From b77f2eb3717762c6638856ebe76812c8b1986b57 Mon Sep 17 00:00:00 2001
From: wk
Date: 星期二, 09 七月 2024 17:30:46 +0800
Subject: [PATCH] feat:门卫运输证

---
 pages/doorkeeper-page/doorkeeper-index/exit-index.vue |  168 ++++++++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 134 insertions(+), 34 deletions(-)

diff --git a/pages/doorkeeper-page/doorkeeper-index/exit-index.vue b/pages/doorkeeper-page/doorkeeper-index/exit-index.vue
index fa0fd82..4a7e8f9 100644
--- a/pages/doorkeeper-page/doorkeeper-index/exit-index.vue
+++ b/pages/doorkeeper-page/doorkeeper-index/exit-index.vue
@@ -1,25 +1,28 @@
 <template>
 		<view class="appointment">
-			<view class="wait-collection"
-				style="background: url('https://mx.jzeg.cn:9096/appimg/image/banner/diverbanner.png') no-repeat;background-size:contain">
+			<view class="searchview">
+				<u-search @change="change" :searchIconSize="40" placeholder="璇疯緭鍏ヨ溅鐗屽彿" height="80" clearabled v-model="carNo" @search="search" @custom="custom" @clear="clear" >
+				</u-search >
 			</view>
 			<uni-table border
 				stripe
 				emptyText="鏆傛棤鏇村鏁版嵁">
 				<uni-tr>
-					<uni-th align="center">鍙告満</uni-th>
-					<uni-th align="center">浜у搧</uni-th>
 					<uni-th align="center">杞︾墝鍙�</uni-th>
+					<uni-th align="center">浜у搧</uni-th>
+					<uni-th align="center">鍙告満</uni-th>
 					<uni-th align="center">鎵嬫満鍙�</uni-th>
+					<uni-th align="center">绌鸿溅鍑哄満	</uni-th>
 					<uni-th align="center">鎿嶄綔</uni-th>
 				</uni-tr>
 				<uni-tr v-for="(item, index) in driverBillOfLoadingData"
 					:key="item.id">
-					<uni-td align="center">{{ item.driver  }}</uni-td>
-					<uni-td align="center">{{ item.productName || '' }}</uni-td>
 					<uni-td align="center">{{ item.carNo || '' }}</uni-td>
+					<uni-td align="center">{{ item.productNames || '' }}</uni-td>
+					<uni-td align="center">{{ item.driver  }}</uni-td>
 					<uni-td align="center">{{ item.phone || '' }}</uni-td>
-					<uni-td><u-button text="閫夋嫨"
+					<uni-td align="center">{{ item.isEmptyCar?item.isEmptyCar=='0'?'鍚�':'鏄�':'鍚�'}}</uni-td>
+					<uni-td><u-button text="妫�鏌�"
 							type="primary"
 							@click="yuYueBtnClick(item)"></u-button></uni-td>
 				</uni-tr>
@@ -30,15 +33,35 @@
 				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.title  }}</uni-td>
+						</uni-tr>
+					</uni-table>
 					<view class="receiverPopup__title"><text>纭畾妫�鏌ュ畬姣�</text></view>
 					<view class="receiverPopup__btn"><u-button text="纭畾"
 							type="primary"
 							@click="popClick"
-							:disabled="canClick"
 							:loading="ClickLoading"></u-button></view>
 				</view>
 			</u-popup>
 			<tab-bar :current="1"></tab-bar>
+			<view class="logoutModel">
+				<u-modal :show="logoutShow"
+					:title="logoutTitle"
+					showCancelButton
+					:content="logoutContent"
+					@confirm="logoutConfirm"
+					@cancel="logoutCancel"></u-modal>
+			</view>
 		</view>
 </template>
 
@@ -50,8 +73,14 @@
 			return {
 				show: false, // 寮瑰嚭鍏ㄩ儴棰嗗彇鎻愮ず
 				driverBillOfLoadingData:[],
+				inspectData:[],
 				isAllSelected:false,
 				form:{},
+				carNo:'',
+				logoutShow: false,
+				logoutTitle: '鎻愮ず',
+				logoutContent: '鏄惁妫�鏌ュ畬姣�',
+				previewImageSrc:"",
 				ClickLoading:false
 			}
 		},
