gjy 3 anos atrás
pai
commit
0e264b4636

+ 0 - 2
pageD/identity/driverIdentity.vue

@@ -46,14 +46,12 @@
 				<button :class='codestatus&&!sendDisabled?"active":""' @click='getcode'
 					class='getcode'>{{sendText}}</button>
 					<view class="con-list">
-						<!-- style='width:70%;position:relative;margin-left: 200px;' -->
 						<input v-model='verifyCode' maxlength = "6"  placeholder="请输入验证码" type="text">
 					</view>
 			</view>
 			<view class="c-row ">
 				<text class="tit">常驻城市</text>
 				<view class="con-list">
-					<!-- <input placeholder="请填写常驻城市" name="input" v-model="DriverViewInfo.residentCityProvincial"></input> -->
 					<view @click='regionchange'>{{region}}</view>
 					<u-picker :params='params' @confirm='regionpicker' mode="region" v-model="show"></u-picker>
 				</view>

+ 141 - 91
pageD/myRelease/buyEdit.vue

@@ -1,11 +1,10 @@
 <template>
 	<view class="center">
-		<view class="area">
-			
+		<view class="area">		
 		<view class="c-row b-b">
 			<text class="tit">名头</text>
 			<view class="con-list">
-				<text @click="navToDetailPage">{{deptList.buyer}}</text>
+				<text @click="navToDetailPage">{{deptList.buyer}}<text class='tip_text cuIcon-right'></text></text>
 			</view>
 		</view>
 		<view class="c-row b-b">
@@ -41,7 +40,6 @@
 		<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>
@@ -57,13 +55,7 @@
 				<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">
@@ -77,60 +69,63 @@
 				<input placeholder="请输入买方手机号" name="input" v-model="deptList.buyerPhone"></input>
 			</view>
 		</view>
-		<view class="c-row ">
-			<button @click='getcode' type="default">{{sendText}}</button>
-			<view class="con-list">
-				<input placeholder="请填写6位短信验证码" name="input" v-model="deptList.title1"></input>
+		<view style='width:100%;position:relative;padding:10px;' class="flex">
+			<button :class='codestatus&&!sendDisabled?"active":""' @click='getcode'
+				class='getcode'>{{sendText}}</button>
+			<view style='width:70%;position:relative;margin-left: 200px;'>
+				<view class="con-list">
+					<input v-model='verifyCode' placeholder="请输入验证码" type="text">
+				</view>
 			</view>
 		</view>
 		</view>
 		<view  class="area">
 		<view class="c-row b-b">
-			<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>
+			<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">
+		<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">
+		<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">
+		<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">
+		<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">
+		<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">
+		<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">
+		<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">
+		<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">
@@ -138,7 +133,7 @@
 				</view>
 			</picker>
 		</view>
-		<view  v-if='checked'  class="c-row b-b">
+		<view  v-if='!checked'  class="c-row b-b">
 			<text class="tit">品级 </text>
 			<picker @change="pinChange" :value="pinIndex" :range="pinType" class="con-list" v-model="deptList.grade">
 				<view class="con-list">
@@ -146,7 +141,14 @@
 				</view>
 			</picker>
 		</view>
-		<view  v-if='checked'  class="c-row b-b">
+		<view v-if='!checked' class="c-row b-b">
+			<text class="tit">产地</text>
+			<view class="con-list">
+				<view @click='regionchange1'>{{region1}}</view>
+				<u-picker :params='params1' @confirm='regionpicker1' mode="region" v-model="show1" ></u-picker>
+			</view>
+		</view>
+		<view  v-if='!checked'  class="c-row b-b">
 			<text class="tit">产出年份</text>
 			<picker @change="nianChange" :value="nianIndex" :range="nianType" class="con-list">
 				<view class="con-list">
@@ -154,7 +156,7 @@
 				</view>
 			</picker>
 		</view>
-		<view  v-if='checked'  class="c-row b-b">
+		<view  v-if='!checked'  class="c-row b-b">
 			<text class="tit">包装方式</text>
 			<picker @change="baoChange" :value="baoIndex" :range="baoType" class="con-list">
 				<view class="con-list">
@@ -162,13 +164,13 @@
 				</view>
 			</picker>
 		</view>
-		<view  v-if='checked&&baoIndex==2||!checked&&baoIndex==3'  class="c-row b-b">
+		<view  v-if='!checked&&baoIndex==2||!checked&&baoIndex==3'  class="c-row b-b">
 			<text class="tit">袋装备注</text>
 				<view class="con-list">
 					<input placeholder="请填写袋装备注" name="input" v-model="deptList.baggingNotes"></input>
 				</view>
 		</view>
