Selaa lähdekoodia

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

# Conflicts:
#	pages/erpbusiness/add_quality_testing.vue
zhongtianhaoyuan 1 vuosi sitten
vanhempi
commit
cda72fff20
2 muutettua tiedostoa jossa 267 lisäystä ja 634 poistoa
  1. 19 4
      pages/erp/exWarehousing/exWarehousing.vue
  2. 248 630
      pages/erpbusiness/add_quality_testing.vue

+ 19 - 4
pages/erp/exWarehousing/exWarehousing.vue

@@ -18,14 +18,19 @@
 				<input v-model='detailData.contractNo' style="width: 200px;" class="right-bottom" placeholder="暂未获取到合同编号" disabled=""></input>
 			</view>
 			<view class="row">
-				<view class="left">提示</view>
-				<view class="right">{{detailData.tips}}</view>
+				<view class="left" style="width: 100px;">提示</view>
+				<view class="right" style="text-align: right;">{{detailData.tips}}</view>
 			</view>
 			<view class="row">
 				<view class="left">货名</view>
 				<view class="right">{{detailData.goodsName ? detailData.goodsName : "选择合同,自动获取"}}
 				</view>
 			</view>
+			<view class="row row-bottom" v-if="detailData.inOutType == '销售出库'">
+				<view class="left">价格(元/吨)</view>
+				<input type="digit"  v-model='detailData.cost' class="right-bottom"
+					placeholder="输入价格"></input>
+			</view>
 			<!-- <view class="row">
 				<view class="left">类型</view>
 				<view @click='show1=true'>{{detailData.type}}</view>
@@ -111,7 +116,7 @@
 				<view @click='slectCarNo' v-if="isPC">{{detailData.carNo}}</view> -->
 				<view class="left">车牌号</view>
 				<!-- 他运合同车牌号输入 -->
-				<input v-model='detailData.carNo' @click.stop="handleShowKeyboard":disabled="true"  class="right-bottom" placeholder="请输入车牌号" v-if="!showCar"></input>
+				<!-- <input v-model='detailData.carNo' @click.stop="handleShowKeyboard":disabled="true"  class="right-bottom" placeholder="请输入车牌号" v-if="!showCar"></input> -->
 				<view v-show="showCar" @click="carno = true" v-if="detailData.inOutType == '移库出库'|| (showCar&&contractType=='1')"><!-- showCar = true时为自运  carjudge为切换状态 contractType==1 为销售合同-->
 					<view v-if="detailData.tranCarNo">
 						{{detailData.carNo?detailData.carNo +'('+detailData.tranCarNo+')':"请选择车牌号"}}
@@ -329,6 +334,7 @@
 					grossWeight: "",
 					tare: "",
 					tips: '',
+					cost:'',
 					carNo:'',
 					selfLoading:"0",
 					goodsName:"",
@@ -512,6 +518,9 @@
 								// "MYCGYMHLJ2021102401"
 									if (this.detailData.inOutType == '销售出库') {
 										this.detailData.tips = '买方' + res.data.data.buyer
+										if(res.data.data.unitContractPrice){
+											this.detailData.cost=res.data.data.unitContractPrice
+										}
 									} else if (this.detailData.inOutType == '移库出库') {
 										this.detailData.tips = '入货库' + this.inOutNoList[0].receiveWarehouse
 									}
@@ -588,13 +597,15 @@
 					if(uni.getStorageSync('compName1')){
 						this.weightbills.seller = uni.getStorageSync('compName1').company
 					}
-					if (this.detailData.tips = '买方' + this.contractList.buyer) {
+					if (this.contractList.unitContractPrice) {
 						this.detailData.tips = '买方' + this.contractList.buyer +
 							'( ' +
 							this.contractList.unitContractPrice +
 							'元/吨)'
+						this.detailData.cost=this.contractList.unitContractPrice
 					} else {
 						this.detailData.tips = '买方' + this.contractList.buyer
+						this.detailData.cost=''
 					}
 				} else if (this.detailData.inOutType == '移库出库') {
 					this.weightbills.buyer = this.inOutNoList[e[0]].receiveWarehouse
@@ -833,6 +844,10 @@
 					this.$api.msg('品级不能为空')
 					return
 				}
