Przeglądaj źródła

前端小程序 认证 发布 测试完成sdy

zhongtianhaoyuan 3 lat temu
rodzic
commit
ece75e6164

+ 29 - 8
pageD/myRelease/buyDetails.vue

@@ -1,6 +1,11 @@
 <template>
 	<view class="center">
-			<text class="title">基本信息</text>
+		<view class="buyup">
+			
+		
+			<view class="c-row b-b">
+				<text class="title">基本信息</text>
+			</view>
 		<view class="c-row b-b">
 			<text class="tit">名头</text>
 			<view class="con-list">
@@ -62,13 +67,17 @@
 				{{procurementPlanInfos.receivePrivate}}{{procurementPlanInfos.receiveCity}}{{procurementPlanInfos.receiveArea}}
 			</view>
 		</view>
-		<view class="c-row b-b">
+		<view class="c-row">
 			<text class="tit">买方手机号</text>
 			<view class="con-list">
 				{{procurementPlanInfos.buyerPhone}}
 			</view>
 		</view>
-		<text class="title">附加要求</text>
+		</view>
+		<view class="buylow">
+		<view class="c-row b-b">
+			<text class="title">货物要求</text>
+		</view>
 		<view class="c-row b-b">
 			<text class="tit">水分(%)<= </text>
 			<view class="con-list">
@@ -121,7 +130,7 @@
 		<view class="c-row b-b">
 			<text class="tit">品级 </text>
 			<view class="con-list">
-				{{procurementPlanInfos.procurementPlanInfos}}
+				{{procurementPlanInfos.grade}}
 			</view>
 		</view>
 		<view class="c-row b-b">
@@ -136,18 +145,19 @@
 				{{procurementPlanInfos.packingType}}
 			</view>
 		</view>
-		<view class="c-row b-b">
+		<view class="c-row b-b" v-if="procurementPlanInfos.packingType == '大袋' || procurementPlanInfos.packingType == '小袋'">
 			<text class="tit">袋装备注</text>
 			<view class="con-list">
 				{{procurementPlanInfos.baggingNotes}}
 			</view>
 		</view>
-		<view class="c-row b-b">
+		<view class="c-row">
 			<text class="tit">运费承担方</text>
 			<view class="con-list">
-				{{procurementPlanInfos.freightPayer}}
+				{{procurementPlanInfos.freightPayer == null || procurementPlanInfos.freightPayer == "" ?"暂无信息": procurementPlanInfos.freightPayer }}
 			</view>
 		</view>
+		</view>
 	</view>
 </template>
 