-		<view  v-if='checked'  class="c-row b-b">
+		<view  v-if='!checked' class="c-row">
 			<text class="tit">运费承担方</text>
 			<picker @change="chengChange" :value="chengIndex" :range="chengType" class="con-list">
 				<view class="con-list">
@@ -193,6 +195,7 @@
 				typesType: ["现货", "期货"],
 				typesIndex: 0,
 				deptList: {
+					buyer:"",
 					salePlanTypeKey:0,
 					grainKey:0,
 					gradeKey:0,
@@ -217,10 +220,10 @@
 				},
 				checked:true,
 				insertProcurementPlanInfo: {},
-				liIndex: 0,
-				liType: ['不限','塔粮', '筛粮', '中粒', '大粒'],
+				liIndex: -1,
+				liType: ['塔粮', '筛粮', '中粒', '大粒'],
 				pinIndex: -1,
-				pinType: ['不限', '一等品', '二等品', '三等品', '等外'],
+				pinType: ['一等品', '二等品', '三等品', '等外'],
 				nianIndex: 3,
 				nianType: ['2023', '2022', '2021', '2020', '2019', '2018', '2017', '2016', '2015', '2014', '2013', '2012',
 					'2011'
@@ -231,10 +234,14 @@
 				show1:false,
 				region:'请选择收货地区',
 				region1:'请选择产地',
-				baoIndex: 0,
-				baoType: ['不限', '散装', '大袋', '小袋'],
+				baoIndex: -1,
+				baoType: ['散装', '大袋', '小袋'],
 				chengIndex: -1,
-				chengType: ['可议', '买方承担', '卖方承担']
+				chengType: ['可议', '买方承担', '卖方承担'],
+				codestatus: false,
+				sendDisabled: false,
+				sendText: '获取验证码',
+				verifyCode:"",
 			}
 		},
 		computed: {
@@ -242,22 +249,20 @@
 		},
 		onLoad(options){
 			this.id=options.id
-			if(options.customerName){
-				this.deptList.buyer = options.customerName
-			}
-			
-		},
-		onShow(){
 			this.getList()
-			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,'buyer',res.data.data.customerName)
-					}else{
-						that.$set(this.deptList,'buyer',res.data.data.compName)
+		},
+		onShow() {
+			var that = this
+			this.$api.doRequest('get', '/identityAuthenticationInfo/getInfo', {
+				commonId: that.userInfo.id
+			}).then(res => {
+				if (res.data.code == 200) {
+					if (res.data.data.customerTypeFlag == 1) {
+						that.$set(that.deptList, 'buyer', res.data.data.customerName)
+					} else {
+						that.$set(that.deptList, 'buyer', res.data.data.compName)
 					}
-					this.goods=res.data.data
+					that.goods = res.data.data
 				}
 				uni.hideLoading()
 			})
@@ -267,6 +272,13 @@
 				this.$api.doRequest('get','/procurementPlanInfo/getProcurementPlan',{id:this.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
+						}
 						 let number = this.deptList.basisPrice
 						this.deptList.basisPrice = Math.abs(number)
 						this.region1=this.deptList.outputPrivate+'-'+this.deptList.outputCity
@@ -276,17 +288,7 @@
 						}else if(this.deptList.procurementPlanTypeKey==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.liIndex = this.deptList.grainKey
 						this.baoIndex=this.deptList.packingTypeKey
 						this.pinIndex=this.deptList.gradeKey
 						if(this.deptList.freightPayerKey==1){
@@ -296,9 +298,6 @@
 						}else if(this.deptList.freightPayerKey==3){
 							this.chengIndex=2
 						}
-						// let number = this.deptList.basisPrice
-					
-						// deptList.basisPrice
 					}
 				})
 				.catch(res => {
@@ -476,11 +475,14 @@
 						}
 					}
 				}
-			
 				if (!this.deptList.buyerPhone) {
 					this.$api.msg('买方手机号不能为空')
 					return
 				}
