From 5abcde36961125cbf436f91b8c17610a6b5f8308 Mon Sep 17 00:00:00 2001
From: sen <sen@qq.com>
Date: 星期三, 15 四月 2026 12:15:08 +0800
Subject: [PATCH] 修改调度单必填校验

---
 ui/admin-ui3/src/views/tms/tmsDispatchOrder/index.vue |  542 +++++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 413 insertions(+), 129 deletions(-)

diff --git a/ui/admin-ui3/src/views/tms/tmsDispatchOrder/index.vue b/ui/admin-ui3/src/views/tms/tmsDispatchOrder/index.vue
index 9c46032..357e00c 100644
--- a/ui/admin-ui3/src/views/tms/tmsDispatchOrder/index.vue
+++ b/ui/admin-ui3/src/views/tms/tmsDispatchOrder/index.vue
@@ -5,7 +5,14 @@
       @row-update="rowUpdate" @row-save="rowSave" @refresh-change="refreshChange" @row-del="rowDel"
       @search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange"
       @current-change="currentChange" @size-change="sizeChange" @on-load="onLoad">
-
+      <template #licensePlate-form="{ row, disabled }">
+        <el-input v-model="form.licensePlate" placeholder="璇烽�夋嫨杞︾墝鍙�" readonly :disabled="disabled"
+          @click="handleVehicleSelect">
+          <template #append>
+            <el-button icon="el-icon-search" @click="handleVehicleSelect" />
+          </template>
+        </el-input>
+      </template>
       <!-- template 涓� -->
       <template #requiredVehicleTypes-form="{ row, disabled }">
         <template v-if="disabled">
@@ -23,7 +30,8 @@
           <span>{{ dictFormat(order_type, row?.orderType || form?.orderType) }}</span>
         </template>
         <template v-else>
-          <el-select v-model="form.orderType" placeholder="璇烽�夋嫨璁㈠崟绫诲瀷"  @change="(val) => handleOrderTypeChange(val)" style="width: 100%" clearable>
+          <el-select v-model="form.orderType" placeholder="璇烽�夋嫨璁㈠崟绫诲瀷" @change="(val) => handleOrderTypeChange(val)"
+            style="width: 100%" clearable>
             <el-option v-for="item in order_type" :key="item.value" :label="item.label" :value="parseInt(item.value)" />
           </el-select>
         </template>
@@ -78,11 +86,10 @@
         <el-button type="primary" icon="Male" :disabled="pageF.single" @click="handleConnectHang"
           v-hasPermi="['tms:tmsDispatchOrder:connectHang']">鎺ユ寕
         </el-button>
-
-        <el-button type="warning" icon="Avatar" :disabled="!(isCustoms == 0)" @click="handleCustoms"
+        <el-button type="warning" icon="Avatar" :disabled="selectionList.length === 0" @click="handleCustoms"
           v-hasPermi="['tms:tmsDispatchOrder:customs']">濮旀墭鎶ュ叧淇℃伅
         </el-button>
-        <el-button type="primary" icon="UserFilled" :disabled="!(isLoad == 0)" @click="handleLoading"
+        <el-button type="primary" icon="UserFilled" :disabled="selectionList.length === 0" @click="handleLoading"
           v-hasPermi="['tms:tmsDispatchOrder:loading']">濮旀墭鍗歌揣淇℃伅
         </el-button>
         <el-button type="primary" icon="UserFilled" :disabled="pageF.single" @click="handleZZ"
@@ -299,26 +306,40 @@
       </div>
 
       <div v-if="optionType == 'customs'">
-        <el-descriptions style="margin-bottom: 20px" :column="2" border>
+        <el-descriptions v-if="optionNum == 'radio'" style="margin-bottom: 20px" :column="2" border>
           <el-descriptions-item label="璋冨害鍗曞彿">{{ form.dispatchNo }}</el-descriptions-item>
           <el-descriptions-item label="瀹㈡埛">{{ form.customerName }}</el-descriptions-item>
           <el-descriptions-item label="椤圭洰鍚嶇О">{{ form.projectName }}</el-descriptions-item>
           <el-descriptions-item label="杩愯緭璺嚎">{{ form.transportLine }}</el-descriptions-item>
         </el-descriptions>
