Browse Source

签合同

achao 3 years ago
parent
commit
d95cd89494
3 changed files with 104 additions and 42 deletions
  1. 27 25
      pages/order/confirmLoading.vue
  2. 12 6
      pages/order/orderDetails.vue
  3. 65 11
      pages/order/signContract.vue

+ 27 - 25
pages/order/confirmLoading.vue

@@ -48,8 +48,9 @@
 			<view class="level2-title">装车信息</view>
 			<view class='row-between'>
 				<view class="">车牌号</view>
-				<input class="car-uumber input" v-model='detailData.carrierInfo.carNo' @click.stop="handleShowKeyboard"
-					:disabled="true" placeholder="输入车牌号" name="input"></input>
+				{{detailData.carrierInfo.carNo}}
+				<!-- <input class="car-uumber input" v-model='detailData.carrierInfo.carNo'
+					:disabled="true" placeholder="输入车牌号" name="input" disabled="true"></input> -->
 			</view>
 			<view class='row-between' @click="selectDate">
 				<view class="">装车日期</view>
@@ -59,9 +60,9 @@
 			</view>
 			<view class='row-between'>
 				<view class="">运费总额(元)</view>
-				<!-- {{detailData.carrierInfo.estimatedFreight}} -->
-				<view class=""><input class="input" type="text" value="" v-model="detailData.carrierInfo.freight"
-						placeholder="请输入运费"></view>
+				{{detailData.freightInfo.freight}}
+			<!-- 	<view class=""><input class="input" type="text" value="" v-model="detailData.carrierInfo.freight"
+						placeholder="请输入运费"></view> -->
 			</view>
 			<view class='row-between'>
 				<view class="">定位</view>
@@ -93,7 +94,7 @@
 		<master-keyboard ref="keyboard" keyboardtype="car" :show="keyShow" :randomNumber="true" :newCar="false"
 			:defaultValue="carNumber" @keyboardClick="handleClick"></master-keyboard>
 		<u-toast ref="uToast"></u-toast>
-		<u-calendar :show="showDate" :mode="mode" @confirm="confirmDate"></u-calendar>
+		<u-calendar :show="showDate" :mode="mode" @confirm="confirmDate" @close="showDate= false"></u-calendar>
 	</view>
 </template>
 
@@ -124,14 +125,14 @@
 				gjList: []
 			}
 		},
-		onLoad(options) {
+		onLoad(options) {debugger
 			that = this
 			// debugger
 			// #ifdef APP-PLUS
 			this.getLngLat();
 			// #endif
 			console.log(options)
-			this.id = options.id
+			this.id = JSON.parse(decodeURIComponent(options.obj)).id
 			this.getInfo()
 			// this.detailData = options;
 			// CYHT20220317000001
@@ -381,27 +382,27 @@
 					})
 					return true
 				}