+				if(!this.verifyCode){
+					this.$api.msg('验证码不能为空')
+					return
+				}
 				if(this.checked == false){
 				if (this.deptList.waterContent&&this.deptList.waterContent<1||
 				this.deptList.waterContent&&this.deptList.waterContent>40) {
@@ -564,33 +566,67 @@
 				 	content: '重新发布后交易信息将进入待审核状态,是否确定重新发布?',
 				 	success: (res) => {
 						if(res.confirm) {  
-				this.$api.doRequest('post', '/procurementPlanInfo/api/editProcurementPlan', this
-						.insertProcurementPlanInfo).then(res => {
-							if(res.data.code==200){
-								uni.showToast({
-									title: "发布成功",
-									
-									icon: 'none',
-								})
-								this.deptList={}
-								uni.navigateTo({
-									url: `/pages/release/release`
-								})
-							}else{
-								uni.showToast({
-									title: res.data.message,
-									icon: 'none',
-									duration: 2000
+							var that = this
+							this.$api.doRequest('get', '/commonUser/loginVerifyCode', {
+									phone: this.deptList.buyerPhone,
+									verifyCode: this.verifyCode
+								}).then(res => {
+									if (res.data.code == 200) {
+										this.$api.doRequest('post', '/procurementPlanInfo/api/editProcurementPlan', this
+												.insertProcurementPlanInfo).then(res => {
+													if(res.data.code==200){
+														uni.showToast({
+															title: "发布成功",
+															icon: 'none',
+															duration: 2000
+														})
+														setTimeout(function(){
+															uni.navigateBack({
+																delta:2
+															})
+														},2000)
+
+														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
+												})
+											});
+									} 
+									else if(res.data.code=='11003'){
+										uni.showModal({
+											title: '提示',
+											content: '验证码不正确',
+											});
+									}
+									else {
+										uni.showToast({
+											title: res.data.message,
+											icon: 'none',
+											duration: 2000
+										})
+									}
 								})
-							}
-					})
-					.catch(res => {
-						uni.showToast({
-							title: res.errmsg,
-							icon: 'none',
-							duration: 2000
-						})
-					});
+								.catch(res => {
+									uni.showToast({
+										title: res.data.message,
+										icon: 'none',
+										duration: 2000
+									})
+								});
 					}
 					}
 				})
@@ -610,7 +646,7 @@
 			nianChange(e) {
 				this.nianIndex = e.detail.value
 				this.niantypes = this.nianType[this.nianIndex];
-				this.deptList.outputYear = this.baoType[this.baoIndex]
+				this.deptList.outputYear = this.nianType[this.niantypes]
 			},
 
 			baoChange(e) {
@@ -674,4 +710,18 @@
 		background-color: #22C572;
 		color: #FFFFFF;
 	}
+	.getcode {
+		font-size: 14px;
+		position: absolute;
+		top: 50%;
+		transform: translateY(-50%);
+		color: #AFB3BF;
+		background: #F5F6F9;
+		height: 30px;
+		line-height: 30px;
+	}
+	.getcode.active {
+		background: #22C572;
+		color: #fff;
+	}
 </style>

+ 39 - 37
pageD/myRelease/buyGrain.vue

@@ -159,14 +159,11 @@
 			</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 @click='yearchange'>{{year[index] == null?"请选择出厂年份":year[index]}}</view>
-				<u-picker :params='params' @confirm='yearpicker($event,index)' v-model="show1" mode="time" :start-year="startData" :end-year="endData">
-				</u-picker> -->
+				<view class="con-list">
+				<view @click='yearchange'>{{deptList.outputYear == null?"请选择出厂年份":deptList.outputYear}}</view>
+				<u-picker :params='params2' @confirm='yearpicker($event)' v-model="show2" mode="time" :start-year="startData" :end-year="endData">
+				</u-picker>
+				</view>
 			</view>
 			<view v-if='checked' class="c-row b-b">
 				<text class="tit">包装方式</text>
@@ -182,7 +179,7 @@
 					<input @input='moreinput' placeholder="请填写袋装备注" name="input" v-model="deptList.baggingNotes"></input>
 				</view>
 			</view>
-			<view v-if='checked' class="c-row b-b">
+			<view v-if='checked' class="c-row">
 				<text class="tit">运费承担方</text>
 				<picker @change="chengChange" :value="chengIndex" :range="chengType" class="con-list">
 					<view class="con-list">
@@ -228,18 +225,15 @@
 					province: true,
 					city: true,
 				},
-				checked: false,
+				checked: true,
 				insertProcurementPlanInfo: {},
 				liIndex: -1,
 				liType: ['塔粮', '筛粮', '中粒', '大粒'],
 				pinIndex: -1,
 				pinType: ['一等品', '二等品', '三等品', '等外'],
-				nianIndex: -1,
-				nianType: ['2023', '2022', '2021', '2020', '2019', '2018', '2017', '2016', '2015', '2014', '2013', '2012',
-					'2011'
-				],
 				show: false,
 				show1: false,
+				show2: false,
 				region: '请选择收货地区',
 				region1: '请选择产地',
 				region2:"",
@@ -252,12 +246,24 @@
 				sendText: '获取验证码',
 				verifyCode:"",
 				verification:true,
