浏览代码

更新 sdy

zhongtianhaoyuan 3 年之前
父节点
当前提交
2c03032239
共有 27 个文件被更改,包括 406 次插入230 次删除
  1. 2 2
      public/static/inspection.html
  2. 4 2
      public/static/payprint.html
  3. 1 0
      src/store/getters.js
  4. 9 1
      src/store/modules/app.js
  5. 3 1
      src/styles/media.scss
  6. 9 0
      src/views/houseSelfCollect/inspectInfo.vue
  7. 6 3
      src/views/houseSelfCollect/inspectionManagement.vue
  8. 107 103
      src/views/houseSelfCollect/paymentManagement.vue
  9. 4 2
      src/views/houseSelfCollect/settlement.vue
  10. 8 1
      src/views/houseSelfCollect/weighingManagement.vue
  11. 44 26
      src/views/houseSelfCollect/weightCheck.vue
  12. 0 1
      src/views/outboundManagement/collectionManagement.vue
  13. 22 9
      src/views/outboundManagement/weighing.vue
  14. 5 1
      src/views/tranManagement/tranManagementTransporHairRespond.vue
  15. 2 2
      src/views/tranManagement/tranManagementthirdpartnarFeedback.vue
  16. 5 2
      src/views/tranManagement/tranManagementthirdpartnarFeedbackLook.vue
  17. 1 1
      src/views/tranManagement/tranManagementthirdpartnarReceiving.vue
  18. 1 1
      src/views/tranManagement/tranManagementthirdpartnarReceivingLook.vue
  19. 14 6
      src/views/warehouse/warehouseManagementAdd.vue
  20. 17 7
      src/views/warehouse/warehouseManagementEdit.vue
  21. 39 12
      src/views/warehouse/warehouseManagementGross.vue
  22. 30 28
      src/views/warehouse/warehouseManagementList.vue
  23. 14 2
      src/views/warehouse/warehouseManagementLook.vue
  24. 3 2
      src/views/warehouse/warehouseManagementNoWeight.vue
  25. 24 10
      src/views/warehouse/warehouseManagementNoWeightIn.vue
  26. 15 1
      src/views/warehouse/warehouseManagementNoWeightOut.vue
  27. 17 4
      src/views/warehouse/warehouseManagementTare.vue

+ 2 - 2
public/static/inspection.html

@@ -159,10 +159,10 @@
             <td v-if="tableData.confirm == '1'" class="col col-bgc">单价(元/公斤)</td>
             <td v-else class="col col-bgc">待定单价(元/公斤)</td>
             <td class="col">{{tableData.tidalGrainPrice}}</td>
-            <td class="col " v-if="printData.type == '潮粮'">
+            <td class="col " v-if="tableData.type == '潮粮'">
               {{tableData.tidalGrainPrice}}
             </td>
-            <td class="col " v-if="printData.type == '干粮'">
+            <td class="col " v-if="tableData.type == '干粮'">
               {{tableData.dryGrainPrice}}
             </td>
           </tr>

+ 4 - 2
public/static/payprint.html

@@ -14,7 +14,9 @@
         height: 88vh;
         position: relative;
       }
-
+      .simple{
+        height: 120vh !important;
+      }
       .content {
         width: 1000px;
         margin: auto;
@@ -548,7 +550,7 @@
           </div>
           <img :src="printData.paymentScreenshot" class="paymentScreenshot" />
         </div>
-        <div class="center part1" v-if="isShowPrintType3">
+        <div class="center part1" v-if="isShowPrintType3" :class="!selectPrint? 'simple':''">
           <div class="header1">{{ printData.compName}}结算凭证</div>
           <div class="line"></div>
           <div class="line"></div>

+ 1 - 0
src/store/getters.js

@@ -45,6 +45,7 @@ const getters = {
   systemWarnNum: state => state.app.systemWarnNum,
   baseInfo: state => state.user.baseInfo, // 设置系统基础信息
   deptBudgetList: state => state.app.deptBudgetList,
+  reader: state => state.app.reader,
   guideInfo: state => state.user.guideInfo, // 新手指引信息
   sparepartSp: state => state.app.sparepartSp, // 搜索状态
   sparepartMa: state => state.app.sparepartMa, // 搜索状态

+ 9 - 1
src/store/modules/app.js

@@ -21,7 +21,8 @@ const state = {
   // 产品-体系运行-预警
   warnNum: 0,
   // 产品-体系运行-流转报表(待处理个数)
-  circulationNum: 0
+  circulationNum: 0,
+  reader:''
 }
 
 const mutations = {
@@ -88,6 +89,10 @@ const mutations = {
   SET_DEPTBUDGETLIST: (state, deptBudgetList) => {
     state.deptBudgetList = deptBudgetList
   },
+  SET_READER: (state, reader) => {
+    state.reader = reader
+  },
+  
 }
 
 const actions = {
@@ -115,6 +120,9 @@ const actions = {
   setdeptBudgetList ({ commit }, params) {
     commit('SET_DEPTBUDGETLIST', params)
   },
+  setReader ({ commit }, params) {
+    commit('SET_READER', params)
+  },
   setMapQueryParams ({ commit }, params) {
     commit('SET_SPAREPARTMAP_QUERY', params)
   },

+ 3 - 1
src/styles/media.scss

@@ -61,7 +61,7 @@ background: #E8ECF6;
 }
 
 .winseaview-main {
-  position: absolute;
+  position: relative;
   left: 200px;
   padding: 0;
   // padding-bottom: 20px;
@@ -78,6 +78,8 @@ background: #E8ECF6;
   // padding-bottom: 22px;
   width: 100%;
   box-sizing: border-box;
+  padding: 10px;
+  box-sizing: border-box;
 }
 
 .winseaview-footer {

+ 9 - 0
src/views/houseSelfCollect/inspectInfo.vue

@@ -418,6 +418,9 @@
                     .toPromise()
                     .then((response) => {
                       this.inspect = response
+                      if (response.compName == '黑龙江秋收有限公司') {
+               				 this.inspect.compName = '黑龙江中天昊元贸易有限公司'
+              					}
                     })
                   this.isShowPrint = true
                   //打印
@@ -473,6 +476,9 @@
                     .toPromise()
                     .then((response) => {
                       this.inspect = response
+                      if (response.compName == '黑龙江秋收有限公司') {
+               				 this.inspect.compName = '黑龙江中天昊元贸易有限公司'
+              					}
                     })
                   this.isShowPrint = true
                 })
@@ -499,6 +505,9 @@
                     .toPromise()
                     .then((response) => {
                       this.inspect = response
+                      if (response.compName == '黑龙江秋收有限公司') {
+               				 this.inspect.compName = '黑龙江中天昊元贸易有限公司'
+              					}
                     })
                   this.isShowPrint = true
                 })

+ 6 - 3
src/views/houseSelfCollect/inspectionManagement.vue

@@ -334,6 +334,7 @@
 					.then((response) => {
 						console.log(response)
 						this.inspect = response.records
+						
 						this.deptBudgetTotal = response.total
 						// this.$forceUpdate();
 					})
@@ -347,15 +348,17 @@
 					.toPromise()
 					.then((response) => {
 						let printString = row.id+","+1
-							// id :row.id,
-							// scanning:1
-						
 							getQRcode({printString}).toPromise()
 					          .then((res) => {
 								this.isShowPrint = true
 								this.printData = response
 								this.printData.qrCodeUrl = res
 							  })
+								this.isShowPrint = true
+								this.printData = response
+						    if (response.compName == '黑龙江秋收有限公司') {
+               				 this.printData.compName = '黑龙江中天昊元贸易有限公司'
+              					}
 						// window.location.href="../../../static/inspection.html?dataList="+JSON.stringify(response)
 					})
 			},

