achao 1 year ago
parent
commit
97bea14ac6

+ 4 - 0
package.json

@@ -55,6 +55,7 @@
     "element-china-area-data": "^5.0.2",
     "element-ui": "^2.15.9",
     "file-saver": "^2.0.5",
+    "flv.js": "^1.6.2",
     "form-making-advanced": "^1.2.6",
     "html2canvas": "^1.3.2",
     "js-base64": "^3.7.2",
@@ -75,6 +76,8 @@
     "sortablejs": "^1.8.4",
     "tinymce": "4.9.2",
     "url-loader": "^4.1.0",
+    "video.js": "^7.21.1",
+    "videojs-flvjs-es6": "^1.0.1",
     "vue": "2.6.10",
     "vue-amap": "^0.5.10",
     "vue-i18n": "7.3.2",
@@ -84,6 +87,7 @@
     "vue-seamless-scroll": "^1.1.17",
     "vuedraggable": "2.20.0",
     "vuex": "3.1.0",
+    "web-see": "^1.1.0",
     "winsea-component-library": "http://maven.zthymaoyi.com/nexus/repository/npm-hosted/winsea-component-library/-/winsea-component-library-1.0.1.tgz",
     "winseaview": "^2.5.11",
     "xe-utils": "^2.3.0",

+ 6 - 2
src/api/V2/houseSelfCollect/index.js

@@ -127,10 +127,14 @@ export const API_POST_TASK_NO = `/weighingManagement/api/changeTaskNo`
     //获取摄像头
 export const API_POST_GETVIDEO = `/photoFrameController/api/devInit`
     //获取车牌号
-export const API_POST_GETCARNUMBER = `/photoFrameController/api/devSetTrigger`
+    // export const API_POST_GETCARNUMBER = `/photoFrameController/api/devSetTrigger`
+export const API_POST_GETCARNUMBER = `/photoFrameController/api/zhuaPai`
     // 换客户
 export const API_POST_CUSTOMER = `/weighingManagement/api/changeCustomer`
     // 丹东港生成入库单
 export const API_POST_DANDONG_ORDER = `/paymentManagement/api/generateOrder`
     // 检查客户送粮量
-export const API_GETQUALITY = '/qualityInspectionManagement/getQualityInspectionManagementMap'
+export const API_GETQUALITY = '/qualityInspectionManagement/getQualityInspectionManagementMap'
+
+export const API_POST_GETOKEN = `/photoFrameController/api/getToken`
+export const API_POST_GEROM = `/photoFrameController/api/getRom`

+ 8 - 2
src/model/houseSelfCollect/index.js

@@ -68,7 +68,9 @@ import {
     API_GET_BASEID,
     API_POST_GETVIDEO,
     API_POST_GETCARNUMBER,
-    API_POST_CUSTOMER
+    API_POST_CUSTOMER,
+    API_POST_GETOKEN,
+    API_POST_GEROM
 } from '@/api/V2/houseSelfCollect'
 //客户管理列表
 export const getCustomerManage = appRx.get(API_GET_CUSTOMER_MANAGE, errorCatcher, errorHandle, filter)
