gjy %!s(int64=3) %!d(string=hai) anos
pai
achega
35f2aab6d8

+ 1 - 0
config/index.js

@@ -4,6 +4,7 @@ const dev = {
 	// baseUrlNew: 'http://192.168.1.103:9100/',
 	// baseUrlNew: 'https://apitest.eliangeyun.com/',
 	baseUrlNew: 'http://api1.eliangeyun.com/',
+	// baseUrlNew: 'http://api1.eliangeyun.com/',
 	h5Appid: 'wxb66b599f7f61b46f',
 	debug: false
 }

+ 2 - 1
pages.json

@@ -326,7 +326,8 @@
 		{
 			"path": "pages/bill/index",
 			"style": {
-				"navigationBarTitleText": "我的票据"
+				"navigationBarTitleText": "我的票据",
+				"enablePullDownRefresh": true
 			}
 		},
 		{

+ 14 - 6
pages/attestation/indexTwo.vue

@@ -79,9 +79,9 @@
 					</view>
 					<text style="color:#AFB3BF;font-size: 14px;">验证码已发送至+86 {{price}}</text>
 					<view class="cancel" @click='pricestatusTwo=false,pricestatus=false'>×</view>
-					<view class='shade-content-item flex'>
+					<view class='shade-content-item1 flex'>
 						<input v-model='verifyCode' placeholder="填写验证码" type="number" class="tainput1" maxlength="6">
-						<text style="color:#AFB3BF;font-size: 14px;" @click="resend">{{sendText}}</text>
+						<text style="color:#22C572;font-size: 14px;padding-right: 40rpx;" @click="resend">{{sendText}}</text>
 					</view>
 					<view>
 						<view class="flex">
@@ -123,6 +123,8 @@
 			...mapState(['hasLogin', 'userInfo'])
 		},
 		onShow() {
+			this.pricestatus = false
+			this.pricestatusTwo = false
 			this.getList()
 		},
 		onPullDownRefresh() {
@@ -359,6 +361,7 @@
 					})
 					return
 				}
+				this.pricestatus = false
 				this.pricestatusTwo = true
 				// this.pricestatusTwo = !this.pricestatusTwo
 				var that = this
@@ -597,7 +600,12 @@
 		height: 160rpx;
 		padding: 35px 10px;
 	}
-
+	.shade-content-item1 {
+		width: 277px;
+		text-align: center;
+		height: 160rpx;
+		padding: 15px 10px;
+	}
 	.shade {
 		position: fixed;
 		top: 0;
@@ -627,8 +635,8 @@
 	}
 
 	.tainput {
-		width: 90%;
-		padding-bottom: 15rpx;
+		width: 70%;
+		// padding-bottom: 15rpx;
 		margin: 0 auto;
 		text-align: left;
 		border-bottom: 1px solid #AFB3BF;
@@ -636,7 +644,7 @@
 	}
 
 	.tainput1 {
-		width: 70%;
+		width: 50%;
 		padding-left: 10px;
 		margin: 0 auto;
 		text-align: left;

+ 24 - 20
pages/bill/index.vue

@@ -4,7 +4,7 @@
 			<view style='background:#fff;display:flex;' class="cu-bar search">
 				<view style='flex:6;' class="search-form round Medium">
 					<text style='color: #ccc;text-indent:6px;' class="cuIcon-search"></text>
-					<input type="text" maxlength="20" :focus="true" v-model="searchKeyWord" @confirm="doSearch()"
+					<input type="text" maxlength="20"  v-model="searchKeyWord" @confirm="doSearch()"
 						 placeholder="请输入买方名称或编号" confirm-type="search"></input>
 				</view>
 				<view @click='doSearch()' class="Regular" style="width:4%;flex:1;">搜索</view>
@@ -20,15 +20,19 @@
 		<view class='wrap' v-for='item in dataInfo'>
 			<view style='margin:5px;padding:10px 0;border-bottom:1px solid #eee;' class="flex justify-between align-item-center">
 				<view style='color:#878C9C;'>{{item.paymentNo}}</view>
-				<view class='not' v-if='item.status=="待结算"'>待付款</view>
-				<view class='already' v-else>已付款</view>
+				<view class='already'  v-if='item.status=="全部付款"'>已付款</view>
+				<view class='not' v-else>待付款</view>
 			</view>
 			<view style='line-height:30px;'>
 				<view class='purchaser'>买方</view><view style='font-size:14px;display:inline-block;'>{{item.compName}}</view>
 			</view>
 			<view style='line-height:30px;'>
-				<view class='seller'>卖方</view><view style='font-size:14px;display:inline-block;'>{{item.customerName}}</view>
-				
+				<view class='flex justify-between align-item-center'>
+					<view >
+						<view class='seller'>卖方</view><view style='font-size:14px;display:inline-block;'>{{item.customerName}}</view>
+					</view>
+					<view>{{item.carNo}}</view>
+				</view>
 			</view>
 			<view class='flex justify-between align-item-center'>
 				<view style="color:#878C9C;padding:5px;">{{item.goodsName}}</view>
@@ -42,13 +46,13 @@
 				<view>{{item.amountIngPayable}}</view>
 			</view>
 			<view class='flex justify-between align-item-center'>
-				<view style='color:#878C9C;padding:5px;'>单价</view>
+				<view style='color:#878C9C;padding:5px;'>已付</view>
 				<view>{{item.amountEdPayable}}</view>
 			</view>
 			<view style='flex-direction:row-reverse;' class='flex'>
-				<view @click='showImage(3,item)' class='button'>结算单</view>
-				<view @click='showImage(2,item)' class='button'>检斤单</view>
-				<view @click='showImage(1,item)' class='button'>质检单</view>
+				<view v-show="item.pictureAddress" @click='showImage(item.pictureAddress)' class='button'>结算单</view>
+				<view v-show="item.weighingPictureAddress" @click='showImage(item.weighingPictureAddress)' class='button'>检斤单</view>
+				<view v-show="item.qualityInspectionPictureAddress" @click='showImage(item.qualityInspectionPictureAddress)' class='button'>质检单</view>
 			</view>
 		</view>
 		<view v-show="isContent">
@@ -56,7 +60,7 @@
 		</view>
 		<view @click='closepop' class='popup' v-if='show'>
 			<view class='imagewrap' style='text-align:center;'>
-				<image :src="img" mode=""></image>
+				<image :src="img" mode="aspectFit"></image>
 			</view>
 			<view @click='xiazai' class='xiazai'><image style='width:24px;height:24px;' src="../../static/img/erp/xiazai@3x.png" mode=""></image></view>
 		</view>
@@ -139,16 +143,14 @@
 							});
 				
 			},
