ccjgmwz il y a 3 ans
Parent
commit
f6a367c7e7

+ 42 - 40
src/views/houseSelfCollect/inspectInfo.vue

@@ -56,7 +56,7 @@
             <ws-form-item v-else label="扣杂" span="1" prop="buckleWeightRatio">
               <ws-input type="number" @mousewheel.native.prevent v-model="inspect.buckleMiscellaneous" placeholder="请输入扣杂" maxlength="100" size="small"
                 :disabled="disabled" />
-                <ws-input v-if='types==4' type="number" @mousewheel.native.prevent v-model="inspect.reBuckleMiscellaneous" placeholder="请输入扣杂" maxlength="100" size="small"
+                <ws-input v-if='types==4' type="number" @mousewheel.native.prevent v-model="inspect.reBuckleMiscellaneous" @input="waterContentChange" placeholder="请输入扣杂" maxlength="100" size="small"
                 />
                 <ws-input v-else type="number" @mousewheel.native.prevent v-model="inspect.reBuckleMiscellaneous" placeholder="未复检" maxlength="100" size="small"
                 disabled />
@@ -118,8 +118,8 @@
           </ws-info-table>
           <div class="but">
             <el-button @click="cancel" v-if="this.types != 2" type="primary">取消</el-button>
-              <el-button @click="print" v-if="this.types ==3 || this.types ==4 ||this.types ==1" type="primary">保存</el-button>
-            <el-button @click="print" v-if="this.types ==5 " type="primary">保存并打印</el-button>
+            <el-button @click="print" v-if="this.types ==3 || this.types ==4 ||this.types ==1" type="primary">保存</el-button>
+            <el-button @click="print" v-if="this.types ==5 " type="primary">确认并打印</el-button>
             <el-button @click="cancel" v-if="this.types == 2" type="primary">关闭</el-button>
           </div>
         </div>
@@ -210,7 +210,7 @@
       this.warehouseName = this.$route.query.warehouseName
       this.cangNo = this.$route.query.warehouseNo
       this.count = Number(this.$route.query.count) + 1
-      this.purchasePriceList = this.$route.query.purchasePriceList
+      // this.purchasePriceList = this.$route.query.purchasePriceList
       this.id = this.$route.query.id
       if (this.types == 2) {
         this.disabled = true
@@ -367,27 +367,29 @@
           })
           return
         }
