Browse Source

Merge branch 'master' of http://git.zthymaoyi.com/gdc/yiliangyiyun-pc

# Conflicts:
#	src/views/houseSelfCollect/inspectionManagement.vue
#	src/views/houseSelfCollect/weighingManagement.vue
mxx 3 years ago
parent
commit
3daedd7b30

+ 14 - 5
src/views/home/index.vue

@@ -554,19 +554,28 @@ export default {
         // 监听来自串行设备的数据
         while (true) {
           const { value, done } = await this.reader.read();
-          // console.log(value,done);
+          // 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++){
-            result += String.fromCharCode(value[i])
-            console.log(result);
+            var tmp = String.fromCharCode(value[i])
+            if(tmp == "+"){
+              flag = true
+            }
+            if(flag && result.length <7){
+              result += tmp
+            }
           }
-          this.text = result
+          this.text = parseInt(result)
+          setTimeout(1000)
           // value 是一个 Uint8Array
         }
          await port.close();

+ 3 - 2
src/views/houseSelfCollect/acquisitionManagementAdd.vue

@@ -32,7 +32,7 @@
             </el-form-item>
           </div>
           <div class="grid-content">
-            <el-form-item label="干粮收购价格(元/公斤)" label-width="180px">
+            <el-form-item label="干粮收购价格(元/公斤)">
               <el-input v-model="baseInfoForm.dryGrainPrice" :disabled="!isEdit"></el-input>
             </el-form-item>
           </div>
@@ -506,7 +506,7 @@
         if (isNaN(result)) {
           return false;
         }
-        result = Math.round(result * 100) / 100;
+        result = Math.round(result * 10000) / 10000;
         return result;
       },
       //保留两位小数
@@ -555,6 +555,7 @@
       },
       // 删除价格组
       delSetPrice(item, index) {
+        // debugger
         let that = this
         this.checkList1 = []
         this.checkList2 = []

+ 36 - 36
src/views/houseSelfCollect/customerManagementAdd.vue

@@ -360,13 +360,13 @@
           })
           return
         }
-          if (!this.imageUrl2) {
-          this.$message({
-            message: '请上传身份证反面',
-            type: 'warning',
-          })
-          return
-        }
+        //   if (!this.imageUrl2) {
+        //   this.$message({
+        //     message: '请上传身份证反面',
+        //     type: 'warning',
+        //   })
+        //   return
+        // }
           if (!this.imageUrl3) {
           this.$message({
             message: '请上传银行卡正面',
@@ -374,13 +374,13 @@
           })
           return
         }
-          if (!this.imageUrl4) {
-          this.$message({
-            message: '请上传银行卡反面',
-            type: 'warning',
-          })
-          return
-        }
+        //   if (!this.imageUrl4) {
+        //   this.$message({
+        //     message: '请上传银行卡反面',
+        //     type: 'warning',
+        //   })
+        //   return
+        // }
         if (!this.customerList.customerName) {
           this.$message({
             message: '请输入姓名',
@@ -388,7 +388,7 @@
           })
           return
         }