-			showImage(status,item){
-				console.log(1111)
-				if(status==1){
-					this.img=item.qualityInspectionPictureAddress
-				}else if(status==2){
-					this.img=item.weighingPictureAddress
-				}else if(status==3){
-					this.img=item.pictureAddress
-				}
-				this.show=true
+			showImage(url){
+				var img = [];
+				img.push(url)
+				uni.previewImage({
+					current:0,
+					urls: img
+				});
+				
 			},
 			tabcarchange(status){
 				this.TabCur=status
@@ -243,6 +245,8 @@
 						}
 						if(data.length==0){
 							this.isContent=true
+							this.isLoadMore = false
+							this.loadStatus = 'nomore'
 						}
 					})
 					.catch(res => {

+ 240 - 49
pages/erp/exWarehousing/exWarehousing.vue

@@ -161,9 +161,9 @@
 				show6: false,
 				show7: false,
 				isPC: true,
-				contractNoList: [{
-					contractNo: ""
-				}],
+				// contractNoList: [{
+				// 	contractNo: ""
+				// }],
 				typeList: [{
 						type: "干粮"
 					},
@@ -206,24 +206,30 @@
 				binNumber: '',
 				detailData: {
 					contractNo: "请选择合同编号或移库任务编号",
-					type: "请选择类型",
+					type: "干粮",
 					grade: "请输入品级",
 					agent: "请选择经办人",
 					inOutDate: "请选择出库日期",
 					inOutType: "请选择出库类型",
 					warehouseInOutDetail: {},
 					gradeKey: "",
+					grossWeight: 0,
+					tare: 0,
+					// buckleWeightRatio: 0,
+					// solidGrainWater: 0,
+					// tidalGrainWater: 0,
+					// pureWeight: 0,
 				},
 				params: {
 					year: true,
 					month: true,
 					day: true,
-					hour: true,
-					minute: true,
-					second: true
+					// hour: true,
+					// minute: true,
+					// second: true
 				},
-				inOutDate1: "",
-				netWeight: ""
+				// inOutDate: "请选择出库日期",
+				netWeight: 0,
 			}
 		},
 		computed: {
@@ -239,28 +245,34 @@
 			this.cangId = options.cangId
 		},
 		onShow() {
+			let _data = uni.getStorageSync('erpContractNo')
 			this.binNumber = helper.erpWarehouse.binNumber
 			this.warehouseName = helper.erpWarehouse.warehouseName
-			this.detailData.goodsName = uni.getStorageSync('erpContractNo').goodsName;
-			this.detailData.contractNo = uni.getStorageSync('erpContractNo').contractNo;
-			this.detailData.goodsNameKey = uni.getStorageSync('erpContractNo').goodsNameKey;
-			if (!uni.getStorageSync('erpContractNo').tranCarInfoList) uni.getStorageSync('erpContractNo')
-				.tranCarInfoList = []
+			this.detailData.goodsName = _data.goodsName;
+			if (_data.contractNo) {
+				this.detailData.contractNo = _data.contractNo;
+			}
+			this.detailData.goodsNameKey = _data.goodsNameKey;
+			if (!_data.tranCarInfoList) _data.tranCarInfoList = []
 			if (!this.detailData.contractNo) {
 				this.detailData.contractNo = '请选择合同编号'
 			} else {
-				if(uni.getStorageSync('erpContractNo').tranCarInfoList){
-				if (uni.getStorageSync('erpContractNo').tranCarInfoList.length == 0) {
+				if (_data.tranCarInfoList.length == 0) {
 					this.isPC = false
-				}}
+				}
 			}
 			if (!this.detailData.goodsName) {
 				this.detailData.goodsName = '货名'
 			}
+			let _day = new Date();
+			_day.setTime(_day.getTime());
+			this.detailData.inOutDate = _day.getFullYear() + "-" + (_day.getMonth() + 1) + "-" + _day.getDate();
 			//出库类型
 			this.outWarehouse()
+			this.detailData.agent = helper.erpWarehouse.personCharge
 			//经办人
 			this.handler()
+
 		},
 		methods: {
 			//计算纯重
@@ -304,7 +316,6 @@
 			},
 			dateChange(e) {
 				this.detailData.inOutDate = e.year + "-" + e.month + "-" + e.day
-				this.inOutDate1 = e.year + "-" + e.month + "-" + e.day + " " + e.hour + ":" + e.minute
 			},
 			warehousingTypePicker(e) {
 				this.detailData.inOutType = this.warehousingTypeList[e].constValue
@@ -328,48 +339,29 @@
 			},
 			getImgUrl(res) {
 				this.detailData.addressUrl = res
-				console.log(res)
-				console.log('------------res-----------')
 			},
 			onError(error) {
-				alert(error)
 				console.log('------------error-----------')
 				console.log(error)
 			},
 			binNumberpicker(e) {
 				this.detailData.binNumber = this.positionList[e[0]].binNumber
 			},
-			// getWeighingManagement() {
-			// 	this.$api.doRequest('get', '/weighingManagement/getWeighingManagement', {
-			// 		id: this.id
-			// 	}).then(res => {
-			// 		if (res.data.code == 200) {
-			// 			this.detailData = res.data.data
-			// 		}
-			// 	})
-			// 	this.$api.doRequest('get', '/warehouseBaseInfo/getWarehouse', {
-			// 		id: this.cangId
-			// 	}).then(res => {
-			// 		if (res.data.code == 200) {
-			// 			this.positionList = res.data.data.warehousePositionInfoList
-			// 		}
-			// 	})
-			// 	this.$api.doRequest('get', '/warehouseBaseInfo/selectContractNoList', {
-			// 		compId: '',
-			// 		flag: 5
-			// 	}).then(res => {
-			// 		if (res.data.code == 200) {
-			// 			this.contractNoList = res.data.data
-			// 		}
-			// 	})
-			// },
 			onProgress(e) {},
-			onRemove(index) {},
+			onRemove() {
+				this.detailData.addressUrl = ""
+			},
 			submit(num) {
-				if (!this.detailData.grossWeight) {
-					this.$api.msg('毛重不能为空')
+				if (!this.detailData.contractNo) {
+					this.$api.msg('合同编号不能为空')
+					return
+				}
+				if (!this.detailData.goodsName) {
+					this.$api.msg('货名不能为空')
 					return
 				}
+
+
 				if (!this.detailData.grossWeight) {
 					this.$api.msg('毛重不能为空')
 					return
@@ -385,6 +377,206 @@
 					this.$api.msg('毛重输入错误!')
 					return
 				}
+				if (!this.detailData.tare) {
+					this.$api.msg('皮重不能为空')
+					return
+				}
+				if (isNaN(this.detailData.tare) ||
+					(String(this.detailData.tare).indexOf('.') != -1 &&
+						String(this.detailData.tare).length -
+						(String(this.detailData.tare).indexOf('.') + 1) >
+						1) ||
+					this.detailData.tare < 1 ||
+					this.detailData.tare > 100000
+				) {
+					this.$api.msg('皮重输入错误!')
+					return
+				}
+				if (this.detailData.tare > this.detailData.grossWeight) {
+					this.$api.msg('皮重不能大于毛重')
+					return
+				}
+				if (this.netWeight < 0) {
+					this.$api.msg('净重不能小于0')
+					return
+				}
+				if (this.detailData.type == "潮粮") {
+					if (!this.detailData.buckleWeightRatio) {
+						this.$api.msg('扣重比不能为空')
+						return
+					}
+					if (isNaN(this.detailData.buckleWeightRatio) ||
+						(String(this.detailData.buckleWeightRatio).indexOf('.') != -1 &&
+							String(this.detailData.buckleWeightRatio).length -
+							(String(this.detailData.buckleWeightRatio).indexOf('.') + 1) >
+							2) ||
+						this.detailData.buckleWeightRatio < 0 ||
+						this.detailData.buckleWeightRatio > 2
+					) {
+						this.$api.msg('扣重比输入错误!')
+						return
+					}
+					if (!this.detailData.solidGrainWater) {
+						this.$api.msg('干粮水分不能为空')
+						return
+					}
+					if (isNaN(this.detailData.solidGrainWater) ||
+						(String(this.detailData.solidGrainWater).indexOf('.') != -1 &&
+							String(this.detailData.solidGrainWater).length -
+							(String(this.detailData.solidGrainWater).indexOf('.') + 1) >
+							1) ||
+						this.detailData.solidGrainWater < 1 ||
+						this.detailData.solidGrainWater > 40
+					) {
+						this.$api.msg('干粮水分输入错误!')
+						return
+					}
+					if (!this.detailData.tidalGrainWater) {
+						this.$api.msg('潮粮水分不能为空')
+						return
+					}
+					if (isNaN(this.detailData.tidalGrainWater) ||
+						(String(this.detailData.tidalGrainWater).indexOf('.') != -1 &&
+							String(this.detailData.tidalGrainWater).length -
+							(String(this.detailData.tidalGrainWater).indexOf('.') + 1) >
+							1) ||
+						this.detailData.tidalGrainWater < 1 ||
+						this.detailData.tidalGrainWater > 40
+					) {
+						this.$api.msg('潮粮水分输入错误!')
+						return
+					}
+					if (this.detailData.tidalGrainWater < this.detailData.solidGrainWater) {
+						this.$api.msg('潮粮水分输入错误!')
+						return
+					}
+					if (!this.detailData.pureWeight) {
+						this.$api.msg('纯重不能为空')
+						return
+					}
+				}
+				if (this.detailData.grade == "请输入品级") {
+					this.$api.msg('品级不能为空')
+					return
+				}
+				if (this.detailData.agent == "请选择经办人") {
+					this.$api.msg('经办人不能为空')
+					return
+				}
+				if (this.detailData.inOutDate == "请选择出库日期") {
+					this.$api.msg('出库日期不能为空')
+					return
+				}
+				if (this.detailData.inOutType == "请选择出库类型") {
+					this.$api.msg('出库类型不能为空')
+					return
+				}
+				if (!this.detailData.carNo) {
+					this.$api.msg('车牌号不能为空')
+					return
+				}
+				if (this.detailData.carNo.length != 7) {
+					this.$api.msg('车牌号输入有误!')
+					return
+				}
+				if (!this.detailData.addressUrl) {
+					this.$api.msg('请上传磅单')
+					return
+				}
+				if (this.detailData.warehouseInOutDetail.qualityInspector) {
+					if (this.detailData.warehouseInOutDetail.qualityInspector < 2 || this.detailData.warehouseInOutDetail
+						.qualityInspector > 10) {
+						this.$api.msg('质检员姓名需要2-10个字')
+						return
+					}
+				}
+				if (this.detailData.warehouseInOutDetail.waterContent) {
+					if (this.detailData.type == "潮粮" && this.detailData.warehouseInOutDetail.waterContent != this
+						.detailData.tidalGrainWater) {
+						this.$api.msg('水分占比与潮粮水分不一致')
+						return
+					}
+					if (this.detailData.type == "干粮") {
+						if (this.detailData.warehouseInOutDetail.waterContent < 0 || this.detailData.warehouseInOutDetail
+							.waterContent > 40) {
+							this.$api.msg('热损伤占比输入错误')
+							return
+						}
+						if (String(this.detailData.warehouseInOutDetail.waterContent).indexOf('.') != -1 && String(this
+								.detailData.warehouseInOutDetail.jiaorenli).length - (String(
+								this.detailData.warehouseInOutDetail.waterContent).indexOf('.') + 1) > 1) {
+							this.$api.msg('热损伤占比输入错误')
+							return
+						}
+					}
+				}
+				if (this.detailData.warehouseInOutDetail.bulkDensity) {
+					if (this.detailData.warehouseInOutDetail.bulkDensity < 500 || this.detailData.warehouseInOutDetail
+						.bulkDensity > 1000) {
+						this.$api.msg('容重输入错误')
+						return
+					}
+					if (String(this.detailData.warehouseInOutDetail.bulkDensity).indexOf('.') != -1 && String(this
+							.detailData.warehouseInOutDetail.bulkDensity).length - (
+							String(this.detailData.warehouseInOutDetail.bulkDensity).indexOf('.') + 1) > 0) {
+						this.$api.msg('容重输入错误')
+						return
+					}
+				}
+				if (this.detailData.warehouseInOutDetail.jiaorenli) {
+					if (this.detailData.warehouseInOutDetail.jiaorenli < 0 || this.detailData.warehouseInOutDetail
+						.jiaorenli > 40) {
+						this.$api.msg('热损伤占比输入错误')
+						return
+					}
+					if (String(this.detailData.warehouseInOutDetail.jiaorenli).indexOf('.') != -1 && String(this.detailData
+							.warehouseInOutDetail.jiaorenli).length - (String(
+							this.detailData.warehouseInOutDetail.jiaorenli).indexOf('.') + 1) > 1) {
+						this.$api.msg('热损伤占比输入错误')
+						return
+					}
+				}
+				if (this.detailData.warehouseInOutDetail.impurity) {
+					if (this.detailData.warehouseInOutDetail.impurity < 0 || this.detailData.warehouseInOutDetail
+						.impurity > 40) {
+						this.$api.msg('杂质占比输入错误')
+						return
+					}
+					if (String(this.detailData.warehouseInOutDetail.impurity).indexOf('.') != -1 && String(this.detailData
+							.warehouseInOutDetail.impurity).length - (String(
+							this.detailData.warehouseInOutDetail.impurity).indexOf('.') + 1) > 1) {
+						this.$api.msg('杂质占比输入错误')
+						return
+					}
+				}
+				if (this.detailData.warehouseInOutDetail.mildewGrain) {
+					if (this.detailData.warehouseInOutDetail.mildewGrain < 0 || this.detailData.warehouseInOutDetail
+						.mildewGrain > 40) {
+						this.$api.msg('霉变粒占比输入错误')
+						return
+					}
+					if (String(this.detailData.warehouseInOutDetail.mildewGrain).indexOf('.') != -1 && String(this
+							.detailData
+							.warehouseInOutDetail.mildewGrain).length - (String(
+							this.detailData.warehouseInOutDetail.mildewGrain).indexOf('.') + 1) > 1) {
+						this.$api.msg('霉变粒占比输入错误')
+						return
+					}
+				}
+				if (this.detailData.warehouseInOutDetail.imperfectGrain) {
+					if (this.detailData.warehouseInOutDetail.imperfectGrain < 0 || this.detailData.warehouseInOutDetail
+						.imperfectGrain > 40) {
+						this.$api.msg('不完善粒占比输入错误')
+						return
+					}
+					if (String(this.detailData.warehouseInOutDetail.imperfectGrain).indexOf('.') != -1 && String(this
+							.detailData
+							.warehouseInOutDetail.imperfectGrain).length - (String(
+							this.detailData.warehouseInOutDetail.imperfectGrain).indexOf('.') + 1) > 1) {
+						this.$api.msg('不完善粒占比输入错误')
+						return
+					}
+				}
 				this.detailData.baseId = helper.erpWarehouse.warehouseId
 				this.detailData.warehouseName = helper.erpWarehouse.warehouseName
 				this.detailData.positionId = helper.erpWarehouse.positionId
@@ -398,7 +590,6 @@
 				let title = ""
 				if (num == 1) {
 					this.detailData.statusFlag = 1
-					this.detailData.inOutDate = this.inOutDate1
 					this.detailData.backOffice = this.userInfo.userName
 					this.detailData.backOfficeId = this.userInfo.id
 					title = "暂存成功"

+ 36 - 21
pages/erp/improvedExWaehousing/improvedExWaehousing.vue

@@ -4,21 +4,21 @@
 			<view class="left" @click='show1=true'>
 				<view>{{warehouseName}}</view>
 				<u-icon name="arrow-right"></u-icon>
-				<u-select v-model="show1" :default-value='[0]' :list="warehouseList" @confirm="confirmWarehouse">
-				</u-select>
+				<u-picker @confirm="warehousechange" range-key='warehouseName' mode="selector" v-model="show1"
+					:range="warehouseList"></u-picker>
 			</view>
 			<view class="right" @click='show2=true'>
-				<view>{{positionName}}</view>
+				<view>{{binNumber}}仓位</view>
 				<u-icon name="arrow-right"></u-icon>
-				<u-select v-model="show2" :default-value='[0]' :list="positionList" @confirm="confirmPositon">
-				</u-select>
+				<u-picker @confirm="warehouseCWchange" range-key='binNumber' mode="selector" v-model="show2"
+					:range="warehouseCWList"></u-picker>
 			</view>
 		</view>
 		<view class="content2">
 			<view class="content2-item" v-for="(item,index) in dataList" @click="goDetail(item)">
 				<view class="item-style">{{item.contractNo}}</view>
 				<view class="item-style">{{item.carNo}}</view>
-				<view class="item-style">{{item.inOutDate}}</view>
+				<view class="item-style">{{item.updateDate}}</view>
 				<view class="item-style">{{item.backOffice}}</view>
 			</view>
 		</view>
@@ -36,31 +36,34 @@
 				pageSize: 10,
 				positionId: "",
 				binNumber: "",
-				warehouseName: '鲅鱼圈一号库',
-				positionName: '102仓位',
-				warehouseList: [{
-					"label": '1',
-					"value": '1'
-				}],
-				positionList: [{
-					"label": '102仓位',
-					"value": '1'
-				}],
+				binNumber: "",
+				warehouseName: '',
+				warehouseList: [],
+				warehouseCWList:[],
 				dataList: []
 			}
 		},
 		onLoad() {
 			this.positionId = helper.erpWarehouse.positionId
+			this.warehouseId = helper.erpWarehouse.warehouseId
 			this.getList()
 		},
 		onShow() {
 			this.positionId = helper.erpWarehouse.positionId
+			this.warehouseId = helper.erpWarehouse.warehouseId
+			let _data = helper.erpWarehouse
+			this.positionId = _data.positionId
+			this.warehouseId = _data.warehouseId
+			this.warehouseList = _data.allWarehouse
+			this.warehouseCWList = _data.warehouseCWList
+			this.warehouseName = _data.warehouseName
+			this.binNumber = _data.binNumber
 		},
 		methods: {
 			getList() {
 				this.$api.doRequest('get', '/warehouseInOutInfo/selectWarehouseInOutInfo', {
 					positionId:this.positionId,
-					baseId: helper.erpWarehouse.warehouseId,
+					baseId: this.warehouseId,
 					currentPage: this.currentPage,
 					pageSize: this.pageSize,
 					inOutFlag:1
@@ -70,12 +73,24 @@
 					}
 				})
 			},
-			confirmWarehouse() {},
-			confirmPositon() {},
+			warehousechange(e) {
+				 this.warehouseName = this.warehouseList[e[0]].warehouseName
+				 this.warehouseId =this.warehouseList[e[0]].id
+				 this.warehouseCWList = this.warehouseList[e[0]].positionInfos
+				 this.warehouseCWchange([0])
+			},
+			warehouseCWchange(e) {
+				 this.binNumber = this.warehouseCWList[e[0]].binNumber
+				 this.warehouseId = this.warehouseCWList[e[0]].baseId
+				 this.positionId = this.warehouseCWList[e[0]].id
+				 helper.erpWarehouse.binNumber = this.binNumber
+				  helper.erpWarehouse.warehouseName = this.warehouseName
+				 helper.erpWarehouse.positionId =  this.positionId
+				 helper.erpWarehouse.warehouseId = this.warehouseId 
+				 this.getList()
+			},
 			goDetail(val) {
-				
 				uni.navigateTo({
-					// /pages/erp/warehousing/selectContractNo
 					url: '/pages/erp/improvedExWaehousing/improvedExWaehousingDetail?data=' + JSON.stringify(val),
 				})
 			}

+ 209 - 40
pages/erp/improvedExWaehousing/improvedExWaehousingDetail.vue

@@ -216,11 +216,7 @@
 					year: true,
 					month: true,
 					day: true,
-					hour: true,
-					minute: true,
-					second: true
 				},
-				inOutDate1: "",
 				netWeight: "",
 				imgUrl: [], //图片展示
 			}