@@ -205,4 +207,8 @@ export const getVideo = appRx.post(API_POST_GETVIDEO, errorCatcher, errorHandle,
     // 获取车牌号
 export const getCarNumber = appRx.post(API_POST_GETCARNUMBER, errorCatcher, errorHandle, filter)
     // 换客户
-export const changeCustomer = appRx.post(API_POST_CUSTOMER, errorCatcher, errorHandle, filter)
+export const changeCustomer = appRx.post(API_POST_CUSTOMER, errorCatcher, errorHandle, filter)
+
+// 获取token
+export const getToken = appRx.post(API_POST_GETOKEN, errorCatcher, errorHandle, filter)
+export const getRom = appRx.post(API_POST_GEROM, errorCatcher, errorHandle, filter)

+ 2 - 1
src/store/getters.js

@@ -63,7 +63,8 @@ const getters = {
     adminId: state => state.app.adminId,
     videoSrc1: state => state.user.videoSrc1,
     videoSrc2: state => state.user.videoSrc2,
-    carNumber: state => state.user.carNumber,
+    carNumber1: state => state.user.carNumber1,
+    carNumber2: state => state.user.carNumber2,
 
 }
 export default getters

+ 7 - 3
src/store/modules/user.js

@@ -15,7 +15,8 @@ import {
 import { groupBy } from 'lodash'
 
 const state = {
-    videoSrc1: '',
+    carNumber1: '',
+    carNumber2: '',
     token: '',
     name: '',
     avatar: '',
@@ -58,8 +59,11 @@ const mutations = {
     SET_VIDEOSRC2: (state, videoSrc2) => {
         state.videoSrc2 = videoSrc2
     },
-    SET_CARNUMBER: (state, carNumber) => {
-        state.carNumber = carNumber
+    SET_CARNUMBER1: (state, carNumber1) => {
+        state.carNumber1 = carNumber1
+    },
+    SET_CARNUMBER2: (state, carNumber2) => {
+        state.carNumber2 = carNumber2
     },
 
     SET_INTRODUCTION: (state, introduction) => {

+ 14 - 24
src/utils/webSocket.js

@@ -10,10 +10,14 @@ export const whetherWebSocket1 = (ip, id) => {
     var that = this
     if ('WebSocket' in window) {
         if (process.env.NODE_ENV === 'production') {
-            websocket1 = new WebSocket('wss://www.zthymaoyi.com/wss/websocket/?adminId=84f62127b7384dcdbaeaddfe460329fc')
+            // websocket1 = new WebSocket('wss://www.zthymaoyi.com/wss/websocket/?adminId=84f62127b7384dcdbaeaddfe460329fc')
+            websocket1 = new WebSocket('wss://apitest2.eliangeyun.com/wss/websocket/' + ip)
+
         } else {
             // that.websocket = new WebSocket('ws://192.168.110.82:8080/')
-            websocket1 = new WebSocket('ws://192.168.110.82:8090/ws/websocket/' + id + ip)
+            // websocket1 = new WebSocket('ws://192.168.110.82:8090/ws/websocket/' + ip)
+            websocket1 = new WebSocket('wss://apitest2.eliangeyun.com/wss/websocket/' + ip)
+
         }
         initWebSocket1()
     } else {
@@ -37,15 +41,9 @@ function initWebSocket1() {
             // console.log('服务端返回:' + event)
             // console.log('event.data', event.data)
             let msg = event.data.split('$')
-            if (msg[0] == 'SHIPIN') {
-                store.commit('user/SET_VIDEOSRC1', 'data:image/jpg;base64,' + msg[1]);
-            } else {
-                console.log(msg)
-                if (msg[1].length > 7) {
-                    msg[1] = msg[1].substring(0, 7)
-                }
-                store.commit('user/SET_CARNUMBER', msg[1]);
-            }
+            console.log('number1', msg[0])
+            store.commit('user/SET_CARNUMBER1', msg[0]);
+            // }
 
             // console.log('执行成功')
         }
@@ -59,10 +57,11 @@ export const whetherWebSocket2 = (ip, id) => {
     var that = this
     if ('WebSocket' in window) {
         if (process.env.NODE_ENV === 'production') {
-            websocket2 = new WebSocket('wss://www.zthymaoyi.com/wss/websocket/?adminId=84f62127b7384dcdbaeaddfe460329fc')
+            // websocket2 = new WebSocket('wss://www.zthymaoyi.com/wss/websocket/?adminId=84f62127b7384dcdbaeaddfe460329fc')
+            websocket2 = new WebSocket('wss://apitest2.eliangeyun.com/wss/websocket/' + ip)
         } else {
             // that.websocket = new WebSocket('ws://192.168.110.82:8080/')
-            websocket2 = new WebSocket('ws://192.168.110.82:8090/ws/websocket/' + id + ip)
+            websocket2 = new WebSocket('wss://apitest2.eliangeyun.com/wss/websocket/' + ip)
         }
         initWebSocket2()
     } else {
@@ -81,21 +80,12 @@ function initWebSocket2() {
         }
         // 收到消息的回调
     websocket2.onmessage = event => {
-            debugger
             // 根据服务器推送的消息做自己的业务处理
             // console.log('服务端返回:' + event)
             // console.log('event.data', event.data)
             let msg = event.data.split('$')
-            if (msg[0] == 'SHIPIN') {
-                store.commit('user/SET_VIDEOSRC2', 'data:image/jpg;base64,' + msg[1]);
-            } else {
-                console.log(msg)
-                if (msg[1].length > 7) {
-                    msg[1] = msg[1].substring(0, 7)
-                }
-                console.log(msg[1])
-                store.commit('user/SET_CARNUMBER', msg[1]);
-            }
+            console.log('number2', msg[0])
+            store.commit('user/SET_CARNUMBER2', msg[0]);
             // console.log('执行成功')
         }
         // 连接关闭的回调

+ 435 - 301
src/views/houseSelfCollect/newWeighingManagement.vue

@@ -29,12 +29,19 @@
           </div> -->
           <!-- <div class="videoImg">
             <div class="videoImg-row">
-              <img :src="imgSrc1.videoSrc1" alt="" class="" style="width:100%"/>
-              <el-button @click='positionPlace(1)' type="primary">定位车辆</el-button>
+                <video id="videoElement" autoplay muted width="50%"></video>
+              <video id="videoElement1" autoplay muted width="50%"></video>
             </div>
+
             <div class="videoImg-row">
-              <img :src="imgSrc1.videoSrc2" alt="" class="" style="width:100%"/>
-              <el-button @click='positionPlace(2)' type="primary">定位车辆</el-button>
+              <div class="carnumber-style">
+                <el-button @click='positionPlace(1)' type="primary" class="btn">定位车辆</el-button>
+                <div class="number">车牌号1:{{ $store.state.user.carNumber1 }}</div>
+              </div>
+              <div class="carnumber-style">
+                <el-button @click='positionPlace(2)' type="primary" class="btn">定位车辆</el-button>
+                <div class="number">车牌号2:{{ $store.state.user.carNumber2 }}</div>
+              </div>
             </div>
           </div> -->
           <!-- <img :src="imgSrc1.videoSrc.videoSrc2" alt="" class="" style="width:100%"/> -->
@@ -190,7 +197,7 @@
                 </el-option>
               </el-select>
               <el-button @click='refreshClick(1)' type="primary">刷新</el-button>
-              <el-button @click='refreshClick' type="primary">{{ timer ? refresh : '自动刷新' }}</el-button>
+              <el-button @click='refreshClick' type="primary">{{ timer? refresh: '自动刷新' }}</el-button>
               <!-- <el-checkbox v-model="checked">默认</el-checkbox> -->
             </div>
             <div class="screen frame">
@@ -274,7 +281,8 @@
             </el-option>
           </el-select>
         </div>
-        <div v-if="warehouseName=='鲅鱼圈金信库'||warehouseName=='白城内陆港'||warehouseName=='杜尔伯特家禾库'||warehouseName=='甘南宏旗库'||warehouseName=='洮南新友谊兴旺库'||warehouseName=='哈尔滨依兰库'||warehouseName=='山东园丰库'">
+        <div
+          v-if="warehouseName == '鲅鱼圈金信库' || warehouseName == '白城内陆港' || warehouseName == '杜尔伯特家禾库' || warehouseName == '甘南宏旗库' || warehouseName == '洮南新友谊兴旺库' || warehouseName == '哈尔滨依兰库' || warehouseName == '山东园丰库'">
           <div class="print-type-ew">
             <el-checkbox v-model="checked" @change="changeEw">打印额外票据</el-checkbox>
             <el-checkbox v-model="ddchecked" @change="changeEwDD">单独打印额外票据</el-checkbox>
@@ -308,6 +316,7 @@
   </div>
 </template>
 <script>
+import flvjs from 'flv.js';
 import {
   tare,
   grossWeight,
@@ -318,18 +327,15 @@ import {
   selectWarehouseSelf,
   getsettleaccout,
   newSubmit,
-  getVideo,
-  getCarNumber
+  getToken,
+  getRom,
 } from '@/model/houseSelfCollect/index'
-import {
-  addstorageputList
-} from '@/model/warehouse/index'
 import weightCheckPrint from './component/weightCheckPrint.vue'
 import BalanceAlert from '@/components/balanceAlert'
 import html2canvas from 'html2canvas'
 import axios from 'axios'
 import configText from '../../../vue.config.js'
-import {whetherWebSocket1,whetherWebSocket2} from '@/utils/webSocket';
+import { whetherWebSocket1, whetherWebSocket2 } from '@/utils/webSocket';
 export default {
   components: {
     weightCheckPrint,
@@ -360,7 +366,7 @@ export default {
               if (_saomaData.managementType) {
                 this.inWarehouseType = _saomaData.managementType
               }
-            } else if (localStorage.getItem('houseSelfCollect_house1')) {debugger
+            } else if (localStorage.getItem('houseSelfCollect_house1')) {
               // this.ip1 = 
               // this.ip2 = 
               this.warehouseName = JSON.parse(localStorage.getItem('houseSelfCollect_house1')).value
@@ -374,7 +380,6 @@ export default {
                 }
               }
             } else {
-              debugger
               localStorage.setItem('houseSelfCollect_house1', JSON.stringify({
                 value: this.warehouseList[0].warehouseName,
                 warehouseId: this.warehouseList[0].id,
@@ -382,8 +387,9 @@ export default {
                 No: this.warehouseList[0].commonWarehouseNo,
                 allowEdit: this.warehouseList[0].allowEdit,
                 compId: localStorage.getItem('ws-pf_compId'),
-                ip1:this.warehouseList[0].shexiang1,
-                ip2:this.warehouseList[0].shexiang2
+                ip1: this.warehouseList[0].shexiang1,
+                ip2: this.warehouseList[0].shexiang2
+
               }))
               this.warehouseName = this.warehouseList[0].warehouseName
               localStorage.setItem('ck', this.warehouseName)
@@ -439,9 +445,18 @@ export default {
   },
   data() {
     return {
-      warehouseInfo:{},
-      carNumber:this.$store.state.user.carNumber,
-      imgSrc1:this.$store.state.user,
+      player: null,
+      // VideoSrc: '',
+      // VideoSrc1:'',
+      ip1: '',
+      ip2: '',
+      rom1: '',
+      rom2: '',
+      warehouseInfo: {},
+      carNumber1: this.$store.state.user.carNumber1,
+      carNumber2: this.$store.state.user.carNumber2,
+      // // carNumber: '辽HLZ126',
+      // imgSrc1: this.$store.state.user,
       timer: '',
       refresh: 60,
       isShowBalance: false,
@@ -581,7 +596,7 @@ export default {
       companyNameEWOptions: [{
         value: '天津建源供应链管理有限公司',
         label: '天津建源供应链管理有限公司'
-      },{
+      }, {
         value: '厦门建发物产有限公司',
         label: '厦门建发物产有限公司'
       }],
@@ -605,137 +620,138 @@ export default {
     }
   },
   mounted() {
+
     localStorage.setItem('serverIp', configText.devServer.proxy['/pb'].target)
     if (localStorage.getItem('compNameoptions')) {
-      var company=JSON.parse(localStorage.getItem('compNameoptions'))
-        
-        var extra=company.filter((item)=>{
-          return item!='黑龙江中天昊元贸易有限公司'
-          &&item!='黑龙江利润元粮食贸易有限公司'
-          &&item!= '黑龙江众利合粮食贸易有限公司'
-          &&item!='黑龙江鑫满仓粮食贸易有限公司'
-          &&item!='黑龙江谷香粮食贸易有限公司'
-          &&item!='黑龙江秋收有限公司'
-          &&item!= '黑龙江欣洋粮食贸易有限公司'
-          &&item!='黑龙江益储益运粮食贸易有限公司'
-          &&item!='黑龙江启兴粮食贸易有限公司'
-        })
-        if(extra.length>0){
-          this.companyNameOptions=[
+      var company = JSON.parse(localStorage.getItem('compNameoptions'))
+
+      var extra = company.filter((item) => {
+        return item != '黑龙江中天昊元贸易有限公司'
+          && item != '黑龙江利润元粮食贸易有限公司'
+          && item != '黑龙江众利合粮食贸易有限公司'
+          && item != '黑龙江鑫满仓粮食贸易有限公司'
+          && item != '黑龙江谷香粮食贸易有限公司'
+          && item != '黑龙江秋收有限公司'
+          && item != '黑龙江欣洋粮食贸易有限公司'
+          && item != '黑龙江益储益运粮食贸易有限公司'
+          && item != '黑龙江启兴粮食贸易有限公司'
+      })
+      if (extra.length > 0) {
+        this.companyNameOptions = [
           {
-          value: '黑龙江中天昊元贸易有限公司',
-          label: '黑龙江中天昊元贸易有限公司'
-        }, {
-          value: '黑龙江利润元粮食贸易有限公司',
-          label: '黑龙江利润元粮食贸易有限公司'
-        }, {
-          value: '黑龙江众利合粮食贸易有限公司',
-          label: '黑龙江众利合粮食贸易有限公司'
-        }, {
-          value: '黑龙江鑫满仓粮食贸易有限公司',
-          label: '黑龙江鑫满仓粮食贸易有限公司'
-        },{
-          value: '黑龙江欣洋粮食贸易有限公司',
-          label: '黑龙江欣洋粮食贸易有限公司'
-        },{
-          value: '黑龙江谷香粮食贸易有限公司',
-          label: '黑龙江谷香粮食贸易有限公司'
-        },{
-          value: '黑龙江秋收有限公司',
-          label: '黑龙江秋收有限公司'
-        },  {
-          value: '黑龙江益储益运粮食贸易有限公司',
-          label: '黑龙江益储益运粮食贸易有限公司'
-        }, {
-          value: '黑龙江启兴粮食贸易有限公司',
-          label: '黑龙江启兴粮食贸易有限公司'
-        }]
-        
-          this.ewCustomerOptions= [
+            value: '黑龙江中天昊元贸易有限公司',
+            label: '黑龙江中天昊元贸易有限公司'
+          }, {
+            value: '黑龙江利润元粮食贸易有限公司',
+            label: '黑龙江利润元粮食贸易有限公司'
+          }, {
+            value: '黑龙江众利合粮食贸易有限公司',
+            label: '黑龙江众利合粮食贸易有限公司'
+          }, {
+            value: '黑龙江鑫满仓粮食贸易有限公司',
+            label: '黑龙江鑫满仓粮食贸易有限公司'
+          }, {
+            value: '黑龙江欣洋粮食贸易有限公司',
+            label: '黑龙江欣洋粮食贸易有限公司'
+          }, {
+            value: '黑龙江谷香粮食贸易有限公司',
+            label: '黑龙江谷香粮食贸易有限公司'
+          }, {
+            value: '黑龙江秋收有限公司',
+            label: '黑龙江秋收有限公司'
+          }, {
+            value: '黑龙江益储益运粮食贸易有限公司',
+            label: '黑龙江益储益运粮食贸易有限公司'
+          }, {
+            value: '黑龙江启兴粮食贸易有限公司',
+            label: '黑龙江启兴粮食贸易有限公司'
+          }]
+
+        this.ewCustomerOptions = [
           {
-          value: '天津建源供应链管理有限公司',
-          label: '天津建源供应链管理有限公司'
-        },{
-          value: '黑龙江中天昊元贸易有限公司',
-          label: '黑龙江中天昊元贸易有限公司'
-        }, {
-          value: '黑龙江利润元粮食贸易有限公司',
-          label: '黑龙江利润元粮食贸易有限公司'
-        }, {
-          value: '黑龙江众利合粮食贸易有限公司',
-          label: '黑龙江众利合粮食贸易有限公司'
-        }, {
-          value: '黑龙江鑫满仓粮食贸易有限公司',
-          label: '黑龙江鑫满仓粮食贸易有限公司'
-        },{
-          value: '黑龙江欣洋粮食贸易有限公司',
-          label: '黑龙江欣洋粮食贸易有限公司'
-        },{
-          value: '黑龙江谷香粮食贸易有限公司',
-          label: '黑龙江谷香粮食贸易有限公司'
-        },{
-          value: '黑龙江秋收有限公司',
-          label: '黑龙江秋收有限公司'
-        },  {
-          value: '黑龙江益储益运粮食贸易有限公司',
-          label: '黑龙江益储益运粮食贸易有限公司'
-        }, {
-          value: '黑龙江启兴粮食贸易有限公司',
-          label: '黑龙江启兴粮食贸易有限公司'
-        }]
-          this.companyNameEWOptions=[
+            value: '天津建源供应链管理有限公司',
+            label: '天津建源供应链管理有限公司'
+          }, {
+            value: '黑龙江中天昊元贸易有限公司',
+            label: '黑龙江中天昊元贸易有限公司'
+          }, {
+            value: '黑龙江利润元粮食贸易有限公司',
+            label: '黑龙江利润元粮食贸易有限公司'
+          }, {
+            value: '黑龙江众利合粮食贸易有限公司',
+            label: '黑龙江众利合粮食贸易有限公司'
+          }, {
+            value: '黑龙江鑫满仓粮食贸易有限公司',
+            label: '黑龙江鑫满仓粮食贸易有限公司'
+          }, {
+            value: '黑龙江欣洋粮食贸易有限公司',
+            label: '黑龙江欣洋粮食贸易有限公司'
+          }, {
+            value: '黑龙江谷香粮食贸易有限公司',
+            label: '黑龙江谷香粮食贸易有限公司'
+          }, {
+            value: '黑龙江秋收有限公司',
+            label: '黑龙江秋收有限公司'
+          }, {
+            value: '黑龙江益储益运粮食贸易有限公司',
+            label: '黑龙江益储益运粮食贸易有限公司'
+          }, {
+            value: '黑龙江启兴粮食贸易有限公司',
+            label: '黑龙江启兴粮食贸易有限公司'
+          }]
+        this.companyNameEWOptions = [
           {
-          value: '天津建源供应链管理有限公司',
-          label: '天津建源供应链管理有限公司'
-        },{
-          value: '黑龙江中天昊元贸易有限公司',
-          label: '黑龙江中天昊元贸易有限公司'
-        }, {
-          value: '黑龙江利润元粮食贸易有限公司',
-          label: '黑龙江利润元粮食贸易有限公司'
-        }, {
-          value: '黑龙江众利合粮食贸易有限公司',
-          label: '黑龙江众利合粮食贸易有限公司'
-        }, {
-          value: '黑龙江鑫满仓粮食贸易有限公司',
-          label: '黑龙江鑫满仓粮食贸易有限公司'
-        },{
-          value: '黑龙江欣洋粮食贸易有限公司',
-          label: '黑龙江欣洋粮食贸易有限公司'
-        },{
-          value: '黑龙江谷香粮食贸易有限公司',
-          label: '黑龙江谷香粮食贸易有限公司'
-        },{
-          value: '黑龙江秋收有限公司',
-          label: '黑龙江秋收有限公司'
-        },  {
-          value: '黑龙江益储益运粮食贸易有限公司',
-          label: '黑龙江益储益运粮食贸易有限公司'
-        }, {
-          value: '黑龙江启兴粮食贸易有限公司',
-          label: '黑龙江启兴粮食贸易有限公司'
-        }]
-           if(localStorage.getItem('print_company_name')){
-            this.companyName=localStorage.getItem('print_company_name')
-          }else{
-            this.companyName=extra[0]
-          }
-          if(localStorage.getItem('print_company_name_ew')){
-            this.companyNameEW=localStorage.getItem('print_company_name_ew')
-          }else{
-            this.companyNameEW=extra[0]
-          }
-          if(localStorage.getItem('print_customer_name_ew')){
-            this.ewCustomer=localStorage.getItem('print_customer_name_ew')
-          }else{
-            this.ewCustomer=extra[0]
-          }
-          for (let i = 0; i < extra.length; i++) {
-            this.ewCustomerOptions.push({value: extra[i],label:extra[i]})
-            this.companyNameOptions.push({value: extra[i],label:extra[i]})
-            this.companyNameEWOptions.push({value: extra[i],label:extra[i]})
-          }
+            value: '天津建源供应链管理有限公司',
+            label: '天津建源供应链管理有限公司'
+          }, {
+            value: '黑龙江中天昊元贸易有限公司',
+            label: '黑龙江中天昊元贸易有限公司'
+          }, {
+            value: '黑龙江利润元粮食贸易有限公司',
+            label: '黑龙江利润元粮食贸易有限公司'
+          }, {
+            value: '黑龙江众利合粮食贸易有限公司',
+            label: '黑龙江众利合粮食贸易有限公司'
+          }, {
+            value: '黑龙江鑫满仓粮食贸易有限公司',
+            label: '黑龙江鑫满仓粮食贸易有限公司'
+          }, {
+            value: '黑龙江欣洋粮食贸易有限公司',
+            label: '黑龙江欣洋粮食贸易有限公司'
+          }, {
+            value: '黑龙江谷香粮食贸易有限公司',
+            label: '黑龙江谷香粮食贸易有限公司'
+          }, {
+            value: '黑龙江秋收有限公司',
+            label: '黑龙江秋收有限公司'
+          }, {
+            value: '黑龙江益储益运粮食贸易有限公司',
+            label: '黑龙江益储益运粮食贸易有限公司'
+          }, {
+            value: '黑龙江启兴粮食贸易有限公司',
+            label: '黑龙江启兴粮食贸易有限公司'
+          }]
+        if (localStorage.getItem('print_company_name')) {
+          this.companyName = localStorage.getItem('print_company_name')
+        } else {
+          this.companyName = extra[0]
+        }
+        if (localStorage.getItem('print_company_name_ew')) {
+          this.companyNameEW = localStorage.getItem('print_company_name_ew')
+        } else {
+          this.companyNameEW = extra[0]
+        }
+        if (localStorage.getItem('print_customer_name_ew')) {
+          this.ewCustomer = localStorage.getItem('print_customer_name_ew')
+        } else {
+          this.ewCustomer = extra[0]
+        }
+        for (let i = 0; i < extra.length; i++) {
+          this.ewCustomerOptions.push({ value: extra[i], label: extra[i] })
+          this.companyNameOptions.push({ value: extra[i], label: extra[i] })
+          this.companyNameEWOptions.push({ value: extra[i], label: extra[i] })
         }
+      }
     }
     this.isShowBalance = true
     var _saomaData = JSON.parse(localStorage.getItem('saoma_data')) //判断是否扫码进来的
@@ -747,7 +763,6 @@ export default {
       .toPromise()
       .then((response) => {
         this.warehouseList = response
-        let _ip1,_ip2;
         if (_saomaData) { //缓存中有值,证明扫码进来的
           if (_saomaData.managementType) {
             this.inWarehouseType = _saomaData.managementType
@@ -762,15 +777,16 @@ export default {
           this.number = _saomaData.number
           for (var i = 0; i < response.length; i++) {
             if (this.warehouseName == this.warehouseList[i].warehouseName) {
-              _ip1 = this.warehouseList[i].shexiang1
-              _ip2 = this.warehouseList[i].shexiang2
+              this.ip1 = this.warehouseList[i].shexiang1
+              this.ip2 = this.warehouseList[i].shexiang2
+              this.rom1 = this.warehouseList[i].rom1
+              this.rom2 = this.warehouseList[i].rom2
               break
             }
           }
 
           localStorage.removeItem('saoma_data'); //第一次进来结束后清除缓存
         } else if (localStorage.getItem('houseSelfCollect_house1')) {
-          debugger
           this.warehouseName = JSON.parse(localStorage.getItem('houseSelfCollect_house1')).value
           for (var i = 0; i < response.length; i++) {
             if (this.warehouseName == this.warehouseList[i].warehouseName) {
@@ -778,8 +794,10 @@ export default {
               this.monitorUrl1 = this.warehouseList[i].monitorUrl1
               this.monitorUrl2 = this.warehouseList[i].monitorUrl2
               this.allowEdit = this.warehouseList[i].allowEdit
-              _ip1 = this.warehouseList[i].shexiang1
-              _ip2 = this.warehouseList[i].shexiang2
+              this.ip1 = this.warehouseList[i].shexiang1
+              this.ip2 = this.warehouseList[i].shexiang2
+              this.rom1 = this.warehouseList[i].rom1
+              this.rom2 = this.warehouseList[i].rom2
               break
             }
           }
@@ -798,8 +816,10 @@ export default {
           this.allowEdit = this.warehouseList[0].allowEdit
           this.monitorUrl1 = this.warehouseList[0].monitorUrl1
           this.monitorUrl2 = this.warehouseList[0].monitorUrl2
-          _ip1 = this.warehouseList[0].shexiang1
-          _ip2 = this.warehouseList[0].shexiang2
+          this.ip1 = this.warehouseList[0].shexiang1
+          this.ip2 = this.warehouseList[0].shexiang2
+          this.rom1 = this.warehouseList[0].rom1
+          this.rom2 = this.warehouseList[0].rom2
         }
 
         this.deptBudgetList.warehouseName = this.warehouseName
@@ -814,7 +834,8 @@ export default {
         } else if (this.tpyeNo == 2) {
           this.information = '皮重'
         }
-        // this.getVideos(_ip1,_ip2)
+
+        // this.getVideos(this.ip1, this.ip2, this.rom1, this.rom2)
         this.getList()
       })
   },
@@ -836,38 +857,131 @@ export default {
 
   },
   methods: {
-    positionPlace(type){
-      getCarNumber({
-        flag:type
-      })
-          .toPromise()
-          .then((response) => {
-            console.log(111)
-            console.log(response)
-        
-        })
-        .catch((response) => { 
-
-        })
+    play() {
+      this.flvPlayer.play();
+    },
+    positionPlace(type) {
+      let _number = ''
+      if(type ==1){
+        _number = this.carNumber1
+      }else{
+        _number = this.carNumber2
+      }
       console.log('定位车辆')
+      console.log(this.carList)
+      for (let i = 0; i < this.carList.length; i++) {
+        if (_number == this.carList[i].carNumber) {
+          this.setCurrent(this.carList[2])
+          return
+        } else {
+          this.$message({
+            message: '未识别到车辆信息',
+            type: 'warning'
+          });
+        }
+      }
+
+      // getCarNumber({
+      //   flag: type,
+      //   ip1: this.ip1,
+      //   ip2: this.ip2
+      // })
+      //   .toPromise()
+      //   .then((response) => {
+      //     console.log(111)
+      //     console.log(response)
+
+      //   })
+      //   .catch((response) => {
+
+      //   })
+      // console.log('定位车辆')
+      // console.log(this.carList)
+      // for (let i = 0; i < this.carList.length; i++) {
+      //   if ('黑AU4139' == this.carList[i].carNumber) {
+      //     this.setCurrent(this.carList[2])
+      //   } else {
+      //     this.$message({
+      //       message: '未识别到车辆信息',
+      //       type: 'warning'
+      //     });
+      //   }
+      // }
     },
-    getVideos(ip1,ip2) {debugger
-      if(ip1&&ip2){
-        whetherWebSocket1(ip1,localStorage.getItem('ws-pf_userId'))
-      whetherWebSocket2(ip2,localStorage.getItem('ws-pf_userId'))
-      getVideo({
-        ip1:ip1,
-        ip2:ip2,
-      })
-          .toPromise()
-          .then((response) => {
-            console.log(111)
-        
-        })
-        .catch((response) => { 
+    getVideos(ip1, ip2, rom1, rom2) {
+      if (rom1) {
+        if (flvjs.isSupported()) {
+          getToken({ romId: rom1 })
+            .toPromise()
+            .then((response) => {
+              console.log(111)
+              // let _accessToken = response.split('$$')[0]
+              let _playUrl = response.split('$$')[1]
+              // this.VideoSrc = _playUrl
+              let videoElement = document.getElementById('videoElement');
+              this.flvPlayer = flvjs.createPlayer({
+                type: 'flv',
+                isLive: true,
+                hasAudio: false,
+                url: _playUrl
+              });
+              this.flvPlayer.attachMediaElement(videoElement);
+              this.flvPlayer.load();
+              this.flvPlayer.play();
 
-        })
+            })
+            .catch((response) => {
+
+            })
+        }
+        whetherWebSocket1(ip1, localStorage.getItem('ws-pf_userId'))
       }
+      if (rom2) {
+          if (flvjs.isSupported()) {
+            getRom({ romId: rom2 })
+              .toPromise()
+              .then((response) => {
+                console.log(111)
+                // let _accessToken = response.split('$$')[0]
+                let _playUrl = response.split('$$')[1]
+                // this.VideoSrc1 = _playUrl
+                let videoElement1 = document.getElementById('videoElement1');
+                this.flvPlayer = flvjs.createPlayer({
+                  type: 'flv',
+                  isLive: true,
+                  hasAudio: false,
+                  url: _playUrl
+                });
+                this.flvPlayer.attachMediaElement(videoElement1);
+                this.flvPlayer.load();
+                this.flvPlayer.play();
+
+              })
+              .catch((response) => {
+
+              })
+          }
+
+          whetherWebSocket2(ip2, localStorage.getItem('ws-pf_userId'))
+        }
+
+      // getVideo({
+      //   ip1:ip1,
+      //   ip2:ip2,
+      //   userId:localStorage.getItem('ws-pf_userId')
+      // })
+      //     .toPromise()
+      //     .then((response) => {
+      //       console.log(111)
+
+      //   })
+      //   .catch((response) => { 
+
+      //   })
+
+
+
+
     },
     refreshClick(type) {
       let that = this
@@ -993,43 +1107,43 @@ export default {
       this.isShowPrintType = false
     },
     async typePrintClick(type) {
-        localStorage.setItem('print_company_name',this.companyName)
-        localStorage.setItem('print_company_name_ew',this.companyNameEW)
-        localStorage.setItem('print_customer_name_ew',this.ewCustomer)
-        getPrint({
-            id: this.idPrint
-          })
-          .toPromise()
-          .then((response) => {
-            
-           localStorage.removeItem('print_in_data')
-            this.dialogDataList = [] //点击确认时先清空要打印的数组
-            this.dialogData = response
-            if (response.compName == '黑龙江秋收有限公司') {
-              this.dialogData.compName = '黑龙江中天昊元贸易有限公司'
-            }else{
-                this.dialogData.compName = this.companyName
-              }
-            if (this.checked) {
-              this.dialogDataList.push(this.dialogData)
-              var _datas = JSON.stringify(this.dialogData)
-              _datas = JSON.parse(_datas)
-              _datas.compName = this.companyNameEW;
-              _datas.customer = this.ewCustomer
-              this.dialogDataList.push(_datas)
-            } else if (this.ddchecked) {
-              _datas = this.dialogData
-              _datas.compName = this.companyNameEW;
-              _datas.customer = this.ewCustomer
-              this.dialogDataList.push(_datas)
-            } else {
-              this.dialogData.compName = this.companyName
-              this.dialogDataList.push(this.dialogData)
-            }
-            
-            localStorage.setItem('print_in_data',JSON.stringify(this.dialogDataList).replace(/%/g, 'baifenhao'))
-            // window.open('../../../../static/weightCheck.html?type=2&tableData=' + JSON.stringify(this.dialogDataList).replace(/%/g, 'baifenhao'))
-            window.open('../../../../static/weightCheck.html?type=2&tableData=' )
+      localStorage.setItem('print_company_name', this.companyName)
+      localStorage.setItem('print_company_name_ew', this.companyNameEW)
+      localStorage.setItem('print_customer_name_ew', this.ewCustomer)
+      getPrint({
+        id: this.idPrint
+      })
+        .toPromise()
+        .then((response) => {
+
+          localStorage.removeItem('print_in_data')
+          this.dialogDataList = [] //点击确认时先清空要打印的数组
+          this.dialogData = response
+          if (response.compName == '黑龙江秋收有限公司') {
+            this.dialogData.compName = '黑龙江中天昊元贸易有限公司'
+          } else {
+            this.dialogData.compName = this.companyName
+          }
+          if (this.checked) {
+            this.dialogDataList.push(this.dialogData)
+            var _datas = JSON.stringify(this.dialogData)
+            _datas = JSON.parse(_datas)
+            _datas.compName = this.companyNameEW;
+            _datas.customer = this.ewCustomer
+            this.dialogDataList.push(_datas)
+          } else if (this.ddchecked) {
+            _datas = this.dialogData
+            _datas.compName = this.companyNameEW;
+            _datas.customer = this.ewCustomer
+            this.dialogDataList.push(_datas)
+          } else {
+            this.dialogData.compName = this.companyName
+            this.dialogDataList.push(this.dialogData)
+          }
+
+          localStorage.setItem('print_in_data', JSON.stringify(this.dialogDataList).replace(/%/g, 'baifenhao'))
+          // window.open('../../../../static/weightCheck.html?type=2&tableData=' + JSON.stringify(this.dialogDataList).replace(/%/g, 'baifenhao'))
+          window.open('../../../../static/weightCheck.html?type=2&tableData=')
           // this.printBig("", this.radio)
         })
         .catch((response) => { })
@@ -1046,18 +1160,22 @@ export default {
             count: this.warehouseList[i].count,
             No: this.warehouseList[i].commonWarehouseNo,
             allowEdit: this.warehouseList[i].allowEdit,
-            compId: localStorage.getItem('ws-pf_compId')
+            compId: localStorage.getItem('ws-pf_compId'),
+            rom1: this.warehouseList[i].rom1,
+            rom2: this.warehouseList[i].rom2
           }))
           this.cangid = this.warehouseList[i].id
           this.monitorUrl1 = this.warehouseList[i].monitorUrl1
           this.monitorUrl2 = this.warehouseList[i].monitorUrl2
+          this.rom1 = this.warehouseList[i].rom1
+          this.rom2 = this.warehouseList[i].rom2
           this.allowEdit = this.warehouseList[i].allowEdit
           if (this.allowEdit == 0) {
             this.disabled = true
           } else if (this.allowEdit == 1) {
             this.disabled = false
           }
-          this.getVideos(this.warehouseList[i].shexiang1,this.warehouseList[i].shexiang2)
+          // this.getVideos(this.warehouseList[i].shexiang1, this.warehouseList[i].shexiang2, this.rom1, this.rom2)
         }
       }
       this.getList()
@@ -1236,18 +1354,18 @@ export default {
         console.log(this.mList)
 
         var _saomaData = JSON.parse(localStorage.getItem('saoma_data'))
-       
-       if (_saomaData) {
-         let _array = JSON.parse(JSON.stringify(this.mList))
-         for (let i = 0; i < this.mList.length; i++) {
-           if (this.mList[i].number == _saomaData.number) {
-             _array.splice(i, 1)
-             _array.unshift(this.mList[i]);
-           }
-         }
-         this.mList = _array
-         localStorage.removeItem('saoma_data'); //第一次进来结束后清除缓存
-       }
+
+        if (_saomaData) {
+          let _array = JSON.parse(JSON.stringify(this.mList))
+          for (let i = 0; i < this.mList.length; i++) {
+            if (this.mList[i].number == _saomaData.number) {
+              _array.splice(i, 1)
+              _array.unshift(this.mList[i]);
+            }
+          }
+          this.mList = _array
+          localStorage.removeItem('saoma_data'); //第一次进来结束后清除缓存
+        }
         this.carList = this.mList
         this.carList1 = this.mListTotal
         for (let i = 0; i < this.mList.length; i++) {
@@ -1276,7 +1394,7 @@ export default {
         this.index = 1
         console.log(this.pList)
         var _saomaData = JSON.parse(localStorage.getItem('saoma_data'))
-       
+
         if (_saomaData) {
           let _array = JSON.parse(JSON.stringify(this.pList))
           for (let i = 0; i < this.pList.length; i++) {
@@ -1852,68 +1970,68 @@ export default {
                 //毛检保存前进行校验
                 var arr = {}
                 // if (this.purchasePriceList.length != 0) {
-                  for (let i = 0; i < this.purchasePriceList.length; i++) {
-                    if (
-                      this.weighingList.goodsName ==
-                      this.purchasePriceList[i].goodsName
-                    ) {
-                      arr = JSON.parse(JSON.stringify(this.purchasePriceList[i]))
-                      arr.saleLimit = this.purchasePriceList[i].saleLimit
-                    }
+                for (let i = 0; i < this.purchasePriceList.length; i++) {
+                  if (
+                    this.weighingList.goodsName ==
+                    this.purchasePriceList[i].goodsName
+                  ) {
+                    arr = JSON.parse(JSON.stringify(this.purchasePriceList[i]))
+                    arr.saleLimit = this.purchasePriceList[i].saleLimit
                   }
-                  // console.log('1111111',arr)
-                  if (Object.keys(arr).length != 0) {
-                    getamount({
-                      compId: localStorage.getItem('ws-pf_compId'),
-                      customerNumberCard: this.weighingList.customerNumberCard,
-                      goodsName: this.weighingList.goodsName,
-                    })
-                      .toPromise()
-                      .then((response) => {
-                        //累计售粮超上限不能完成毛检保存
-                        let count = (
-                          arr.saleLimit -
-                          response / 1000
-                        ).toFixed(2)
-                        if (count - this.weighingList.grossWeight / 1000 < 0) {
-                          this.$alert(
-                            '该客户累计销售' +
-                            this.weighingList.goodsName +
-                            (response / 1000).toFixed(2) +
-                            '吨,还可售粮' +
-                            count +
-                            '吨',
-                            '提示', {
-                            confirmButtonText: '确定',
-                            // callback: (action) => {
-                            //   this.$message({
-                            //     type: 'info',
-                            //     message: `累计售粮已超出上限`,
-                            //   })
-                            // },
+                }
+                // console.log('1111111',arr)
+                if (Object.keys(arr).length != 0) {
+                  getamount({
+                    compId: localStorage.getItem('ws-pf_compId'),
+                    customerNumberCard: this.weighingList.customerNumberCard,
+                    goodsName: this.weighingList.goodsName,
+                  })
+                    .toPromise()
+                    .then((response) => {
+                      //累计售粮超上限不能完成毛检保存
+                      let count = (
+                        arr.saleLimit -
+                        response / 1000
+                      ).toFixed(2)
+                      if (count - this.weighingList.grossWeight / 1000 < 0) {
+                        this.$alert(
+                          '该客户累计销售' +
+                          this.weighingList.goodsName +
+                          (response / 1000).toFixed(2) +
+                          '吨,还可售粮' +
+                          count +
+                          '吨',
+                          '提示', {
+                          confirmButtonText: '确定',
+                          // callback: (action) => {
+                          //   this.$message({
+                          //     type: 'info',
+                          //     message: `累计售粮已超出上限`,
+                          //   })
+                          // },
+                        })
+                      }
+                      //累计售粮没有超上限完成毛检保存
+                      grossWeight(this.weighingList)
+                        .toPromise()
+                        .then((response) => {
+                          if (this.reader) {
+                            this.reader.cancel()
+                          }
+                          this.$notify.success({
+                            title: '成功',
+                            message: '保存成功',
                           })
-                        } 
-                          //累计售粮没有超上限完成毛检保存
-                          grossWeight(this.weighingList)
-                            .toPromise()
-                            .then((response) => {
-                              if (this.reader) {
-                                this.reader.cancel()
-                              }
-                              this.$notify.success({
-                                title: '成功',
-                                message: '保存成功',
-                              })
-                              this.getList()
-                            })
-                      })
-                    return
-                  }
-                  else {
-                    this.$alert(this.weighingList.goodsName + '的收购价格正在审核中,请审核通过后进行操作', {
-                      confirmButtonText: '确定',
+                          this.getList()
+                        })
                     })
-                  }
+                  return
+                }
+                else {
+                  this.$alert(this.weighingList.goodsName + '的收购价格正在审核中,请审核通过后进行操作', {
+                    confirmButtonText: '确定',
+                  })
+                }
                 // }
                 // else {
                 //   this.$message.error('该仓库未设置收购价格或收购价格正在审核中,请审核通过后进行操作')
@@ -2060,7 +2178,7 @@ export default {
             // console.log(this.inWarehouseType)
             //贸易入库需要再走入库接口
             if (this.inWarehouseType == 1) {
-               //贸易入库皮检
+              //贸易入库皮检
               getsettleaccout({//查看结算单
                 id: this.weighingList.warehouseInOutId
               }).toPromise().then((response) => {
@@ -2111,8 +2229,8 @@ export default {
                     this
                       .warehouseName == '哈尔滨依兰库' || this
                         .warehouseName == '白城内陆港' || this
-                          .warehouseName == '山东园丰库'|| this
-                          .warehouseName == '杜尔伯特家禾库'||this.warehouseName=='甘南宏旗库'||this.warehouseName=='洮南新友谊兴旺库')) {
+                          .warehouseName == '山东园丰库' || this
+                            .warehouseName == '杜尔伯特家禾库' || this.warehouseName == '甘南宏旗库' || this.warehouseName == '洮南新友谊兴旺库')) {
                     if (this.weighingList.seller && this.weighingList.buyer) {
                       let cang = {}
                       cang.value = this.weighingList.seller
@@ -2192,7 +2310,7 @@ export default {
                   .then((response) => {
                     //累计售粮超上限不能完成皮检保存
                     let count = (
-                       arr2.saleLimit - response / 1000
+                      arr2.saleLimit - response / 1000
                     ).toFixed(2)
                     if (count - this.weighingList.netWeight / 1000 < 0) {
                       this.$alert(
@@ -2211,7 +2329,7 @@ export default {
                               message: `累计售粮已超出上限`,
                             })
                           },
-                      })
+                        })
                     }
                     else {
                       //累计售粮没有超上限完成皮检保存
@@ -2857,14 +2975,30 @@ export default {
   width: 300px;
   height: 300px
 }
-.videoImg{
-  width: 60%;
+
+.videoImg {
   // display: flex;
   // flex-direction: column;
   // align-items: center;
   // justify-content: center;
 }
-.videoImg-row{
+
+.videoImg-row {
+  display: flex;
+  margin-bottom: 20px;
+}
+
+.carnumber-style {
+  // background: red;
   display: flex;
+  flex-direction: column;
+  justify-content: center;
+  align-items: center;
+
+  width: 50%;
+
+  .btn {
+    margin-bottom: 10px;
+  }
 }
 </style>