Jelajahi Sumber

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

gjy 2 tahun lalu
induk
melakukan
c92e038582

+ 17 - 1
src/views/houseSelfCollect/acquisitionManagementAdd.vue

@@ -377,10 +377,11 @@ export default {
             this.baseInfoForm.bulkDensityStandard = ''
           }
           this.baseInfoForm.goodsNameKey = response[0].constKey
-        } else {
+        } else{
           this.goodnameList = _list
           if (_list.length != 0) {
             this.selectVal = _list[0].constValue
+            // this.selectVal = _goodsNameList[0]
             if (this.selectVal == '玉米淀粉' ||
             this.selectVal == '玉米(机收)' ||
             this.selectVal == '玉米(酒精)' ||
@@ -514,9 +515,24 @@ export default {
         .toPromise()
         .then((response) => {
           this.baseInfoForm = response
+          this.selectVal = this.baseInfoForm.goodsName
           //构造查看priceList数据
           this.priceList = []
           this.makeLookPriceList()
+          if (this.selectVal == '玉米淀粉' ||
+            this.selectVal == '玉米(机收)' ||
+            this.selectVal == '玉米(酒精)' ||
+            this.selectVal == '玉米(筛漏)' ||
+            this.selectVal == '玉米(陈粮)' ||
+            this.selectVal == '玉米(棒)' ||
+            this.selectVal == '玉米'
+          ) {
+            this.isSolidFood = true
+            this.baseInfoForm.bulkDensityStandard = 1
+          } else {
+            this.isSolidFood = false
+            this.baseInfoForm.bulkDensityStandard = ''
+          }
           if (this.$route.query.type != '新增') {
             let _data = this.priceList
             this.checkList1 = []

+ 47 - 32
src/views/houseSelfCollect/inspectionManagementNew.vue

@@ -965,25 +965,8 @@ export default {
       this.deptBudgetList.customerPhone = customers[1].split(')')[0]
     },
     waterContentChange(type) {
-      if (this.deptBudgetList.goodsName && type != 'water') {
-        if (this.deptBudgetList.goodsName.indexOf('潮粮') != -1) {
-          this.deptBudgetList.type = '潮粮'
-        } else {
-          this.deptBudgetList.type = '干粮'
-        }
-        if (!this.deptBudgetList.dryGrainPrice || this.deptBudgetList.dryGrainPrice == 0) {
-          getDryGrainPrice({
-            warehouseId: this.cangid,
-            goodsName: this.deptBudgetList.goodsName
-          })
-            .toPromise()
-            .then((response) => {
-              this.$set(this.deptBudgetList, 'dryGrainPrice', response)
-            })
-        }
-        // debugger
-        //客户
-        if(this.serviceManagementType==3){
+          //客户
+          if(this.serviceManagementType==3){
           getcustomer({
             warehouseId: this.cangid,
             goodsName: this.deptBudgetList.goodsName
@@ -1007,7 +990,26 @@ export default {
               }
             })
         }
-        
+      if(this.deptBudgetList.inOutType=="收购入库"){ //收购入库  价格取至合同
+        return
+      }
+      if (this.deptBudgetList.goodsName && type != 'water') {
+        if (this.deptBudgetList.goodsName.indexOf('潮粮') != -1) {
+          this.deptBudgetList.type = '潮粮'
+        } else {
+          this.deptBudgetList.type = '干粮'
+        }
+        if (!this.deptBudgetList.dryGrainPrice || this.deptBudgetList.dryGrainPrice == 0) {
+          getDryGrainPrice({
+            warehouseId: this.cangid,
+            goodsName: this.deptBudgetList.goodsName
+          })
+            .toPromise()
+            .then((response) => {
+              this.$set(this.deptBudgetList, 'dryGrainPrice', response)
+            })
+        }
+        // debugger
         for (var i = 0; i < this.purchasePriceList.length; i++) {
           if (this.purchasePriceList[i].goodsName == this.deptBudgetList.goodsName) {
             this.$set(this.deptBudgetList, 'buckleWeightRatio', this.purchasePriceList[i].deductWeight)
@@ -1069,6 +1071,9 @@ export default {
            
           }
         });
+      }else{
+        if(this.deptBudgetList.inOutType=="收购入库"){ //收购入库  价格取至合同
+        return
       }else{
         getinspectLookUnitPrice({
           warehouseId: this.cangid,
@@ -1080,11 +1085,9 @@ export default {
             if(response){
              this.deptBudgetList.dryGrainPrice = response
             }
-
           })
+      } 
       }
-      
-
     },
     opendBtn() {
       html2canvas(this.$refs.saveImg.$el).then(canvas => {
@@ -1323,7 +1326,6 @@ export default {
       })
         .toPromise()
         .then((response) => {
-          // debugger
           console.log(response)
           this.deptBudgetList = response
           if (this.statusTypetext == '复检') {
@@ -3327,6 +3329,15 @@ export default {
           var data = this.taskNolist[i]
           if (this.taskNolist[i].inOutType == '移库入库') {
             this.deptBudgetList.contractNo = this.taskNolist[i].moveTaskNo
+          }else if(this.taskNolist[i].inOutType == '收购入库'){
+            this.deptBudgetList.contractNo = this.taskNolist[i].contractNo
+            this.deptBudgetList.inOutType == this.taskNolist[i].inOutType
+            this.deptBudgetList.goodsName = this.taskNolist[i].goodsName
+            if(this.taskNolist[i].goodsName.indexOf("潮粮") != -1){  //收购从合同中带出货名  单价等信息  用货名是否带有潮粮字符来判断干潮类型
+              this.deptBudgetList.type = "潮粮"
+            }else{
+              this.deptBudgetList.type = "干粮"
+            }
           } else {
             if (this.taskNolist[i].contractNo) {
               // console.log(this.taskNolist[i])
@@ -3343,7 +3354,9 @@ export default {
         if (
           this.outContractNo[i].contractNo == this.deptBudgetList.contractNo
         ) {
-          console.log(this.outContractNo[i])
+          if(this.outContractNo[i].priceType == "定价收购"){
+            this.deptBudgetList.dryGrainPrice = Number(this.outContractNo[i].unitContractPrice/1000).toFixed(2)
+          }
           if(this.serviceManagementType==3){
             var arr=this.goodnameList.filter((item)=>{return item.goodsName==this.outContractNo[i].goodsName})
             console.log(arr)
@@ -3352,13 +3365,15 @@ export default {
               this.deptBudgetList.goodsName = this.outContractNo[i].goodsName
             this.deptBudgetList.goodsNameKey = this.outContractNo[i].goodsNameKey
             }else{
-              this.deptBudgetList.goodsName=''
-              this.deptBudgetList.goodsNameKey=''
-              this.$message({
-                message: `当前仓库未设置:`+this.outContractNo[i].goodsName,
-                type: 'warning',   
-              });
-              break;
+              if(this.deptBudgetList.inOutType!="收购入库"){
+                 this.deptBudgetList.goodsName=''
+                  this.deptBudgetList.goodsNameKey=''
+                  this.$message({
+                    message: `当前仓库未设置:`+this.outContractNo[i].goodsName,
+                    type: 'warning',   
+                  });
+                  break;
+              }
             }
           }else{
             this.shipInfoList=this.outContractNo[i].shipInfoList