@@ -236,16 +232,9 @@
 		onLoad(options) {
 			this.detailData = JSON.parse(options.data)
 			this.netWeight = this.detailData.netWeight
-			console.log(this.detailData, "dmksj")
-
-			// this.imgUrl = this.detailData.addressUrl.split(",")
-
-			for (let i = 0; i < this.detailData.addressUrl.split(",").length; i++) {
 				this.imgUrl.push({
-						url:this.detailData.addressUrl.split(",")[i]
+						url:this.detailData.addressUrl.split(",")[0]
 					})
-			}
-			console.log(this.imgUrl)
 			this.cangId = options.cangId
 		},
 		onShow() {
@@ -307,7 +296,6 @@
 			},
 			dateChange(e) {
 				this.detailData.inOutDate = e.year + "-" + e.month + "-" + e.day
-				this.inOutDate1 = e.year + "-" + e.month + "-" + e.day + " " + e.hour + ":" + e.minute
 			},
 			warehousingTypePicker(e) {
 				this.detailData.inOutType = this.warehousingTypeList[e].constValue
@@ -342,33 +330,19 @@
 			binNumberpicker(e) {
 				this.detailData.binNumber = this.positionList[e[0]].binNumber
 			},
-			// getWeighingManagement() {
-			// 	this.$api.doRequest('get', '/weighingManagement/getWeighingManagement', {
-			// 		id: this.id
-			// 	}).then(res => {
-			// 		if (res.data.code == 200) {
-			// 			this.detailData = res.data.data
-			// 		}
-			// 	})
-			// 	this.$api.doRequest('get', '/warehouseBaseInfo/getWarehouse', {
-			// 		id: this.cangId
-			// 	}).then(res => {
-			// 		if (res.data.code == 200) {
-			// 			this.positionList = res.data.data.warehousePositionInfoList
-			// 		}
-			// 	})
-			// 	this.$api.doRequest('get', '/warehouseBaseInfo/selectContractNoList', {
-			// 		compId: '',
-			// 		flag: 5
-			// 	}).then(res => {
-			// 		if (res.data.code == 200) {
-			// 			this.contractNoList = res.data.data
-			// 		}
-			// 	})
-			// },
 			onProgress(e) {},
 			onRemove(index) {},
 			submit(num) {
+				if (!this.detailData.contractNo) {
+					this.$api.msg('合同编号不能为空')
+					return
+				}
+				if (!this.detailData.goodsName) {
+					this.$api.msg('货名不能为空')
+					return
+				}
+				
+				
 				if (!this.detailData.grossWeight) {
 					this.$api.msg('毛重不能为空')
 					return
@@ -384,6 +358,204 @@
 					this.$api.msg('毛重输入错误!')
 					return
 				}
+				if (!this.detailData.tare) {
+					this.$api.msg('皮重不能为空')
+					return
+				}
+				if (isNaN(this.detailData.tare) ||
+					(String(this.detailData.tare).indexOf('.') != -1 &&
+						String(this.detailData.tare).length -
+						(String(this.detailData.tare).indexOf('.') + 1) >
+						1) ||
+					this.detailData.tare < 1 ||
+					this.detailData.tare > 100000
+				) {
+					this.$api.msg('皮重输入错误!')
+					return
+				}
+				if (this.detailData.tare > this.detailData.grossWeight) {
+					this.$api.msg('皮重不能大于毛重')
+					return
+				}
+				if (this.netWeight < 0) {
+					this.$api.msg('净重不能小于0')
+					return
+				}
+				if (this.detailData.type == "潮粮") {
+					if (!this.detailData.buckleWeightRatio) {
+						this.$api.msg('扣重比不能为空')
+						return
+					}
+					if (isNaN(this.detailData.buckleWeightRatio) ||
+						(String(this.detailData.buckleWeightRatio).indexOf('.') != -1 &&
+							String(this.detailData.buckleWeightRatio).length -
+							(String(this.detailData.buckleWeightRatio).indexOf('.') + 1) >
+							2) ||
+						this.detailData.buckleWeightRatio < 0 ||
+						this.detailData.buckleWeightRatio > 2
+					) {
+						this.$api.msg('扣重比输入错误!')
+						return
+					}
+					if (!this.detailData.solidGrainWater) {
+						this.$api.msg('干粮水分不能为空')
+						return
+					}
+					if (isNaN(this.detailData.solidGrainWater) ||
+						(String(this.detailData.solidGrainWater).indexOf('.') != -1 &&
+							String(this.detailData.solidGrainWater).length -
+							(String(this.detailData.solidGrainWater).indexOf('.') + 1) >
+							1) ||
+						this.detailData.solidGrainWater < 1 ||
+						this.detailData.solidGrainWater > 40
+					) {
+						this.$api.msg('干粮水分输入错误!')
+						return
+					}
+					if (!this.detailData.tidalGrainWater) {
+						this.$api.msg('潮粮水分不能为空')
+						return
+					}
+					if (isNaN(this.detailData.tidalGrainWater) ||
+						(String(this.detailData.tidalGrainWater).indexOf('.') != -1 &&
+							String(this.detailData.tidalGrainWater).length -
+							(String(this.detailData.tidalGrainWater).indexOf('.') + 1) >
+							1) ||
+						this.detailData.tidalGrainWater < 1 ||
+						this.detailData.tidalGrainWater > 40
+					) {
+						this.$api.msg('潮粮水分输入错误!')
+						return
+					}
+					if (this.detailData.tidalGrainWater < this.detailData.solidGrainWater) {
+						this.$api.msg('潮粮水分输入错误!')
+						return
+					}
+					if (!this.detailData.pureWeight) {
+						this.$api.msg('纯重不能为空')
+						return
+					}
+				}
+				if (this.detailData.grade == "请输入品级") {
+					this.$api.msg('品级不能为空')
+					return
+				}
+				if (this.detailData.agent == "请选择经办人") {
+					this.$api.msg('经办人不能为空')
+					return
+				}
+				if (this.detailData.inOutDate == "请选择出库日期") {
+					this.$api.msg('出库日期不能为空')
+					return
+				}
+				if (this.detailData.inOutType == "请选择出库类型") {
+					this.$api.msg('出库类型不能为空')
+					return
+				}
+				if (!this.detailData.carNo) {
+					this.$api.msg('车牌号不能为空')
+					return
+				}
+				if (this.detailData.carNo.length != 7) {
+					this.$api.msg('车牌号输入有误!')
+					return
+				}
+				if (!this.detailData.addressUrl) {
+					this.$api.msg('请上传磅单')
+					return
+				}
+				if (this.detailData.warehouseInOutDetail.qualityInspector) {
+					if (this.detailData.warehouseInOutDetail.qualityInspector < 2 || this.detailData.warehouseInOutDetail
+						.qualityInspector > 10) {
+						this.$api.msg('质检员姓名需要2-10个字')
+						return
+					}
+				}
+				if (this.detailData.warehouseInOutDetail.waterContent) {
+					if (this.detailData.type == "潮粮" && this.detailData.warehouseInOutDetail.waterContent != this
+						.detailData.tidalGrainWater) {
+						this.$api.msg('水分占比与潮粮水分不一致')
+						return
+					}
+					if (this.detailData.type == "干粮") {
+						if (this.detailData.warehouseInOutDetail.waterContent < 0 || this.detailData.warehouseInOutDetail
+							.waterContent > 40) {
+							this.$api.msg('热损伤占比输入错误')
+							return
+						}
+						if (String(this.detailData.warehouseInOutDetail.waterContent).indexOf('.') != -1 && String(this
+								.detailData.warehouseInOutDetail.jiaorenli).length - (String(
+								this.detailData.warehouseInOutDetail.waterContent).indexOf('.') + 1) > 1) {
+							this.$api.msg('热损伤占比输入错误')
+							return
+						}
+					}
+				}
+				if (this.detailData.warehouseInOutDetail.bulkDensity) {
+					if (this.detailData.warehouseInOutDetail.bulkDensity < 500 || this.detailData.warehouseInOutDetail
+						.bulkDensity > 1000) {
+						this.$api.msg('容重输入错误')
+						return
+					}
+					if (String(this.detailData.warehouseInOutDetail.bulkDensity).indexOf('.') != -1 && String(this
+							.detailData.warehouseInOutDetail.bulkDensity).length - (
+							String(this.detailData.warehouseInOutDetail.bulkDensity).indexOf('.') + 1) > 0) {
+						this.$api.msg('容重输入错误')
+						return
+					}
+				}
+				if (this.detailData.warehouseInOutDetail.jiaorenli) {
+					if (this.detailData.warehouseInOutDetail.jiaorenli < 0 || this.detailData.warehouseInOutDetail
+						.jiaorenli > 40) {
+						this.$api.msg('热损伤占比输入错误')
+						return
+					}
+					if (String(this.detailData.warehouseInOutDetail.jiaorenli).indexOf('.') != -1 && String(this.detailData
+							.warehouseInOutDetail.jiaorenli).length - (String(
+							this.detailData.warehouseInOutDetail.jiaorenli).indexOf('.') + 1) > 1) {
+						this.$api.msg('热损伤占比输入错误')
+						return
+					}
+				}
+				if (this.detailData.warehouseInOutDetail.impurity) {
+					if (this.detailData.warehouseInOutDetail.impurity < 0 || this.detailData.warehouseInOutDetail
+						.impurity > 40) {
+						this.$api.msg('杂质占比输入错误')
+						return
+					}
+					if (String(this.detailData.warehouseInOutDetail.impurity).indexOf('.') != -1 && String(this.detailData
+							.warehouseInOutDetail.impurity).length - (String(
+							this.detailData.warehouseInOutDetail.impurity).indexOf('.') + 1) > 1) {
+						this.$api.msg('杂质占比输入错误')
+						return
+					}
+				}
+				if (this.detailData.warehouseInOutDetail.mildewGrain) {
+					if (this.detailData.warehouseInOutDetail.mildewGrain < 0 || this.detailData.warehouseInOutDetail
+						.mildewGrain > 40) {
+						this.$api.msg('霉变粒占比输入错误')
+						return
+					}
+					if (String(this.detailData.warehouseInOutDetail.mildewGrain).indexOf('.') != -1 && String(this.detailData
+							.warehouseInOutDetail.mildewGrain).length - (String(
+							this.detailData.warehouseInOutDetail.mildewGrain).indexOf('.') + 1) > 1) {
+						this.$api.msg('霉变粒占比输入错误')
+						return
+					}
+				}
+				if (this.detailData.warehouseInOutDetail.imperfectGrain) {
+					if (this.detailData.warehouseInOutDetail.imperfectGrain < 0 || this.detailData.warehouseInOutDetail
+						.imperfectGrain > 40) {
+						this.$api.msg('不完善粒占比输入错误')
+						return
+					}
+					if (String(this.detailData.warehouseInOutDetail.imperfectGrain).indexOf('.') != -1 && String(this.detailData
+							.warehouseInOutDetail.imperfectGrain).length - (String(
+							this.detailData.warehouseInOutDetail.imperfectGrain).indexOf('.') + 1) > 1) {
+						this.$api.msg('不完善粒占比输入错误')
+						return
+					}
+				}
 				this.detailData.baseId = helper.erpWarehouse.warehouseId
 				this.detailData.positionId = helper.erpWarehouse.positionId
 				this.detailData.warehouseName = helper.erpWarehouse.warehouseName
@@ -397,7 +569,6 @@
 				let title = ""
 				if (num == 1) {
 					this.detailData.statusFlag = 1
-					this.detailData.inOutDate = this.inOutDate1
 					this.detailData.backOffice = this.userInfo.userName
 					this.detailData.backOfficeId = this.userInfo.id
 					title = "暂存成功"
@@ -405,7 +576,6 @@
 					this.detailData.statusFlag = 3
 					title = "提交成功"
 				}
-				console.log(this.detailData,"提交数据")
 				let that = this
 				uni.showModal({
 					content: "确定提交出库信息?",
@@ -413,7 +583,6 @@
 						if (res.confirm) {
 							that.$api.doRequest('post', '/warehouseInOutInfo/InOutWarehouse',
 								that.detailData).then(res => {
-									that.$api.msg(title)
 								if (res.data.code == 200) {
 									that.$api.msg(title)
 									uni.navigateBack()

+ 37 - 13
pages/erp/improvedWrehousing/improvedWrehousing.vue

@@ -26,7 +26,7 @@
 				</view>
 				<view class="row">
 					<view class="left">暂存时间</view>
-					<view>{{item.inOutDate}}</view>
+					<view>{{item.updateDate}}</view>
 				</view>
 				<view class="row no-boder">
 					<view class="left">提交人</view>
@@ -53,7 +53,8 @@
 				warehouseList: [],
 				warehouseCWList: [],
 				dataList: [],
-				allWarehouse: []
+				allWarehouse: [],
+				showTime:''
 			}
 		},
 		onLoad() {
@@ -67,13 +68,14 @@
 			this.warehouseCWList = _data.warehouseCWList
 			this.binNumber = _data.binNumber
 			this.positionId = _data.positionId
+			this.warehouseId = _data.warehouseId
 			this.getList()
 		},
 		methods: {
 			getList() {
 				this.$api.doRequest('get', '/warehouseInOutInfo/selectWarehouseInOutInfo', {
-					positionId: helper.erpWarehouse.positionId,
-					baseId: helper.erpWarehouse.warehouseId,
+					positionId: this.positionId,
+					baseId: this.warehouseId,
 					currentPage: this.currentPage,
 					pageSize: this.pageSize,
 					inOutFlag: 2
@@ -83,8 +85,27 @@
 					}
 				})
 			},
-			confirmWarehouse() {},
-			confirmPositon() {},
+			warehousechange(e) {
+				this.warehouseName = this.warehouseList[e[0]].warehouseName
+				this.warehouseId = this.warehouseList[e[0]].id
+				this.warehouseCWList = this.warehouseList[e[0]].positionInfos
+				this.warehouseCWchange([0])
+				this.currentPage = 1
+				this.pageSize = 9999
+
+			},
+			warehouseCWchange(e) {
+				this.binNumber = this.warehouseCWList[e[0]].binNumber
+				this.warehouseId = this.warehouseCWList[e[0]].baseId
+				this.positionId = this.warehouseCWList[e[0]].id
+				this.binNumber = this.warehouseCWList[e[0]].binNumber
+				helper.erpWarehouse.positionId =  this.positionId
+				helper.erpWarehouse.warehouseId = this.warehouseId 
+				helper.erpWarehouse.binNumber = this.binNumber 
+				this.currentPage = 1
+				this.pageSize = 9999
+				this.getList()
+			},
 			goDetail(val) {
 				uni.navigateTo({
 					url: '/pages/erp/improvedWrehousing/improvedWrehousingDetail?data=' + JSON.stringify(val),
@@ -104,6 +125,7 @@
 		.left,
 		.right {
 			display: flex;
+			align-items: center;
 		}
 	}
 
@@ -113,21 +135,21 @@
 		border-radius: 10rpx;
 		background: #FFFFFF;
 	}
-	
+
 	.content2 {
 		.row {
 			display: flex;
 			justify-content: space-between;
 			border-bottom: 1px solid #EEEEEE;
 			padding: 21rpx 0;
-	
+
 			.right,
 			input {
 				font-size: 28rpx;
 				color: #333333;
 			}
 		}
-	
+
 		.row-bottom {
 			.right-bottom {
 				width: 300rpx;
@@ -135,13 +157,15 @@
 			}
 		}
 	}
-	.content2-item{
+
+	.content2-item {
 		background: white;
-		margin:0 20rpx 20rpx 20rpx;
+		margin: 0 20rpx 20rpx 20rpx;
 		padding: 10rpx;
 		border-radius: 15rpx;
 	}
-	.no-boder{
-		    border-bottom: none!important;
+
+	.no-boder {
+		border-bottom: none !important;
 	}
 </style>

+ 283 - 18
pages/erp/improvedWrehousing/improvedWrehousingDetail.vue

@@ -81,9 +81,7 @@
 				<view class="left">入库日期</view>
 				<view @click='show4=true'>{{detailData.inOutDate}}</view>
 				<u-picker v-model="show4" mode="time" @confirm='dateChange($event)' :params="params">
-					<!-- <view >{{detailData.inOutDate ? detailData.inOutDate:"请选择日期" }}</view> -->
 				</u-picker>
-				<!-- <u-calendar v-model="show4" mode="date" @change='dateChange'></u-calendar> -->
 			</view>
 			<view class="row">
 				<view class="left">入库类型</view>
@@ -100,14 +98,13 @@
 			</view>
 			<view class="row row-bottom has-btn">
 				<view class="left">成本(元/吨)</view>
-				<input v-if="detailData.inOutType=='采购入库'" v-model='detailData.unitContractPrice' class="right-bottom"
-					placeholder="自动获取" :disabled="isEditCB"></input>
-				<input v-if="detailData.inOutType!='采购入库'" v-model='detailData.cost' class="right-bottom"
+				<input v-if="detailData.inOutType=='采购入库'" v-model='detailData.cost' class="right-bottom"
 					placeholder="自动获取" :disabled="isEditCB"></input>
 				<u-button class="edit-btn" hover-class="none" @click="editCB">编辑</u-button>
 			</view>
 			<view class="row row-bottom has-btn">
 				<view class="left">运费(元/吨)</view>
+				{{detailData.freight}}
 				<input @input='' v-model='detailData.freight' :disabled="isEditYF" class="right-bottom"
 					placeholder="自动获取"></input>
 				<u-button class="edit-btn" hover-class="none" @click="editYF">编辑</u-button>
@@ -263,8 +260,8 @@
 		},
 		onLoad(options) {
 			this.detailData = JSON.parse(options.data)
-			this.binNumber = helper.erpWarehouse.binNumber
-			this.warehouseName = helper.erpWarehouse.warehouseName
+			this.binNumber = this.detailData.binNumber
+			this.warehouseName = this.detailData.warehouseName
 			this.compId = helper.erpWarehouse.compId
 			if(this.detailData.addressUrl){
 				this.imgUrl.push({
@@ -278,7 +275,9 @@
 			...mapState(['hasLogin', 'userInfo']),
 		},
 		onShow() {
-			if (this.detailData.inOutType == '采购入库') {
+			
+			console.log('详情数据',this.detailData)
+			if (this.detailData.inOutType == '采购入库'&&this.detailData.status!='已暂存') {
 				this.detailData.freight = 0
 			}
 			if (!this.detailData.tranCarInfoList) this.detailData.tranCarInfoList = []
@@ -342,8 +341,7 @@
 			},
 			dateChange(e) {
 				console.log(e)
-				this.detailData.inOutDate = e.year + "-" + e.month + "-" + e.day
-				this.inOutDate1 = e.year + "-" + e.month + "-" + e.day + " " + e.hour + ":" + e.minute 
+				this.detailData.inOutDate = e.year + "-" + e.month + "-" + e.day + " " + e.hour + ":" + e.minute + ":" + e.second 
 			},
 			warehousingTypePicker(e) {
 				this.detailData.inOutType = this.warehousingTypeList[e].constValue
@@ -416,17 +414,282 @@
 				this.isEditYF = false
 			},
 			submit(num) {
-				if (isNaN(this.detailData.grossWeight) ||
-					(String(this.detailData.grossWeight).indexOf('.') != -1 &&
-						String(this.detailData.grossWeight).length -
-						(String(this.detailData.grossWeight).indexOf('.') + 1) >
+			if (!this.detailData.contractNo) {
+				this.$api.msg('合同编号不能为空')
+				return
+			}
+			if (!this.detailData.goodsName) {
+				this.$api.msg('货名不能为空')
+				return
+			}
+			if (!this.detailData.grossWeight) {
+				this.$api.msg('毛重不能为空')
+				return
+			}
+			if (isNaN(this.detailData.grossWeight) ||
+				(String(this.detailData.grossWeight).indexOf('.') != -1 &&
+					String(this.detailData.grossWeight).length -
+					(String(this.detailData.grossWeight).indexOf('.') + 1) >
+					1) ||
+				this.detailData.grossWeight < 1 ||
+				this.detailData.grossWeight > 100000
+			) {
+				this.$api.msg('毛重输入错误!')
+				return
+			}
+			if (!this.detailData.tare) {
+				this.$api.msg('皮重不能为空')
+				return
+			}
+			if (isNaN(this.detailData.tare) ||
+				(String(this.detailData.tare).indexOf('.') != -1 &&
+					String(this.detailData.tare).length -
+					(String(this.detailData.tare).indexOf('.') + 1) >
+					3) ||
+				this.detailData.tare < 0 ||
+				this.detailData.tare > 10
+			) {
+				this.$api.msg('皮重输入错误!')
+				return
+			}
+			
+			if (!this.detailData.deductionWeight) {
+				this.$api.msg('扣重不能为空')
+				return
+			}
+			if (isNaN(this.detailData.deductionWeight) ||
+				(String(this.detailData.deductionWeight).indexOf('.') != -1 &&
+					String(this.detailData.deductionWeight).length -
+					(String(this.detailData.deductionWeight).indexOf('.') + 1) >
+					1) ||
+				this.detailData.deductionWeight < 1 ||
+				this.detailData.deductionWeight > 100000
+			) {
+				this.$api.msg('扣重输入错误!')
+				return
+			}
+			if (this.detailData.tare > this.detailData.grossWeight) {
+				this.$api.msg('皮重不能大于毛重')
+				return
+			}
+			if (this.netWeight < 0) {
+				this.$api.msg('净重不能小于0')
+				return
+			}
+			if (this.detailData.type == "潮粮") {
+				if (!this.detailData.buckleWeightRatio) {
+					this.$api.msg('扣重比不能为空')
+					return
+				}
+				if (isNaN(this.detailData.buckleWeightRatio) ||
+					(String(this.detailData.buckleWeightRatio).indexOf('.') != -1 &&
+						String(this.detailData.buckleWeightRatio).length -
+						(String(this.detailData.buckleWeightRatio).indexOf('.') + 1) >
+						2) ||
+					this.detailData.buckleWeightRatio < 0 ||
+					this.detailData.buckleWeightRatio > 2
+				) {
+					this.$api.msg('扣重比输入错误!')
+					return
+				}
+				if (!this.detailData.solidGrainWater) {
+					this.$api.msg('干粮水分不能为空')
+					return
+				}
+				if (isNaN(this.detailData.solidGrainWater) ||
+					(String(this.detailData.solidGrainWater).indexOf('.') != -1 &&
+						String(this.detailData.solidGrainWater).length -
+						(String(this.detailData.solidGrainWater).indexOf('.') + 1) >
 						1) ||
-					this.detailData.grossWeight < 1 ||
-					this.detailData.grossWeight > 100000
+					this.detailData.solidGrainWater < 1 ||
+					this.detailData.solidGrainWater > 40
 				) {
-					this.$api.msg('毛重输入错误!')
+					this.$api.msg('干粮水分输入错误!')
+					return
+				}
+				if (!this.detailData.tidalGrainWater) {
+					this.$api.msg('潮粮水分不能为空')
+					return
+				}
+				if (isNaN(this.detailData.deductionAmount) ||
+					(String(this.detailData.deductionAmount).indexOf('.') != -1 &&
+						String(this.detailData.deductionAmount).length -
+						(String(this.detailData.deductionAmount).indexOf('.') + 1) >
+						2) ||
+					this.detailData.deductionAmount < 1 ||
+					this.detailData.deductionAmount > 10000
+				) {
+					this.$api.msg('扣款输入错误!')
+					return
+				}
+				if (!this.detailData.deductionAmount) {
+					this.$api.msg('扣款不能为空')
+					return
+				}
+				if (isNaN(this.detailData.tidalGrainWater) ||
+					(String(this.detailData.tidalGrainWater).indexOf('.') != -1 &&
+						String(this.detailData.tidalGrainWater).length -
+						(String(this.detailData.tidalGrainWater).indexOf('.') + 1) >
+						1) ||
+					this.detailData.tidalGrainWater < 1 ||
+					this.detailData.tidalGrainWater > 40
+				) {
+					this.$api.msg('潮粮水分输入错误!')
+					return
+				}
+				if (this.detailData.tidalGrainWater < this.detailData.solidGrainWater) {
+					this.$api.msg('潮粮水分输入错误!')
+					return
+				}
+				if (!this.detailData.pureWeight) {
+					this.$api.msg('纯重不能为空')
+					return
+				}
+			}
+			if (this.detailData.grade == "请输入品级") {
+				this.$api.msg('品级不能为空')
+				return
+			}
+			if (this.detailData.agent == "请选择经办人") {
+				this.$api.msg('经办人不能为空')
+				return
+			}
+			if (this.detailData.inOutDate == "请选择入库日期") {
+				this.$api.msg('入库日期不能为空')
+				return
+			}
+			if (this.detailData.inOutType == "请选择入库类型") {
+				this.$api.msg('入库类型不能为空')
+				return
+			}
+			if (!this.detailData.carNo) {
+				this.$api.msg('车牌号不能为空')
+				return
+			}
+			if (this.detailData.carNo.length != 7) {
+				this.$api.msg('车牌号输入有误!')
+				return
+			}
+			if (!this.detailData.addressUrl) {
+				this.$api.msg('请上传磅单')
+				return
+			}
+				if (!this.detailData.cost) {
+					this.$api.msg('未获取到成本,请编辑后提交')
+					return
+				}
+				if (String(this.detailData.cost).indexOf('.') != -1 && String(this.detailData
+						.cost).length - (String(
+						this.detailData.cost).indexOf('.') + 1) > 2) {
+					this.$api.msg('成本输入错误')
+					return
+				}
+				if (this.detailData.cost < 0 || this.detailData.cost > 20000) {
+					this.$api.msg('成本输入错误')
+					return
+				}
+			if (!this.detailData.freight) {
+				this.$api.msg('运费不能为空')
+				return
+			}
+			if (this.detailData.warehouseInOutDetail.qualityInspector) {
+				if (this.detailData.warehouseInOutDetail.qualityInspector < 2 || this.detailData
+					.warehouseInOutDetail
+					.qualityInspector > 10) {
+					this.$api.msg('质检员姓名需要2-10个字')
+					return
+				}
+			}
+			if (this.detailData.warehouseInOutDetail.waterContent) {
+				if (this.detailData.type == "潮粮" && this.detailData.warehouseInOutDetail.waterContent != this
+					.detailData.tidalGrainWater) {
+					this.$api.msg('水分占比与潮粮水分不一致')
 					return
 				}
+				if (this.detailData.type == "干粮") {
+					if (this.detailData.warehouseInOutDetail.waterContent < 0 || this.detailData
+						.warehouseInOutDetail
+						.waterContent > 40) {
+						this.$api.msg('热损伤占比输入错误')
+						return
+					}
+					if (String(this.detailData.warehouseInOutDetail.waterContent).indexOf('.') != -1 && String(this
+							.detailData.warehouseInOutDetail.jiaorenli).length - (String(
+							this.detailData.warehouseInOutDetail.waterContent).indexOf('.') + 1) > 1) {
+						this.$api.msg('热损伤占比输入错误')
+						return
+					}
+				}
+			}
+			if (this.detailData.warehouseInOutDetail.bulkDensity) {
+				if (this.detailData.warehouseInOutDetail.bulkDensity < 500 || this.detailData.warehouseInOutDetail
+					.bulkDensity > 1000) {
+					this.$api.msg('容重输入错误')
+					return
+				}
+				if (String(this.detailData.warehouseInOutDetail.bulkDensity).indexOf('.') != -1 && String(this
+						.detailData.warehouseInOutDetail.bulkDensity).length - (
+						String(this.detailData.warehouseInOutDetail.bulkDensity).indexOf('.') + 1) > 0) {
+					this.$api.msg('容重输入错误')
+					return
+				}
+			}
+			if (this.detailData.warehouseInOutDetail.jiaorenli) {
+				if (this.detailData.warehouseInOutDetail.jiaorenli < 0 || this.detailData.warehouseInOutDetail
+					.jiaorenli > 40) {
+					this.$api.msg('热损伤占比输入错误')
+					return
+				}
+				if (String(this.detailData.warehouseInOutDetail.jiaorenli).indexOf('.') != -1 && String(this
+						.detailData
+						.warehouseInOutDetail.jiaorenli).length - (String(
+						this.detailData.warehouseInOutDetail.jiaorenli).indexOf('.') + 1) > 1) {
+					this.$api.msg('热损伤占比输入错误')
+					return
+				}
+			}
+			if (this.detailData.warehouseInOutDetail.impurity) {
+				if (this.detailData.warehouseInOutDetail.impurity < 0 || this.detailData.warehouseInOutDetail
+					.impurity > 40) {
+					this.$api.msg('杂质占比输入错误')
+					return
+				}
+				if (String(this.detailData.warehouseInOutDetail.impurity).indexOf('.') != -1 && String(this
+						.detailData
+						.warehouseInOutDetail.impurity).length - (String(
+						this.detailData.warehouseInOutDetail.impurity).indexOf('.') + 1) > 1) {
+					this.$api.msg('杂质占比输入错误')
+					return
+				}
+			}
+			if (this.detailData.warehouseInOutDetail.mildewGrain) {
+				if (this.detailData.warehouseInOutDetail.mildewGrain < 0 || this.detailData.warehouseInOutDetail
+					.mildewGrain > 40) {
+					this.$api.msg('霉变粒占比输入错误')
+					return
+				}
+				if (String(this.detailData.warehouseInOutDetail.mildewGrain).indexOf('.') != -1 && String(this
+						.detailData
+						.warehouseInOutDetail.mildewGrain).length - (String(
+						this.detailData.warehouseInOutDetail.mildewGrain).indexOf('.') + 1) > 1) {
+					this.$api.msg('霉变粒占比输入错误')
+					return
+				}
+			}
+			if (this.detailData.warehouseInOutDetail.imperfectGrain) {
+				if (this.detailData.warehouseInOutDetail.imperfectGrain < 0 || this.detailData.warehouseInOutDetail
+					.imperfectGrain > 40) {
+					this.$api.msg('不完善粒占比输入错误')
+					return
+				}
+				if (String(this.detailData.warehouseInOutDetail.imperfectGrain).indexOf('.') != -1 && String(this
+						.detailData
+						.warehouseInOutDetail.imperfectGrain).length - (String(
+						this.detailData.warehouseInOutDetail.imperfectGrain).indexOf('.') + 1) > 1) {
+					this.$api.msg('不完善粒占比输入错误')
+					return
+				}
+			}
 				this.detailData.baseId = helper.erpWarehouse.warehouseId
 				this.detailData.warehouseName = helper.erpWarehouse.warehouseName
 				this.detailData.positionId = helper.erpWarehouse.positionId
@@ -490,7 +753,9 @@
 		.top {
 			display: flex;
 			margin-bottom: 20rpx;
-
+			border-radius: 20rpx;
+			background: white;
+			padding: 20rpx;
 			.top-left {
 				margin-right: 20rpx;
 			}

+ 74 - 52
pages/erp/index.vue

@@ -4,8 +4,8 @@
 			<view class="comp" @click='show0=true'>
 				<view>{{compName}}</view>
 				<u-icon name="arrow-right" color="" v-if="compList.length>1"></u-icon>
-				<u-picker @confirm="compChange" range-key='compName' mode="selector" v-model="show0"
-					:range="compList" v-if="compList.length>1"></u-picker>
+				<u-picker @confirm="compChange" range-key='compName' mode="selector" v-model="show0" :range="compList"
+					v-if="compList.length>1"></u-picker>
 			</view>
 			<view class='title'>仓库管理</view>
 			<view class="dropdown">
@@ -22,31 +22,29 @@
 						:range="warehouseCWList"></u-picker>
 				</view>
 			</view>
-			
+
 			<view class="cu-list grid" :class="['col-' + gridCol,gridBorder?'':'no-border']">
 				<view class="cu-item" v-for="(item,index) in gridList" :key="index" @click="gridClick(item, index)"
 					v-if="index<gridCol*2">
 					<view :class="['cuIcon-' + item.cuIcon,'text-' + item.color]">
 						<image :src="item.src" class="sign"></image>
 					</view>
-			
+
 					<text>{{item.name}}</text>
 				</view>
 			</view>
 		</view>
-		
-		<u-modal v-model="isShowAlert"
-		 :title-style="{fontSize: '18px',fontWeight:'500'}" 
-		 :content-style="{fontSize: '14px',fontWeight:'400'}" 
-		 confirm-color='#22C572' confirm-text='立即开通' title='您尚未开通ERP业务'
-		 :content="content" @confirm="goOpenService"></u-modal>
+
+		<u-modal v-model="isShowAlert" :title-style="{fontSize: '18px',fontWeight:'500'}"
+			:content-style="{fontSize: '14px',fontWeight:'400'}" confirm-color='#22C572' confirm-text='立即开通'
+			title='您尚未开通ERP业务' :content="content" @confirm="goOpenService"></u-modal>
 	</view>
 </template>
 <script>
 	import {
 		mapState
 	} from 'vuex';
-import helper from '@/common/helper.js'; 
+	import helper from '@/common/helper.js';
 	export default {
 		components: {
 
@@ -57,19 +55,20 @@ import helper from '@/common/helper.js';
 				show1: false,
 				show2: false,
 				isShowAlert: false,
-				compName:'',
-				compList:[],
+				compName: '',
+				compList: [],
 				content: '易粮易运ERP系统包含合同管理、仓库管理、运输管理、结算管理等多个模块,可为粮企提供粮食贸易的全流程服务,平台诚邀您的加入。',
 				warehouseName: '暂无仓库',
 				binNumber: '暂无',
-				compId:'',
-				warehouseId:"",
-				positionId:"",
+				compId: '',
+				warehouseId: "",
+				positionId: "",
 				warehouseList: [],
-				warehouseCWList:[],
-				allWarehouse:[],
+				warehouseCWList: [],
+				allWarehouse: [],
 				gridCol: 4,
 				gridBorder: false,
+				personCharge:'',
 				gridList: [{
 						num: 0,
 						name: '入库',
@@ -128,8 +127,7 @@ import helper from '@/common/helper.js';
 			}
 		},
 
-		onLoad() {
-		},
+		onLoad() {},
 		// #ifndef MP
 		onNavigationBarButtonTap(e) {
 			const index = e.index;
@@ -174,13 +172,13 @@ import helper from '@/common/helper.js';
 					})
 				}
 			})
-			this.$api.doRequest('get', '/openServiceInfo/selectCommonCompany',{
-				phone:this.userInfo.phone
+			this.$api.doRequest('get', '/openServiceInfo/selectCommonCompany', {
+				phone: this.userInfo.phone
 			}).then(res => {
 				if (res.data.code == 200) {
-					if(res.data.data.length==0){
+					if (res.data.data.length == 0) {
 						this.isShowAlert = true
-					}else{
+					} else {
 						this.isShowAlert = false
 					}
 					this.compList = res.data.data
@@ -190,8 +188,8 @@ import helper from '@/common/helper.js';
 			})
 		},
 		methods: {
-			getCompWarehouse(){},
-			goOpenService(){
+			getCompWarehouse() {},
+			goOpenService() {
 				if (!this.hasLogin) {
 					url = '/pages/public/login';
 				}
@@ -232,14 +230,15 @@ import helper from '@/common/helper.js';
 				} else {
 					if (item.url) {
 						helper.erpWarehouse = {
-							warehouseName:this.warehouseName,
-							binNumber:this.binNumber,
-							compId:this.compId,
-							warehouseId:this.warehouseId,
-							baseId:this.baseId,
-							allWarehouse:this.allWarehouse,
-							warehouseCWList:this.warehouseCWList,
-							positionId: this.positionId
+							warehouseName: this.warehouseName,
+							binNumber: this.binNumber,
+							compId: this.compId,
+							warehouseId: this.warehouseId,
+							baseId: this.baseId,
+							allWarehouse: this.allWarehouse,
+							warehouseCWList: this.warehouseCWList,
+							positionId: this.positionId,
+							personCharge:this.personCharge
 						}
 						uni.navigateTo({
 							url: item.url
@@ -249,7 +248,7 @@ import helper from '@/common/helper.js';
 			},
 			confirmWarehouse() {},
 			confirmPositon() {},
-			compChange(e){
+			compChange(e) {
 				this.compName = this.compList[e[0]].compName
 				this.init(this.compList[e[0]].compId)
 			},
@@ -258,8 +257,24 @@ import helper from '@/common/helper.js';
 				this.$api.doRequest('get', '/warehouseBaseInfo/selectWarehouseSelf', {
 					compId: compId,
 				}).then(res => {
-					if (res.data.data.length!=0) {
-						console.log('res',res.data.data)
+					if (res.data.data.length != 0) {
+						console.log('res', res.data.data)
+						let _showData = uni.getStorageSync("erpSelectWarehous")
+						let _showCWData = uni.getStorageSync("erpSelectWarehousCW")
+						this.allWarehouse = res.data.data
+						this.warehouseList = res.data.data;
+						if (_showData) {
+							this.warehouseName = _showData.warehouseName
+							this.compId = _showData.compId
+							this.agent = _showData.agent
+							this.binNumber = _showCWData.binNumber
+							this.warehouseCWList = _showData.positionInfos
+							this.warehouseId = _showData.id
+							this.baseId = _showCWData.baseId
+							this.positionId = _showCWData.id
+							this.personCharge = _showData.personCharge
+							console.log('this.warehouseCWList', this.warehouseCWList)
+						} else {
 							this.allWarehouse = res.data.data
 							this.warehouseName = res.data.data[0].warehouseName
 							this.warehouseList = res.data.data;
@@ -270,32 +285,35 @@ import helper from '@/common/helper.js';
 							this.warehouseId = res.data.data[0].id
 							this.baseId = res.data.data[0].positionInfos[0].baseId
 							this.positionId = res.data.data[0].positionInfos[0].id
-							console.log('this.warehouseCWList',this.warehouseCWList)
-							// this.makeBinNumber()
-						
-					}
-					else{
-						this.warehouseList=[]
+							this.personCharge = res.data.data[0].personCharge
+							console.log('this.warehouseCWList', this.warehouseCWList)
+						}
+
+					} else {
+						this.warehouseList = []
 						this.warehouseCWList = []
-						this.warehouseName='暂无仓库'
-						this.binNumber='暂无'
+						this.warehouseName = '暂无仓库'
+						this.binNumber = '暂无'
 					}
 				})
 			},
-			makeBinNumber(){
-			
+			makeBinNumber() {
+
 			},
 			warehousechange(e) {
 				this.warehouseName = this.warehouseList[e[0]].warehouseName
 				this.compId = this.warehouseList[e[0]].compId
 				this.agent = this.warehouseList[e[0]].agent
-				this.warehouseId =this.warehouseList[e[0]].id
+				this.warehouseId = this.warehouseList[e[0]].id
 				this.warehouseCWList = this.warehouseList[e[0]].positionInfos
+				uni.setStorageSync('erpSelectWarehous', this.warehouseList[e[0]])
+				this.warehouseCWchange([0])
 			},
-			warehouseCWchange(e){
+			warehouseCWchange(e) {
 				this.binNumber = this.warehouseCWList[e[0]].binNumber
 				this.baseId = this.warehouseCWList[e[0]].baseId
-				this.positionId = this.warehouseCWList[e[0]].positionId
+				this.positionId = this.warehouseCWList[e[0]].id
+				uni.setStorageSync('erpSelectWarehousCW', this.warehouseCWList[e[0]])
 			}
 
 		}
@@ -400,12 +418,15 @@ import helper from '@/common/helper.js';
 		justify-content: space-between;
 		border-bottom: 1px solid #EEEEEE;
 		padding-bottom: 20rpx;
+
 		.left,
 		.right {
 			display: flex;
+			align-items: center;
 		}
 	}
-	.comp{
+
+	.comp {
 		display: flex;
 		font-size: 36rpx;
 		font-weight: 500;
@@ -415,7 +436,8 @@ import helper from '@/common/helper.js';
 		font-weight: 700;
 		border-bottom: 1px solid #EEEEEE;
 	}
-	 .-model__title{
+
+	.-model__title {
 		background: red;
 		color: red;
 	}

+ 286 - 11
pages/erp/warehousing/warehousing.vue

@@ -66,8 +66,7 @@
 			<view class="row">
 				<view class="left">品级</view>
 				<view @click='show3=true'>{{detailData.grade}}</view>
-				<u-picker :range="pjList" range-key="grade" @confirm='pjPicker($event)' v-model="show3"
-					mode="selector">
+				<u-picker :range="pjList" range-key="grade" @confirm='pjPicker($event)' v-model="show3" mode="selector">
 				</u-picker>
 			</view>
 			<view class="row">
@@ -100,10 +99,10 @@
 			</view>
 			<view class="row row-bottom has-btn">
 				<view class="left">成本(元/吨)</view>
-				<input v-if="detailData.inOutType=='采购入库'" v-model='detailData.unitContractPrice' class="right-bottom"
-					placeholder="自动获取" :disabled="isEditCB"></input>
-				<input v-if="detailData.inOutType!='采购入库'" v-model='detailData.cost' class="right-bottom"
+				<input v-model='detailData.cost' class="right-bottom"
 					placeholder="自动获取" :disabled="isEditCB"></input>
+				<!-- <input v-if="detailData.inOutType!='采购入库'" v-model='detailData.cost' class="right-bottom"
+					placeholder="自动获取" :disabled="isEditCB"></input> -->
 				<u-button class="edit-btn" hover-class="none" @click="editCB">编辑</u-button>
 			</view>
 			<view class="row row-bottom has-btn">
@@ -191,9 +190,9 @@
 					year: true,
 					month: true,
 					day: true,
-					hour: true,
-					minute: true,
-					second: true
+					// hour: true,
+					// minute: true,
+					// second: true
 				},
 				isEditCB: 'false',
 				isEditYF: 'false',
@@ -247,7 +246,7 @@
 					carNo: '辽H12345',
 					type: "干粮",
 					goodsName: "123",
-					inOutDate: '请输入入库日期',
+					inOutDate: '请选择入库日期',
 					grade: "一等品",
 					agent: '请选择经办人',
 					inOutType: '请选择入库类型',
@@ -256,6 +255,7 @@
 					tare: 0,
 					deductionAmount: 0,
 					netWeight: 0,
+					cost:0,
 					warehouseInOutDetail: {}
 				}
 			}
@@ -271,10 +271,16 @@
 		},
 		onShow() {
 			let _data = uni.getStorageSync('erpContractNo')
+			this.detailData.agent = helper.erpWarehouse.personCharge
 			this.detailData.goodsName = _data.goodsName;
 			this.detailData.contractNo = _data.contractNo;
 			this.detailData.goodsNameKey = _data.goodsNameKey;
-			this.detailData.unitContractPrice = _data.unitContractPrice
+			if(_data.unitContractPrice) {
+				this.detailData.cost = _data.unitContractPrice
+			}
+			let _day = new Date();
+			_day.setTime(_day.getTime());
+			this.detailData.inOutDate = _day.getFullYear() + "-" + (_day.getMonth() + 1) + "-" + _day.getDate();
 			if (_data.inOutType == '采购入库') {
 				this.detailData.freight = 0
 			}
@@ -337,7 +343,7 @@
 			pjPicker(e) {
 				console.log(e)
 				this.detailData.gradeKey = e[0]
-				    this.detailData.grade = this.pjList[e].grade
+				this.detailData.grade = this.pjList[e].grade
 			},
 			handlerPicker(e) {
 				console.log(e)
@@ -419,6 +425,18 @@
 				this.isEditYF = false
 			},
 			submit(num) {
+				if (!this.detailData.contractNo) {
+					this.$api.msg('合同编号不能为空')
+					return
+				}
+				if (!this.detailData.goodsName) {
+					this.$api.msg('货名不能为空')
+					return
+				}
+				if (!this.detailData.grossWeight) {
+					this.$api.msg('毛重不能为空')
+					return
+				}
 				if (isNaN(this.detailData.grossWeight) ||
 					(String(this.detailData.grossWeight).indexOf('.') != -1 &&
 						String(this.detailData.grossWeight).length -
@@ -430,6 +448,259 @@
 					this.$api.msg('毛重输入错误!')
 					return
 				}
+				if (!this.detailData.tare) {
+					this.$api.msg('皮重不能为空')
+					return
+				}
+				if (isNaN(this.detailData.tare) ||
+					(String(this.detailData.tare).indexOf('.') != -1 &&
+						String(this.detailData.tare).length -
+						(String(this.detailData.tare).indexOf('.') + 1) >
+						3) ||
+					this.detailData.tare < 0 ||
+					this.detailData.tare > 10
+				) {
+					this.$api.msg('皮重输入错误!')
+					return
+				}
+
+				if (!this.detailData.deductionWeight) {
+					this.$api.msg('扣重不能为空')
+					return
+				}
+				if (isNaN(this.detailData.deductionWeight) ||
+					(String(this.detailData.deductionWeight).indexOf('.') != -1 &&
+						String(this.detailData.deductionWeight).length -
+						(String(this.detailData.deductionWeight).indexOf('.') + 1) >
+						1) ||
+					this.detailData.deductionWeight < 1 ||
+					this.detailData.deductionWeight > 100000
+				) {
+					this.$api.msg('扣重输入错误!')
+					return
+				}
+				if (this.detailData.tare > this.detailData.grossWeight) {
+					this.$api.msg('皮重不能大于毛重')
+					return
+				}
+				if (this.netWeight < 0) {
+					this.$api.msg('净重不能小于0')
+					return
+				}
+				if (this.detailData.type == "潮粮") {
+					if (!this.detailData.buckleWeightRatio) {
+						this.$api.msg('扣重比不能为空')
+						return
+					}
+					if (isNaN(this.detailData.buckleWeightRatio) ||
+						(String(this.detailData.buckleWeightRatio).indexOf('.') != -1 &&
+							String(this.detailData.buckleWeightRatio).length -
+							(String(this.detailData.buckleWeightRatio).indexOf('.') + 1) >
+							2) ||
+						this.detailData.buckleWeightRatio < 0 ||
+						this.detailData.buckleWeightRatio > 2
+					) {
+						this.$api.msg('扣重比输入错误!')
+						return
+					}
+					if (!this.detailData.solidGrainWater) {
+						this.$api.msg('干粮水分不能为空')
+						return
+					}
+					if (isNaN(this.detailData.solidGrainWater) ||
+						(String(this.detailData.solidGrainWater).indexOf('.') != -1 &&
+							String(this.detailData.solidGrainWater).length -
+							(String(this.detailData.solidGrainWater).indexOf('.') + 1) >
+							1) ||
+						this.detailData.solidGrainWater < 1 ||
+						this.detailData.solidGrainWater > 40
+					) {
+						this.$api.msg('干粮水分输入错误!')
+						return
+					}
+					if (!this.detailData.tidalGrainWater) {
+						this.$api.msg('潮粮水分不能为空')
+						return
+					}
+					if (isNaN(this.detailData.deductionAmount) ||
+						(String(this.detailData.deductionAmount).indexOf('.') != -1 &&
+							String(this.detailData.deductionAmount).length -
+							(String(this.detailData.deductionAmount).indexOf('.') + 1) >
+							2) ||
+						this.detailData.deductionAmount < 1 ||
+						this.detailData.deductionAmount > 10000
+					) {
+						this.$api.msg('扣款输入错误!')
+						return
+					}
+					if (!this.detailData.deductionAmount) {
+						this.$api.msg('扣款不能为空')
+						return
+					}
+					if (isNaN(this.detailData.tidalGrainWater) ||
+						(String(this.detailData.tidalGrainWater).indexOf('.') != -1 &&
+							String(this.detailData.tidalGrainWater).length -
+							(String(this.detailData.tidalGrainWater).indexOf('.') + 1) >
+							1) ||
+						this.detailData.tidalGrainWater < 1 ||
+						this.detailData.tidalGrainWater > 40
+					) {
+						this.$api.msg('潮粮水分输入错误!')
+						return
+					}
+					if (this.detailData.tidalGrainWater < this.detailData.solidGrainWater) {
+						this.$api.msg('潮粮水分输入错误!')
+						return
+					}
+					if (!this.detailData.pureWeight) {
+						this.$api.msg('纯重不能为空')
+						return
+					}
+				}
+				if (this.detailData.grade == "请输入品级") {
+					this.$api.msg('品级不能为空')
+					return
+				}
+				if (this.detailData.agent == "请选择经办人") {
+					this.$api.msg('经办人不能为空')
+					return
+				}
+				if (this.detailData.inOutDate == "请选择入库日期") {
+					this.$api.msg('入库日期不能为空')
+					return
+				}
+				if (this.detailData.inOutType == "请选择入库类型") {
+					this.$api.msg('入库类型不能为空')
+					return
+				}
+				if (!this.detailData.carNo) {
+					this.$api.msg('车牌号不能为空')
+					return
+				}
+				if (this.detailData.carNo.length != 7) {
+					this.$api.msg('车牌号输入有误!')
+					return
+				}
+				if (!this.detailData.addressUrl) {
+					this.$api.msg('请上传磅单')
+					return
+				}
+					if (!this.detailData.cost) {
+						this.$api.msg('未获取到成本,请编辑后提交')
+						return
+					}
+					if (String(this.detailData.cost).indexOf('.') != -1 && String(this.detailData
+							.cost).length - (String(
+							this.detailData.cost).indexOf('.') + 1) > 2) {
+						this.$api.msg('成本输入错误')
+						return
+					}
+					if (this.detailData.cost < 0 || this.detailData.cost > 20000) {
+						this.$api.msg('成本输入错误')
+						return
+					}
+				if (!this.detailData.freight) {
+					this.$api.msg('运费不能为空')
+					return
+				}
+				if (this.detailData.warehouseInOutDetail.qualityInspector) {
+					if (this.detailData.warehouseInOutDetail.qualityInspector < 2 || this.detailData
+						.warehouseInOutDetail
+						.qualityInspector > 10) {
+						this.$api.msg('质检员姓名需要2-10个字')
+						return
+					}
+				}
+				if (this.detailData.warehouseInOutDetail.waterContent) {
+					if (this.detailData.type == "潮粮" && this.detailData.warehouseInOutDetail.waterContent != this
+						.detailData.tidalGrainWater) {
+						this.$api.msg('水分占比与潮粮水分不一致')
+						return
+					}
+					if (this.detailData.type == "干粮") {
+						if (this.detailData.warehouseInOutDetail.waterContent < 0 || this.detailData
+							.warehouseInOutDetail
+							.waterContent > 40) {
+							this.$api.msg('热损伤占比输入错误')
+							return
+						}
+						if (String(this.detailData.warehouseInOutDetail.waterContent).indexOf('.') != -1 && String(this
+								.detailData.warehouseInOutDetail.jiaorenli).length - (String(
+								this.detailData.warehouseInOutDetail.waterContent).indexOf('.') + 1) > 1) {
+							this.$api.msg('热损伤占比输入错误')
+							return
+						}
+					}
+				}
+				if (this.detailData.warehouseInOutDetail.bulkDensity) {
+					if (this.detailData.warehouseInOutDetail.bulkDensity < 500 || this.detailData.warehouseInOutDetail
+						.bulkDensity > 1000) {
+						this.$api.msg('容重输入错误')
+						return
+					}
+					if (String(this.detailData.warehouseInOutDetail.bulkDensity).indexOf('.') != -1 && String(this
+							.detailData.warehouseInOutDetail.bulkDensity).length - (
+							String(this.detailData.warehouseInOutDetail.bulkDensity).indexOf('.') + 1) > 0) {
+						this.$api.msg('容重输入错误')
+						return
+					}
+				}
+				if (this.detailData.warehouseInOutDetail.jiaorenli) {
+					if (this.detailData.warehouseInOutDetail.jiaorenli < 0 || this.detailData.warehouseInOutDetail
+						.jiaorenli > 40) {
+						this.$api.msg('热损伤占比输入错误')
+						return
+					}
+					if (String(this.detailData.warehouseInOutDetail.jiaorenli).indexOf('.') != -1 && String(this
+							.detailData
+							.warehouseInOutDetail.jiaorenli).length - (String(
+							this.detailData.warehouseInOutDetail.jiaorenli).indexOf('.') + 1) > 1) {
+						this.$api.msg('热损伤占比输入错误')
+						return
+					}
+				}
+				if (this.detailData.warehouseInOutDetail.impurity) {
+					if (this.detailData.warehouseInOutDetail.impurity < 0 || this.detailData.warehouseInOutDetail
+						.impurity > 40) {
+						this.$api.msg('杂质占比输入错误')
+						return
+					}
+					if (String(this.detailData.warehouseInOutDetail.impurity).indexOf('.') != -1 && String(this
+							.detailData
+							.warehouseInOutDetail.impurity).length - (String(
+							this.detailData.warehouseInOutDetail.impurity).indexOf('.') + 1) > 1) {
+						this.$api.msg('杂质占比输入错误')
+						return
+					}
+				}
+				if (this.detailData.warehouseInOutDetail.mildewGrain) {
+					if (this.detailData.warehouseInOutDetail.mildewGrain < 0 || this.detailData.warehouseInOutDetail
+						.mildewGrain > 40) {
+						this.$api.msg('霉变粒占比输入错误')
+						return
+					}
+					if (String(this.detailData.warehouseInOutDetail.mildewGrain).indexOf('.') != -1 && String(this
+							.detailData
+							.warehouseInOutDetail.mildewGrain).length - (String(
+							this.detailData.warehouseInOutDetail.mildewGrain).indexOf('.') + 1) > 1) {
+						this.$api.msg('霉变粒占比输入错误')
+						return
+					}
+				}
+				if (this.detailData.warehouseInOutDetail.imperfectGrain) {
+					if (this.detailData.warehouseInOutDetail.imperfectGrain < 0 || this.detailData.warehouseInOutDetail
+						.imperfectGrain > 40) {
+						this.$api.msg('不完善粒占比输入错误')
+						return
+					}
+					if (String(this.detailData.warehouseInOutDetail.imperfectGrain).indexOf('.') != -1 && String(this
+							.detailData
+							.warehouseInOutDetail.imperfectGrain).length - (String(
+							this.detailData.warehouseInOutDetail.imperfectGrain).indexOf('.') + 1) > 1) {
+						this.$api.msg('不完善粒占比输入错误')
+						return
+					}
+				}
 				this.detailData.baseId = helper.erpWarehouse.warehouseId
 				this.detailData.warehouseName = helper.erpWarehouse.warehouseName
 				this.detailData.positionId = helper.erpWarehouse.positionId
@@ -491,8 +762,12 @@
 		padding: 20rpx 20rpx 140rpx 20rpx;
 
 		.top {
+			border-radius: 20rpx;
+			background: white;
+			padding: 20rpx;
 			display: flex;
 			margin-bottom: 20rpx;
+			align-items: center;
 
 			.top-left {
 				margin-right: 20rpx;

+ 1 - 0
pages/erpbusiness/acquisitionInspection/acquisitionInspection.vue

@@ -139,6 +139,7 @@
 				}).then(res => {
 					console.log("warehouseBaseInfo", res)
 					let _resData = res.data.data
+					this.warehouseList = []
 					for (let i = 0; i < _resData.length; i++) {
 						let _obj = {
 							"label": _resData[i].warehouseName,

+ 6 - 5
pages/erpbusiness/add_quality_testing.vue

@@ -80,7 +80,8 @@
 			<view v-if="gridList.type == '潮粮'" class="c-row">
 				<view class="title">净重单价(元/公斤)</view>
 				<view class="con-list">
-					{{gridList.tidalGrainPrice}}
+					<input v-model='gridList.tidalGrainPrice' disabled placeholder="自动获取,不可编辑"
+						 name="input"></input>
 				</view>
 			</view>
 			<view v-if="gridList.type == '干粮'" class="c-row">
@@ -91,7 +92,7 @@
 				</view>
 			</view>
 		</view>
-		<view style='margin-bottom:100px;' class='wrap'>
+		<view style='margin-bottom:300rpx;' class='wrap'>
 			<view class='title_b'>化验信息</view>
 
 			<view class="c-row ">
@@ -250,11 +251,11 @@
 		onLoad(options){
 			
 			this.commonWarehouseNo=options.commonWarehouseNo
-			this.warehouseCount=options.warehouseCount
+			this.warehouseCount=Number(options.warehouseCount) + 1
 			 let number = '000' + this.warehouseCount
 			 number = number.substring(number.length - 4, number.length)
 			this.gridList.warehouseName=options.warehouseName
-			this.gridList.qualityNo='ZCRK' + this.getdate() + this.commonWarehouseNo + number
+			this.gridList.qualityNo='SGRK' + this.getdate() + this.commonWarehouseNo + number
 			this.purchasePriceList=uni.getStorageSync('purchasePriceList')
 			this.cangid=options.cangid
 			this.managementType=options.managementType
@@ -377,7 +378,7 @@
 					this.$api.msg('车牌号不能为空')
 					return
 				}
-				if (this.gridList.carNumber.length > 7) {
+				if (this.gridList.carNumber.length != 7) {
 					this.$api.msg('车牌号输入错误')
 					return
 				}

+ 2 - 1
pages/erpbusiness/edit_quality_testing.vue

@@ -71,7 +71,8 @@
 			<view class="c-row">
 				<view class="title">净重单价(元/公斤)</view>
 				<view class="con-list">
-					{{gridList.tidalGrainPrice}}
+					<input v-model='gridList.tidalGrainPrice' disabled placeholder="自动获取,不可编辑"
+						 name="input"></input>
 				</view>
 			</view>
 		</view>

+ 1 - 7
pages/erpbusiness/examine_quality_testing.vue

@@ -117,7 +117,7 @@
 			<view class="c-row ">
 				<view class="title">霉变粒(%)</view>
 				<view class="con-list">
-					{{gridList.impurity}}
+					{{gridList.mildewGrain}}
 				</view>
 			</view>
 			<view class="c-row ">
@@ -126,12 +126,6 @@
 					{{gridList.jiaorenli}}
 				</view>
 			</view>
-			<view class="c-row ">
-				<view class="title">不完善粒(%)<=</view>
-				<view class="con-list">
-					{{gridList.imperfectGrain}}
-				</view>
-			</view>
 		</view>
 	</view>
 </template>

+ 29 - 8
pages/erpbusiness/quality_testing.vue

@@ -1,5 +1,5 @@
 <template>
-	<view>
+	<view class="center">
 		<view class='navbar' style='position:fixed;background:#fff;top:0;width:100%;z-index:3;'>
 			<view class="back-btn cuIcon-back" @click="navBack"></view>
 				<view class='header-content' v-if='managementType==3'>出库质检</view>
@@ -194,18 +194,37 @@
 			this.managementType=options.managementType
 		},
 		onShow() {
+			var that = this
+			if(this.cangid){
+				uni.setStorageSync("cangid",this.cangid)
+			}
+			else{
+				this.cangid = uni.getStorageSync("cangid")
+			}
 			this.gridList=[]
 			this.$api.doRequest('get', '/warehouseBaseInfo/selectWarehouseSelf',{
 				compId:'',
 				personCharge:this.userInfo.phone
 			}).then(res => {
 				if(res.data.data){
-					this.warehouseName=res.data.data[0].warehouseName
-					this.cangid=res.data.data[0].id
-					this.warehouseCount = res.data.data[0].count
-					this.commonWarehouseNo=res.data.data[0].commonWarehouseNo
-					uni.setStorageSync('purchasePriceList',res.data.data[0].purchasePriceList)
-					this.selector=res.data.data
+					let list = res.data.data
+					for(var i=0;i<list.length;i++){
+						if (that.cangid&&that.cangid == list[i].id) {
+						  that.warehouseName = list[i].warehouseName
+						  that.warehouseCount =  list[i].count
+						  that.commonWarehouseNo =  list[i].commonWarehouseNo
+						  uni.setStorageSync('purchasePriceList',list[i].purchasePriceList)
+						  break
+						} 
+					}
+					that.selector=res.data.data
+					if(that.selector.length > 0 && !that.cangid){
+						that.warehouseName = that.selector[0].warehouseName
+						that.warehouseCount =  that.selector[0].count
+						that.commonWarehouseNo =  that.selector[0].commonWarehouseNo
+						that.cangid =  that.selector[0].id
+						uni.setStorageSync('purchasePriceList',that.selector[0].purchasePriceList)
+					}
 					this.getList(true)
 				}
 			})
@@ -235,6 +254,7 @@
 			warehousechange(e){
 				this.warehouseName=this.selector[e[0]].warehouseName
 				this.cangid=this.selector[e[0]].id
+				uni.setStorageSync("cangid",this.cangid)
 				this.warehouseCount = this.selector[e[0]].count
 				this.commonWarehouseNo=this.selector[e[0]].commonWarehouseNo
 				uni.setStorageSync('purchasePriceList',this.selector[e[0]].purchasePriceList)
@@ -410,7 +430,8 @@
 </script>
 <style scoped lang='scss' >
 	page{
-		background:#F5F6FA;
+		background:#F5F6FA;		
+		margin-bottom:160rpx;
 	}
 	
 	.container {

+ 2 - 0
pages/grain_pulse/home.vue

@@ -139,6 +139,7 @@
 		    this.getList()
 			this.isLoadMore = false
 			this.loadStatus = 'loading'
+			this.currentPage = 1
 		     setTimeout(function () {
 		         uni.stopPullDownRefresh();  //关闭下拉刷新
 		     }, 1000);
@@ -186,6 +187,7 @@
 					},
 					fail:function(req){
 						console.log(req)
+						that.getList()
 					}
 				});
 			}

+ 1 - 1
pages/grain_pulse/record.vue

@@ -165,7 +165,7 @@
 		},
 		methods: {
 			navBack() {
-				uni.navigateBack(1)
+				uni.navigateBack()
 			},
 			releaseclick() {
 				this.$api.doRequest('get', '/settledCompanyInfo/companyList', {loginPhone:this.userInfo.phone})

+ 1 - 1
pages/public/login.vue

@@ -122,7 +122,7 @@
 				})
 			},
 			gocode(){
-				if(this.phone.length==11){
+				if(this.phone.length==11 && /^0?1[3|4|5|6|7|8][0-9]\d{8}$/.test(this.phone)){
 					uni.navigateTo({
 						url:'/pages/public/code?phone='+this.phone
 					})

+ 1 - 1
pages/user/user.vue

@@ -33,7 +33,7 @@
 					<view class="cu-item" style='text-align:center;' v-for="(item,index) in gridList1" :key="index"
 						@click="gridClick(item, index)" v-if="index<gridCol*2">
 						<view :class="['cuIcon-' + item.cuIcon,'text-' + item.color]">
-							<text v-if='item.num==1&&taskTip' class='badge_user'>{{taskTip}}</text>
+							<text v-if='item.num==4&&taskTip' class='badge_user'>{{taskTip}}</text>
 							<image :src="item.src" class="sign1"></image>
 						</view>
 						<text>{{item.name}}</text>

+ 7 - 4
util/util.js

@@ -313,12 +313,15 @@ const utils = {
 				Math.sin(b / 2), 2)));
 		s = s * 6378.137;
 		s = Math.round(s * 10000) / 10000;
-		if(s > 1){
-			s = s.toFixed(2) + 'km' //保留两位小数
+		if(s >= 1 && s < 20){
+			s = s.toFixed(1) + 'km' 
 		}
-		else{
+		else if(s < 1){
 			s = s*1000
-			s = s.toFixed(0) + 'm' //保留两位小数
+			s = s.toFixed(0) + 'm' 
+		}
+		else{
+			s = s.toFixed(0) + 'km'
 		}
 		return s
 	},