gjy 2 years ago
parent
commit
4c231f7466
2 changed files with 50 additions and 36 deletions
  1. 9 7
      pages/erpbusiness/add_quality_testing.vue
  2. 41 29
      pages/erpbusiness/edit_quality_testing.vue

+ 9 - 7
pages/erpbusiness/add_quality_testing.vue

@@ -1299,8 +1299,10 @@
 					}
 
 				}
-
-				
+						that.gridList.waterPriceIncrease=0
+						that.gridList.waterPriceDeduction=0
+						that.gridList.qualityPriceIncrease=0
+						that.gridList.qualityPriceDeduction=0
 				//潮粮单价改变事件
 				if (
 					this.gridList.goodsName &&
@@ -1313,17 +1315,17 @@
 						waterContent: this.gridList.waterContent,
 						grade: this.gridList.grade,
 					}).then(res => {
-						that.gridList.waterPriceIncrease=0
-						that.gridList.waterPriceDeduction=0
-						that.gridList.qualityPriceIncrease=0
-						that.gridList.qualityPriceDeduction=0
+						
 						if (that.gridList.paramType == '1') {
-							that.gridList.tidalGrainPrice = parseFloat(parseFloat(res.data.data) - parseFloat(that
+							if(that.gridList.buckleMiscellaneous){
+								that.gridList.tidalGrainPrice = parseFloat(parseFloat(res.data.data) - parseFloat(that
 								.gridList.buckleMiscellaneous) / 100 * parseFloat(that.gridList
 								.dryGrainPrice)).toFixed(4)
 								that.tidalGrainPrice = parseFloat(parseFloat(res.data.data) - parseFloat(that
 									.gridList.buckleMiscellaneous) / 100 * parseFloat(that.gridList
 									.dryGrainPrice)).toFixed(4)
+							}
+							
 							if (!that.gridList.tidalGrainPrice) {
 								that.gridList.tidalGrainPrice = ''
 							}

+ 41 - 29
pages/erpbusiness/edit_quality_testing.vue

@@ -950,36 +950,43 @@
 						})
 					}
 				}
-				
-				//潮粮单价改变事件
-				if (
-					this.gridList.goodsName &&
-					this.gridList.waterContent &&
-					this.gridList.grade 
-				) {
-				console.log('123123')
-					this.$api.doRequest('get', '/purchasePrice/tidalGrainPrice', {
-						warehouseId: this.cangid,
-						goodsName: this.gridList.goodsName,
-						waterContent: this.gridList.waterContent,
-						grade: this.gridList.grade,
-					}).then(res => {
-						that.gridList.waterPriceIncrease=0
-						that.gridList.waterPriceDeduction=0
-						that.gridList.qualityPriceIncrease=0
-						that.gridList.qualityPriceDeduction=0
-						if (that.gridList.paramType == '1') {
-							that.gridList.tidalGrainPrice = parseFloat(parseFloat(res.data.data) - parseFloat(that
-								.gridList.buckleMiscellaneous) / 100 * parseFloat(that.gridList
-								.dryGrainPrice)).toFixed(4)
-							if (!that.gridList.tidalGrainPrice) {
-								that.gridList.tidalGrainPrice = ''
+				that.gridList.waterPriceIncrease=0
+				that.gridList.waterPriceDeduction=0
+				that.gridList.qualityPriceIncrease=0
+				that.gridList.qualityPriceDeduction=0
+					//潮粮单价改变事件
+					if (
+						this.gridList.goodsName &&
+						this.gridList.waterContent &&
+						this.gridList.grade 
+					) {
+					console.log('123123')
+						this.$api.doRequest('get', '/purchasePrice/tidalGrainPrice', {
+							warehouseId: this.cangid,
+							goodsName: this.gridList.goodsName,
+							waterContent: this.gridList.waterContent,
+							grade: this.gridList.grade,
+						}).then(res => {
+							
+							if (that.gridList.paramType == '1') {
+								// console.log(that.gridList)
+								if(that.gridList.buckleMiscellaneous){
+									that.gridList.tidalGrainPrice = parseFloat(parseFloat(res.data.data) - parseFloat(that
+									.gridList.buckleMiscellaneous) / 100 * parseFloat(that.gridList
+									.dryGrainPrice)).toFixed(4)
+									that.tidalGrainPrice = parseFloat(parseFloat(res.data.data) - parseFloat(that
+									.gridList.buckleMiscellaneous) / 100 * parseFloat(that.gridList
+									.dryGrainPrice)).toFixed(4)
+								}
+								if (!that.gridList.tidalGrainPrice) {
+									that.gridList.tidalGrainPrice = ''
+								}
+							} else {
+								that.gridList.tidalGrainPrice = res.data.data
 							}
-						} else {
-							that.gridList.tidalGrainPrice = res.data.data
-						}
-					})
-				}
+						})
+					}
+				
 			},
 			goodsPicker(e) {
 				this.gridList.goodsName = this.goodsList[e[0]].goodsName
@@ -987,6 +994,11 @@
 			submit() {
 				this.$delete(this.gridList,'status')
 				this.gridList.agent=this.userInfo.userName;
+
+				// if(!this.$u.test.isEmpty(this.gridList.tidalGrainPrice)){
+				// 	this.gridList.tidalGrainPrice=''
+				// 	return
+				// }
 				if(this.flag==3){
 					this.gridList.statusFlag=7
 				}else if(this.flag==4||this.flag==0){