-				if (uni.$u.test.isEmpty(this.detailData.carrierInfo.freight)) {
+				if (uni.$u.test.isEmpty(this.detailData.freightInfo.freight)) {
 					this.$refs.uToast.show({
 						type: 'error',
 						message: "运费总额不能为空!",
 					})
 					return true
 				}
-				if (uni.$u.test.isEmpty(this.detailData.carrierInfo.sendCity)) {
-					this.$refs.uToast.show({
-						type: 'error',
-						message: "定位不能为空!",
-					})
-					return true
-				}
-				if (uni.$u.test.isEmpty(this.detailData.carrierInfo.sendArea)) {
-					this.$refs.uToast.show({
-						type: 'error',
-						message: "定位不能为空!",
-					})
-					return true
-				}
+				// if (uni.$u.test.isEmpty(this.detailData.carrierInfo.sendCity)) {
+				// 	this.$refs.uToast.show({
+				// 		type: 'error',
+				// 		message: "定位不能为空!",
+				// 	})
+				// 	return true
+				// }
+				// if (uni.$u.test.isEmpty(this.detailData.carrierInfo.sendArea)) {
+				// 	this.$refs.uToast.show({
+				// 		type: 'error',
+				// 		message: "定位不能为空!",
+				// 	})
+				// 	return true
+				// }
 				if (uni.$u.test.isEmpty(this.detailData.carrierInfo.loadingImg)) {
 					this.$refs.uToast.show({
 						type: 'error',
@@ -411,9 +412,10 @@
 				}
 			},
 			confirmClick() {
-				this.validate()
-				debugger
+				
 				this.isShowAlert = false
+				 if(this.validate()) return 
+				debugger
 				//1暂存
 				if (this.detailData.statusFlag == 1) {
 					delete this.detailData.carrierInfo.loadingAreaLongitude;

+ 12 - 6
pages/order/orderDetails.vue

@@ -17,10 +17,10 @@
 			<!-- flex flex-space-between -->
 			<view class="item2">
 				<u-button class="btn" text="查看合同" @click="lookContract" v-if="dataObj.driverContract=='1'"></u-button>
-			     <u-button class="btn" text="签订合同" @click="signContract" v-if="dataObj.cargoOwnerStatus=='未装车'&&dataObj.driverContract!='1'"></u-button>
+			     <!-- <u-button class="btn" text="签订合同" @click="signContract" v-if="dataObj.cargoOwnerStatus=='未装车'&&dataObj.driverContract!='1'"></u-button> -->
 				<u-button class="btn" text="终止" @click="stop"  v-if="dataObj.orderStatus=='待货主确认'||dataObj.orderStatus=='未装车'"></u-button>
 				<u-button class="btn" text="联系客服"  @click="$helper.contactCustomerService"></u-button>
-				<u-button class="btn" text="确认装车" @click="confirmLoading" v-if="dataObj.orderStatus=='未装车'&&dataObj.driverContract!='1'"></u-button>
+				<u-button class="btn" text="确认装车" @click="confirmLoading" v-if="dataObj.orderStatus=='未装车'"></u-button>
 				<!-- <u-button class="btn" text="确认装车" @click="confirmLoading"></u-button> -->
 				<u-button class="btn" text="修改装车信息"  @click="confirmLoading" v-if="dataObj.orderStatus=='货主驳回装车信息'||dataObj.orderStatus=='平台驳回装车信息'"></u-button>
 				<u-button class="btn" text="确认卸车" @click="confirmUnLoading" v-if="dataObj.orderStatus=='运输中'"></u-button>
@@ -321,7 +321,10 @@
 					});
 			},
 			confirmLoading() {
-				uni.$u.route('/pages/order/confirmLoading', {id:this.id});
+				uni.$u.route('/pages/order/confirmLoading', {
+					obj: JSON.stringify({id:this.id}),
+				});
+				// uni.$u.route('/pages/order/confirmLoading', {id:this.id});
 			},
 			confirmUnLoading() {
 				let item = this.dataDetails
@@ -398,7 +401,10 @@
 							this.dataObj = res.data
 							this.carrierInfo = res.data.carrierInfo
 							this.freightInfo =  res.data.freightInfo
-							this.zcPhoneList = this.carrierInfo.loadingImg.split(',')
+							if(this.carrierInfo.loadingImg&&this.carrierInfo.loadingImg.length>0){
+								this.zcPhoneList = this.carrierInfo.loadingImg.split(',')
+							}
+							
 							// if(res.data.orderStatus!="待货主确认"&&res.data.orderStatus!="未装车"&&res.data.orderStatus!="已终止"){
 							// 	this.status1 = true
 							// }
@@ -409,9 +415,9 @@
 						
 					})
 			},
-			goConfirmLoading(id) {
+			goConfirmLoading(id) {debugger
 				uni.$u.route('/pages/order/confirmLoading', {
-					id: this.id,
+					obj: JSON.stringify({id:this.id}),
 				});
 			},
 		}

+ 65 - 11
pages/order/signContract.vue

@@ -47,17 +47,21 @@
 				<!-- 				<view class="flex"><input type="text" placeholder="请输入运费" v-model="dataDetails.freight"
 						class="text-align-right yf-input">{{dataDetails.freight}}元/车</view> -->
 				<view class="flex">
-					<u--input placeholder="请输入运费" border="none" type="number" v-model="dataDetails.freightCars"
+					<u--input placeholder="请输入运费" border="none" type="number" v-model="dataDetails.freight"
 						inputAlign='right' clearable></u--input>
 					<!-- <span>元/车</span> -->
 				</view>
 			</view>
 			<view class='row-between'>
 				<view class="gray">车牌号</view>
-				<view class="flex">
+				<view class="" style="color:#BBBBBB;" @click="carClick">
+					{{dataDetails.carrierInfo.carNo?dataDetails.carrierInfo.carNo:'请选择车牌号'}}
+				</view>
+				
+				<!-- <view class="flex">
 					<input class="" v-model='dataDetails.carrierInfo.carNo' @click.stop="handleShowKeyboard"
 						:disabled="true" placeholder="输入车牌号" name="input" style="text-align: right;"></input>
