Przeglądaj źródła

前端小程序 sdy

zhongtianhaoyuan 3 lat temu
rodzic
commit
7e3265f2c4

+ 1 - 0
pageA/product/business_buy.vue

@@ -282,6 +282,7 @@
 							return
 						}
 					}
+					this.purchaseOrder.packingFee=-this.purchaseOrder.packingFee
 					if(this.purchaseOrder.packingFee>0||this.purchaseOrder.packingFee<-2000){
 						this.$api.msg('包装费输入错误')
 						return

+ 35 - 35
pageA/product/business_sale.vue

@@ -5,14 +5,13 @@
 		<view  class="c-row b-b">
 			<view class="title">买方</view>
 			<view class="con-list">
-			<view class="title">{{purchaseOrder.buyer}}</view>
+				<view v-if='goods.customerTypeFlag==1' class="title" @click="liang">{{purchaseOrder.customer?purchaseOrder.customer:goods.customerName}}></view>
+				<view v-if='goods.customerTypeFlag==2' class="title" @click="liang">{{purchaseOrder.compName?purchaseOrder.compName:goods.compName}}></view>
 			</view>
 		</view>
 		<view  class="c-row">
 			<view class="title">卖方</view>
 			<view class="con-list">
-				<!-- <view v-if='goods.customerTypeFlag==1' class="title" @click="liang">{{purchaseOrder.customer?purchaseOrder.customer:goods.customerName}}></view>
-				<view v-if='goods.customerTypeFlag==2' class="title" @click="liang">{{purchaseOrder.compName?purchaseOrder.compName:goods.compName}}></view> -->
 			{{purchaseOrder.seller}}
 			</view>
 		</view>
@@ -47,7 +46,7 @@
 			<view  class="title">今日基差(元/吨)</view>
 			<view class="con-list">
 				<view class="picker">
-					<text>{{purchaseOrder.basisPrice}}</text>
+					<text>{{purchaseOrder.basis}}</text>
 				</view>
 				</view>
 		</view>
@@ -75,7 +74,7 @@
 		<view  class="c-row b-b">
 			<view class="title">采购数量(吨)</view>
 			<view class="con-list">
-			<input v-model='purchaseOrder.transactionsNumber' placeholder="请填写出售数量" name="input"></input>
+			<input v-model='purchaseOrder.transactionsNumber' placeholder="请填写采购数量" name="input"></input>
 			</view>
 		</view>
 		<view  class="c-row b-b">
@@ -286,7 +285,8 @@
 							return
 						}
 					}
-					if(this.purchaseOrder.packingFee>0||this.purchaseOrder.packingFee<= 2000){
+					this.purchaseOrder.packingFee=-this.purchaseOrder.packingFee
+					if(this.purchaseOrder.packingFee>0||this.purchaseOrder.packingFee<-2000){
 						this.$api.msg('包装费输入错误')
 						return
 					}
@@ -308,35 +308,35 @@
 					}
 					var that=this
 					this.purchaseOrder.pcFlag=0