-        if (
-          this.inspect.buckleWeightRatio < 0 ||
-          this.inspect.buckleWeightRatio > 2
-        ) {
-          this.$message({
-            message: '扣重比输入错误',
-            type: 'warning',
-          })
-          return
-        }
-        if (
-          String(this.inspect.buckleWeightRatio).indexOf('.') != -1 &&
-          String(this.inspect.buckleWeightRatio).length -
-            (String(this.inspect.buckleWeightRatio).indexOf('.') + 1) >
-            2
-        ) {
-          this.$message({
-            message: '扣重比输入错误',
-            type: 'warning',
-          })
-          return
+        if(this.inspect.paramType == '2'){
+          if (
+            this.inspect.buckleWeightRatio < 0 ||
+            this.inspect.buckleWeightRatio > 2
+          ) {
+            this.$message({
+              message: '扣重比输入错误',
+              type: 'warning',
+            })
+            return
+          }
+          if (
+            String(this.inspect.buckleWeightRatio).indexOf('.') != -1 &&
+            String(this.inspect.buckleWeightRatio).length -
+              (String(this.inspect.buckleWeightRatio).indexOf('.') + 1) >
+              2
+          ) {
+            this.$message({
+              message: '扣重比输入错误',
+              type: 'warning',
+            })
+            return
+          }
         }
         if (!this.inspect.type) {
           this.$message({
@@ -593,7 +595,7 @@
             })
         } else if (this.types == 3) {
           this.inspect.flag=0
-          this.$confirm('确定保存检信息?', '提示', {
+          this.$confirm('确定保存检信息?', '提示', {
               confirmButtonText: '确定',
               cancelButtonText: '取消',
               type: 'warning',
@@ -614,7 +616,7 @@
         else if (this.types == 4) {
           this.inspect.flag=1
           this.inspect.reInspector=sessionStorage.getItem('ws-pf_roleName') + sessionStorage.getItem('ws-pf_staffName')
-          this.$confirm('确定保存检信息?', '提示', {
+          this.$confirm('确定保存检信息?', '提示', {
               confirmButtonText: '确定',
               cancelButtonText: '取消',
               type: 'warning',
@@ -704,24 +706,20 @@
         }
       },
 
-      // waterContentChange() {
-      //   debugger
-      //   if (this.inspect.goodsName) {
       waterContentChange(type) {
         if (this.inspect.goodsName&&type!='water') {
+          getDryGrainPrice({warehouseId:this.cangid,goodsName:this.inspect.goodsName})
+          .toPromise()
+          .then((response) => { 
+            this.$set(this.inspect,'dryGrainPrice',response)
+          })
           for (var i = 0; i < this.purchasePriceList.length; i++) {
             if (this.purchasePriceList[i].goodsName == this.inspect.goodsName) {
-              this.$set(this.inspect,'paramType',this.purchasePriceList[i].paramType)
               this.$set(this.inspect,'buckleWeightRatio',this.purchasePriceList[i].deductWeight)
+              this.$set(this.inspect,'paramType',this.purchasePriceList[i].paramType)
+              
             }
           }
-          if(this.inspect.type == '干粮'){
-             getDryGrainPrice({warehouseId:this.cangid,goodsName:this.inspect.goodsName})
-                .toPromise()
-                .then((response) => { 
-                  this.$set(this.inspect,'dryGrainPrice',response)
-                })
-          }
         }
         //潮粮单价改变事件
         if (
@@ -737,8 +735,11 @@
             })
             .toPromise()
             .then((response) => {
-              this.inspect.tidalGrainPrice = response
-              this.unitPrice = response
+              if(this.inspect.paramType == '1'){
+                this.inspect.tidalGrainPrice = parseFloat(parseFloat(response) - parseFloat(this.inspect.buckleMiscellaneous)/100*parseFloat(this.inspect.dryGrainPrice)).toFixed(4)
+              }else{
+                this.inspect.tidalGrainPrice = response
+              }
             })
         }
         if(this.inspect.goodsName && this.inspect.customerName ){
@@ -786,6 +787,7 @@
           .then((response) => {
             this.goodNameList = []
             this.goodNameList = response
+            this.purchasePriceList = response
           })
         // 品级
         packList({

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

@@ -102,7 +102,7 @@
             <!-- <el-button @click="inspectInfo(scope.row, 3)" v-if="scope.row.status=='已初检'" v-hasPermission="`acquisitionManagement.acquisitionQuality.edit`">初检</el-button>
             <el-button @click="inspectInfo(scope.row, 5)" v-if="scope.row.confirm!='1'" v-hasPermission="`acquisitionManagement.acquisitionQuality.edit`">确认</el-button>
             <el-button @click="inspectInfo(scope.row, 4)" v-if="scope.row.status!='1'" v-hasPermission="`acquisitionManagement.acquisitionQuality.edit`">复检</el-button> -->
-          <el-button @click="del(scope.row)" v-if="scope.row.weighingManagement.status=='已质检'" type="danger" v-hasPermission="`acquisitionManagement.acquisitionQuality.delete`">删除</el-button>
+          <el-button @click="del(scope.row)" v-if="!scope.row.weighingManagement || scope.row.weighingManagement.status=='已质检'" type="danger" v-hasPermission="`acquisitionManagement.acquisitionQuality.delete`">删除</el-button>
           <el-button @click="print(scope.row)" v-hasPermission="`acquisitionManagement.acquisitionQuality.print`">打印</el-button>
         </template>
       </el-table-column>
@@ -166,9 +166,7 @@ export default {
       isShowPrint: false,
       printData: {},
       deductWeight:'',//扣重比
-      saleLimit:'',
-      purchasePriceList:[]
-
+      saleLimit:''
     }
   },
   activated() {
@@ -203,8 +201,7 @@ export default {
           id: row.id,
           warehouseName: this.warehouseName,
           count: this.warehouseCount,
-          warehouseNo: this.warehouseNo,
-          purchasePriceList:this.purchasePriceList
+          warehouseNo: this.warehouseNo
         },
       })
     },
@@ -216,7 +213,6 @@ export default {
           this.warehouseNo = this.warehouseList[i].No
           this.cangid = this.warehouseList[i].id
           this.WAREHOUSE[1].payname = this.warehouseList[i].value
-          this.purchasePriceList = this.warehouseList[i].purchasePriceList
         }
       }
       this.getList()
@@ -270,14 +266,12 @@ export default {
               value: response[i].warehouseName,
               id: response[i].id,
               count: response[i].count,
-              purchasePriceList: response[i].purchasePriceList,
               No:response[i].commonWarehouseNo
             })
             if (this.cangid&&this.cangid == response[i].id) {
               this.warehouseName = response[i].warehouseName
               this.warehouseCount =  response[i].count
               this.warehouseNo =  response[i].commonWarehouseNo
-              this.purchasePriceList =  response[i].purchasePriceList
             } 
           }
           if(this.warehouseList.length > 0 && !this.cangid){
@@ -285,7 +279,6 @@ export default {
             this.warehouseCount =  this.warehouseList[0].count
             this.warehouseNo =  this.warehouseList[0].No
             this.cangid =  this.warehouseList[0].id
-            this.purchasePriceList =  this.warehouseList[0].purchasePriceList
             this.WAREHOUSE[1].payname = this.warehouseList[0].value
           }
           this.getList()

+ 1 - 1
src/views/houseSelfCollect/settlement.vue

@@ -191,7 +191,7 @@
               disabled
               />
             </ws-form-item>
-            <ws-form-item v-if='paymentList.type=="潮粮"' label="扣杂(公斤)" span="1" prop="waterContent">
+            <ws-form-item v-if='paymentList.type=="潮粮"' label="扣杂" span="1" prop="waterContent">
               <ws-input type="number" @mousewheel.native.prevent v-model="paymentList.qualityInspectionManagement.buckleMiscellaneous" placeholder="请输入扣杂" maxlength="100" size="small" disabled/>
             </ws-form-item>
             <ws-form-item  label="扣单价(元/公斤)" span="1" prop="unitDeduction">