@@ -59,33 +88,74 @@
 			this.init();
 		},
 		methods: {
+			logoutConfirm() {
+
+				uni.showLoading({ title: '鍔犺浇涓�...' });
+				this.$reqPost('addCheckLog',{
+								carNo:this.form.carNo,
+								taskId:this.form.id,
+								taskcode:this.form.code,
+							}, 'json').then(res => {
+					if (res.code === 0) {
+						uni.$u.toast('妫�鏌ユ垚鍔�')
+						this.form={}
+						this.ClickLoading = false;
+						this.TaskCoalList()
+						this.logoutShow = false;
+					} else {
+						uni.$u.toast(res.msg ? res.msg : '妫�鏌ュけ璐�')
+						this.logoutShow = false;
+					}
+				})
+			},
+			logoutCancel() {
+				this.logoutShow = false;
+			},
 			yuYueBtnClick(item){
+				this.logoutShow = true;
+				this.inspectData=[]
 				this.form=item
-				this.show = true;
+			},
+			selectionChange(items){
+			  const allIds = this.inspectData.map(item => item);
+			  this.isAllSelected = items?.detail.index.length === allIds.length 
 			},
 			init() {
 				this.isAllSelected=false
 				this.TaskCoalList();
 				this.form={}
+				this.inspectData=[]
 			},
 			popClick() {
-					this.ClickLoading = true;
-					uni.showLoading({ title: '鍔犺浇涓�...' });
-					this.$reqPost('addCheckLog',{
-									carNo:this.form.carNo,
-									taskId:this.form.id,
-									taskcode:this.form.code,
-								}, 'json').then(res => {
-						if (res.code === 0) {
-							uni.$u.toast('妫�鏌ユ垚鍔�')
-							this.form={}
-							this.ClickLoading = false;
-							this.show = false;
-							this.TaskCoalList()
-						} else {
-							uni.$u.toast(res.msg ? res.msg : '妫�鏌ュけ璐�')
-						}
-					})
+					if(this.isAllSelected==true){
+						this.ClickLoading = true;
+						this.inspectData=this.inspectData.map(item=>{
+							return {
+								...item,
+								valve:"閫氳繃"
+							}
+						})
+						uni.showLoading({ title: '鍔犺浇涓�...' });
+						this.$reqPost('addCheckLog',{
+										carNo:this.form.carNo,
+										taskId:this.form.id,
+										taskcode:this.form.code,
+										inspectedResult:JSON.stringify(this.inspectData)
+									}, 'json').then(res => {
+							if (res.code === 0) {
+								uni.$u.toast('妫�鏌ユ垚鍔�')
+								this.form={}
+								this.ClickLoading = false;
+								this.inspectData=[]
+								this.show = false;
+								this.TaskCoalList()
+							} else {
+								uni.$u.toast(res.msg ? res.msg : '妫�鏌ュけ璐�')
+							}
+						})
+					}else{
+						uni.$u.toast('蹇呴』鍏ㄩ儴妫�娴�')
+					}
 			},
 			open() {},
 			close() {
@@ -96,17 +166,46 @@
 				uni.showLoading({
 					title: '鍔犺浇涓�...'
 				});
-				this.$reqGet('getCheckTaskCoal',{flag:1}).then(res => {
-					uni.hideLoading();
-					this.driverBillOfLoadingData = res.data;
-				});
+				
+				if(!this.carNo){
+					this.$reqGet('getCheckTaskCoal',{flag:1}).then(res => {
+						uni.hideLoading();
+						this.driverBillOfLoadingData = res.data;
+					});
+				}else{
+					this.$reqGet('getCheckTaskCoal',{flag:1,carNo:this.carNo}).then(res => {
+						uni.hideLoading();
+						this.driverBillOfLoadingData = res.data;
+					});
+				}
+				
 				
 			},
+			change(res) {
+				console.log(res)
+			},
+			search(res) {
+				console.log(res)
+				this.TaskCoalList()
+			},
+			clear(res) {
+				this.carNo=""
+			},
+			custom(res) {
+				console.log(res)
+			}
 		}
 	};
 </script>
 
 <style lang="scss" scoped>
+	.searchview{
+		margin: 20rpx 0;
+		height: 200rpx;
+		u-search{
+			width: 100rpx;
+		}
+	}
 	.receiverPopup {
 		height: vww(110);
 		width: 300rpx;
@@ -127,10 +226,6 @@
 			}
 		}
 	}
-	.wait-collection {
-			width: 100%;
-			height: 600rpx;
-		}
 	::v-deep.appointment {
 		.appointment-description {
 			margin: vww(8) 0;
@@ -203,4 +298,9 @@
 			}
 		}
 	}
+	.wait-appointment,
+	.Reserved {
+		position: relative;
+		top: vww(-120);
+	}
 </style>
\ No newline at end of file

--
Gitblit v1.9.1