-					// uni.showModal({
-					// 	content: '订单提交后将发送给买方,是否确定提交?',
-					// 	success: function (res) {
-					// 		if (res.confirm) {
-					// 			that.$api.doRequest('post','  ', that.purchaseOrder).then(res => {
-					// 				if(res.data.code==200){
-					// 					uni.showToast({
-					// 						title: '提交成功,等待买方回复',
-					// 						icon: 'none',
-					// 						duration: 2000
-					// 					})
-					// 					// uni.navigateBack();
-					// 				}else{
-					// 					uni.showToast({
-					// 						title: '提交失败:'+res.data.message,
-					// 						icon: 'none',
-					// 						duration: 2000
-					// 					})
-					// 				}
-					// 			}).catch(res => {
-					// 				uni.showToast({
-					// 					title: res.data.message,
-					// 					icon: 'none',
-					// 					duration: 2000
-					// 				})
-					// 			})
-					// 		}
-					// 	}
-					// })
+					uni.showModal({
+						content: '订单提交后将发送给卖方,是否确定提交?',
+						success: function (res) {
+							if (res.confirm) {
+								that.$api.doRequest('post','/saleOrder/api/insertSaleOrder', that.purchaseOrder).then(res => {
+									if(res.data.code==200){
+										uni.showToast({
+											title: '提交成功,等待卖方回复',
+											icon: 'none',
+											duration: 2000
+										})
+										// uni.navigateBack();
+									}else{
+										uni.showToast({
+											title: '提交失败:'+res.data.message,
+											icon: 'none',
+											duration: 2000
+										})
+									}
+								}).catch(res => {
+									uni.showToast({
+										title: res.data.message,
+										icon: 'none',
+										duration: 2000
+									})
+								})
+							}
+						}
+					})
 				},
 				someprice(e){
 					if(this.purchaseOrder.pointPrice&&this.purchaseOrder.invoiceFee&&this.purchaseOrder.packingFee){

+ 1 - 1
pageA/product/detail.vue

@@ -190,7 +190,7 @@
 				<view class='shade-content-item'>
 					您的粮商身份正在审核中,请耐心等待认证状态可在<text>我的-身份认证</text>中查看
 				</view>
-				<image @click='status==false' style='width:30px;height:30px;margin-top:10px;' src='../../static/img/jiaoyi/guanbi-2@3x.png'></image>
+				<image @click='status=false' style='width:30px;height:30px;margin-top:10px;' src='../../static/img/jiaoyi/guanbi-2@3x.png'></image>
 			</view>
 		</view>
 		<!-- 底部操作菜单 -->

+ 1 - 1
pageA/product/sales_detail.vue

@@ -202,7 +202,7 @@
 				<view class='shade-content-item'>
 					您的粮商身份正在审核中,请耐心等待认证状态可在<text>我的-身份认证</text>中查看
 				</view>
-				<image @click='status==false' style='width:30px;height:30px;margin-top:10px;' src='../../static/img/jiaoyi/guanbi-2@3x.png'></image>
+				<image @click='status=false' style='width:30px;height:30px;margin-top:10px;' src='../../static/img/jiaoyi/guanbi-2@3x.png'></image>
 			</view>
 		</view>
 		<!-- 底部操作菜单 -->

+ 55 - 7
pageD/identity/companyIdentityThree.vue

@@ -202,6 +202,7 @@
 				this.zhihangStatus = !this.zhihangStatus
 			},
 			commit() {
+				var that=this
 				if (this.bankid[0] == '' || this.bankid[0] == null) {
 					this.$api.msg('请上传银行卡正面')
 					return
@@ -260,17 +261,64 @@
 				this.$api.doRequest('post', '/identityAuthenticationInfo/api/addIdentityAuthenticationInfo', this
 						.identityAuthenticationInfo)
 					.then(res => {
-						console.log(res.data.message)
-						if(res.data.message == "Success"){
+						// console.log(res.data.message)
+						// if(res.data.message == "Success"){
+						// 	uni.navigateTo({
+						// 		url: `/pages/attestation/indexTwo` ,
+						// 	})
+						// }else{				
+						// 		this.$api.msg(res.data.message)
+						// 		return
+						// }
+						if(res.data.code=='11018'){
+							uni.showModal({
+								title: '提示',
+								content: '该手机号已认证过个人粮商,再次认证将覆盖之前的认证信息,是否确定认证?',
+								success: function (res) {
+									if (res.confirm) {
+										that.identityAuthenticationInfo.cover=1
+											that.$api.doRequest('post', '/identityAuthenticationInfo/api/editIdentityAuthenticationInfo', that.identityAuthenticationInfo).then(res => {
+												uni.showToast({
+													title: '提交成功',
+													icon: 'none',
+													duration: 2000
+												})
+												uni.navigateTo({
+														url: `/pages/attestation/indexTwo` ,
+													})
+											}).catch(res => {
+												uni.showToast({
+													title: res.data.message,
+													icon: 'none',
+													duration: 2000
+												})
+											})
+								        } else if (res.cancel) {
+								          uni.showToast({
+								          	title: '提交失败',
+								          	icon: 'none',
+								          	duration: 2000
+								          })
+								        }
+								    }
+								});
+						}else if(res.data.code==200){
+							uni.showToast({
+								title: '提交成功',
+								icon: 'none',
+								duration: 2000
+							})
 							uni.navigateTo({
-								url: `/pages/attestation/indexTwo` ,
+									url: `/pages/attestation/indexTwo` ,
+								})
+						}else{
+							uni.showToast({
+								title: res.data.message,
+								icon: 'none',
+								duration: 2000
 							})
-						}else{				
-								this.$api.msg(res.data.message)
-								return
 						}
 						
-						
 					}).catch(res => {
 						uni.showToast({
 							title: res.data.message,

+ 38 - 6
pageD/identity/driverIdentityThree.vue

@@ -72,6 +72,7 @@
 		},
 		methods:{
 			commit() {
+				var that = this
 				if (this.addressUrl[0] == "" || this.addressUrl[0] == null) {
 					console.log(this.addressUrl)
 					this.$api.msg('请上传行驶证!')
@@ -97,14 +98,45 @@
 				this.DriverViewInfo.pcFlag = 0
 				this.DriverViewInfo.compId = "2710b21efc1e4393930c5dc800010dc4"
 				console.log(this.DriverViewInfo,"司机对象")
-				return
 				this.$api.doRequest('post', '/driverViewInfo/api/addInfo', this.DriverViewInfo).then(res => {
+					if(res.data.code=='ERROR001'){
+						uni.showModal({
+							title: '提示',
+							content: '该手机号已认证过司机,再次认证将覆盖之前的认证信息,是否确定认证?',
+							success: function (res) {
+								if (res.confirm) {
+									that.DriverViewInfo.cover=1
+										that.$api.doRequest('post', '/driverViewInfo/api/editInfo', that.DriverViewInfo).then(res => {
+										}).catch(res => {
+											uni.showToast({
+												title: '提交成功',
+												icon: 'none',
+												duration: 2000
+											})
+										})
+							        } else if (res.cancel) {
+							          uni.showToast({
+							          	title: '提交失败',
+							          	icon: 'none',
+							          	duration: 2000
+							          })
+							        }
+							    }
+							});
+					}else if(res.data.code==200){
+						uni.showToast({
+							title: '提交成功',
+							icon: 'none',
+							duration: 2000
+						})
+					}
+					
 				}).catch(res => {
-					uni.showToast({
-						title: res.data.message,
-						icon: 'none',
-						duration: 2000
-					})
+						uni.showToast({
+							title: res.data.message,
+							icon: 'none',
+							duration: 2000
+						})
 				})
 			},
 			travel(){

+ 0 - 2
pageD/identity/driverIdentityTwo.vue

@@ -275,8 +275,6 @@
 					this.DriverViewInfo.driverPayeeInfoList = this.driverPayeeInfoList
 					this.DriverViewInfo.driverPayeeInfoList.payeeAddressUrl = this.bankimg
 					var model = JSON.stringify(this.DriverViewInfo);
-					console.log(this.DriverViewInfo,"sjijsoi")
-					return
 				uni.navigateTo({
 					url: `/pageD/identity/driverIdentityThree?DriverViewInfo=` + model
 				})

+ 32 - 4
pageD/myRelease/buyGrain.vue

@@ -4,7 +4,7 @@
 			<view class="c-row b-b">
 				<text class="tit">名头</text>
 				<view class="con-list">
-					<text @click="navToDetailPage">{{deptList.procurementPlanNo}}</text>
+					<text @click="navToDetailPage">{{deptList.buyer}}</text>
 				</view>
 			</view>
 			<view class="c-row b-b">
@@ -258,7 +258,7 @@
 		},
 		onLoad(options) {
 			if (options.customerName) {
-				this.deptList.procurementPlanNo = options.customerName
+				this.deptList.buyer = options.customerName
 			}
 		},
 		onShow() {
@@ -268,9 +268,9 @@
 			}).then(res => {
 				if (res.data.code == 200) {
 					if (res.data.data.customerTypeFlag == 1) {
-						that.$set(this.deptList, 'procurementPlanNo', res.data.data.customerName)
+						that.$set(this.deptList, 'buyer', res.data.data.customerName)
 					} else {
-						that.$set(this.deptList, 'procurementPlanNo', res.data.data.compName)
+						that.$set(this.deptList, 'buyer', res.data.data.compName)
 					}
 					this.goods = res.data.data
 				}
@@ -556,6 +556,7 @@
 				this.insertProcurementPlanInfo = this.deptList
 				this.insertProcurementPlanInfo.basisPrice = -this.insertProcurementPlanInfo.basisPrice
 				this.insertProcurementPlanInfo.commonId = this.userInfo.id
+				this.insertProcurementPlanInfo.procurementPlanNo='CGJH'+this.getdate()+this.verifyinit()
 				this.insertProcurementPlanInfo.compId = "2710b21efc1e4393930c5dc800010dc4"
 				this.$api.doRequest('post', '/procurementPlanInfo/api/insertProcurementPlanInfo', this
 						.insertProcurementPlanInfo).then(res => {
@@ -612,6 +613,33 @@
 				this.deptList.packingTypeKey = e.detail.value
 				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
+			},
+			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('')
+			},
 			chengChange(e) {
 				this.chengIndex = e.detail.value
 				this.chengtypes = this.chengType[this.chengIndex];

+ 41 - 6
pageD/myRelease/sellGrain.vue

@@ -4,7 +4,7 @@
 			<view class="c-row b-b">
 				<text class="tit">名头</text>
 				<view class="con-list">
-					<text @click="navToDetailPage">{{deptList.procurementPlanNo}}</text>
+					<text @click="navToDetailPage">{{deptList.seller}}</text>
 				</view>
 			</view>
 			<view class="c-row b-b">
@@ -234,7 +234,7 @@
 					city: true,
 				},
 				checked: true,
-				insertProcurementPlanInfo: {},
+				insertSalePlanInfo: {},
 				liIndex: 0,
 				liType: ['塔粮', '筛粮', '中粒', '大粒'],
 				pinIndex: 0,
@@ -263,7 +263,7 @@
 		},
 		onLoad(options) {
 			if (options.customerName) {
-				this.deptList.procurementPlanNo = options.customerName
+				this.deptList.seller = options.customerName
 			}
 		},
 		onShow() {
@@ -273,9 +273,9 @@
 			}).then(res => {
 				if (res.data.code == 200) {
 					if (res.data.data.customerTypeFlag == 1) {
-						that.$set(this.deptList, 'procurementPlanNo', res.data.data.customerName)
+						that.$set(this.deptList, 'seller', res.data.data.customerName)
 					} else {
-						that.$set(this.deptList, 'procurementPlanNo', res.data.data.compName)
+						that.$set(this.deptList, 'seller', res.data.data.compName)
 					}
 					this.goods = res.data.data
 				}
@@ -558,6 +558,7 @@
 						}
 					}
 				}
+<<<<<<< HEAD
 				if(this.amendprice() == false){
 					this.$api.msg('验证码输入有误!')
 					return
@@ -566,8 +567,15 @@
 				this.insertProcurementPlanInfo.basisPrice = -this.insertProcurementPlanInfo.basisPrice
 				this.insertProcurementPlanInfo.commonId = this.userInfo.id
 				this.insertProcurementPlanInfo.compId = "2710b21efc1e4393930c5dc800010dc4"
+=======
+				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.compId = "2710b21efc1e4393930c5dc800010dc4"
+>>>>>>> cf82327deab7b10c1c2181e90bf088a14545c10f
 				this.$api.doRequest('post', '/salePlanInfo/api/insertSalePlanInfo', this
-						.insertProcurementPlanInfo).then(res => {
+						.insertSalePlanInfo).then(res => {
 						if (res.data.code == 200) {
 							uni.showToast({
 								title: "发布成功",
@@ -621,6 +629,33 @@
 				this.deptList.packingTypeKey = e.detail.value
 				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
+			},
+			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('')
+			},
 			chengChange(e) {
 				this.chengIndex = e.detail.value
 				this.chengtypes = this.chengType[this.chengIndex];

+ 2 - 0
pages/attestation/index.vue

@@ -147,11 +147,13 @@
 				},	
 				
 			liangShang(){
+				console.log(1111)
 				uni.navigateTo({
 					url: `/pages/attestation/indexTwo`
 				})
 			},
 			siJi(){
+				console.log(2222)
 				uni.navigateTo({
 					url: `/pages/attestation/indexThree`
 				})

+ 12 - 1
pages/business/business.vue

@@ -35,23 +35,34 @@
 					<view class="title">{{item.title}}</view>
 				</view>
 				<view class='flex justify-between'>
-					<view class='address'>
+					<view v-if='TabCur==0' class='address'>
 						{{item.receivePrivate}}{{item.receiveCity}}{{item.receiveArea}}{{item.receiveWarehouse}}
 					</view>
+					<view v-if='TabCur==1' class='address'>
+						{{item.sendPrivate}}{{item.sendCity}}{{item.sendArea}}{{item.sendWarehouse}}
+					</view>
 					<view class='price' v-if='item.procurementPlanType=="期货"'>{{item.basisPrice}}<text
 							style='font-size:13px;color:#333333;'>元/吨</text></view>
 					<view class='price' v-if='item.procurementPlanType=="现货"'>{{item.unitPrice}}<text
 							style='font-size:13px;color:#333;'>元/吨</text></view>
+					<view class='price' v-if='item.salePlanType=="期货"'>{{item.basisPrice}}<text
+						style='font-size:13px;color:#333333;'>元/吨</text></view>
+					<view class='price' v-if='item.salePlanType=="现货"'>{{item.unitPrice}}<text
+						style='font-size:13px;color:#333;'>元/吨</text></view>
 				</view>
 				<view class='flex justify-between'>
 					<view>
 						<view class='tag1 tag-bule radius line-pink' v-if='item.procurementPlanType=="现货"'>现货</view>
 						<view class='tag1 tag-bule radius line-pink' v-if='item.procurementPlanType=="期货"'>期货</view>
+						<view class='tag1 tag-bule radius line-pink' v-if='item.salePlanType=="现货"'>现货</view>
+						<view class='tag1 tag-bule radius line-pink' v-if='item.salePlanType=="期货"'>期货</view>
 						<view class='tag1 tag-yellow radius line-green'>{{item.goodsName}}</view>
 						<view class='tag1 tag-red radius line-yellow'>{{item.weight}}吨</view>
 					</view>
 					<view style='color:#878C9C;padding-top:5px;' v-if='item.procurementPlanType=="期货"'>今日基差</view>
 					<view style='color:#878C9C;padding-top:5px;' v-if='item.procurementPlanType=="现货"'>采购价格</view>
+					<view style='color:#878C9C;padding-top:5px;' v-if='item.salePlanType=="期货"'>今日基差</view>
+					<view style='color:#878C9C;padding-top:5px;' v-if='item.salePlanType=="现货"'>采购价格</view>
 				</view>
 			</view>
 			<view v-show="isLoadMore">