-				</view>
+				</view> -->
 				
 			</view>
 			<view class='row-between'>
@@ -138,6 +142,8 @@
 				<!-- <button @click="subCanvas" class="subBtn">完成</button> -->
 			</view>
 		</view>
+		<u-picker :show="showCarList" :columns="carList" :closeOnClickOverlay='true' @close='selectTypeClose'
+			@cancel='selectTypeClose' @confirm='confirmBtn'></u-picker>
 		<master-keyboard ref="keyboard" keyboardtype="car" :show="keyShow" :randomNumber="true" :newCar="false"
 			:defaultValue="carNumber" @keyboardClick="handleClick"></master-keyboard>
 		<u-toast ref="uToast"></u-toast>
@@ -146,11 +152,16 @@
 </template>
 
 <script>
+	import {
+		mapState
+	} from 'vuex';
 	var that;
 	import uploadImage from '@/components/ossutil/uploadFile.js';
 	export default {
 		data() {
 			return {
+				showCarList:false,
+				carList:[],
 				keyShow: false,
 				carNumber: '',
 				isScaleStart: false,
@@ -183,7 +194,11 @@
 
 			};
 		},
-		onLoad(options) {debugger
+		computed: {
+			...mapState(['hasLogin', 'userInfo', 'firstAuthentication']),
+		},
+		onLoad(options) {
+			this.carList = []
 			that = this
 			console.log(JSON.parse(options.obj))
 			// this.dataDetails = JSON.parse(options.obj)
@@ -199,12 +214,48 @@
 					})
 					.exec();
 			});
+			uni.showLoading({
+				title:'加载中'
+			})
+			this.$request.baseRequest('get', '/driverCarInfo/selectDriverCar', {
+					driverId: that.userInfo.driverId,
+					// driverId:this.firstAuthentication.id
+				}).then(res => {
+					if (res.code == '200') {debugger
+						uni.hideLoading()
+						if(res.data.length>0){
+							let _list = []
+							for(let i = 0;i<res.data.length;i++){
+								if(res.data[i].status=='已通过'){
+									 _list.push(res.data[i].carNumber)
+								}
+							}
+							that.carList = [_list]
+						}
+					} else {
+						uni.$u.toast(res.message);
+					}
+			
+				})
+				.catch(res => {
+					uni.$u.toast(res.message);
+				});
 		},
 		methods: {
+			confirmBtn(e){
+				this.dataDetails.carrierInfo.carNo = e.value[0]
+				this.showCarList = false
+			},
+			selectTypeClose(){
+				this.showCarList = false
+			},
+			carClick(){
+				this.showCarList = true
+			},
 			//车牌号弹出键盘
 			handleShowKeyboard() {
 				debugger
-				if (this.dataDetails.carrierInfo.carNo == '') {
+				if (!this.dataDetails.carrierInfo.carNo) {
 					this.carNumber = ''
 				} else {
 					this.carNumber = this.dataDetails.carrierInfo.carNo
@@ -252,7 +303,7 @@
 					})
 					return
 				}
-				if (uni.$u.test.isEmpty(that.dataDetails.freightCars)) {
+				if (uni.$u.test.isEmpty(that.dataDetails.freight)) {
 					that.$refs.uToast.show({
 						type: 'error',
 						message: "运费不能为空!",
@@ -302,7 +353,7 @@
 				_obj.endDates = that.dataDetails.endDates
 				_obj.contactPersonName = that.dataDetails.contactPersonName
 				_obj.contactPersonPhone = that.dataDetails.contactPersonPhone
-				_obj.freightCars = that.dataDetails.freightCars
+				_obj.freight = that.dataDetails.freight
 				_obj.advanceCharge = that.dataDetails.advanceCharge
 				_obj.id = that.dataDetails.id
 				_obj.carNumber =that.dataDetails.carrierInfo.carNo
@@ -344,10 +395,13 @@
 													type: 'success',
 													message: "提交成功",
 													complete() {
-														that.upCallback({
-															size: 10,
-															num: 1
-														})
+														uni.$u.route('/pages/order/confirmLoading', {
+															obj: JSON.stringify(that.dataDetails),
+														});
+														// that.upCallback({
+														// 	size: 10,
+														// 	num: 1
+														// })
 													}
 												})
 											}