-				morestatus:false
+				morestatus:false,
+				params2: {
+					year: true,
+				},
 				// DriverViewInfo:{},
 			}
 		},
 		computed: {
-			...mapState(['hasLogin', 'userInfo'])
+			...mapState(['hasLogin', 'userInfo']),
+			startData(){
+					var data = new Date()
+					return data.getFullYear() - 30
+				},
+				endData(){
+					var data = new Date()
+					return data.getFullYear()
+				}
+		
 		},
 		onLoad(options) {
 			if (options.customerName) {
@@ -294,6 +300,14 @@
 				}
 				
 			},
+			yearpicker(e) {
+				if(e!=null){
+					this.morestatus=true
+				}else{
+					this.morestatus=false
+				}
+				this.deptList.outputYear = e.year
+			},
 			// async amendprice() {
 			// 	var that = this
 			// 	this.$api.doRequest('get', '/commonUser/loginVerifyCode', {
@@ -386,7 +400,7 @@
 				this.checked = !this.checked
 			},
 			yearchange() {
-				this.show1 = true
+				this.show2 = true
 			},
 			typeChange(e) {
 				this.typesIndex = e.detail.value
@@ -590,9 +604,9 @@
 				    content: '确定发布交易信息?',
 				    success: function (res) {
 						if (res.confirm) {
-							this.$api.doRequest('get', '/commonUser/loginVerifyCode', {
-								phone: this.deptList.buyerPhone,
-								verifyCode: this.verifyCode
+							that.$api.doRequest('get', '/commonUser/loginVerifyCode', {
+								phone: that.deptList.buyerPhone,
+								verifyCode: that.verifyCode
 							}).then(res => {
 								if (res.data.code == 200) {
 									that.$api.doRequest('post', '/procurementPlanInfo/api/insertProcurementPlanInfo', that.insertProcurementPlanInfo).then(res => {
@@ -631,12 +645,14 @@
 										});
 								}
 								else {
+									}
+								})
+								.catch(res => {
 									uni.showToast({
 										title: res.data.message,
 										icon: 'none',
 										duration: 2000
 									})
-								}
 							})
 							.catch(res => {
 								uni.showToast({
@@ -658,7 +674,7 @@
 				}
 				this.liIndex = e.detail.value
 				this.litypes = this.liType[this.liIndex];
-				this.deptList.grainKey = e.detail.value + 1
+				this.deptList.grainKey = e.detail.value
 				this.deptList.grain = this.liType[this.liIndex]
 			},
 			pinChange(e) {
@@ -672,16 +688,7 @@
 				this.deptList.gradeKey = e.detail.value
 				this.deptList.grade = this.pinType[this.pinIndex]
 			},
-			nianChange(e) {
-				if(e.detail.value!=-1){
-					this.morestatus=true
-				}else{
-					this.morestatus=false
-				}
-				this.nianType = e.detail.value
-				this.niantypes = this.nianType[this.nianIndex];
-				this.deptList.outputYear = this.nianType[this.nianType]
-			},
+
 
 			baoChange(e) {
 				if(e.detail.value!=-1){
@@ -808,11 +815,6 @@
 		height: 30px;
 		line-height: 30px;
 	}
-	
-	.getcode.active {
-		border: none;
-	}
-	
 	.getcode.active {
 		background: #22C572;
 		color: #fff;

+ 222 - 86
pageD/myRelease/sellEdit.vue

@@ -4,7 +4,7 @@
 			<view class="c-row b-b">
 				<text class="tit">名头</text>
 				<view class="con-list">
-					<text @click="navToDetailPage">{{deptList.seller}}</text>
+					<text @click="navToDetailPage">{{deptList.seller}}<text class='tip_text cuIcon-right'></text></text>
 				</view>
 			</view>
 			<view class="c-row b-b">
@@ -34,9 +34,14 @@
 			</view>
 			<view class="c-row b-b">
 				<text class="tit">类型</text>
-				<view class="con-list">
+				<!-- 	<view class="con-list">
 					{{deptList.salePlanType}}
-				</view>
+				</view> -->
+				<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>
@@ -70,12 +75,21 @@
 					<u-picker :params='params' @confirm='regionpicker' mode="region" v-model="show"></u-picker>
 				</view>
 			</view>
-			<view class="c-row ">
+			<view class="c-row b-b">
 				<text class="tit">卖方手机号</text>
 				<view class="con-list">
 					<input placeholder="请输入买方手机号" name="input" v-model="deptList.sellerPhone"></input>
 				</view>
 			</view>
+			<view style='width:100%;position:relative;padding:10px;' class="flex">
+				<button :class='codestatus&&!sendDisabled?"active":""' @click='getcode'
+					class='getcode'>{{sendText}}</button>
+				<view style='width:70%;position:relative;margin-left: 200px;'>
+					<view class="con-list">
+						<input v-model='verifyCode' maxlength="6" placeholder="请输入验证码" type="text">
+					</view>
+				</view>
+			</view>
 		</view>
 		<view class="buylow">
 			<view class="c-row ">
@@ -208,11 +222,15 @@
 					city: true,
 				},
 				checked: true,
+				codestatus: false,
+				sendText: '获取验证码',
+				sendDisabled: false,
+				verifyCode: "",
 				insertProcurementPlanInfo: {},
 				liIndex: 0,
 				liType: ['塔粮', '筛粮', '中粒', '大粒'],
-				pinIndex: 0,
-				pinType: ['不限(默认)', '一等品', '二等品', '三等品', '等外'],
+				pinIndex: -1,
+				pinType: ['一等品', '二等品', '三等品', '等外'],
 				nianIndex: 3,
 				nianType: ['2023', '2022', '2021', '2020', '2019', '2018', '2017', '2016', '2015', '2014', '2013', '2012',
 					'2011'
@@ -221,8 +239,8 @@
 				show1: false,
 				region: '请选择收货地区',
 				region1: '请选择产地',
-				baoIndex: 0,
-				baoType: ['不限(默认)', '散装', '大袋', '小袋'],
+				baoIndex: -1,
+				baoType: ['散装', '大袋', '小袋'],
 				chengIndex: -1,
 				chengType: ['可议', '买方承担', '卖方承担']
 			}
@@ -233,22 +251,23 @@
 		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()
-		// 	})
-		// },
+
+		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, 'seller', res.data.data.customerName)
+					} else {
+						that.$set(this.deptList, 'seller', res.data.data.compName)
+					}
+					this.goods = res.data.data
+				}
+				uni.hideLoading()
+			})
+		},
 		methods: {
 			getList(options) {
 				this.$api.doRequest('get', '/salePlanInfo/getSalePlanInfo', {
@@ -263,32 +282,24 @@
 								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
+							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
+							// }
+							this.typesIndex = this.deptList.salePlanTypeKey - 1
+							this.liIndex = this.deptList.grainKey
+							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({
@@ -307,6 +318,49 @@
 						})
 					});
 			},
+			getcode() {
+				var that = this
+				if (/^0?1[3|4|5|6|7|8][0-9]\d{8}$/.test(that.deptList.sellerPhone)) {
+					this.$api.doRequest('get', '/commonUser/sendVerifyCode', {
+							phone: that.deptList.sellerPhone
+						}).then(res => {
+							if (res.data.code == 200) {
+								that.sendDisabled = true
+								let sec = 60
+								let interval = setInterval(() => {
+									sec--;
+									that.sendText = sec + 's后重发'
+									if (sec <= 0) {
+										that.sendDisabled = false
+										that.sendText = "获取验证码"
+										clearInterval(interval)
+									}
+								}, 1000)
+							} else {
+								uni.showToast({
+									title: res.data.message,
+									icon: 'none',
+									duration: 2000
+								})
+								return
+							}
+						})
+						.catch(res => {
+							uni.showToast({
+								title: res.data.message,
+								icon: 'none',
+								duration: 2000
+							})
+							return
+						});
+				} else {
+					uni.showToast({
+						title: '请输入正确的手机号',
+						icon: 'none',
+						duration: 2000
+					})
+				}
+			},
 			regionpicker(e) {
 				this.deptList.sendPrivate = e.province.label
 				this.deptList.sendCity = e.city.label
@@ -330,14 +384,13 @@
 			typeChange(e) {
 				this.typesIndex = e.detail.value
 				this.types = this.typesType[this.typesIndex];
-				this.deptList.salePlanTypeKey = e.detail.value+1
+				this.deptList.salePlanTypeKey = e.detail.value
 				this.deptList.salePlanType = this.typesType[this.typesIndex];
 				if (this.typesIndex == 0) {
 					this.deptList.priceType = '定价采购'
 				} else {
 					this.deptList.priceType = '期货盘面价+基差'
 				}
-
 			},
 			navToDetailPage() {
 				// if (index == 1) {
@@ -429,12 +482,16 @@
 					// 	}
 					// }
 				}
-				
+
 				if (!this.deptList.sellerPhone) {
 					this.$api.msg('卖方手机号不能为空')
 					return
 				}
-				
+				if (!this.verifyCode) {
+					this.$api.msg('验证码不能为空')
+					return
+				}
+
 				if (this.checked == false) {
 					if (this.deptList.waterContent && this.deptList.waterContent < 1 ||
 						this.deptList.waterContent && this.deptList.waterContent > 40) {
@@ -514,53 +571,117 @@
 				}
 				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
-							})
+				uni.showModal({
+					content: '重新发布后交易信息将进入待审核状态,是否确定重新发布?',
+					success: (res) => {
+						if (res.confirm) {
+							var that = this
+							this.$api.doRequest('get', '/commonUser/loginVerifyCode', {
+									phone: this.deptList.sellerPhone,
+									verifyCode: this.verifyCode
+								}).then(res => {
+									if (res.data.code == 200) {
+										that.$api.doRequest('post', '/salePlanInfo/api/editSalePlanInfo', that
+												.insertProcurementPlanInfo).then(res => {
+												if (res.data.code == 200) {
+													// uni.showToast({
+													// 	title: "发布成功",
+													// 	icon: 'none',
+													// })
+													that.$api.msg('重新发布成功')
+													that.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
+												})
+											});
+									} else if (res.data.code == '11003') {
+										uni.showModal({
+											title: '提示',
+											content: '验证码不正确',
+										});
+									} else {
+										uni.showToast({
+											title: res.data.message,
+											icon: 'none',
+											duration: 2000
+										})
+										return
+									}
+								})
+								.catch(res => {
+									uni.showToast({
+										title: res.data.message,
+										icon: 'none',
+										duration: 2000
+									})
+									return
+								});
+
 						}
+					}
+				})
+				
+				// 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
-						})
-					});
+				// 	})
+				// 	.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.grainKey = e.detail.value
 				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.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]
