ccj il y a 11 mois
Parent
commit
752714811a

+ 1 - 0
src/api/V2/houseSelfCollect/index.js

@@ -141,5 +141,6 @@ export const API_GETQUALITY = '/qualityInspectionManagement/getQualityInspection
 export const API_GET_WAREHOUSE = '/warehouseBaseInfo/selectWarehouseSelfNew'
 
 export const API_GET_GETOKEN = `/warehouseBaseInfo/api/getToken`
+export const API_GET_GETSNAPSHOT = `/warehouseBaseInfo/api/getSnapshot`
 export const API_POST_GEROM = `/photoFrameController/api/getRom`
 export const API_POST_UPLOADSELF = '/paymentManagement/uploadSelfCertificate'

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

@@ -71,6 +71,7 @@ import {
     API_POST_GETVIDEO,
     API_POST_GETCARNUMBER,
     API_GET_GETOKEN,
+    API_GET_GETSNAPSHOT,
     API_POST_GEROM,
     API_GETQUALITY,
     API_POST_UPLOADSELF,
@@ -218,6 +219,7 @@ export const changeCustomer = appRx.post(API_POST_CUSTOMER, errorCatcher, errorH
 export const getwarehouse = appRx.get(API_GET_WAREHOUSE, errorCatcher, errorHandle, filter)
 
 export const getToken = appRx.get(API_GET_GETOKEN, errorCatcher, errorHandle, filter)
+export const getSnapshot = appRx.get(API_GET_GETSNAPSHOT, errorCatcher, errorHandle, filter)
 export const getRom = appRx.post(API_POST_GEROM, errorCatcher, errorHandle, filter)
 // 查询交易量
 export const getquality = appRx.get(API_GETQUALITY, errorCatcher, errorHandle, filter)

+ 85 - 29
src/views/houseSelfCollect/newWeighingManagement.vue

@@ -684,6 +684,7 @@ import {
   newSubmit,
   getbinNumber,
   getToken,
+  getSnapshot,
   getRom
 } from '@/model/houseSelfCollect/index'
 import { addstorageputList } from '@/model/warehouse/index'
@@ -1022,7 +1023,7 @@ export default {
             player = new EZUIKit.EZUIKitPlayer({
               id: 'video-container', // 视频容器ID
               accessToken: accessToken,
-              url: this.monitorUrl2,
+              url: 'ezopen://open.ys7.com/' + this.monitorUrl2 + '.hd.live',
               template: 'standard',
               width: 550,
               height: 350,
@@ -1054,37 +1055,59 @@ export default {
     // callbackPic(data) {
     //   console.log('ressssss', data)
     // },
-    getAPhoto() {
+    async getAPhoto() {
       console.log('getAPhoto')
+      await getSnapshot({
+        param: this.monitorUrl2
+      })
+        .toPromise()
+        .then(response => {
+          console.log('getSnapshot ', response)
+          let b = this.dataURLtoFile(response, 'printImage')
+          let formdata = new FormData()
+          formdata.append('file', b)
+          axios({
+            method: 'post',
+            url: this.global.uploadPath,
+            data: formdata
+          }).then(response => {
+            console.log('response.data.data.url', response.data.data.url)
+            this.photoInfo = response.data.data.url
+            if (this.photoInfo) {
+              this.coverImgList.push(this.photoInfo)
+            }
+          })
+        })
       //   const capCallback = data => {
       //     console.log('ressssss', data)
       //   }
       //   player.handleCapturePicture = this.callbackPic
       //   player.capturePicture('default', this.callbackPic)
       //   player.capturePicture(`${new Date().getTime()}`, capCallback)
-      var capturePicturePromise = player.capturePicture(
-        `${new Date().getTime()}`
-      )
-      capturePicturePromise.then(res => {
-        console.log('promise 获取 数据', res)
-        let b = this.dataURLtoFile(
-          this.transformUint8ArrayToBase64(res.data.fileUint8Array),
-          'printImage'
-        )
-        let formdata = new FormData()
-        formdata.append('file', b)
-        axios({
-          method: 'post',
-          url: this.global.uploadPath,
-          data: formdata
-        }).then(response => {
-          console.log('response.data.data.url', response.data.data.url)
-          this.photoInfo = response.data.data.url
-          if (this.photoInfo) {
-            this.coverImgList.push(this.photoInfo)
-          }
-        })
-      })
+
+      //   var capturePicturePromise = player.capturePicture(
+      //     `${new Date().getTime()}`
+      //   )
+      //   capturePicturePromise.then(res => {
+      //     console.log('promise 获取 数据', res)
+      //     let b = this.dataURLtoFile(
+      //       this.transformUint8ArrayToBase64(res.data.fileUint8Array),
+      //       'printImage'
+      //     )
+      //     let formdata = new FormData()
+      //     formdata.append('file', b)
+      //     axios({
+      //       method: 'post',
+      //       url: this.global.uploadPath,
+      //       data: formdata
+      //     }).then(response => {
+      //       console.log('response.data.data.url', response.data.data.url)
+      //       this.photoInfo = response.data.data.url
+      //       if (this.photoInfo) {
+      //         this.coverImgList.push(this.photoInfo)
+      //       }
+      //     })
+      //   })
     },
     transformUint8ArrayToBase64(array) {
       var binary = ''
@@ -1263,7 +1286,7 @@ export default {
             player = new EZUIKit.EZUIKitPlayer({
               id: 'video-container', // 视频容器ID
               accessToken: accessToken,
-              url: _this.monitorUrl2,
+              url: 'ezopen://open.ys7.com/' + _this.monitorUrl2 + '.hd.live',
               // simple - 极简版; pcLive-pc直播;pcRec-pc回放;mobileLive-移动端直播;mobileRec-移动端回放;security - 安防版;voice-语音版;
               template: 'standard',
               width: 550,
@@ -1602,7 +1625,9 @@ export default {
         }
       }
       console.log(val)
-      this.weighingList.addressUrl = val.addressUrl
+      if (val) {
+        this.weighingList.addressUrl = val.addressUrl
+      }
     },
     cancel() {
       if (this.reader) {
@@ -1810,9 +1835,40 @@ export default {
       //     return
       //   }
       // }
-      if (!this.photoInfo) {
-        this.getAPhoto()
+      let _this = this
+      console.log(player)
+      if (!_this.photoInfo && _this.monitorUrl2) {
+        // this.getAPhoto()
+        await getSnapshot({
+          param: _this.monitorUrl2
+        })
+          .toPromise()
+          .then(response => {
+            console.log('getSnapshot ', response)
+            let b = _this.dataURLtoFile(response, 'printImage')
+            let formdata = new FormData()
+            formdata.append('file', b)
+            axios({
+              method: 'post',
+              url: _this.global.uploadPath,
+              data: formdata
+            })
+              .then(response => {
+                console.log('response.data.data.url', response.data.data.url)
+                _this.photoInfo = response.data.data.url
+                if (_this.photoInfo) {
+                  _this.coverImgList.push(_this.photoInfo)
+                }
+              })
+              .finally(res => {
+                _this.doCommit()
+              })
+          })
+      } else {
+        _this.doCommit()
       }
+    },
+    doCommit() {
       this.$confirm('确定保存检斤信息?', '提示', {
         confirmButtonText: '确定',
         cancelButtonText: '取消',

+ 4 - 3
src/views/houseSelfCollect/weightCheckRecord.vue

@@ -202,9 +202,10 @@
               />
               <img
                 v-if="
-                  scope.row.addressUrl.split(',')[
-                    scope.row.addressUrl.split(',').length - 1
-                  ]
+                  scope.row.addressUrl.split(',').length > 1 &&
+                    scope.row.addressUrl.split(',')[
+                      scope.row.addressUrl.split(',').length - 1
+                    ]
                 "
                 :src="
                   scope.row.addressUrl.split(',')[

+ 35 - 5
src/views/outboundManagement/weighingManagementNew.vue

@@ -721,7 +721,7 @@ import {
   getstaff,
   getReceiptTaskNo
 } from '@/model/warehouse/index'
-import { getToken } from '@/model/houseSelfCollect/index'
+import { getSnapshot, getToken } from '@/model/houseSelfCollect/index'
 import { getcomp } from '@/model/indexRx'
 import axios from 'axios'
 import weightCheckPrint from './component/weightCheckPrint.vue'
@@ -1831,9 +1831,39 @@ export default {
       }
       this.weighingList.compId = localStorage.getItem('ws-pf_compId')
       this.weighingList.warehouseName = this.warehouseName
-      if (!this.photoInfo) {
-        this.getAPhoto()
+      let _this = this
+      if (!_this.photoInfo && _this.monitorUrl2) {
+        // this.getAPhoto()
+        await getSnapshot({
+          param: _this.monitorUrl2
+        })
+          .toPromise()
+          .then(response => {
+            console.log('getSnapshot ', response)
+            let b = _this.dataURLtoFile(response, 'printImage')
+            let formdata = new FormData()
+            formdata.append('file', b)
+            axios({
+              method: 'post',
+              url: _this.global.uploadPath,
+              data: formdata
+            })
+              .then(response => {
+                console.log('response.data.data.url', response.data.data.url)
+                _this.photoInfo = response.data.data.url
+                if (_this.photoInfo) {
+                  _this.coverImgList.push(_this.photoInfo)
+                }
+              })
+              .finally(res => {
+                _this.doCommit()
+              })
+          })
+      } else {
+        _this.doCommit()
       }
+    },
+    doCommit() {
       this.$confirm('确定保存检斤信息?', '提示', {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
@@ -2272,7 +2302,7 @@ export default {
             player = new EZUIKit.EZUIKitPlayer({
               id: 'video-container', // 视频容器ID
               accessToken: accessToken,
-              url: _this.monitorUrl2,
+              url: 'ezopen://open.ys7.com/' + _this.monitorUrl2 + '.hd.live',
               // simple - 极简版; pcLive-pc直播;pcRec-pc回放;mobileLive-移动端直播;mobileRec-移动端回放;security - 安防版;voice-语音版;
               template: 'standard',
               width: 550,
@@ -2817,7 +2847,7 @@ export default {
               player = new EZUIKit.EZUIKitPlayer({
                 id: 'video-container', // 视频容器ID
                 accessToken: accessToken,
-                url: this.monitorUrl2,
+                url: 'ezopen://open.ys7.com/' + this.monitorUrl2 + '.hd.live',
                 template: 'standard',
                 width: 550,
                 height: 350,

+ 8 - 1
src/views/outboundManagement/weighingManagementrecord.vue

@@ -109,17 +109,24 @@
           </span>
         </template>
       </el-table-column>
-      <el-table-column key="15" label="附件" width="200">
+      <el-table-column key="15" label="照片" width="200">
         <template scope="scope">
           <!-- {{scope.row.addressUrl.split(',')[0]}} -->
           <div v-if="scope.row.addressUrl" style="display:flex">
             <img
+              v-if="scope.row.addressUrl.split(',')[0]"
               :src="scope.row.addressUrl.split(',')[0]"
               alt=""
               style="width:100px"
               @click="showImg(scope.row.addressUrl.split(',')[0])"
             />
             <img
+              v-if="
+                scope.row.addressUrl.split(',').length > 1 &&
+                  scope.row.addressUrl.split(',')[
+                    scope.row.addressUrl.split(',').length - 1
+                  ]
+              "
               :src="
                 scope.row.addressUrl.split(',')[
                   scope.row.addressUrl.split(',').length - 1