From 0ad1bb4a25e7b5d98b4d0fc18e7294d132e1ec3e Mon Sep 17 00:00:00 2001
From: wk
Date: 星期四, 13 六月 2024 14:44:58 +0800
Subject: [PATCH] feat:运输证

---
 pages/driver-page/driver-index/driver-index.vue |  208 +++++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 188 insertions(+), 20 deletions(-)

diff --git a/pages/driver-page/driver-index/driver-index.vue b/pages/driver-page/driver-index/driver-index.vue
index 86a6c78..ec676d1 100644
--- a/pages/driver-page/driver-index/driver-index.vue
+++ b/pages/driver-page/driver-index/driver-index.vue
@@ -68,7 +68,7 @@
 									size="40"></u-icon></view>
 							<view class="send-date">{{ item.sendDate }}</view>
 							<view class="type">
-								<view class="coal-name">{{ item.coalName }}</view>
+								<view class="coal-name">{{ item.productNames || item.productName }}</view>
 							</view>
 						</view>
 						<view class="fourth-line"
@@ -151,11 +151,15 @@
 									<view class="send-date">{{ item.sendDate }}</view>
 								</view>
 								<view class="type">
-									<view class="coal-name">{{ item.coalName }}</view>
+									<view class="coal-name">{{ item.productNames || item.productName }}</view>
 									<!-- <view class="order-type">{{ item.orderType }}</view> -->
 								</view>
 							</view>
-							<view class="fourth-line">
+							<view class="fifth-line">
+								<view class="button-img"
+									@click.stop="cancelCerifCate(item)">
+									娣诲姞鎶艰繍鍛�
+								</view>
 								<view class="button-img"
 									@click.stop="cancelAppoint(item)">
 									璇锋眰閫�鍗�
@@ -174,6 +178,17 @@
 						content="鏄惁纭閫�鍗�"
 						@confirm="cancelAppointConfirm"
 						@cancel="cancelAppointCancel"></u-modal>
+				</view>
+				<!-- 鍦哄唴鎺ュ崟寮圭獥 -->
+				<view class="">
+					<u-modal :show="insideConnectShow"
+						title="鎺ュ崟閫夋嫨"
+						showCancelButton
+						cancel-text="姝e父鎺ュ崟"
+						confirm-text="鍦哄唴鎺ュ崟"
+						content="鍦哄唴鎺ュ崟鏃犻渶绉扮毊,鏄惁纭鎺ュ崟"
+						@confirm="insideConnectConfirm"
+						@cancel="insideConnectCancel"></u-modal>
 				</view>
 				<!-- 宸查绾︽彁鐓ゅ崟 -->
 				<view class="Reserved">
@@ -240,11 +255,16 @@
 									<view class="send-date">{{ item.yuYueSection|| ''  }}</view>
 								</view>
 								<view class="type">
-									<view class="coal-name">{{ item.coalName || '' }}</view>
+									<view class="coal-name">{{ item.productNames || item.productName }}</view>
 									<!-- <view class="order-type">{{ item.orderType }}</view> -->
 								</view>
 							</view>
-							<view class="fourth-line">
+							<view class="fourth-line"
+								v-if="item.status<3">
+									<view class="button-img"
+										@click.stop="cancelCerifCate(item)">
+										娣诲姞鎶艰繍鍛�
+									</view>
 								<view class="button-img"
 									@click.stop="cancelAppoint(item)">
 									璇锋眰閫�鍗�
@@ -256,6 +276,31 @@
 				</view>
 			</view>
 		</view>
+		<u-popup :show="show"
+			@close="close"
+			@open="open"
+			mode="center"
+			round="10">
+			<view class="receiverPopup">
+				<uni-table border
+					stripe
+					type="selection" 
+					@selection-change="selectionChange"
+					emptyText="鏆傛棤鏇村鏁版嵁">
+					<uni-tr>
+						<uni-th align="center">鎶艰繍鍛�</uni-th>
+					</uni-tr>
+					<uni-tr v-for="(item, index) in inspectData"
+						:key="item.id">
+						<uni-td align="center">{{ item.name.split("|")[0]  }}</uni-td>
+					</uni-tr>
+				</uni-table>
+				<view class="receiverPopup__btn"><u-button text="纭畾"
+						type="primary"
+						@click="popClick"
+						:loading="ClickLoading"></u-button></view>
+			</view>
+		</u-popup>
 	</view>
 </template>
 
