Browse Source

修改货运收发确认收货按钮

wangchao 3 years ago
parent
commit
cc0a73ff7b

+ 158 - 162
pageA/freightTransport/addsendgoods.vue

@@ -3,107 +3,39 @@
 		<view class="transaction">
 			<u-form :model="purchaseOrder" ref="uForm" class="uForm">
 				<u-form-item label="业务编号" prop="businessNumber" label-width="140" required>
-					<u-input v-model="purchaseOrder.businessNumber" input-align="right" placeholder="请输入业务编号"/>
+					<u-input v-model="purchaseOrder.businessNumber" input-align="right" placeholder="请输入业务编号" />
 				</u-form-item>
 				<u-form-item label="收货方" prop="consignee" label-width="140" required>
-					<u-input v-model="purchaseOrder.consignee" input-align="right" placeholder="请输入收货方名称"/>
+					<u-input v-model="purchaseOrder.consignee" input-align="right" placeholder="请输入收货方名称" />
 				</u-form-item>
 				<u-form-item label="发货方" prop="shipper" label-width="140" required>
-					<u-input v-model="purchaseOrder.shipper" input-align="right" placeholder="请输入发货方名称"/>
+					<u-input v-model="purchaseOrder.shipper" input-align="right" placeholder="请输入发货方名称" />
 				</u-form-item>
 				<u-form-item label="货名" prop="goodsName" label-width="140" required>
-					<u-input v-model="purchaseOrder.goodsName" input-align="right" placeholder="请输入货名,如玉米"/>
+					<u-input v-model="purchaseOrder.goodsName" input-align="right" placeholder="请输入货名,如玉米" />
 				</u-form-item>
 				<u-form-item label="货物单价(元/吨)" prop="goodsPrice" label-width="250" required>
-					<u-input v-model="purchaseOrder.goodsPrice" input-align="right" placeholder="请输入货物单价"/>
+					<u-input v-model="purchaseOrder.goodsPrice" input-align="right" placeholder="请输入货物单价" />
 				</u-form-item>
 				<u-form-item label="运费单价(元/吨)" prop="freightUnitPrice" label-width="250" required>
-					<u-input v-model="purchaseOrder.freightUnitPrice" input-align="right" placeholder="请输入运费单价"/>
+					<u-input v-model="purchaseOrder.freightUnitPrice" input-align="right" placeholder="请输入运费单价" />
 				</u-form-item>
 				<u-form-item label="运费承担方" prop="freightUnitPrice" label-width="250" required>
-						<!-- <u-select v-model="isFreightUnitPrice" :list="packingType" :default-value="defaultValue" mode="single-column" @confirm="packingChange"></u-select> -->
-						<view class="con-list">
-							<picker @change="packingChange" :value="packingIndex" :range="packingType">
-								<view class="picker">
-									{{packingIndex>-1?packingType[packingIndex]:'请选择'}}
-								</view>
-							</picker>
-						</view>
+					<view class="con-list">
+						<picker @change="packingChange" :value="packingIndex" :range="packingType">
+							<view class="picker">
+								{{packingIndex>-1?packingType[packingIndex]:'请选择'}}
+							</view>
+						</picker>
+					</view>
+				</u-form-item>
+				<u-form-item label="收货地址" prop="receivingAddress" label-width="140" required>
+					<u-input v-model="purchaseOrder.receivingAddress" input-align="right" placeholder="请输入收货地址" />
+				</u-form-item>
+				<u-form-item label="收货人账号" prop="accountNumber" label-width="160" required>
+					<u-input v-model="purchaseOrder.accountNumber" input-align="right" placeholder="请输入收货人账号" />
 				</u-form-item>
-			<u-form-item label="收货地址" prop="receivingAddress" label-width="140" required>
-				<u-input v-model="purchaseOrder.receivingAddress" input-align="right" placeholder="请输入收货地址"/>
-			</u-form-item>
-			<u-form-item label="收货人账号" prop="accountNumber" label-width="160" required>
-				<u-input v-model="purchaseOrder.accountNumber" input-align="right" placeholder="请输入收货人账号"/>
-			</u-form-item>
 			</u-form>
