浏览代码

前端gjy

gjy 3 年之前
父节点
当前提交
ea5df8414a

+ 1 - 1
components/uview-ui/libs/util/province.js

@@ -1 +1 @@
-var provinceData=[{"label":"北京市","value":"11"},{"label":"天津市","value":"12"},{"label":"河北省","value":"13"},{"label":"山西省","value":"14"},{"label":"内蒙古自治区","value":"15"},{"label":"辽宁省","value":"21"},{"label":"吉林省","value":"22"},{"label":"黑龙江省","value":"23"},{"label":"上海市","value":"31"},{"label":"江苏省","value":"32"},{"label":"浙江省","value":"33"},{"label":"安徽省","value":"34"},{"label":"福建省","value":"35"},{"label":"江西省","value":"36"},{"label":"山东省","value":"37"},{"label":"河南省","value":"41"},{"label":"湖北省","value":"42"},{"label":"湖南省","value":"43"},{"label":"广东省","value":"44"},{"label":"广西壮族自治区","value":"45"},{"label":"海南省","value":"46"},{"label":"重庆市","value":"50"},{"label":"四川省","value":"51"},{"label":"贵州省","value":"52"},{"label":"云南省","value":"53"},{"label":"西藏自治区","value":"54"},{"label":"陕西省","value":"61"},{"label":"甘肃省","value":"62"},{"label":"青海省","value":"63"},{"label":"宁夏回族自治区","value":"64"},{"label":"新疆维吾尔自治区","value":"65"},{"label":"台湾","value":"66"},{"label":"香港","value":"67"},{"label":"澳门","value":"68"}];export default provinceData;
+var provinceData=[{"label":"全国","value":"10"},{"label":"北京市","value":"11"},{"label":"天津市","value":"12"},{"label":"河北省","value":"13"},{"label":"山西省","value":"14"},{"label":"内蒙古自治区","value":"15"},{"label":"辽宁省","value":"21"},{"label":"吉林省","value":"22"},{"label":"黑龙江省","value":"23"},{"label":"上海市","value":"31"},{"label":"江苏省","value":"32"},{"label":"浙江省","value":"33"},{"label":"安徽省","value":"34"},{"label":"福建省","value":"35"},{"label":"江西省","value":"36"},{"label":"山东省","value":"37"},{"label":"河南省","value":"41"},{"label":"湖北省","value":"42"},{"label":"湖南省","value":"43"},{"label":"广东省","value":"44"},{"label":"广西壮族自治区","value":"45"},{"label":"海南省","value":"46"},{"label":"重庆市","value":"50"},{"label":"四川省","value":"51"},{"label":"贵州省","value":"52"},{"label":"云南省","value":"53"},{"label":"西藏自治区","value":"54"},{"label":"陕西省","value":"61"},{"label":"甘肃省","value":"62"},{"label":"青海省","value":"63"},{"label":"宁夏回族自治区","value":"64"},{"label":"新疆维吾尔自治区","value":"65"},{"label":"台湾","value":"66"},{"label":"香港","value":"67"},{"label":"澳门","value":"68"}];export default provinceData;

+ 1 - 0
pageA/product/business_buy.vue

@@ -175,6 +175,7 @@
 			onLoad(options) {
 				console.log(options)
 				this.id=options.id
+				this.purchaseOrder.planId=options.id
 				this.purchaseOrder.seller = options.seller
 				this.purchaseOrder.goodsName = options.goodsName
 				this.purchaseOrder.receivePrivate = options.receivePrivate

+ 11 - 0
pageB/contract/contract_detail.vue

@@ -138,6 +138,9 @@
 						if(month+1<10){
 							month="0"+(month+1)
 						}
+						if(date1+1<10){
+							date1="0"+date1
+						}
 						return year+'-'+month+"-"+date1
 					},
 					startDate() {
@@ -208,6 +211,14 @@
 						this.$api.msg('司机手机号输入错误')
 						return
 					}