@@ -295,6 +340,9 @@
 		},
 		data() {
 			return {
+				show: false,
+				yaList:[],
+				inspectData:[],
 				driverBillOfLoadingData: {
 					list1: [],
 					list2: [],
@@ -305,20 +353,49 @@
 				qiangDanTitle: '鎺ュ崟鎻愮ず',
 				qiangDanContent: '',
 				qiangDanOrderPlanId: null,
-				fleetId: '',
-				xsUserId: '',
-				customerId: '',
 				isFirstLogin: true, //鏄惁鏄涓�娆$櫥褰�
 				phone: "",
 				isFirstTime: false, //鏄惁鏄櫥褰曡繘鍏ラ椤碉紝杩樻槸鍒殑椤甸潰杩斿洖 false鏄櫥褰� true鏄埆鐨勯〉闈�
 				cancelAppointShow: false, //纭閫�鍗曞脊绐楁帶鍒�
-				cancelAppointId: ''
+				cancelAppointId: '',
+				insideConnectShow: false,
+				orderPlanId: '',
+				fleetId: '',
+				customerId: '',
+				xsUserId: '',
+				filedId: '',
 			};
 		},
 		onShow() {
 			this.init();
 		},
 		methods: {
+			open() {},
+			close() {
+				this.show = false;
+			},
+			selectionChange(e) {
+				this.yaList= e.detail.index.map(item=>{
+					return this.inspectData[item]
+				})
+			},
+			popClick(){
+				let data=this.yaList.map(item=>{
+					return  item.name
+				})
+				let paramsData={
+					idCardEscort:data.join(','),roadTransportId:this.yaList[0].roadTransportId,id: this.yaList[0].Id
+				}
+				this.$reqPut('saveMyEscort', paramsData, 'json')
+					.then(res => {
+						if (res.code == 0) {
+							this.$u.toast('娣诲姞鎴愬姛');
+							this.show=false
+						} else {
+							this.$u.toast(res.msg ? res.msg : '娣诲姞澶辫触');
+						}
+					})
+			},
 			// 璺宠浆鍦板浘
 			skipMap(val) {
 				uni.navigateTo({
@@ -328,6 +405,7 @@
 				});
 			},
 			init() {
+				this.inspectData=[]
 				this.qiangDanList();
 			},
 			// 鍙告満棣栭〉鍒楄〃
@@ -342,16 +420,26 @@
 			},
 			// 鎺ュ崟鎸夐挳
 			qiangDanBtn(value) {
-				if (value.tmcCount == '0') {
-					this.qiangDan(value.orderPlanId, value.fleetId, value.customerId === null ? '0' : value.customerId,
-						value.xsUserId === null ? '0' : value.xsUserId);
+				//鏄惁鍙互鍦哄唴鎺ュ崟锛�1 鍙互2涓嶅彲浠�
+				if (value.isInsideConnect === 1) {
+					this.insideConnectShow = true
+					this.orderPlanId = value.orderPlanId
+					this.fleetId = value.fleetId
+					this.customerId = !value.customerId ? '0' : value.customerId
+					this.xsUserId = !value.xsUserId ? '0' : value.xsUserId
+					this.filedId = value.filedId
 				} else {
-					this.qiangDanOrderPlanId = value.orderPlanId;
-					this.fleetId = value.fleetId;
-					this.customerId = value.customerId === null ? '0' : value.customerId;
-					this.xsUserId = value.xsUserId === null ? '0' : value.xsUserId;
-					this.qiangDanShow = true;
-					this.qiangDanContent = `宸叉帴${value.tmcCount}鍗曪紝纭畾鎺ュ崟锛焋;
+					if (value.tmcCount == '0') {
+						this.qiangDan(value.orderPlanId, value.fleetId, !value.customerId ? '0' : value.customerId,
+							!value.xsUserId ? '0' : value.xsUserId);
+					} else {
+						this.qiangDanOrderPlanId = value.orderPlanId;
+						this.fleetId = value.fleetId;
+						this.customerId = !value.customerId ? '0' : value.customerId;
+						this.xsUserId = !value.xsUserId ? '0' : value.xsUserId;
+						this.qiangDanShow = true;
+						this.qiangDanContent = `宸叉帴${value.tmcCount}鍗曪紝纭畾鎺ュ崟锛焋;
+					}
 				}
 			},
 			// 鎺ュ崟妯℃�佹
@@ -390,6 +478,25 @@
 						uni.hideLoading()
 					})
 			},
