ccjgmwz 3 년 전
부모
커밋
0effdfa993
1개의 변경된 파일23개의 추가작업 그리고 9개의 파일을 삭제
  1. 23 9
      pages/erpbusiness/add_quality_testing.vue

+ 23 - 9
pages/erpbusiness/add_quality_testing.vue

@@ -32,13 +32,20 @@
 						 name="input"></input>
 				</view>
 			</view>
-			<view class="c-row ">
+			<view v-if="gridList.paramType != '1'" class="c-row ">
 				<view class="title">扣重比</view>
 				<view class="con-list">
 					<input v-model='gridList.buckleWeightRatio' placeholder="请输入扣重比"
 						 name="input"></input>
 				</view>
 			</view>
+			<view v-else class="c-row ">
+				<view class="title">扣杂</view>
+				<view class="con-list">
+					<input v-model='gridList.buckleMiscellaneous' placeholder="请输入扣杂" @input="waterContentChange"
+						 name="input"></input>
+				</view>
+			</view>
 			<view class="c-row ">
 				<view class="title">购粮性质</view>
 				<view class="con-list">
@@ -198,7 +205,8 @@
 					natureOfGrainPurchase:'贸易粮',
 					type:'潮粮',
 					tidalGrainPrice:'',
-					dryGrainPrice:''
+					dryGrainPrice:'',
+					buckleMiscellaneous:0
 				},
 				typeList:['潮粮','干粮'],
 				managementType:'',
@@ -261,8 +269,7 @@
 				warehouseId:this.cangid
 			}).then(res => {
 				if(res.data.data){
-					uni.setStorageSync('purchasePriceList',res.data.data)
-					this.purchasePriceList=uni.getStorageSync('purchasePriceList')
+					
 				}
 			})
 			this.managementType=options.managementType
@@ -294,10 +301,12 @@
 					warehouseId:this.cangid
 				}).then(res => {
 					if(res.data.data){
-						this.goodsList = res.data.data
-						if(this.goodsList.length > 0){
-							this.gridList.goodsName=this.goodsList[0].goodsName
-							this.waterContentChange()
+						that.goodsList = res.data.data
+						if(that.goodsList.length > 0){
+							that.gridList.goodsName=that.goodsList[0].goodsName
+							uni.setStorageSync('purchasePriceList',that.goodsList)
+							that.purchasePriceList=uni.getStorageSync('purchasePriceList')
+							that.waterContentChange()
 						}
 						
 						// for (let i = 0; i < res.data.data.length; i++) {
@@ -320,6 +329,7 @@
 				  for (var i = 0; i < this.purchasePriceList.length; i++) {
 					if (this.purchasePriceList[i].goodsName == this.gridList.goodsName) {
 					  this.gridList.buckleWeightRatio = this.purchasePriceList[i].deductWeight
+					  this.gridList.paramType = this.purchasePriceList[i].paramType
 					}
 				  }
 				}
@@ -338,7 +348,11 @@
 						waterContent: this.gridList.waterContent,
 						grade: this.gridList.grade,
 					}).then(res => {
-						that.gridList.tidalGrainPrice = res.data.data
+						if(that.gridList.paramType == '1'){
+							that.gridList.tidalGrainPrice = parseFloat(parseFloat(res.data.data) - parseFloat(that.gridList.buckleMiscellaneous)/100*parseFloat(that.gridList.dryGrainPrice)).toFixed(4)
+						}else{
+							that.gridList.tidalGrainPrice = res.data.data
+						}
 					})
 				}
 			},