+        <el-table v-if="optionNum == 'checkbox'" :data="clearanceList" border size="small"
+          style="width: 100%; margin-bottom: 20px">
+          <el-table-column prop="dispatchNo" label="璋冨害鍗曞彿" width="150" />
+          <el-table-column prop="customerName" label="瀹㈡埛" min-width="120" show-overflow-tooltip />
+          <el-table-column prop="projectName" label="椤圭洰鍚嶇О" min-width="120" show-overflow-tooltip />
+          <el-table-column prop="transportLine" label="杩愯緭璺嚎" min-width="150" show-overflow-tooltip />
+        </el-table>
+
         <avue-form v-model="form" ref="boxFormRef" :option="boxFormOption">
 
         </avue-form>
       </div>
 
       <div v-if="optionType == 'loading'">
-        <el-descriptions style="margin-bottom: 20px" :column="2" border>
+        <el-descriptions v-if="optionNum == 'radio'" style="margin-bottom: 20px" :column="2" border>
           <el-descriptions-item label="璋冨害鍗曞彿">{{ form.dispatchNo }}</el-descriptions-item>
           <el-descriptions-item label="瀹㈡埛">{{ form.customerName }}</el-descriptions-item>
           <el-descriptions-item label="椤圭洰鍚嶇О">{{ form.projectName }}</el-descriptions-item>
           <el-descriptions-item label="杩愯緭璺嚎">{{ form.transportLine }}</el-descriptions-item>
         </el-descriptions>
+        <el-table v-if="optionNum == 'checkbox'" :data="clearanceList" border size="small"
+          style="width: 100%; margin-bottom: 20px">
+          <el-table-column prop="dispatchNo" label="璋冨害鍗曞彿" width="150" />
+          <el-table-column prop="customerName" label="瀹㈡埛" min-width="120" show-overflow-tooltip />
+          <el-table-column prop="projectName" label="椤圭洰鍚嶇О" min-width="120" show-overflow-tooltip />
+          <el-table-column prop="transportLine" label="杩愯緭璺嚎" min-width="150" show-overflow-tooltip />
+        </el-table>
         <avue-form v-model="form" ref="boxFormRef" :option="boxFormOption">
-
         </avue-form>
       </div>
       <template #footer>
@@ -635,7 +656,17 @@
     <flowLog ref="flowLogIshow" :isShow="false" :flowParams="flowParams"></flowLog>
 
   </basicContainer>
+  <el-dialog title="閫夋嫨杞﹁締" v-model="vehicleDialogVisible" width="70%" append-to-body :close-on-click-modal="false">
+    <avue-crud ref="vehicleCrudRef" :option="vehicleOption" :data="vehicleData" :page="vehiclePage"
+      @on-load="loadVehicleList" @search-change="vehicleSearchChange" @search-reset="vehicleSearchReset"
+      @current-change="vehicleCurrentChange" @size-change="vehicleSizeChange" @row-click="handleVehicleRowClick">
+    </avue-crud>
 
+    <template #footer>
+      <el-button @click="vehicleDialogVisible = false">鍙� 娑�</el-button>
+      <el-button type="primary" @click="confirmVehicleSelection">纭� 瀹�</el-button>
+    </template>
+  </el-dialog>
 
 </template>
 
@@ -665,7 +696,7 @@
   importTemplateTmsDispatchOrder, ypdddjSumbit,
   tmsTmsDispatchOrderImportLog,
   saveTmsFinanceDetail2,
-  getLastLicensePlate
+  getLastLicensePlate,
 } from "@/api/tms/tmsDispatchOrder";
 import useCurrentInstance from "@/utils/useCurrentInstance";
 import { computed, onMounted, onBeforeUnmount, reactive, ref, toRefs, watch, getCurrentInstance, nextTick } from "vue";