@@ -163,7 +173,6 @@
 			}
 		},
 		onLoad(options){
-				
 			this.getList(options.id)
 		},
 		methods: {
@@ -191,6 +200,7 @@
 <style>
 	.center{
 		padding: 10px 20px;
+		background-color: #F5F6FA;
 	}
 	.c-row {
 	    display: -webkit-box;
@@ -223,6 +233,17 @@
 		font-size: 18px;
 		font-weight: 600;
 	}
+	.buyup {
+		background-color: #FFFFFF;
+		border-radius: 20px;
+		margin-top: 10px;
+	}
+	
+	.buylow {
+		background-color: #FFFFFF;
+		border-radius: 20px;
+		margin-top: 10px;
+	}
 
 
 </style>

+ 67 - 60
pageD/myRelease/buyEdit.vue

@@ -89,7 +89,6 @@
 		</view>
 		<view  class="area">
 		<view class="c-row b-b">
-			<!-- <checkbox style='transform: scale(0.8);'  :checked="checked" @click='checkedbox'></checkbox>完善更多信息(选填,可由客服人员代为完善) -->
 			<checkbox style='transform: scale(0.8);'  :checked="checked" @click='checkedbox'></checkbox><text style="font-size: 14px; ">完善更多信息<text style="font-size: 10px; color: #AFB3BF;">(选填,可由客服人员代为完善)</text></text>
 		</view>
 		<view v-if='checked' class="c-row b-b">
@@ -144,7 +143,7 @@
 		</view>
 		<view  v-if='checked'  class="c-row b-b">
 			<text class="tit">品级 </text>
-			<picker @change="pinChange" :value="pinIndex" :range="pinType" class="con-list">
+			<picker @change="pinChange" :value="pinIndex" :range="pinType" class="con-list" v-model="deptList.grade">
 				<view class="con-list">
 					{{pinIndex>-1?pinType[pinIndex]:'请选择品级'}}
 				</view>
@@ -197,15 +196,17 @@
 				typesType: ["现货", "期货"],
 				typesIndex: 0,
 				deptList: {
+					salePlanTypeKey:0,
+					grainKey:0,
+					gradeKey:0,
+					packingTypeKey:0,
+					freightPayerKey:-1,
 					priceType: "定价采购",
 					procurementPlanType:"现货",
 					grain:"不限",
-					grainKey:1,
 					grade:"不限",
-					gradeKey:1,
 					outputYear:"2020",
 					packingType:"不限",
-					packingTypeKey:0,
 					freightPayer:"",
 				},
 				params:{
@@ -221,7 +222,7 @@
 				insertProcurementPlanInfo: {},
 				liIndex: 0,
 				liType: ['不限','塔粮', '筛粮', '中粒', '大粒'],
-				pinIndex: 0,
+				pinIndex: -1,
 				pinType: ['不限', '一等品', '二等品', '三等品', '等外'],
 				nianIndex: 3,
 				nianType: ['2023', '2022', '2021', '2020', '2019', '2018', '2017', '2016', '2015', '2014', '2013', '2012',
@@ -269,12 +270,14 @@
 				this.$api.doRequest('get','/procurementPlanInfo/getProcurementPlan',{id:this.id}).then(res => {
 					if(res.data.code==200){
 						this.deptList = res.data.data
+						 let number = this.deptList.basisPrice
+						this.deptList.basisPrice = Math.abs(number)
 						this.region1=this.deptList.outputPrivate+'-'+this.deptList.outputCity
 						this.region=this.deptList.receivePrivate+'-'+this.deptList.receiveCity+'-'+this.deptList.receiveArea
 						if(this.deptList.procurementPlanTypeKey==2){
-							this.typesIndex=0
-						}else if(this.deptList.procurementPlanTypeKey==1){
 							this.typesIndex=1
+						}else if(this.deptList.procurementPlanTypeKey==1){
+							this.typesIndex=0
 						}
 						if(this.deptList.grainKey==1){
 							this.liIndex=0
@@ -296,6 +299,9 @@
 						}else if(this.deptList.freightPayerKey==3){
 							this.chengIndex=2
 						}
+						// let number = this.deptList.basisPrice
+					
+						// deptList.basisPrice
 					}
 				})
 				.catch(res => {
@@ -384,7 +390,7 @@
 					})
 					},
 			commit() {
-				this.insertProcurementPlanInfo = this.deptList
+	
 				// if (!this.deptList.goodsName) {
 				// 	this.$api.msg('货名1不能为空')
 				// 	return
@@ -405,7 +411,7 @@
 					this.$api.msg('货名输入错误')
 					return
 				}
-				if (!this.insertProcurementPlanInfo.plannedPurchaseVolume) {
+				if (!this.deptList.plannedPurchaseVolume) {
 					this.$api.msg('采购量不能为空')
 					return
 				}
@@ -420,135 +426,138 @@
 						return
 					}
 				}
-				if (!this.insertProcurementPlanInfo.minimumVolume) {
+				if (!this.deptList.minimumVolume) {
 					this.$api.msg('最小成交量不能为空')
 					return
 				}
-				if (this.insertProcurementPlanInfo.minimumVolume>100000||this.insertProcurementPlanInfo.minimumVolume<1) {
+				if (this.deptList.minimumVolume>100000||this.deptList.minimumVolume<1) {
 					this.$api.msg('最小成交量输入错误')
 					return
 				}
-				if (this.insertProcurementPlanInfo.minimumVolume.toString().indexOf('.')!=-1) {
-					if(this.insertProcurementPlanInfo.minimumVolume.split('.')[1].length>2){
+				if (this.deptList.minimumVolume.toString().indexOf('.')!=-1) {
+					if(this.deptList.minimumVolume.split('.')[1].length>2){
 						this.$api.msg('最小成交量输入错误')
 						return
 					}
 				}
-				if (!this.insertProcurementPlanInfo.procurementPlanType) {
+				if (!this.deptList.procurementPlanType) {
 					this.$api.msg('类型不能为空')
 					return
 				}
-				if (!this.insertProcurementPlanInfo.priceType) {
+				if (!this.deptList.priceType) {
 					this.$api.msg('价格类型不能为空')
 					return
 				}
-				if(this.insertProcurementPlanInfo.procurementPlanType == '现货'){
-					if (!this.insertProcurementPlanInfo.unitPrice) {
+				if(this.deptList.procurementPlanType == '现货'){
+					if (!this.deptList.unitPrice) {
 						this.$api.msg('单价不能为空')
 						return
 					}
-					if (this.insertProcurementPlanInfo.unitPrice>100000||this.insertProcurementPlanInfo.unitPrice<1) {
+					if (this.deptList.unitPrice>100000||this.deptList.unitPrice<1) {
 						this.$api.msg('单价输入错误')
 						return
 					}
-					if (this.insertProcurementPlanInfo.unitPrice.indexOf('.')!=-1) {
-						if(this.insertProcurementPlanInfo.unitPrice.split('.')[1].length>2){
+					if (this.deptList.unitPrice.indexOf('.')!=-1) {
+						if(this.deptList.unitPrice.split('.')[1].length>2){
 							this.$api.msg('单价输入错误')
 							return
 						}
 					}
-				}else if(this.insertProcurementPlanInfo.procurementPlanType == '期货'){
-					if (!this.insertProcurementPlanInfo.basisPrice) {
+				}else if(this.deptList.procurementPlanType == '期货'){
+					if (!this.deptList.basisPrice) {
 						this.$api.msg('基差不能为空')
 						return
 					}
-					if (this.insertProcurementPlanInfo.basisPrice>10000||this.insertProcurementPlanInfo.basisPrice<1) {
+					if (this.deptList.basisPrice>10000||this.deptList.basisPrice<1) {
 						this.$api.msg('基差输入错误')
 						return
 					}
-					if (this.insertProcurementPlanInfo.basisPrice.indexOf('.')!=-1) {
-						if(this.insertProcurementPlanInfo.basisPrice.split('.')[1].length>2){
+					if (this.deptList.basisPrice.toString().indexOf('.')!=-1) {
+						if(this.deptList.basisPrice.toString().split('.')[1].length>2){
 							this.$api.msg('基差输入错误')
 							return
 						}
 					}
 				}
 			
-				if (!this.insertProcurementPlanInfo.buyerPhone) {
+				if (!this.deptList.buyerPhone) {
 					this.$api.msg('买方手机号不能为空')
 					return
 				}
-				if (this.insertProcurementPlanInfo.waterContent&&this.insertProcurementPlanInfo.waterContent<1||
-				this.insertProcurementPlanInfo.waterContent&&this.insertProcurementPlanInfo.waterContent>40) {
+				if(this.checked == false){
+				if (this.deptList.waterContent&&this.deptList.waterContent<1||
+				this.deptList.waterContent&&this.deptList.waterContent>40) {
 					this.$api.msg('水分输入错误')
 					return
 				}
-				if (this.insertProcurementPlanInfo.waterContent&&this.insertProcurementPlanInfo.waterContent.indexOf('.')!=-1) {
-					if(this.insertProcurementPlanInfo.waterContent.split('.')[1].length>2){
+				if (this.deptList.waterContent&&this.deptList.waterContent.indexOf('.')!=-1) {
+					if(this.deptList.waterContent.split('.')[1].length>2){
 						this.$api.msg('水分输入错误')
 						return
 					}
 				}
-				if (this.insertProcurementPlanInfo.bulkDensity&&this.insertProcurementPlanInfo.bulkDensity<500||
-				this.insertProcurementPlanInfo.bulkDensity&&this.insertProcurementPlanInfo.bulkDensity>1000) {
+				if (this.deptList.bulkDensity&&this.deptList.bulkDensity<500||
+				this.deptList.bulkDensity&&this.deptList.bulkDensity>1000) {
 					this.$api.msg('容重输入错误')
 					return
 				}
-				if (this.insertProcurementPlanInfo.jiaorenli&&this.insertProcurementPlanInfo.jiaorenli<1||
-				this.insertProcurementPlanInfo.jiaorenli&&this.insertProcurementPlanInfo.jiaorenli>40) {
+				if (this.deptList.jiaorenli&&this.deptList.jiaorenli<1||
+				this.deptList.jiaorenli&&this.deptList.jiaorenli>40) {
 					this.$api.msg('热损伤输入错误')
 					return
 				}
-				if (this.insertProcurementPlanInfo.jiaorenli&&this.insertProcurementPlanInfo.jiaorenli.indexOf('.')!=-1) {
-					if(this.insertProcurementPlanInfo.jiaorenli.split('.')[1].length>2){
+				if (this.deptList.jiaorenli&&this.deptList.jiaorenli.indexOf('.')!=-1) {
+					if(this.deptList.jiaorenli.split('.')[1].length>2){
 						this.$api.msg('热损伤输入错误')
 						return
 					}
 				}
-				if (this.insertProcurementPlanInfo.impurity&&this.insertProcurementPlanInfo.impurity<1||
-				this.insertProcurementPlanInfo.impurity&&this.insertProcurementPlanInfo.impurity>40) {
+				if (this.deptList.impurity&&this.deptList.impurity<1||
+				this.deptList.impurity&&this.deptList.impurity>40) {
 					this.$api.msg('杂质输入错误')
 					return
 				}
-				if (this.insertProcurementPlanInfo.impurity&&this.insertProcurementPlanInfo.impurity.indexOf('.')!=-1) {
-					if(this.insertProcurementPlanInfo.impurity.split('.')[1].length>2){
+				if (this.deptList.impurity&&this.deptList.impurity.indexOf('.')!=-1) {
+					if(this.deptList.impurity.split('.')[1].length>2){
 						this.$api.msg('杂质输入错误')
 						return
 					}
 				}
-				if (this.insertProcurementPlanInfo.mildewGrain&&this.insertProcurementPlanInfo.mildewGrain<1||
-				this.insertProcurementPlanInfo.mildewGrain&&this.insertProcurementPlanInfo.mildewGrain>40) {
+				if (this.deptList.mildewGrain&&this.deptList.mildewGrain<1||
+				this.deptList.mildewGrain&&this.deptList.mildewGrain>40) {
 					this.$api.msg('霉变粒输入错误')
 					return
 				}
-				if (this.insertProcurementPlanInfo.mildewGrain&&this.insertProcurementPlanInfo.mildewGrain.indexOf('.')!=-1) {
-					if(this.insertProcurementPlanInfo.mildewGrain.split('.')[1].length>2){
+				if (this.deptList.mildewGrain&&this.deptList.mildewGrain.indexOf('.')!=-1) {
+					if(this.deptList.mildewGrain.split('.')[1].length>2){
 						this.$api.msg('霉变粒输入错误')
 						return
 					}
 				}
-				if (this.insertProcurementPlanInfo.imperfectGrain&&this.insertProcurementPlanInfo.imperfectGrain<1||
-				this.insertProcurementPlanInfo.imperfectGrain&&this.insertProcurementPlanInfo.imperfectGrain>40) {
+				if (this.deptList.imperfectGrain&&this.deptList.imperfectGrain<1||
+				this.deptList.imperfectGrain&&this.deptList.imperfectGrain>40) {
 					this.$api.msg('不完整粒输入错误')
 					return
 				}
-				if (this.insertProcurementPlanInfo.imperfectGrain&&this.insertProcurementPlanInfo.imperfectGrain.indexOf('.')!=-1) {
-					if(this.insertProcurementPlanInfo.imperfectGrain.split('.')[1].length>2){
+				if (this.deptList.imperfectGrain&&this.deptList.imperfectGrain.indexOf('.')!=-1) {
+					if(this.deptList.imperfectGrain.split('.')[1].length>2){
 						this.$api.msg('不完整粒输入错误')
 						return
 					}
 				}
-				if (this.deptList.protein&&this.deptList.protein<1||
-				this.deptList.protein&&this.deptList.protein>80) {
+				if (this.deptList.protein && this.deptList.protein < 1 ||
+				this.deptList.protein && this.deptList.protein > 80) {
 					this.$api.msg('蛋白输入错误')
 					return
 				}
-				if (this.deptList.protein&&this.deptList.protein.indexOf('.')!=-1) {
+				if (this.deptList.protein && this.deptList.protein.indexOf('.')!=-1) {
 					if(this.deptList.protein.split('.')[1].length>2){
 						this.$api.msg('蛋白输入错误')
 						return
 					}
 				}
+				}
+				this.insertProcurementPlanInfo = this.deptList
 				this.insertProcurementPlanInfo.basisPrice=-this.insertProcurementPlanInfo.basisPrice
 		         this.insertProcurementPlanInfo.commonId = this.userInfo.id
 				 this.insertProcurementPlanInfo.compId = "2710b21efc1e4393930c5dc800010dc4"
@@ -564,11 +573,9 @@
 									
 									icon: 'none',
 								})
-								setTimeout(() => {
-									uni.navigateBack({})
-								}, 1000)
-								uni.navigateBack({
-									delta: 1
+								this.deptList={}
+								uni.navigateTo({
+									url: `/pages/release/release`
 								})
 							}else{
 								uni.showToast({
@@ -598,7 +605,7 @@
 			pinChange(e) {
 				this.pinIndex = e.detail.value
 				this.pintypes = this.pinType[this.pinIndex];
-				this.deptList.gradeKey = e.detail.value+1
+				this.deptList.gradeKey = e.detail.value
 				this.deptList.grade = this.pinType[this.pinIndex]
 			},
 			nianChange(e) {
@@ -611,13 +618,13 @@
 				this.baoIndex = e.detail.value
 				this.baotypes = this.baoType[this.baoIndex];
 				this.deptList.packingTypeKey = e.detail.value
-				this.deptList.packingType = this.chengType[this.chengIndex];
+				this.deptList.packingType = this.baoType[this.baoIndex];
 			},
 			chengChange(e) {
 				this.chengIndex = e.detail.value
 				this.chengtypes = this.chengType[this.chengIndex];
 				this.deptList.freightPayerKey = e.detail.value+1
-					this.deptList.freightPayer = this.chengType[this.chengIndex];
+				this.deptList.freightPayer = this.chengType[this.chengIndex];
 			}
 		}
 	}

+ 322 - 292
pageD/myRelease/buyGrain.vue

@@ -1,223 +1,224 @@
 <template>
 	<view class="center">
 		<view class="buyup">
-			
-		
-		<view class="c-row b-b">
-			<text class="tit">名头</text>
-			<view class="con-list">
-				<text @click="navToDetailPage">{{deptList.procurementPlanNo}}</text>
-			</view>
-		</view>
-		<view class="c-row b-b">
-			<text class="tit">标题</text>
-			<view class="con-list">
-				<input maxlength='16' minlength='2' placeholder="请输入标题,不超过16个字" name="input" v-model="deptList.title"></input>
+			<view class="c-row b-b">
+				<text class="tit">名头</text>
+				<view class="con-list">
+					<text @click="navToDetailPage">{{deptList.procurementPlanNo}}</text>
+				</view>
 			</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>
+			<view class="c-row b-b">
+				<text class="tit">标题</text>
+				<view class="con-list">
+					<input maxlength='16' minlength='2' placeholder="请输入标题,不超过16个字" name="input"
+						v-model="deptList.title"></input>
+				</view>
 			</view>
-		</view>
-		<view class="c-row b-b">
-			<text class="tit">采购量(吨)</text>
-			<view class="con-list">
-				<input placeholder="请输入采购重量,如1000" name="input" v-model="deptList.plannedPurchaseVolume"></input>
+			<view class="c-row b-b">
+				<text class="tit">货名</text>
+				<view class="con-list">
+					<input placeholder="请输入货名,如玉米" name="input" v-model="deptList.goodsName"></input>
+				</view>
 			</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>
+			<view class="c-row b-b">
+				<text class="tit">采购量(吨)</text>
+				<view class="con-list">
+					<input placeholder="请输入采购重量,如1000" name="input" v-model="deptList.plannedPurchaseVolume"></input>
+				</view>
 			</view>
-		</view>
-		<view class="c-row b-b">
-			<text class="tit">类型</text>
-			<picker @change="typeChange" :value="typesIndex" :range="typesType" class="con-list"
-				>
-				<view class="picker" v-model="deptList.procurementPlanType">
-					{{typesIndex>-1?typesType[typesIndex]:'请选择类型'}}
+			<view class="c-row b-b">
+				<text class="tit">最小成交量(吨)</text>
+				<view class="con-list">
+					<input placeholder="请输入最小成交量" name="input" v-model="deptList.minimumVolume"></input>
 				</view>
-			</picker>
-		</view>
-		<view class="c-row b-b">
-			<text class="tit">价格类型</text>
+			</view>
+			<view class="c-row b-b">
+				<text class="tit">类型</text>
+				<picker @change="typeChange" :value="typesIndex" :range="typesType" class="con-list">
+					<view class="picker" v-model="deptList.procurementPlanType">
+						{{typesIndex>-1?typesType[typesIndex]:'请选择类型'}}
+					</view>
+				</picker>
+			</view>
+			<view class="c-row b-b">
+				<text class="tit">价格类型</text>
 				<view class="con-list">
 					<!-- <input placeholder="请填写价格类型" name="input"  v-model="deptList.priceType"></input> -->
 					{{deptList.priceType}}
 				</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.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>
+			<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>
+				</view>
 			</view>
-		</view>
-		<view class="c-row b-b">
-			<text class="tit">收货地区</text>
-			<view class="con-list">
-				<view @click='regionchange'>{{region}}</view>
-				<u-picker :params='params' @confirm='regionpicker' mode="region" v-model="show" ></u-picker>
+			<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>
+				</view>
 			</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>
+			<view class="c-row b-b">
+				<text class="tit">收货地区</text>
+				<view class="con-list">
+					<view @click='regionchange'>{{region}}</view>
+					<u-picker :params='params' @confirm='regionpicker' mode="region" v-model="show"></u-picker>
+				</view>
 			</view>
-		</view>
-		<view class="c-row ">
-			<text class="validate">获取验证码</text>
-			<view class="con-list">
-				<input placeholder="请填写6位短信验证码" name="input" v-model="deptList.title1"></input>
+			<view class="c-row b-b">
+				<text class="tit">买方手机号</text>
+				<view class="con-list">
+					<input placeholder="请输入买方手机号" name="input" v-model="deptList.buyerPhone"></input>
+				</view>
+			</view>
+			<view class="c-row ">
+				<text class="validate">获取验证码</text>
+				<view class="con-list">
+					<input placeholder="请填写6位短信验证码" name="input" v-model="deptList.title1"></input>
+				</view>
 			</view>
-		</view>
 		</view>
 		<view class="buylow">
-			
-		
-		<view class="c-row ">
-			<checkbox style='transform: scale(0.8);'  :checked="checked" @click='checkedbox'></checkbox><text style="font-size: 14px; ">完善更多信息<text style="font-size: 10px; color: #AFB3BF;">(选填,可由客服人员代为完善)</text></text>
-		</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  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  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  v-if='!checked'  class="c-row b-b">
-			<text class="tit">杂质(%)<= </text>
+			<view class="c-row ">
+				<checkbox style='transform: scale(0.8);' :checked="checked" @click='checkedbox'></checkbox><text
+					style="font-size: 14px; ">完善更多信息<text
+						style="font-size: 10px; color: #AFB3BF;">(选填,可由客服人员代为完善)</text></text>
+			</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 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 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 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 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 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 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 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">
-						<input placeholder="请填写杂质占比" name="input" v-model="deptList.impurity"></input>
+						{{liIndex>-1?liType[liIndex]:'请选择粒型'}}
 					</view>
-		</view>
-		<view  v-if='!checked'  class="c-row b-b">
-			<text class="tit">霉变粒(%)<= </text>
+				</picker>
+			</view>
+			<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">
-						<input placeholder="请填写霉变粒占比" name="input" v-model="deptList.mildewGrain"></input>
+						{{pinIndex>-1?pinType[pinIndex]:'请选择品级'}}
 					</view>
-		</view>
-		<view  v-if='!checked'  class="c-row b-b">
-			<text class="tit">不完整粒(%)<= </text>
+				</picker>
+			</view>
+			<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">
-						<input placeholder="请填写不完整粒占比" name="input" v-model="deptList.imperfectGrain"></input>
+						{{nianIndex>-1?nianType[nianIndex]:'请选择产出年份'}}
 					</view>
-		</view>
-		<view  v-if='!checked'  class="c-row b-b">
-			<text class="tit">蛋白(%)<= </text>
+				</picker>
+			</view>
+			<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">
-						<input placeholder="请填写蛋白占比" name="input" v-model="deptList.protein"></input>
+						{{baoIndex>-1?baoType[baoIndex]:'请选择包装方式'}}
 					</view>
-		</view>
-		<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">
-					{{liIndex>-1?liType[liIndex]:'请选择粒型'}}
-				</view>
-			</picker>
-		</view>
-		<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">
-					{{pinIndex>-1?pinType[pinIndex]:'请选择品级'}}
-				</view>
-			</picker>
-		</view>
-		<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>
+				</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">
-					{{nianIndex>-1?nianType[nianIndex]:'请选择产出年份'}}
-				</view>
-			</picker>
-		</view>
-		<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">
-					{{baoIndex>-1?baoType[baoIndex]:'请选择包装方式'}}
-				</view>
-			</picker>
-		</view>
-		<view  v-if='!checked&&baoIndex==2||!checked&&baoIndex==3'  class="c-row b-b">
-			<text class="tit">袋装备注</text>
+			<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 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">
+						{{chengIndex>-1?chengType[chengIndex]:'请选择运费承担方'}}
+					</view>
+				</picker>
+			</view>
 		</view>
-		<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">
-					{{chengIndex>-1?chengType[chengIndex]:'请选择运费承担方'}}
-				</view>
-			</picker>
-		</view>
-		</view>
-
 		<button @click="commit()" class="btn">发布</button>
 	</view>
 </template>
-
 <script>
 	import {
-	    mapState 
+		mapState
 	} from 'vuex';
 	export default {
 		data() {
 			return {
 				types: '',
-				goods:{},
+				goods: {},
 				typesType: ["现货", "期货"],
 				typesIndex: 0,
 				deptList: {
+					salePlanTypeKey: 0,
+					grainKey: 0,
+					gradeKey: 0,
+					packingTypeKey: 0,
+					freightPayerKey: 0,
 					priceType: "定价采购",
-					procurementPlanType:"现货",
-					grain:"塔粮",
-					grade:"不限(默认)",
-					outputYear:"2020",
-					packingType:"不限(默认)",
-					freightPayer:"",
+					procurementPlanType: "现货",
+					grain: "塔粮",
+					grade: "不限(默认)",
+					outputYear: "2020",
+					packingType: "不限(默认)",
+					freightPayer: "",
 				},
-				params:{
+				params: {
 					province: true,
 					city: true,
 					area: true,
 				},
-				params1:{
+				params1: {
 					province: true,
 					city: true,
 				},
-				checked:true,
+				checked: true,
 				insertProcurementPlanInfo: {},
 				liIndex: 0,
 				liType: ['塔粮', '筛粮', '中粒', '大粒'],
@@ -227,10 +228,10 @@
 				nianType: ['2023', '2022', '2021', '2020', '2019', '2018', '2017', '2016', '2015', '2014', '2013', '2012',
 					'2011'
 				],
-				show:false,
-				show1:false,
-				region:'请选择收货地区',
-				region1:'请选择产地',
+				show: false,
+				show1: false,
+				region: '请选择收货地区',
+				region1: '请选择产地',
 				baoIndex: 0,
 				baoType: ['不限(默认)', '散装', '大袋', '小袋'],
 				chengIndex: -1,
@@ -238,51 +239,54 @@
 			}
 		},
 		computed: {
-			...mapState(['hasLogin','userInfo'])
+			...mapState(['hasLogin', 'userInfo'])
 		},
-		onLoad(options){
-			if(options.customerName){
-				this.deptList.procurementPlanNo=options.customerName
+		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)
+		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
+					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
+			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
+			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
+			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
+			regionchange1() {
+				this.show1 = true
 			},
-			checkedbox(e){
-				this.checked=!this.checked
+			checkedbox(e) {
+				this.checked = !this.checked
 			},
 			typeChange(e) {
 				this.typesIndex = e.detail.value
 				this.types = this.typesType[this.typesIndex];
+				this.deptList.procurementPlanTypeKey = e.detail.value + 1
 				this.deptList.procurementPlanType = this.typesType[this.typesIndex];
 				if (this.typesIndex == 0) {
 					this.deptList.priceType = '定价采购'
@@ -292,18 +296,16 @@
 
 			},
 			navToDetailPage() {
-				// if (index == 1) {
-					uni.navigateTo({
-						url: `/pageD/myRelease/Identity_switching`
-					})
-					},
+				uni.navigateTo({
+					url: `/pageD/myRelease/Identity_switching`
+				})
+			},
 			commit() {
-				this.insertProcurementPlanInfo = this.deptList
 				if (!this.deptList.title) {
 					this.$api.msg('标题不能为空')
 					return
 				}
-				if (this.deptList.title.length>16||this.deptList.title.length<2) {
+				if (this.deptList.title.length > 16 || this.deptList.title.length < 2) {
 					this.$api.msg('标题输入错误')
 					return
 				}
@@ -311,160 +313,180 @@
 					this.$api.msg('货名不能为空')
 					return
 				}
-				if (this.deptList.goodsName.length>6||this.deptList.goodsName.length<1) {
+				if (this.deptList.goodsName.length > 6 || this.deptList.goodsName.length < 1) {
 					this.$api.msg('货名输入错误')
 					return
 				}
-				if (!this.insertProcurementPlanInfo.plannedPurchaseVolume) {
+				if (!this.deptList.plannedPurchaseVolume) {
 					this.$api.msg('采购量不能为空')
 					return
 				}
-				if (this.deptList.plannedPurchaseVolume>100000||this.deptList.plannedPurchaseVolume<1) {
+				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){
+				if (this.deptList.plannedPurchaseVolume.indexOf('.') != -1) {
+					if (this.deptList.plannedPurchaseVolume.split('.')[1].length > 2) {
 						this.$api.msg('采购量输入错误')
 						return
 					}
 				}
-				if (!this.insertProcurementPlanInfo.minimumVolume) {
+				if (!this.deptList.minimumVolume) {
 					this.$api.msg('最小成交量不能为空')
 					return
 				}
-				if (this.insertProcurementPlanInfo.minimumVolume>100000||this.insertProcurementPlanInfo.minimumVolume<1) {
+				if (this.deptList.minimumVolume > 100000 || this.deptList.minimumVolume < 1) {
 					this.$api.msg('最小成交量输入错误')
 					return
 				}
-				if (this.insertProcurementPlanInfo.minimumVolume.indexOf('.')!=-1) {
-					if(this.insertProcurementPlanInfo.minimumVolume.split('.')[1].length>2){
+				if (this.deptList.minimumVolume.indexOf('.') != -1) {
+					if (this.deptList.minimumVolume.split('.')[1].length > 2) {
 						this.$api.msg('最小成交量输入错误')
 						return
 					}
 				}
-				if (!this.insertProcurementPlanInfo.procurementPlanType) {
+				if (!this.deptList.procurementPlanType) {
 					this.$api.msg('类型不能为空')
 					return
 				}
-				if (!this.insertProcurementPlanInfo.priceType) {
+				if (!this.deptList.priceType) {
 					this.$api.msg('价格类型不能为空')
 					return
 				}
-				if(this.insertProcurementPlanInfo.procurementPlanType == '现货'){
-					if (!this.insertProcurementPlanInfo.unitPrice) {
+				if (this.deptList.procurementPlanType == '现货') {
+					if (!this.deptList.unitPrice) {
 						this.$api.msg('单价不能为空')
 						return
 					}
-					if (this.insertProcurementPlanInfo.unitPrice>100000||this.insertProcurementPlanInfo.unitPrice<1) {
+					if (this.deptList.unitPrice > 100000 || this.deptList.unitPrice < 1) {
 						this.$api.msg('单价输入错误')
 						return
 					}
-					if (this.insertProcurementPlanInfo.unitPrice.indexOf('.')!=-1) {
-						if(this.insertProcurementPlanInfo.unitPrice.split('.')[1].length>2){
+					if (this.deptList.unitPrice.indexOf('.') != -1) {
+						if (this.deptList.unitPrice.split('.')[1].length > 2) {
 							this.$api.msg('单价输入错误')
 							return
 						}
 					}
-				}else if(this.insertProcurementPlanInfo.procurementPlanType == '期货'){
-					if (!this.insertProcurementPlanInfo.basisPrice) {
+				} else if (this.deptList.procurementPlanType == '期货') {
+					if (!this.deptList.basisPrice) {
 						this.$api.msg('基差(元/吨)不能为空')
 						return
 					}
-					if (this.insertProcurementPlanInfo.basisPrice>10000||this.insertProcurementPlanInfo.basisPrice<1) {
+					if (this.deptList.basisPrice > 10000 || this.deptList.basisPrice < 1) {
 						this.$api.msg('基差输入错误')
 						return
 					}
-					if (this.insertProcurementPlanInfo.basisPrice.indexOf('.')!=-1) {
-						if(this.insertProcurementPlanInfo.basisPrice.split('.')[1].length>2){
+					if (this.deptList.basisPrice.indexOf('.') != -1) {
+						if (this.deptList.basisPrice.split('.')[1].length > 2) {
 							this.$api.msg('基差输入错误')
 							return
 						}
 					}
 				}
-			
-				if (!this.insertProcurementPlanInfo.buyerPhone) {
+				if (!this.deptList.buyerPhone) {
 					this.$api.msg('买方手机号不能为空')
 					return
 				}
-				if (this.insertProcurementPlanInfo.waterContent&&this.insertProcurementPlanInfo.waterContent<1||
-				this.insertProcurementPlanInfo.waterContent&&this.insertProcurementPlanInfo.waterContent>40) {
-					this.$api.msg('水分输入错误')
-					return
-				}
-				if (this.insertProcurementPlanInfo.waterContent&&this.insertProcurementPlanInfo.waterContent.indexOf('.')!=-1) {
-					if(this.insertProcurementPlanInfo.waterContent.split('.')[1].length>2){
+				if (this.checked == false) {
+					if (this.deptList.waterContent && this.deptList.waterContent < 1 ||
+						this.deptList.waterContent && this.deptList.waterContent > 40) {
 						this.$api.msg('水分输入错误')
 						return
 					}
-				}
-				if (this.insertProcurementPlanInfo.bulkDensity&&this.insertProcurementPlanInfo.bulkDensity<500||
-				this.insertProcurementPlanInfo.bulkDensity&&this.insertProcurementPlanInfo.bulkDensity>1000) {
-					this.$api.msg('容重输入错误')
-					return
-				}
-				if (this.insertProcurementPlanInfo.jiaorenli&&this.insertProcurementPlanInfo.jiaorenli<1||
-				this.insertProcurementPlanInfo.jiaorenli&&this.insertProcurementPlanInfo.jiaorenli>40) {
-					this.$api.msg('热损伤输入错误')
-					return
-				}
-				if (this.insertProcurementPlanInfo.jiaorenli&&this.insertProcurementPlanInfo.jiaorenli.indexOf('.')!=-1) {
-					if(this.insertProcurementPlanInfo.jiaorenli.split('.')[1].length>2){
+					if (this.deptList.waterContent && this.deptList.waterContent.indexOf('.') != -1) {
+						if (this.deptList.waterContent.split('.')[1].length > 2) {
+							this.$api.msg('水分输入错误')
+							return
+						}
+					}
+					if (this.deptList.bulkDensity && this.deptList.bulkDensity < 500 ||
+						this.deptList.bulkDensity && this.deptList.bulkDensity > 1000) {
+						this.$api.msg('容重输入错误')
+						return
+					}
+					if (this.deptList.jiaorenli && this.deptList.jiaorenli < 1 ||
+						this.deptList.jiaorenli && this.deptList.jiaorenli > 40) {
 						this.$api.msg('热损伤输入错误')
 						return
 					}
-				}
-				if (this.insertProcurementPlanInfo.impurity&&this.insertProcurementPlanInfo.impurity<1||
-				this.insertProcurementPlanInfo.impurity&&this.insertProcurementPlanInfo.impurity>40) {
-					this.$api.msg('杂质输入错误')
-					return
-				}
-				if (this.insertProcurementPlanInfo.impurity&&this.insertProcurementPlanInfo.impurity.indexOf('.')!=-1) {
-					if(this.insertProcurementPlanInfo.impurity.split('.')[1].length>2){
+					if (this.deptList.jiaorenli && this.deptList.jiaorenli.indexOf('.') != -1) {
+						if (this.deptList.jiaorenli.split('.')[1].length > 2) {
+							this.$api.msg('热损伤输入错误')
+							return
+						}
+					}
+					if (this.deptList.impurity && this.deptList.impurity < 1 ||
+						this.deptList.impurity && this.deptList.impurity > 40) {
 						this.$api.msg('杂质输入错误')
 						return
 					}
-				}
-				if (this.insertProcurementPlanInfo.mildewGrain&&this.insertProcurementPlanInfo.mildewGrain<1||
-				this.insertProcurementPlanInfo.mildewGrain&&this.insertProcurementPlanInfo.mildewGrain>40) {
-					this.$api.msg('霉变粒输入错误')
-					return
-				}
-				if (this.insertProcurementPlanInfo.mildewGrain&&this.insertProcurementPlanInfo.mildewGrain.indexOf('.')!=-1) {
-					if(this.insertProcurementPlanInfo.mildewGrain.split('.')[1].length>2){
+					if (this.deptList.impurity && this.deptList.impurity.indexOf('.') != -1) {
+						if (this.deptList.impurity.split('.')[1].length > 2) {
+							this.$api.msg('杂质输入错误')
+							return
+						}
+					}
+					if (this.deptList.mildewGrain && this.deptList.mildewGrain < 1 ||
+						this.deptList.mildewGrain && this.deptList.mildewGrain > 40) {
 						this.$api.msg('霉变粒输入错误')
 						return
 					}
-				}
-				if (this.insertProcurementPlanInfo.imperfectGrain&&this.insertProcurementPlanInfo.imperfectGrain<1||
-				this.insertProcurementPlanInfo.imperfectGrain&&this.insertProcurementPlanInfo.imperfectGrain>40) {
-					this.$api.msg('不完整粒输入错误')
-					return
-				}
-				if (this.insertProcurementPlanInfo.imperfectGrain&&this.insertProcurementPlanInfo.imperfectGrain.indexOf('.')!=-1) {
-					if(this.insertProcurementPlanInfo.imperfectGrain.split('.')[1].length>2){
+					if (this.deptList.mildewGrain && this.deptList.mildewGrain.indexOf('.') != -1) {
+						if (this.deptList.mildewGrain.split('.')[1].length > 2) {
+							this.$api.msg('霉变粒输入错误')
+							return
+						}
+					}
+					if (this.deptList.imperfectGrain && this.deptList.imperfectGrain < 1 ||
+						this.deptList.imperfectGrain && this.deptList.imperfectGrain > 40) {
 						this.$api.msg('不完整粒输入错误')
 						return
 					}
-				}
-				if (this.insertProcurementPlanInfo.protein && this.insertProcurementPlanInfo.protein > 1 ||
-				this.insertProcurementPlanInfo.protein && this.insertProcurementPlanInfo.protein < 80) {
-					this.$api.msg('蛋白输入错误1')
-					return
-				}
-				if (this.insertProcurementPlanInfo.protein&&this.insertProcurementPlanInfo.protein.indexOf('.')!=-1) {
-					if(this.insertProcurementPlanInfo.protein.split('.')[1].length>2){
-						this.$api.msg('蛋白输入错误2')
+					if (this.deptList.imperfectGrain && this.deptList.imperfectGrain.indexOf('.') != -1) {
+						if (this.deptList.imperfectGrain.split('.')[1].length > 2) {
+							this.$api.msg('不完整粒输入错误')
+							return
+						}
+					}
+					if (this.deptList.protein && this.deptList.protein < 1 ||
+						this.deptList.protein && this.deptList.protein > 80) {
+						this.$api.msg('蛋白输入错误')
 						return
 					}
+					if (this.deptList.protein && this.deptList.protein.indexOf('.') != -1) {
+						if (this.deptList.protein.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.insertProcurementPlanInfo = this.deptList
+				this.insertProcurementPlanInfo.basisPrice = -this.insertProcurementPlanInfo.basisPrice
+				this.insertProcurementPlanInfo.commonId = this.userInfo.id
+				this.insertProcurementPlanInfo.compId = "2710b21efc1e4393930c5dc800010dc4"
 				this.$api.doRequest('post', '/procurementPlanInfo/api/insertProcurementPlanInfo', this
 						.insertProcurementPlanInfo).then(res => {
-						console.log("添加成功")
-						this.procurementPlanInfos = res.data.data
+						if (res.data.code == 200) {
+							uni.showToast({
+								title: "发布成功",
+								icon: 'none',
+							})
+							// setTimeout(() => {
+							// 	uni.navigateBack({})
+							// }, 1000)
+							this.deptList = {}
+							uni.navigateTo({
+								url: `/pages/release/release`
+							})
+						} else {
+							uni.showToast({
+								title: res.data.message,
+								icon: 'none',
+								duration: 2000
+							})
+						}
+
 					})
 					.catch(res => {
 						uni.showToast({
@@ -477,11 +499,13 @@
 			liChange(e) {
 				this.liIndex = e.detail.value
 				this.litypes = this.liType[this.liIndex];
+				this.deptList.grainKey = e.detail.value + 1
 				this.deptList.grain = this.liType[this.liIndex]
 			},
 			pinChange(e) {
 				this.pinIndex = e.detail.value
 				this.pintypes = this.pinType[this.pinIndex];
+				this.deptList.gradeKey = e.detail.value
 				this.deptList.grade = this.pinType[this.pinIndex]
 			},
 			nianChange(e) {
@@ -493,12 +517,14 @@
 			baoChange(e) {
 				this.baoIndex = e.detail.value
 				this.baotypes = this.baoType[this.baoIndex];
-				this.deptList.packingType = this.chengType[this.chengIndex];
+				this.deptList.packingTypeKey = e.detail.value
+				this.deptList.packingType = this.baoType[this.baoIndex];
 			},
 			chengChange(e) {
 				this.chengIndex = e.detail.value
 				this.chengtypes = this.chengType[this.chengIndex];
-					this.deptList.freightPayer = this.chengType[this.chengIndex];
+				this.deptList.freightPayerKey = e.detail.value + 1
+				this.deptList.freightPayer = this.chengType[this.chengIndex];
 			}
 		}
 	}
@@ -538,23 +564,27 @@
 		padding-right: 20rpx;
 		font-size: 14px;
 	}
-	.buyup{
+
+	.buyup {
 		background-color: #FFFFFF;
 		border-radius: 20px;
 		margin-top: 10px;
 	}
-	.buylow{
+
+	.buylow {
 		background-color: #FFFFFF;
 		border-radius: 20px;
 		margin-top: 10px;
 	}
-	.btn{
+
+	.btn {
 		border-radius: 20px;
 		margin-top: 10px;
 		background-color: #22C572;
 		color: #FFFFFF;
 	}
-	.validate{
+
+	.validate {
 		width: 100px;
 		height: 32px;
 		background-color: #F5F6F9;

+ 313 - 177
pageD/myRelease/sellDetails.vue

@@ -1,246 +1,382 @@
 <template>
 	<view class="center">
-			<text class="title">基本信息</text>
-		<view class="c-row b-b">
-			<text class="tit">名头</text>
-			<view class="con-list">
-				<input placeholder="请填写名头" name="input" @input="addressInput"></input>
+		<view class="buyup">
+			<view class="c-row b-b">
+				<text class="title">基本信息</text>
 			</view>
-		</view>
-		<view class="c-row b-b">
-			<text class="tit">标题</text>
-			<view class="con-list">
-				<input placeholder="请填写标题,2-16个子" name="input" @input="addressInput"></input>
-			</view>
-		</view>
-		<view class="c-row b-b">
-			<text class="tit">货名</text>
-			<view class="con-list">
-				<input placeholder="请填写货名" name="input" @input="addressInput"></input>
-			</view>
-		</view>
-		<view class="c-row b-b">
-			<text class="tit">出售量(吨)</text>
-			<view class="con-list">
-				<input placeholder="请填写出售重量" name="input" @input="addressInput"></input>
-			</view>
-		</view>
-		<view class="c-row b-b">
-			<text class="tit">最小成交量(吨)</text>
-			<view class="con-list">
-				<input placeholder="请填写最小成交量" name="input" @input="addressInput"></input>
-			</view>
-		</view>
-		<view class="c-row b-b">
-			<text class="tit">类型</text>
-			<picker @change="typeChange" :value="typesIndex" :range="typesType" class="con-list">
-				<view class="picker">
-					{{typesIndex>-1?typesType[typesIndex]:'请选择类型'}}
-				</view>
-			</picker>
-		</view>
-		<view class="c-row b-b">
-			<text class="tit">价格类型</text>
-			<picker @change="typeChange" :value="typesIndex" :range="typesType" class="con-list">
+			<view class="c-row b-b">
+				<text class="tit">名头</text>
 				<view class="con-list">
-					<input placeholder="请填写价格类型" name="input" @input="addressInput"></input>
+					<text @click="navToDetailPage">{{deptList.procurementPlanNo}}</text>
 				</view>
-			</picker>
-		</view>
-		<view class="c-row b-b">
-			<text class="tit">单价(元/吨)</text>
-			<picker @change="typeChange" :value="typesIndex" :range="typesType" class="con-list">
+			</view>
+			<view class="c-row b-b">
+				<text class="tit">标题</text>
 				<view class="con-list">
-					<input placeholder="请填写单价(元/吨)" name="input" @input="addressInput"></input>
+					{{deptList.title}}
 				</view>
-			</picker>
-		</view>
-		<view class="c-row b-b">
-			<text class="tit">产地</text>
-			<picker @change="typeChange" :value="typesIndex" :range="typesType" class="con-list">
+			</view>
+			<view class="c-row b-b">
+				<text class="tit">货名</text>
 				<view class="con-list">
-					<input placeholder="请填写产地" name="input" @input="addressInput"></input>
+					{{deptList.goodsName}}
 				</view>
-			</picker>
-		</view>
-		<view class="c-row b-b">
-			<text class="tit">发货地区</text>
-			<picker @change="typeChange" :value="typesIndex" :range="typesType" class="con-list">
+			</view>
+			<view class="c-row b-b">
+				<text class="tit">出货量(吨)</text>
 				<view class="con-list">
-					<input placeholder="请填写发货地区" name="input" @input="addressInput"></input>
+					{{deptList.plannedSaleVolume}}
 				</view>
-			</picker>
-		</view>
-		<view class="c-row b-b">
-			<text class="tit">卖方手机号</text>
-			<picker @change="typeChange" :value="typesIndex" :range="typesType" class="con-list">
+			</view>
+			<view class="c-row b-b">
+				<text class="tit">最小成交量(吨)</text>
 				<view class="con-list">
-					<input placeholder="请填写卖方手机号" name="input" @input="addressInput"></input>
+					{{deptList.minimumVolume}}
 				</view>
-			</picker>
-		</view>
-		<text class="title">附加要求</text>
-		<view class="c-row b-b">
-			<text class="tit">水分(%)<= </text>
-			<picker @change="typeChange" :value="typesIndex" :range="typesType" class="con-list">
+			</view>
+			<view class="c-row b-b">
+				<text class="tit">类型</text>
 				<view class="con-list">
-					<input placeholder="请填写水分占比" name="input" @input="addressInput"></input>
+
+					{{deptList.salePlanType}}
 				</view>
-			</picker>
-		</view>
-		<view class="c-row b-b">
-			<text class="tit">容重(g/L)<= </text>
-			<picker @change="typeChange" :value="typesIndex" :range="typesType" class="con-list">
+			</view>
+			<view class="c-row b-b">
+				<text class="tit">价格类型</text>
 				<view class="con-list">
-					<input placeholder="请填写容重" name="input" @input="addressInput"></input>
+					{{deptList.priceType}}
 				</view>
-			</picker>
-		</view>
-
-		<view class="c-row b-b">
-			<text class="tit">热损伤(%)<= </text>
-			<picker @change="typeChange" :value="typesIndex" :range="typesType" class="con-list">
+			</view>
+			<view class="c-row b-b" v-if="deptList.salePlanType == '现货'">
+				<text class="tit">单价(元/吨)</text>
 				<view class="con-list">
-					<input placeholder="请填写热损伤占比" name="input" @input="addressInput"></input>
+					{{deptList.unitPrice}}
 				</view>
-			</picker>
-		</view>
-		<view class="c-row b-b">
-			<text class="tit">杂质(%)<= </text>
-			<picker @change="typeChange" :value="typesIndex" :range="typesType" class="con-list">
+			</view>
+			<view class="c-row b-b" v-if="deptList.salePlanType == '期货'">
+				<text class="tit">基差(元/吨)</text>
 				<view class="con-list">
-					<input placeholder="请填写杂质占比" name="input" @input="addressInput"></input>
+					{{deptList.basisPrice}}
 				</view>
-			</picker>
-		</view>
-		<view class="c-row b-b">
-			<text class="tit">霉变粒(%)<= </text>
-			<picker @change="typeChange" :value="typesIndex" :range="typesType" class="con-list">
+			</view>
+			<view class="c-row b-b">
+				<text class="tit">产地</text>
 				<view class="con-list">
-					<input placeholder="请填写霉变粒占比" name="input" @input="addressInput"></input>
+					{{deptList.outputPrivate}}{{deptList.outputCity}}
 				</view>
-			</picker>
-		</view>
-		<view class="c-row b-b">
-			<text class="tit">不完整粒(%)<= </text>
-			<picker @change="typeChange" :value="typesIndex" :range="typesType" class="con-list">
+			</view>
+			<view class="c-row b-b">
+				<text class="tit">发货地区</text>
 				<view class="con-list">
-					<input placeholder="请填写不完整粒占比" name="input" @input="addressInput"></input>
+					{{deptList.sendPrivate}}{{deptList.sendCity}}{{deptList.sendArea}}
 				</view>
-			</picker>
-		</view>
-		<view class="c-row b-b">
-			<text class="tit">蛋白(%)<= </text>
-			<picker @change="typeChange" :value="typesIndex" :range="typesType" class="con-list">
+			</view>
+			<view class="c-row ">
+				<text class="tit">卖方手机号</text>
 				<view class="con-list">
-					<input placeholder="请填写蛋白占比" name="input" @input="addressInput"></input>
+					{{deptList.sellerPhone}}
 				</view>
-			</picker>
+			</view>
 		</view>
-		<view class="c-row b-b">
-			<text class="tit">粒型 </text>
-			<picker @change="typeChange" :value="typesIndex" :range="typesType" class="con-list">
+		<view class="buylow">
+			<view class="c-row b-b">
+				<text class="title">货物要求</text>
+			</view>
+			<view class="c-row b-b">
+				<text class="tit">水分(%)<= </text>
+						<view class="con-list">
+							{{deptList.waterContent}}
+						</view>
+			</view>
+			<view class="c-row b-b">
+				<text class="tit">容重(g/L)<= </text>
+						<view class="con-list">
+							{{deptList.bulkDensity}}
+						</view>
+			</view>
+			<view class="c-row b-b">
+				<text class="tit">热损伤(%)<= </text>
+						<view class="con-list">
+							{{deptList.jiaorenli}}
+						</view>
+			</view>
+			<view class="c-row b-b">
+				<text class="tit">杂质(%)<= </text>
+						<view class="con-list">
+							{{deptList.impurity}}
+						</view>
+			</view>
+			<view class="c-row b-b">
+				<text class="tit">霉变粒(%)<= </text>
+						<view class="con-list">
+							{{deptList.mildewGrain}}
+						</view>
+			</view>
+			<view class="c-row b-b">
+				<text class="tit">不完整粒(%)<= </text>
+						<view class="con-list">
+							{{deptList.imperfectGrain}}
+						</view>
+			</view>
+			<view class="c-row b-b">
+				<text class="tit">蛋白(%)<= </text>
+						<view class="con-list">
+							{{deptList.protein}}
+						</view>
+			</view>
+			<view class="c-row b-b">
+				<text class="tit">粒型 </text>
 				<view class="con-list">
-					<input placeholder="请填写粒型" name="input" @input="addressInput"></input>
+					{{deptList.grain}}
 				</view>
-			</picker>
-		</view>
-		<view class="c-row b-b">
-			<text class="tit">品级 </text>
-			<picker @change="typeChange" :value="typesIndex" :range="typesType" class="con-list">
+			</view>
+			<view class="c-row b-b">
+				<text class="tit">品级 </text>
 				<view class="con-list">
-					<input placeholder="请填写品级" name="input" @input="addressInput"></input>
+					{{deptList.grade}}
 				</view>
-			</picker>
-		</view>
-		<view class="c-row b-b">
-			<text class="tit">产出年份</text>
-			<picker @change="typeChange" :value="typesIndex" :range="typesType" class="con-list">
+			</view>
+
+			<view class="c-row b-b">
+				<text class="tit">产出年份</text>
 				<view class="con-list">
-					<input placeholder="请填写产出年份" name="input" @input="addressInput"></input>
+					{{deptList.outputYear}}
 				</view>
-			</picker>
-		</view>
-		<view class="c-row b-b">
-			<text class="tit">包装方式</text>
-			<picker @change="typeChange" :value="typesIndex" :range="typesType" class="con-list">
+			</view>
+			<view class="c-row b-b">
+				<text class="tit">包装方式</text>
 				<view class="con-list">
-					<input placeholder="请填写包装方式" name="input" @input="addressInput"></input>
+					{{deptList.packingType}}
 				</view>
-			</picker>
-		</view>
-		<view class="c-row b-b">
-			<text class="tit">袋装备注</text>
-			<picker @change="typeChange" :value="typesIndex" :range="typesType" class="con-list">
+			</view>
+			<view v-if="deptList.packingType == '大袋' || deptList.packingType == '小袋'" class="c-row b-b">
+				<text class="tit">袋装备注</text>
 				<view class="con-list">
-					<input placeholder="请填写包装方式" name="input" @input="addressInput"></input>
+					{{deptList.baggingNotes}}
 				</view>
-			</picker>
-		</view>
-		<view class="c-row b-b">
-			<text class="tit">运费承担方</text>
-			<picker @change="typeChange" :value="typesIndex" :range="typesType" class="con-list">
+			</view>
+			<view class="c-row">
+				<text class="tit">运费承担方</text>
 				<view class="con-list">
-					<input placeholder="请填写包装方式" name="input" @input="addressInput"></input>
+					{{deptList.freightPayer == null || procurementPlanInfos.freightPayer == "" ? "暂无信息":deptList.freightPayer }}
 				</view>
-			</picker>
+			</view>
 		</view>
 	</view>
 </template>
 
 <script>
+	import {
+		mapState
+	} from 'vuex';
 	export default {
 		data() {
 			return {
-				types:'',
-				typesType:["现货","期货"],
-		
+				types: '',
+				goods: {},
+				typesType: ["现货", "期货"],
+				typesIndex: 0,
+				deptList: {
+					priceType: "定价采购",
+					procurementPlanType: "现货",
+					grain: "塔粮",
+					grade: "不限(默认)",
+					outputYear: "2020",
+					packingType: "不限(默认)",
+					freightPayer: "",
+				},
+				params: {
+					province: true,
+					city: true,
+					area: true,
+				},
+				params1: {
+					province: true,
+					city: true,
+				},
+				checked: true,
+				insertProcurementPlanInfo: {},
+				liIndex: 0,
+				liType: ['塔粮', '筛粮', '中粒', '大粒'],
+				pinIndex: 0,
+				pinType: ['不限(默认)', '一等品', '二等品', '三等品', '等外'],
+				nianIndex: 3,
+				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,
+				chengType: ['可议', '买方承担', '卖方承担']
 			}
 		},
+		computed: {
+			...mapState(['hasLogin', 'userInfo'])
+		},
+		onLoad(options) {
+			this.getList(options)
+		},
 		methods: {
-			typeChange(e){
+			getList(options) {
+				this.$api.doRequest('get', '/salePlanInfo/getSalePlanInfo', {
+						id: options.id
+					}).then(res => {
+						if (res.data.code == 200) {
+							this.deptList = res.data.data
+						} else {
+							uni.showToast({
+								title: res.data.message,
+								icon: 'none',
+								duration: 2000
+							})
+						}
+					})
+					.catch(res => {
+						uni.showToast({
+							title: res.errmsg,
+							icon: 'none',
+							duration: 2000
+						})
+					});
+			},
+			regionpicker(e) {
+				this.deptList.sendPrivate = e.province.label
+				this.deptList.sendCity = e.city.label
+				this.deptList.sendArea = 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];
-			}
+				this.deptList.procurementPlanType = this.typesType[this.typesIndex];
+				if (this.typesIndex == 0) {
+					this.deptList.priceType = '定价采购'
+				} else {
+					this.deptList.priceType = '期货盘面价+基差'
+				}
+			},
+			navToDetailPage() {
+				// if (index == 1) {
+				uni.navigateTo({
+					url: `/pageD/myRelease/Identity_switching`
+				})
+			},
+			// liChange(e) {
+			// 	this.liIndex = e.detail.value
+			// 	this.litypes = this.liType[this.liIndex];
+			// 	this.deptList.grain = this.liType[this.liIndex]
+			// },
+			// pinChange(e) {
+			// 	this.pinIndex = e.detail.value
+			// 	this.pintypes = this.pinType[this.pinIndex];
+			// 	this.deptList.grade = this.pinType[this.pinIndex]
+			// },
+			// nianChange(e) {
+			// 	this.nianIndex = e.detail.value
+			// 	this.niantypes = this.nianType[this.nianIndex];
+			// 	this.deptList.outputYear = this.baoType[this.baoIndex]
+			// },
+
+			// baoChange(e) {
+			// 	this.baoIndex = e.detail.value
+			// 	this.baotypes = this.baoType[this.baoIndex];
+			// 	this.deptList.packingType = this.chengType[this.chengIndex];
+			// },
+			// chengChange(e) {
+			// 	this.chengIndex = e.detail.value
+			// 	this.chengtypes = this.chengType[this.chengIndex];
+			// 	this.deptList.freightPayer = this.chengType[this.chengIndex];
+			// }
 		}
 	}
 </script>
 
 <style>
-	.center{
+	.center {
 		padding: 10px 20px;
+		background-color: #F5F6FA;
 	}
+
 	.c-row {
-	    display: -webkit-box;
-	    display: -webkit-flex;
-	    display: flex;
-	    -webkit-box-align: center;
-	    -webkit-align-items: center;
-	    align-items: center;
-	    padding: 20rpx 30rpx;
-	    position: relative;
+		display: -webkit-box;
+		display: -webkit-flex;
+		display: flex;
+		-webkit-box-align: center;
+		-webkit-align-items: center;
+		align-items: center;
+		padding: 20rpx 30rpx;
+		position: relative;
 	}
+
 	.con-list {
-	    -webkit-box-flex: 1;
-	    -webkit-flex: 1;
-	    flex: 1;
-	    display: -webkit-box;
-	    display: -webkit-flex;
-	    display: flex;
-	    -webkit-box-orient: vertical;
-	    -webkit-box-direction: normal;
-	    -webkit-flex-direction: column;
-	    flex-direction: column;
-	    color: #303133;
-	    line-height: 40rpx;
-	    text-align: right;
-	    padding-right: 20rpx;
+		-webkit-box-flex: 1;
+		-webkit-flex: 1;
+		flex: 1;
+		display: -webkit-box;
+		display: -webkit-flex;
+		display: flex;
+		-webkit-box-orient: vertical;
+		-webkit-box-direction: normal;
+		-webkit-flex-direction: column;
+		flex-direction: column;
+		color: #AFB3BF;
+		line-height: 40rpx;
+		text-align: right;
+		padding-right: 20rpx;
 		font-size: 14px;
 	}
-	.title{
-		font-size: 18px;
-		font-weight: 600;
+
+	.buyup {
+		background-color: #FFFFFF;
+		border-radius: 20px;
+		margin-top: 10px;
+	}
+
+	.buylow {
+		background-color: #FFFFFF;
+		border-radius: 20px;
+		margin-top: 10px;
+	}
+
+	.btn {
+		border-radius: 20px;
+		margin-top: 10px;
+		background-color: #22C572;
+		color: #FFFFFF;
 	}
 
+	.validate {
+		width: 100px;
+		height: 32px;
+		background-color: #F5F6F9;
+		color: #AFB3BF;
+		border-radius: 10px;
+		border: none;
+		text-align: center;
+		line-height: 30px;
+	}
 
+	.title {
+		color: #333333;
+		font-size: 16px;
+		font-weight: 600;
+	}
 </style>

+ 647 - 0
pageD/myRelease/sellEdit.vue

@@ -0,0 +1,647 @@
+<template>
+	<view class="center">
+		<view class="buyup">
+			<view class="c-row b-b">
+				<text class="tit">名头</text>
+				<view class="con-list">
+					<text @click="navToDetailPage">{{deptList.procurementPlanNo}}</text>
+				</view>
+			</view>
+			<view class="c-row b-b">
+				<text class="tit">标题</text>
+				<view class="con-list">
+					<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>
+				</view>
+			</view>
+			<view class="c-row b-b">
+				<text class="tit">出货量(吨)</text>
+				<view class="con-list">
+					<input placeholder="请输入采购重量,如1000" name="input" v-model="deptList.plannedSaleVolume"></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>
+				</view>
+			</view>
+			<view class="c-row b-b">
+				<text class="tit">类型</text>
+				<picker @change="typeChange" :value="typesIndex" :range="typesType" class="con-list">
+					<view class="picker" v-model="deptList.salePlanType">
+						{{typesIndex>-1?typesType[typesIndex]:'请选择类型'}}
+					</view>
+				</picker>
+			</view>
+			<view class="c-row b-b">
+				<text class="tit">价格类型</text>
+				<view class="con-list">
+					<input placeholder="请填写价格类型" name="input" v-model="deptList.priceType"></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.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>
+				</view>
+			</view>
+			<view 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 class="c-row b-b">
+				<text class="tit">发货地区</text>
+				<view class="con-list">
+					<view @click='regionchange'>{{region}}</view>
+					<u-picker :params='params' @confirm='regionpicker' mode="region" v-model="show"></u-picker>
+				</view>
+			</view>
+			<view class="c-row ">
+				<text class="tit">卖方手机号</text>
+				<view class="con-list">
+					<input placeholder="请输入买方手机号" name="input" v-model="deptList.sellerPhone"></input>
+				</view>
+			</view>
+		</view>
+		<view class="buylow">
+			<view class="c-row ">
+				<checkbox style='transform: scale(0.8);' :checked="checked" @click='checkedbox'></checkbox><text
+					style="font-size: 14px; ">完善更多信息<text
+						style="font-size: 10px; color: #AFB3BF;">(选填,可由客服人员代为完善)</text></text>
+			</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 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 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 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> -->
+							{{deptList.impurity}}
+						</view>
+			</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.mildewGrain"></input>
+						</view>
+			</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.imperfectGrain"></input>
+						</view>
+			</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.protein"></input>
+						</view>
+			</view>
+			<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">
+						{{liIndex>-1?liType[liIndex]:'请选择粒型'}}
+					</view>
+				</picker>
+			</view>
+			<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">
+						{{pinIndex>-1?pinType[pinIndex]:'请选择品级'}}
+					</view>
+				</picker>
+			</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">
+						{{nianIndex>-1?nianType[nianIndex]:'请选择产出年份'}}
+					</view>
+				</picker>
+			</view>
+			<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">
+						{{baoIndex>-1?baoType[baoIndex]:'请选择包装方式'}}
+					</view>
+				</picker>
+			</view>
+			<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 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">
+						{{chengIndex>-1?chengType[chengIndex]:'请选择运费承担方'}}
+					</view>
+				</picker>
+			</view>
+		</view>
+
+		<button @click="commit()" class="btn">重新发布</button>
+	</view>
+</template>
+
+<script>
+	import {
+		mapState
+	} from 'vuex';
+	export default {
+		data() {
+			return {
+				types: '',
+				goods: {},
+				typesType: ["现货", "期货"],
+				typesIndex: 0,
+				deptList: {
+					priceType: "定价采购",
+					procurementPlanType: "现货",
+					grain: "塔粮",
+					grade: "不限(默认)",
+					outputYear: "2020",
+					packingType: "不限(默认)",
+					freightPayer: "",
+				},
+				params: {
+					province: true,
+					city: true,
+					area: true,
+				},
+				params1: {
+					province: true,
+					city: true,
+				},
+				checked: true,
+				insertProcurementPlanInfo: {},
+				liIndex: 0,
+				liType: ['塔粮', '筛粮', '中粒', '大粒'],
+				pinIndex: 0,
+				pinType: ['不限(默认)', '一等品', '二等品', '三等品', '等外'],
+				nianIndex: 3,
+				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,
+				chengType: ['可议', '买方承担', '卖方承担']
+			}
+		},
+		computed: {
+			...mapState(['hasLogin', 'userInfo'])
+		},
+		onLoad(options) {
+			this.getList(options)
+		},
+		// 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: {
+			getList(options) {
+				this.$api.doRequest('get', '/salePlanInfo/getSalePlanInfo', {
+						id: options.id
+					}).then(res => {
+						if (res.data.code == 200) {
+							this.deptList = res.data.data
+							if (this.deptList.waterContent != null || this.deptList.bulkDensity != null || this
+								.deptList.jiaorenli != null || this.deptList.impurity != null || this.deptList
+								.mildewGrain != null || this.deptList.imperfectGrain != null || this.deptList
+								.protein != null || this.deptList.grade != null || this.deptList.outputYear != null ||
+								this.deptList.packingType != null || this.deptList.freightPayer != null) {
+								this.checked = false
+							}
+							this.region1=this.deptList.outputPrivate+'-'+this.deptList.outputCity
+							this.region=this.deptList.sendPrivate+'-'+this.deptList.sendCity+'-'+this.deptList.sendArea
+							if(this.deptList.salePlanTypeKey==2){
+								this.typesIndex = 1
+							}else if(this.deptList.salePlanTypeKey==1){
+								this.typesIndex =0
+							}
+							if(this.deptList.grainKey==1){
+								this.liIndex=0
+							}else if(this.deptList.grainKey==2){
+								this.liIndex=1
+							}else if(this.deptList.grainKey==3){
+								this.liIndex=2
+							}else if(this.deptList.grainKey==4){
+								this.liIndex=3
+							}else if(this.deptList.grainKey==5){
+								this.liIndex=4
+							}
+							this.baoIndex=this.deptList.packingTypeKey
+							  this.pinIndex=this.deptList.gradeKey
+							if(this.deptList.freightPayerKey==1){
+								this.chengIndex=0
+							}else if(this.deptList.freightPayerKey==2){
+								this.chengIndex=1
+							}else if(this.deptList.freightPayerKey==3){
+								this.chengIndex=2
+							}
+						} else {
+							uni.showToast({
+								title: res.data.message,
+								icon: 'none',
+								duration: 2000
+							})
+						}
+
+					})
+					.catch(res => {
+						uni.showToast({
+							title: res.errmsg,
+							icon: 'none',
+							duration: 2000
+						})
+					});
+			},
+			regionpicker(e) {
+				this.deptList.sendPrivate = e.province.label
+				this.deptList.sendCity = e.city.label
+				this.deptList.sendArea = 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];
+				this.deptList.salePlanTypeKey = e.detail.value+1
+				this.deptList.salePlanType = this.typesType[this.typesIndex];
+				if (this.typesIndex == 0) {
+					this.deptList.priceType = '定价采购'
+				} else {
+					this.deptList.priceType = '期货盘面价+基差'
+				}
+
+			},
+			navToDetailPage() {
+				// if (index == 1) {
+				uni.navigateTo({
+					url: `/pageD/myRelease/Identity_switching`
+				})
+			},
+			commit() {
+				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.deptList.plannedSaleVolume) {
+					this.$api.msg('出货量不能为空')
+					return
+				}
+				if (this.deptList.plannedSaleVolume > 100000 || this.deptList.plannedSaleVolume < 1) {
+					this.$api.msg('出货量输入错误')
+					return
+				}
+				if (this.deptList.plannedSaleVolume.toString().indexOf('.') != -1) {
+					if (this.deptList.plannedSaleVolume.split('.')[1].length > 2) {
+						this.$api.msg('出货量输入错误')
+						return
+					}
+				}
+				if (!this.deptList.minimumVolume) {
+					this.$api.msg('最小成交量不能为空')
+					return
+				}
+				if (this.deptList.minimumVolume > 100000 || this.deptList.minimumVolume < 1) {
+					this.$api.msg('最小成交量输入错误')
+					return
+				}
+				if (this.deptList.minimumVolume.toString().indexOf('.') != -1) {
+					if (this.deptList.minimumVolume.split('.')[1].length > 2) {
+						this.$api.msg('最小成交量输入错误')
+						return
+					}
+				}
+				if (!this.deptList.salePlanType) {
+					this.$api.msg('类型不能为空')
+					return
+				}
+				if (!this.deptList.priceType) {
+					this.$api.msg('价格类型不能为空')
+					return
+				}
+				if (this.deptList.salePlanType == '现货') {
+					if (!this.deptList.unitPrice) {
+						this.$api.msg('单价不能为空')
+						return
+					}
+					if (this.deptList.unitPrice > 100000 || this.deptList.unitPrice < 1) {
+						this.$api.msg('单价输入错误')
+						return
+					}
+					if (this.deptList.unitPrice.indexOf('.') != -1) {
+						if (this.deptList.unitPrice.split('.')[1].length > 2) {
+							this.$api.msg('单价输入错误')
+							return
+						}
+					}
+				} else if (this.deptList.salePlanType == '期货') {
+					if (!this.deptList.basisPrice) {
+						this.$api.msg('基差(元/吨)不能为空')
+						return
+					}
+					// if (this.deptList.basisPrice > 10000 || this.deptList.basisPrice < 1) {
+					// 	this.$api.msg('基差输入错误')
+					// 	return
+					// }
+					// if (this.deptList.basisPrice.indexOf('.') != -1) {
+					// 	if (this.deptList.basisPrice.split('.')[1].length > 2) {
+					// 		this.$api.msg('基差输入错误')
+					// 		return
+					// 	}
+					// }
+				}
+				
+				if (!this.deptList.sellerPhone) {
+					this.$api.msg('卖方手机号不能为空')
+					return
+				}
+				
+				if (this.checked == false) {
+					if (this.deptList.waterContent && this.deptList.waterContent < 1 ||
+						this.deptList.waterContent && this.deptList.waterContent > 40) {
+						this.$api.msg('水分输入错误')
+						return
+					}
+					if (this.deptList.waterContent && this.deptList.waterContent.indexOf('.') != -1) {
+						if (this.deptList.waterContent.split('.')[1].length > 2) {
+							this.$api.msg('水分输入错误')
+							return
+						}
+					}
+					if (this.deptList.bulkDensity && this.deptList.bulkDensity < 500 ||
+						this.deptList.bulkDensity && this.deptList.bulkDensity > 1000) {
+						this.$api.msg('容重输入错误')
+						return
+					}
+					if (this.deptList.jiaorenli && this.deptList.jiaorenli < 1 ||
+						this.deptList.jiaorenli && this.deptList.jiaorenli > 40) {
+						this.$api.msg('热损伤输入错误')
+						return
+					}
+					if (this.deptList.jiaorenli && this.deptList.jiaorenli.indexOf('.') != -1) {
+						if (this.deptList.jiaorenli.split('.')[1].length > 2) {
+							this.$api.msg('热损伤输入错误')
+							return
+						}
+					}
+					if (this.deptList.impurity && this.deptList.impurity < 1 ||
+						this.deptList.impurity && this.deptList.impurity > 40) {
+						this.$api.msg('杂质输入错误')
+						return
+					}
+					if (this.deptList.impurity && this.deptList.impurity.indexOf('.') != -1) {
+						if (this.deptList.impurity.split('.')[1].length > 2) {
+							this.$api.msg('杂质输入错误')
+							return
+						}
+					}
+					if (this.deptList.mildewGrain && this.deptList.mildewGrain < 1 ||
+						this.deptList.mildewGrain && this.deptList.mildewGrain > 40) {
+						this.$api.msg('霉变粒输入错误')
+						return
+					}
+					if (this.deptList.mildewGrain && this.deptList.mildewGrain.indexOf('.') != -1) {
+						if (this.deptList.mildewGrain.split('.')[1].length > 2) {
+							this.$api.msg('霉变粒输入错误')
+							return
+						}
+					}
+					if (this.deptList.imperfectGrain && this.deptList.imperfectGrain < 1 ||
+						this.deptList.imperfectGrain && this.deptList.imperfectGrain > 40) {
+						this.$api.msg('不完整粒输入错误')
+						return
+					}
+					if (this.deptList.imperfectGrain && this.deptList.imperfectGrain.indexOf('.') != -1) {
+						if (this.deptList.imperfectGrain.split('.')[1].length > 2) {
+							this.$api.msg('不完整粒输入错误')
+							return
+						}
+					}
+					if (this.deptList.protein && this.deptList.protein < 1 ||
+						this.deptList.protein && this.deptList.protein > 80) {
+						this.$api.msg('蛋白输入错误')
+						return
+					}
+					if (this.deptList.protein && this.deptList.protein.indexOf('.') != -1) {
+						if (this.deptList.protein.split('.')[1].length > 2) {
+							this.$api.msg('蛋白输入错误')
+							return
+						}
+					}
+				}
+				this.insertProcurementPlanInfo = this.deptList
+				this.insertProcurementPlanInfo.basisPrice = -this.insertProcurementPlanInfo.basisPrice
+				this.insertProcurementPlanInfo.commonId = this.userInfo.id
+				this.insertProcurementPlanInfo.compId = "2710b21efc1e4393930c5dc800010dc4"
+				this.$api.doRequest('post', '/salePlanInfo/api/editSalePlanInfo', this
+						.insertProcurementPlanInfo).then(res => {
+						if (res.data.code == 200) {
+							uni.showToast({
+								title: "发布成功",
+								icon: 'none',
+							})
+							// setTimeout(() => {
+							// 	uni.navigateBack({})
+							// }, 1000)
+							this.deptList = {}
+							uni.navigateTo({
+								url: `/pages/release/release`
+							})
+						} else {
+							uni.showToast({
+								title: res.data.message,
+								icon: 'none',
+								duration: 2000
+							})
+						}
+
+					})
+					.catch(res => {
+						uni.showToast({
+							title: res.errmsg,
+							icon: 'none',
+							duration: 2000
+						})
+					});
+			},
+			liChange(e) {
+				this.liIndex = e.detail.value
+				this.litypes = this.liType[this.liIndex];
+				this.deptList.grainKey = e.detail.value+1
+				this.deptList.grain = this.liType[this.liIndex]
+			},
+			pinChange(e) {
+				this.pinIndex = e.detail.value
+				this.pintypes = this.pinType[this.pinIndex];
+				this.deptList.gradeKey = e.detail.value+1
+				this.deptList.grade = this.pinType[this.pinIndex]
+			},
+			nianChange(e) {
+				this.nianIndex = e.detail.value
+				this.niantypes = this.nianType[this.nianIndex];
+				this.deptList.outputYear = this.baoType[this.baoIndex]
+			},
+
+			baoChange(e) {
+				this.baoIndex = e.detail.value
+				this.baotypes = this.baoType[this.baoIndex];
+				this.deptList.packingTypeKey = e.detail.value
+				this.deptList.packingType = this.baoType[this.baoIndex];
+			},
+			chengChange(e) {
+				this.chengIndex = e.detail.value
+				this.chengtypes = this.chengType[this.chengIndex];
+					this.deptList.freightPayerKey = e.detail.value+1
+				this.deptList.freightPayer = this.chengType[this.chengIndex];
+			}
+		}
+	}
+</script>
+
+<style>
+	.center {
+		padding: 10px 20px;
+		background-color: #F5F6FA;
+	}
+
+	.c-row {
+		display: -webkit-box;
+		display: -webkit-flex;
+		display: flex;
+		-webkit-box-align: center;
+		-webkit-align-items: center;
+		align-items: center;
+		padding: 20rpx 30rpx;
+		position: relative;
+	}
+
+	.con-list {
+		-webkit-box-flex: 1;
+		-webkit-flex: 1;
+		flex: 1;
+		display: -webkit-box;
+		display: -webkit-flex;
+		display: flex;
+		-webkit-box-orient: vertical;
+		-webkit-box-direction: normal;
+		-webkit-flex-direction: column;
+		flex-direction: column;
+		color: #AFB3BF;
+		line-height: 40rpx;
+		text-align: right;
+		padding-right: 20rpx;
+		font-size: 14px;
+	}
+
+	.buyup {
+		background-color: #FFFFFF;
+		border-radius: 20px;
+		margin-top: 10px;
+	}
+
+	.buylow {
+		background-color: #FFFFFF;
+		border-radius: 20px;
+		margin-top: 10px;
+	}
+
+	.btn {
+		border-radius: 20px;
+		margin-top: 10px;
+		background-color: #22C572;
+		color: #FFFFFF;
+	}
+
+	.validate {
+		width: 100px;
+		height: 32px;
+		background-color: #F5F6F9;
+		color: #AFB3BF;
+		border-radius: 10px;
+		border: none;
+		text-align: center;
+		line-height: 30px;
+	}
+</style>

+ 548 - 192
pageD/myRelease/sellGrain.vue

@@ -1,250 +1,606 @@
 <template>
 	<view class="center">
-		<view class="c-row b-b">
-			<text class="tit">名头</text>
-			<view class="con-list">
-				<input placeholder="请填写名头" name="input" @input="addressInput"></input>
-			</view>
-		</view>
-		<view class="c-row b-b">
-			<text class="tit">标题</text>
-			<view class="con-list">
-				<input placeholder="请填写标题,2-16个子" name="input" @input="addressInput"></input>
-			</view>
-		</view>
-		<view class="c-row b-b">
-			<text class="tit">货名</text>
-			<view class="con-list">
-				<input placeholder="请填写货名" name="input" @input="addressInput"></input>
-			</view>
-		</view>
-		<view class="c-row b-b">
-			<text class="tit">出售量(吨)</text>
-			<view class="con-list">
-				<input placeholder="请填写出售重量" name="input" @input="addressInput"></input>
-			</view>
-		</view>
-		<view class="c-row b-b">
-			<text class="tit">最小成交量(吨)</text>
-			<view class="con-list">
-				<input placeholder="请填写最小成交量" name="input" @input="addressInput"></input>
-			</view>
-		</view>
-		<view class="c-row b-b">
-			<text class="tit">类型</text>
-			<picker @change="typeChange" :value="typesIndex" :range="typesType" class="con-list">
-				<view class="picker">
-					{{typesIndex>-1?typesType[typesIndex]:'请选择类型'}}
-				</view>
-			</picker>
-		</view>
-		<view class="c-row b-b">
-			<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>
-				</view>
-			</picker>
-		</view>
-		<view class="c-row b-b">
-			<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>
-				</view>
-			</picker>
-		</view>
-		<view class="c-row b-b">
-			<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>
-				</view>
-			</picker>
-		</view>
-		<view class="c-row b-b">
-			<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>
-				</view>
-			</picker>
-		</view>
-		<view class="c-row b-b">
-			<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>
-				</view>
-			</picker>
-		</view>
-		<view class="c-row b-b">
-			<button type="default">获取验证码</button>
-			<picker @change="typeChange" :value="typesIndex" :range="typesType" class="con-list">
-				<view class="con-list">
-					<input placeholder="请填写6位短信验证码" name="input" @input="addressInput"></input>
-				</view>
-			</picker>
-		</view>
-		<view class="c-row b-b">
-			<text class="tit">水分(%)<= </text>
-			<picker @change="typeChange" :value="typesIndex" :range="typesType" class="con-list">
+		<view class="buyup">
+			<view class="c-row b-b">
+				<text class="tit">名头</text>
 				<view class="con-list">
-					<input placeholder="请填写水分占比" name="input" @input="addressInput"></input>
+					<text @click="navToDetailPage">{{deptList.procurementPlanNo}}</text>
 				</view>
-			</picker>
-		</view>
-		<view class="c-row b-b">
-			<text class="tit">容重(g/L)<= </text>
-			<picker @change="typeChange" :value="typesIndex" :range="typesType" class="con-list">
+			</view>
+			<view class="c-row b-b">
+				<text class="tit">标题</text>
 				<view class="con-list">
-					<input placeholder="请填写容重" name="input" @input="addressInput"></input>
+					<input maxlength='16' minlength='2' placeholder="请输入标题,不超过16个字" name="input"
+						v-model="deptList.title"></input>
 				</view>
-			</picker>
-		</view>
-
-		<view class="c-row b-b">
-			<text class="tit">热损伤(%)<= </text>
-			<picker @change="typeChange" :value="typesIndex" :range="typesType" class="con-list">
+			</view>
+			<view class="c-row b-b">
+				<text class="tit">货名</text>
 				<view class="con-list">
-					<input placeholder="请填写热损伤占比" name="input" @input="addressInput"></input>
+					<input placeholder="请输入货名,如玉米" name="input" v-model="deptList.goodsName"></input>
 				</view>
-			</picker>
-		</view>
-		<view class="c-row b-b">
-			<text class="tit">杂质(%)<= </text>
-			<picker @change="typeChange" :value="typesIndex" :range="typesType" class="con-list">
+			</view>
+			<view class="c-row b-b">
+				<text class="tit">出货量(吨)</text>
 				<view class="con-list">
-					<input placeholder="请填写杂质占比" name="input" @input="addressInput"></input>
+					<input placeholder="请输入采购重量,如1000" name="input" v-model="deptList.plannedSaleVolume"></input>
 				</view>
-			</picker>
-		</view>
-		<view class="c-row b-b">
-			<text class="tit">霉变粒(%)<= </text>
-			<picker @change="typeChange" :value="typesIndex" :range="typesType" class="con-list">
+			</view>
+			<view class="c-row b-b">
+				<text class="tit">最小成交量(吨)</text>
 				<view class="con-list">
-					<input placeholder="请填写霉变粒占比" name="input" @input="addressInput"></input>
+					<input placeholder="请输入最小成交量" name="input" v-model="deptList.minimumVolume"></input>
 				</view>
-			</picker>
-		</view>
-		<view class="c-row b-b">
-			<text class="tit">不完整粒(%)<= </text>
-			<picker @change="typeChange" :value="typesIndex" :range="typesType" class="con-list">
+			</view>
+			<view class="c-row b-b">
+				<text class="tit">类型</text>
+				<picker @change="typeChange" :value="typesIndex" :range="typesType" class="con-list">
+					<view class="picker" v-model="deptList.salePlanType">
+						{{typesIndex>-1?typesType[typesIndex]:'请选择类型'}}
+					</view>
+				</picker>
+			</view>
+			<view class="c-row b-b">
+				<text class="tit">价格类型</text>
 				<view class="con-list">
-					<input placeholder="请填写不完整粒占比" name="input" @input="addressInput"></input>
+					<!-- <input placeholder="请填写价格类型" name="input"  v-model="deptList.priceType"></input> -->
+					{{deptList.priceType}}
 				</view>
-			</picker>
-		</view>
-		<view class="c-row b-b">
-			<text class="tit">蛋白(%)<= </text>
-			<picker @change="typeChange" :value="typesIndex" :range="typesType" class="con-list">
+			</view>
+			<view class="c-row b-b" v-if="this.typesIndex == 0">
+				<text class="tit">单价(元/吨)</text>
 				<view class="con-list">
-					<input placeholder="请填写蛋白占比" name="input" @input="addressInput"></input>
+					<input placeholder="请填写单价" name="input" v-model="deptList.unitPrice"></input>
 				</view>
-			</picker>
-		</view>
-		<view class="c-row b-b">
-			<text class="tit">粒型 </text>
-			<picker @change="typeChange" :value="typesIndex" :range="typesType" class="con-list">
+			</view>
+			<view class="c-row b-b" v-if="this.typesIndex == 1">
+				<text class="tit">基差(元/吨)</text>
 				<view class="con-list">
-					<input placeholder="请填写粒型" name="input" @input="addressInput"></input>
+					<input placeholder="请输入基差" name="input" v-model="deptList.basisPrice"></input>
 				</view>
-			</picker>
-		</view>
-		<view class="c-row b-b">
-			<text class="tit">品级 </text>
-			<picker @change="typeChange" :value="typesIndex" :range="typesType" class="con-list">
+			</view>
+			<view class="c-row b-b">
+				<text class="tit">产地</text>
 				<view class="con-list">
-					<input placeholder="请填写品级" name="input" @input="addressInput"></input>
+					<view @click='regionchange1'>{{region1}}</view>
+					<u-picker :params='params1' @confirm='regionpicker1' mode="region" v-model="show1"></u-picker>
 				</view>
-			</picker>
-		</view>
-		<view class="c-row b-b">
-			<text class="tit">产出年份</text>
-			<picker @change="typeChange" :value="typesIndex" :range="typesType" class="con-list">
+			</view>
+			<view class="c-row b-b">
+				<text class="tit">发货地区</text>
 				<view class="con-list">
-					<input placeholder="请填写产出年份" name="input" @input="addressInput"></input>
+					<view @click='regionchange'>{{region}}</view>
+					<u-picker :params='params' @confirm='regionpicker' mode="region" v-model="show"></u-picker>
 				</view>
-			</picker>
-		</view>
-		<view class="c-row b-b">
-			<text class="tit">包装方式</text>
-			<picker @change="typeChange" :value="typesIndex" :range="typesType" class="con-list">
+			</view>
+			<view class="c-row b-b">
+				<text class="tit">卖方手机号</text>
 				<view class="con-list">
-					<input placeholder="请填写包装方式" name="input" @input="addressInput"></input>
+					<input placeholder="请输入买方手机号" name="input" v-model="deptList.sellerPhone"></input>
 				</view>
-			</picker>
-		</view>
-		<view class="c-row b-b">
-			<text class="tit">袋装备注</text>
-			<picker @change="typeChange" :value="typesIndex" :range="typesType" class="con-list">
+			</view>
+			<view class="c-row ">
+				<text class="validate">获取验证码</text>
 				<view class="con-list">
-					<input placeholder="请填写包装方式" name="input" @input="addressInput"></input>
+					<input placeholder="请填写6位短信验证码" name="input" v-model="deptList.title1"></input>
 				</view>
-			</picker>
+			</view>
 		</view>
-		<view class="c-row b-b">
-			<text class="tit">运费承担方</text>
-			<picker @change="typeChange" :value="typesIndex" :range="typesType" class="con-list">
+		<view class="buylow">
+
+
+			<view class="c-row ">
+				<checkbox style='transform: scale(0.8);' :checked="checked" @click='checkedbox'></checkbox><text
+					style="font-size: 14px; ">完善更多信息<text
+						style="font-size: 10px; color: #AFB3BF;">(选填,可由客服人员代为完善)</text></text>
+			</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 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 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 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 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 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 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 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">
+						{{liIndex>-1?liType[liIndex]:'请选择粒型'}}
+					</view>
+				</picker>
+			</view>
+			<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">
+						{{pinIndex>-1?pinType[pinIndex]:'请选择品级'}}
+					</view>
+				</picker>
+			</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">
+						{{nianIndex>-1?nianType[nianIndex]:'请选择产出年份'}}
+					</view>
+				</picker>
+			</view>
+			<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">
+						{{baoIndex>-1?baoType[baoIndex]:'请选择包装方式'}}
+					</view>
+				</picker>
+			</view>
+			<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" @input="addressInput"></input>
+					<input placeholder="请填写袋装备注" name="input" v-model="deptList.baggingNotes"></input>
 				</view>
-			</picker>
+			</view>
+			<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">
+						{{chengIndex>-1?chengType[chengIndex]:'请选择运费承担方'}}
+					</view>
+				</picker>
+			</view>
 		</view>
-		
-		<button type="default">发布</button>
+
+		<button @click="commit()" class="btn">发布</button>
 	</view>
 </template>
 
 <script>
+	import {
+		mapState
+	} from 'vuex';
 	export default {
 		data() {
 			return {
-				types:'',
-				typesType:["现货","期货"],
-		
+				types: '',
+				goods: {},
+				typesType: ["现货", "期货"],
+				typesIndex: 0,
+				deptList: {
+					salePlanTypeKey:0,
+					grainKey:0,
+					gradeKey:0,
+					packingTypeKey:0,
+					freightPayerKey:-1,
+					priceType: "定价采购",
+					procurementPlanType: "现货",
+					grain: "塔粮",
+					grade: "不限(默认)",
+					outputYear: "2020",
+					packingType: "不限(默认)",
+					freightPayer: "",
+				},
+				params: {
+					province: true,
+					city: true,
+					area: true,
+				},
+				params1: {
+					province: true,
+					city: true,
+				},
+				checked: true,
+				insertProcurementPlanInfo: {},
+				liIndex: 0,
+				liType: ['塔粮', '筛粮', '中粒', '大粒'],
+				pinIndex: 0,
+				pinType: ['不限(默认)', '一等品', '二等品', '三等品', '等外'],
+				nianIndex: 3,
+				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,
+				chengType: ['可议', '买方承担', '卖方承担']
 			}
 		},
+		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: {
-			typeChange(e){
+			regionpicker(e) {
+				this.deptList.sendPrivate = e.province.label
+				this.deptList.sendCity = e.city.label
+				this.deptList.sendArea = 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];
+				this.deptList.salePlanTypeKey = e.detail.value+1
+				this.deptList.salePlanType = this.typesType[this.typesIndex];
+				if (this.typesIndex == 0) {
+					this.deptList.priceType = '定价采购'
+				} else {
+					this.deptList.priceType = '期货盘面价+基差'
+				}
+
+			},
+			navToDetailPage() {
+				// if (index == 1) {
+				uni.navigateTo({
+					url: `/pageD/myRelease/Identity_switching`
+				})
+			},
+			commit() {
+
+				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.deptList.plannedSaleVolume) {
+					this.$api.msg('出货量不能为空')
+					return
+				}
+				if (this.deptList.plannedSaleVolume > 100000 || this.deptList.plannedSaleVolume < 1) {
+					this.$api.msg('出货量输入错误')
+					return
+				}
+				if (this.deptList.plannedSaleVolume.indexOf('.') != -1) {
+					if (this.deptList.plannedSaleVolume.split('.')[1].length > 2) {
+						this.$api.msg('出货量输入错误')
+						return
+					}
+				}
+				if (!this.deptList.minimumVolume) {
+					this.$api.msg('最小成交量不能为空')
+					return
+				}
+				if (this.deptList.minimumVolume > 100000 || this.deptList.minimumVolume < 1) {
+					this.$api.msg('最小成交量输入错误')
+					return
+				}
+				if (this.deptList.minimumVolume.indexOf('.') != -1) {
+					if (this.deptList.minimumVolume.split('.')[1].length > 2) {
+						this.$api.msg('最小成交量输入错误')
+						return
+					}
+				}
+				if (!this.deptList.salePlanType) {
+					this.$api.msg('类型不能为空')
+					return
+				}
+				if (!this.deptList.priceType) {
+					this.$api.msg('价格类型不能为空')
+					return
+				}
+				if (this.deptList.salePlanType == '现货') {
+					if (!this.deptList.unitPrice) {
+						this.$api.msg('单价不能为空')
+						return
+					}
+					if (this.deptList.unitPrice > 100000 || this.deptList.unitPrice < 1) {
+						this.$api.msg('单价输入错误')
+						return
+					}
+					if (this.deptList.unitPrice.indexOf('.') != -1) {
+						if (this.deptList.unitPrice.split('.')[1].length > 2) {
+							this.$api.msg('单价输入错误')
+							return
+						}
+					}
+				} else if (this.deptList.salePlanType == '期货') {
+					if (!this.deptList.basisPrice) {
+						this.$api.msg('基差(元/吨)不能为空')
+						return
+					}
+					if (this.deptList.basisPrice > 10000 || this.deptList.basisPrice < 1) {
+						this.$api.msg('基差输入错误')
+						return
+					}
+					if (this.deptList.basisPrice.indexOf('.') != -1) {
+						if (this.deptList.basisPrice.split('.')[1].length > 2) {
+							this.$api.msg('基差输入错误')
+							return
+						}
+					}
+				}
+
+				if (!this.deptList.sellerPhone) {
+					this.$api.msg('卖方手机号不能为空')
+					return
+				}
+
+				if (this.checked == false) {
+					if (this.deptList.waterContent && this.deptList.waterContent < 1 ||
+						this.deptList.waterContent && this.deptList.waterContent > 40) {
+						this.$api.msg('水分输入错误')
+						return
+					}
+					if (this.deptList.waterContent && this.deptList.waterContent.indexOf('.') != -1) {
+						if (this.deptList.waterContent.split('.')[1].length > 2) {
+							this.$api.msg('水分输入错误')
+							return
+						}
+					}
+					if (this.deptList.bulkDensity && this.deptList.bulkDensity < 500 ||
+						this.deptList.bulkDensity && this.deptList.bulkDensity > 1000) {
+						this.$api.msg('容重输入错误')
+						return
+					}
+					if (this.deptList.jiaorenli && this.deptList.jiaorenli < 1 ||
+						this.deptList.jiaorenli && this.deptList.jiaorenli > 40) {
+						this.$api.msg('热损伤输入错误')
+						return
+					}
+					if (this.deptList.jiaorenli && this.deptList.jiaorenli.indexOf('.') != -1) {
+						if (this.deptList.jiaorenli.split('.')[1].length > 2) {
+							this.$api.msg('热损伤输入错误')
+							return
+						}
+					}
+					if (this.deptList.impurity && this.deptList.impurity < 1 ||
+						this.deptList.impurity && this.deptList.impurity > 40) {
+						this.$api.msg('杂质输入错误')
+						return
+					}
+					if (this.deptList.impurity && this.deptList.impurity.indexOf('.') != -1) {
+						if (this.deptList.impurity.split('.')[1].length > 2) {
+							this.$api.msg('杂质输入错误')
+							return
+						}
+					}
+					if (this.deptList.mildewGrain && this.deptList.mildewGrain < 1 ||
+						this.deptList.mildewGrain && this.deptList.mildewGrain > 40) {
+						this.$api.msg('霉变粒输入错误')
+						return
+					}
+					if (this.deptList.mildewGrain && this.deptList.mildewGrain.indexOf('.') != -1) {
+						if (this.deptList.mildewGrain.split('.')[1].length > 2) {
+							this.$api.msg('霉变粒输入错误')
+							return
+						}
+					}
+					if (this.deptList.imperfectGrain && this.deptList.imperfectGrain < 1 ||
+						this.deptList.imperfectGrain && this.deptList.imperfectGrain > 40) {
+						this.$api.msg('不完整粒输入错误')
+						return
+					}
+					if (this.deptList.imperfectGrain && this.deptList.imperfectGrain.indexOf('.') != -1) {
+						if (this.deptList.imperfectGrain.split('.')[1].length > 2) {
+							this.$api.msg('不完整粒输入错误')
+							return
+						}
+					}
+					if (this.deptList.protein && this.deptList.protein < 1 ||
+						this.deptList.protein && this.deptList.protein > 80) {
+						this.$api.msg('蛋白输入错误')
+						return
+					}
+					if (this.deptList.protein && this.deptList.protein.indexOf('.') != -1) {
+						if (this.deptList.protein.split('.')[1].length > 2) {
+							this.$api.msg('蛋白输入错误')
+							return
+						}
+					}
+				}
+				this.insertProcurementPlanInfo = this.deptList
+				this.insertProcurementPlanInfo.basisPrice = -this.insertProcurementPlanInfo.basisPrice
+				this.insertProcurementPlanInfo.commonId = this.userInfo.id
+				this.insertProcurementPlanInfo.compId = "2710b21efc1e4393930c5dc800010dc4"
+				this.$api.doRequest('post', '/salePlanInfo/api/insertSalePlanInfo', this
+						.insertProcurementPlanInfo).then(res => {
+						if (res.data.code == 200) {
+							uni.showToast({
+								title: "发布成功",
+								icon: 'none',
+							})
+							// setTimeout(() => {
+							// 	uni.navigateBack({})
+							// }, 1000)
+							this.deptList = {}
+							uni.navigateTo({
+								url: `/pages/release/release`
+							})
+						} else {
+							uni.showToast({
+								title: res.data.message,
+								icon: 'none',
+								duration: 2000
+							})
+						}
+
+					})
+					.catch(res => {
+						uni.showToast({
+							title: res.errmsg,
+							icon: 'none',
+							duration: 2000
+						})
+					});
+			},
+			liChange(e) {
+				this.liIndex = e.detail.value
+				this.litypes = this.liType[this.liIndex];
+				this.deptList.grainKey = e.detail.value+1
+				this.deptList.grain = this.liType[this.liIndex]
+			},
+			pinChange(e) {
+				this.pinIndex = e.detail.value
+				this.pintypes = this.pinType[this.pinIndex];
+				this.deptList.gradeKey = e.detail.value
+				this.deptList.grade = this.pinType[this.pinIndex]
+			},
+			nianChange(e) {
+				this.nianIndex = e.detail.value
+				this.niantypes = this.nianType[this.nianIndex];
+				this.deptList.outputYear = this.baoType[this.baoIndex]
+			},
+
+			baoChange(e) {
+				this.baoIndex = e.detail.value
+				this.baotypes = this.baoType[this.baoIndex];
+				this.deptList.packingTypeKey = e.detail.value
+				this.deptList.packingType = this.baoType[this.baoIndex];
+			},
+			chengChange(e) {
+				this.chengIndex = e.detail.value
+				this.chengtypes = this.chengType[this.chengIndex];
+				this.deptList.freightPayerKey = e.detail.value+1
+				this.deptList.freightPayer = this.chengType[this.chengIndex];
 			}
 		}
 	}
 </script>
 
 <style>
-	.center{
+	.center {
 		padding: 10px 20px;
+		background-color: #F5F6FA;
 	}
+
 	.c-row {
-	    display: -webkit-box;
-	    display: -webkit-flex;
-	    display: flex;
-	    -webkit-box-align: center;
-	    -webkit-align-items: center;
-	    align-items: center;
-	    padding: 20rpx 30rpx;
-	    position: relative;
+		display: -webkit-box;
+		display: -webkit-flex;
+		display: flex;
+		-webkit-box-align: center;
+		-webkit-align-items: center;
+		align-items: center;
+		padding: 20rpx 30rpx;
+		position: relative;
 	}
+
 	.con-list {
-	    -webkit-box-flex: 1;
-	    -webkit-flex: 1;
-	    flex: 1;
-	    display: -webkit-box;
-	    display: -webkit-flex;
-	    display: flex;
-	    -webkit-box-orient: vertical;
-	    -webkit-box-direction: normal;
-	    -webkit-flex-direction: column;
-	    flex-direction: column;
-	    color: #303133;
-	    line-height: 40rpx;
-	    text-align: right;
-	    padding-right: 20rpx;
+		-webkit-box-flex: 1;
+		-webkit-flex: 1;
+		flex: 1;
+		display: -webkit-box;
+		display: -webkit-flex;
+		display: flex;
+		-webkit-box-orient: vertical;
+		-webkit-box-direction: normal;
+		-webkit-flex-direction: column;
+		flex-direction: column;
+		color: #AFB3BF;
+		line-height: 40rpx;
+		text-align: right;
+		padding-right: 20rpx;
 		font-size: 14px;
 	}
 
+	.buyup {
+		background-color: #FFFFFF;
+		border-radius: 20px;
+		margin-top: 10px;
+	}
 
+	.buylow {
+		background-color: #FFFFFF;
+		border-radius: 20px;
+		margin-top: 10px;
+	}
+
+	.btn {
+		border-radius: 20px;
+		margin-top: 10px;
+		background-color: #22C572;
+		color: #FFFFFF;
+	}
+
+	.validate {
+		width: 100px;
+		height: 32px;
+		background-color: #F5F6F9;
+		color: #AFB3BF;
+		border-radius: 10px;
+		border: none;
+		text-align: center;
+		line-height: 30px;
+	}
 </style>

+ 8 - 0
pages.json

@@ -1069,6 +1069,14 @@
 						"enablePullDownRefresh": false
 					}
 
+				},
+				{
+					"path": "myRelease/sellEdit",
+					"style": {
+						"navigationBarTitleText": "卖粮",
+						"enablePullDownRefresh": false
+					}
+				
 				},
 				{
 					"path": "myRelease/buyGrain",

+ 269 - 154
pages/release/release.vue

@@ -1,25 +1,24 @@
 <template>
 	<view class="center">
 		<view class="introduce-section">
-			<view class="informations "  v-for="(item , index) in procurementPlanInfos" :Key="index">
+			<view class="informations " v-for="(item , index) in procurementPlanInfos" :Key="index">
 				<view @click="details(item)">
 					<view class="flex">
-					<view class="logo flex">
-						买粮
+						<view class="logo flex" v-if="item.type == '买粮'">{{item.type}}</view>
+						<view class="logo1 flex" v-if="item.type == '卖粮'">{{item.type}}</view>
+						<!-- <view class="logo flex" >买粮{{item.planType}}</view> -->
+						<text class="grain">{{item.goodsName}}</text>
+						<view class="status">
+							<view v-if='item.status=="已驳回"' class='put2'>未通过</view>
+							<view v-if='item.status=="待审核"' class='put1'>审核中</view>
+							<view v-if='item.status=="已认证"' class='put'>已通过</view>
+						</view>
+					</view>
+					<view class="address">{{item.receivePrivate}}{{item.receiveCity}}{{item.receiveArea}}</view>
+					<view class="flex ">
+						<view class="weight">{{item.weight > 0 ? item.weight : 0}}吨</view>
+						<text class="unitPrice">{{item.unitPrice}} <text class="amount">元/吨</text></text>
 					</view>
-				<text class="grain">{{item.goodsName}}</text>
-				<view class="status">
-					<view v-if='item.status=="已驳回"' class='put2'>未通过</view>
-					<view v-if='item.status=="待审核"' class='put1'>审核中</view>
-					<view v-if='item.status=="已认证"' class='put'>已通过</view>
-				</view>	
-				</view>
-				<view class="address">{{item.receivePrivate}}{{item.receiveCity}}{{item.receiveArea}}</view>
-				<view class="flex ">
-					<view class="weight" >{{item.weight > 0 ? item.weight : 0}}吨</view>
-					<text class="unitPrice">{{item.unitPrice}} <text class="amount">元/吨</text></text>
-					
-				</view>
 				</view>
 				<hr style="margin: 16px 0; color: #EEEEEE;">
 				<view class="flex" style="right: 10px;">
@@ -28,24 +27,11 @@
 					<view class='anniu' @click="switch1(item)" v-if="item.showFlag == 1">显示</view>
 					<view class='anniu' @click="deleteRelease(item)">删除</view>
 				</view>
-				
-				<!-- <view v-if='item.status=="已驳回"' class='cu-tag radius line-pink put'>未通过</view>
-				<view v-if='item.status=="待审核"' class='cu-tag radius line-pink put'>审核中</view>
-				<view v-if='item.status=="已认证"' class='cu-tag radius line-pink put'>已通过</view> -->
 			</view>
 		</view>
-		<!-- <view class="page-bottom">
-			<view class="action-btn-group">
-				<picker style='display:inline-block;' @change="releaseChange" :value="releases" :range="releaseType">
-					<button  type="primary" class=" action-btn no-border add-cart-btn" >发布</button>
-					<view class="picker">
-						{{releases>-1?releaseType[releases]:''}}
-					</view>
-				</picker>
-			</view>
-		</view> -->
-		<picker style='display:inline-block;width: 100%;' @change="releaseChange" :value="releases" :range="releaseType">
-			<button  type="primary" class="btn" >发布</button>
+		<picker style='display:inline-block;width: 100%;' @change="releaseChange" :value="releases"
+			:range="releaseType">
+			<button type="primary" class="btn">发布</button>
 			<view class="picker">
 				{{releases>-1?releaseType[releases]:''}}
 			</view>
@@ -54,124 +40,231 @@
 </template>
 
 <script>
+	import {
+		mapState
+	} from 'vuex';
 	export default {
 		data() {
 			return {
-				releaseType:["我要卖粮","我要买粮"],
-				release:'',
-				releases:'',
-				receivePrivate:'',
-				procurementPlanInfo:{
-					pageSize:10,
-					currentPage:1
+				releaseType: ["我要卖粮", "我要买粮"],
+				release: '',
+				releases: '',
+				receivePrivate: '',
+				procurementPlanInfo: {
+					pageSize: 10,
+					currentPage: 1
 				},
-				releaseIndex:"",
-				pageSize:10,
-				currentPage:1,
-				procurementPlanInfos:[],
+				releaseIndex: "",
+				pageSize: 10,
+				currentPage: 1,
+				procurementPlanInfos: [],
 			}
 		},
-		onLoad(){
+		onLoad() {
 			this.getList()
 		},
+		computed: {
+			...mapState(['hasLogin', 'userInfo'])
+		},
 		methods: {
-			switch1(item){
-				// if (!this.hasLogin) {
+			switch1(item) {
+				if (item.type == "买粮") {
+					var that = this
+					var tips
+					if (item.showFlag == 0) {
+						tips = "隐藏后该信息不再展示给其他用户,是否确定隐藏?"
+					} else if (item.showFlag == 1) {
+						tips = "确定显示该信息?"
+					}
+					uni.showModal({
+						content: tips,
+						showCancel: true,
+						confirmText: '确定',
+						success: function(res) {
+
+							if (res.confirm) {
+								that.$api.doRequest('post', '/procurementPlanInfo/api/editStatus', {
+										id: item.id,
+										flag: 0
+									}).then(res => {
+										// this.procurementPlanInfos = res.data.data.records
+										if (res.data.message == "Success") {
+											if (item.showFlag == 0) {
+												that.$api.msg('隐藏成功!')
+											} else if (item.showFlag == 1) {
+												that.$api.msg('显示成功!')
+											}
+											that.getList()
+											return
+										}
+									})
+									.catch(res => {
+										uni.showToast({
+											title: res.errmsg,
+											icon: 'none',
+											duration: 2000
+										})
+									});
+							} else if (res.cancel) {
+								// console.log('用户点击取消');
+							}
+						},
+					})
+				} else if (item.type == "卖粮") {
+					var that = this
+					var tips
+					if (item.showFlag == 0) {
+						tips = "隐藏后该信息不再展示给其他用户,是否确定隐藏?"
+					} else if (item.showFlag == 1) {
+						tips = "确定显示该信息?"
+					}
+					uni.showModal({
+						content: tips,
+						showCancel: true,
+						confirmText: '确定',
+						success: function(res) {
+
+							if (res.confirm) {
+								that.$api.doRequest('post', '/salePlanInfo/api/editStatus', {
+										id: item.id,
+										flag: 0
+									}).then(res => {
+										// this.procurementPlanInfos = res.data.data.records
+										if (res.data.message == "Success") {
+											if (item.showFlag == 0) {
+												that.$api.msg('隐藏成功!')
+											} else if (item.showFlag == 1) {
+												that.$api.msg('显示成功!')
+											}
+											that.getList()
+											return
+										}
+									})
+									.catch(res => {
+										uni.showToast({
+											title: res.errmsg,
+											icon: 'none',
+											duration: 2000
+										})
+									});
+							} else if (res.cancel) {
+								// console.log('用户点击取消');
+							}
+						},
+					})
+				}
+			},
+			edit(item) {
+				if (item.type == "买粮") {
+
+					uni.navigateTo({
+						url: `/pageD/myRelease/buyEdit?id=${item.id}`
+					})
+				} else if (item.type == "卖粮") {
+					uni.navigateTo({
+						url: `/pageD/myRelease/sellEdit?id=${item.id}`
+					})
+				}
+			},
+			deleteRelease(item) {
+				if (item.type == "买粮") {
 					uni.showModal({
 						// title: '登录提示',
-						content: '隐藏后该信息不再展示给其他用户,是否确定隐藏?',
+						content: '确定删除该信息?',
 						showCancel: true,
 						confirmText: '确定',
 						success: (e) => {
-							this.$api.doRequest('post','/procurementPlanInfo/api/editStatus',{id:item.id,flag:0}).then(res => {		
-								// this.procurementPlanInfos = res.data.data.records
-								console.log(res)
-								if (res.data.message == "Success") {
-									this.$api.msg('隐藏成功!')
+							this.$api.doRequest('post', '/procurementPlanInfo/api/deleteProcurementPlan', {
+									id: item.id
+								}).then(res => {
+									if (res.data.message == "Success") {
+										this.$api.msg('删除成功!')
 										this.getList()
-									return
-								}
-								
-							})
-							.catch(res => {
-								uni.showToast({
-									title: res.errmsg,
-									icon:'none',
-									duration: 2000
+										return
+									}
 								})
-							});
+								.catch(res => {
+									uni.showToast({
+										title: res.errmsg,
+										icon: 'none',
+										duration: 2000
+									})
+								});
 						},
 						fail: () => {},
 						complete: () => {}
 					})
-				// }
-			},
-			edit(item){
-				uni.navigateTo({
-					url: `/pageD/myRelease/buyEdit?id=${item.id}`
-				})
-			},
-			deleteRelease(item){
-				// if (!this.hasLogin) {
+				} else if (item.type == "卖粮") {
 					uni.showModal({
 						// title: '登录提示',
 						content: '确定删除该信息?',
 						showCancel: true,
 						confirmText: '确定',
 						success: (e) => {
-							this.$api.doRequest('post','/procurementPlanInfo/api/deleteProcurementPlan',{id:item.id}).then(res => {
-								if (res.data.message == "Success") {
-									this.$api.msg('删除成功!')
-									this.getList()
-									return
-								}
-								
-							})
-							.catch(res => {
-								uni.showToast({
-									title: res.errmsg,
-									icon:'none',
-									duration: 2000
+							this.$api.doRequest('post', '/salePlanInfo/api/deleteSalePlanInfo', {
+									id: item.id
+								}).then(res => {
+									if (res.data.message == "Success") {
+										this.$api.msg('删除成功!')
+										this.getList()
+										return
+									}
 								})
-							});
+								.catch(res => {
+									uni.showToast({
+										title: res.errmsg,
+										icon: 'none',
+										duration: 2000
+									})
+								});
 						},
 						fail: () => {},
 						complete: () => {}
 					})
-					// }
+
+				}
 			},
-			releaseChange(e){
+			releaseChange(e) {
 				this.receivePrivate = e.detail.value
 				this.release = this.releaseType[this.receivePrivate];
 				this.pageSize = 1
 
-				if(this.release == "我要卖粮"){
+				if (this.release == "我要卖粮") {
 					uni.navigateTo({
 						url: `/pageD/myRelease/sellGrain`
 					})
-				}else if(this.release == "我要买粮"){
+				} else if (this.release == "我要买粮") {
 					uni.navigateTo({
 						url: `/pageD/myRelease/buyGrain`
 					})
 				}
 			},
-			details(item){
-				uni.navigateTo({
-					url: `/pageD/myRelease/buyDetails?id=${item.id}`
-				})
+			details(item) {
+				if (item.type == "买粮") {
+					uni.navigateTo({
+						url: `/pageD/myRelease/buyDetails?id=${item.id}`
+					})
+				} else if (item.type == "卖粮") {
+					uni.navigateTo({
+						url: `/pageD/myRelease/sellDetails?id=${item.id}`
+					})
+				}
 			},
-			getList(){
+
+			getList() {
 				// this.procurementPlanInfo.pcFlag = "1"
-				this.$api.doRequest('get','/procurementPlanInfo/selectProcurementPlanInfo',this.procurementPlanInfo).then(res => {		
-					this.procurementPlanInfos = res.data.data.records
-				})
-				.catch(res => {
-					uni.showToast({
-						title: res.errmsg,
-						icon:'none',
-						duration: 2000
+				this.procurementPlanInfo.commonId = this.userInfo.id
+				this.$api.doRequest('get', '/procurementPlanInfo/selectProcurementPlanInfoAPP', this.procurementPlanInfo)
+					.then(res => {
+						this.procurementPlanInfos = res.data.data.records
 					})
-				});
+					.catch(res => {
+						uni.showToast({
+							title: res.errmsg,
+							icon: 'none',
+							duration: 2000
+						})
+					});
 			}
 
 		}
@@ -181,14 +274,14 @@
 <style>
 	.center {
 		padding: 10px 20px;
-			background-color: #F5F6FA;
+		background-color: #F5F6FA;
 	}
 
 	.informations {
-      background-color: #FFFFFF;
-	  margin-top: 20px;
-	  border-radius: 16px;
-	  padding: 10px;
+		background-color: #FFFFFF;
+		margin-top: 20px;
+		border-radius: 16px;
+		padding: 10px;
 	}
 
 	.labels {
@@ -197,10 +290,11 @@
 		margin-right: 40px;
 	}
 
-	.fabuBut{
+	.fabuBut {
 		margin-bottom: 0px;
 	}
-	.logo{
+
+	.logo {
 		width: 36px;
 		height: 24px;
 		background-color: #FEECE6;
@@ -209,69 +303,90 @@
 		padding: 3px;
 		margin-top: 2px;
 	}
-    .grain{
+
+	.logo1 {
+		width: 36px;
+		height: 24px;
+		background-color: #E9F8F0;
+		color: #22C572;
+		border-radius: 8px;
+		padding: 3px;
+		margin-top: 2px;
+	}
+
+	.grain {
 		font-size: 18px;
 		color: #333333;
 		font-weight: 600;
 		margin-left: 20px;
 	}
-	.address{
+
+	.address {
 		margin-left: 56px;
 		font-size: 14px;
-		color: #333333;	
+		color: #333333;
 	}
-	.weight{
+
+	.weight {
 		margin-left: 56px;
 		font-size: 14px;
 		color: #878C9C;
 	}
-	.unitPrice{
-		
+
+	.unitPrice {
+
 		font-size: 22px;
 		font-weight: 600;
-/* 	margin-left: 200px; */
-position: absolute;
-	/* text-align: right; */
-	right: 40px;
+		/* 	margin-left: 200px; */
+		position: absolute;
+		/* text-align: right; */
+		right: 40px;
 
 	}
+
 	/* .amount{
 		width: 100%;
 	} */
-	.amount{
+	.amount {
 		margin-left: 10px;
 		font-size: 12px;
-		
-		}
-		.status{
-			position: absolute;
-			right: 40px;
-		}
-		.put{
-			color: #22C572;
-			font-size: 14px;
-		}
-		.put1{
-			color: #FE6430;
-			font-size: 14px;
-		}
-		.put2{
-			color: #FB1E1E;
-			font-size: 14px;
-		}
-		.anniu{
-			width: 60px;
-			height: 30px;
-			border: 1px solid #CDCDCD;
-			border-radius: 16px;
-			text-align: center;
-			line-height: 30px;
-			margin-left: 10px;
-		}
-		.btn{
-			width: 100%;
-			border-radius: 20px;
-			background-color: #22C572;
-			margin-top: 10px;
-		}
+
+	}
+
+	.status {
+		position: absolute;
+		right: 40px;
+	}
+
+	.put {
+		color: #22C572;
+		font-size: 14px;
+	}
+
+	.put1 {
+		color: #FE6430;
+		font-size: 14px;
+	}
+
+	.put2 {
+		color: #FB1E1E;
+		font-size: 14px;
+	}
+
+	.anniu {
+		width: 60px;
+		height: 30px;
+		border: 1px solid #CDCDCD;
+		border-radius: 16px;
+		text-align: center;
+		line-height: 30px;
+		margin-left: 10px;
+	}
+
+	.btn {
+		width: 100%;
+		border-radius: 20px;
+		background-color: #22C572;
+		margin-top: 10px;
+	}
 </style>