zhongtianhaoyuan il y a 2 ans
Parent
commit
5a169d0e6d
2 fichiers modifiés avec 14 ajouts et 10 suppressions
  1. 2 2
      pages/goodSource/index.vue
  2. 12 8
      pages/order/signContract.vue

+ 2 - 2
pages/goodSource/index.vue

@@ -308,9 +308,9 @@
 					driverPhone: this.firstAuthentication.driverPhone,
 					cargoOwnerPhone: item.cargoOwnerPhone,
 					id:item.id,
-					billingMethod:item.billingMethod
+					billingMethod:item.billingMethod,
+					freightAdvance:item.freightAdvance
 				}
-
 				this.$request.baseRequest('post', '/publishTaskInfo/api/addOrder', _obj).then(res => {
 						if (res.code == 200) {
 							this.$refs.uToast.show({

+ 12 - 8
pages/order/signContract.vue

@@ -55,7 +55,7 @@
 						class="text-align-right yf-input">{{dataDetails.freight}}元/车</view> -->
 				<view class="flex">
 					<u--input placeholder="请输入运费" border="none" type="number" v-model="dataDetails.freight"
-						inputAlign='right' clearable></u--input>
+						inputAlign='right' clearable @input="preMoney"></u--input>
 					<!-- <span> 元/车</span> -->
 				</view>
 			</view>
@@ -122,9 +122,7 @@
 			<view class='row-between'>
 				<view class="gray">装车后预付款</view>
 				<view class="">
-					
-					
-					<u--input placeholder="请输入装车后预付款" v-if="dataDetails.freightAdvance == 1" border="none"
+					<u--input placeholder="自动获取,不可编辑" v-if="dataDetails.freightAdvance == 1" border="none"
 						v-model="dataDetails.loadingAdvancePayment" inputAlign='right' clearable disabled></u--input>
 					<u--input placeholder="请输入装车后预付款" v-else border="none" v-model="dataDetails.loadingAdvancePayment"
 						inputAlign='right' clearable></u--input>
@@ -220,6 +218,7 @@
 				startShow: false,
 				endShow: false,
 				contractCheck:false,//判断合同是否提交
+				proportion:"",//垫付比例
 
 
 			};
@@ -251,9 +250,11 @@
 		onLoad(options) {
 			this.carList = []
 			that = this
-			// this.dataDetails = JSON.parse(options.obj)
 			this.dataDetails = JSON.parse(decodeURIComponent(options.obj))
-			// this.dataDetails.advanceFreightService = '平台垫付运费'
+			if(this.dataDetails.freightAdvance == 1){
+				this.proportion = this.dataDetails.driverAdvancePayment > this.dataDetails.ownerAdvancePayment ? this.dataDetails.ownerAdvancePayment:this.dataDetails.driverAdvancePayment
+			}
+			console.log(this.dataDetails)
 			this.dataDetails.carrierInfo = {}
 			this.ctx = uni.createCanvasContext("handWriting");
 			this.$nextTick(() => {
@@ -287,13 +288,17 @@
 					} else {
 						uni.$u.toast(res.message);
 					}
-
 				})
 				.catch(res => {
 					uni.$u.toast(res.message);
 				});
 		},
 		methods: {
+			preMoney(){
+				if(this.dataDetails.freightAdvance == 1){
+					this.dataDetails.loadingAdvancePayment = this.dataDetails.freight * this.proportion
+				}
+			},
 			collection() {
 				uni.$u.route('/pages/order/bankCard');
 			},
@@ -301,7 +306,6 @@
 				this.dataDetails.carrierInfo.carNo = e.value[0]
 				for (let i = 0; i < this.carlistCopy.length; i++) {
 					if (e.value[0] == this.carlistCopy[i].carNumber) {
-
 						this.dataDetails.trailerNumber = this.carlistCopy[i].guaCarNumber
 					}
 				}