zhangyuewww hace 3 años
padre
commit
d1d279023e

+ 11 - 3
pageA/freightTransport/contract_detail.vue

@@ -80,6 +80,7 @@
 					reciveNetWeight: '',
 					collectionScreenshot: '',
 					dispatchingDate: '',
+					id:"",
 					// compId: '2710b21efc1e4393930c5dc800010dc4',
 					batch: ""
 
@@ -192,7 +193,8 @@
 		},
 		onLoad(option) {
 			this.goods.dispatchingDate = this.time;
-			this.goods.batch = option.id;
+			this.goods.batch = option.batch;
+			this.goods.id = option.id;
 
 		},
 		methods: {
@@ -240,6 +242,7 @@
 													confirmText: "继续添加",
 													success: function(res) {
 														if (res.confirm) {
+															// console.log(that.goods,24)
 															that.goods = {
 																carNo: '',
 																collectionScreenshot: '',
@@ -248,9 +251,14 @@
 																driverPhone: '',
 																reciveNetWeight: '',
 																tare: '',
-																tranCarNo: ''
+																tranCarNo: '',
+																batch:that.goods.batch,
+																id:that.goods.id
 															}
 														} else if (res.cancel) {
+															uni.navigateTo({
+																url: '/pageA/freightTransport/record/sendrecord?id=' + that.goods.id
+															})
 													}
 													}
 												});
@@ -285,7 +293,7 @@
 
 						} else if (res.cancel) {
 						uni.navigateTo({
-							url: '/pageA/freightTransport/record/sendrecord?id=' + that.goods.batch
+							url: '/pageA/freightTransport/record/sendrecord?id=' + that.goods.id
 						})
 						}
 					}

+ 101 - 88
pageA/freightTransport/record/sendrecord.vue

@@ -127,89 +127,89 @@
 			</view>
 			<view class="c-row flex justify-end">
 				<view class='deductfreight' @click="freightDeduction(item)">扣运费</view>
-				<view class="freightAlert-model">
-					<u-modal v-model="freightAlert" cancel-color="#AFB3BF" confirm-color="#22C572" :show-title="false"
-						show-cancel-button=true @confirm="confirmFreight(0,item)">
-						<view class="freightAlert-warp">
-							<view class="freightAlert-row">
-								<view class="title">扣运费</view>
-								<u-icon name="close" class="close" size="20" @click="closeModel"></u-icon>
-							</view>
-							<view class="freightAlert-row2 row">
-								<view>运输损耗</view>
-								<view>{{item.reciveNetWeight-item.dispatchNetWeight}}</view>
-							</view>
-							<view class="freightAlert-row3 row">
-								扣款金额
-							</view>
-							<view class="freightAlert-row4">
-								<u-input v-model="freightDeductionAmount" :type="type" :border="border"
-									placeholder="请输入扣款金额" class="uview-border" @input="inputWatch" />
-								<view class="text">
-									元
-								</view>
-							</view>
-							<view class="red-tip" v-show="isShowFreightTip">
-								扣款金额输入错误/扣款金额不能为空
-							</view>
+				<view class='payfreight' @click="payDeduction(item)">付运费</view>
+			</view>
+		</view>
+		<view class="freightAlert-model">
+			<u-modal v-model="freightAlert" cancel-color="#AFB3BF" confirm-color="#22C572" :show-title="false"
+				show-cancel-button=true @confirm="confirmFreight(0,dataList)">
+				<view class="freightAlert-warp">
+					<view class="freightAlert-row">
+						<view class="title">扣运费</view>
+						<u-icon name="close" class="close" size="20" @click="closeModel"></u-icon>
+					</view>
+					<view class="freightAlert-row2 row">
+						<view>运输损耗</view>
+						<view>{{dataList.reciveNetWeight-dataList.dispatchNetWeight}}</view>
+					</view>
+					<view class="freightAlert-row3 row">
+						扣款金额
+					</view>
+					<view class="freightAlert-row4">
+						<u-input v-model="freightDeductionAmount" :type="type" :border="border"
+							placeholder="请输入扣款金额" class="uview-border" @input="inputWatch" />
+						<view class="text">
+							元
 						</view>
-					</u-modal>
+					</view>
+					<view class="red-tip" v-show="isShowFreightTip">
+						扣款金额输入错误/扣款金额不能为空
+					</view>
 				</view>
