Explorar el Código

联调货运收发相关接口

wangchao hace 3 años
padre
commit
9e86ad8e67

+ 26 - 17
pageA/freightTransport/addpaygoods.vue

@@ -1,12 +1,14 @@
 <template>
 	<view class="container">
 		<view class="information">
-			<u-form :model="userInfo" ref="uForm" class="uForm">
+			<u-form :model="user" ref="uForm" class="uForm">
 				<u-form-item label="收货人姓名" prop="receiveName" label-width="160" required>
-					<u-input v-model="userInfo.receiveName" :disabled="recipientsNumber?true:false" input-align="right" placeholder="请输入收货人姓名" />
+					<u-input v-model="user.receiveName" :disabled="recipientsNumber?true:false" input-align="right"
+						placeholder="请输入收货人姓名" />
 				</u-form-item>
 				<u-form-item label="收货人手机号" prop="receivePhone" label-width="180" required>
-					<u-input v-model="userInfo.receivePhone" :disabled="recipientsNumber?true:false" input-align="right" placeholder="请输入收货人注册易粮易运的手机号" />
+					<u-input v-model="user.receivePhone" :disabled="recipientsNumber?true:false" input-align="right"
+						placeholder="请输入收货人注册易粮易运的手机号" />
 				</u-form-item>
 
 			</u-form>
@@ -14,13 +16,13 @@
 		<button class="submit-btn" @click="submit" v-if="!recipientsNumber">提交</button>
 		<button class="submit-btn btn-bgccolor" v-if="recipientsNumber">人数已达上限</button>
 		<view class="c-row">
-			<view class="">全部收货人({{dataList.receivingUsers.length}})</view>
+			<view class="">全部收货人({{dataList.receivingUsers.length+1}})</view>
 		</view>
 		<view class="c-row">
-			<view class="title">我的用户昵称</view>
-				<view class="phone">
-					{{dataList.accountNumber}}
-				</view>
+			<view class="title">{{dataList.consignee}}</view>
+			<view class="phone">
+				{{dataList.accountNumber}}
+			</view>
 		</view>
 		<view class="information" v-for="(item,index) in dataList.receivingUsers">
 			<view class="c-row">