-           if (!this.customerList.customerNumberCard) {
+           if (!this.customerList.bankCard) {
           this.$message({
             message: '请输入输入银行卡号',
             type: 'warning',
@@ -409,20 +409,20 @@
           })
           return
         }
-         if (!this.customerList.payeeName) {
-          this.$message({
-            message: '请输入收款人姓名',
-            type: 'warning',
-          })
-          return
-        } 
-         if (!this.customerList.payeeNumberCard) {
-          this.$message({
-            message: '请输入收款人身份证号',
-            type: 'warning',
-          })
-          return
-        }
+        //  if (!this.customerList.payeeName) {
+        //   this.$message({
+        //     message: '请输入收款人姓名',
+        //     type: 'warning',
+        //   })
+        //   return
+        // } 
+        //  if (!this.customerList.payeeNumberCard) {
+        //   this.$message({
+        //     message: '请输入收款人身份证号',
+        //     type: 'warning',
+        //   })
+        //   return
+        // }
          if (this.customerList.payeeNumberCard.length != 18) {
           this.$message({
             message: '收款人身份证号输入有误,请重新输入',
@@ -444,13 +444,13 @@
           })
           return
         }
-        if (!this.customerList.compAddress) {
-          this.$message({
-            message: '请输入联系地址',
-            type: 'warning',
-          })
-          return
-        }
+        // if (!this.customerList.compAddress) {
+        //   this.$message({
+        //     message: '请输入联系地址',
+        //     type: 'warning',
+        //   })
+        //   return
+        // }
         // 验证码校验
         GetCustomerCodeJY({
             phone: this.customerList.customerPhone,

+ 18 - 6
src/views/houseSelfCollect/inspectInfo.vue

@@ -72,7 +72,7 @@
           <div class="title">质检数据</div>
           <ws-info-table>
             <ws-form-item label="等级" span="1" prop="grade">
-              <ws-select v-model="inspect.grade" placeholder="请输入等级" class="typeselect" @change="waterContentChange"
+              <ws-select v-model="inspect.grade" placeholder="请输入等级" class="typeselect"
                 :disabled="disabled">
                 <ws-option v-for="item in gradeList" :key="item.constKey" :label="item.constValue"
                   :value="item.constValue" />
@@ -177,6 +177,7 @@
         imgUrl:"",
         printData:{},
         num:0,
+        tipFlag:true
       }
     },
     activated() {
@@ -184,6 +185,7 @@
       if(!this.types){
           this.types = 1
            this.information = '添加'
+           this.disabled = false
            this.inspect = {
           tidalGrainPrice: 0,
           buckleWeightRatio: 0,
@@ -232,7 +234,8 @@
       calculation() {
         let number = '000' + this.count
         number = number.substring(number.length - 4, number.length)
-        this.inspect.qualityNo = 'SGRK' + this.getdate() + this.cangNo + number //SGRK+8位时间+3位仓库编号+4位序列号
+        this.inspect.qualityNo = 'ZCRK' + this.getdate() + this.cangNo + number //SGRK+8位时间+3位仓库编号+4位序列号
+        
         // + this.verifyinit()
       },
       closeDialog() {
@@ -249,7 +252,7 @@
               data: formdata
             }).then((response) => {
               //编辑接口
-              this.inspect.pictureAddress=response.data.url
+              this.inspect.pictureAddress = response.data.url
                getinspectEdit(this.inspect)
                 .toPromise()
                 .then((response) => {
@@ -574,6 +577,7 @@
                     .toPromise()
                     .then((response) => {
                       this.inspect = response
+                      console.log(this.inspect,"cdsklh")
                     })
                   this.isShowPrint = true
                 })
@@ -616,7 +620,8 @@
           .then((response) => {
             for (let i = 0; i < this.purchasePriceList.length; i++) {
               if (this.inspect.goodsName == this.purchasePriceList[i].goodsName) {
-                if (this.purchasePriceList[i].saleLimit - response/1000 < 50 || count > 0) {
+                if ((this.purchasePriceList[i].saleLimit - response/1000 < 50 || count > 0)&&this.tipFlag) {
+                  this.tipFlag = false
                     this.$alert('当前客户已累计销售我司' +this.inspect.goodsName + (response/1000).toFixed(2) +'吨,最高可售' +this.purchasePriceList[i].saleLimit +'吨。',
                           '提示',
                           {
@@ -668,7 +673,11 @@
         if(this.inspect.goodsName && this.inspect.customerName ){
              // //查看当前用户对应货名有未结算状态的送货
        let count = 0
-        getCount({
+        if (
+          this.inspect.goodsName &&
+          this.inspect.customerName 
+        ) {
+          getCount({
           compId: sessionStorage.getItem('ws-pf_compId'),
           customerName: this.inspect.customerName,
           goodsName: this.inspect.goodsName,
@@ -686,7 +695,8 @@
           .then((response) => {
             for (let i = 0; i < this.purchasePriceList.length; i++) {
               if (this.inspect.goodsName == this.purchasePriceList[i].goodsName) {
-                if (this.purchasePriceList[i].saleLimit - response/1000 < 50 || count > 0) {
+                if ((this.purchasePriceList[i].saleLimit - response/1000 < 50 || count > 0 )&&this.tipFlag) {
+                  this.tipFlag = false
                     this.$alert('当前客户已累计销售我司' +this.inspect.goodsName + (response/1000).toFixed(2) +'吨,最高可售' +this.purchasePriceList[i].saleLimit +'吨。',
                           '提示',
                           {
@@ -700,6 +710,8 @@
             }
           })
         }
+        
+        }
       },
 
       getList(ids) {

+ 36 - 20
src/views/houseSelfCollect/paymentManagement.vue

@@ -8,8 +8,8 @@
         <ws-button type="primary"  @click="screen()">全部</ws-button>
         <ws-button type="primary" @click="reject" v-if="isShowAdopt">驳回</ws-button>
         <ws-button type="primary" @click="adopt" v-if="isShowAdopt">通过</ws-button>
-        <ws-button type="primary" @click="adopt" v-if="isShowAdopt">审核</ws-button>
-        <ws-button type="primary" @click="payment">付款</ws-button>
+        <ws-button type="primary" @click="handlepass" v-if="isShowAdopt">审核</ws-button>
+        <ws-button type="primary" @click="payment" v-hasPermission="`acquisitionManagement.acquisitionPay.pay`">付款</ws-button>
       </template>
       <template slot="right">
         <el-select
@@ -75,7 +75,7 @@
       <el-table-column class="table_td" prop="pureWeight" width="120" label="纯重(公斤)"></el-table-column>
       <el-table-column class="table_td" prop="amountIngPayable" label="应付款(元)"></el-table-column>
       <el-table-column class="table_td" prop="amountEdPayable" label="已付款(元)"></el-table-column>
-      <el-table-column class="table_td" prop="collectionIngPayable" label="更新时间"></el-table-column>
+      <el-table-column class="table_td" prop="updateDate" label="更新时间" width="140" ></el-table-column>
       <el-table-column class="table_td" prop="status" label="状态">
         <template scope="scope">
           <span v-if="scope.row.approveStatus">
@@ -90,12 +90,12 @@
         <template scope="scope">
           <el-button
             type="danger"
-            v-if="!scope.row.approveStatus && scope.row.status != '已驳回'"
+            v-if="(!scope.row.approveStatus || scope.row.approveStatus == '待结算')&& scope.row.status == '待结算'"
             @click="del(scope.row)"
             v-hasPermission="`acquisitionManagement.acquisitionPay.delete`"
           >删除</el-button>
           <el-button
-            v-if="!scope.row.approveStatus && scope.row.status != '已驳回'"
+            v-if="(!scope.row.approveStatus || scope.row.approveStatus == '待结算')&& scope.row.status == '待结算'"
             @click="settlement(1, scope.row)"
             v-hasPermission="`acquisitionManagement.acquisitionPay.add`"
           >结算</el-button>
@@ -240,6 +240,20 @@ export default {
     this.getList()
   },
   methods: {
+    handlepass() {
+      var that = this
+      if (this.modification.length == 0) {
+        this.$message.warning('请选择要通过的条目')
+      } else {
+        this.$confirm(`审核通过后,任务将发送给财务,是否确定通过?`, {
+          cancelButtonText: '取消',
+          confirmButtonText: '确定',
+          type: 'warning',
+        }).then(() => {
+          that.audit(this.modification[0], 0, true, 2)
+        })
+      }
+    },
     getWarehouse() {
       selectWarehouseSelf({
         compId: sessionStorage.getItem('ws-pf_compId')
@@ -286,26 +300,28 @@ export default {
       })
         .toPromise()
         .then(response => {
+          debugger
           this.paymentList = response
           this.deptBudgetTotal = response.total
         })
-     getpayment({
-        currentPage: 1,
-        pageSize: 99999,
-        warehouseName: this.warehouseName,
-        managementType : 1 
-      })
-        .toPromise()
-        .then((response) => {
-          for(let i = 0 ; i < response.length ; i++){
-            if(response[i].taskId){
-              this.isShowAdopt = true
-              return
-            }
+        this.isShowAdopt = true
+    //  getpayment({
+    //     currentPage: 1,
+    //     pageSize: 99999,
+    //     warehouseName: this.warehouseName,
+    //     managementType : 1 
+    //   })
+    //     .toPromise()
+    //     .then((response) => {
+    //       for(let i = 0 ; i < response.length ; i++){
+    //         if(response[i].taskId){
+    //           this.isShowAdopt = true
+    //           return
+    //         }
        
-          }
+    //       }
        
-        })
+    //     })
     },
     del(row) {
       this.$confirm(

+ 36 - 25
src/views/houseSelfCollect/settlement.vue

@@ -237,16 +237,6 @@
             >
               <ws-input @input='grainMoney' v-model="paymentList.grainMoney" placeholder="请输入粮款" maxlength="100" size="small" disabled/>
             </ws-form-item>
-            <ws-form-item label="称重补助" span="1" prop="waterContent">
-              <ws-input
-              @input='grainMoney'
-               v-model="paymentList.weighingSubsidy"
-                placeholder="请输入称重补助"
-                maxlength="100"
-                size="small"
-                :disabled="disabled"
-              />
-            </ws-form-item>
             <ws-form-item label="称重扣款" span="1" prop="waterContent">
               <ws-input
               @input='grainMoney'
@@ -257,16 +247,17 @@
                 :disabled="disabled"
               />
             </ws-form-item>
-            <ws-form-item label="运费补助" span="1" prop="waterContent">
+            <ws-form-item label="称重补助" span="1" prop="waterContent">
               <ws-input
               @input='grainMoney'
-              v-model="paymentList.freightSubsidy"
-                placeholder="请输入运费补助"
+               v-model="paymentList.weighingSubsidy"
+                placeholder="请输入称重补助"
                 maxlength="100"
-                :disabled="disabled"
                 size="small"
+                :disabled="disabled"
               />
             </ws-form-item>
+            
             <ws-form-item label="运费扣款" span="1" prop="waterContent">
               <ws-input
               @input='grainMoney'
@@ -277,11 +268,11 @@
                 size="small"
               />
             </ws-form-item>
-            <ws-form-item label="卸车补助" span="1" prop="waterContent">
+            <ws-form-item label="运费补助" span="1" prop="waterContent">
               <ws-input
               @input='grainMoney'
-              v-model="paymentList.unloadSubsidy"
-                placeholder="请输入卸车补助"
+              v-model="paymentList.freightSubsidy"
+                placeholder="请输入运费补助"
                 maxlength="100"
                 :disabled="disabled"
                 size="small"
@@ -297,11 +288,11 @@
                 size="small"
               />
             </ws-form-item>
-            <ws-form-item label="其他补助" span="1" prop="waterContent">
+            <ws-form-item label="卸车补助" span="1" prop="waterContent">
               <ws-input
               @input='grainMoney'
-              v-model="paymentList.otherSubsidy"
-                placeholder="请输入其他补助"
+              v-model="paymentList.unloadSubsidy"
+                placeholder="请输入卸车补助"
                 maxlength="100"
                 :disabled="disabled"
                 size="small"
@@ -317,6 +308,18 @@
                 size="small"
               />
             </ws-form-item>
+
+            <ws-form-item label="其他补助" span="1" prop="waterContent">
+              <ws-input
+              @input='grainMoney'
+              v-model="paymentList.otherSubsidy"
+                placeholder="请输入其他补助"
+                maxlength="100"
+                :disabled="disabled"
+                size="small"
+              />
+            </ws-form-item>
+            
             <ws-form-item label="其他扣款" span="1" prop="waterContent">
               <ws-input
               @input='grainMoney'
@@ -388,7 +391,7 @@
     >
       <paymentPrint :printData="printData" ref="saveImg"></paymentPrint>
       <div style="text-align:center">
-        <el-button type="primary" @click="isShowPrint = false">关闭</el-button>
+        <el-button type="primary" @click="closePrint">关闭</el-button>
         <!-- <el-button type="primary" @click="printSmall">打印小票</el-button> -->
         <el-button type="primary" @click="printBig">打印单据</el-button>
       </div>
@@ -485,13 +488,15 @@ export default {
           }
           if(this.paymentList.type =='潮粮'){
             this.paymentList.grainMoney=this.paymentList.qualityInspectionManagement.tidalGrainPrice*this.paymentList.weighingManagement.netWeight
-            this.paymentList.calculationPayable =  this.paymentList.grainMoney.toFixed(2)
+            this.paymentList.calculationPayable=Number(this.paymentList.grainMoney)+Number(this.paymentList.weighingSubsidy)+Number(this.paymentList.freightSubsidy)+Number(this.paymentList.unloadSubsidy)+Number(this.paymentList.otherSubsidy)-Number(this.paymentList.weighingDeduction)-this.paymentList.freightDeduction-Number(this.paymentList.unloadDeduction)-Number(this.paymentList.otherDeduction)-Number(this.paymentList.qualityDeduction)
+            this.paymentList.calculationPayable =  this.paymentList.calculationPayable.toFixed(2)
+      
               this.paymentList.actualPayment = this.paymentList.calculationPayable
               this.actualPayment( this.paymentList.actualPayment)
           }else{
             // this.paymentList.grainMoney=this.paymentList.qualityInspectionManagement.solidGrainPrice*this.paymentList.weighingManagement.netWeight
-             this.paymentList.grainMoney = this.paymentList.qualityInspectionManagement.dryGrainPrice * this.paymentList.weighingManagement.netWeight
-              this.paymentList.calculationPayable =  this.paymentList.grainMoney.toFixed(2)
+             this.paymentList.calculationPayable=Number(this.paymentList.grainMoney)+Number(this.paymentList.weighingSubsidy)+Number(this.paymentList.freightSubsidy)+Number(this.paymentList.unloadSubsidy)+Number(this.paymentList.otherSubsidy)-Number(this.paymentList.weighingDeduction)-this.paymentList.freightDeduction-Number(this.paymentList.unloadDeduction)-Number(this.paymentList.otherDeduction)-Number(this.paymentList.qualityDeduction)
+              this.paymentList.calculationPayable =  this.paymentList.calculationPayable.toFixed(2)
                 this.paymentList.actualPayment = this.paymentList.calculationPayable
                 this.actualPayment( this.paymentList.actualPayment)
           }
@@ -503,7 +508,7 @@ export default {
      this.paymentList.capitalize=this.convertCurrency(e)
     },
     grainMoney(){
-       this.paymentList.calculationPayable=(Number(this.paymentList.grainMoney)+Number(this.paymentList.weighingSubsidy)+Number(this.paymentList.freightSubsidy)+Number(this.paymentList.unloadSubsidy)+Number(this.paymentList.otherSubsidy))-this.paymentList.weighingDeduction-this.paymentList.freightDeduction-this.paymentList.unloadDeduction-this.paymentList.otherDeduction-this.paymentList.qualityDeduction.toFixed(2)
+       this.paymentList.calculationPayable=Number(this.paymentList.grainMoney)+Number(this.paymentList.weighingSubsidy)+Number(this.paymentList.freightSubsidy)+Number(this.paymentList.unloadSubsidy)+Number(this.paymentList.otherSubsidy)-Number(this.paymentList.weighingDeduction)-this.paymentList.freightDeduction-Number(this.paymentList.unloadDeduction)-Number(this.paymentList.otherDeduction)-Number(this.paymentList.qualityDeduction)
        this.paymentList.calculationPayable =  this.paymentList.calculationPayable.toFixed(2)
       this.paymentList.actualPayment = this.paymentList.calculationPayable
       this.actualPayment( this.paymentList.actualPayment)
@@ -733,9 +738,15 @@ export default {
       
     },
     cancel() {
+      this.isShowPrint = false
       this.paymentList = [] 
       this.$router.push({ path: 'paymentManagement' })
     },
+    closePrint(){
+        this.paymentList = [] 
+        this.isShowPrint = false
+        this.$router.push({path:'paymentManagement'})
+      },
   },
 }
 </script>

+ 73 - 9
src/views/houseSelfCollect/weightCheck.vue

@@ -77,6 +77,7 @@
             </ws-form-item>
             <ws-form-item label="毛重(公斤)" span="1" prop="grossWeight">
               <ws-input
+                v-if="this.tpyeNo != 2"
                 v-model="weighingList.grossWeight"
                 @input="calculation"
                 placeholder="未获取到毛重"
@@ -84,11 +85,20 @@
                 size="small"
                 :disabled="disabled"
               />
+              <ws-input
+                v-else
+                v-model="weighingList.grossWeight"
+                @input="calculation"
+                placeholder="未获取到毛重"
+                maxlength="100"
+                size="small"
+                disabled
+              />
             </ws-form-item>
             <el-button
               type="primary"
               :class="tpyeNo != 2 ? '' : 'butCss'"
-              @click="chongxin"
+              @click="openPort"
               >重新获取</el-button
             >
             <ws-form-item
@@ -103,9 +113,10 @@
                 placeholder="未获取到皮重"
                 maxlength="100"
                 size="small"
-                :disabled="disabled"/>
+                :disabled="disabled"
+                />
             </ws-form-item>
-            <el-button type="primary" v-if="this.tpyeNo == 2">重新获取</el-button>
+            <el-button type="primary" v-if="this.tpyeNo == 2" @click="openPort">重新获取</el-button>
             <div class="formItem">
               <ws-form-item
                 label="扣杂(公斤)"
@@ -188,6 +199,7 @@ export default {
       information: '',
       weighingList: {
         grossWeight: '',
+        tare: '',
         buckleMiscellaneous: 0,
       },
       tpyeNo: '',
@@ -196,7 +208,9 @@ export default {
       warehouseId: '',
       purchasePriceList: [],
       isShowPrint: false,
-      tableData:{}
+      tableData:{},
+      reader:null,
+      param:9600
     }
   },
   activated() {
@@ -221,14 +235,64 @@ export default {
     }
     if (this.tpyeNo == 1) {
       this.information = '毛重'
+      this.weighingList.tare = 0
     } else if (this.tpyeNo == 2) {
       this.information = '皮重'
     }
   },
+  deactivated(){
+    // this.closePort()
+  },
   methods: {
-    chongxin() {
-      if (this.tpyeNo == 2) {
-        return
+    async closePort(){
+      console.log('closePort');
+      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();
+        // 监听来自串行设备的数据
+        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) 
+          }
+          setTimeout(1000)
+          // value 是一个 Uint8Array
+        }
+         await port.close();
+      }
+      else{
+        console.log('the Web Serial API is not supported.',navigator);
       }
     },
     cancel() {
@@ -374,13 +438,13 @@ export default {
                     this.weighingList.goodsName == this.purchasePriceList[i].goodsName
                   ) {
                     //累计售粮超上限不能完成毛检保存
-                    let count = this.purchasePriceList[i].saleLimit - response
+                    let count =  (this.purchasePriceList[i].saleLimit -response/1000).toFixed(2)
                     console.log(this.weighingList.grossWeight/1000,"毛重转吨")
                     if (count - this.weighingList.grossWeight/1000 < 0) {
                       this.$alert(
                         '该客户累计销售' +
                           this.weighingList.goodsName +
-                          response +
+                          (response/1000).toFixed(2) +
                           '吨,还可售粮' +
                           count +
                           '吨',

+ 1 - 1
src/views/login/index_ship.vue

@@ -170,7 +170,7 @@ export default {
     this.loginForm.password = Cookies.get('ws_login_pwd')
       ? Cookies.get('ws_login_pwd')
       : ''
-    this.rememberMe = Cookies.get('ws_login_rememberMe') === '1'
+    // this.rememberMe = Cookies.get('ws_login_rememberMe') === '1'
     const arr = JSON.parse(JSON.stringify(zhJs))
     this.loop(arr, null)
 

+ 18 - 29
src/views/outboundManagement/collectionManagement.vue

@@ -331,30 +331,28 @@ export default {
     varietyClick(row) {
        if (
         row.actualCollectionment < 0 ||
-        row.actualCollectionment > 100000 ||
+        row.actualCollectionment > 1000000 ||
         (String(row.actualCollectionment).indexOf('.') != -1 &&
           String(row.actualCollectionment).length -
             (String(row.actualCollectionment).indexOf('.') + 1) >
             2)
       ) {
         this.$message({
-          message: '金额输入错误',
+          message: '实际应收输入错误',
           type: 'warning',
         })
         return
       }
-      if (row.actualCollectionment) {
-        if (isNaN(row.actualCollectionment)) {
-          this.$message({
-            message: '金额非数字!',
-            type: 'warning',
-          })
-          return
-        }
-      }
       if (!row.actualCollectionment) {
         this.$message({
-          message: '金额不能为空!',
+          message: '实际应收不能为空',
+          type: 'warning',
+        })
+        return
+      }
+      if (row.actualCollectionment < row.amountEdCollectionable) {
+        this.$message({
+          message: '实际应收不能小于已收款',
           type: 'warning',
         })
         return
@@ -413,7 +411,13 @@ export default {
       }
     },
     collectSubmit() {
-     
+     if (!this.collectionScreenshot) {
+        this.$message({
+          message: '请上传收款截图',
+          type: 'warning',
+        })
+        return
+      }
       this.$confirm(`确定提交收款信息?`, {
         cancelButtonText: '取消',
         confirmButtonText: '确定',
@@ -471,22 +475,6 @@ export default {
             })
         })
     },
-    //     disableReasons() {
-    //   this.outerVisible = false
-    //   this.disablieForm.disableStatusFlag = 0
-    //   disableDriver(this.disablieForm)
-    //     .toPromise()
-    //     .then((response) => {
-    //       this.$notify.success({
-    //         title: '成功',
-    //         message: '禁用成功',
-    //       })
-    //       this.getList()
-    //     })
-    //     .catch((response) => {
-    //       EventBus.$emit('error', response.message)
-    //     })
-    // },
     handlePictureCardPreview1(file) {
       this.collectionScreenshot = file.url
     },
@@ -532,6 +520,7 @@ export default {
       }).toPromise().then((response) => {
           for (var i = 0; i < response.records.length; i++) {
             response.records[i].identification = 'false'
+            response.records[i].contractPrice =  response.records[i].contractPrice/1000
           }
            this.collectList = response.records
         })

+ 2 - 10
src/views/outboundManagement/collectionment.vue

@@ -60,7 +60,7 @@
             </ws-form-item>
             <ws-form-item label="单价(元/公斤)" span="1" prop="contractPrice">
               <ws-input 
-              v-model="collectionList.contractPrice" placeholder="请输入单价" maxlength="100" size="small" disabled/>
+              v-model="collectionList.weighingManagement.contractPrice" placeholder="请输入单价" maxlength="100" size="small" disabled/>
             </ws-form-item>
             <ws-form-item label="车牌号" span="1" prop="carNo">
               <ws-input 
@@ -189,18 +189,10 @@ export default {
         id:this.$route.query.id,
         relationId: this.$route.query.relationId,
         compId: sessionStorage.getItem('ws-pf_compId'),
-      })
+      })     
       .toPromise()
       .then((response) => {
           this.collectionList = response
-          // this.qualityInspectionManagement = response
-          // this.paymentList.qualityInspectionManagement.waterMin=this.$route.query.waterMin
-          // this.paymentList.qualityInspectionManagement.weightDeduction=(this.paymentList.qualityInspectionManagement.waterContent-this.paymentList.qualityInspectionManagement.waterMin)*this.paymentList.buckleWeightRatio
-          // this.paymentList.base=(100-this.paymentList.qualityInspectionManagement.weightDeduction)/100
-          // this.paymentList.pureWeight=this.paymentList.base*this.paymentList.weighingManagement.netWeight
-          // if(!this.paymentList.solidGrainPrice){
-          //   this.paymentList.solidGrainPrice=this.paymentList.qualityInspectionManagement.tidalGrainPrice/this.paymentList.base
-          // }
         })
     },
   },

+ 136 - 48
src/views/outboundManagement/qualityInspection.vue

@@ -197,7 +197,6 @@ export default {
     this.inspect.carNumber = this.$route.query.carNumber
     this.inspect.goodsName = this.$route.query.goodsName
     this.inspect.storageTagNo = this.$route.query.storageTagNo
-    //this.inspect.personCharge = this.$route.query.personCharge
     let id = this.$route.query.id
     this.cangNo = this.$route.query.warehouseNo
     this.count = Number(this.$route.query.count)+1 
@@ -205,7 +204,6 @@ export default {
       this.disabled = true
       this.information = '查看'
     }
-    // this.calculation()
     this.getList(id)
   },
   methods: {
@@ -222,71 +220,161 @@ export default {
       }
       return year + mouth + datetime
     },
-    // calculation() {
-    //   let number ='000'+ this.count
-    //   number = number.substring(number.length - 4,number.length)
-    //   this.inspect.qualityNo = 'SGRK' + this.getdate()+this.cangNo+number //SGRK+8位时间+3位仓库编号+4位序列号
-    //   // + this.verifyinit()
-    // },
     print() {
       this.inspect.warehouseName = this.warehouseName
       this.inspect.id = this.$route.query.id
       this.inspect.qualityInspector = sessionStorage.getItem('ws-pf_staffName')
-          this.inspect.compId = sessionStorage.getItem('ws-pf_compId')
-      // if(this.types == null || this.types == ''){
-         this.$confirm('确定保存质检信息?', '提示', {
+      this.inspect.compId = sessionStorage.getItem('ws-pf_compId')
+              if (!this.inspect.grade) {
+          this.$message({
+            message: '等级不能为空',
+            type: 'warning',
+          })
+          return
+        }
+        if (!this.inspect.impurity) {
+          this.$message({
+            message: '杂质不能为空',
+            type: 'warning',
+          })
+          return
+        }
+        if (String(this.inspect.impurity).indexOf('.') != -1 && String(this.inspect.impurity).length - (String(this.inspect.impurity).indexOf('.') + 1) > 1) {
+          this.$message({
+            message: '杂质输入错误',
+            type: 'warning',
+          })
+          return
+        }
+        
+         if (this.inspect.impurity < 0 || this.inspect.impurity > 40) {
+          this.$message({
+            message: '杂质输入错误',
+            type: 'warning',
+          })
+          return
+        }
+        if (!this.inspect.waterContent) {
+          this.$message({
+            message: '水分不能为空',
+            type: 'warning',
+          })
+          return
+        }
+         if (this.inspect.waterContent < 0 || this.inspect.waterContent > 40) {
+          this.$message({
+            message: '水分输入错误',
+            type: 'warning',
+          })
+          return
+        }
+        if (String(this.inspect.waterContent).indexOf('.') != -1 && String(this.inspect.waterContent).length - (String(this.inspect.waterContent).indexOf('.') + 1) > 1) {
+          this.$message({
+            message: '水分输入错误',
+            type: 'warning',
+          })
+          return
+        }
+        if (!this.inspect.mildewGrain) {
+          this.$message({
+            message: '霉变粒不能为空',
+            type: 'warning',
+          })
+          return
+        }
+         if (this.inspect.mildewGrain < 0 || this.inspect.mildewGrain > 40) {
+          this.$message({
+            message: '霉变粒输入错误',
+            type: 'warning',
+          })
+          return
+        }
+         if (String(this.inspect.mildewGrain).indexOf('.') != -1 && String(this.inspect.mildewGrain).length - (String(this.inspect.mildewGrain).indexOf('.') + 1) > 1) {
+          this.$message({
+            message: '霉变粒输入错误',
+            type: 'warning',
+          })
+          return
+        }
+        if (!this.inspect.bulkDensity) {
+          this.$message({
+            message: '容重不能为空',
+            type: 'warning',
+          })
+          return
+        }
+         if (this.inspect.bulkDensity < 500 || this.inspect.bulkDensity > 1000) {
+          this.$message({
+            message: '容重输入错误',
+            type: 'warning',
+          })
+          return
+        }
+        if (String(this.inspect.bulkDensity).indexOf('.') != -1 && String(this.inspect.bulkDensity).length - (String(this.inspect.bulkDensity).indexOf('.') + 1) > 0) {
+          this.$message({
+            message: '容重需输入整数',
+            type: 'warning',
+          })
+          return
+        }
+        if (!this.inspect.jiaorenli) {
+          this.$message({
+            message: '热损伤不能为空',
+            type: 'warning',
+          })
+          return
+        }
+         if (this.inspect.jiaorenli < 0 || this.inspect.jiaorenli > 40) {
+          this.$message({
+            message: '热损伤输入错误',
+            type: 'warning',
+          })
+          return
+        }
+         if (String(this.inspect.jiaorenli).indexOf('.') != -1 && String(this.inspect.jiaorenli).length - (String(this.inspect.jiaorenli).indexOf('.') + 1) > 1) {
+          this.$message({
+            message: '热损伤输入错误',
+            type: 'warning',
+          })
+          return
+        }
+        if (!this.inspect.imperfectGrain) {
+          this.$message({
+            message: '不完善粒不能为空',
+            type: 'warning',
+          })
+          return
+        }
+         if (this.inspect.imperfectGrain < 0 || this.inspect.imperfectGrain > 40) {
+          this.$message({
+            message: '不完善粒输入错误',
+            type: 'warning',
+          })
+          return
+        }
+           if (String(this.inspect.imperfectGrain).indexOf('.') != -1 && String(this.inspect.imperfectGrain).length - (String(this.inspect.imperfectGrain).indexOf('.') + 1) > 1) {
+          this.$message({
+            message: '不完善粒输入错误',
+            type: 'warning',
+          })
+          return
+        }
+      this.$confirm('确定保存质检信息?', '提示', {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
         type: 'warning',
       })
         .then(() => {
-          
           addOut(this.inspect)
             .toPromise()
             .then((response) => {
               this.$message.success('保存成功')
-              // this.xx = true;
-              // let newstr = document.getElementById('print').innerHTML
-              // let oldstr = document.body.innerHTML
-              // document.body.innerHTML = newstr
-              // window.print()
-              // document.body.innerHTML = oldstr
-              // // window.location.reload()
               this.$router.push({ path: 'qualityInspectionManagement' })
             })
         })
         .catch(() => {
           return false
         })
-
-      // }else if(this.types == 1){
-      //    this.$confirm('确定保存质检信息?', '提示', {
-      //   confirmButtonText: '确定',
-      //   cancelButtonText: '取消',
-      //   type: 'warning',
-      // })
-      //   .then(() => {
-      //     // return
-      //     getinspectEdit(this.inspect)
-      //       .toPromise()
-      //       .then((response) => {
-      //         this.$message.success('修改成功')
-      //         // this.xx = true;
-      //         // let newstr = document.getElementById('print').innerHTML
-      //         // let oldstr = document.body.innerHTML
-      //         // document.body.innerHTML = newstr
-      //         // window.print()
-      //         // document.body.innerHTML = oldstr
-      //         // window.location.reload()
-      //         this.$router.push({ path: 'paymentManagement' })
-      //       })
-      //   })
-      //   .catch(() => {
-      //     return false
-      //   })
-
-      // }
-     
     },
     cancel() {
       this.$router.push({ path: 'qualityInspectionManagement' })

+ 3 - 2
src/views/outboundManagement/qualityInspectionManagement.vue

@@ -66,7 +66,7 @@
       <el-table-column width="300" label="操作">
         <template slot-scope="scope">
           <span v-if="scope.row.status == '已质检'"><el-button @click="qualityInspection(scope.row, 2)">查看</el-button></span>
-          <span v-if="scope.row.status == '已称重' || scope.row.status == '' || scope.row.status == null"><el-button @click="qualityInspection(scope.row, 1)">质检</el-button></span>
+          <span v-if="scope.row.status == '已称重' || scope.row.status == '' || scope.row.status == null"><el-button @click="qualityInspection(scope.row, 1)">质检</el-button></span>
         </template>
       </el-table-column>
     </el-table>
@@ -99,7 +99,7 @@ export default {
       pageSize: 10,
       deptCircularPage: {},
       deptBudgetTotal: 0,
-
+      managementType:3,
       searchKeyWord: '',
       taskTypeList: [],
       searchType: 0,
@@ -163,6 +163,7 @@ export default {
         pageSize: this.pageSize,
         searchKeyWord: this.searchKeyWord,
         warehouseName: this.warehouseName,
+        managementType : this.managementType,
       })
         .toPromise()
         .then((response) => {

+ 55 - 5
src/views/outboundManagement/weighing.vue

@@ -50,14 +50,14 @@
 							<ws-input v-model="weighingList.grossWeight" @input="calculation" placeholder="未获取到毛重"
 								maxlength="100" size="small" :disabled="disabled2" />
 						</ws-form-item>
-						<el-button type="primary" v-if="this.types == 1" @click="chongxin">重新获取</el-button>
+						<el-button type="primary" v-if="this.types == 1" @click="openPort">重新获取</el-button>
 
 						<ws-form-item label="皮重(公斤)" span="1" prop="tare">
 							<!-- <ws-input v-model="weighingList.tare" placeholder="未获取到皮重" maxlength="100" size="small"
 								disabled /> -->
 								<ws-input @input="calculation" v-model="weighingList.tare" placeholder="未获取到皮重" maxlength="100" size="small" />
 						</ws-form-item>
-						<el-button type="primary" v-if="this.types == 2 || this.types == null">重新获取</el-button>
+						<el-button type="primary" v-if="this.types == 2 || this.types == null" @click="openPort">重新获取</el-button>
 						<!-- <div class="formItem"> -->
 						<ws-form-item label="净重(公斤)" span="1" prop="netWeight" v-if="this.types == 1">
 							<ws-input v-model="weighingList.netWeight" placeholder="请输入净重" maxlength="100" size="small"
@@ -116,6 +116,8 @@
 					addressUrl: '',
 					buckleMiscellaneous: 0,
 					compId: sessionStorage.getItem('ws-pf_compId'),
+					grossWeight:'',
+					tare:''
 				},
 				disabled: false,
 				disabled1: false,
@@ -145,6 +147,8 @@
 				warehouseId: '', //仓库id
 				compId: sessionStorage.getItem('ws-pf_compId'),
 				size: 10,
+				reader:null,
+				param:9600
 			}
 		},
 		activated() {
@@ -171,10 +175,56 @@
 			this.getList(id)
 		},
 		methods: {
-			chongxin() {
-				if (this.types == 2 || this.types == 3) {
-					return
+			async closePort(){
+				console.log('closePort');
+				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();
+				// 监听来自串行设备的数据
+				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) 
+				}
+				setTimeout(1000)
+				// value 是一个 Uint8Array
+				}
+				await port.close();
+			}
+			else{
+				console.log('the Web Serial API is not supported.',navigator);
+			}
 			},
 			//附件
 			//上传附件

+ 1 - 1
vue.config.js

@@ -141,7 +141,7 @@ module.exports = {
         // target: 'https://product-server.winsea.com/', //目标地址
         // target: 'http://standard-dev.winsea.com/', //目标地址
         // target: 'http://localhost:8090/',
-        target: 'http://192.168.1.112:8090/',
+        target: 'http://192.168.1.103:9100/',
         // target: 'http://192.168.1.112:8090/',
         // target: 'http://192.168.1.121:8090/',
         // target: 'http://192.168.1.119:8090/',