achao преди 1 година
родител
ревизия
f6868c6b02
променени са 1 файла, в които са добавени 250 реда и са изтрити 631 реда
  1. 250 631
      pages/erpbusiness/add_quality_testing.vue

+ 250 - 631
pages/erpbusiness/add_quality_testing.vue

@@ -461,6 +461,7 @@
 </template>
 
 <script>
+	var that;
 	const Equ_List = ['waterContent', 'bulkDensity', 'imperfectGrain', 'impurity', 'mildewGrain', 'jiaorenli'];
 	import dragButton from "@/components/drag-button/drag-button.vue";
 	import keyboard from "@/components/master-keyboard/master-keyboard.vue";
@@ -479,7 +480,9 @@
 		},
 		data() {
 			return {
-				redstatus:false,
+				isQY: false,
+				isZJ: false,
+				redstatus: false,
 				isShowPrint: false,
 				isShowAlert: false,
 				disabled1: false,
@@ -523,7 +526,7 @@
 					name: '他运',
 					value: '他运'
 				}],
-				printId:'',
+				printId: '',
 				typevalue: '3',
 				coverTransform: 'translateY(0px)',
 				coverTransition: '0s',
@@ -778,6 +781,8 @@
 			}
 		},
 		onLoad(options) {
+			that = this
+			console.log(that)
 			console.log(this.cangid)
 			this.commonWarehouseNo = options.commonWarehouseNo
 			this.warehouseCount = Number(options.warehouseCount) + 1
@@ -827,8 +832,8 @@
 
 			// 	this.gridList.customerNumberCard = _customerInfo.customerNumberCard
 			// }
-			this.gridList.grade = this.gradeList[2].value
-			this.gridList.gradeKey = this.gradeList[2].key
+			this.gridList.grade = this.gradeList[1].value
+			this.gridList.gradeKey = this.gradeList[1].key
 
 			this.$api.doRequest('get', '/qualityInspectionManagement/api/goodsName', {
 				warehouseId: this.cangid
@@ -851,9 +856,11 @@
 			console.log(this.gridList)
 			this.gridListInit = this.gridList
 		},
-		onShow() {
-			if (this.utils.getCurrectRoles('acquisitionQuality.initial') && !this.utils.getCurrectRoles(
-					'acquisitionQuality.qview')) {
+		async onShow() {
+			this.isQY = this.utils.getCurrectRoles('acquisitionQuality.qview')
+			this.isZJ = this.utils.getCurrectRoles('acquisitionQuality.initial')
+
+			if (this.isZJ && !this.isQY) {
 				this.typevalue = '1'
 				this.contractFlag = 7
 			} else {
@@ -870,10 +877,11 @@
 				this.flag = 2
 
 			}
-			this.$api.doRequest('get', '/inOutWarehouseTask/selectInOutWarehouseNo', {
+			await this.$api.doRequest('get', '/inOutWarehouseTask/selectInOutWarehouseNo', {
 				flag: this.flag,
 				warehouseName: this.gridList.warehouseName
 			}).then(res => {
+				console.log(1)
 				console.log(res)
 				this.taskNolist = res.data.data
 			})
@@ -881,10 +889,11 @@
 				name: '他运',
 				value: '他运'
 			}]
-			this.$api.doRequest('get', '/inOutWarehouseTask/getContractNo', {
+			await this.$api.doRequest('get', '/inOutWarehouseTask/getContractNo', {
 				warehouseName: this.gridList.warehouseName
 			}).then(res => {
 				uni.hideLoading();
+				console.log(2)
 				// console.log(res)
 				if (res.data.data.contractManagementInfoList) {
 					for (let i = 0; i < res.data.data.contractManagementInfoList.length; i++) {
@@ -917,39 +926,40 @@
 
 				this.gridList.customerNumberCard = _customerInfo.customerNumberCard
 				var that = this
-				setTimeout(()=>{
-				},1000)
+				setTimeout(() => {}, 1000)
 				console.log(this.gridList.goodsName)
-				if(!this.gridList.goodsName){
+				if (!this.gridList.goodsName) {
 					this.gridList.goodsName = uni.getStorageSync('goodsName')
 				}
-					if(this.gridList.goodsName){
-						uni.showLoading({
-							title: '加载中',
-							mask: true
-						})
-						this.$api.doRequest('get', '/qualityInspectionManagement/getQualityInspectionManagementMap', {
+				if (this.gridList.goodsName) {
+					uni.showLoading({
+						title: '加载中',
+						mask: true
+					})
+					await this.$api.doRequest('get',
+						'/qualityInspectionManagement/getQualityInspectionManagementMap', {
 							goodsName: this.gridList.goodsName,
 							compId: uni.getStorageSync('pcUserInfo').compId,
 							customerNumberCard: this.gridList.customerNumberCard,
 							warehouseName: this.gridList.warehouseName
 						}).then(res => {
-							uni.hideLoading();
-							if(res.data.data.A+res.data.data.B+res.data.data.C*50>res.data.data.D-50){
-								that.redstatus=true
-							}else{
-								that.redstatus=false
-							}
-							var a=res.data.data.A>0?'已完成'+Number(res.data.data.A).toFixed(2)+'吨,':''
-							var b=res.data.data.B>0?'进行中'+Number(res.data.data.B).toFixed(2)+'吨,':''
-							var c=res.data.data.C>0?'未称重'+Number(res.data.data.C)+'车':''
-									  
-							that.gridList.volumeofbusiness=a+b+c
-							console.log(that.gridList.volumeofbusiness)
-							that.$forceUpdate()
-						})
-					}
-				
+						console.log(3)
+						uni.hideLoading();
+						if (res.data.data.A + res.data.data.B + res.data.data.C * 50 > res.data.data.D - 50) {
+							that.redstatus = true
+						} else {
+							that.redstatus = false
+						}
+						var a = res.data.data.A > 0 ? '已完成' + Number(res.data.data.A).toFixed(2) + '吨,' : ''
+						var b = res.data.data.B > 0 ? '进行中' + Number(res.data.data.B).toFixed(2) + '吨,' : ''
+						var c = res.data.data.C > 0 ? '未称重' + Number(res.data.data.C) + '车' : ''
+
+						that.gridList.volumeofbusiness = a + b + c
+						console.log(that.gridList.volumeofbusiness)
+						that.$forceUpdate()
+					})
+				}
+
 			}
 		},
 		methods: {
@@ -1149,8 +1159,8 @@
 					// number = number.substring(number.length - 4, number.length)
 					// this.gridList.qualityNo = 'SGRK' + this.getdate() + this.commonWarehouseNo + number
 				}
-				this.gridList.grade = this.gradeList[2].value
-				this.gridList.gradeKey = this.gradeList[2].key
+				this.gridList.grade = this.gradeList[1].value
+				this.gridList.gradeKey = this.gradeList[1].key
 				this.$api.doRequest('get', '/inOutWarehouseTask/selectInOutWarehouseNo', {
 					flag: this.flag,
 					warehouseName: this.gridList.warehouseName
@@ -1162,7 +1172,7 @@
 				console.log(this.gridList, 111111111111)
 			},
 			outtypepicker(e, status) {
-				console.log(e,status)
+				console.log(e, status)
 				if (status == 0) {
 					this.gridList.outType = this.multiSelector[e[0]].name
 				} else {
@@ -1328,8 +1338,8 @@
 						}
 					}
 					this.gridList.goodsNameKey = this.contractNolist.goodsNameKey
-					this.gridList.grade = this.gradeList[2].value
-					this.gridList.gradeKey = this.gradeList[2].key
+					this.gridList.grade = this.gradeList[1].value
+					this.gridList.gradeKey = this.gradeList[1].key
 					// this.gridList.grade = this.contractNolist.grade
 					this.gridList.inOutType = this.contractNolist.inOutType
 
@@ -1416,28 +1426,32 @@
 						this.tranCarInfoList = []
 					}
 					this.fleetNameList = this.contractNolist.tranCarInfoList1
-					if(this.gridList.goodsName&&this.gridList.customerNumberCard){
+					if (this.gridList.goodsName && this.gridList.customerNumberCard) {
 						uni.showLoading({
-						title: '加载中',
-						mask: true
-					})
-					let that  = this
-					this.$api.doRequest('get', '/qualityInspectionManagement/getQualityInspectionManagementMap', {
-							goodsName: this.gridList.goodsName,
-							compId: uni.getStorageSync('pcUserInfo').compId,
-							customerNumberCard: this.gridList.customerNumberCard
-						}).then(res => {
-							uni.hideLoading(); 
-							if(res.data.data.A+res.data.data.B+res.data.data.C*50>res.data.data.D-50){
-								that.redstatus=true
-							}else{
-								that.redstatus=false
+							title: '加载中',
+							mask: true
+						})
+						let that = this
+						this.$api.doRequest('get',
+							'/qualityInspectionManagement/getQualityInspectionManagementMap', {
+								goodsName: this.gridList.goodsName,
+								compId: uni.getStorageSync('pcUserInfo').compId,
+								customerNumberCard: this.gridList.customerNumberCard
+							}).then(res => {
+							uni.hideLoading();
+							if (res.data.data.A + res.data.data.B + res.data.data.C * 50 > res.data.data
+								.D - 50) {
+								that.redstatus = true
+							} else {
+								that.redstatus = false
 							}
-							var a=res.data.data.A>0?'已完成'+Number(res.data.data.A).toFixed(2)+'吨,':''
-							var b=res.data.data.B>0?'进行中'+Number(res.data.data.B).toFixed(2)+'吨,':''
-							var c=res.data.data.C>0?'未称重'+Number(res.data.data.C)+'车':''
-									  
-							that.gridList.volumeofbusiness=a+b+c
+							var a = res.data.data.A > 0 ? '已完成' + Number(res.data.data.A).toFixed(2) +
+								'吨,' : ''
+							var b = res.data.data.B > 0 ? '进行中' + Number(res.data.data.B).toFixed(2) +
+								'吨,' : ''
+							var c = res.data.data.C > 0 ? '未称重' + Number(res.data.data.C) + '车' : ''
+
+							that.gridList.volumeofbusiness = a + b + c
 							console.log(that.gridList.volumeofbusiness)
 							that.$forceUpdate()
 						})
@@ -1448,7 +1462,7 @@
 			},
 			print() {
 				console.log(this.printId)
-				if(this.printId){
+				if (this.printId) {
 					this.$api.doRequest('get', '/qualityInspectionManagement/api/getQualityInspection', {
 						id: this.printId
 					}).then(res => {
@@ -1458,7 +1472,7 @@
 						})
 					})
 				}
-				
+
 			},
 			close() {
 				this.isShowPrint = false
@@ -1484,24 +1498,10 @@
 			handleClick(e) {
 				this.gridList.carNumber = e.value //键盘输入值
 			},
-			// confirmInfo() {
-			// 	this.isShowAlert = true	
-			// },
-			// alertBtn() {
-			// 	this.$api.doRequest('get', '/qualityInspectionManagement/api/editQualityInspection', {
-			// 		id: this.id,
-			// 		flag:2
-			// 	}).then(res => {
-			// 		if(res.data.code=="200"){
-			// 			this.$api.msg('提交成功!')
-			// 		}else{
-			// 			this.$api.msg('提交失败')
-			// 		}
-			// 	})
-			// },
 			cancelClick() {
 				this.isShowAlert = false
 			},
+
 			waterContentChange() {
 				var that = this
 				if (this.gridList.goodsName) {
@@ -1538,9 +1538,9 @@
 					this.gridList.waterContent &&
 					this.gridList.grade
 				) {
-					
+
 					uni.showLoading({
-						title:"加载中"
+						title: "加载中"
 					})
 					this.$api.doRequest('get', '/purchasePrice/tidalGrainPrice', {
 						warehouseId: this.cangid,
@@ -1600,7 +1600,161 @@
 				}
 				return year + '' + mouth + '' + datetime
 			},
+			async addQualityInspection(type) {
+				if (type == 1) {
+					await this.$api.doRequest('post', '/qualityInspectionManagement/api/addQualityInspection', this
+							.gridList)
+						.then(res => {
+							console.log(res)
+							this.printId = res.data.data
+							uni.hideLoading()
+							if (res.data.code == 200) {
+								console.log("addQualityInspection")
+								this.$api.msg('提交成功')
+								this.gridList.warehouseId = this.cangid
+								this.gridList.compId = uni.getStorageSync(
+									'pcUserInfo').compId
+								uni.setStorageSync("quality_print", this.gridList)
+								if (this.isZJ) {
+									this.isShowPrint = true
+								} else {
+									uni.navigateBack({})
+								}
+
+								console.log('that.gridList', this.gridList)
+								// uni.navigateBack({})
+							} else {
+								this.$api.msg('提交失败')
+							}
+						})
+					return
+				}
+				if (type == 2) {
+					await this.$api.doRequest('post', '/qualityInspectionManagement/api/addQualityInspection', this
+							.gridList)
+						.then(res => {
+							console.log("addQualityInspection")
+							this.printId = res.data.data
+							uni.hideLoading()
+							if (res.data.code == 200) {
+								this.$api.msg('提交成功')
+								this.gridList.warehouseId = this.cangid
+								this.gridList.compId = uni.getStorageSync('pcUserInfo').compId
+								uni.setStorageSync("quality_print", this.gridList)
+								if (this.isZJ) {
+									this.isShowPrint = true
+								} else {
+									uni.navigateBack({})
+								}
+								uni.setStorageSync(
+									'checkcustomer', {}
+								)
+								console.log('that.gridList', this.gridList)
+								// uni.navigateBack({})
+							} else {
+								this.$api.msg('提交失败')
+							}
+						})
+				}
+
+			},
+			async inOutWarehouse(type) {
+				if (type == 1) {
+					await this.$api.doRequest('post', '/warehouseInOutInfo/InOutWarehouse', this.gridList)
+						.then(res => {
+							console.log("InOutWarehouse")
+							this.gridList.warehouseInOutId = res.data.data
+						})
+					return
+				}
+				if (type == 2) {
+					await this.$api.doRequest('post', '/warehouseInOutInfo/InOutWarehouse', this.gridList)
+						.then(res => {
+							console.log("InOutWarehouse")
+							if (this.isQY) {
+								if (!this.isZJ) {
+									this.gridList.statusFlag = 7
+								} else {
+									this.gridList.statusFlag = 0
+								}
+							}
+							this.gridList.warehouseInOutId = res.data.data
+							this.addQualityInspection(2)
+						})
+					return
+				}
+
+			},
+			async cumulant(type) {
+				if (type == 1) {
+					await this.$api.doRequest('get', '/paymentManagement/cumulant', {
+							compId: uni.getStorageSync('pcUserInfo').compId,
+							customerNumberCard: this.gridList.customerNumberCard,
+							goodsName: this.gridList.goodsName,
+						})
+						.then(response => {
+							console.log("cumulant")
+							if (response.data.code == 200) {
+								for (let i = 0; i < this.purchasePriceList.length; i++) {
+									if (this.gridList.goodsName == this.purchasePriceList[i].goodsName) {
+										let count = (this.purchasePriceList[i].saleLimit - response.data.data /
+												1000)
+											.toFixed(2)
+										console.log(count, this.purchasePriceList[i].saleLimit, response.data.data)
+
+										if (Number(count) <= 0) {
+											count = 0
+											this.$api.msg('该客户累计销售' + this.gridList.goodsName + (response.data
+												.data /
+												1000).toFixed(2) + '吨,还可售粮' + count + '吨', )
+											uni.hideLoading()
+											break;
+										}
+
+										this.gridList.inOutFlag = 2
+										this.inOutWarehouse(2)
+									}
+								}
+							}
+						})
+					return
+				}
+
+			},
+			async getGoodsName() {
+				let that = this
+				await this.$api.doRequest('get', '/qualityInspectionManagement/api/goodsName', {
+					warehouseId: this.cangid
+				}).then(res => {
+					if (res.data.code != 200 && that.typevalue == 3) {
+						uni.showModal({
+							content: res.data.message,
+							showCancel: false
+						})
+						return;
+					}
+					uni.showModal({
+						content: "确定提交质检信息?",
+						showCancel: true,
+						confirmText: '提交',
+						success: function(res) {
+							if (res.confirm) {
+								that.gridList.serviceManagementType = that.typevalue
+								if (that.typevalue == 3) {
+									that.cumulant(1)
+									return
+								}
+								that.gridList.inOutFlag = 2
+								that.inOutWarehouse(1)
+								that.addQualityInspection(1)
+							}
+						}
+					})
+				})
+			},
 			submit() {
+				console.log(this.isQY, "isQY")
+				console.log(this.isZJ, "isZJ")
 				if (this.typevalue == 3) {
 					if (this.outType) {
 						this.gridList.outType = this.outType
@@ -1626,11 +1780,6 @@
 					return
 				}
 				if (this.utils.getCurrectRoles('acquisitionQuality.initial')) {
-
-					// if (!this.gridList.qualityNo) {
-					// 	this.$api.msg('编号不能为空')
-					// 	return
-					// }
 					if (!this.gridList.binNumber) {
 						this.$api.msg('仓位不能为空')
 						return
@@ -1641,22 +1790,6 @@
 							return
 						}
 					}
-					// if (this.gridList.waterPriceIncrease>10||this.gridList.waterPriceIncrease<0) {
-					// 	this.$api.msg('水分增价输入错误')
-					// 	return
-					// }
-					// if (this.gridList.waterPriceDeduction>10||this.gridList.waterPriceDeduction<0) {
-					// 	this.$api.msg('水分扣价输入错误')
-					// 	return
-					// }
-					// if (this.gridList.qualityPriceIncrease>10||this.gridList.qualityPriceIncrease<0) {
-					// 	this.$api.msg('质量增价输入错误')
-					// 	return
-					// }
-					// if (this.gridList.qualityPriceDeduction>10||this.gridList.qualityPriceDeduction<0) {
-					// 	this.$api.msg('质量扣价输入错误')
-					// 	return
-					// }
 					if (!this.gridList.type) {
 						this.$api.msg('类型不能为空')
 						return
@@ -1704,7 +1837,7 @@
 						}
 					}
 				}
-				if (this.utils.getCurrectRoles('acquisitionQuality.qview')) {
+				if (this.isQY) {
 					if (this.typevalue == 3) {
 						if (!this.gridList.customerName) {
 							this.$api.msg('客户不能为空')
@@ -1724,556 +1857,42 @@
 						return
 					}
 				}
-				var text = ''
-				if (this.utils.getCurrectRoles('acquisitionQuality.qview') && !this.utils.getCurrectRoles(
-						'acquisitionQuality.initial')) {
-					text = "确定提交钎样信息?"
-					this.gridList.brazer = 1
+				// 钎样提交
+				if (this.isQY && !this.isZJ) {
+					that.gridList.serviceManagementType = that.typevalue
 					uni.showModal({
-						content: text,
+						content: "确定提交钎样信息?",
 						showCancel: true,
 						confirmText: '提交',
 						success: function(res) {
 							if (res.confirm) {
-								that.gridList.serviceManagementType = that.typevalue
 								if (that.typevalue == 3) {
 									uni.showLoading({
-										title: '加载中',
-										mask: true
-									})
-									that.$api.doRequest('get', '/paymentManagement/cumulant', {
-											compId: uni.getStorageSync('pcUserInfo').compId,
-											customerNumberCard: that.gridList.customerNumberCard,
-											goodsName: that.gridList.goodsName,
-										})
-										.then(response => {
-											if (response.data.code == 200) {
-												for (let i = 0; i < that.purchasePriceList.length; i++) {
-													if (
-														that.gridList.goodsName == that.purchasePriceList[
-															i]
-														.goodsName
-													) {
-														let count = (that.purchasePriceList[i].saleLimit -
-															response.data.data / 1000).toFixed(2)
-														console.log(count, that.purchasePriceList[i]
-															.saleLimit,
-															response.data.data)
-
-														if (Number(count) <= 0) {
-															count = 0
-															that.$api.msg('该客户累计销售' + that.gridList
-																.goodsName +
-																(
-																	response.data.data / 1000).toFixed(
-																	2) +
-																'吨,还可售粮' +
-																count + '吨', )
-																uni.hideLoading()
-
-														} else {
-															that.gridList.inOutFlag = 2
-															that.$api.doRequest('post',
-																	'/warehouseInOutInfo/InOutWarehouse',
-																	that.gridList)
-																.then(res => {
-																	if (res.data.code ==
-																		200) {
-																	if (that.utils.getCurrectRoles(
-																			'acquisitionQuality.qview'
-																		)) {
-																		if (!that.utils
-																			.getCurrectRoles(
-																				'acquisitionQuality.initial'
-																			)) {
-																			that.gridList.statusFlag =
-																				7
-																		} else {
-																			that.gridList.statusFlag =
-																				0
-																		}
-																	}
-																	that.gridList.warehouseInOutId =
-																		res.data.data
-																	if(that.gridList.warehouseInOutId){
-																		that.$api.doRequest('post',
-																				'/qualityInspectionManagement/api/addQualityInspection',
-																				that.gridList)
-																			.then(res => {
-																				that.printId=res.data.data
-																				uni.hideLoading()
-																				if (res.data.code ==
-																					200) {
-																					that.$api.msg(
-																						'提交成功')
-																					that.gridList
-																						.warehouseId =
-																						that
-																						.cangid
-																					that.gridList
-																						.compId =
-																						uni
-																						.getStorageSync(
-																							'pcUserInfo'
-																						)
-																						.compId
-																					uni.setStorageSync(
-																						"quality_print",
-																						that
-																						.gridList)
-																					if (that.utils
-																						.getCurrectRoles(
-																							'acquisitionQuality.initial'
-																						)) {
-																						that.isShowPrint =
-																							true
-																					} else {
-																						uni.navigateBack({})
-																					}
-																					uni.setStorageSync('checkcustomer',{})
-																					console.log(
-																						'that.gridList',
-																						that
-																						.gridList)
-																					// uni.navigateBack({})
-																				} else {
-																					that.$api.msg(
-																						'提交失败')
-																				}
-																			})
-																	}
-																	else{
-																		uni.hideLoading()
-																	}
-																}
-																else{
-																	uni.hideLoading()
-																}
-																})
-																
-														}
-													}
-												}
-											}
-										})
-								} else {
-									uni.showLoading({
-										title: '加载中',
-										mask: true
+										title: "加载中"
 									})
-									that.gridList.inOutFlag = 2
-									that.$api.doRequest('post',
-											'/warehouseInOutInfo/InOutWarehouse',
-											that.gridList)
-										.then(res => {
-
-											that.gridList.warehouseInOutId = res.data.data
-											if(that.gridList.warehouseInOutId){
-												that.$api.doRequest('post',
-														'/qualityInspectionManagement/api/addQualityInspection',
-														that.gridList)
-													.then(res => {
-														console.log(res)
-														that.printId=res.data.data
-														uni.hideLoading()
-														if (res.data.code == 200) {
-															that.$api.msg('提交成功')
-															that.gridList.warehouseId = that.cangid
-															that.gridList.compId = uni.getStorageSync(
-																'pcUserInfo').compId
-															uni.setStorageSync("quality_print", that
-																.gridList)
-															if (that.utils.getCurrectRoles(
-																	'acquisitionQuality.initial')) {
-																that.isShowPrint = true
-															} else {
-																uni.navigateBack({})
-															}
-												
-															console.log('that.gridList', that.gridList)
-															// uni.navigateBack({})
-														} else {
-															that.$api.msg('提交失败')
-														}
-													})
-											}
-											else{
-												uni.hideLoading()
-											}
-											
-										})
+									that.cumulant(1)
+									return
 								}
-
+								uni.showLoading({
+									title: "加载中"
+								})
+								that.gridList.inOutFlag = 2
+								that.inOutWarehouse(1)
+								that.addQualityInspection(1)
 							}
+
 						}
 					})
 				} else {
-					text = "确定提交质检信息?"
 					this.gridList.brazer = 0
-					this.$api.doRequest('get', '/qualityInspectionManagement/api/goodsName', {
-						warehouseId: this.cangid
-					}).then(res => {
-						if (res.data.code != 200 && that.typevalue == 3) {
-							uni.showModal({
-								content: res.data.message,
-								showCancel: false
-							})
-							return;
-						} else {
-							uni.showModal({
-								content: text,
-								showCancel: true,
-								confirmText: '提交',
-								success: function(res) {
-									if (res.confirm) {
-										that.gridList.serviceManagementType = that.typevalue
-										if (that.typevalue == 3) {
-											uni.showLoading({
-												title: '加载中',
-												mask: true
-											})
-											that.$api.doRequest('get', '/paymentManagement/cumulant', {
-													compId: uni.getStorageSync('pcUserInfo')
-														.compId,
-													customerNumberCard: that.gridList
-														.customerNumberCard,
-													goodsName: that.gridList.goodsName,
-												})
-												.then(response => {
-													if (response.data.code == 200) {
-														for (let i = 0; i < that.purchasePriceList
-															.length; i++) {
-															if (
-																that.gridList.goodsName == that
-																.purchasePriceList[i]
-																.goodsName
-															) {
-																let count = (that
-																		.purchasePriceList[i]
-																		.saleLimit -
-																		response.data.data / 1000)
-																	.toFixed(2)
-																console.log(count, that
-																	.purchasePriceList[i]
-																	.saleLimit,
-																	response.data.data)
-
-																if (Number(count) <= 0) {
-																	count = 0
-																	that.$api.msg('该客户累计销售' + that
-																		.gridList.goodsName +
-																		(
-																			response.data
-																			.data / 1000)
-																		.toFixed(2) +
-																		'吨,还可售粮' +
-																		count + '吨', )
-																		uni.hideLoading()
-
-																} else {
-																	that.gridList.inOutFlag = 2
-																	that.$api.doRequest('post',
-																			'/warehouseInOutInfo/InOutWarehouse',
-																			that.gridList)
-																		.then(res => {
-																			if (that.utils
-																				.getCurrectRoles(
-																					'acquisitionQuality.qview'
-																				)) {
-																				if (!that.utils
-																					.getCurrectRoles(
-																						'acquisitionQuality.initial'
-																					)) {
-																					that.gridList
-																						.statusFlag =
-																						7
-																				} else {
-																					that.gridList
-																						.statusFlag =
-																						0
-																				}
-																			}
-																			that.gridList.warehouseInOutId =
-																			res.data.data
-																			if(that.gridList.warehouseInOutId){
-																				that.$api.doRequest(
-																					'post',
-																					'/qualityInspectionManagement/api/addQualityInspection',
-																					that.gridList)
-																					.then(res => {
-																						that.printId=res.data.data
-																						uni.hideLoading()
-																						if (res
-																							.data
-																							.code ==
-																							200
-																						) {
-																							that.$api
-																								.msg(
-																									'提交成功'
-																								)
-																							that.gridList
-																								.warehouseId =
-																								that
-																								.cangid
-																							that.gridList
-																								.compId =
-																								uni
-																								.getStorageSync(
-																									'pcUserInfo'
-																								)
-																								.compId
-																							uni.setStorageSync(
-																								"quality_print",
-																								that
-																								.gridList
-																							)
-																							if (that
-																								.utils
-																								.getCurrectRoles(
-																									'acquisitionQuality.initial'
-																								)
-																							) {
-																								that.isShowPrint =
-																									true
-																							} else {
-																								uni.navigateBack({})
-																							}
-																				
-																							console
-																								.log(
-																									'that.gridList',
-																									that
-																									.gridList
-																								)
-																							// uni.navigateBack({})
-																						} else {
-																							that.$api
-																								.msg(
-																									'提交失败'
-																								)
-																						}
-																					})
-																			}
-																			else{
-																				uni.hideLoading()
-																			}
-																		})
-																}
-															}
-														}
-													}
-												})
-										} else {
-											uni.showLoading({
-												title: '加载中',
-												mask: true
-											})
-
-											that.gridList.inOutFlag = 2
-											that.$api.doRequest('post',
-													'/warehouseInOutInfo/InOutWarehouse',
-													that.gridList)
-												.then(res => {
-
-													that.gridList.warehouseInOutId = res.data.data
-													
-													if(that.gridList.warehouseInOutId){
-														that.$api.doRequest('post',
-																'/qualityInspectionManagement/api/addQualityInspection',
-																that.gridList)
-															.then(res => {
-																that.printId=res.data.data
-																uni.hideLoading()
-																if (res.data.code == 200) {
-																	that.$api.msg('提交成功')
-																	that.gridList.warehouseId =
-																		that.cangid
-																	that.gridList.compId = uni
-																		.getStorageSync(
-																			'pcUserInfo').compId
-																	uni.setStorageSync(
-																		"quality_print", that
-																		.gridList)
-																	if (that.utils.getCurrectRoles(
-																			'acquisitionQuality.initial'
-																		)) {
-																		that.isShowPrint = true
-																	} else {
-																		uni.navigateBack({})
-																	}
-														
-																	console.log('that.gridList',
-																		that.gridList)
-																	// uni.navigateBack({})
-																} else {
-																	that.$api.msg('提交失败')
-																}
-															})
-													}	
-													else{
-														uni.hideLoading()
-													}
-												})
-										}
-
-									}
-								}
-							})
-						}
-					})
+					this.getGoodsName()
 				}
 
-				// if (!this.gridList.storageTagNo) {
-				// 	this.$api.msg('囤位号不能为空')
-				// 	return
-				// }
-				// if (this.gridList.storageTagNo&&this.gridList.storageTagNo.length > 10) {
-				// 	this.$api.msg('囤位号不能为空')
-				// 	return
-				// }
+				// // 质检提交
+				// if (!this.isQY && this.isZJ) {
 
-				// if (this.gridList.buckleWeightRatio < 0 || this.gridList.buckleWeightRatio > 2) {
-				// 	this.$api.msg('扣重比输入错误')
-				// 	return
-				// }
-				// if (
-				// 	String(this.gridList.buckleWeightRatio).indexOf('.') != -1 &&
-				// 	String(this.gridList.buckleWeightRatio).length -
-				// 	(String(this.gridList.buckleWeightRatio).indexOf('.') + 1) > 2) {
-				// 	this.$api.msg('扣重比输入错误')
-				// 	return
 				// }
 
-				// uni.showModal({
-				// 	content: text,
-				// 	showCancel: true,
-				// 	confirmText: '提交',
-				// 	success: function(res) {
-				// 		if (res.confirm) {
-				// 			that.gridList.serviceManagementType = that.typevalue
-				// 			if (that.typevalue == 3) {
-				// 				that.$api.doRequest('get', '/paymentManagement/cumulant', {
-				// 						compId: uni.getStorageSync('pcUserInfo').compId,
-				// 						customerNumberCard: that.gridList.customerNumberCard,
-				// 						goodsName: that.gridList.goodsName,
-				// 					})
-				// 					.then(response => {
-				// 						if (response.data.code == 200) {
-				// 							for (let i = 0; i < that.purchasePriceList.length; i++) {
-				// 								if (
-				// 									that.gridList.goodsName == that.purchasePriceList[i]
-				// 									.goodsName
-				// 								) {
-				// 									let count = (that.purchasePriceList[i].saleLimit -
-				// 										response.data.data / 1000).toFixed(2)
-				// 									console.log(count, that.purchasePriceList[i].saleLimit,
-				// 										response.data.data)
-
-				// 									if (Number(count) <= 0) {
-				// 										count = 0
-				// 										that.$api.msg('该客户累计销售' + that.gridList.goodsName +
-				// 											(
-				// 												response.data.data / 1000).toFixed(2) +
-				// 											'吨,还可售粮' +
-				// 											count + '吨', )
-
-				// 									} else {
-				// 										that.gridList.inOutFlag = 2
-				// 										that.$api.doRequest('post',
-				// 												'/warehouseInOutInfo/InOutWarehouse',
-				// 												that.gridList)
-				// 											.then(res => {
-				// 												if (that.utils.getCurrectRoles(
-				// 														'acquisitionQuality.qview')) {
-				// 													if (!that.utils.getCurrectRoles(
-				// 															'acquisitionQuality.initial'
-				// 															)) {
-				// 														that.gridList.statusFlag = 7
-				// 													} else {
-				// 														that.gridList.statusFlag = 0
-				// 													}
-				// 												}
-				// 												that.gridList.warehouseInOutId = res
-				// 													.data.data
-				// 												that.$api.doRequest('post',
-				// 														'/qualityInspectionManagement/api/addQualityInspection',
-				// 														that.gridList)
-				// 													.then(res => {
-				// 														if (res.data.code == 200) {
-				// 															that.$api.msg('提交成功')
-				// 															that.gridList
-				// 																.warehouseId = that
-				// 																.cangid
-				// 															that.gridList.compId =
-				// 																uni.getStorageSync(
-				// 																	'pcUserInfo')
-				// 																.compId
-				// 															uni.setStorageSync(
-				// 																"quality_print",
-				// 																that.gridList)
-				// 															if (that.utils
-				// 																.getCurrectRoles(
-				// 																	'acquisitionQuality.initial'
-				// 																	)) {
-				// 																that.isShowPrint =
-				// 																	true
-				// 															} else {
-				// 																uni.navigateBack({})
-				// 															}
-
-				// 															console.log(
-				// 																'that.gridList',
-				// 																that.gridList)
-				// 															// uni.navigateBack({})
-				// 														} else {
-				// 															that.$api.msg('提交失败')
-				// 														}
-				// 													})
-				// 											})
-				// 									}
-				// 								}
-				// 							}
-				// 						}
-				// 					})
-				// 			} else {
-
-				// 				that.gridList.inOutFlag = 2
-				// 				that.$api.doRequest('post',
-				// 						'/warehouseInOutInfo/InOutWarehouse',
-				// 						that.gridList)
-				// 					.then(res => {
-
-				// 						that.gridList.warehouseInOutId = res.data.data
-				// 						that.$api.doRequest('post',
-				// 								'/qualityInspectionManagement/api/addQualityInspection',
-				// 								that.gridList)
-				// 							.then(res => {
-				// 								if (res.data.code == 200) {
-				// 									that.$api.msg('提交成功')
-				// 									that.gridList.warehouseId = that.cangid
-				// 									that.gridList.compId = uni.getStorageSync(
-				// 										'pcUserInfo').compId
-				// 									uni.setStorageSync("quality_print", that.gridList)
-				// 									if (that.utils.getCurrectRoles(
-				// 											'acquisitionQuality.initial')) {
-				// 										that.isShowPrint = true
-				// 									} else {
-				// 										uni.navigateBack({})
-				// 									}
-
-				// 									console.log('that.gridList', that.gridList)
-				// 									// uni.navigateBack({})
-				// 								} else {
-				// 									that.$api.msg('提交失败')
-				// 								}
-				// 							})
-				// 					})
-				// 			}
-
-				// 		}
-				// 	}
-				// })
 			},
 			gradepicker(e) {
 				console.log(e)