@@ -705,15 +736,27 @@
 import {
   tmsFinanceDetail
 } from "@/api/tms/tmsDispatchOrder";
-const { appContext } = getCurrentInstance();
+const { appContext } = getCurrentInstance() as any;
 
 const { proxy } = useCurrentInstance(
 );
+// 瀹氫箟绫诲瀷
+interface VehicleRow {
+  id?: string;
+  licensePlate?: string;
+  serviceProviderName?: string;
+  vehicleType?: string;
+  internalCode?: string;
+  licenseHk?: string;
+  licenseMo?: string;
+  [key: string]: any;
+}
 const { fee_type, sys_currency, vehicle_type, order_type } = proxy.useDict('fee_type', 'sys_currency', 'vehicle_type', 'order_type')
 const crudRef = ref();
 const boxFormRef = ref();
 const goodsCrudRef = ref();
 const actualFormRef = ref();
+const isAutoSettingVehicle = ref(false);
 /**
  * 瀛楀吀鍏叡杞崲鍑芥暟
  */
@@ -1164,9 +1207,9 @@
         // },
         orderTime: {
           label: '涓嬪崟鏃堕棿',
-          type: 'datetime',  // 鏀逛负 datetime 绫诲瀷
-          format: 'YYYY-MM-DD HH:mm:ss',
-          valueFormat: 'YYYY-MM-DD HH:mm:ss',
+          type: 'date',  // 鏀逛负 datetime 绫诲瀷
+          format: 'YYYY-MM-DD',
+          valueFormat: 'YYYY-MM-DD',
           display: true,
           rules: [
             {
@@ -1342,37 +1385,52 @@
               message: "涓婚┚椹跺憳涓嶈兘涓虹┖", trigger: "change"
             }
           ],
-          change: (val: any) => {
-            // 闃叉閲嶅鎵ц
+          // 鍦� mainDriverId 鐨� change 浜嬩欢涓�
+          change: async (val: any) => {
             if (data.isChanging) return;
             data.isChanging = true;
+            isAutoSettingVehicle.value = true;
 
             const table = crudRef.value?.getPropRef?.('mainDriverId')?.$refs?.temp;
             if (!table) {
               data.isChanging = false;
+              isAutoSettingVehicle.value = false;
               return;
             }
 
             let active = table.active;
             if (Array.isArray(active)) active = active[0];
+            if (active && active.driverName) {
+              try {
 
-            if (active) {
-              Object.assign(form.value, {
-                mainDriverId: active.id,
-                mainDriverName: active.driverName,
-              });
+                await nextTick(); // 绛夊緟娓呯┖鐢熸晥
+                const res = await getLastLicensePlate(active.driverName);
 
-              // 鑾峰彇杞︾墝鍙峰苟璧嬪��
-              getLastLicensePlate(active.driverName).then(res => {
-                if (res.code == 200) {
-                  form.value.licensePlate = res.data.licensePlate;
-                  form.value.vehicleId = res.data.vehicleId
+                if (res.code === 200 && res.data) {
+                  const vehicleData = res.data;
+                  nextTick(() => {
+                    Object.assign(form.value, {
+                      licensePlate: vehicleData.licensePlate,
+                      vehicleId: vehicleData.vehicleId,
+                      actualVehicleType: vehicleData.actualVehicleType,
+                      mainDriverName: active.driverName
+
+
+                    });
+                  })
+                  await nextTick();
                 }
-              }).finally(() => {
+              } catch (e) {
+                console.error("鑷姩鑾峰彇杞︾墝澶辫触", e);
+              } finally {
                 data.isChanging = false;
-              });
+                setTimeout(() => {
+                  // isAutoSettingVehicle.value = false;
+                }, 500); // 绋嶅井寤堕暱涓�鐐规椂闂达紝闃叉 vehicleId 鐨� change 浜嬩欢璇Е
+              }
             } else {
               data.isChanging = false;
+              // isAutoSettingVehicle.value = false;
             }
           },
           // change: (val: any) => {
@@ -1400,7 +1458,7 @@
             searchMenuSpan: 5,
             column: {
               vehicleProviderName: {
-                label: '杞﹁締鏈嶅姟鍟�1', minWidth: 130,
+                label: '杞﹁締鏈嶅姟鍟�', minWidth: 130,
                 search: true,
               },
               driverName: {
@@ -1491,6 +1549,7 @@
               if (Array.isArray(value)) {
                 id = value[0]
               }
+
               getTmsDriver(id).then(res => {
                 return callback(res.data || {})
               })
@@ -1510,92 +1569,117 @@
           }
 
         },
-        vehicleId: {
+        licensePlate: {
           label: '杞︾墝鍙�', dataType: 'string',
           display: true,
+          readonly: true,
           rules: [
             {
-              required: true,
+              required: false,
               message: "杞︾墝鍙蜂笉鑳戒负绌�", trigger: "change"
             }
           ],
-          change: (val: any) => {
-            const table = crudRef.value?.getPropRef?.('vehicleId')?.$refs?.temp;
-            if (!table) return;
-            let active = table.active;
-            if (Array.isArray(active)) active = active[0];
-            if (active) {
-              Object.assign(form.value, {
-                vehicleId: active.id,
-                licensePlate: active.licensePlate,
-                actualVehicleType: active.vehicleType,
-              });
-            }
-          },
-          type: 'table', suffixIcon: 'search',
-          children: {
-            border: true,
-            searchLabelWidth: 100,
-            searchMenuSpan: 5,
-            column: {
-              serviceProviderName: {
-                label: '杞﹁締鏈嶅姟鍟�', minWidth: 130,
-                search: true,
-              },
-              vehicleType: {
-                label: '杞﹁締绫诲瀷', minWidth: 120,
-                type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/vehicle_type',
-
-                search: true,
-              },
-              internalCode: {
-                label: '杞﹁締鍐呴儴缂栫爜', minWidth: 120,
-                search: true,
-              },
-              licensePlate: {
-                label: '杞︾墝鍙�', minWidth: 120,
-                search: true,
-              },
-              licenseHk: {
-                label: '棣欐腐鐗岀収', minWidth: 120,
-                search: true,
-              },
-              licenseMo: {
-                label: '婢抽棬鐗岀収', minWidth: 120,
-                search: true,
-              },
-            },
-
-          },
-          props: {
-            label: 'licensePlate',
-            value: 'id'
-          },
-          onLoad: ({ page, value, data }: { page: any, value: any, data: any }, callback: any) => {
-            if (value) {
-              let id = value;
-              if (Array.isArray(value)) {
-                id = value[0]
-              }
-              getTmsVehicle(id).then(res => {
-                return callback(res.data || {})
-              })
-            } else {
-              listTmsVehicle({
-                pageSize: page.pageSize,
-                pageNum: page.currentPage, ...data,
-                carrierType: form.value.operationMode, serviceProviderId: form.value.vehicleProviderId
-              }).then(res => {
-                return callback({
-                  total: res.total,
-                  data: res.rows || [],
-                })
-              })
-            }
-
+          click: ({ value, column }) => {
+            // 鐐瑰嚮杈撳叆妗嗘椂瑙﹀彂閫夋嫨寮圭獥
+            handleVehicleSelect();
           }
-
         },
+        // vehicleId: {
+        //   label: '杞︾墝鍙�', dataType: 'string',
+        //   display: true,
+        //   rules: [
+        //     {
+        //       required: true,
+        //       message: "杞︾墝鍙蜂笉鑳戒负绌�", trigger: "change"
+        //     }
+        //   ],
+        //   change: (val: any) => {
+        //     if (isAutoSettingVehicle.value) {
+        //       return;
+        //     }
+
+        //     const table = crudRef.value?.getPropRef?.('vehicleId')?.$refs?.temp;
+        //     if (!table) return;
+        //     let active = table.active;
+        //     if (Array.isArray(active)) active = active[0];
+        //     console.log(9852);
+
+        //     if (active) {
+        //       Object.assign(form.value, {
+        //         vehicleId: active.id,
+        //         licensePlate: active.licensePlate,
+        //         actualVehicleType: active.vehicleType,
+        //       });
+        //     }
+        //   },
+        //   type: 'table', suffixIcon: 'search',
+        //   children: {
+        //     border: true,
+        //     searchLabelWidth: 100,
+        //     searchMenuSpan: 5,
+        //     column: {
+        //       serviceProviderName: {
+        //         label: '杞﹁締鏈嶅姟鍟�', minWidth: 130,
+        //         search: true,
+        //       },
+        //       vehicleType: {
+        //         label: '杞﹁締绫诲瀷', minWidth: 120,
+        //         type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/vehicle_type',
+
+        //         search: true,
+        //       },
+        //       internalCode: {
+        //         label: '杞﹁締鍐呴儴缂栫爜', minWidth: 120,
+        //         search: true,
+        //       },
+        //       licensePlate: {
+        //         label: '杞︾墝鍙�', minWidth: 120,
+        //         search: true,
+        //       },
+        //       licenseHk: {
+        //         label: '棣欐腐鐗岀収', minWidth: 120,
+        //         search: true,
+        //       },
+        //       licenseMo: {
+        //         label: '婢抽棬鐗岀収', minWidth: 120,
+        //         search: true,
+        //       },
+        //     },
+
+        //   },
+        //   props: {
+        //     label: 'licensePlate',
+        //     value: 'id'
+        //   },
+        //   onLoad: ({ page, value, data }: { page: any, value: any, data: any }, callback: any) => {
+        //     if (value) {
+        //       let id = value;
+        //       if (Array.isArray(value)) {
+        //         id = value[0]
+        //       }
+        //       console.log(555, 'xq1');
+
+        //       getTmsVehicle(id).then(res => {
+        //         return callback(res.data || {})
+        //       })
+        //     } else {
+        //       console.log(444, 'xq1');
+
+        //       listTmsVehicle({
+        //         pageSize: page.pageSize,
+        //         pageNum: page.currentPage, ...data,
+        //         carrierType: form.value.operationMode, serviceProviderId: form.value.vehicleProviderId
+        //       }).then(res => {
+        //         return callback({
+        //           total: res.total,
+        //           data: res.rows || [],
+        //         })
+        //       })
+        //     }
+
+        //   }
+
+        // },
         actualVehicleType: {
           label: '娲惧嚭杞﹀瀷',
           display: true, type: 'select', dicUrl: '/system/dict/data/type/vehicle_type', dataType: 'string',
@@ -2600,10 +2684,12 @@
           if (Array.isArray(value)) {
             id = value[0]
           }
+
           getTmsVehicle(id).then(res => {
             return callback(res.data || {})
           })
         } else {
+
           listTmsVehicle({ pageSize: page.pageSize, pageNum: page.currentPage, ...data }).then(res => {
             return callback({
               total: res.total,
@@ -3199,9 +3285,9 @@
   }
 });
 const zzItemsTableData = ref();
-
-
-
+/* 鎶ュ叧鍒楄〃 */
+const clearanceList = ref([]);
+const optionNum = ref(''); // 鐢ㄤ簬鍖哄垎鏄姤鍏宠繕鏄鍗�
 
 const {
   tableData,
@@ -3237,6 +3323,7 @@
   },
   handleSelectionChangeFunc: (selection: any) => {
     selectionList.value = selection;
+    clearanceList.value = selection;
     if (selection.length > 0) {
       isCustoms.value = selection[0].isCustoms;
       isLoad.value = selection[0].isLoad;
@@ -3297,14 +3384,17 @@
     // 銆愭牳蹇冧慨鏀广�戯細鐩存帴杩斿洖锛屼笉瑕佽祴鍊肩粰 queryParams.value
     return finalParams;
   },
-  handleBeforeOpenFunc: (type: string) => {
+  handleBeforeOpenFunc: (type: string,) => {
 
     if (type == 'add') {
       form.value = {};
     } else if (type == 'edit') {
       // form.value = row;
+      handleOrderTypeChange(form.value.orderType);
 
     }
+
+
   }
 
 })
@@ -3538,11 +3628,24 @@
       pageF.isUploading = false;
     })
   } else if (optionType.value === 'customs') {
-    customsOrder({
-      id: form.value.id,
-      customsServiceProviderId: form.value.customsServiceProviderId,
-      customsServiceProviderName: form.value.customsServiceProviderName,
-    }).then(res => {
+    let result = <any>[];
+    if (optionNum.value == 'checkbox') {
+      result = clearanceList.value.map(item => {
+        return {
+          id: item.id,
+          customsServiceProviderId: form.value.customsServiceProviderId,
+          customsServiceProviderName: form.value.customsServiceProviderName
+        };
+      });
+    } else if (optionNum.value == 'radio') {
+      result = [{
+        id: form.value.id,
+        customsServiceProviderId: form.value.customsServiceProviderId,
+        customsServiceProviderName: form.value.customsServiceProviderName
+      }]
+    }
+
+    customsOrder(result).then(res => {
       ElMessage({
         message: "鎻愪氦鎴愬姛锛�",
         type: 'success'
@@ -3553,11 +3656,25 @@
       pageF.isUploading = false;
     })
   } else if (optionType.value === 'loading') {
-    loadingOrder({
-      id: form.value.id,
-      loadingServiceProviderId: form.value.loadingServiceProviderId,
-      loadingServiceProviderName: form.value.loadingServiceProviderName,
-    }).then(res => {
+
+    let result = <any>[];
+    if (optionNum.value == 'checkbox') {
+      result = clearanceList.value.map(item => {
+        return {
+          id: item.id,
+          loadingServiceProviderId: form.value.loadingServiceProviderId,
+          loadingServiceProviderName: form.value.loadingServiceProviderName
+        };
+      });
+    } else if (optionNum.value == 'radio') {
+      result = [{
+        id: form.value.id,
+        loadingServiceProviderId: form.value.loadingServiceProviderId,
+        loadingServiceProviderName: form.value.loadingServiceProviderName
+      }]
+    }
+
+    loadingOrder(result).then(res => {
       ElMessage({
         message: "鎻愪氦鎴愬姛锛�",
         type: 'success'
@@ -4194,17 +4311,32 @@
 const handleCustoms = () => {
   title.value = '琛ュ厖濮旀墭鎶ュ叧淇℃伅';
   open.value = true;
-  form.value = selectionList.value[0];
+  form.value = clearanceList.value[0];
   optionType.value = 'customs';
+  optionNum.value = 'checkbox'
   boxFormOption.value = customsOption.value;
 
 }
 
-const handleCustomsAdd = (selectionList) => {
+const handleCustomsAdd = (row) => {
   title.value = '琛ュ厖濮旀墭瑁呭嵏淇℃伅';
+
+  clearanceList.value = [];
+  // 2. 娓呴櫎琛ㄦ牸瑙嗚涓婄殑閫変腑鐘舵��
+  if (crudRef.value) {
+    crudRef.value.clearSelection();
+  }
+
+  // 3. 閲嶇疆琛ㄥ崟
+  form.value = {};
+
+  // 4. 灏嗗綋鍓嶇偣鍑荤殑琛屾暟鎹祴鍊肩粰 form锛岀敤浜庡脊绐楃紪杈�
+  Object.assign(form.value, row);
+
   open.value = true;
-  form.value = selectionList;
   optionType.value = 'loading';
+  optionNum.value = 'radio';
+
   boxFormOption.value = loadingOption.value;
 }
 const handleLoading = () => {
@@ -4212,14 +4344,33 @@
   open.value = true;
   form.value = selectionList.value[0];
   optionType.value = 'loading';
+  optionNum.value = 'checkbox'
   boxFormOption.value = loadingOption.value;
 }
-const handleLoadingAdd = (selectionList) => {
-  title.value = '琛ュ厖濮旀墭瑁呭嵏淇℃伅';
+const handleLoadingAdd = (row: any) => {
+  // 1. 娓呯┖鎵归噺閫変腑鐨勬暟鎹垪琛紝瀵艰嚧椤堕儴鎸夐挳 disabled (length === 0)
+  clearanceList.value = [];
+  // 2. 娓呴櫎琛ㄦ牸瑙嗚涓婄殑閫変腑鐘舵��
+  if (crudRef.value) {
+    crudRef.value.clearSelection();
+  }
+
+  // 3. 閲嶇疆琛ㄥ崟
+  form.value = {};
+
+  // 4. 灏嗗綋鍓嶇偣鍑荤殑琛屾暟鎹祴鍊肩粰 form锛岀敤浜庡脊绐楃紪杈�
+  Object.assign(form.value, row);
+
+  // 5. 璁剧疆寮圭獥閰嶇疆
+  title.value = '琛ュ厖濮旀墭鎶ュ叧淇℃伅';
+  optionType.value = 'customs';
+  optionNum.value = 'radio';
+  boxFormOption.value = customsOption.value;
+
+  // 6. 鎵撳紑寮圭獥
   open.value = true;
-  form.value = selectionList;
-  optionType.value = 'loading';
-  boxFormOption.value = loadingOption.value;
+
+  // 銆愯皟璇曘�戞鏃舵墦鍗帮紝闀垮害搴斾负 0
 }
 const quotationItems = ref();
 const getQuotationItems = async () => {
@@ -4959,7 +5110,7 @@
 const handleOrderTypeChange = (value: any) => {
   // 闃叉 value 涓� null 鎴� undefined 鏃跺嚭閿� (褰撴竻绌洪�夋嫨鏃�)
   if (value === null || value === undefined) {
-     return;
+    return;
   }
 
   option.value.group.forEach((item: any) => {
@@ -4970,7 +5121,7 @@
           cItem.required = !(value == 1);
         });
       }
-      
+
       // 澶勭悊鍗歌揣鐐瑰繀濉鍒�
       if (item.column.receiverId && item.column.receiverId.rules) {
         item.column.receiverId.rules.forEach((cItem: any) => {
@@ -4989,6 +5140,139 @@
     }
   }
 };
+/* 杞︾墝鍙� */
+// --- 鐘舵�佺鐞� ---
+const vehicleDialogVisible = ref(false);
+const vehicleData = ref<VehicleRow[]>([]);
+const vehicleQuery = ref<any>({});
+const selectedVehicleRow = ref<VehicleRow>({});
+
+const vehiclePage = ref({
+  currentPage: 1,
+  pageSize: 10,
+  total: 0
+});
+
+// --- 寮圭獥閰嶇疆 ---
+const vehicleOption = ref({
+  header: true,
+  menu: false,
+  addBtn: false,
+  refreshBtn: true,
+  columnBtn: false,
+  index: false,
+  selection: false,
+  searchShow: true,
+  searchMenuSpan: 6,
+  searchLabelWidth: 100,
+  highlightCurrentRow: true,
+  column: [
+    { label: '杞﹁締鏈嶅姟鍟�', prop: 'serviceProviderName', search: true },
+    {
+      label: '杞﹁締绫诲瀷',
+      prop: 'vehicleType',
+      type: 'select',
+      dataType: 'string',
+      dicUrl: '/system/dict/data/type/vehicle_type',
+      search: true
+    },
+    { label: '杞﹁締鍐呴儴缂栫爜', prop: 'internalCode', search: true },
+    { label: '杞︾墝鍙�', prop: 'licensePlate', search: true },
+    { label: '棣欐腐鐗岀収', prop: 'licenseHk' },
+    { label: '婢抽棬鐗岀収', prop: 'licenseMo' }
+  ]
+});
+
+// --- 鏂规硶 ---
+
+/**
+ * 鍔犺浇鏁版嵁锛氶粯璁ゅ己鍒朵紶 carrierType: '0'
+ */
+const loadVehicleList = async (page?: any, params?: any) => {
+  const query = {
+    pageNum: vehiclePage.value.currentPage,
+    pageSize: vehiclePage.value.pageSize,
+    carrierType: '0', // 榛樿寮哄埗浼�0
+    ...vehicleQuery.value,
+    ...params
+  };
+
+  try {
+    const res = await listTmsVehicle(query);
+    if (res.code === 200) {
+      // const { records, total } = res.rows;
+      vehicleData.value = res.rows;
+      vehiclePage.value.total = res.total;
+    }
+  } catch (error) {
+    console.error("鍔犺浇杞﹁締鍒楄〃澶辫触", error);
+  }
+};
+
+/**
+ * 鎼滅储锛氬甫鍏ユ悳绱㈠弬鏁板苟寮哄埗 carrierType 涓� 0
+ */
+const vehicleSearchChange = (params: any, done: Function) => {
+  vehicleQuery.value = params;
+  vehiclePage.value.currentPage = 1;
+  loadVehicleList();
+  done();
+};
+
+/**
+ * 閲嶇疆锛氭竻绌烘悳绱㈡潯浠讹紝浣嗕緷鐒朵繚鐣� carrierType 涓� 0
+ */
+const vehicleSearchReset = () => {
+  vehicleQuery.value = {}; // 娓呯┖鎼滅储
+  vehiclePage.value.currentPage = 1;
+  loadVehicleList(); // loadVehicleList 鍐呴儴宸茬粡鍐欐 carrierType: '0'
+};
+
+const vehicleCurrentChange = (val: number) => {
+  vehiclePage.value.currentPage = val;
+  loadVehicleList();
+};
+
+const vehicleSizeChange = (val: number) => {
+  vehiclePage.value.pageSize = val;
+  loadVehicleList();
+};
+
+const handleVehicleRowClick = (row: VehicleRow) => {
+  selectedVehicleRow.value = row;
+};
+
+// 鎵撳紑寮圭獥鏂规硶
+const handleVehicleSelect = () => {
+  selectedVehicleRow.value = {};
+  vehicleDialogVisible.value = true;
+};
+
+/**
+ * 纭閫夋嫨锛氬洖鏄惧埌涓昏〃鍗�
+ */
+const confirmVehicleSelection = () => {
+  if (!selectedVehicleRow.value.licensePlate) {
+    appContext.$message.warning("璇风偣鍑婚�夋嫨涓�琛岃褰�");
+    return;
+  }
+  // 1. 璧嬪�� (纭繚涓昏〃鍗� data.form 瀛樺湪)
+
+
+  data.form.vehicleId = selectedVehicleRow.value.id;
+  data.form.licensePlate = selectedVehicleRow.value.licensePlate;
+  data.form.actualVehicleType = selectedVehicleRow.value.vehicleType;
+
+  // 濡傛灉闇�瑕佸叾浠栧瓧娈典篃鍙互涓�骞跺甫鍥烇紝姣斿鏈嶅姟鍟嗙瓑
+  // data.form.serviceProviderName = selectedVehicleRow.value.serviceProviderName;
+
+  vehicleDialogVisible.value = false;
+
+  // 2. 寮哄埗瑙嗗浘鏇存柊
+  nextTick(() => {
+    appContext.$forceUpdate();
+  });
+};
 
 </script>
 <style lang="scss" scoped>

--
Gitblit v1.8.0