@@ -45,7 +47,8 @@
 		name: "trust",
 		data() {
 			return {
-				userInfo: {
+				id:"",
+				user: {
 					compId: "",
 					infoId: "",
 					receiveName: "",
@@ -88,7 +91,7 @@
 
 					]
 				},
-				recipientsNumber:false
+				recipientsNumber: false
 			}
 		},
 		computed: {
@@ -99,8 +102,9 @@
 			this.$refs.uForm.setRules(this.rules);
 		},
 		onLoad(option) {
-			this.userInfo.infoId = option.id;
+			this.user.infoId = option.id;
 			this.getDetail(option.id);
+			this.id = option.id
 
 		},
 		methods: {
@@ -120,7 +124,11 @@
 
 					if (res.data.code == 200) {
 						this.dataList = res.data.data
-						if(this.dataList.length>=20) this.recipientsNumber = true
+						this.dataList.receivingUsers = this.dataList.receivingUsers ? this.dataList
+							.receivingUsers : []
+						if (this.dataList.receivingUsers.length > 20) this.recipientsNumber = true
+
+
 						console.log("this.dataList----------------------")
 						console.log(this.dataList)
 					} else {
@@ -141,14 +149,14 @@
 				this.$refs.uForm.validate(valid => {
 					if (valid) {
 						that.$api.doRequest('post', '/freightReceivingDispatching/api/insertReceivingUser', this
-							.userInfo).then(res => {
+							.user).then(res => {
 							if (res.data.code == 200) {
 								uni.showToast({
 									title: '提交成功',
 									icon: 'none',
 									duration: 2000,
 									success: function() {
-										
+										this.getDetail(that.id);
 									}
 								})
 
@@ -184,7 +192,7 @@
 					confirmText: "删除",
 					success: function(res) {
 						if (res.confirm) {
-							that.$api.doRequest('post','/receivingUser/deleteInfo', {
+							that.$api.doRequest('post', '/receivingUser/deleteInfo', {
 								"id": val.id
 							}).then(res => {
 								if (res.data.code == 200) {
@@ -193,7 +201,7 @@
 										icon: 'none',
 										duration: 2000,
 										success: function() {
-											that.getDetail(that.userInfo.infoId)
+											that.getDetail(that.user.infoId)
 										}
 									})
 
@@ -300,7 +308,8 @@
 		font-weight: 500;
 		color: #FFFFFF;
 	}
-	.btn-bgccolor{
+
+	.btn-bgccolor {
 		background: #D8DAE0;
 	}
 </style>

+ 15 - 12
pageA/freightTransport/confirmpaygoods.vue

@@ -86,6 +86,14 @@
 							message: '数值类型,1-100之间',
 							trigger: ['change', 'blur'],
 						},
+						// {
+						// 	validator: (rule, value, callback) => {
+						// 		if(parseInt(value)>this.goods.reciveNetWeight) return false
+						// 		return true
+						// 	},
+						// 	message: '收货毛重不能大于发货净重',
+						// 	trigger: ['change', 'blur'],
+						// },
 
 					],
 					reciveTare: [{
@@ -133,14 +141,7 @@
 				show: false,
 				goodsName: '',
 				verifyCode: '',
-				sendText0: '获取验证码',
-				sendText1: '获取验证码',
-				sendText2: '获取验证码',
-				sendText3: '获取验证码',
-				sendDisabled0: false,
-				sendDisabled1: false,
-				sendDisabled2: false,
-				sendDisabled3: false,
+			
 				buyer: '',
 				buyerPhone: '',
 				level: '',
@@ -192,7 +193,7 @@
 		onReady() {
 			this.$refs.uForm.setRules(this.rules);
 		},
-		onLoad(options) {debugger
+		onLoad(options) {
 			this.goods = JSON.parse(options.toINfo)
 			this.id = options.id;
 			this.goods.reciveCollectionScreenshot = this.goods.reciveCollectionScreenshot == null ? '':this.goods.reciveCollectionScreenshot
@@ -260,6 +261,9 @@
 					content: '确定提交收货信息?',
 					success: function(res) {
 						if (res.confirm) {
+							that.goods.reciveGrossWeight = parseInt(that.goods.reciveGrossWeight)
+							that.goods.reciveTare = parseInt(that.goods.reciveTare)
+							
 							that.$api.doRequest('post',
 									'/freightReceivingDispatching/api/confirmFreightReceivingDispatchingCar',
 									that.goods).then(
@@ -271,10 +275,9 @@
 												success: function(res) {
 													if (res.confirm) {
 														that.$store.commit(
-															'configfreightTransport', true)
+															'configfreightTransport', false)
 														uni.navigateTo({
-															url: `/pageA/freightTransport/record/payrecord?id=` +
-																this.id
+															url: `/pageA/freightTransport/record/payrecord?id=` +that.id
 														})
 														// var result = that.goods.tranCarNo.substr(
 														// 	that.goods.tranCarNo.indexOf("C") +

+ 4 - 9
pageA/freightTransport/contract_detail.vue

@@ -251,14 +251,7 @@
 																tranCarNo: ''
 															}
 														} else if (res.cancel) {
-
-															// uni.navigateBack({
-															// 	delta: 1,
-															// 	success: function() {
-															// 		beforePage.$vm.init(); 
-															// 	}
-															// });
-														}
+													}
 													}
 												});
 											} else if (res.data.code == 11015) {
@@ -291,7 +284,9 @@
 							});
 
 						} else if (res.cancel) {
-
+						uni.navigateTo({
+							url: '/pageA/freightTransport/record/sendrecord?id=' + that.goods.batch
+						})
 						}
 					}
 				});

+ 41 - 27
pageA/freightTransport/index.vue

@@ -14,11 +14,11 @@
 			</view>
 			<view class="" v-if="!isShowNoData">
 				<view v-for="(item,index) in listData" :key="index">
-					<view @click='sendreceiverecord(item)' class="guess-section">
+					<view @click.stop='sendreceiverecord(item)' class="guess-section">
 						<view class="list-item">
 							<view class="list-item-left">
-								<view class='type send' v-if="item.status=='发货'">发</view>
-								<view class='type put' v-if="item.status=='收货'">收</view>
+								<view class='type send' v-if="item.shipperPhone==userInfo.phone">发</view>
+								<view class='type put' v-if="item.shipperPhone!=userInfo.phone">收</view>
 								<view class="number">
 									<view class='businessnumber'>{{item.businessNumber}}</view>
 									<view class='consigner'>{{item.consignee}}</view>
@@ -35,7 +35,7 @@
 							<text>待结算:{{item.toSettled}}</text>
 						</view>
 						<view style='width:100%;' class='flex justify-end'>
-							<view class='del' @click="delRow(item)">删除</view>
+							<view class='del' @click.stop="delRow(item)">删除</view>
 						</view>
 					</view>
 				</view>
@@ -95,7 +95,7 @@
 			this.currentPage = 1
 			this.isLoadMore = false
 			this.loadStatus = 'loading'
-			this.listData=[]
+			this.listData = []
 			this.getListData(this.status)
 			setTimeout(function() {
 				uni.stopPullDownRefresh();
@@ -112,7 +112,7 @@
 			},
 			sendreceiverecord(item) {
 
-				if (item.status == '发货') {
+				if (item.shipperPhone == this.userInfo.phone) {
 					uni.navigateTo({
 						url: '/pageA/freightTransport/record/sendrecord?id=' + item.id
 					})
@@ -164,7 +164,7 @@
 							// }else{
 							// 	that.isShowNoData = false
 							// }
-							that.isLoadMore=true
+							that.isLoadMore = true
 							that.loadStatus = 'nomore'
 						} else {
 							if (that.currentPage > 1) {
@@ -178,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
@@ -194,7 +194,7 @@
 			tabcarchange(val) {
 				this.currentPage = 1
 				this.searchKeyWord = ""
-				this.listData=[]
+				this.listData = []
 				console.log(val)
 				this.status = val
 				this.getListData(val)
@@ -207,26 +207,40 @@
 			},
 			//删除
 			delRow(val) {
-				this.$api.doRequest('post', 'freightReceivingDispatching/api/deleteFreightReceivingDispatching', {
-					"id": val.id
-				}).then(res => {
-					if (res.data.code == 200) {
-						// this.listData = res.data.data.records;
-						uni.showToast({
-							title: "删除成功!",
-							icon: 'none',
-							duration: 2000
-						})
-						this.getListData(0)
+				uni.showModal({
+					content: '货运信息(业务编号'+val.businessNumber+')删除后不可恢复,是否确定删除?',
+					cancelText: "返回",
+					confirmText: "删除",
+					confirmColor:"#22C572",
+					success: function(res) {
+						if (res.confirm) {
+							this.$api.doRequest('post',
+								'freightReceivingDispatching/api/deleteFreightReceivingDispatching', {
+									"id": val.id
+								}).then(res => {
+								if (res.data.code == 200) {
+									// this.listData = res.data.data.records;
+									uni.showToast({
+										title: "删除成功!",
+										icon: 'none',
+										duration: 2000
+									})
+									this.getListData(0)
+								}
+
+							}).catch(res => {
+								// uni.showToast({
+								// 	title: res.data.message,
+								// 	icon: 'none',
+								// 	duration: 2000
+								// })
+							})
+						} else if (res.cancel) {
+
+						}
 					}
+				});
 
-				}).catch(res => {
-					// uni.showToast({
-					// 	title: res.data.message,
-					// 	icon: 'none',
-					// 	duration: 2000
-					// })
-				})
 			}
 
 		}

+ 35 - 21
pageA/freightTransport/record/payrecord.vue

@@ -206,10 +206,10 @@
 						</view>
 					</u-modal>
 				</view>
-				<view style='flex:1;' class='deductfreight' @click="deductPayment()" v-if="!payfreightCli">扣货款</view>
+				<view style='flex:1;' class='deductfreight' @click="deductPayment()" v-if="item.status=='待结算'">扣货款</view>
 				<view class="freightAlert-model">
 					<u-modal v-model="deductPaymentAlert" cancel-color="#AFB3BF" confirm-color="#22C572"
-						:show-title="false" show-cancel-button=true @confirm="confirmeductPayment(item)">
+						:show-title="false" show-cancel-button=true @confirm="confirmeductPayment(item,0)">
 						<view class="freightAlert-warp payAlert">
 							<view class="freightAlert-row">
 								<view class="title">扣货款</view>
@@ -231,10 +231,10 @@
 						</view>
 					</u-modal>
 				</view>
-				<view style='flex:1;' class='payfreight' @click="Payment()" v-if="!payfreightCli">付货款</view>
+				<view style='flex:1;' class='payfreight' @click="Payment()"  v-if="item.status=='待结算'">付货款</view>
 				<view class="freightAlert-model">
 					<u-modal v-model="paymentAlert" cancel-color="#AFB3BF" confirm-color="#22C572" :show-title="false"
-						show-cancel-button=true @confirm="confirmPayPayment(item)">
+						show-cancel-button=true @confirm="confirmeductPayment(item,1)">
 						<view class="freightAlert-warp payAlert">
 							<view class="freightAlert-row">
 								<view class="title">付货款</view>
@@ -286,7 +286,7 @@
 					</u-modal>
 				</view>
 
-				<view @click='confirmpaygoods(item)' style='flex:2;' class='payfreight' v-if="payfreightCli">确认收货</view>
+				<view @click='confirmpaygoods(item)' style='flex:2;' class='payfreight' v-if="item.status!='待结算'">确认收货</view>
 			</view>
 
 		</view>
@@ -349,13 +349,12 @@
 		onReachBottom() { //上拉触底函数
 		},
 		methods: {
-			confirmpaygoods(item) {debugger
+			confirmpaygoods(item) {
 				uni.navigateTo({
-					url: '/pageA/freightTransport/confirmpaygoods?toINfo=' + JSON.stringify(item)
+					url: '/pageA/freightTransport/confirmpaygoods?toINfo=' + JSON.stringify(item)+'&id='+this.id
 				})
 			},
 			commit() {
-				console.log(1111)
 				uni.navigateTo({
 					url: '/pageA/freightTransport/addpaygoods?id=' + this.id
 				})
@@ -441,10 +440,6 @@
 				console.log("付货款")
 				this.paymentAlert = true
 			},
-			confirmPayPayment() {
-				console.log("付货款提交")
-			},
-
 			//判断输入值
 			checkVal(e, state, item) {
 				console.log(e)
@@ -478,28 +473,47 @@
 			closeModel() {
 				this.freightAlert = false;
 				this.payAlert = false;
-				this.ductPaymentAlert = false;
+				this.deductPaymentAlert = false;
 				this.paymentAlert = false;
 			},
-			confirmeductPayment(val) {
+			confirmPayPayment() {
+				console.log("付货款提交")
+			},
+			confirmeductPayment(val,type) {
 				console.log(val)
-				val.goodsDeductionAmount = parseInt(this.ductPayment);
-				this.$api.doRequest('post', 'freightReceivingDispatching/api/PaymentDeduction', val).then(
+				let _title = ''
+				let _title1 = ''
+				if(type==0){
+					_title = "扣款成功!"
+					_title1 = "扣款失败!"
+				}else{
+					_title = "付款成功!"
+					_title1 = "扣款失败!"
+				}
+				
+				let that = this;
+				val.goodsDeductionAmount = parseInt(that.ductPayment);
+				val.money = 0
+				val.goodsEdPayable = parseInt(that.paymenMoney);
+				that.$api.doRequest('post', 'freightReceivingDispatching/api/PaymentDeduction', val).then(
 					res => {
 						if (res.data.code == 200) {
 							uni.showToast({
-								title: "扣款成功!",
+								title:_title,
 								icon: 'none',
-								duration: 2000
+								duration: 2000,
+								success() {
+									getDetail(that.id, that)
+								}
 							})
-							location.reload()
 						} else {
 							uni.showToast({
-								title: "扣款失败!",
+								title:_title1,
 								icon: 'none',
 								duration: 2000
 							})
-							this.ductPayment = 0
+							that.ductPayment = 0
+							that.goodsEdPayable = 0
 						}
 
 					}).catch(res => {

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

@@ -197,7 +197,7 @@
 								付款金额
 							</view>
 							<view class="freightAlert-row4">
-								<u-input v-model="item.money" :type="type" :border="border" placeholder="请输入扣款金额"
+								<u-input v-model="item.money" :type="type" :border="border" placeholder="请输入本次支付运费金额"
 									class="uview-border" @input="payInputWatch($event,item)" />
 								<view class="text">
@@ -388,7 +388,7 @@
 		position: relative;
 
 		.title {
-			color: #9698A2;
+			/* color: #9698A2; */
 		}
 
 		.title-black {