-			
-			<!-- <view class="c-row b-b margin-top">
-				<view class="title">业务编号</view>
-				<view class="con-list">
-					<input v-model='purchaseOrder.businessNumber' placeholder="请输入业务编号"
-						placeholder-style="font-size: 12px;" name="input"></input>
-				</view>
-			</view> -->
-<!-- 			<view class="c-row b-b">
-				<view class="title">收货方</view>
-				<view class="con-list">
-					<input v-model='purchaseOrder.consignee' placeholder="请输入收货方名称" placeholder-style="font-size: 12px;"
-						name="input"></input>
-				</view>
-			</view> -->
-	<!-- 		<view class="c-row b-b">
-				<view class="title">发货方</view>
-				<view class="con-list">
-					<input v-model='purchaseOrder.shipper' placeholder="请输入发货方名称" placeholder-style="font-size: 12px;"
-						name="input"></input>
-				</view>
-			</view> -->
-			<!-- <view class="c-row b-b">
-				<view class="title">货名</view>
-				<view class="con-list">
-					<input v-model='purchaseOrder.goodsName' placeholder="请输入货名,如玉米"
-						placeholder-style="font-size: 12px;" name="input"></input>
-				</view>
-			</view> -->
-			<!-- <view class="c-row b-b">
-				<view class="title">货物单价(元/吨)</view>
-				<view class="con-list">
-					<input v-model='purchaseOrder.goodsPrice' placeholder="请输入货物单价" placeholder-style="font-size: 12px;"
-						name="input"></input>
-				</view>
-			</view> -->
-			<!-- <view class="c-row b-b">
-				<view class="title">运费单价(元/吨)</view>
-				<view class="con-list">
-					<input v-model='purchaseOrder.freightUnitPrice' placeholder="请输入运费单价"
-						placeholder-style="font-size: 12px;" name="input"></input>
-				</view>
-			</view> -->
-			<!-- <view class="c-row b-b">
-				<view class="title">运费承担方</view>
-				<view class="con-list">
-					<picker @change="packingChange" :value="packingIndex" :range="packingType">
-						<view class="picker">
-							{{packingIndex>-1?packingType[packingIndex]:'请选择'}}
-						</view>
-					</picker>
-				</view>
-			</view> -->
-	<!-- 		<view class="c-row b-b">
-				<view class="title">收货地址</view>
-				<view class="con-list">
-					<input v-model='purchaseOrder.receivingAddress' placeholder="请输入收货地址"
-						placeholder-style="font-size: 12px;" name="input"></input>
-				</view>
-			</view>
-			<view class="c-row">
-				<view class="title">收货人账号</view>
-				<view class="con-list">
-					<input v-model='purchaseOrder.accountNumber' placeholder="请输入收货人账号"
-						placeholder-style="font-size: 12px;" name="input"></input>
-				</view>
-			</view> -->
 		</view>
 		<view class="account-tip">
 			注:收货人账号为收货人注册易粮易运的手机号码
@@ -117,100 +49,160 @@
 </template>
 
 <script>