+			insideConnectHandle(orderPlanId, fleetId, customerId, xsUserId, filedId) {
+				uni.showLoading({
+					title: '鍔犺浇涓�'
+				})
+				this.$reqPost('insideConnect', {
+					orderPlanId,
+					fleetId,
+					customerId,
+					xsUserId,
+					filedId
+				}, 'params').then(res => {
+					uni.hideLoading()
+					if (res.code == 0) {
+						this.$u.toast('鍦哄唴鎺ュ崟鎴愬姛');
+					} else {
+						this.$u.toast(res.msg ? res.msg : '鍦哄唴鎺ュ崟澶辫触');
+					}
+				})
+			},
 			list3CardIconClick(value) {
 				uni.navigateTo({
 					url: `/pages/driver-page/driver-index/bill-of-lading-details/bill-of-lading-details?orderPlanId=${value.id}&yyId=${value.yyId}&orderType=${value.orderType}`
@@ -404,11 +511,27 @@
 			// 璇锋眰閫�鍗�
 			cancelAppoint(item) {
 				if (item.status >= 3) {
-					this.$uy.toast('褰撳墠鐘舵�佷笉鍙��鍗�')
+					this.$u.toast('褰撳墠鐘舵�佷笉鍙��鍗�')
 					return
 				}
 				this.cancelAppointShow = true
 				this.cancelAppointId = item.id
+			},
+			cancelCerifCate(value){
+				this.$reqGet('getMyEscortList', { customerId: value.customerId }).then(res => {
+					this.inspectData=[]
+					if (res.code == 0) {
+						this.inspectData=res.data.persons.map(item=>{
+							return {name:item,roadTransportId:res.data.id,Id: value.id}
+						})
+						this.show=true
+					} else {
+						this.$u.toast(res.msg ? res.msg : '璇锋坊鍔犻亾璺繍杈撹瘉');
+						uni.navigateTo({
+							url: '/pages/driver-page/drvier-my/certifiCate/certifiCate'
+						})
+					}
+				})
 			},
 			// 閫�鍗曞脊绐楃‘璁�
 			cancelAppointConfirm() {
@@ -434,6 +557,15 @@
 			// 閫�鍗曞脊绐楀彇娑�
 			cancelAppointCancel() {
 				this.cancelAppointShow = false
+			},
+			insideConnectCancel() {
+				this.insideConnectShow = false
+				this.qiangDan(this.orderPlanId, this.fleetId, this.customerId, this.xsUserId)
+			},
+			// 鍦哄唴鎺ュ崟
+			insideConnectConfirm() {
+				this.insideConnectShow = false
+				this.insideConnectHandle(this.orderPlanId, this.fleetId, this.customerId, this.xsUserId, this.filedId)
 			},
 			// 鍘婚绾�
 			toAppointmentClick(value) {
@@ -538,7 +670,26 @@
 
 		}
 	}
-
+	.receiverPopup {
+		height: vww(110);
+		width: 300rpx;
+		
+		.receiverPopup__title {
+			margin: vww(10) auto 0;
+			width: 80%;
+			text-align: center;
+		}
+	
+	
+		&__btn {
+			margin: vww(10) auto;
+			width: 50%;
+	
+			.u-button {
+				height: vww(20);
+			}
+		}
+	}
 	/deep/.u-button {
 		width: 100%;
 		height: 28px !important;
@@ -976,6 +1127,23 @@
 					.fourth-line {
 						@include fourthLine;
 					}
+					.fifth-line {
+						height: vww(68);
+						display: flex;
+						align-items: center;
+						.button-img {
+							width: vww(122);
+							height: vww(41);
+							background: url('https://mx.jzeg.cn:9096/appimg/image/banner/button.png') no-repeat;
+							background-size: cover;
+							font-size: 28rpx;
+							font-weight: 300;
+							color: #ffffff;
+							text-align: center;
+							line-height: vww(40);
+						
+						}
+					}
 				}
 			}
 

--
Gitblit v1.9.1