+				this.deptList.outputYear = this.nianType[this.nianIndex]
 			},
 
 			baoChange(e) {
@@ -572,7 +693,7 @@
 			chengChange(e) {
 				this.chengIndex = e.detail.value
 				this.chengtypes = this.chengType[this.chengIndex];
-					this.deptList.freightPayerKey = e.detail.value+1
+				this.deptList.freightPayerKey = e.detail.value + 1
 				this.deptList.freightPayer = this.chengType[this.chengIndex];
 			}
 		}
@@ -643,4 +764,19 @@
 		text-align: center;
 		line-height: 30px;
 	}
+
+	.getcode {
+		font-size: 14px;
+		position: absolute;
+		top: 50%;
+		transform: translateY(-50%);
+		color: #AFB3BF;
+		background: #F5F6F9;
+		height: 30px;
+		line-height: 30px;
+	}
+
+	.getcode.active {
+		border: none;
+	}
 </style>

+ 85 - 85
pageD/myRelease/sellGrain.vue

@@ -79,13 +79,7 @@
 					<input placeholder="请输入卖方手机号" @input='phoneinput' name="input" v-model="deptList.sellerPhone"></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  class="c-row b-b">
 				<button :class='codestatus&&!sendDisabled?"active":""' @click='getcode'
 					class='getcode'>{{sendText}}</button>
