gjy 3 lat temu
rodzic
commit
a2fec00591
1 zmienionych plików z 54 dodań i 33 usunięć
  1. 54 33
      pages/erpbusiness/edit_quality_testing.vue

+ 54 - 33
pages/erpbusiness/edit_quality_testing.vue

@@ -105,7 +105,11 @@
 		</view>
 		<view style='padding-bottom:300rpx;'>
 			<view class='wrap'>
-				<view class='title_b'>化验信息</view>
+				<view style='margin-right:10px;' class='flex justify-between align-item-center'>
+					<view class='title_b'>化验信息</view>
+					<u-switch v-if='flag!=1' v-model="value" @change="change"></u-switch>
+				</view>
+				
 
 				<view class="c-row ">
 					<view class="title">等级</view>
@@ -166,7 +170,7 @@
 		</view>
 
 		<view class="footer">
-			<view @click='confirmInfo' class="button">确认初检信息</view>
+			<view v-if='value&&flag!=1||value==false' @click='confirmInfo' class="button">确认初检信息</view>
 			<view @click='submit' class="button">提交</view>
 		</view>
 		<u-modal v-model="isShowAlert" :title-style="{fontSize: '18px',fontWeight:'500'}"
@@ -228,6 +232,7 @@
 				showTran: true,
 				companyId: 1,
 				current: 4,
+				value:false,
 				gradeList: [{
 						key: 1,
 						value: '一等品'
@@ -288,12 +293,18 @@
 			this.managementType = options.managementType
 		},
 		onShow() {
+			console.log(this.flag)
 			var that = this
 			this.$api.doRequest('get', '/qualityInspectionManagement/api/getQualityInspection', {
 				id: this.id
 			}).then(res => {
 				if (res.data.data) {
 					let data = res.data.data
+					if(data.supplementaryRecording==1){
+						that.value=true
+					}else{
+						that.value=false
+					}
 					that.gridList = data
 					that.$api.doRequest('get', '/warehouseBaseInfo/getWarehouse', {
 						id: this.cangid
@@ -315,6 +326,14 @@
 			this.gridList.gradeKey = this.gradeList[0].key
 		},
 		methods: {
+			change(e){
+				if(e){
+					this.gridList.supplementaryRecording=1
+				}else{
+					this.gridList.supplementaryRecording=0
+				}
+				
+			},
 			confirmInfo() {
 				this.isShowAlert = true	
 			},
@@ -452,37 +471,39 @@
 					this.$api.msg('购粮性质不能为空')
 					return
 				}
-				if (!this.gridList.grade) {
-					this.$api.msg('等级不能为空')
-					return
-				}
-				if (!this.gridList.impurity) {
-					this.$api.msg('杂质不能为空')
-					return
-				}
-				if (!this.gridList.waterContent) {
-					this.$api.msg('初检水分不能为空')
-					return
-				}
-				// if (!this.gridList.reWaterContent) {
-				// 	this.$api.msg('复检水分不能为空')
-				// 	return
-				// }
-				if (!this.gridList.mildewGrain) {
-					this.$api.msg('霉变粒不能为空')
-					return
-				}
-				if (!this.gridList.bulkDensity) {
-					this.$api.msg('容重不能为空')
-					return
-				}
-				if (!this.gridList.jiaorenli) {
-					this.$api.msg('热损伤不能为空')
-					return
-				}
-				if (!this.gridList.imperfectGrain) {
-					this.$api.msg('不完整粒不能为空')
-					return
+				if(this.value==false){
+					if (!this.gridList.grade) {
+						this.$api.msg('等级不能为空')
+						return
+					}
+					if (!this.gridList.impurity) {
+						this.$api.msg('杂质不能为空')
+						return
+					}
+					if (!this.gridList.waterContent) {
+						this.$api.msg('初检水分不能为空')
+						return
+					}
+					// if (!this.gridList.reWaterContent) {
+					// 	this.$api.msg('复检水分不能为空')
+					// 	return
+					// }
+					if (!this.gridList.mildewGrain) {
+						this.$api.msg('霉变粒不能为空')
+						return
+					}
+					if (!this.gridList.bulkDensity) {
+						this.$api.msg('容重不能为空')
+						return
+					}
+					if (!this.gridList.jiaorenli) {
+						this.$api.msg('热损伤不能为空')
+						return
+					}
+					if (!this.gridList.imperfectGrain) {
+						this.$api.msg('不完整粒不能为空')
+						return
+					}
 				}
 				uni.showModal({
 					content: "确定提交质检信息?",