-				<view class='payfreight' @click="payDeduction()">付运费</view>
-				<view class="freightAlert-model">
-					<u-modal v-model="payAlert" cancel-color="#AFB3BF" confirm-color="#22C572" :show-title="false"
-						show-cancel-button=true @confirm="confirmFreight(1,item)">
-						<view class="freightAlert-warp payAlert">
-							<view class="freightAlert-row">
-								<view class="title">付运费</view>
-								<u-icon name="close" class="close" size="20" @click="closeModel"></u-icon>
-							</view>
-							<view class="freightAlert-row3 row">
-								应付
-							</view>
-							<view class="freightAlert-row4">
-								<u-input v-model="item.freightIngPayable" :type="type" :border="border"
-									placeholder="请输入付款金额" class="uview-border" @input="paidInputWatch" />
-								<view class="text">
-									元
-								</view>
-							</view>
-							<view class="red-tip paid-tip" v-show="isShowPaidTip">
-								应付金额不能为空/应付运费不能小于已付运费
-							</view>
-							<view class="paid">
-								<view class="">
-									已付
-								</view>
-								<view>
-									{{item.freightEdPayable}}元
-								</view>
-							</view>
-							<view class="unpaid">
-								<view class="">
-									未付
-								</view>
-								<view>
-									{{item.freightIngPayable-item.freightEdPayable}}元
-								</view>
-							</view>
-							<view class="freightAlert-row3 row">
-								付款金额
-							</view>
-							<view class="freightAlert-row4">
-								<u-input v-model="item.money" :type="type" :border="border" placeholder="请输入本次支付运费金额"
-									class="uview-border" @input="payInputWatch($event,item)" />
-								<view class="text">
-									元
-								</view>
-							</view>
-							<view class="red-tip pay-tip" v-show="isShowPayTip">
-								付款金额输入错误/付款金额不能超过未付金额/付款金额不能为空
-							</view>
+			</u-modal>
+		</view>
+		<view class="freightAlert-model">
+			<u-modal v-model="payAlert" cancel-color="#AFB3BF" confirm-color="#22C572" :show-title="false"
+				show-cancel-button=true @confirm="confirmFreight(1,dataList)">
+				<view class="freightAlert-warp payAlert">
+					<view class="freightAlert-row">
+						<view class="title">付运费</view>
+						<u-icon name="close" class="close" size="20" @click="closeModel"></u-icon>
+					</view>
+					<view class="freightAlert-row3 row">
+						应付
+					</view>
+					<view class="freightAlert-row4">
+						<u-input v-model="dataList.freightIngPayable" :type="type" :border="border"
+							placeholder="请输入付款金额" class="uview-border" @input="paidInputWatch" />
+						<view class="text">
+							元
+						</view>
+					</view>
+					<view class="red-tip paid-tip" v-show="isShowPaidTip">
+						应付金额不能为空/应付运费不能小于已付运费
+					</view>
+					<view class="paid">
+						<view class="">
+							已付
+						</view>
+						<view>
+							{{dataList.freightEdPayable}}元
+						</view>
+					</view>
+					<view class="unpaid">
+						<view class="">
+							未付
+						</view>
+						<view>
+							{{dataList.freightIngPayable-dataList.freightEdPayable}}元
+						</view>
+					</view>
+					<view class="freightAlert-row3 row">
+						付款金额
+					</view>
+					<view class="freightAlert-row4">
+						<u-input v-model="dataList.money" :type="type" :border="border" placeholder="请输入本次支付运费金额"
+							class="uview-border" @input="payInputWatch($event,dataList)" />
+						<view class="text">
+							元
 						</view>
-					</u-modal>
+					</view>
+					<view class="red-tip pay-tip" v-show="isShowPayTip">
+						付款金额输入错误/付款金额不能超过未付金额/付款金额不能为空
+					</view>
 				</view>
-			</view>
+			</u-modal>
 		</view>
 		<view class='footer'>
 			<button class="btn" @click="commit()">添加发车信息</button>
@@ -247,7 +247,14 @@
 				isShowFreightTip: false,
 				isShowPaidTip: false,
 				isShowPayTip: false,
-				id: ""
+				id: "",
+				dataList:{
+					reciveNetWeight:"",
+					dispatchNetWeight:"",
+					freightEdPayable:"",
+					freightIngPayable:"",
+					freightEdPayable:""
+				}
 			}
 		},
 		onShow() {
@@ -270,7 +277,7 @@
 		methods: {
 			commit() {
 				uni.navigateTo({
-					url: '/pageA/freightTransport/contract_detail?id=' + this.purchaseOrder.batch
+					url: '/pageA/freightTransport/contract_detail?id=' + this.id+'&batch='+this.purchaseOrder.batch
 				})
 			},
 			// 查看磅单
@@ -281,18 +288,18 @@
 					this.isShowSViewPoundList = true
 				}
 			},
-			confirmFreight(flag, val) {
+			confirmFreight(flag,val) {
 				if (flag == 1) {
 					val.money = parseInt(val.money);
+					val.freightIngPayable = parseInt(val.freightIngPayable);
 				} else {
 					val.freightDeductionAmount = parseInt(this.freightDeductionAmount);
 				}
-				val.freightIngPayable = parseInt(val.freightIngPayable);
 				val.flag = flag
 				this.$api.doRequest('post', 'freightReceivingDispatching/api/paymentAndDeductionfreight', val).then(
 					res => {
 						if (res.data.code == 200) {
-							location.reload()
+							window.location.reload()
 						}
 
 					}).catch(res => {
@@ -315,8 +322,8 @@
 					this.isShowPaidTip = false
 				}
 			},
-			payInputWatch(e, item) {
-				let _val = this.checkVal(e, "pay", item);
+			payInputWatch(e, dataList) {
+				let _val = this.checkVal(e, "pay", dataList);
 				if (_val) {
 					this.isShowPayTip = true
 				} else {
@@ -326,13 +333,19 @@
 			// 扣运费
 			freightDeduction(item) {
 				this.freightAlert = true;
-				item.freightDeductionAmount = ""
+				this.dataList.freightDeductionAmount = ""
+				this.dataList.reciveNetWeight=item.reciveNetWeight
+				this.dataList.dispatchNetWeight=item.dispatchNetWeight
 				console.log("扣运费")
 			},
 			// 付运费
-			payDeduction() {
+			payDeduction(item) {
 				console.log("付运费")
 				this.payAlert = true
+				this.dataList.id =item.id
+				this.dataList.freightEdPayable=item.freightEdPayable
+				this.dataList.freightIngPayable=item.freightIngPayable
+				this.dataList.freightEdPayable=item.freightEdPayable
 			},
 
 			//判断输入值