Explorar o código

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

zhongtianhaoyuan %!s(int64=3) %!d(string=hai) anos
pai
achega
8c7f626893

+ 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' @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: "确定提交质检信息?",

+ 24 - 18
pages/user/depotAcquisition/grainDeliveryRecord.vue

@@ -6,21 +6,24 @@
 					<view class="left">{{item.warehouseName}}</view>
 					<view class="right">{{item.validityDate}}</view>
 				</view>
-				<view class="hz-content">
-					<view class="row1">
-						<view class="hz-name">
-							{{item.shipperName}}
+				<view v-for="(item1,index) in item.shippingInformationList">
+					<view class="hz-content">
+						<view class="row1">
+							<view class="hz-name">
+								{{item1.shipperName}}
+							</view>
+							<view class="car">
+								({{item1.carList.length}}车)
+							</view>
 						</view>
-						<view class="car">
-							({{item.carList.length}}车)
-						</view>
-					</view>
-					<view class="car-list">
-						<view v-for="(item1,index) in item.carList" class="number">
-							{{item1}}
+						<view class="car-list">
+							<view v-for="(item2,index) in item1.carList" class="number">
+								{{item1.carNo}}
+							</view>
 						</view>
 					</view>
 				</view>
+				
 				<view class="del-row">
 					<view class="del" @click='del(item)'>删除</view>
 				</view>
@@ -101,16 +104,14 @@
 		methods: {
 			getData(size, page, type) {
 				let _obj = {
-					commonId: uni.getStorageSync("userInfo").id,
-					pageSize: size,
-					currentPage: page
+					commonId: uni.getStorageSync("userInfo").id
 				}
 				this.$api.doRequest('get', '/grainDeliveryRegistration/selectGrainDeliveryRegistration', _obj)
 					.then(res => {
 						if (res.data.code == 200) {
 							let curPageData = []
-							for (let i = 0; i < res.data.data.records.length; i++) {
-								let _data = res.data.data.records[i];
+							for (let i = 0; i < res.data.data.length; i++) {
+								let _data = res.data.data[i];
 								//判断是记录是否失效
 								let _isUserd = function() {
 									let _startTime = new Date((_data.validityDate + ' 00:00:00')).getTime();
@@ -121,12 +122,17 @@
 										_data.validityDate = _data.validityDate + ' 0时前有效'
 									}
 								}()
-								let _carNumberList = _data.carNo.split(',')
+								let _carNumberList=[]
+								for (var q = 0; q < _data.shippingInformationList.length; q++) {
+									console.log(_data.shippingInformationList[q])
+									_data.shippingInformationList[q].carList = _data.shippingInformationList[q].carNo.split(',')
+								}
+								
 								let __obj = {
 									warehouseName: _data.warehouseName,
 									id: _data.id,
 									shipperName: _data.shipperName,
-									carList: _carNumberList,
+									shippingInformationList: _data.shippingInformationList,
 									validityDate: _data.validityDate
 
 								}