+	// import fullPopup from '@/components/common/fullPopup'
 	export default {
 		name: "business",
+		  components: {
+		    // fullPopup
+		  },
 		data() {
 			return {
 				purchaseOrder: {
 					freightPayer: "发货方承担"
 				},
-				packingType: ["发货方承担","收货方承担"],
-				isFreightUnitPrice:true,
-				packingIndex:0,
-				phone:""
+				packingType: ["发货方承担", "收货方承担"],
+				isFreightUnitPrice: true,
+				packingIndex: 0,
+				phone: "",
+				rules: {
+					businessNumber: [{
+						validator: (rule, value, callback) => {
+							return !this.$u.test.isEmpty(value)
+						},
+						message: '业务编号不能为空',
+						trigger: ['change', 'blur']
+					}, ],
+					consignee: [{
+						validator: (rule, value, callback) => {
+							return !this.$u.test.isEmpty(value)
+						},
+						message: '收货方不能为空',
+						trigger: ['change', 'blur']
+					}],
+					shipper: [{
+						validator: (rule, value, callback) => {
+							return !this.$u.test.isEmpty(value)
+						},
+						message: '发货方不能为空',
+						trigger: ['change', 'blur']
+					}],
+
+					goodsName: [{
+						validator: (rule, value, callback) => {
+							return !this.$u.test.isEmpty(value)
+						},
+						message: '货名不能为空',
+						trigger: ['change', 'blur']
+					}],
+					goodsPrice: [{
+							validator: (rule, value, callback) => {
+								return !this.$u.test.isEmpty(value)
+							},
+							message: '货物单价不能为空',
+							trigger: ['change', 'blur']
+						},
+						{
+							validator: (rule, value, callback) => {
+								return this.$u.test.amount(value)
+							},
+							message: '数值类型,最多保留两位小数',
+							trigger: ['change', 'blur'],
+						}
+					],
+					freightUnitPrice: [{
+							validator: (rule, value, callback) => {
+								return !this.$u.test.isEmpty(value)
+							},
+							message: '运费单价不能为空',
+							trigger: ['change', 'blur']
+						},
+						{
+							validator: (rule, value, callback) => {
+								return this.$u.test.amount(value)
+							},
+							message: '数值类型,最多保留两位小数',
+							trigger: ['change', 'blur'],
+						}
+					],
+					receivingAddress: [{
+						validator: (rule, value, callback) => {
+							return !this.$u.test.isEmpty(value)
+						},
+						message: '收获地址不能为空',
+						trigger: ['change', 'blur']
+					}],
+					accountNumber: [{
+							validator: (rule, value, callback) => {
+								return !this.$u.test.isEmpty(value)
+							},
+							message: '手机号码不能为空',
+							trigger: ['change', 'blur']
+						},
+						{
+							validator: (rule, value, callback) => {
+								return this.$u.test.mobile(value);
+							},
+							message: '手机号格式不正确',
+							trigger: ['change', 'blur']
+						}
+					]
+				}
 			}
 		},
-		onShow() {
-
+		onReady() {
+			this.$refs.uForm.setRules(this.rules);
 		},
 		onLoad(options) {
 			this.phone = options.phone
 		},
-		onPageScroll(e) {
-
-		},
-		//下拉刷新
-		onPullDownRefresh() {},
-		onReachBottom() { //上拉触底函数
-		},
 		methods: {
 			packingChange(event) {
 				console.log(event)
 				this.packingIndex = event.detail.value;
 			},
 			commit() {
-				this.purchaseOrder.accountNumber= this.phone
-				this.$api.doRequest('post', '/freightReceivingDispatching/api/insertFreightReceivingDispatching',this.purchaseOrder).then(res => {
-					// if(res.data.code=='200'){
-					// 	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
-					// 						})
-					// 						uni.navigateTo({
-					// 							url: `/pages/attestation/indexThree` 
-					// 						})
-					// 					})
-					// 		        } 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/indexThree` 
-					// 	})
-					// }
-					if(res.data.code==200){
-							uni.showToast({
-								title: '提交成功',
-								icon: 'none',
-								duration: 2000,
-								success:function(){
-									uni.navigateTo({
-											url: `/pageA/freightTransport/index` 
+				this.purchaseOrder.shipperPhone = this.phone
+				this.$refs.uForm.validate(valid => {
+					if (valid) {
+						uni.showLoading({
+							title: '正在加载',
+							mask: true
+						})
+						console.log('验证通过');
+						this.$api.doRequest('post',
+							'/freightReceivingDispatching/api/insertFreightReceivingDispatching',
+							this
+							.purchaseOrder).then(res => {
+							if (res.data.code == 200) {
+								uni.showToast({
+									title: '提交成功',
+									icon: 'none',
+									duration: 2000,
+									success: function() {
+										uni.navigateTo({
+											url: `/pageA/freightTransport/index`
 										})
-								}
-							})
-					
+									}
+								})
+
+							}
+
+						}).catch(res => {
+							// uni.showToast({
+							// 	title: res.data.message,
+							// 	icon: 'none',
+							// 	duration: 2000
+							// })
+						})
+					} else {
+						console.log('验证失败');
 					}
-					
-				}).catch(res => {
-						// uni.showToast({
-						// 	title: res.data.message,
-						// 	icon: 'none',
-						// 	duration: 2000
-						// })
-				})
+				});
+
+
+
+
+
 			}
 		}
 	}
@@ -221,9 +213,11 @@
 	.content {
 		background: #F5F6FA;
 	}
-	.center{
+
+	.center {
 		overflow-y: hidden;
 	}
+
 	.c-row {
 		display: -webkit-box;
 		display: -webkit-flex;
@@ -657,12 +651,14 @@
 	.btn:after {
 		border: none;
 	}
-	.account-tip{
+
+	.account-tip {
 		font-size: 24rpx;
 		font-weight: 400;
 		color: #AFB3BF;
 		padding-left: 60rpx;
 	}
+
 	.uForm {
 		padding: 0 40rpx;
 	}

+ 6 - 8
pageA/freightTransport/confirmpaygoods.vue

@@ -108,9 +108,8 @@
 							},
 							message: '数值类型,1-50之间',
 							trigger: ['change', 'blur'],
-						},
-
-					],
+						}
+					]
 				},
 				id: "",
 				params: {
@@ -193,11 +192,10 @@
 		onReady() {
 			this.$refs.uForm.setRules(this.rules);
 		},
-		onLoad(option) {
-			this.goods = JSON.parse(option.toINfo)
-			this.id = options.id
-			this.goods.reciveCollectionScreenshot = this.goods.reciveCollectionScreenshot == null ? '' : this.goods
-				.reciveCollectionScreenshot
+		onLoad(options) {debugger
+			this.goods = JSON.parse(options.toINfo)
+			this.id = options.id;
+			this.goods.reciveCollectionScreenshot = this.goods.reciveCollectionScreenshot == null ? '':this.goods.reciveCollectionScreenshot
 		},
 		methods: {
 			DateChange(e) {

+ 11 - 4
pageA/freightTransport/index.vue

@@ -85,7 +85,6 @@
 			this.scrollTop = e.scrollTop;
 		},
 		onReachBottom() { //上拉触底函数
-		debugger
 			if (!this.isLoadMore) { //此处判断,上锁,防止重复请求
 				this.isLoadMore = true
 				this.currentPage += 1
@@ -93,7 +92,6 @@
 			}
 		},
 		onPullDownRefresh() {
-			debugger
 			this.currentPage = 1
 			this.isLoadMore = false
 			this.loadStatus = 'loading'
@@ -161,7 +159,13 @@
 									.signedFor
 							}
 							console.log(that.listData)
-							that.isLoadMore = false
+							// if(that.listData.length==0){
+							// 	that.isShowNoData = true
+							// }else{
+							// 	that.isShowNoData = false
+							// }
+							that.isLoadMore=true
+							that.loadStatus = 'nomore'
 						} else {
 							if (that.currentPage > 1) {
 								that.currentPage = 1
@@ -174,7 +178,7 @@
 
 					}).catch(res => {
 						that.$api.msg(res.data.data.errmsg)
-						that.isLoadMore = false
+						that.isLoadMore=false
 						that.loadStatus = 'nomore'
 						if (that.currentPage > 1) {
 							that.currentPage = 1
@@ -188,7 +192,9 @@
 					})
 			},
 			tabcarchange(val) {
+				this.currentPage = 1
 				this.searchKeyWord = ""
+				this.listData=[]
 				console.log(val)
 				this.status = val
 				this.getListData(val)
@@ -231,6 +237,7 @@
 	page,
 	.content {
 		background: #F5F6FA;
+		padding-bottom: 50px;
 	}
 
 	.line {

+ 2 - 2
pageA/freightTransport/record/payrecord.vue

@@ -330,7 +330,7 @@
 				isShowPayTip: false,
 				isShowPaymenMoneyTip: false,
 				id: "",
-				payfreightCli: false
+				payfreightCli: true
 			}
 		},
 		onShow() {
@@ -349,7 +349,7 @@
 		onReachBottom() { //上拉触底函数
 		},
 		methods: {
-			confirmpaygoods(item) {
+			confirmpaygoods(item) {debugger
 				uni.navigateTo({
 					url: '/pageA/freightTransport/confirmpaygoods?toINfo=' + JSON.stringify(item)
 				})

+ 1 - 1
store/index.js

@@ -86,7 +86,7 @@ const store = new Vuex.Store({
 		],
 		clientId: lifeData.clientId?lifeData.clientId: "",
 		// 确定收货
-		isConfigfreightTransport:false,
+		isConfigfreightTransport:true,
 		choice:""
 	},
 	mutations: {