@@ -95,8 +89,6 @@
 			</view>
 		</view>
 		<view class="buylow">
-
-
 			<view class="c-row ">
 				<checkbox style='transform: scale(0.8);' value='1' :disabled="morestatus" :checked="checked" @click='checkedbox'></checkbox><text
 					style="font-size: 14px; ">完善更多信息<text
@@ -163,11 +155,11 @@
 
 			<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 class="con-list">
+				<view @click='yearchange'>{{deptList.outputYear == null?"请选择出厂年份":deptList.outputYear}}</view>
+				<u-picker :params='params2' @confirm='yearpicker($event)' v-model="show2" mode="time" :start-year="startData" :end-year="endData">
+				</u-picker>
+				</view>
 			</view>
 			<view v-if='checked' class="c-row b-b">
 				<text class="tit">包装方式</text>
@@ -209,16 +201,15 @@
 				typesType: ["现货", "期货"],
 				typesIndex: 0,
 				deptList: {
-					salePlanType:'现货',
-					salePlanTypeKey:0,
-					grainKey:0,
-					gradeKey:0,
-					packingTypeKey:0,
-					freightPayerKey:-1,
+					salePlanType: '现货',
+					salePlanTypeKey: 0,
+					grainKey: 0,
+					gradeKey: 0,
+					packingTypeKey: 0,
+					freightPayerKey: -1,
 					priceType: "定价销售",
 					grain: "塔粮",
 					grade: "不限(默认)",
-					outputYear: "2020",
 					packingType: "不限(默认)",
 					freightPayer: "",
 				},
@@ -231,22 +222,19 @@
 					province: true,
 					city: true,
 				},
-				checked: false,
+				checked: true,
 				insertSalePlanInfo: {},
 				liIndex: -1,
 				liType: ['塔粮', '筛粮', '中粒', '大粒'],
 				pinIndex: -1,
 				pinType: ['一等品', '二等品', '三等品', '等外'],
