gjy 3 rokov pred
rodič
commit
34aaf64cd7

+ 2 - 0
src/api/V2/warehouse/index.js

@@ -108,4 +108,6 @@ export const API_GET_WAREHOUSE_ALL = '/warehouseBaseInfo/allWarehouse'
 export const API_SEND_BACK ='/warehouseInOutInfo/returnWarehouse'
 //删除
 export const API_DELETE_WAREHOUSE ='/warehouseInOutInfo/api/deleteWarehouse'
+//查看自己负责的仓库
+export const API_GET_WAREHOUSENAME='/warehouseBaseInfo/selectWarehouseSelf'
 

+ 5 - 1
src/model/warehouse/index.js

@@ -53,7 +53,8 @@ import {
     API_POST_WAREHOUSE_INWEIGHT,
     API_GET_WAREHOUSE_ALL,
     API_SEND_BACK,
-    API_DELETE_WAREHOUSE
+    API_DELETE_WAREHOUSE,
+    API_GET_WAREHOUSENAME
 } from '@/api/V2/warehouse'
 // import { app } from 'electron'
 // 列表
@@ -161,4 +162,7 @@ export const  getWarehouseAll = appRx.get(API_GET_WAREHOUSE_ALL, errorHandle, fi
 export const sendback = appRx.post(API_SEND_BACK,errorCatcher, errorHandle, filter)
 //删除
 export const postdeletewarehouse = appRx.post(API_DELETE_WAREHOUSE,errorCatcher, errorHandle, filter)
+//查看自己负责的仓库
+export const getwarehousName = appRx.get(API_GET_WAREHOUSENAME,errorCatcher, errorHandle, filter)
+
 

+ 5 - 3
src/views/houseSelfCollect/newWeighingManagement.vue

@@ -1306,7 +1306,8 @@
                                 warehousing.deductionWeight /= 1000
                                 warehousing.statusFlag = 1
                                 warehousing.inOutFlag =
-                                  warehousing.id = warehousing.warehouseInOutId
+                                warehousing.id = warehousing.warehouseInOutId
+                                 warehousing.warehouseInOutDetail.id = warehousing.inOutDetailId
                                 addstorageputList(warehousing).toPromise().then((response) => {
                                   if (response == 'OK') {
                                     this.getList()
@@ -1345,6 +1346,7 @@
                       warehousing.inOutFlag = 2
                       delete warehousing.status
                       warehousing.id = warehousing.warehouseInOutId
+                      warehousing.warehouseInOutDetail.id = warehousing.inOutDetailId
                       addstorageputList(warehousing).toPromise().then((response) => {
                         if (response == 'OK') {
                           this.getList()
@@ -1749,7 +1751,7 @@
       border-radius: 4px;
       min-width: 355px;
       width: 40%;
-      min-height: 685px;
+      min-height: 760px;
 
       .but {
         position: absolute;
@@ -1807,7 +1809,7 @@
     padding: 10px;
     margin-left: 20px;
     border-radius: 4px;
-    min-height: 685px;
+    min-height: 760px;
   }
 
   .screen {

+ 142 - 138
src/views/outboundManagement/weighingManagementNew.vue

@@ -675,6 +675,10 @@
           this.weighingList.tare = data
         }
       },
+      openPort() {
+        this.$refs.weightChild.openPort()
+      },
+
       listclick(row) {
         this.id = row.id
         getweighing({
@@ -1273,144 +1277,144 @@
           },
         }
       },
-      async openPort() {
-        console.log('openPort', navigator)
-        if ('serial' in navigator) {
-          //   if (!this.$store.state.app.reader) {
-          // The Web Serial API is supported.
-          console.log('the Web Serial API is supported.')
-          console.log(this.param)
-          const port = await navigator.serial.requestPort()
-          await port.open({
-            baudRate: this.param,
-          }) // set baud rate
-          this.reader = port.readable.getReader()
-          console.log('beforeReader', port)
-          console.log('beforeReader', this.reader)
-          this.$store.dispatch('app/setReader', this.reader)
-          //   } else {
-          //     console.log('afterport', this.$store.state.app.reader)
-          //     this.reader = this.$store.state.app.reader
-          //   }
-          // 监听来自串行设备的数据
-          while (true) {
-            const {
-              value,
-              done
-            } = await this.reader.read()
-            // console.log("value",value);
-            if (done) {
-              // 允许稍后关闭串口。
-              this.reader.releaseLock()
-              break
-            }
-            var result = ''
-            //2。获取16进制字符串
-            // var receData = HexConvert.ByteToString(value);
-            // console.log("receData",receData);
-            var flag = false
-            // for(var i=0;i<value.length;i++){
-            // 	var tmp = String.fromCharCode(value[i])
-            // 	if(tmp == '+'){
-            // 	flag = true
-            // 	}
-            // 	if(flag && result.length <6 && tmp != '+'){
-            // 	result += tmp
-            // 	}
-            // }
-            // if(this.tpyeNo != 2){
-            // 	this.weighingList.grossWeight = parseInt(result)
-            // }
-            // else{
-            // 	this.weighingList.tare = parseInt(result)
-            // }
-            if (
-              (this.warehouseName &&
-                (this.warehouseName == '山东诸城迈饶库' ||
-                  this.warehouseName == '克东千红库')) ||
-              this.warehouseName == '鲅鱼圈祥腾库' ||
-              this.warehouseName == '哈尔滨依兰库' ||
-              this.warehouseName == '龙江金信库'
-            ) {
-              for (var i = 0; i < value.length; i++) {
-                var tmp = String.fromCharCode(value[i])
-                if (tmp == '+') {
-                  flag = true
-                }
-                if (flag && result.length < 6 && tmp != '+') {
-                  result += tmp
-                }
-              }
-              if (this.tpyeNo != 2) {
-                if (parseInt(result) || parseInt(result) == 0) {
-                  this.weighingList.weight = parseInt(result)
-                }
-              } else {
-                if (parseInt(result) || parseInt(result) == 0) {
-                  this.weighingList.weight = parseInt(result)
-                }
-              }
-            } else if (
-              this.warehouseName &&
-              (this.warehouseName == '顺诚粮库' ||
-                this.warehouseName == '鲅鱼圈金信库')
-            ) {
-              for (var i = value.length - 1; i >= 0; i--) {
-                var tmp = String.fromCharCode(value[i])
-                console.log(tmp)
-                if (String.fromCharCode(value[0]) == '.') {
-                  flag = true
-                }
-                if (flag && result.length < 9 && tmp != '=' && tmp != '.') {
-                  result += tmp
-                }
-              }
-              if (this.tpyeNo != 2) {
-                if (parseInt(result) || parseInt(result) == 0) {
-                  this.weighingList.weight = parseInt(result)
-                }
-              } else {
-                if (parseInt(result) || parseInt(result) == 0) {
-                  this.weighingList.weight = parseInt(result)
-                }
-              }
-            } else {
-              for (var i = 0; i < value.length; i++) {
-                var tmp = String.fromCharCode(value[i])
-                if (value[0] != 49 && value[0] != 2) {
-                  break
-                }
-                if (tmp == String.fromCharCode(32)) {
-                  flag = true
-                }
-                if (flag && result.length < 7 && tmp != String.fromCharCode(32)) {
-                  // if(i-1 >=0 &&tmp == String.fromCharCode(48) && value[i-1] == 32){
-                  // 	continue
-                  // }
-                  // if(i-2 >=0 &&tmp == String.fromCharCode(48) && value[i-2] == 32){
-                  // 	continue
-                  // }
-                  result += tmp
-                }
-              }
-              if (this.tpyeNo != 2) {
-                if (parseInt(result) || parseInt(result) == 0) {
-                  this.weighingList.weight = parseInt(result) * 100
-                }
-              } else {
-                if (parseInt(result) || parseInt(result) == 0) {
-                  this.weighingList.weight = parseInt(result) * 100
-                }
-              }
-            }
-            // setTimeout(1000)
-            // value 是一个 Uint8Array
-          }
-          await port.close()
-        } else {
-          console.log('the Web Serial API is not supported.', navigator)
-        }
-      },
+      // async openPort() {
+        // console.log('openPort', navigator)
+        // if ('serial' in navigator) {
+        //   //   if (!this.$store.state.app.reader) {
+        //   // The Web Serial API is supported.
+        //   console.log('the Web Serial API is supported.')
+        //   console.log(this.param)
+        //   const port = await navigator.serial.requestPort()
+        //   await port.open({
+        //     baudRate: this.param,
+        //   }) // set baud rate
+        //   this.reader = port.readable.getReader()
+        //   console.log('beforeReader', port)
+        //   console.log('beforeReader', this.reader)
+        //   this.$store.dispatch('app/setReader', this.reader)
+        //   //   } else {
+        //   //     console.log('afterport', this.$store.state.app.reader)
+        //   //     this.reader = this.$store.state.app.reader
+        //   //   }
+        //   // 监听来自串行设备的数据
+        //   while (true) {
+        //     const {
+        //       value,
+        //       done
+        //     } = await this.reader.read()
+        //     // console.log("value",value);
+        //     if (done) {
+        //       // 允许稍后关闭串口。
+        //       this.reader.releaseLock()
+        //       break
+        //     }
+        //     var result = ''
+        //     //2。获取16进制字符串
+        //     // var receData = HexConvert.ByteToString(value);
+        //     // console.log("receData",receData);
+        //     var flag = false
+        //     // for(var i=0;i<value.length;i++){
+        //     // 	var tmp = String.fromCharCode(value[i])
+        //     // 	if(tmp == '+'){
+        //     // 	flag = true
+        //     // 	}
+        //     // 	if(flag && result.length <6 && tmp != '+'){
+        //     // 	result += tmp
+        //     // 	}
+        //     // }
+        //     // if(this.tpyeNo != 2){
+        //     // 	this.weighingList.grossWeight = parseInt(result)
+        //     // }
+        //     // else{
+        //     // 	this.weighingList.tare = parseInt(result)
+        //     // }
+        //     if (
+        //       (this.warehouseName &&
+        //         (this.warehouseName == '山东诸城迈饶库' ||
+        //           this.warehouseName == '克东千红库')) ||
+        //       this.warehouseName == '鲅鱼圈祥腾库' ||
+        //       this.warehouseName == '哈尔滨依兰库' ||
+        //       this.warehouseName == '龙江金信库'
+        //     ) {
+        //       for (var i = 0; i < value.length; i++) {
+        //         var tmp = String.fromCharCode(value[i])
+        //         if (tmp == '+') {
+        //           flag = true
+        //         }
+        //         if (flag && result.length < 6 && tmp != '+') {
+        //           result += tmp
+        //         }
+        //       }
+        //       if (this.tpyeNo != 2) {
+        //         if (parseInt(result) || parseInt(result) == 0) {
+        //           this.weighingList.weight = parseInt(result)
+        //         }
+        //       } else {
+        //         if (parseInt(result) || parseInt(result) == 0) {
+        //           this.weighingList.weight = parseInt(result)
+        //         }
+        //       }
+        //     } else if (
+        //       this.warehouseName &&
+        //       (this.warehouseName == '顺诚粮库' ||
+        //         this.warehouseName == '鲅鱼圈金信库')
+        //     ) {
+        //       for (var i = value.length - 1; i >= 0; i--) {
+        //         var tmp = String.fromCharCode(value[i])
+        //         console.log(tmp)
+        //         if (String.fromCharCode(value[0]) == '.') {
+        //           flag = true
+        //         }
+        //         if (flag && result.length < 9 && tmp != '=' && tmp != '.') {
+        //           result += tmp
+        //         }
+        //       }
+        //       if (this.tpyeNo != 2) {
+        //         if (parseInt(result) || parseInt(result) == 0) {
+        //           this.weighingList.weight = parseInt(result)
+        //         }
+        //       } else {
+        //         if (parseInt(result) || parseInt(result) == 0) {
+        //           this.weighingList.weight = parseInt(result)
+        //         }
+        //       }
+        //     } else {
+        //       for (var i = 0; i < value.length; i++) {
+        //         var tmp = String.fromCharCode(value[i])
+        //         if (value[0] != 49 && value[0] != 2) {
+        //           break
+        //         }
+        //         if (tmp == String.fromCharCode(32)) {
+        //           flag = true
+        //         }
+        //         if (flag && result.length < 7 && tmp != String.fromCharCode(32)) {
+        //           // if(i-1 >=0 &&tmp == String.fromCharCode(48) && value[i-1] == 32){
+        //           // 	continue
+        //           // }
+        //           // if(i-2 >=0 &&tmp == String.fromCharCode(48) && value[i-2] == 32){
+        //           // 	continue
+        //           // }
+        //           result += tmp
+        //         }
+        //       }
+        //       if (this.tpyeNo != 2) {
+        //         if (parseInt(result) || parseInt(result) == 0) {
+        //           this.weighingList.weight = parseInt(result) * 100
+        //         }
+        //       } else {
+        //         if (parseInt(result) || parseInt(result) == 0) {
+        //           this.weighingList.weight = parseInt(result) * 100
+        //         }
+        //       }
+        //     }
+        //     // setTimeout(1000)
+        //     // value 是一个 Uint8Array
+        //   }
+        //   await port.close()
+        // } else {
+        //   console.log('the Web Serial API is not supported.', navigator)
+        // }
+      // },
       find() {
         this.getList()
       },

+ 4 - 2
src/views/warehousenew/warehouseManagementList.vue

@@ -218,7 +218,7 @@
             <!--仓库名称-->
             <el-form-item label="仓库名称" span="1" prop="warehouseName">
               <el-select v-model="parameter.warehouseName" placeholder="请选择仓库名称" filterable clearable>
-                <el-option v-for="item in warehouseXiaLa" :key="item.warehouseName" :label="item.warehouseName" :value="item.warehouseName" />
+                <el-option v-for="item in warehouseAllXiaLa" :key="item.warehouseName" :label="item.warehouseName" :value="item.warehouseName" />
               </el-select>
             </el-form-item>
             <el-form-item label="增量比例(%)" v-if="headerText == '打印记录'">
@@ -250,6 +250,7 @@
     getResponsible,
     deletewarehouse,
     postInWeight,
+    getwarehousName
   } from '@/model/warehouse/index'
   import mapDrag from '@/components/mapdrag/warehouseMap'
   import {
@@ -368,6 +369,7 @@
           this.$message.error('请选择所要打印的仓库')
           return
         }
+        this.parameter.warehouseName = this.parameter.warehouseName.replace("(临)","")
         if (this.headerText == '导出记录') {
           if (this.parameter.radio == 3) {
             const {
@@ -957,7 +959,7 @@
                 this.responsible = response[0].staffName
               })
           // 仓库名称
-            xiala({
+            getwarehousName({
               compId: localStorage.getItem('ws-pf_compId'),
               warehouseType: this.warehouseType,
             })