+					if(this.goods.grossWeight==''){
+						this.$api.msg('毛重不能为空')
+						return
+					}
+					if(this.goods.tare==''){
+						this.$api.msg('皮重不能为空')
+						return
+					}
 					if(this.goods.grossWeight>100){
 						this.$api.msg('毛重输入错误')
 						return

+ 202 - 0
pageD/myRelease/Identity_switching.vue

@@ -0,0 +1,202 @@
+<template>
+	<view class="center">
+		<view v-for="(item , index) in lists" :Key="index">
+			<view>
+				<view class="company">{{item.customerType}}</view>
+				<view class="guess-item" @click="navToDetailPage(item)">
+					<view class="infos">
+
+						<view class="info">{{item.customerName}}
+							<view class='cu-tag radius line-pink but'>{{item.authenticationStatus}}</view>
+						</view>
+						<view class="info">{{item.customerPhone}}</view>
+						<label>
+							<checkbox style='transform: scale(0.8);' :value='item.id' :checked="item.checked" @click.stop="checkBox($event,item)" ></checkbox>
+							<text>设置默认</text>
+						</label>
+						
+					</view>
+
+				</view>
+			</view>
+		</view>
+	</view>
+
+	</view>
+	</view>
+</template>
+
+<script>
+	import {
+		mapState
+	} from 'vuex';
+	export default {
+		name: "buy",
+		data() {
+			return {
+				lists:[],
+				PageCur: "buy",
+				buyInfo: [],
+				pages: 1, //页数
+				limit: 10, //每次取条目数
+				loadStatus: 'loading', //加载样式:more-加载前样式,loading-加载中样式,nomore-没有数据样式
+				isLoadMore: false, //是否加载中
+				showTran: true,
+				scrollTop: 0,
+				TabCur: 0,
+				current: 1,
+				checked:false,
+				goodsName:'',
+				receivePrivate:'',
+				receiveCity:'',
+				receiveArea:'',
+				minimumVolume:'',
+				basis:'',
+				buyer:'',
+				unitPrice:'',
+				receiveWarehouse:'',
+				procurementPlanType:'',
+				procurementPlan:'',
+				identityAuthenticationInfo: {
+					pageSize: 10,
+					currentPage: 1,
+					commonId: "",
+					
+					
+				},
+			};
+		},
+		onShow(){
+			this.getList()
+		},
+		onLoad(options) {
+			this.goodsName = options.goodsName
+			this.receivePrivate = options.receivePrivate
+			this.receiveCity = options.receiveCity
+			this.receiveArea = options.receiveArea
+			this.minimumVolume = options.minimumVolume
+			this.buyer = options.buyer
+			this.basis = options.basisPrice
+			this.unitPrice = options.unitPrice
+			this.receiveWarehouse = options.receiveWarehouse
+			this.procurementPlanType = options.procurementPlanType
+			this.procurementPlan=options.procurementPlanNo
+		},
+		computed: {
+			...mapState(['hasLogin', 'userInfo'])
+		},
+		methods: {
+			getList() {
+				this.identityAuthenticationInfo.commonId = this.userInfo.id
+				this.$api.doRequest('get', '/identityAuthenticationInfo/selectIdentityAuthenticationInfo', {
+						pageSize: 10,
+						currentPage: 1,
+						commonId: this.userInfo.id
+					}, 'application/json;charset=UTF-8').then(res => {
+						if(res.data.code==200){
+							for(var i=0;i<res.data.data.records.length;i++){
+								if(res.data.data.records[i].defaultFlag!=1){
+									res.data.data.records[i].checked=false
+								}else{
+									res.data.data.records[i].checked=true
+								}
+							}
+							this.lists = res.data.data.records
+						}
+					})
+					.catch(res => {
+						uni.showToast({
+							title: res.errmsg,
+							icon: 'none',
+							duration: 2000
+						})
+					});
+			},
+			checkBox(e,item){
+				for(var i=0;i<this.lists.length;i++){
+					this.lists[i].checked=true
+				}
+				item.checked=true
+				this.$api.doRequest('post', '/identityAuthenticationInfo/api/setDefault', {
+						id:item.id,
+						commonId: this.userInfo.id
+					}).then(res => {
+						if(res.data.code==200){
+							// this.lists = res.data.data.records
+						}
+					})
+					.catch(res => {
+						uni.showToast({
+							title: res.errmsg,
+							icon: 'none',
+							duration: 2000
+						})
+					});
+			},
+			// adddriver(index) {
+			// 	if (index == 1) {
+			// 		uni.navigateTo({
+			// 			url: `/pageD/identity/companyIdentity`
+			// 		})
+			// 	} else {
+			// 		uni.navigateTo({
+			// 			url: `/pageD/identity/driverIdentity`
+			// 		})
+			// 	}
+			// },
+			navToDetailPage(item) {
+				// if (index == 1) {
+					if(item.customerTypeFlag==1){
+						uni.navigateTo({
+						url: `/pageD/myRelease/buyGrain?id=${item.id}&customerName=${item.customerName}`
+					})
+					}else{
+						uni.navigateTo({
+							url: `/pageD/myRelease/buyGrain?id=${item.id}&customerName=${item.compName}`
+						})
+					}
+					
+					},
+				// } else {
+				// 	uni.navigateTo({
+				// 		url: `/pageD/identity/driverIdentityLook`
+				// 	})
+				
+
+			// }
+		}
+	}
+</script>
+
+<style>
+	.center {
+		padding: 10px 20px;
+	}
+
+	.title {
+		font-size: 18px;
+		font-weight: 900;
+		margin-right: 20px;
+		display: initial;
+	}
+
+	.company {
+		font-size: 16px;
+		margin-top: 10px;
+	}
+
+	.infos {
+		/* margin: 10px 20px; */
+		width: 100%;
+		display: inline-table;
+	}
+
+	.info {
+		line-height: 20px;
+	}
+
+	.but {
+		right: 3px;
+		float: right;
+	}
+</style>

+ 1 - 1
pageD/myRelease/buyDetails.vue

@@ -72,7 +72,7 @@
 			</picker>
 		</view>
 		<view class="c-row b-b">
-			<text class="tit">方手机号</text>
+			<text class="tit">方手机号</text>
 			<picker @change="typeChange" :value="typesIndex" :range="typesType" class="con-list">
 				<view class="con-list">
 					<input placeholder="请填写卖方手机号" name="input" @input="addressInput"></input>

+ 196 - 57
pageD/myRelease/buyGrain.vue

@@ -3,31 +3,31 @@
 		<view class="c-row b-b">
 			<text class="tit">名头</text>
 			<view class="con-list">
-				<input placeholder="请填写名头" name="input" v-model="deptList.procurementPlanNo"></input>
+				<text @click="navToDetailPage">{{deptList.procurementPlanNo}}</text>
 			</view>
 		</view>
 		<view class="c-row b-b">
 			<text class="tit">标题</text>
 			<view class="con-list">
-				<input placeholder="请填写标题,2-16个字" name="input" v-model="deptList.title"></input>
+				<input maxlength='16' minlength='2' placeholder="请输入标题,不超过16个字" name="input" v-model="deptList.title"></input>
 			</view>
 		</view>
 		<view class="c-row b-b">
 			<text class="tit">货名</text>
 			<view class="con-list">
-				<input placeholder="请填写货名" name="input" v-model="deptList.goodsName"></input>
+				<input placeholder="请输入货名,如玉米" name="input" v-model="deptList.goodsName"></input>
 			</view>
 		</view>
 		<view class="c-row b-b">
 			<text class="tit">采购量(吨)</text>
 			<view class="con-list">
-				<input placeholder="请填写采购重量" name="input" v-model="deptList.plannedPurchaseVolume"></input>
+				<input placeholder="请输入采购重量,如1000" name="input" v-model="deptList.plannedPurchaseVolume"></input>
 			</view>
 		</view>
 		<view class="c-row b-b">
 			<text class="tit">最小成交量(吨)</text>
 			<view class="con-list">
-				<input placeholder="请填写最小成交量" name="input" v-model="deptList.minimumVolume"></input>
+				<input placeholder="请输入最小成交量" name="input" v-model="deptList.minimumVolume"></input>
 			</view>
 		</view>
 		<view class="c-row b-b">
@@ -49,25 +49,26 @@
 		<view class="c-row b-b" v-if="this.typesIndex != 1">
 			<text class="tit">单价(元/吨)</text>
 			<view class="con-list">
-				<input placeholder="请填写单价(元/吨)" name="input" v-model="deptList.unitPrice"></input>
+				<input placeholder="请填写单价" name="input" v-model="deptList.unitPrice"></input>
 			</view>
 		</view>
 		<view class="c-row b-b" v-if="this.typesIndex == 1">
 			<text class="tit">基差(元/吨)</text>
 			<view class="con-list">
-				<input placeholder="请填写单价(元/吨)" name="input" v-model="deptList.basisPrice"></input>
+				<input placeholder="请输入基差" name="input" v-model="deptList.basisPrice"></input>
 			</view>
 		</view>
 		<view class="c-row b-b">
 			<text class="tit">收货地区</text>
 			<view class="con-list">
-				<input placeholder="请填写收货地区" name="input" v-model="deptList.receiveArea"></input>
+				<view @click='regionchange'>{{region}}</view>
+				<u-picker :params='params' @confirm='regionpicker' mode="region" v-model="show" ></u-picker>
 			</view>
 		</view>
 		<view class="c-row b-b">
 			<text class="tit">买方手机号</text>
 			<view class="con-list">
-				<input placeholder="请填写卖方手机号" name="input" v-model="deptList.buyerPhone"></input>
+				<input placeholder="请输入买方手机号" name="input" v-model="deptList.buyerPhone"></input>
 			</view>
 		</view>
 		<view class="c-row b-b">
@@ -77,48 +78,51 @@
 			</view>
 		</view>
 		<view class="c-row b-b">
+			<checkbox style='transform: scale(0.8);'  :checked="checked" @click='checkedbox'></checkbox>完善更多信息(选填,可由客服人员代为完善)
+		</view>
+		<view v-if='!checked' class="c-row b-b">
 			<text class="tit">水分(%)<= </text>
 					<view class="con-list">
 						<input placeholder="请填写水分占比" name="input" v-model="deptList.waterContent"></input>
 					</view>
 		</view>
-		<view class="c-row b-b">
+		<view  v-if='!checked'  class="c-row b-b">
 			<text class="tit">容重(g/L)<= </text>
 					<view class="con-list">
 						<input placeholder="请填写容重" name="input" v-model="deptList.bulkDensity"></input>
 					</view>
 		</view>
-		<view class="c-row b-b">
+		<view  v-if='!checked'  class="c-row b-b">
 			<text class="tit">热损伤(%)<= </text>
 					<view class="con-list">
 						<input placeholder="请填写热损伤占比" name="input" v-model="deptList.jiaorenli"></input>
 					</view>
 		</view>
-		<view class="c-row b-b">
+		<view  v-if='!checked'  class="c-row b-b">
 			<text class="tit">杂质(%)<= </text>
 					<view class="con-list">
 						<input placeholder="请填写杂质占比" name="input" v-model="deptList.impurity"></input>
 					</view>
 		</view>
-		<view class="c-row b-b">
+		<view  v-if='!checked'  class="c-row b-b">
 			<text class="tit">霉变粒(%)<= </text>
 					<view class="con-list">
 						<input placeholder="请填写霉变粒占比" name="input" v-model="deptList.mildewGrain"></input>
 					</view>
 		</view>
-		<view class="c-row b-b">
+		<view  v-if='!checked'  class="c-row b-b">
 			<text class="tit">不完整粒(%)<= </text>
 					<view class="con-list">
 						<input placeholder="请填写不完整粒占比" name="input" v-model="deptList.imperfectGrain"></input>
 					</view>
 		</view>
-		<view class="c-row b-b">
+		<view  v-if='!checked'  class="c-row b-b">
 			<text class="tit">蛋白(%)<= </text>
 					<view class="con-list">
 						<input placeholder="请填写蛋白占比" name="input" v-model="deptList.protein"></input>
 					</view>
 		</view>
-		<view class="c-row b-b">
+		<view  v-if='!checked'  class="c-row b-b">
 			<text class="tit">粒型 </text>
 			<picker @change="liChange" :value="liIndex" :range="liType" class="con-list" v-model="deptList.grain">
 				<view class="con-list">
@@ -126,7 +130,7 @@
 				</view>
 			</picker>
 		</view>
-		<view class="c-row b-b">
+		<view  v-if='!checked'  class="c-row b-b">
 			<text class="tit">品级 </text>
 			<picker @change="pinChange" :value="pinIndex" :range="pinType" class="con-list">
 				<view class="con-list">
@@ -134,7 +138,14 @@
 				</view>
 			</picker>
 		</view>
-		<view class="c-row b-b">
+		<view  v-if='!checked'  class="c-row b-b">
+			<text class="tit">产地</text>
+			<view class="con-list">
+				<view @click='regionchange1'>{{region1}}</view>
+				<u-picker :params='params1' @confirm='regionpicker1' mode="region" v-model="show1" ></u-picker>
+			</view>
+		</view>
+		<view  v-if='!checked'  class="c-row b-b">
 			<text class="tit">产出年份</text>
 			<picker @change="nianChange" :value="nianIndex" :range="nianType" class="con-list">
 				<view class="con-list">
@@ -142,7 +153,7 @@
 				</view>
 			</picker>
 		</view>
-		<view class="c-row b-b">
+		<view  v-if='!checked'  class="c-row b-b">
 			<text class="tit">包装方式</text>
 			<picker @change="baoChange" :value="baoIndex" :range="baoType" class="con-list">
 				<view class="con-list">
@@ -150,13 +161,13 @@
 				</view>
 			</picker>
 		</view>
-		<view class="c-row b-b">
+		<view  v-if='!checked&&baoIndex==2||!checked&&baoIndex==3'  class="c-row b-b">
 			<text class="tit">袋装备注</text>
 				<view class="con-list">
 					<input placeholder="请填写袋装备注" name="input" v-model="deptList.baggingNotes"></input>
 				</view>
 		</view>
-		<view class="c-row b-b">
+		<view  v-if='!checked'  class="c-row b-b">
 			<text class="tit">运费承担方</text>
 			<picker @change="chengChange" :value="chengIndex" :range="chengType" class="con-list">
 				<view class="con-list">
@@ -177,6 +188,7 @@
 		data() {
 			return {
 				types: '',
+				goods:{},
 				typesType: ["现货", "期货"],
 				typesIndex: 0,
 				deptList: {
@@ -188,6 +200,16 @@
 					packingType:"不限(默认)",
 					freightPayer:"",
 				},
+				params:{
+					province: true,
+					city: true,
+					area: true,
+				},
+				params1:{
+					province: true,
+					city: true,
+				},
+				checked:true,
 				insertProcurementPlanInfo: {},
 				liIndex: 0,
 				liType: ['塔粮', '筛粮', '中粒', '大粒'],
@@ -197,6 +219,10 @@
 				nianType: ['2023', '2022', '2021', '2020', '2019', '2018', '2017', '2016', '2015', '2014', '2013', '2012',
 					'2011'
 				],
+				show:false,
+				show1:false,
+				region:'请选择收货地区',
+				region1:'请选择产地',
 				baoIndex: 0,
 				baoType: ['不限(默认)', '散装', '大袋', '小袋'],
 				chengIndex: -1,
@@ -206,7 +232,46 @@
 		computed: {
 			...mapState(['hasLogin','userInfo'])
 		},
+		onLoad(options){
+			if(options.customerName){
+				this.deptList.procurementPlanNo=options.customerName
+			}
+		},
+		onShow(){
+			var that=this
+			this.$api.doRequest('get', '/identityAuthenticationInfo/getInfo',{commonId:this.userInfo.id}).then(res => {
+				if(res.data.code==200){
+					if(res.data.data.customerTypeFlag==1){
+						that.$set(this.deptList,'procurementPlanNo',res.data.data.customerName)
+					}else{
+						that.$set(this.deptList,'procurementPlanNo',res.data.data.compName)
+					}
+					this.goods=res.data.data
+				}
+				uni.hideLoading()
+			})
+		},
 		methods: {
+			regionpicker(e){
+				this.deptList.receivePrivate=e.province.label
+				this.deptList.receiveCity=e.city.label
+				this.deptList.receiveArea=e.area.label
+				this.region=e.province.label+'-'+e.city.label+'-'+e.area.label
+			},
+			regionchange(){
+				this.show=true
+			},
+			regionpicker1(e){
+				this.deptList.outputPrivate=e.province.label
+				this.deptList.outputCity=e.city.label
+				this.region1=e.province.label+'-'+e.city.label
+			},
+			regionchange1(){
+				this.show1=true
+			},
+			checkedbox(e){
+				this.checked=!this.checked
+			},
 			typeChange(e) {
 				this.typesIndex = e.detail.value
 				this.types = this.typesType[this.typesIndex];
@@ -218,28 +283,62 @@
 				}
 
 			},
+			navToDetailPage() {
+				// if (index == 1) {
+					uni.navigateTo({
+						url: `/pageD/myRelease/Identity_switching`
+					})
+					},
 			commit() {
 				this.insertProcurementPlanInfo = this.deptList
 				// if (!this.deptList.goodsName) {
 				// 	this.$api.msg('货名1不能为空')
 				// 	return
 				// }
-			// 	if (!this.deptList.title) {
-			// 		this.$api.msg('标题不能为空')
-			// 		return
-			// 	}
+				if (!this.deptList.title) {
+					this.$api.msg('标题不能为空')
+					return
+				}
+				if (this.deptList.title.length>16||this.deptList.title.length<2) {
+					this.$api.msg('标题输入错误')
+					return
+				}
 				if (!this.deptList.goodsName) {
 					this.$api.msg('货名不能为空')
 					return
 				}
+				if (this.deptList.goodsName.length>6||this.deptList.goodsName.length<1) {
+					this.$api.msg('货名输入错误')
+					return
+				}
 				if (!this.insertProcurementPlanInfo.plannedPurchaseVolume) {
 					this.$api.msg('采购量不能为空')
 					return
 				}
+				if (this.deptList.plannedPurchaseVolume>100000||this.deptList.plannedPurchaseVolume<1) {
+					this.$api.msg('采购量输入错误')
+					return
+				}
+				if (this.deptList.plannedPurchaseVolume.indexOf('.')!=-1) {
+					if(this.deptList.plannedPurchaseVolume.split('.')[1].length>2){
+						this.$api.msg('采购量输入错误')
+						return
+					}
+				}
 				if (!this.insertProcurementPlanInfo.minimumVolume) {
 					this.$api.msg('最小成交量不能为空')
 					return
 				}
+				if (this.insertProcurementPlanInfo.minimumVolume>100000||this.insertProcurementPlanInfo.minimumVolume<1) {
+					this.$api.msg('最小成交量输入错误')
+					return
+				}
+				if (this.insertProcurementPlanInfo.minimumVolume.indexOf('.')!=-1) {
+					if(this.insertProcurementPlanInfo.minimumVolume.split('.')[1].length>2){
+						this.$api.msg('最小成交量输入错误')
+						return
+					}
+				}
 				if (!this.insertProcurementPlanInfo.procurementPlanType) {
 					this.$api.msg('类型不能为空')
 					return
@@ -253,69 +352,109 @@
 						this.$api.msg('单价不能为空')
 						return
 					}
+					if (this.insertProcurementPlanInfo.unitPrice>100000||this.insertProcurementPlanInfo.unitPrice<1) {
+						this.$api.msg('单价输入错误')
+						return
+					}
+					if (this.insertProcurementPlanInfo.unitPrice.indexOf('.')!=-1) {
+						if(this.insertProcurementPlanInfo.unitPrice.split('.')[1].length>2){
+							this.$api.msg('单价输入错误')
+							return
+						}
+					}
 				}else if(this.insertProcurementPlanInfo.procurementPlanType == '期货'){
 					if (!this.insertProcurementPlanInfo.basisPrice) {
 						this.$api.msg('基差(元/吨)不能为空')
 						return
 					}
+					if (this.insertProcurementPlanInfo.basisPrice>10000||this.insertProcurementPlanInfo.basisPrice<1) {
+						this.$api.msg('基差输入错误')
+						return
+					}
+					if (this.insertProcurementPlanInfo.basisPrice.indexOf('.')!=-1) {
+						if(this.insertProcurementPlanInfo.basisPrice.split('.')[1].length>2){
+							this.$api.msg('基差输入错误')
+							return
+						}
+					}
 				}
 			
 				if (!this.insertProcurementPlanInfo.buyerPhone) {
 					this.$api.msg('买方手机号不能为空')
 					return
 				}
-				if (!this.insertProcurementPlanInfo.waterContent) {
-					this.$api.msg('水分不能为空')
+				if (this.insertProcurementPlanInfo.waterContent&&this.insertProcurementPlanInfo.waterContent<1||
+				this.insertProcurementPlanInfo.waterContent&&this.insertProcurementPlanInfo.waterContent>40) {
+					this.$api.msg('水分输入错误')
 					return
 				}
-				if (!this.insertProcurementPlanInfo.bulkDensity) {
-					this.$api.msg('容重不能为空')
-					return
+				if (this.insertProcurementPlanInfo.waterContent&&this.insertProcurementPlanInfo.waterContent.indexOf('.')!=-1) {
+					if(this.insertProcurementPlanInfo.waterContent.split('.')[1].length>2){
+						this.$api.msg('水分输入错误')
+						return
+					}
 				}
-				if (!this.insertProcurementPlanInfo.jiaorenli) {
-					this.$api.msg('热损伤不能为空')
+				if (this.insertProcurementPlanInfo.bulkDensity&&this.insertProcurementPlanInfo.bulkDensity<500||
+				this.insertProcurementPlanInfo.bulkDensity&&this.insertProcurementPlanInfo.bulkDensity>1000) {
+					this.$api.msg('容重输入错误')
 					return
 				}
-				if (!this.insertProcurementPlanInfo.impurity) {
-					this.$api.msg('杂质不能为空')
+				if (this.insertProcurementPlanInfo.jiaorenli&&this.insertProcurementPlanInfo.jiaorenli<1||
+				this.insertProcurementPlanInfo.jiaorenli&&this.insertProcurementPlanInfo.jiaorenli>40) {
+					this.$api.msg('热损伤输入错误')
 					return
 				}
-				if (!this.insertProcurementPlanInfo.mildewGrain) {
-					this.$api.msg('霉变粒不能为空')
-					return
+				if (this.insertProcurementPlanInfo.jiaorenli&&this.insertProcurementPlanInfo.jiaorenli.indexOf('.')!=-1) {
+					if(this.insertProcurementPlanInfo.jiaorenli.split('.')[1].length>2){
+						this.$api.msg('热损伤输入错误')
+						return
+					}
 				}
-				if (!this.insertProcurementPlanInfo.imperfectGrain) {
-					this.$api.msg('不完整粒不能为空')
+				if (this.insertProcurementPlanInfo.impurity&&this.insertProcurementPlanInfo.impurity<1||
+				this.insertProcurementPlanInfo.impurity&&this.insertProcurementPlanInfo.impurity>40) {
+					this.$api.msg('杂质输入错误')
 					return
 				}
-				if (!this.insertProcurementPlanInfo.bulkDensity) {
-					this.$api.msg('蛋白不能为空')
-					return
+				if (this.insertProcurementPlanInfo.impurity&&this.insertProcurementPlanInfo.impurity.indexOf('.')!=-1) {
+					if(this.insertProcurementPlanInfo.impurity.split('.')[1].length>2){
+						this.$api.msg('杂质输入错误')
+						return
+					}
 				}
-				if (!this.insertProcurementPlanInfo.grain) {
-					this.$api.msg('粒型不能为空')
+				if (this.insertProcurementPlanInfo.mildewGrain&&this.insertProcurementPlanInfo.mildewGrain<1||
+				this.insertProcurementPlanInfo.mildewGrain&&this.insertProcurementPlanInfo.mildewGrain>40) {
+					this.$api.msg('霉变粒输入错误')
 					return
 				}
-				if (!this.insertProcurementPlanInfo.grade) {
-					this.$api.msg('品级不能为空')
-					return
+				if (this.insertProcurementPlanInfo.mildewGrain&&this.insertProcurementPlanInfo.mildewGrain.indexOf('.')!=-1) {
+					if(this.insertProcurementPlanInfo.mildewGrain.split('.')[1].length>2){
+						this.$api.msg('霉变粒输入错误')
+						return
+					}
 				}
-				if (!this.insertProcurementPlanInfo.outputYear) {
-					this.$api.msg('产出年份不能为空')
+				if (this.insertProcurementPlanInfo.imperfectGrain&&this.insertProcurementPlanInfo.imperfectGrain<1||
+				this.insertProcurementPlanInfo.imperfectGrain&&this.insertProcurementPlanInfo.imperfectGrain>40) {
+					this.$api.msg('不完整粒输入错误')
 					return
 				}
-				if (!this.insertProcurementPlanInfo.packingType) {
-					this.$api.msg('包装方式不能为空')
-					return
+				if (this.insertProcurementPlanInfo.imperfectGrain&&this.insertProcurementPlanInfo.imperfectGrain.indexOf('.')!=-1) {
+					if(this.insertProcurementPlanInfo.imperfectGrain.split('.')[1].length>2){
+						this.$api.msg('不完整粒输入错误')
+						return
+					}
 				}
-				if (!this.insertProcurementPlanInfo.baggingNotes) {
-					this.$api.msg('装袋备注不能为空')
+				if (this.insertProcurementPlanInfo.bulkDensity&&this.insertProcurementPlanInfo.bulkDensity<1||
+				this.insertProcurementPlanInfo.bulkDensity&&this.insertProcurementPlanInfo.bulkDensity>80) {
+					this.$api.msg('蛋白输入错误')
 					return
 				}
-				if (!this.insertProcurementPlanInfo.freightPayer) {
-					this.$api.msg('运费承担方不能为空')
-					return
+				if (this.insertProcurementPlanInfo.bulkDensity&&this.insertProcurementPlanInfo.bulkDensity.indexOf('.')!=-1) {
+					if(this.insertProcurementPlanInfo.bulkDensity.split('.')[1].length>2){
+						this.$api.msg('蛋白输入错误')
+						return
+					}
 				}
+				this.insertProcurementPlanInfo.basisPrice=-this.insertProcurementPlanInfo.basisPrice
 		         this.insertProcurementPlanInfo.commonId = this.userInfo.id
 				 this.insertProcurementPlanInfo.compId = "2710b21efc1e4393930c5dc800010dc4"
 				this.$api.doRequest('post', '/procurementPlanInfo/api/insertProcurementPlanInfo', this

+ 17 - 13
pageD/warehousings/warehousingDetails.vue

@@ -105,55 +105,55 @@
 				<view class="c-row b-b">
 					<text class="tit">质检员</text>
 					<view class="con-list">
-						<text>{{WarehouseInOutDetail.qualityInspector}}</text>
+						<text>{{warehouseInOutInfo.warehouseInOutDetail.qualityInspector}}</text>
 					</view>
 				</view>
 				<view class="c-row b-b">
 					<text class="tit">蛋白(%){{'>='}}</text>
 					<view class="con-list">
-						<text>{{WarehouseInOutDetail.protein}}</text>
+						<text>{{warehouseInOutInfo.warehouseInOutDetail.protein}}</text>
 					</view>
 				</view>
 				<view class="c-row b-b">
 					<text class="tit">水分(%){{'<='}}</text>
 					<view class="con-list">
-						<text>{{WarehouseInOutDetail.waterContent}}</text>
+						<text>{{warehouseInOutInfo.warehouseInOutDetail.waterContent}}</text>
 					</view>
 				</view>
 				<view class="c-row b-b">
 					<text class="tit">容重(g/L){{'<='}}</text>
 					<view class="con-list">
-						<text>{{WarehouseInOutDetail.bulkDensity}}</text>
+						<text>{{warehouseInOutInfo.warehouseInOutDetail.bulkDensity}}</text>
 					</view>
 				</view>
 				<view class="c-row b-b">
 					<text class="tit">热损伤(%){{'<='}}</text>
 					<view class="con-list">
-						<text>{{WarehouseInOutDetail.jiaorenli}}</text>
+						<text>{{warehouseInOutInfo.warehouseInOutDetail.jiaorenli}}</text>
 					</view>
 				</view>
 				<view class="c-row b-b">
 					<text class="tit">杂质(%){{'<='}}</text>
 					<view class="con-list">
-						<text>{{WarehouseInOutDetail.impurity}}</text>
+						<text>{{warehouseInOutInfo.warehouseInOutDetail.impurity}}</text>
 					</view>
 				</view>
 				<view class="c-row b-b">
 					<text class="tit">霉变粒(%){{'<='}}</text>
 					<view class="con-list">
-						<text>{{WarehouseInOutDetail.mildewGrain}}</text>
+						<text>{{warehouseInOutInfo.warehouseInOutDetail.mildewGrain}}</text>
 					</view>
 				</view>
 				<view class="c-row b-b">
 					<text class="tit">不完整粒(%){{'<='}} </text>
 					<view class="con-list">
-						<text>{{WarehouseInOutDetail.imperfectGrain}}</text>
+						<text>{{warehouseInOutInfo.warehouseInOutDetail.imperfectGrain}}</text>
 					</view>
 				</view>
 				<view class="c-row b-b">
 					<text class="tit">品级</text>
 					<view class="con-list">
-						<text>{{WarehouseInOutDetail.grade}}</text>
+						<text>{{warehouseInOutInfo.warehouseInOutDetail.grade}}</text>
 					</view>
 				</view>
 			</view>
@@ -166,8 +166,11 @@
 
 		data() {
 			return {
-				warehouseInOutInfo: {},
-				WarehouseInOutDetail: {},
+				warehouseInOutInfo: {
+					warehouseInOutDetail:{
+						qualityInspector:''
+					}
+				}
 			}
 		},
 		onLoad(options){
@@ -181,10 +184,10 @@
 				this.types = this.typesType[this.typesIndex];
 			},
 			getList(id1){
+				var that=this
 				this.$api.doRequest('get','/warehouseInOutInfo/getInfo',{id:id1}).then(res => {
 					console.log(res)
-					this.warehouseInOutInfo = res.data.data
-					this.WarehouseInOutDetail = this.warehouseInOutInfo.warehouseInOutDetail
+					that.warehouseInOutInfo = res.data.data
 					
 				})
 				.catch(res => {
@@ -194,6 +197,7 @@
 						duration: 2000
 					})
 				});
+				console.log(this.warehouseInOutInfo)
 			}
 		}
 		}

+ 355 - 55
pageD/warehousings/warehousings.vue

@@ -79,16 +79,20 @@
 				</view>
 				<view class="cu-form-group align-start">
 					<view class="title">扣款项</view>
-					<input placeholder="请输入扣款项" name="input" v-model="WarehouseInOutInfo.deductionItems"></input>
+					<input maxlength='16' placeholder="请输入扣款项" name="input" v-model="WarehouseInOutInfo.deductionItems"></input>
 				</view>
 				<view class="c-row b-b">
 					<text class="tit">入库日期</text>
 					<view class="con-list">
-						<text>{{WarehouseInOutInfo.inOutDate}}</text>
+						<view @click="show = true">{{WarehouseInOutInfo.inOutDate!=''?WarehouseInOutInfo.inOutDate:time}}</view>
+						<u-picker  :params='params' :default-time='time' @confirm="DateChange" v-model="show" mode="time"></u-picker>
+						<!-- <text>{{WarehouseInOutInfo.inOutDate}}</text> -->
 					</view>
 				</view>
 				<view class="padding flex flex-direction">
-					<button class="cu-btn bg-red margin-tb-sm lg">上传磅单照片</button>
+					<button @tap="ChooseImage2" class="cu-btn bg-red margin-tb-sm lg">上传磅单照片</button>
+				<image v-if='WarehouseInOutInfo.addressUrl' :src='WarehouseInOutInfo.addressUrl'></image>
+				
 				</view>
 			</view>
 
@@ -98,7 +102,7 @@
 			<view class="c-list">
 				<view class="cu-form-group align-start">
 					<view class="title">质检员</view>
-					<input placeholder="请输入质检员姓名" name="input" v-model="list.qualityInspector"></input>
+					<input maxlength='10' minlength='2' placeholder="请输入质检员姓名" name="input" v-model="list.qualityInspector"></input>
 				</view>
 				<view class="cu-form-group align-start">
 					<view class="title">蛋白(%)>=</view>
@@ -106,54 +110,47 @@
 				</view>
 				<view class="cu-form-group align-start">
 					<view class="title">水分(%)<= </view>
-							<input placeholder="请输入水分占比" name="input" v-model="list.waterContent"></input>
-					</view>
-					<view class="cu-form-group align-start">
-						<view class="title">容重(克/升)>= </view>
-						<input placeholder="请输入容重" name="input" v-model="list.bulkDensity"></input>
-					</view>
-					<view class="cu-form-group align-start">
-						<view class="title">热损伤(%)<= </view>
-								<input placeholder="请输入热损伤占比" name="input" v-model="list.jiaorenli"></input>
-						</view>
-						<view class="cu-form-group align-start">
-							<view class="title">杂质(%)<= </view>
-									<input placeholder="请输入杂质占比" name="input" v-model="list.impurity"></input>
-							</view>
-							<view class="cu-form-group align-start">
-								<view class="title">霉变粒(%)<= </view>
-										<input placeholder="请输入霉变粒占比" name="input" v-model="list.mildewGrain"></input>
-								</view>
-								<view class="cu-form-group align-start">
-									<view class="title">不完整粒(%)<= </view>
-											<input placeholder="请输入不完整粒占比" name="input"
-												v-model="list.imperfectGrain"></input>
-									</view>
-									<view class="c-row b-b">
-										<text class="tit">品级 </text>
-										<picker @change="pinChange" :value="pinIndex" :range="pinType" class="con-list">
-											<view class="con-list">
-												{{pinIndex>-1?pinType[pinIndex]:'请选择品级'}}
-											</view>
-										</picker>
-									</view>
-								</view>
-
-							</view>
-							<!-- 底部操作菜单 -->
-							<view class="padding flex flex-direction">
-								<button class="cu-btn bg-red margin-tb-sm lg" @click="commit1">暂存</button>
-								<button class="cu-btn bg-red margin-tb-sm lg" @click="commit">提交</button>
+					<input placeholder="请输入水分占比" name="input" v-model="list.waterContent"></input>
+				</view>
+				<view class="cu-form-group align-start">
+					<view class="title">容重(克/升)>= </view>
+					<input placeholder="请输入容重" name="input" v-model="list.bulkDensity"></input>
+				</view>
+				<view class="cu-form-group align-start">
+					<view class="title">热损伤(%)<= </view>
+					<input placeholder="请输入热损伤占比" name="input" v-model="list.jiaorenli"></input>
+				</view>
+				<view class="cu-form-group align-start">
+					<view class="title">杂质(%)<= </view>
+					<input placeholder="请输入杂质占比" name="input" v-model="list.impurity"></input>
+				</view>
+				<view class="cu-form-group align-start">
+					<view class="title">霉变粒(%)<= </view>
+					<input placeholder="请输入霉变粒占比" name="input" v-model="list.mildewGrain"></input>
+				</view>
+				<view class="cu-form-group align-start">
+					<view class="title">不完整粒(%)<= </view>
+					<input placeholder="请输入不完整粒占比" name="input"	v-model="list.imperfectGrain"></input>
+				</view>
+				<view class="c-row b-b">
+					<text class="tit">品级 </text>
+					<picker @change="pinChange" :value="pinIndex" :range="pinType" class="con-list">
+						<view class="con-list">
+							{{pinIndex>-1?pinType[pinIndex]:'请选择品级'}}
 							</view>
-						</view>
+						</picker>
 					</view>
 				</view>
 			</view>
-		</view>
+							<!-- 底部操作菜单 -->
+			<view class="padding flex flex-direction">
+				<button class="cu-btn bg-red margin-tb-sm lg" @click="commit1">暂存</button>
+				<button class="cu-btn bg-red margin-tb-sm lg" @click="commit">提交</button>
+			</view>
 	</view>
-
 </template>
 <script>
+		import uploadImage from '@/components/ossutil/uploadFile.js';
 	export default {
 		data() {
 			return {
@@ -162,6 +159,7 @@
 				goods: {},
 				list: {},
 				WarehouseInOutInfo: {
+					inOutDate:'',
 					warehouseInOutDetail: {},
 					pcFlag: 0,
 					contractNo: {},
@@ -171,14 +169,43 @@
 					contractNo: {},
 					carNo: {},
 				},
-				pinIndex: '不限(默认)',
+				params:{
+					year: true,
+					month: true,
+					day: true,
+				},
+				pinIndex: 0,
+				show:false,
 				pinTypes: '',
 				pinType: ['不限(默认)', '一等品', '二等品', '三等品', '等外'],
-				ruIndex: '采购入库',
+				ruIndex: 0,
 				rutypes: '',
 				ruType: ['采购入库', '移库入库', '暂存入库', '贸易服务入库', '退库'],
 			}
 		},
+		computed: {
+				time() {
+					var date=new Date()
+					var year=date.getFullYear()
+					var month=date.getMonth()
+					var date1=date.getDate()
+					if(month+1<10){
+						month="0"+(month+1)
+					}
+					if(date1+1<10){
+						date1="0"+date1
+					}
+					return year+'-'+month+"-"+date1
+				},
+				startDate() {
+				//限制开始时间;
+				//也可以直接限定为当天日期 var date= new Date(); return date
+					return new Date(new Date(new Date().toLocaleDateString()).getTime()-(1*60*60*1000))
+				},
+				endDate() {
+					return new Date()
+				}
+			},	
 		onLoad(option) {
 			this.WarehouseInOutInfo.contractNo = option.contractNo
 			this.WarehouseInOutInfo.goodsName = option.goodsName
@@ -189,12 +216,151 @@
 			this.WarehouseInOutInfo.carNo = option.carNo
 		},
 		methods: {
+			DateChange(e) {
+				this.WarehouseInOutInfo.inOutDate=e.year+'-'+e.month+'-'+e.day
+			},
+			ChooseImage2() {
+				var that=this
+				uni.chooseImage({
+					count: 1, //默认9
+					sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
+					sourceType: ['album','camera'], //从相册选择
+					success: (res) => {
+						//上传图片
+						//图片路径可自行修改
+						uploadImage(res.tempFilePaths[0], 'addressUrl/',
+							result => {		
+								that.$set(that.WarehouseInOutInfo,'addressUrl',result)
+								uni.hideLoading();
+							}
+						)
+					}
+				});
+				console.log(this.WarehouseInOutInfo)
+			},
 			commit1() {
-				console.log(this.list)
+				if(this.WarehouseInOutInfo.grossWeight>100||this.WarehouseInOutInfo.grossWeight<1){
+					this.$api.msg('毛重输入错误')
+					return
+				}
+				if(this.WarehouseInOutInfo.grossWeight.indexOf('.')!=-1){
+					if(this.WarehouseInOutInfo.grossWeight.split('.')[1].length>2){
+						this.$api.msg('毛重输入错误')
+						return
+					}
+				}
+				if(this.WarehouseInOutInfo.tare>50||this.WarehouseInOutInfo.tare<1){
+					this.$api.msg('皮重输入错误')
+					return
+				}
+				if(this.WarehouseInOutInfo.tare.indexOf('.')!=-1){
+					if(this.WarehouseInOutInfo.tare.split('.')[1].length>2){
+						this.$api.msg('皮重输入错误')
+						return
+					}
+				}
+				if(this.WarehouseInOutInfo.deductionAmount&&this.WarehouseInOutInfo.deductionAmount>10000||this.WarehouseInOutInfo.deductionAmount&&this.WarehouseInOutInfo.deductionAmount<0){
+					this.$api.msg('扣款金额输入错误')
+					return
+				}
+				if(this.WarehouseInOutInfo.deductionAmount&&this.WarehouseInOutInfo.deductionAmount.indexOf('.')!=-1){
+					if(this.WarehouseInOutInfo.deductionAmount.split('.')[1].length>2){
+						this.$api.msg('扣款金额输入错误')
+						return
+					}
+				}
+				if(this.list.qualityInspector&&this.list.qualityInspector<2||this.list.qualityInspector&&this.list.qualityInspector>10){
+					this.$api.msg('质检员姓名输入错误')
+					return
+				}
+				if(this.list.protein&&this.list.protein<1||this.list.protein&&this.list.protein>80){
+					this.$api.msg('蛋白占比输入错误')
+					return
+				}
+				if(this.list.protein&&this.list.protein.indexOf('.')!=-1){
+					if(this.list.protein.split('.')[1].length>2){
+						this.$api.msg('蛋白占比输入错误')
+						return
+					}
+				}
+				if(this.list.waterContent&&this.list.waterContent<1||this.list.waterContent&&this.list.waterContent>40){
+					this.$api.msg('水分输入错误')
+					return
+				}
+				if(this.list.waterContent&&this.list.waterContent.indexOf('.')!=-1){
+					if(this.list.waterContent.split('.')[1].length>2){
+						this.$api.msg('水分输入错误')
+						return
+					}
+				}
+				if(this.list.bulkDensity&&this.list.bulkDensity<1||this.list.bulkDensity&&this.list.bulkDensity>40){
+					this.$api.msg('容重输入错误')
+					return
+				}
+				if(this.list.bulkDensity&&this.list.bulkDensity.indexOf('.')!=-1){
+					if(this.list.bulkDensity.split('.')[1].length>2){
+						this.$api.msg('容重输入错误')
+						return
+					}
+				}
+				if(this.list.jiaorenli&&this.list.jiaorenli<1||this.list.jiaorenli&&this.list.jiaorenli>40){
+					this.$api.msg('热损伤输入错误')
+					return
+				}
+				if(this.list.jiaorenli&&this.list.jiaorenli.indexOf('.')!=-1){
+					if(this.list.jiaorenli.split('.')[1].length>2){
+						this.$api.msg('热损伤输入错误')
+						return
+					}
+				}
+				if(this.list.impurity&&this.list.impurity<1||this.list.impurity&&this.list.impurity>40){
+					this.$api.msg('杂质输入错误')
+					return
+				}
+				if(this.list.impurity&&this.list.impurity.indexOf('.')!=-1){
+					if(this.list.impurity.split('.')[1].length>2){
+						this.$api.msg('杂质输入错误')
+						return
+					}
+				}
+				if(this.list.mildewGrain&&this.list.mildewGrain<1||this.list.mildewGrain&&this.list.mildewGrain>40){
+					this.$api.msg('霉变粒输入错误')
+					return
+				}
+				if(this.list.mildewGrain&&this.list.mildewGrain.indexOf('.')!=-1){
+					if(this.list.mildewGrain.split('.')[1].length>2){
+						this.$api.msg('霉变粒输入错误')
+						return
+					}
+				}
+				if(this.list.imperfectGrain&&this.list.imperfectGrain<1||this.list.imperfectGrain&&this.list.imperfectGrain>40){
+					this.$api.msg('不完整粒输入错误')
+					return
+				}
+				if(this.list.imperfectGrain&&this.list.imperfectGrain.indexOf('.')!=-1){
+					if(this.list.imperfectGrain.split('.')[1].length>2){
+						this.$api.msg('不完整粒输入错误')
+						return
+					}
+				}
+				this.WarehouseInOutInfo.deductionAmount=-this.WarehouseInOutInfo.deductionAmount
 				this.WarehouseInOutInfo.warehouseInOutDetail = this.list
 				this.WarehouseInOutInfo.statusFlag = 1
 				this.$api.doRequest('post', '/warehouseInOutInfo/InOutWarehouse', this.WarehouseInOutInfo).then(res => {
-
+					if(res.data.code==200){
+						uni.showToast({
+							title: '暂存成功',
+							icon: 'none',
+							duration: 2000
+						})
+						uni.navigateBack({})
+					}else{
+						uni.showToast({
+							title: res.data.message,
+							icon: 'none',
+							duration: 2000
+						})
+					}
 				}).catch(res => {
 					uni.showToast({
 						title: res.data.message,
@@ -204,11 +370,145 @@
 				})
 			},
 			commit() {
-				console.log(this.list)
+				if(!this.WarehouseInOutInfo.grossWeight){
+					this.$api.msg('毛重不能为空')
+					return
+				}
+				if(!this.WarehouseInOutInfo.tare){
+					this.$api.msg('皮重不能为空')
+					return
+				}
+				if(!this.WarehouseInOutInfo.warehouseName){
+					this.$api.msg('仓库不能为空')
+					return
+				}
+				if(!this.WarehouseInOutInfo.binNumber){
+					this.$api.msg('仓库不能为空')
+					return
+				}
+				if(this.WarehouseInOutInfo.grossWeight>100||this.WarehouseInOutInfo.grossWeight<1){
+					this.$api.msg('毛重输入错误')
+					return
+				}
+				if(this.WarehouseInOutInfo.grossWeight.indexOf('.')!=-1){
+					if(this.WarehouseInOutInfo.grossWeight.split('.')[1].length>2){
+						this.$api.msg('毛重输入错误')
+						return
+					}
+				}
+				if(this.WarehouseInOutInfo.tare>50||this.WarehouseInOutInfo.tare<1){
+					this.$api.msg('皮重输入错误')
+					return
+				}
+				if(this.WarehouseInOutInfo.tare.indexOf('.')!=-1){
+					if(this.WarehouseInOutInfo.tare.split('.')[1].length>2){
+						this.$api.msg('皮重输入错误')
+						return
+					}
+				}
+				if(this.WarehouseInOutInfo.deductionAmount&&this.WarehouseInOutInfo.deductionAmount>10000||this.WarehouseInOutInfo.deductionAmount&&this.WarehouseInOutInfo.deductionAmount<0){
+					this.$api.msg('扣款金额输入错误')
+					return
+				}
+				if(this.WarehouseInOutInfo.deductionAmount&&this.WarehouseInOutInfo.deductionAmount.indexOf('.')!=-1){
+					if(this.WarehouseInOutInfo.deductionAmount.split('.')[1].length>2){
+						this.$api.msg('扣款金额输入错误')
+						return
+					}
+				}
+				if(this.list.qualityInspector&&this.list.qualityInspector<2||this.list.qualityInspector&&this.list.qualityInspector>10){
+					this.$api.msg('质检员姓名输入错误')
+					return
+				}
+				if(this.list.protein&&this.list.protein<1||this.list.protein&&this.list.protein>80){
+					this.$api.msg('蛋白占比输入错误')
+					return
+				}
+				if(this.list.protein&&this.list.protein.indexOf('.')!=-1){
+					if(this.list.protein.split('.')[1].length>2){
+						this.$api.msg('蛋白占比输入错误')
+						return
+					}
+				}
+				if(this.list.waterContent&&this.list.waterContent<1||this.list.waterContent&&this.list.waterContent>40){
+					this.$api.msg('水分输入错误')
+					return
+				}
+				if(this.list.waterContent&&this.list.waterContent.indexOf('.')!=-1){
+					if(this.list.waterContent.split('.')[1].length>2){
+						this.$api.msg('水分输入错误')
+						return
+					}
+				}
+				if(this.list.bulkDensity&&this.list.bulkDensity<1||this.list.bulkDensity&&this.list.bulkDensity>40){
+					this.$api.msg('容重输入错误')
+					return
+				}
+				if(this.list.bulkDensity&&this.list.bulkDensity.indexOf('.')!=-1){
+					if(this.list.bulkDensity.split('.')[1].length>2){
+						this.$api.msg('容重输入错误')
+						return
+					}
+				}
+				if(this.list.jiaorenli&&this.list.jiaorenli<1||this.list.jiaorenli&&this.list.jiaorenli>40){
+					this.$api.msg('热损伤输入错误')
+					return
+				}
+				if(this.list.jiaorenli&&this.list.jiaorenli.indexOf('.')!=-1){
+					if(this.list.jiaorenli.split('.')[1].length>2){
+						this.$api.msg('热损伤输入错误')
+						return
+					}
+				}
+				if(this.list.impurity&&this.list.impurity<1||this.list.impurity&&this.list.impurity>40){
+					this.$api.msg('杂质输入错误')
+					return
+				}
+				if(this.list.impurity&&this.list.impurity.indexOf('.')!=-1){
+					if(this.list.impurity.split('.')[1].length>2){
+						this.$api.msg('杂质输入错误')
+						return
+					}
+				}
+				if(this.list.mildewGrain&&this.list.mildewGrain<1||this.list.mildewGrain&&this.list.mildewGrain>40){
+					this.$api.msg('霉变粒输入错误')
+					return
+				}
+				if(this.list.mildewGrain&&this.list.mildewGrain.indexOf('.')!=-1){
+					if(this.list.mildewGrain.split('.')[1].length>2){
+						this.$api.msg('霉变粒输入错误')
+						return
+					}
+				}
+				if(this.list.imperfectGrain&&this.list.imperfectGrain<1||this.list.imperfectGrain&&this.list.imperfectGrain>40){
+					this.$api.msg('不完整粒输入错误')
+					return
+				}
+				if(this.list.imperfectGrain&&this.list.imperfectGrain.indexOf('.')!=-1){
+					if(this.list.imperfectGrain.split('.')[1].length>2){
+						this.$api.msg('不完整粒输入错误')
+						return
+					}
+				}
+				this.WarehouseInOutInfo.deductionAmount=-this.WarehouseInOutInfo.deductionAmount
 				this.WarehouseInOutInfo.warehouseInOutDetail = this.list
 				this.WarehouseInOutInfo.statusFlag = 3
 				this.$api.doRequest('post', '/warehouseInOutInfo/InOutWarehouse', this.WarehouseInOutInfo).then(res => {
-
+					if(res.data.code==200){
+						uni.showToast({
+							title: '提交成功',
+							icon: 'none'
+						})
+						setTimeout(() => {
+							uni.navigateBack({})
+						}, 200)
+					}else{
+						uni.showToast({
+							title: res.data.message,
+							icon: 'none',
+							duration: 2000
+						})
+					}
 				}).catch(res => {
 					uni.showToast({
 						title: res.data.message,
@@ -238,12 +538,12 @@
 				}
 			},
 			ruChange(e) {
-				this.ruIndex = e.detail.value
-				this.rutypes = this.ruType[this.ruIndex];
+				this.WarehouseInOutInfo.inOutTypeKey = e.detail.value
+				this.WarehouseInOutInfo.inOutType = this.ruType[this.ruIndex];
 			},
 			pinChange(e) {
-				this.pinIndex = e.detail.value
-				this.pinTypes = this.pinType[this.pinIndex];
+				this.WarehouseInOutInfo.gradeKey = e.detail.value
+				this.WarehouseInOutInfo.grade = this.pinType[this.pinIndex];
 			},
 		}
 

+ 11 - 1
pages.json

@@ -412,7 +412,17 @@
                 "enablePullDownRefresh": false
             }
             
-        }
+        },
+		{
+		    "path" : "pageD/myRelease/Identity_switching",
+		    "style" :                                                                                    
+		    {
+		        "navigationBarTitleText": "",
+		        "enablePullDownRefresh": false
+		    }
+		    
+		}
+
 		
     ],
 	"subpackages": [

+ 48 - 4
pages/task/my_task.vue

@@ -20,7 +20,7 @@
 					<view  class="title-tip" v-if="item.statusFlag==1">未完成</view>
 				</view>
 				<view class="titles ">{{item.contractNo}}</view>
-				<view class="titles titleds_aa">{{item.inOutDate}}</view>
+				<view class="titles titleds_aa">{{item.createDate | formatDate}}</view>
 			</view>
 			<view v-show="isLoadMore">
 				<uni-load-more :status="loadStatus"></uni-load-more>
@@ -51,10 +51,53 @@
 			};
 		},
 		onLoad(options) {
-
-			this.getIndexBuyData();
 			this.getIndexBuyData()
 		},
+		filters: {
+			formatDate (date) {
+				var date=new Date(date)
+				var time=new Date()
+				var newdate=''
+				if(time.getMonth() + 1>=10){
+					newdate=time.getFullYear()+'-'+(time.getMonth()+1)+'-'+time.getDate()
+				}else{
+					newdate=time.getFullYear()+'-0'+(time.getMonth()+1)+'-'+time.getDate()
+				}
+			     //把时间戳改为yyyy-MM-dd格式
+			     //判断是否今天
+				 var datatime=''
+				 if(date.getMonth() + 1>=10){
+				 	datatime=date.getFullYear()+'-'+(date.getMonth()+1)+'-'+date.getDate()
+				 }else{
+				 	datatime=date.getFullYear()+'-0'+(date.getMonth()+1)+'-'+date.getDate()
+				 }
+				 console.log(datatime ,newdate)
+			     if(datatime == newdate){
+			          var h = date.getHours();
+			             h = h < 10 ? '0' + h : h;
+			             var m = date.getMinutes();
+			             m = m < 10 ? '0' + m : m;
+			             var s = date.getSeconds();
+			             s = s < 10 ? '0' + s : s;
+			             return h + ':' + m + ':' + s;
+			     }else{
+					 if(date.getMonth() + 1>=10){
+						 return date.getFullYear()+'-'+(date.getMonth()+1)+'-'+date.getDate()
+					 }else{
+						  return date.getFullYear()+'-0'+(date.getMonth()+1)+'-'+date.getDate()
+					 }
+					 
+				 }
+			 let o = {
+			  'Y': date.getFullYear(),
+			  'M+': date.getMonth() + 1,
+			  'd+': date.getDate(),
+			  // 'H+': date.getHours(),
+			  // 'm+': date.getMinutes(),
+			  // 's+': date.getSeconds()
+			 }
+			},
+		},
 		methods: {
 			getIndexBuyData() {
 				console.log(11111)
@@ -68,7 +111,8 @@
 					console.log(res, "对象")
 					if (res.data.code == 200) {
 						let data = res.data.data.records
-						console.log(data, "13246")
+						// for(var i=0;i<res.data.data.records.length;i++){
+						// }
 						//采购信息
 						if (data.length > 0) {
 							that.taskInfo = that.taskInfo.concat(data)