-				nianIndex: -1,
-				nianType: ['2023', '2022', '2021', '2020', '2019', '2018', '2017', '2016', '2015', '2014', '2013', '2012',
-					'2011'
-				],
 				show: false,
 				show1: false,
+				show2:false,
 				region: '请选择发货地区',
 				regions: "",
 				region1: '请选择产地',
-				region2 :"",
+				region2: "",
 				baoIndex: -1,
 				baoType: ['散装', '大袋', '小袋'],
 				chengIndex: -1,
@@ -256,11 +244,22 @@
 				sendText: '获取验证码',
 				verifyCode:"",
 				verification:true,
+				params2: {
+					year: true,
+				},
 				morestatus:false
 			}
 		},
 		computed: {
-			...mapState(['hasLogin', 'userInfo'])
+			...mapState(['hasLogin', 'userInfo']),
+			startData(){
+					var data = new Date()
+					return data.getFullYear() - 30
+				},
+				endData(){
+					var data = new Date()
+					return data.getFullYear()
+				}
 		},
 		onLoad(options) {
 			if (options.customerName) {
@@ -284,6 +283,9 @@
 			})
 		},
 		methods: {
+			yearchange() {
+				this.show2 = true
+			},
 			moreinput(e){
 				if(e.detail.value.length>0){
 					this.morestatus=true
@@ -292,6 +294,14 @@
 				}
 				
 			},
+			yearpicker(e) {
+				if(e!=null){
+					this.morestatus=true
+				}else{
+					this.morestatus=false
+				}
+				this.deptList.outputYear = e.year
+			},
 			// async amendprice() {
 			// 	var that = this
 			// 	this.$api.doRequest('get', '/commonUser/loginVerifyCode', {
@@ -324,6 +334,7 @@
 					this.codestatus=true
 				}
 			},