+ 107 - 103
src/views/houseSelfCollect/paymentManagement.vue

@@ -71,7 +71,8 @@
         <ws-button type="primary" @click="payment" v-hasPermission="`acquisitionManagement.acquisitionPay.pay`">付款
         </ws-button>
         <!-- v-hasPermission="`acquisitionManagement.acquisitionPay.finace`" -->
-        <ws-button type="primary" @click="selectPrint(1)" v-hasPermission="`acquisitionManagement.acquisitionPay.finace`">财务批量打印
+        <ws-button type="primary" @click="selectPrint(1)"
+          v-hasPermission="`acquisitionManagement.acquisitionPay.finace`">财务批量打印
         </ws-button>
       </template>
       <template slot="right"> </template>
@@ -147,7 +148,8 @@
               (scope.row.status != '待结算' && !scope.row.approveStatus)
             " @click="print1(scope.row)" v-hasPermission="`acquisitionManagement.acquisitionPay.finace`">财务打印
           </el-button>
-          <el-button @click="previewPayOrder(scope.row)" class="my-pre" v-hasPermission="`acquisitionManagement.acquisitionPay.pay`">预览付款单
+          <el-button @click="previewPayOrder(scope.row)" class="my-pre"
+            v-hasPermission="`acquisitionManagement.acquisitionPay.pay`">预览付款单
           </el-button>
           <el-button type="danger" v-if="
               (!scope.row.approveStatus ||
@@ -193,36 +195,22 @@
       <!-- <div v-for="(item, index) in payImg" :key="index" class="pay_img">
         <img :src="item" alt class="img" />
       </div> -->
-      <el-upload
-  action="https://www.zthymaoyi.com/upload/admin"
-  list-type="picture-card"
-  :on-success="handleAvatarSuccess1"
-  :file-list='payImg'
-  :limit='1'>
-    <i slot="default" class="el-icon-plus"></i>
-    <div slot="file" slot-scope="{file}">
-      <img
-        class="el-upload-list__item-thumbnail"
-        :src="file.url" alt=""
-      >
-      
-      <span class="el-upload-list__item-actions"> 
-        <span
-          class="el-upload-list__item-preview"
-          @click="handlePictureCardPreview(file)"
-        >
-          <i class="el-icon-zoom-in"></i>
-        </span>
-        <span
-          v-if="!disabled"
-          class="el-upload-list__item-delete"
-          @click="_handleRemove(file)"
-        >
-          <i class="el-icon-delete"></i>
-        </span>
-      </span>
-    </div>
-</el-upload>
+      <el-upload action="https://www.zthymaoyi.com/upload/admin" list-type="picture-card"
+        :on-success="handleAvatarSuccess1" :file-list='payImg' :limit='1'>
+        <i slot="default" class="el-icon-plus"></i>
+        <div slot="file" slot-scope="{file}">
+          <img class="el-upload-list__item-thumbnail" :src="file.url" alt="">
+
+          <span class="el-upload-list__item-actions">
+            <span class="el-upload-list__item-preview" @click="handlePictureCardPreview(file)">
+              <i class="el-icon-zoom-in"></i>
+            </span>
+            <span v-if="!disabled" class="el-upload-list__item-delete" @click="_handleRemove(file)">
+              <i class="el-icon-delete"></i>
+            </span>
+          </span>
+        </div>
+      </el-upload>
       <!-- <el-upload class="avatar-uploader"  action="https://www.zthymaoyi.com/upload/admin" :show-file-list="false"
                 :on-success="handleAvatarSuccess1" :on-remove="_handleRemove">
                 <img @mouseout='imgshow' @mouseover="deleteshow=true" v-if="payImg" :src="payImg" class="avatar" />
@@ -251,8 +239,8 @@
       </el-dialog>
     </div>
     <el-dialog :visible.sync="dialogVisible">
-  <img width="100%" :src="dialogImageUrl" alt="">
-</el-dialog>
+      <img width="100%" :src="dialogImageUrl" alt="">
+    </el-dialog>
     <!--客户信息-->
     <el-dialog width="50%" title="客户信息" :visible.sync="customerInfo" :append-to-body="true" :close="customerclose">
       <el-form class="customer">
@@ -308,17 +296,13 @@
         <el-button @click="customerclose">取 消</el-button>
       </div>
     </el-dialog>
-   <el-dialog width="50%" title="付款回执单" :visible.sync="isPreviewPayOrder" :close="paymentReceiptClose">
-     <div class="no-messege" v-if="!paymentReceipt">暂未上传付款回执单</div>  
-     <el-image
-          class="my-img"
-          ref="myImg"
-          v-if="paymentReceipt"
-          :src="paymentReceipt"
-          :preview-src-list="[paymentReceipt]">
+    <el-dialog width="50%" title="付款回执单" :visible.sync="isPreviewPayOrder" :close="paymentReceiptClose">
+      <div class="no-messege" v-if="!paymentReceipt">暂未上传付款回执单</div>
+      <el-image class="my-img" ref="myImg" v-if="paymentReceipt" :src="paymentReceipt"
+        :preview-src-list="[paymentReceipt]">
       </el-image>
     </el-dialog>
-    
+
   </div>
 </template>
 <script>
@@ -359,8 +343,8 @@
     watch: {},
     data() {
       return {
-        paymentReceipt:'',
-        isPreviewPayOrder:false,
+        paymentReceipt: '',
+        isPreviewPayOrder: false,
         printType: 0,
         isShowPrintType1: true,
         isShowPrintType2: true,
@@ -370,7 +354,7 @@
         form: {},
         formLabelWidth: '300px',
         invoicing: '',
-        deleteshow:false,
+        deleteshow: false,
         customerlist: {
           payeeAddressUrls: [],
         },
@@ -412,8 +396,8 @@
         printData: {},
         warehouse: [],
         disabled: false,
-        dialogImageUrl:'',
-        dialogVisible:false,
+        dialogImageUrl: '',
+        dialogVisible: false,
         value1: '', //付款日期
         modification: [],
         userJurisdiction: true,
@@ -447,22 +431,21 @@
       })
     },
     methods: {
-      imgshow(){
-        this.deleteshow=false
+      imgshow() {
+        this.deleteshow = false
         console.log(11111)
       },
       handlePictureCardPreview(file) {
         this.dialogImageUrl = file.url;
         this.dialogVisible = true;
       },
-      previewPayOrder(val){
-      this.paymentReceipt = val.paymentScreenshot
-      this.isPreviewPayOrder = true
-     console.log(val.paymentScreenshot)
-        
-      },
-      paymentReceiptClose(){
+      previewPayOrder(val) {
+        this.paymentReceipt = val.paymentScreenshot
+        this.isPreviewPayOrder = true
+        console.log(val.paymentScreenshot)
+
       },
+      paymentReceiptClose() {},
       datechange() {
         this.getList()
       },
@@ -726,6 +709,9 @@
                   })
                   .toPromise()
                   .then((response) => {
+                    if (response.compName == '黑龙江秋收有限公司') {
+                      response.compName = '黑龙江中天昊元贸易有限公司'
+                    }
                     index1++
                     let date = new Date()
                     response.currentTime =
@@ -767,6 +753,9 @@
               // val 是数组中每个接口返回的值 res.data
               console.log('两个接口全部加载完成', val1, val2);
               this.printData = val2.data
+              if (val2.data.compName == '黑龙江秋收有限公司') {
+                this.printData.compName = '黑龙江中天昊元贸易有限公司'
+              }
               this.isShowPrint = true
               // if(this.printData.solidGrainPrice){
               //   this.printData.solidGrainPrice = (this.printData.tidalGrainPrice * this.printData.netWeight)/this.printData.pureWeight
@@ -853,16 +842,18 @@
         //   })
         //   return
         // } else {
-          this.showPayImgs = true
-          this.id=row.id
-          var arr=row.paymentScreenshot.split('$')
-          console.log(arr)
-          this.payImg=[]
-          for (let i = 0; i < arr.length; i++) {
-            if(arr[i]!=''){
-              this.payImg.push({url:arr[i]})
-            }
+        this.showPayImgs = true
+        this.id = row.id
+        var arr = row.paymentScreenshot.split('$')
+        console.log(arr)
+        this.payImg = []
+        for (let i = 0; i < arr.length; i++) {
+          if (arr[i] != '') {
+            this.payImg.push({
+              url: arr[i]
+            })
           }
+        }
         // }
       },
       getWarehouse() {
@@ -879,24 +870,24 @@
               this.warehouseName = this.$route.query.warehouseName
               this.warehouseNameKey = this.$route.query.warehouseName
             } else {
-                for(let index = 0 ; index < this.warehouseList.length ; index++){
-                  
-                    if (_wareHouse && _wareHouse.value == this.warehouseList[index].warehouseName) {
-                          this.warehouseName = this.warehouseList[index].warehouseName
-                          this.warehouseNameKey = this.warehouseList[index].warehouseName
-                          return
+              for (let index = 0; index < this.warehouseList.length; index++) {
+
+                if (_wareHouse && _wareHouse.value == this.warehouseList[index].warehouseName) {
+                  this.warehouseName = this.warehouseList[index].warehouseName
+                  this.warehouseNameKey = this.warehouseList[index].warehouseName
+                  return
+                } else {
+                  this.warehouseNameKey = this.warehouseList[0].id
+                  if (this.warehouseName) {
+                    this.warehouseNameKey = this.WAREHOUSE[3].payname
                   } else {
-                    this.warehouseNameKey = this.warehouseList[0].id
-                    if (this.warehouseName) {
-                      this.warehouseNameKey = this.WAREHOUSE[3].payname
-                    } else {
-                      this.WAREHOUSE[3].payname = this.warehouseList[0].id
-                      this.warehouseName = this.warehouseList[0].warehouseName
-                    }
+                    this.WAREHOUSE[3].payname = this.warehouseList[0].id
+                    this.warehouseName = this.warehouseList[0].warehouseName
                   }
+                }
 
               }
-              
+
             }
             this.getList()
           })
@@ -906,25 +897,31 @@
         this.imageUrl = e.url
       },
       handleAvatarSuccess1(file) {
-        if(this.payImg[0]){
-          this.$set(this.payImg[0],'url',file.url)
-        }else{
-          this.payImg[0]={
-            url:file.url
+        if (this.payImg[0]) {
+          this.$set(this.payImg[0], 'url', file.url)
+        } else {
+          this.payImg[0] = {
+            url: file.url
           }
         }
-        settlementEdit({id:this.id,paymentScreenshot:this.payImg[0].url}).toPromise()
+        settlementEdit({
+            id: this.id,
+            paymentScreenshot: this.payImg[0].url
+          }).toPromise()
           .then((response) => {
-            this.showPayImgs=false
+            this.showPayImgs = false
             this.$message.success('修改成功')
             this.getList()
           })
       },
-      _handleRemove(){
-this.payImg[0].url=''
-settlementEdit({id:this.id,paymentScreenshot:this.payImg[0].url}).toPromise()
+      _handleRemove() {
+        this.payImg[0].url = ''
+        settlementEdit({
+            id: this.id,
+            paymentScreenshot: this.payImg[0].url
+          }).toPromise()
           .then((response) => {
-            this.showPayImgs=false
+            this.showPayImgs = false
             this.$message.success('修改成功')
             this.getList()
           })
@@ -1245,6 +1242,9 @@ settlementEdit({id:this.id,paymentScreenshot:this.payImg[0].url}).toPromise()
           .toPromise()
           .then((response) => {
             this.printData = response
+            if (response.compName == '黑龙江秋收有限公司') {
+              this.printData.compName = '黑龙江中天昊元贸易有限公司'
+            }
             this.isShowPrint = true
             // if(this.printData.solidGrainPrice){
             //   this.printData.solidGrainPrice = (this.printData.tidalGrainPrice * this.printData.netWeight)/this.printData.pureWeight
@@ -1306,7 +1306,7 @@ settlementEdit({id:this.id,paymentScreenshot:this.payImg[0].url}).toPromise()
                 monitorUrl1: this.warehouseList[i].monitorUrl1,
                 monitorUrl2: this.warehouseList[i].monitorUrl2,
                 warehouseNo: this.warehouseList[i].commonWarehouseNo,
-                compId:localStorage.getItem('ws-pf_compId')
+                compId: localStorage.getItem('ws-pf_compId')
               })
             )
             this.WAREHOUSE[3].payname = this.warehouseList[i].id
@@ -1426,17 +1426,18 @@ settlementEdit({id:this.id,paymentScreenshot:this.payImg[0].url}).toPromise()
   //   width: 150px;
   //   height: 150px;
   // }
-  .avatar-uploader{
-    position:relative;
-    width:178px;
+  .avatar-uploader {
+    position: relative;
+    width: 178px;
   }
+
   .avatar-uploader .el-upload {
     border: 1px dashed #d9d9d9;
     border-radius: 6px;
     cursor: pointer;
     position: relative;
     overflow: hidden;
-    width:178px;
+    width: 178px;
   }
 
   .avatar-uploader .el-upload:hover {
@@ -1536,16 +1537,19 @@ settlementEdit({id:this.id,paymentScreenshot:this.payImg[0].url}).toPromise()
   .el-button {
     margin: 5px;
   }
-  .no-messege{
+
+  .no-messege {
     text-align: center;
     font-size: 30px;
     padding: 50px;
   }
-   .my-img{
-            width: 200px;
-            height: 200px;
-        }
-  .el-icon-delete{
-    font-size:20px;
+
+  .my-img {
+    width: 200px;
+    height: 200px;
+  }
+
+  .el-icon-delete {
+    font-size: 20px;
   }
 </style>

+ 4 - 2
src/views/houseSelfCollect/settlement.vue

@@ -736,16 +736,18 @@ export default {
           })
           return
         }
-
       this.paymentList.id=this.$route.query.id 
       this.paymentList.amountIngPayable = this.paymentList.actualPayment
       this.paymentList.settlementClerk =  localStorage.getItem('ws-pf_staffName')
       postpaymentedit(this.paymentList).toPromise().then((response) => {
          getpaymentexamine({id:this.$route.query.id}).toPromise().then((response) => {
              this.printData= response
+              if (response.compName == '黑龙江秋收有限公司') {
+              this.printData.compName = '黑龙江中天昊元贸易有限公司'
+            }
              console.log(this.printData,'结算打印')
+          this.isShowPrint = true
          })
-         this.isShowPrint = true
         },
         )
     },

+ 8 - 1
src/views/houseSelfCollect/weighingManagement.vue

@@ -362,6 +362,9 @@
               .toPromise()
               .then((response) => {
                 index1++;
+              if (response.compName == '黑龙江秋收有限公司') {
+              response.compName = '黑龙江中天昊元贸易有限公司'
+              }
                 this.jjSelectPrintList.push(response)
                 if (index1 == this.modification.length) {
                   this.printBig(1, this.radio)
@@ -386,6 +389,9 @@
             .toPromise()
             .then((response) => {
               this.dialogData = response
+              if (response.compName == '黑龙江秋收有限公司') {
+              this.dialogData.compName = '黑龙江中天昊元贸易有限公司'
+              }
               this.isShowPrint = true
             })
             .catch((response) => {
@@ -448,7 +454,8 @@
               cangid: this.cangid,
               warehouseName: this.warehouseName,
               paramType: row.qualityInspectionManagement.paramType,
-              customerNumberCard: row.customerNumberCard
+              customerNumberCard: row.customerNumberCard,
+              automaticWeightAcquisition: row.automaticWeightAcquisition
             },
           })
         } else {

+ 44 - 26
src/views/houseSelfCollect/weightCheck.vue

@@ -119,7 +119,7 @@
               </el-table-column>
               <el-table-column property="carNumber" label="车牌号">
               </el-table-column>
-               <el-table-column property="status" label="状态">
+              <el-table-column property="status" label="状态">
               </el-table-column>
             </el-table>
             <div style="text-align: center">
@@ -236,11 +236,14 @@
         warehouseName: '',
         result1: '00',
         allowEdit: 0,
-        mListTop:[],
-        mListBottom:[],
-        pListTop:[],
-        pListBottom:[]
+        mListTop: [],
+        mListBottom: [],
+        pListTop: [],
+        pListBottom: []
       }
+    },
+    mounted() {
+     
     },
     activated() {
       console.log(this.common.name)
@@ -280,6 +283,9 @@
       } else if (this.tpyeNo == 2) {
         this.information = '皮重'
       }
+      if(this.$route.query.automaticWeightAcquisition == '1'){
+        this.openPort()
+      }
 
     },
     deactivated() {
@@ -354,18 +360,18 @@
           if (_list[i].status == '已质检') {
             this.mListTop.push(_list[i])
           }
-           if (_list[i].status == '已称毛重') {
+          if (_list[i].status == '已称毛重') {
             this.mListBottom.push(_list[i])
           }
           if (_list[i].status == '已称皮重') {
             this.pListBottom.push(_list[i])
           }
           if (_list[i].status == '已称毛重') {
-              this.pListTop.push(_list[i])
+            this.pListTop.push(_list[i])
           }
         }
-       this.mList= this.mListTop.concat(this.mListBottom)
-       this.pList= this.pListTop.concat(this.pListBottom)
+        this.mList = this.mListTop.concat(this.mListBottom)
+        this.pList = this.pListTop.concat(this.pListBottom)
         if (this.information == '毛重') {
           this.index = 0
           this.carList = this.mList
@@ -433,10 +439,10 @@
         }
       },
       tabClick(val) {
-        this.mListTop=[]
-        this.mListBottom=[]
-        this.pListTop=[]
-        this.pListBottom=[]
+        this.mListTop = []
+        this.mListBottom = []
+        this.pListTop = []
+        this.pListBottom = []
         this.carWeightInfo.carNumber = ''
         this.weighingList = []
         this.index = val
@@ -469,17 +475,24 @@
         }
       },
       async openPort() {
-        console.log('openPort', navigator);
+        console.log('openPort', navigator)
         if ('serial' in navigator) {
-          // 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();
-
+          // 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 {
@@ -820,6 +833,9 @@
                     .toPromise()
                     .then((response) => {
                       this.inspect = response
+                      if (response.compName == '黑龙江秋收有限公司') {
+               				 this.inspect.compName = '黑龙江中天昊元贸易有限公司'
+              					}
                       this.inspect.a = '中天'
                       // this.tableData = response
                       this.isShowPrint = true
@@ -896,8 +912,9 @@
   }
 
   .substance {
-      padding-bottom: 20px;
-      overflow-y: scroll;
+    padding-bottom: 20px;
+    overflow-y: scroll;
+
     .active {
       background: #5878e8;
       color: white;
@@ -1083,7 +1100,8 @@
       width: 50%;
     }
   }
-  .car-right{
+
+  .car-right {
     width: 50%;
   }
 </style>

+ 0 - 1
src/views/outboundManagement/collectionManagement.vue

@@ -21,7 +21,6 @@
       <template slot="right">
         <el-col
           style="text-align: right; line-height: 60px; padding-right: 10px"
-          :span="8"
         >
         <div class="el-input el-input--small el-input--suffix">
           <el-select

+ 22 - 9
src/views/outboundManagement/weighing.vue

@@ -137,7 +137,10 @@
 				reader:null,
 				param:9600
 			}
-		},
+    },
+    mounted() {
+	  this.openPort()
+	  },
 		activated() {
 			this.types = this.$route.query.typeNo
 			this.weighingList.number = this.$route.query.number
@@ -176,14 +179,24 @@
 				this.reader.cancel()
 			},
 			async openPort(){
-			console.log('openPort',navigator);
-			if ('serial' in navigator) {
-				// 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('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();

+ 5 - 1
src/views/tranManagement/tranManagementTransporHairRespond.vue

@@ -92,7 +92,11 @@
             <span v-else>{{ scope.$index + 1 }}</span>
           </template>
         </el-table-column>
-        <el-table-column prop="processNo" label="运输任务编号" width="140">
+        <el-table-column prop="processNo" label="运输任务编号/合同编号" width="140">
+        <template scope="scope">
+            <span v-if="scope.row.processNo">{{ scope.row.processNo }}</span>
+            <span v-else>{{ scope.row.contractNo }}</span>
+          </template>
         </el-table-column>
         <el-table-column prop="tranType" label="运输方式"> </el-table-column>
         <el-table-column prop="goodsName" label="货名"> </el-table-column>

+ 2 - 2
src/views/tranManagement/tranManagementthirdpartnarFeedback.vue

@@ -686,7 +686,7 @@ export default {
         .then(() => {
           this.$refs.deptBudgetList.validate((valid) => {
             if (valid) {
-              posttranprocessinfo({threeTranType:this.checkList.toString(),id:this.deptBudgetList.id,contractNo:this.deptBudgetList.contractNo,tranCarInfoList1,tranCarInfoList2,tranCarInfoList3,tranCarInfoList4})
+              posttranprocessinfo({threeTranType:this.checkList.toString(),id:this.deptBudgetList.id,infoId:this.deptBudgetList.infoId,contractNo:this.deptBudgetList.contractNo,tranCarInfoList1,tranCarInfoList2,tranCarInfoList3,tranCarInfoList4})
                 .toPromise()
                 .then((response) => {
                   this.$message.success('提交成功')
@@ -1178,7 +1178,7 @@ export default {
 }
 //联络员及车次
 /deep/.liaison .ws-info-table .el-form-item {
-  width: 20%;
+  width: 25%;
 }
 /deep/.liaison .ws-info-table .el-form-item .el-form-item__label {
   width: 50%;

+ 5 - 2
src/views/tranManagement/tranManagementthirdpartnarFeedbackLook.vue

@@ -415,12 +415,15 @@ export default {
             }
             if(this.checkList.indexOf('火运')!=-1){
               this.status1=true
-              if(response.tranCarInfoList2[i].boxNo&&response.tranCarInfoList2[i].boxNo.indexOf(',')!=-1){
+              for (let i = 0; i < response.tranCarInfoList2.length; i++) {
+                if(response.tranCarInfoList2[i].boxNo&&response.tranCarInfoList2[i].boxNo.indexOf(',')!=-1){
                   response.tranCarInfoList2[i].boxNo1=response.tranCarInfoList2[i].boxNo.split(',')[0]
                   response.tranCarInfoList2[i].boxNo2=response.tranCarInfoList2[i].boxNo.split(',')[1]
                 }else{
                   response.tranCarInfoList2[i].boxNo1=response.tranCarInfoList2[i].boxNo
                 }
+              }
+              
               this.freightspace1=response.tranCarInfoList2
             }else{
               this.status1=false
@@ -804,7 +807,7 @@ export default {
 }
 //联络员及车次
 /deep/.liaison .ws-info-table .el-form-item {
-  width: 20%;
+  width: 25%;
 }
 /deep/.liaison .ws-info-table .el-form-item .el-form-item__label {
   width: 50%;

+ 1 - 1
src/views/tranManagement/tranManagementthirdpartnarReceiving.vue

@@ -1019,7 +1019,7 @@ export default {
 }
 //联络员及车次
 /deep/.liaison .ws-info-table .el-form-item {
-  width: 20%;
+  width: 25%;
 }
 /deep/.liaison .ws-info-table .el-form-item .el-form-item__label {
   width: 50%;

+ 1 - 1
src/views/tranManagement/tranManagementthirdpartnarReceivingLook.vue

@@ -805,7 +805,7 @@ export default {
 }
 //联络员及车次
 /deep/.liaison .ws-info-table .el-form-item {
-  width: 20%;
+  width: 25%;
 }
 /deep/.liaison .ws-info-table .el-form-item .el-form-item__label {
   width: 50%;

+ 14 - 6
src/views/warehouse/warehouseManagementAdd.vue

@@ -323,7 +323,14 @@
       },
 
       submit() {
+        
         if (this.radio == 1) {
+          this.deptBudgetList.warehousePrivate =
+                    CodeToText[this.selectedOptions[0]]
+                  this.deptBudgetList.warehouseCity =
+                    CodeToText[this.selectedOptions[1]]
+                  this.deptBudgetList.warehouseArea =
+                    CodeToText[this.selectedOptions[2]]
           if (!this.deptBudgetList.warehouseName) {
             this.$message({
               message: '仓库名称不能为空!',
@@ -372,6 +379,13 @@
             })
             return
           }
+          if (!this.deptBudgetList.warehousePrivate) {
+            this.$message({
+              message: '请选择仓库所在地!',
+              type: 'warning',
+            })
+            return
+          }
           if (!this.deptBudgetList.detailedAddress) {
             this.$message({
               message: '详细地址不能为空!',
@@ -528,12 +542,6 @@
                 if (valid) {
                   this.deptBudgetList.compId =
                     localStorage.getItem('ws-pf_compId')
-                  this.deptBudgetList.warehousePrivate =
-                    CodeToText[this.selectedOptions[0]]
-                  this.deptBudgetList.warehouseCity =
-                    CodeToText[this.selectedOptions[1]]
-                  this.deptBudgetList.warehouseArea =
-                    CodeToText[this.selectedOptions[2]]
                   this.deptBudgetList.warehousePositionInfoList =
                     this.freightspace
                   this.deptBudgetList.totalStorage = this.totalStorage

+ 17 - 7
src/views/warehouse/warehouseManagementEdit.vue

@@ -98,13 +98,13 @@
           <el-button v-if="warehouseType == 1">上传附件</el-button>
         </el-upload>
         <div class="addressUrls" v-if="addressUrls != null">
-          <div class='addressUrls-item'>
             <div v-for="(item , index) in addressUrls" class="addressUrl" :key="index">
               <div @click='close(index)' class="iconfont icon-guanbi"></div>
-              <img v-if="addressUrls != null" width="100" height="100" :src="item" alt="" />
-            </div>
-
-
+              <el-image  v-if="addressUrls != null"
+                style="width: 100px; height: 100px"
+                :src="item" 
+                :preview-src-list="addressUrls">
+              </el-image>
           </div>
         </div>
         <div class="small-title">仓库定位</div>
@@ -339,6 +339,7 @@
         })
       },
       handleChange(value) {
+        console.log(value)
         this.selectedOptions = value
       },
       warehouseTypechange() {
@@ -468,12 +469,21 @@
           .then((response) => {
             var tmp = []
             tmp[0] = TextToCode[response.warehousePrivate].code
-            tmp[1] =
+            if(response.warehouseCity!=''){
+              tmp[1] =
               TextToCode[response.warehousePrivate][response.warehouseCity].code
-            tmp[2] =
+              tmp[2] =
               TextToCode[response.warehousePrivate][response.warehouseCity][
                 response.warehouseArea
               ].code
+            }else{
+              tmp[1]=TextToCode[response.warehousePrivate]['市辖区'].code
+              tmp[2] =
+              TextToCode[response.warehousePrivate]['市辖区'][
+                response.warehouseArea
+              ].code
+            }
+           
             this.selectedOptions = tmp
             this.deptBudgetList = response
             // if(this.deptBudgetList.addressUrl){

+ 39 - 12
src/views/warehouse/warehouseManagementGross.vue

@@ -360,14 +360,14 @@
             "
           >
             <ws-input
-              v-if="!carstatus"
+              v-if="options2.length==0"
               v-model="deptBudgetList.carNo"
               placeholder="请输入车牌号"
               maxlength="7"
-              size="small"
+              size="small" 
             />
             <el-select
-              v-if="carstatus"
+              v-if='carstatus&&options2.length>0'
               filterable
               :filter-method="dataFilter2"
               v-model="deptBudgetList.carNo"
@@ -382,6 +382,22 @@
                 :value="item.carNo"
               />
             </el-select>
+            <el-select
+              v-if='!carstatus&&options2.length>0'
+              filterable
+              :filter-method="dataFilter2"
+              v-model="deptBudgetList.carNo"
+              placeholder="请选择车牌号"
+              class="typeselect"
+              @change="carChange"
+            >
+              <el-option
+                v-for="item in options2"
+                :key="item.constKey"
+                :label="item.carNo"
+                :value="item.carNo"
+              />
+            </el-select>
           </ws-form-item>
           <!--船名  -->
           <ws-form-item
@@ -899,6 +915,9 @@ export default {
     //   // this.deptBudgetList.inOutType = '退库'
     //   this.deptBudgetList.inOutTypeKey = '1'
     // }
+    if(this.$route.query.automaticWeightAcquisition == '1'){
+      this.openPort()
+    }
   },
   methods: {
     async closePort() {
@@ -907,15 +926,23 @@ export default {
     },
     async openPort() {
       console.log('openPort', navigator)
-      if ('serial' in navigator) {
-        // 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()
+        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()

+ 30 - 28
src/views/warehouse/warehouseManagementList.vue

@@ -325,12 +325,12 @@
         },
         accessoryTFs: false,
         isShowPrintType: false, //打印
-        headerText: "",
+        headerText: '',
         packtypeList: [], //仓库列表
         parameter: {
           radio: 3,
-          startDate: "",
-          endDate: "",
+          startDate: '',
+          endDate: '',
           proportion: ''
         },
         date: {
@@ -348,9 +348,9 @@
       //导出、打印
       outData(index) {
         if (index == 1) {
-          this.headerText = "导出记录"
+          this.headerText = '导出记录'
         } else if (index == 2) {
-          this.headerText = "打印记录"
+          this.headerText = '打印记录'
         }
         // 获取仓库
         xiala({
@@ -367,38 +367,38 @@
         var strDate = date.getDate()
         var pastdate = new Date(date.getTime() - 24 * 60 * 60 * 1000)
         this.parameter.startDate = pastdate.getFullYear() + '-' + (pastdate.getMonth() + 1) + '-' + pastdate.getDate()
-        this.parameter.endDate = "" + year + "-" + month + "-" + strDate
+        this.parameter.endDate = '' + year + '-' + month + '-' + strDate
         this.$forceUpdate();
         this.isShowPrintType = true
       },
       removePrint() {
-        this.parameter.warehouseName = ""
-        this.parameter.proportion = ""
+        this.parameter.warehouseName = ''
+        this.parameter.proportion = ''
         this.isShowPrintType = false
 
       },
       async submitClick() {
-        if (!this.parameter.radio && this.headerText == "打印记录") {
-          this.$message.error("请选择打印的类型")
+        if (!this.parameter.radio && this.headerText == '打印记录') {
+          this.$message.error('请选择打印的类型')
           return
         }
         if (!this.parameter.startDate) {
-          this.$message.error("请选择打印的起始日期")
+          this.$message.error('请选择打印的起始日期')
           return
         }
         if (!this.parameter.endDate) {
-          this.$message.error("请选择打印的截止日期")
+          this.$message.error('请选择打印的截止日期')
           return
         }
         if (new Date(this.parameter.endDate).getTime() < new Date(this.parameter.startDate).getTime()) {
-          this.$message.error("截止日期输入错误")
+          this.$message.error('截止日期输入错误')
           return
         }
         if (!this.parameter.warehouseName) {
-          this.$message.error("请选择所要打印的仓库")
+          this.$message.error('请选择所要打印的仓库')
           return
         }
-        if (this.headerText == "导出记录") {
+        if (this.headerText == '导出记录') {
           if (this.parameter.radio == 3) {
             const {
               data
@@ -435,7 +435,7 @@
             })
           }
 
-        } else if (this.headerText == "打印记录") {
+        } else if (this.headerText == '打印记录') {
           console.log(this.parameter.startDate)
           addselectinfoList({
               compId: localStorage.getItem('ws-pf_compId'),
@@ -448,7 +448,7 @@
             }).toPromise()
             .then((response) => {
               if (response.records.length == 0) {
-                this.$message.error("暂未查到所要打印的出入库信息")
+                this.$message.error('暂未查到所要打印的出入库信息')
               } else {
                 var warehousePrint = response.records
                 if (this.parameter.proportion) {
@@ -490,9 +490,9 @@
                           }
                           response1.splice(index, 1) //删除已添加过得假数据车牌号
                           if (response1.length == 0) {
-                            sessionStorage.setItem("inOutWarehouse_Print", JSON.stringify(warehousePrint))
-                            let _canshu = ""
-                            _canshu = this.parameter.radio +"&warehouseName=" + this.parameter.warehouseName+"&startDate=" + this.parameter.startDate+"&endDate=" + this.parameter.startDate
+                            sessionStorage.setItem('inOutWarehouse_Print', JSON.stringify(warehousePrint))
+                            let _canshu = ''
+                            _canshu = this.parameter.radio +'&warehouseName=' + this.parameter.warehouseName+'&startDate=' + this.parameter.startDate+'&endDate=' + this.parameter.startDate
                             window.open('../../../../../static/warehousePrint.html?type=' + _canshu)
                           }
                         } else { //增量为0时
@@ -500,16 +500,16 @@
                         }
                       }
                       //跳转
-                      sessionStorage.setItem("inOutWarehouse_Print", JSON.stringify(warehousePrint))
-                      let _canshu = ""
-                      _canshu = this.parameter.radio + "&warehouseName=" + this.parameter.warehouseName+"&startDate=" + this.parameter.startDate+"&endDate=" + this.parameter.startDate
+                      sessionStorage.setItem('inOutWarehouse_Print', JSON.stringify(warehousePrint))
+                      let _canshu = ''
+                      _canshu = this.parameter.radio + '&warehouseName=' + this.parameter.warehouseName+'&startDate=' + this.parameter.startDate+'&endDate=' + this.parameter.startDate
                       window.open('../../../../../static/warehousePrint.html?type=' + _canshu)
 
                     })
                 } else { //没有增量比例的直接打印
-                  sessionStorage.setItem("inOutWarehouse_Print", JSON.stringify(response.records))
-                  let _canshu1 = ""
-                  _canshu1 = this.parameter.radio + "&warehouseName=" + this.parameter.warehouseName+"&startDate=" + this.parameter.startDate+"&endDate=" + this.parameter.startDate
+                  sessionStorage.setItem('inOutWarehouse_Print', JSON.stringify(response.records))
+                  let _canshu1 = ''
+                  _canshu1 = this.parameter.radio + '&warehouseName=' + this.parameter.warehouseName+'&startDate=' + this.parameter.startDate+'&endDate=' + this.parameter.startDate
                   window.open('../../../../../static/warehousePrint.html?type=' + _canshu1)
                 }
               }
@@ -611,7 +611,8 @@
             warehouseType: this.warehouseType,
             createType: item.createType,
             information: '毛重检斤',
-            allowEdit: item.allowEdit
+            allowEdit: item.allowEdit,
+            automaticWeightAcquisition: item.automaticWeightAcquisition
           },
         })
       },
@@ -628,7 +629,8 @@
             warehouseType: this.warehouseType,
             warehouseId: item.warehouseId,
             information: '皮重检斤',
-            allowEdit: item.allowEdit
+            allowEdit: item.allowEdit,
+            automaticWeightAcquisition: item.automaticWeightAcquisition
           },
         })
       },

+ 14 - 2
src/views/warehouse/warehouseManagementLook.vue

@@ -132,7 +132,8 @@
           </ws-info-table>
         </div>
         <div class="small-title" v-show="warehouseType == '1'">仓库照片</div>
-        <div class="addressUrls">
+        <div>
+          <div class="addressUrls">
           <div v-for="(items, index) in addressUrls" class="addressUrl">
             <img
               v-show="addressUrls.length > 0"
@@ -143,6 +144,8 @@
             />
           </div>
         </div>
+        
+        </div>
       </ws-form>
     </div>
     <div style="text-align: right; padding: 10px">
@@ -157,6 +160,11 @@
   </div>
 </template>
 <script>
+import {
+    regionData,
+    CodeToText,
+    TextToCode
+  } from 'element-china-area-data'
 import { xiala, billoperatehis, getLook } from '@/model/warehouse/index'
 import Pagination from '@/components/Pagination'
 import WsUpload from '@/components/WsUpload'
@@ -307,6 +315,7 @@ export default {
       })
         .toPromise()
         .then((response) => {
+          
           this.packtypeList = response
         })
     },
@@ -342,9 +351,12 @@ export default {
   margin-top: 100px;
   top: 30px;
   width: 90%;
-  height: 500px;
+  // height: 500px;
   margin: 0 auto;
 }
+.container{
+  overflow:scroll;
+}
 .container .bg-left {
   padding-left: 40px;
 }

+ 3 - 2
src/views/warehouse/warehouseManagementNoWeight.vue

@@ -317,7 +317,7 @@ export default {
             deductionAmount:row.deductionAmount,
             deductionWeight:row.deductionWeight,
             allowEdit:row.allowEdit,
-
+            automaticWeightAcquisition: row.automaticWeightAcquisition
           },
         })
       } else if (row.inOutFlag == 1) {
@@ -359,7 +359,8 @@ export default {
             pureWeight:row.pureWeight,
             deductionAmount:row.deductionAmount,
             deductionWeight:row.deductionWeight,
-            allowEdit:row.allowEdit
+            allowEdit:row.allowEdit,
+            automaticWeightAcquisition:row.automaticWeightAcquisition
           },
         })
       }

+ 24 - 10
src/views/warehouse/warehouseManagementNoWeightIn.vue

@@ -823,6 +823,8 @@ export default {
       ],
     }
   },
+  mounted() {
+	},
   activated() {
     if (this.$route.query.allowEdit == 1) {
       this.allowEdit = false
@@ -883,6 +885,10 @@ export default {
       .then((response) => {
         this.deptBudgetList2 = response
       })
+      
+    if(this.$route.query.automaticWeightAcquisition == '1'){
+      this.openPort()
+    }
   },
   methods: {
     async closePort() {
@@ -890,16 +896,24 @@ export default {
       this.reader.cancel()
     },
     async openPort() {
-      console.log('openPort', navigator)
-      if ('serial' in navigator) {
-        // 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('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()

+ 15 - 1
src/views/warehouse/warehouseManagementNoWeightOut.vue

@@ -612,6 +612,8 @@ export default {
       result1: '00',
     }
   },
+  mounted() {
+	},
   activated() {
     if (this.$route.query.allowEdit == 1) {
       this.allowEdit = false
@@ -653,6 +655,10 @@ export default {
       .then((response) => {
         this.deptBudgetList2 = response
       })
+      
+    if(this.$route.query.automaticWeightAcquisition == '1'){
+      this.openPort()
+    }
   },
   methods: {
     async closePort() {
@@ -661,7 +667,8 @@ export default {
     },
     async openPort() {
       console.log('openPort', navigator)
-      if ('serial' in 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)
@@ -670,6 +677,13 @@ export default {
           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()

+ 17 - 4
src/views/warehouse/warehouseManagementTare.vue

@@ -773,6 +773,9 @@ export default {
         console.log(response)
         this.deptBudgetList1 = response
       })
+    if(this.$route.query.automaticWeightAcquisition == '1'){
+      this.openPort()
+    }
   },
   methods: {
     async closePort() {
@@ -781,7 +784,8 @@ export default {
     },
     async openPort() {
       console.log('openPort', navigator)
-      if ('serial' in 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)
@@ -790,6 +794,13 @@ export default {
           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()
@@ -1387,9 +1398,11 @@ export default {
               this.deptBudgetList.statusFlag = 1
               this.deptBudgetList.grossWeight /= 1000
               this.deptBudgetList.tare /= 1000
-              this.deptBudgetList.netWeight = Number(
-                this.deptBudgetList.netWeight
-              ).toFixed(2)
+              if(this.deptBudgetList.netWeight){
+                this.deptBudgetList.netWeight = Number(
+                  this.deptBudgetList.netWeight
+                ).toFixed(2)
+              }
               this.deptBudgetList.pureWeight /= 1000
               addstorageputList(this.deptBudgetList)
                 .toPromise()