zhangyuewww hace 3 años
padre
commit
a4f6c39999
Se han modificado 1 ficheros con 191 adiciones y 169 borrados
  1. 191 169
      pageA/freightTransport/record/payrecord.vue

+ 191 - 169
pageA/freightTransport/record/payrecord.vue

@@ -122,174 +122,174 @@
 			<view class="c-row flex justify-end">
 				<view style='flex:1;' class='deductfreight' v-if="!purchaseOrder.freightPayer=='发货方承担'"
 					@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>
-							<!-- <u-cell-item :arrow="false" title="运输损耗"></u-cell-item> -->
-							<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' style='flex:1;' v-if="!purchaseOrder.freightPayer=='发货方承担'"
+					@click="payDeduction(item)">付运费</view>
+				<view style='flex:1;' class='deductfreight' @click="deductPayment(item)" v-if="item.status=='待结算'">扣货款</view>
+				<view style='flex:1;' class='payfreight' @click="Payment(item)"  v-if="item.status=='待结算'">付货款</view>
+				<view @click='confirmpaygoods(item)' style='flex:2;' class='payfreight' v-if="item.status!='待结算'">确认收货</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>
+					<!-- <u-cell-item :arrow="false" title="运输损耗"></u-cell-item> -->
+					<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' style='flex:1;' v-if="!purchaseOrder.freightPayer=='发货方承担'"
-					@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="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>
-					</u-modal>
+						<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>
+					</view>
+					<view class="red-tip pay-tip" v-show="isShowPayTip">
+						付款金额输入错误/付款金额不能超过未付金额/付款金额不能为空
+					</view>
 				</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,0)">
-						<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="ductPayment" :type="type" :border="border" placeholder="请输入扣款金额"
-									class="uview-border" @input="deductPaymentInputWatch($event,item)" />
-								<view class="text">
-									元
-								</view>
-							</view>
-							<view class="red-tip pay-tip" v-show="isShowFreightTip">
-								付款金额输入错误/付款金额不能为空
-							</view>
+			</u-modal>
+		</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(dataList,0)">
+				<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="ductPayment" :type="type" :border="border" placeholder="请输入扣款金额"
+							class="uview-border" @input="deductPaymentInputWatch($event,dataList)" />
+						<view class="text">
+							元
 						</view>
-					</u-modal>
+					</view>
+					<view class="red-tip pay-tip" v-show="isShowFreightTip">
+						付款金额输入错误/付款金额不能为空
+					</view>
 				</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="confirmeductPayment(item,1)">
-						<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.goodsIngPayable" :type="type" :border="border" disabled
-									placeholder="请输入付款金额" class="uview-border" @input="paymentInputWatch" />
-								<view class="text">
-									元
-								</view>
-							</view>
-							<view class="red-tip paid-tip" v-show="isShowPaymenMoneyTip">
-								应付金额不能为空/应付货款不能小于已付货款
-							</view>
-							<view class="paid">
-								<view class="">
-									已付
-								</view>
-								<view>
-									{{item.goodsEdPayable}}元
-								</view>
-							</view>
-							<view class="unpaid">
-								<view class="">
-									未付
-								</view>
-								<view>
-									{{item.goodsIngPayable-item.goodsEdPayable}}元
-								</view>
-							</view>
-							<view class="freightAlert-row3 row">
-								付款金额
-							</view>
-							<view class="freightAlert-row4">
-								<u-input v-model="paymenMoney" :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="paymentAlert" cancel-color="#AFB3BF" confirm-color="#22C572" :show-title="false"
+				show-cancel-button=true @confirm="confirmeductPayment(dataList,1)">
+				<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.goodsIngPayable" :type="type" :border="border" disabled
+							placeholder="请输入付款金额" class="uview-border" @input="paymentInputWatch" />
+						<view class="text">
+							元
+						</view>
+					</view>
+					<view class="red-tip paid-tip" v-show="isShowPaymenMoneyTip">
+						应付金额不能为空/应付货款不能小于已付货款
+					</view>
+					<view class="paid">
+						<view class="">
+							已付
+						</view>
+						<view>
+							{{dataList.goodsEdPayable}}元
 						</view>