+
 			getcode() {
 				var that = this
 				if (/^0?1[3|4|5|6|7|8][0-9]\d{8}$/.test(that.deptList.sellerPhone)) {
@@ -392,7 +403,7 @@
 			typeChange(e) {
 				this.typesIndex = e.detail.value
 				this.types = this.typesType[this.typesIndex];
-				this.deptList.salePlanTypeKey = e.detail.value+1
+				this.deptList.salePlanTypeKey = e.detail.value
 				this.deptList.salePlanType = this.typesType[this.typesIndex];
 				if (this.typesIndex == 0) {
 					this.deptList.priceType = '定价销售'
@@ -505,11 +516,11 @@
 					this.$api.msg('卖方手机号不能为空')
 					return
 				}
-				if (this.deptList.sellerPhone.length!=11) {
+				if (this.deptList.sellerPhone.length != 11) {
 					this.$api.msg('卖方手机号输入错误')
 					return
 				}
-				if(!this.verifyCode){
+				if (!this.verifyCode) {
 					this.$api.msg('验证码不能为空')
 					return
 				}
@@ -590,11 +601,11 @@
 				// 	this.$api.msg('验证码输入有误!')
 				// 	return
 				// }
-				var that=this
+				var that = this
 				this.insertSalePlanInfo = this.deptList
 				this.insertSalePlanInfo.basisPrice = this.insertSalePlanInfo.basisPrice
 				this.insertSalePlanInfo.commonId = this.userInfo.id
-				this.insertSalePlanInfo.salePlanNo='XSJH'+this.getdate()+this.verifyinit()
+				this.insertSalePlanInfo.salePlanNo = 'XSJH' + this.getdate() + this.verifyinit()
 				this.insertSalePlanInfo.compId = "2710b21efc1e4393930c5dc800010dc4"
 				uni.showModal({ 
 					title: '提示',
@@ -606,15 +617,10 @@
 						verifyCode: that.verifyCode
 					}).then(res => {
 						if (res.data.code == 200) {
-							that.$api.doRequest('post', '/salePlanInfo/api/insertSalePlanInfo', that.insertSalePlanInfo).then(res => {
+							that.$api.doRequest('post', '/salePlanInfo/api/insertSalePlanInfo', that
+									.insertSalePlanInfo).then(res => {
 									if (res.data.code == 200) {
-										uni.showToast({
-											title: "发布成功",
-											icon: 'none',
-										})
-										// setTimeout(() => {
-										// 	uni.navigateBack({})
-										// }, 1000)
+										that.$api.msg('发布成功')
 										that.deptList = {}
 										uni.navigateTo({
 											url: `/pages/release/release`
@@ -626,7 +632,7 @@
 											duration: 2000
 										})
 									}
-							
+
 								})
 								.catch(res => {
 									uni.showToast({
@@ -635,14 +641,12 @@
 										duration: 2000
 									})
 								});
-						}
-						else if(res.data.code=='11003'){
-						 	uni.showModal({
-						 		title: '提示',
-						 		content: '验证码不正确',
-						 		});
-						 }
-						else {
+						} else if (res.data.code == '11003') {
+							uni.showModal({
+								title: '提示',
+								content: '验证码不正确',
+							});
+						} else {
 							uni.showToast({
 								title: res.data.message,
 								icon: 'none',
@@ -677,7 +681,7 @@
 				}
 				this.liIndex = e.detail.value
 				this.litypes = this.liType[this.liIndex];
-				this.deptList.grainKey = e.detail.value+1
+				this.deptList.grainKey = e.detail.value
 				this.deptList.grain = this.liType[this.liIndex]
 			},
 			pinChange(e) {
@@ -691,16 +695,6 @@
 				this.deptList.gradeKey = e.detail.value
 				this.deptList.grade = this.pinType[this.pinIndex]
 			},
-			nianChange(e) {
-				if(e.detail.value!=-1){
-					this.morestatus=true
-				}else{
-					this.morestatus=false
-				}
-				this.nianIndex = e.detail.value
-				this.niantypes = this.nianType[this.nianIndex];
-				this.deptList.outputYear = this.baoType[this.baoIndex]
-			},
 
 			baoChange(e) {
 				if(e.detail.value!=-1){
@@ -714,31 +708,31 @@
 				this.deptList.packingType = this.baoType[this.baoIndex];
 			},
 			getdate() {
-			  var date = new Date()
-			  var year = date.getFullYear() //获取完整的年份(4位)
-			  var mouth = date.getMonth() + 1 //获取当前月份(0-11,0代表1月)
-			  var datetime = date.getDate() //获取当前日(1-31)
-			  if (mouth < 10) {
-				mouth = '0' + mouth
-			  }
-			  if (datetime < 10) {
-				datetime = '0' + datetime
-			  }
-			  return year + mouth + datetime
+				var date = new Date()
+				var year = date.getFullYear() //获取完整的年份(4位)
+				var mouth = date.getMonth() + 1 //获取当前月份(0-11,0代表1月)
+				var datetime = date.getDate() //获取当前日(1-31)
+				if (mouth < 10) {
+					mouth = '0' + mouth
+				}
+				if (datetime < 10) {
+					datetime = '0' + datetime
+				}
+				return year + mouth + datetime
 			},
 			verifyinit() {
-			  var arr = []
-			  for (var i = 48; i < 123; i++) {
-				if (i > 57 && i < 65) continue
-				if (i > 90 && i < 97) continue
-				arr.push(String.fromCharCode(i))
-			  }
-			  arr.sort(function() {
-				return Math.random() - 0.5
-			  })
-			  arr.length = 4
-					
-			  return arr.join('')
+				var arr = []
+				for (var i = 48; i < 123; i++) {
+					if (i > 57 && i < 65) continue
+					if (i > 90 && i < 97) continue
+					arr.push(String.fromCharCode(i))
+				}
+				arr.sort(function() {
+					return Math.random() - 0.5
+				})
+				arr.length = 4
+
+				return arr.join('')
 			},
 			chengChange(e) {
 				if(e.detail.value!=-1){
@@ -748,7 +742,7 @@
 				}
 				this.chengIndex = e.detail.value
 				this.chengtypes = this.chengType[this.chengIndex];
-				this.deptList.freightPayerKey = e.detail.value+1
+				this.deptList.freightPayerKey = e.detail.value + 1
 				this.deptList.freightPayer = this.chengType[this.chengIndex];
 			}
 		}
@@ -791,11 +785,13 @@
 	.con-list input{
 		font-size:14px !important;
 	}
+
 	.buyup {
 		background-color: #FFFFFF;
 		border-radius: 20px;
 		margin-top: 10px;
 	}
+
 	.buylow {
 		background-color: #FFFFFF;
 		border-radius: 20px;
@@ -808,6 +804,7 @@
 		background-color: #22C572;
 		color: #FFFFFF;
 	}
+
 	.validate {
 		width: 100px;
 		height: 32px;
@@ -818,6 +815,7 @@
 		text-align: center;
 		line-height: 30px;
 	}
+
 	.getcode {
 		font-size: 14px;
 		color: #AFB3BF;
@@ -825,9 +823,11 @@
 		height: 30px;
 		line-height: 30px;
 	}
+
 	.getcode.active {
 		border: none;
 	}
+
 	.getcode.active {
 		background: #22C572;
 		color: #fff;