+				if (!this.detailData.cost && this.detailData.inOutType == '销售出库'&& num == 2) {
+					this.$api.msg('价格不能为空')
+					return
+				}
 				if (this.detailData.agent == "请选择经办人") {
 					this.$api.msg('经办人不能为空')
 					return

+ 248 - 630
pages/erpbusiness/add_quality_testing.vue

@@ -511,6 +511,7 @@
 </template>
 
 <script>
+	var that;
 	const Equ_List = ['waterContent', 'bulkDensity', 'imperfectGrain', 'impurity', 'mildewGrain', 'jiaorenli','protein','completeGrain'];
 	import dragButton from "@/components/drag-button/drag-button.vue";
 	import keyboard from "@/components/master-keyboard/master-keyboard.vue";
@@ -529,7 +530,9 @@
 		},
 		data() {
 			return {
-				redstatus:false,
+				isQY: false,
+				isZJ: false,
+				redstatus: false,
 				isShowPrint: false,
 				isShowAlert: false,
 				disabled1: false,
@@ -573,7 +576,7 @@
 					name: '他运',
 					value: '他运'
 				}],
-				printId:'',
+				printId: '',
 				typevalue: '3',
 				coverTransform: 'translateY(0px)',
 				coverTransition: '0s',
@@ -831,6 +834,8 @@
 			}
 		},
 		onLoad(options) {
+			that = this
+			console.log(that)
 			console.log(this.cangid)
 			this.commonWarehouseNo = options.commonWarehouseNo
 			this.warehouseCount = Number(options.warehouseCount) + 1
@@ -880,8 +885,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
@@ -904,9 +909,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 {
@@ -923,10 +930,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
 			})
@@ -934,10 +942,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++) {
@@ -970,38 +979,38 @@
 
 				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()
-						})
-					}
+						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: {
@@ -1208,8 +1217,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
@@ -1221,7 +1230,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 {
@@ -1387,8 +1396,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
 					if(this.gridList.goodsName == "大豆"){ //货名为大豆是设置默认
@@ -1486,28 +1495,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()
 						})
@@ -1518,7 +1531,7 @@
 			},
 			print() {
 				console.log(this.printId)
-				if(this.printId){
+				if (this.printId) {
 					this.$api.doRequest('get', '/qualityInspectionManagement/api/getQualityInspection', {
 						id: this.printId
 					}).then(res => {
@@ -1528,7 +1541,7 @@
 						})
 					})
 				}
-				
+
 			},
 			close() {
 				this.isShowPrint = false
@@ -1554,24 +1567,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) {
@@ -1608,9 +1607,9 @@
 					this.gridList.waterContent &&
 					this.gridList.grade
 				) {
-					
+
 					uni.showLoading({
-						title:"加载中"
+						title: "加载中"
 					})
 					this.$api.doRequest('get', '/purchasePrice/tidalGrainPrice', {
 						warehouseId: this.cangid,
@@ -1670,7 +1669,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
@@ -1696,11 +1849,6 @@
 					return
 				}
 				if (this.utils.getCurrectRoles('acquisitionQuality.initial')) {
-
-					// if (!this.gridList.qualityNo) {
-					// 	this.$api.msg('编号不能为空')
-					// 	return
-					// }
 					if (!this.gridList.binNumber) {
 						this.$api.msg('仓位不能为空')
 						return
@@ -1711,22 +1859,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
@@ -1775,7 +1907,7 @@
 						}
 					}
 				}
-				if (this.utils.getCurrectRoles('acquisitionQuality.qview')) {
+				if (this.isQY) {
 					if (this.typevalue == 3) {
 						if (!this.gridList.customerName) {
 							this.$api.msg('客户不能为空')
@@ -1795,556 +1927,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)