From 5c01be6370291febe52adfa74fad8101a197c388 Mon Sep 17 00:00:00 2001
From: qingyiay <2386314947@qq.com>
Date: 星期二, 28 三月 2023 18:27:19 +0800
Subject: [PATCH] 微信绑定测试

---
 pages/driver-page/driver-index/driver-index.vue |   78 +++++++++++++++++++++++++++++---------
 1 files changed, 59 insertions(+), 19 deletions(-)

diff --git a/pages/driver-page/driver-index/driver-index.vue b/pages/driver-page/driver-index/driver-index.vue
index 41a08cd..5d0d623 100644
--- a/pages/driver-page/driver-index/driver-index.vue
+++ b/pages/driver-page/driver-index/driver-index.vue
@@ -16,21 +16,31 @@
 						<text>{{ item.carNum }}</text>
 						寮�
 					</view>
-					<view class="card-left__utils"><u-button @tap.stop="qiangDanBtn(item.orderPlanId)" text="鎶㈠崟" type="primary" shape="circle"></u-button></view>
+					<view class="card-left__utils"><u-button @tap.stop="qiangDanBtn(item)" text="鎶㈠崟" type="primary" shape="circle"></u-button></view>
 				</template>
 				<template v-slot:right-top>
 					<view class="right-top">
 						<view class="card-right-top-row">
 							<view>
-								<text>{{ item.compName }}</text>
+								<text>{{ item.deptName || '' }}</text>
 							</view>
 							<view>
-								<text>{{ item.coalName }}</text>
+								<text>{{ item.coalName || '' }}</text>
 							</view>
 						</view>
 						<view class="card-right-top-row">
 							<view>
 								<text>鍓╀綑{{ item.carNum - item.taskNum }}寮�</text>
+							</view>
+						</view>
+						<view class="card-right-top-row">
+							<view>
+								<text>{{ item.filedName || '' }}</text>
+							</view>
+						</view>
+						<view class="card-right-top-row">
+							<view>
+								<text>{{ item.orderCode || '' }}</text>
 							</view>
 						</view>
 					</view>
@@ -120,13 +130,30 @@
 import { customerId } from '@/utils/status';
 
 export default {
+	props: {
+		indexdriverBillOfLoadingData: {
+			type: Array,
+			default: []
+		}
+	},
+	watch: {
+		indexdriverBillOfLoadingData: {
+			handler(v) {
+				this.driverBillOfLoadingData = v;
+			},
+			deep: true,
+			immediate: true
+		}
+	},
 	data() {
 		return {
 			driverBillOfLoadingData: [],
 			// 鎶㈠崟妯℃�佹
 			qiangDanShow: false,
 			qiangDanTitle: '鎶㈠崟鎻愮ず',
-			qiangDanContent: ''
+			qiangDanContent: '',
+			qiangDanOrderPlanId: null,
+			fleetId: ''
 		};
 	},
 	onShow() {
@@ -141,35 +168,46 @@
 			uni.showLoading({
 				title: '鍔犺浇涓�...'
 			});
-			// this.$reqGet('qiangDanList', { id: customerId }).then(res => {
 			this.$reqGet('qiangDanList').then(res => {
-				console.log('鎶㈠崟鍒楄〃', res);
 				uni.hideLoading();
 				this.driverBillOfLoadingData = res.data;
 			});
 		},
 		// 鎶㈠崟鎸夐挳
 		qiangDanBtn(value) {
-			if (value.taskNum == 0) {
-				this.qiangDan(value.orderPlanId);
+			if (value.tmcCount == '0') {
+				this.qiangDan(value.orderPlanId, value.fleetId);
 			} else {
+				this.qiangDanOrderPlanId = value.orderPlanId;
+				this.fleetId = value.fleetId;
+				this.qiangDanShow = true;
+				this.qiangDanContent = `宸叉姠${value.tmcCount}鍗曪紝纭畾鎶㈠崟锛焋;
 			}
 		},
 		// 鎶㈠崟妯℃�佹
-		qiangDanConfirm() {},
+		qiangDanConfirm() {
+			this.qiangDanContent = '';
+			this.qiangDanShow = false;
+			this.qiangDan(this.qiangDanOrderPlanId, this.fleetId);
+		},
 		qiangDanCancel() {
 			this.qiangDanShow = false;
 		},
 		// 鎶㈠崟璇锋眰
-		qiangDan(id) {
-			// this.$reqPost('qiangDan', { orderPlanId: id, wxUserId: customerId }, 'params').then(res => {
-			this.$reqPost('qiangDan', { orderPlanId: id }, 'params').then(res => {
-				if (res.code == 0) {
-					this.$u.toast('鎶㈠崟鎴愬姛');
-				}
-				console.log('鎶㈠崟', res);
-				this.qiangDanList();
-			});
+		qiangDan(id, fleetId) {
+			this.$reqPost('qiangDan', { orderPlanId: id, fleetId: fleetId }, 'params')
+				.then(res => {
+					if (res.code == 0) {
+						this.$u.toast('鎶㈠崟鎴愬姛');
+					} else {
+						this.$u.toast(res.data ? res.data : '鎶㈠崟澶辫触');
+					}
+				})
+				.then(() => {
+					setTimeout(() => {
+						this.qiangDanList();
+					}, 1000);
+				});
 		},
 		list3CardIconClick(value) {
 			uni.navigateTo({
@@ -252,14 +290,16 @@
 			}
 			&Table {
 				.uni-table {
+					min-width: 94% !important;
 					.uni-table-tr {
 						padding: 0;
 						.uni-table-th {
+							width: 33.3%;
 							line-height: 58rpx;
 							padding: vww(5) vww(10);
 							color: #111111;
 							font-weight: 400;
-							background: #e5e5e5;
+							background: #f5f5f5;
 						}
 						.uni-table-td {
 							font-weight: 400;

--
Gitblit v1.9.1