zhongtianhaoyuan 2 年之前
父節點
當前提交
9ae2cd44ce
共有 2 個文件被更改,包括 373 次插入286 次删除
  1. 343 275
      pages/erpbusiness/add_quality_testing.vue
  2. 30 11
      pages/erpbusiness/edit_quality_testing.vue

File diff suppressed because it is too large
+ 343 - 275
pages/erpbusiness/add_quality_testing.vue


+ 30 - 11
pages/erpbusiness/edit_quality_testing.vue

@@ -311,9 +311,9 @@
 					<view v-else class="title">蛋白</view>
 					<view class="con-list">
 						<input :disabled='flag==1' type="digit" v-model='gridList.bulkDensity' placeholder="请输入容重"
-							name="input"></input>
-							<input  v-if='flag==1||flag==2' type="digit" v-model='gridList.reBulkDensity' placeholder="请输入容重"
-								name="input"></input>
+							name="input"  @input="obtainPrice"></input>
+							<input  v-if='flag==1||flag==2' type="digit" v-model='gridList.reBulkDensity' placeholder="请输入容重" 
+								name="input"  @input="obtainPrice"></input>
 					</view>
 				</view>
 				<view class="c-row ">
@@ -640,6 +640,21 @@
 			}
 		},
 		methods: {
+			obtainPrice(){//根据容重获取价格
+				if (this.gridList.goodsName && this.cangid && this.gridList.bulkDensity) {
+					// if (!this.gridList.dryGrainPrice || this.gridList.dryGrainPrice == 0) {
+						this.$api.doRequest('get', '/purchasePrice/tidalGrainPrice', {            
+							warehouseId: this.cangid,
+							goodsName: this.gridList.goodsName,
+							bulkDensity:this.gridList.bulkDensity
+						}).then(res => {
+							if(res.data.data != 0){
+								this.gridList.dryGrainPrice = res.data.data
+							}
+						})
+					// }
+				}
+			},
 			changeprice(){
 				if(this.pricetext=='解锁'){
 					this.pricedisabled=false
@@ -784,6 +799,17 @@
 			},
 			waterContentChange() {
 				var that = this
+				if (this.gridList.goodsName) {
+					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
+						}
+					}
+				}
+				if(this.gridList.serviceManagementType == 3){ //收购入库 不需在获取价格
+					return
+				}
 				if (this.gridList.goodsName && this.cangid) {
 					if (!this.gridList.dryGrainPrice || this.gridList.dryGrainPrice == 0) {
 						this.$api.doRequest('get', '/purchasePrice/dryGrainPrice', {
@@ -794,14 +820,7 @@
 						})
 					}
 				}
-				if (this.gridList.goodsName) {
-					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
-						}
-					}
-				}
+				
 				var numReg = /^[0-9]*$/
 				var numRe = new RegExp(numReg)
 				//潮粮单价改变事件

Some files were not shown because too many files changed in this diff