-					</u-modal>
+					</view>
+					<view class="unpaid">
+						<view class="">
+							未付
+						</view>
+						<view>
+							{{dataList.goodsIngPayable-dataList.goodsEdPayable}}元
+						</view>
+					</view>
+					<view class="freightAlert-row3 row">
+						付款金额
+					</view>
+					<view class="freightAlert-row4">
+						<u-input v-model="paymenMoney" :type="type" :border="border" placeholder="请输入货款金额"
+							class="uview-border" @input="payInputWatch($event,dataList)" />
+						<view class="text">
+							元
+						</view>
+					</view>
+					<view class="red-tip pay-tip" v-show="isShowPayTip">
+						付款金额输入错误/付款金额不能超过未付金额/付款金额不能为空
+					</view>
 				</view>
-
-				<view @click='confirmpaygoods(item)' style='flex:2;' class='payfreight' v-if="item.status!='待结算'">确认收货</view>
-			</view>
-
+			</u-modal>
 		</view>
+		
 		<view class='footer'>
 			<button class="btn" @click="commit()">添加收货人</button>
 		</view>
@@ -330,7 +330,16 @@
 				isShowPayTip: false,
 				isShowPaymenMoneyTip: false,
 				id: "",
-				payfreightCli: true
+				payfreightCli: true,
+				dataList:{
+					reciveNetWeight:"",
+					dispatchNetWeight:"",
+					freightEdPayable:"",
+					freightIngPayable:"",
+					freightEdPayable:"",
+					goodsIngPayable:"",
+					goodsEdPayable:""
+				}
 			}
 		},
 		onShow() {
@@ -378,7 +387,7 @@
 				this.$api.doRequest('post', 'freightReceivingDispatching/api/paymentAndDeductionfreight', val).then(
 					res => {
 						if (res.data.code == 200) {
-							location.reload()
+							window.location.reload()
 						}
 
 					}).catch(res => {
@@ -401,8 +410,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
 					this.isShowPaymenMoneyTip = true
@@ -412,8 +421,8 @@
 				}
 			},
 			//扣货款输入监听
-			deductPaymentInputWatch(e, item) {
-				let _val = this.checkVal(e, "deductPayment", item);
+			deductPaymentInputWatch(e, dataList) {
+				let _val = this.checkVal(e, "deductPayment", dataList);
 				if (_val) {
 					this.isShowFreightTip = true
 				} else {
@@ -424,20 +433,32 @@
 			freightDeduction(item) {
 				this.freightAlert = true;
 				this.freightDeductionAmount = 0
-				// this.cleanVal(item,"freightDeductionAmount")
+				this.dataList.reciveNetWeight=item.reciveNetWeight
+				this.dataList.dispatchNetWeight=item.dispatchNetWeight
+				this.dataList.id =item.id
 				console.log("扣运费")
 			},
 			// 付运费
-			payDeduction() {
+			payDeduction(item) {
 				console.log("付运费")
+				this.dataList.freightEdPayable=item.freightEdPayable
+				this.dataList.freightIngPayable=item.freightIngPayable
+				this.dataList.freightEdPayable=item.freightEdPayable
+				this.dataList.id =item.id
 				this.payAlert = true
 			},
-			deductPayment() {
+			deductPayment(item) {
 				console.log("扣货款")
+				this.dataList.id =item.id
+				this.dataList.batch=item.batch
 				this.deductPaymentAlert = true
 			},
-			Payment() {
+			Payment(item) {
 				console.log("付货款")
+				this.dataList.goodsIngPayable=item.goodsIngPayable
+				this.dataList.goodsEdPayable=item.goodsEdPayable
+				this.dataList.id =item.id
+				this.dataList.batch=item.batch
 				this.paymentAlert = true
 			},
 			//判断输入值
@@ -506,6 +527,7 @@
 									getDetail(that.id, that)
 								}
 							})
+							window.location.reload()
 						} else {
 							uni.showToast({
 								title:_title1,