From 7ed2a032d0724e68aec8af940f2ce0023a9f0eb7 Mon Sep 17 00:00:00 2001
From: sen <sen@qq.com>
Date: 星期三, 15 四月 2026 09:27:51 +0800
Subject: [PATCH] 修改调度单年月日

---
 ui/admin-ui3/src/views/tms/tmsDispatchOrder/index.vue | 6017 +++++++++++++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 5,402 insertions(+), 615 deletions(-)

diff --git a/ui/admin-ui3/src/views/tms/tmsDispatchOrder/index.vue b/ui/admin-ui3/src/views/tms/tmsDispatchOrder/index.vue
index 4a10511..82fb31f 100644
--- a/ui/admin-ui3/src/views/tms/tmsDispatchOrder/index.vue
+++ b/ui/admin-ui3/src/views/tms/tmsDispatchOrder/index.vue
@@ -1,637 +1,5424 @@
 <template>
-  <basicContainer >
-    <avue-crud
-        :option="option"
-        :table-loading="pageF.loading"
-        :data="tableData"
-        :page="page"
-        :permission="permissionList"
-        :before-open="beforeOpen"
-        v-model="form" v-model:search="queryParams"
-        ref="crudRef"
-        @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"
-    >
+  <basicContainer>
+    <avue-crud :option="option" :table-loading="pageF.loading" :data="tableData" :page="page"
+      :permission="permissionList" :before-open="beforeOpen" v-model="form" v-model:search="queryParams" ref="crudRef"
+      @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">
+          <span>{{ dictFormat(vehicle_type, row?.requiredVehicleTypes || form?.requiredVehicleTypes) }}</span>
+        </template>
+        <template v-else>
+          <el-select v-model="form.requiredVehicleTypes" placeholder="璇烽�夋嫨杞﹀瀷" style="width: 100%">
+            <el-option v-for="item in vehicle_type" :key="item.value" :label="item.label" :value="item.value" />
+          </el-select>
+        </template>
+      </template>
+
+      <template #orderType-form="{ row, disabled }">
+        <template v-if="disabled">
+          <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-option v-for="item in order_type" :key="item.value" :label="item.label" :value="parseInt(item.value)" />
+          </el-select>
+        </template>
+      </template>
+
+      <template #actualVehicleType-form="{ row, disabled }">
+        <template v-if="disabled">
+          <span>{{ dictFormat(vehicle_type, row?.actualVehicleType || form?.actualVehicleType) }}</span>
+        </template>
+        <template v-else>
+          <el-select v-model="form.actualVehicleType" placeholder="璇烽�夋嫨瀹為檯杞﹀瀷" style="width: 100%">
+            <el-option v-for="item in vehicle_type" :key="item.value" :label="item.label" :value="item.value" />
+          </el-select>
+        </template>
+      </template>
+
+
+
       <template #menu-left>
-        <el-button
-            type="success"
-            icon="Edit"
-            :disabled="pageF.single"
-            v-hasPermi="['tms:tmsDispatchOrder:edit']"
-            @click="handleUpdate">淇敼
+        <!--        <el-button-->
+        <!--            type="success"-->
+        <!--            icon="Edit"-->
+        <!--            :disabled="pageF.single"-->
+        <!--            v-hasPermi="['tms:tmsDispatchOrder:edit']"-->
+        <!--            @click="handleUpdate">淇敼-->
+        <!--        </el-button>-->
+        <!--        <el-button-->
+        <!--            type="danger"-->
+        <!--            icon="Delete"-->
+        <!--            :disabled="pageF.multiple"-->
+        <!--            @click="handleDelete"-->
+        <!--            v-hasPermi="['tms:tmsDispatchOrder:remove']"-->
+        <!--        >鍒犻櫎-->
+        <!--        </el-button>-->
+        <el-button type="warning" plain icon="Download" @click="handleExport"
+          v-hasPermi="['tms:tmsDispatchOrder:export']">瀵煎嚭
         </el-button>
-        <el-button
-            type="danger"
-            icon="Delete"
-            :disabled="pageF.multiple"
-            @click="handleDelete"
-            v-hasPermi="['tms:tmsDispatchOrder:remove']"
-        >鍒犻櫎
+        <el-button type="info" icon="Upload" @click="handleImport"
+          v-hasPermi="['tms:tmsDispatchOrder:import']">瀵煎叆</el-button>
+        <el-button type="info" plain icon="Document" @click="handleImportLog">瀵煎叆鏃ュ織</el-button>
+        <!--        <el-button-->
+        <!--            type="success"-->
+        <!--            icon="Promotion"-->
+        <!--            :disabled="pageF.multiple"-->
+        <!--            @click="handleGenerate"-->
+        <!--            v-hasPermi="['tms:tmsDispatchOrder:generate']"-->
+        <!--        >鐢熸垚搴旀敹搴斾粯璐圭敤-->
+        <!--        </el-button>-->
+        <el-button type="warning" icon="Female" :disabled="pageF.single" @click="handleDropHook"
+          v-hasPermi="['tms:tmsDispatchOrder:dropHook']">鐢╂寕
         </el-button>
-        <el-button
-            type="warning"
-            plain
-            icon="Download"
-            @click="handleExport"
-            v-hasPermi="['tms:tmsDispatchOrder:export']"
-        >瀵煎嚭
+        <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="selectionList.length === 0" @click="handleCustoms"
+          v-hasPermi="['tms:tmsDispatchOrder:customs']">濮旀墭鎶ュ叧淇℃伅
+        </el-button>
+        <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"
+          v-hasPermi="['tms:tmsDispatchOrder:zzdj']">澧炲�间綔涓氱櫥璁�
+        </el-button>
+        <el-button type="primary" icon="Printer" :disabled="pageF.single" @click="handlePrint"
+          v-hasPermi="['tms:tmsDispatchOrder:print']">鎵胯繍鍗曟墦鍗�
+        </el-button>
+        <el-button type="primary" icon="UserFilled" :disabled="!zxhdjSingle" @click="handleZXHDJ"
+          v-hasPermi="['tms:tmsDispatchOrder:zzdj']">瑁呭嵏璐х偣鐧昏
         </el-button>
       </template>
+
+      <template #loadingServiceProviderName="{ row }">
+        <template v-if="String(row.isCustoms).trim() === '0' && !row.loadingServiceProviderName">
+          <el-link type="primary" underline="never" @click="handleCustomsAdd(row)"
+            style="font-weight: bold; cursor: pointer; color: #409eff;">
+            寰呮坊鍔�
+          </el-link>
+        </template>
+
+        <template v-else>
+          <span>{{ row.loadingServiceProviderName }}</span>
+        </template>
+      </template>
+
+      <!-- 鍗歌揣鏈嶅姟 -->
+      <template #customsServiceProviderName="{ row }">
+        <template v-if="String(row.isLoad).trim() === '0' && !row.customsServiceProviderName">
+          <el-link type="primary" underline="never" @click="handleLoadingAdd(row)"
+            style="font-weight: bold; cursor: pointer; color: #409eff;">
+            寰呮坊鍔�
+          </el-link>
+        </template>
+
+        <template v-else>
+          <span>{{ row.customsServiceProviderName }}</span>
+        </template>
+      </template>
+
+
+
+      <template #menu="{ row, index, size }">
+        <el-tooltip content="鏌ョ湅" placement="top" :enterable="false">
+          <el-link type="primary" icon="el-icon-view" underline="never" class="link-btn"
+            v-hasPermi="['tms:tmsDispatchOrder:query']" @click="$refs.crudRef.rowView(row, index)">
+            &nbsp;
+          </el-link>
+        </el-tooltip>
+        <el-tooltip content="鍒犻櫎" placement="top" :enterable="false">
+          <el-link type="primary" icon="el-icon-delete" underline="never" class="link-btn"
+            v-hasPermi="['tms:tmsDispatchOrder:remove']" v-if="row.status == 0"
+            @click="$refs.crudRef.rowDel(row, index)">
+            &nbsp;
+          </el-link>
+        </el-tooltip>
+
+        <el-tooltip content="缂栬緫" placement="top" :enterable="false">
+          <el-link type="primary" icon="el-icon-edit" underline="never" class="link-btn"
+            v-hasPermi="['tms:tmsDispatchOrder:edit']" v-if="[0, 1].includes(row.status)"
+            @click="$refs.crudRef.rowEdit(row, index)">
+            &nbsp;
+          </el-link>
+        </el-tooltip>
+
+      </template>
+      <template #menu-before="{ row }">
+
+
+        <el-tooltip content="杩愯緭璐у搧鐧昏" placement="top">
+          <el-link size="small" type="primary" @click="handleAddGoods(row)" class="link-btn"
+            v-hasPermi="['tms:tmsGoodsDetail:add']" v-if="[0, 1, 2].includes(row.status)" underline="never"
+            icon="el-icon-document-add">
+            &nbsp;
+          </el-link>
+        </el-tooltip>
+        <el-tooltip content="瀹為檯杩愯緭璁板綍" placement="top">
+          <el-link size="small" type="primary" @click="handleActual(row)" class="link-btn"
+            v-hasPermi="['tms:tmsDispatchOrder:update']" v-if="[0, 1, 2].includes(row.status)" underline="never"
+            icon="el-icon-set-up">
+            &nbsp;
+          </el-link>
+        </el-tooltip>
+        <el-tooltip content="纭畾" placement="top">
+          <el-link size="small" type="primary" v-if="row.status == 0" @click="handleConfirm(row)" class="link-btn"
+            v-hasPermi="['tms:tmsDispatchOrder:confirmOrder']" underline="never" icon="el-icon-pointer">
+            &nbsp;
+          </el-link>
+        </el-tooltip>
+        <el-tooltip content="浣滃簾" placement="top">
+          <el-link size="small" type="primary" v-if="[0, 1, 2].includes(row.status)" @click="handleClose(row)"
+            class="link-btn" v-hasPermi="['tms:tmsDispatchOrder:closeOrder']" underline="never" icon="el-icon-close">
+            &nbsp;
+          </el-link>
+        </el-tooltip>
+        <el-tooltip content="澶嶅埗" placement="top">
+          <el-link size="small" type="primary" @click="handleCopy(row)" class="link-btn" underline="never"
+            v-hasPermi="['tms:tmsDispatchOrder:copyOrder']" icon="el-icon-connection">
+            &nbsp;
+          </el-link>
+        </el-tooltip>
+        <el-tooltip content="涓婁紶琛岀▼" placement="top">
+          <el-link size="small" type="primary" v-if="[1, 2].includes(row.status)" @click="handleUploadItinerary(row)"
+            v-hasPermi="['tms:tmsTrip:add']" class="link-btn" underline="never" icon="el-icon-upload">
+            &nbsp;
+          </el-link>
+        </el-tooltip>
+        <el-tooltip content="鏌ョ湅琛岀▼" placement="top">
+          <el-link size="small" type="primary" v-if="![0, 1].includes(row.status)" @click="handleLogItinerary(row)"
+            v-hasPermi="['tms:tmsTrip:list']" class="link-btn" underline="never" icon="Finished">
+            &nbsp;
+          </el-link>
+        </el-tooltip>
+        <el-tooltip content="瀹屾垚琛岀▼" placement="top">
+          <el-link size="small" type="primary" v-if="[2].includes(row.status)" @click="handleOk(row)" class="link-btn"
+            v-hasPermi="['tms:tmsDispatchOrder:okOrder']" underline="never" icon="el-icon-circle-check">
+            &nbsp;
+          </el-link>
+        </el-tooltip>
+        <!-- 
+        <el-tooltip content="瀹屾垚琛岀▼" placement="top">
+          <el-link size="small" type="primary" v-if="[2].includes(row.status)" @click="handleOk(row)" class="link-btn"
+            v-hasPermi="['tms:tmsDispatchOrder:okOrder']" underline="never" icon="el-icon-circle-check">
+            &nbsp;
+          </el-link>
+        </el-tooltip> -->
+
+        <el-tooltip content="鏃ュ織" placement="top">
+          <el-link size="small" type="primary" @click="handleFlow(row)" class="link-btn"
+            v-hasPermi="['cwgl:estimatedReceivable:flog']" underline="never" icon="el-icon-document">
+            &nbsp;
+          </el-link>
+        </el-tooltip>
+
+
+      </template>
+
+      <!-- <template #menu="{row}">
+
+</template> -->
+
+      <template #shipperId-form="{ disabled }">
+        <div style="display:flex; align-items: center;justify-content: space-between">
+          <avue-input-table :props="consignorProps" dataType="string" :children="consignorOption" :disabled="disabled"
+            :on-load="onShipperLoad" suffixIcon="search" v-model="form.shipperId" style="width: 80%"
+            @change="changeShipper" placeholder="璇烽�夋嫨瑁呰揣鐐�"></avue-input-table>
+          <el-button icon="plus" :disabled="disabled" @click="handleAddShipper"></el-button>
+        </div>
+      </template>
+      <template #receiverId-form="{ disabled }">
+        <div style="display:flex; align-items: center;justify-content: space-between">
+          <avue-input-table :props="consignorProps" :children="consignorOption" dataType="string"
+            :on-load="onConsignorLoad" suffixIcon="search" v-model="form.receiverId" :disabled="disabled"
+            @change="changeReceiver" style="width: 80%" placeholder="璇烽�夋嫨鍗歌揣鐐�"></avue-input-table>
+          <el-button icon="plus" :disabled="disabled" @click="handleAddReceiver"></el-button>
+        </div>
+      </template>
+
     </avue-crud>
+    <el-dialog :title="pageF.title" v-model="pageF.open" class="avue-dialog avue-dialog--top" width="80%">
+      <h2 v-if="optionType == 'addFinance'">鎶ヤ环璐圭敤</h2>
+      <avue-crud v-if="optionType == 'addFinance'" :option="itemsTableOption" :data="itemsTableData"
+        @selection-change="selectionChange2">
+        <template #count="{ row }">
+          <el-input-number v-model="row.count" @change="countChange(row)" placeholder="璇疯緭鍏ヨ璐规暟閲�"
+            min="0"></el-input-number>
+        </template>
+      </avue-crud>
+      <h2 v-if="optionType == 'addFinance'">瀹炴姤瀹為攢璐圭敤</h2>
+      <avue-form v-if="optionType == 'addItinerary' || optionType == 'addFinance'" v-model="boxForm" ref="boxFormRef"
+        :option="boxFormOption">
+
+      </avue-form>
+      <avue-crud :option="boxTableOption" :data="boxTableData">
+      </avue-crud>
+      <template #footer>
+        <div class="dialog-footer">
+          <el-button type="primary" v-if="optionType == 'addItinerary' || optionType == 'addFinance'"
+            :loading="pageF.isUploading" @click="submitForm">
+            {{ pageF.isUploading ? '鎻愪氦涓�' : '纭� 瀹�' }}
+          </el-button>
+
+          <el-button type="primary" v-if="optionType == 'generate'" :loading="pageF.isUploading"
+            @click="submitGenerate">
+            {{ pageF.isUploading ? '鐢熸垚涓�' : '鐢熸垚璐圭敤' }}
+          </el-button>
+          <el-button @click="cancelBox">鍙� 娑�</el-button>
+        </div>
+      </template>
+    </el-dialog>
+
+    <el-dialog :title="title" v-model="open" class="avue-dialog avue-dialog--top" width="40%">
+      <div v-if="optionType === 'dropHook'">
+        <el-descriptions :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.$actualVehicleType }}</el-descriptions-item>
+          <el-descriptions-item label="杩愯緭宸ュ叿鍙风爜">{{ form.licensePlate }}</el-descriptions-item>
+          <el-descriptions-item label="鎵樻灦鍙�">{{ form.shelfCode }}</el-descriptions-item>
+          <el-descriptions-item label="涓婚┚椹跺憳">{{ form.mainDriverName }}</el-descriptions-item>
+          <el-descriptions-item label="鍓┚椹跺憳">{{ form.assistantDriverName }}</el-descriptions-item>
+        </el-descriptions>
+      </div>
+      <div v-if="optionType == 'connectHang'">
+        <el-descriptions 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.$actualVehicleType }}</el-descriptions-item>
+          <el-descriptions-item label="鎵樻灦鍙�">{{ form.shelfCode }}</el-descriptions-item>
+        </el-descriptions>
+        <avue-form v-model="form" ref="boxFormRef" :option="boxFormOption">
+
+        </avue-form>
+      </div>
+
+      <div v-if="optionType == 'customs'">
+        <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 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>
+        <div class="dialog-footer">
+          <el-button type="primary" v-if="optionType != 'view'" :loading="pageF.isUploading" @click="submitForm2">
+            {{ pageF.isUploading ? '鎻愪氦涓�' : '纭� 瀹�' }}
+          </el-button>
+          <el-button @click="cancelBox2">鍙� 娑�</el-button>
+        </div>
+      </template>
+    </el-dialog>
+
+
+    <el-dialog title="璐у搧淇℃伅鐧昏" v-model="open2" class="avue-dialog avue-dialog--top" width="80%">
+      <avue-crud :option="goodsTableOption" v-model="goodsForm" @row-update="rowGoodsUpdate" @row-save="rowGoodsSave"
+        @row-del="rowGoodsDel" :data="goodsTableData" ref="goodsCrudRef">
+      </avue-crud>
+      <!--      <template #footer>-->
+      <!--        <div class="dialog-footer">-->
+      <!--          <el-button type="primary"  :loading="pageF.isUploading" @click="submitForm2">-->
+      <!--            {{ pageF.isUploading ? '鎻愪氦涓�' : '纭� 瀹�' }}-->
+      <!--          </el-button>-->
+      <!--          <el-button @click="open2 = false">鍙� 娑�</el-button>-->
+      <!--        </div>-->
+      <!--      </template>-->
+    </el-dialog>
+
+    <el-dialog title="瀹為檯杩愯緭淇℃伅" v-model="open3" class="avue-dialog avue-dialog--top" width="80%">
+      <avue-form v-model="actualForm" ref="actualFormRef" :option="actualFormOption">
+
+      </avue-form>
+      <template #footer>
+        <div class="dialog-footer">
+          <el-button type="primary" :loading="pageF.isUploading" @click="submitForm3">
+            {{ pageF.isUploading ? '鎻愪氦涓�' : '纭� 瀹�' }}
+          </el-button>
+          <el-button @click="open3 = false">鍙� 娑�</el-button>
+        </div>
+      </template>
+    </el-dialog>
+
+
+
+    <el-dialog title="澧炲�间綔涓氱櫥璁�" v-model="open4" class="avue-dialog avue-dialog--top" width="80%">
+      <el-descriptions :column="3" 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-item label="杞﹀瀷">{{ form.$actualVehicleType }}</el-descriptions-item>
+        <el-descriptions-item label="杞︾墝">{{ form.licensePlate }}</el-descriptions-item>
+      </el-descriptions>
+      <avue-tabs :option="tabsOption" ref="tabsOptionRef" @change="handleChange"></avue-tabs>
+
+      <avue-crud v-if="active !== 'tab4'" :option="zzItemsTableOption" ref="itemsTableRef" :data="zzItemsTableData">
+        <template #count="{ row }">
+          <el-input-number v-model="row.count" placeholder="璁¤垂鏁伴噺" :min="0"></el-input-number>
+        </template>
+        <template #remark="{ row }">
+          <el-input v-model="row.remark" placeholder="澶囨敞"></el-input>
+        </template>
+
+
+      </avue-crud>
+
+      <div v-if="active === 'tab4'">
+        <h2>瀹炴姤瀹為攢璐圭敤</h2>
+        <!-- <avue-form v-model="boxForm" ref="boxFormRef" :option="boxFormOption">
+
+        </avue-form> -->
+        <avue-crud :option="expenditureTableOption" :data="tmsFinanceDetails">
+          <template #actualFeeAmount="{ row }">
+            <el-input-number v-model="row.actualFeeAmount" :precision="2" :min="0" controls-position="right"
+              placeholder="杈撳叆閲戦" style="width: 100%" />
+          </template>
+          <template #currency="{ row }">
+            <el-radio-group v-model="row.currency">
+              <el-radio v-for="item in sys_currency" :key="item.value" :label="item.value">
+                {{ item.label }}
+              </el-radio>
+            </el-radio-group>
+          </template>
+          <template #voucherUrl="{ row }">
+            <!-- <avue-upload v-model="row.voucherUrl" :action="'/common/upload2'" type="upload" accept="image/*"
+              @upload-after="(res, done, loading, column) => handleUploadAfter(res, done, loading, column, row)"></avue-upload> -->
+
+            <!-- 鍑瘉鍥剧墖 -->
+            <el-upload class="upload-demo" ref="uploadRef" :limit="1" drag :action="urlApi + '/common/upload2'" multiple
+              :show-file-list="true" :on-success="(res) => handleUploadAfter(res, row)"
+              :on-exceed="(files) => handleExceed(files, row)">
+              <el-icon class="el-icon--upload"><upload-filled /></el-icon>
+              <div class="el-upload__text">
+                鐐瑰嚮鎴栧皢鍥剧墖鎷栨嫿鍒版鍖哄煙涓婁紶
+              </div>
+
+            </el-upload>
+          </template>
+          <template #remark="{ row }">
+            <el-input v-model="row.remark" placeholder="濉啓澶囨敞" clearable />
+          </template>
+        </avue-crud>
+        <avue-crud :option="boxTableOption" :data="boxTableData" @selection-change="boxSelectionChange">
+          <template #menu-left>
+            <el-button type="danger" plain icon="Delete"
+              :disabled="!(boxSelectionList.length === 1 && boxSelectionList[0]?.status === 0)"
+              @click="handleBatchBoxDel">
+              浣滃簾
+            </el-button>
+          </template>
+        </avue-crud>
+      </div>
+      <template #footer>
+        <div class="dialog-footer">
+          <el-button type="primary" :loading="pageF.isUploading" @click="submitTabForm">
+            {{ pageF.isUploading ? '鎻愪氦涓�' : '纭� 瀹�' }}
+          </el-button>
+
+          <el-button @click="open4 = false">鍙� 娑�</el-button>
+        </div>
+      </template>
+    </el-dialog>
+
+    <el-dialog title="璋冨害鍗曚綔搴�" v-model="open5" class="avue-dialog avue-dialog--top" width="80%">
+      <el-descriptions :column="3" 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-item label="杞﹀瀷">{{ form.$actualVehicleType }}</el-descriptions-item>
+        <el-descriptions-item label="杞︾墝">{{ form.licensePlate }}</el-descriptions-item>
+      </el-descriptions>
+
+      <avue-form v-model="boxForm" ref="boxFormRef" :option="boxFormOption">
+
+      </avue-form>
+      <template #footer>
+        <div class="dialog-footer">
+          <el-button type="primary" :loading="pageF.isUploading" @click="submitForm5">
+            {{ pageF.isUploading ? '鎻愪氦涓�' : '纭� 瀹�' }}
+          </el-button>
+
+          <el-button @click="open5 = false">鍙� 娑�</el-button>
+        </div>
+      </template>
+    </el-dialog>
+
+    <el-dialog title="鎵胯繍鍗曟墦鍗�" v-model="open6" class="avue-dialog avue-dialog--top cydprint" width="80%">
+      <div v-if="print == 0">
+        <el-descriptions :column="3" border>
+          <el-descriptions-item label="璁㈠崟鍙�">{{ form.dispatchNo }}</el-descriptions-item>
+          <el-descriptions-item label="鎵胯繍鏃ユ湡">{{ form.orderTime }}</el-descriptions-item>
+          <el-descriptions-item label="杞︾墝">{{ form.licensePlate }}</el-descriptions-item>
+          <el-descriptions-item label="璁㈣溅绫诲瀷">{{ form.$actualVehicleType }}</el-descriptions-item>
+
+          <el-descriptions-item label="鍙告満濮撳悕">{{ form.mainDriverName }}</el-descriptions-item>
+          <el-descriptions-item label="鐢佃瘽">{{ form.mainDriverMobile }}</el-descriptions-item>
+          <el-descriptions-item label="鎵樻灦鍙�/鏌滃彿">{{ form.shelfCode }}/ {{ form.containerNo }}</el-descriptions-item>
+          <el-descriptions-item label="瀹㈡埛鍚嶇О">{{ form.customerName }}</el-descriptions-item>
+          <el-descriptions-item label="璧锋璺嚎">{{ form.transportLine }}</el-descriptions-item>
+          <el-descriptions-item label="璋冨害鍛�">{{ form.createBy }}</el-descriptions-item>
+          <el-descriptions-item label="鏄惁鎵撳嵃">{{ form.$isPrint }}</el-descriptions-item>
+          <el-descriptions-item label="鍘嗗彶鎵撳嵃娆℃暟">{{ form.printCount }}</el-descriptions-item>
+        </el-descriptions>
+        <h3 class="title" style="color: #333;font-weight: bold;">鍗曟嵁淇℃伅</h3>
+        <avue-form v-model="boxForm" ref="boxFormRef" :option="boxFormOption">
+
+        </avue-form>
+      </div>
+      <div v-else>
+        <div id="print">
+          <img src="@/assets/img.png" alt="" style="width: 168px;height: 68px">
+          <h3 class="title">鐝犳捣甯傛眹鐣呬氦閫氭姇璧勬湁闄愬叕鍙�</h3>
+          <div class="header">
+            <div class="order">璁㈠崟鍙凤細{{ boxForm.dispatchNo }}</div>
+            <div class="sub-title">璐х墿鎵胯繍鍗曡瘉</div>
+          </div>
+          <table>
+            <tr>
+              <td>鎵胯繍鏃ユ湡锛歿{ boxForm.orderTime }}</td>
+              <td>鍏仈鍗曞彿鐮侊細{{ boxForm.sixLinkNo }}</td>
+            </tr>
+            <tr>
+              <td>杞︾墝锛歿{ boxForm.licensePlate }}</td>
+              <td>璁㈣溅杞﹀瀷: {{ boxForm.$actualVehicleType }}</td>
+            </tr>
+            <tr>
+              <td>鍙告満濮撳悕锛歿{ boxForm.mainDriverName }}</td>
+              <td>鐢佃瘽锛歿{ boxForm.mainDriverMobile }}</td>
+            </tr>
+
+            <tr>
+              <td>鎵樻灦鍙�/鏌滃彿锛歿{ boxForm.shelfCode }}/ {{ boxForm.containerNo }}</td>
+              <td>琛岄┒鍙e哺锛歿{ boxForm.portName }}</td>
+            </tr>
+            <tr>
+              <td>鎻愬崟鍙稴/O锛歿{ boxForm.billNo }}</td>
+              <td>鐮佸ご鍚嶏細{{ boxForm.terminalName }}</td>
+            </tr>
+
+            <tr>
+              <td>瀹㈡埛锛歿{ boxForm.customerName }}</td>
+              <td>鑱旂粶浜猴細{{ boxForm.contactName }} {{ boxForm.contactPhone }} </td>
+            </tr>
+            <tr>
+              <td colspan="2">
+                <span style="margin-right: 40px">璐х墿鍚嶇О锛歿{ boxForm.cargoName }} </span>
+                <span style="margin-right: 40px">浠舵暟锛歿{ boxForm.pieceCount }} </span>
+                <span style="margin-right: 40px">閲嶉噺锛歿{ boxForm.weight }}KG</span>
+              </td>
+            </tr>
+            <tr>
+              <td colspan="2">璧锋璺嚎锛歿{ boxForm.transportLine }}</td>
+            </tr>
+            <tr>
+              <td>
+                <div style="line-height: 24px">璋冨害鍛橈細{{ boxForm.createBy }}</div>
+                <div style="line-height: 42px">鎵胯繍鍙告満锛歿{ boxForm.mainDriverName }}</div>
+              </td>
+              <td>鏀惰揣浜虹瀛�/鐩栫珷锛�</td>
+            </tr>
+          </table>
+
+          <div>鎵樿繍椤荤煡锛�</div>
+          <div>1.濡傚洜鎵樿繍鑰呮惡甯﹁繚瑙勭鍝侊紝杩濆弽褰撳湴娉曚緥鑰屽紩鑷磋溅杈嗗強鍙告満鎵g暀鎴栧缃氾紝鎵樹汉浜哄繀璧斿伩涓�鍒囨崯澶憋紝鐩磋嚦浜嬩欢瀹屾弧瑙e喅涓烘銆�</div>
+          <div>2.璐х墿瑁呭嵏鍙婅繍杈撴湡闂达紝涓�鍒囦氦閫氭剰澶栧紩鑷磋矾涓嶈兘琛岄┒鎴栬溅杈嗘崯澶辫�屼护璐х墿涓嶈兘濡傛湡浜よ揣鍙婁竴鍒囬銆佺伀銆佺洍绐冨強鍏跺畠鎰忓鍧囩敱璐т富璐熻矗銆�</div>
+          <div>3.涓�鍒囦氦鏄撳潎鎸夋湰鍏徃涔嬫爣鍑嗙粡钀ユ潯娆句负鍑嗭紝鏈叕鍙镐箣璐d换鍦ㄦ煇浜涙儏鍐典笅浼氳璞佸厤鎴栭檺 (鍒跺鏈夐』瑕侊紝娆㈣繋绱㈠彇)锛�</div>
+
+        </div>
+
+      </div>
+
+
+
+      <template #footer>
+        <div class="dialog-footer">
+          <el-button @click="print = 0" v-if="print == 1">閲嶆柊濉啓</el-button>
+          <el-button type="primary" :loading="pageF.isUploading" @click="submitForm6">
+            {{ pageF.isUploading ? '鎻愪氦涓�' : '纭� 瀹�' }}
+          </el-button>
+
+          <el-button @click="open6 = false">鍙� 娑�</el-button>
+        </div>
+      </template>
+    </el-dialog>
+
+    <!-- 鐢ㄦ埛瀵煎叆瀵硅瘽妗� -->
+    <el-dialog title="璋冨害鍗曞鍏�" v-model="upload.open" width="400px" append-to-body>
+      <el-upload ref="uploadRef" :limit="1" accept=".xlsx, .xls" :headers="upload.headers"
+        :action="upload.url + '?updateSupport=' + upload.updateSupport" :disabled="upload.isUploading"
+        :on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag>
+        <el-icon class="el-icon--upload"><upload-filled /></el-icon>
+        <div class="el-upload__text">灏嗘枃浠舵嫋鍒版澶勶紝鎴�<em>鐐瑰嚮涓婁紶</em></div>
+        <template #tip>
+          <div class="el-upload__tip text-center">
+            <span>浠呭厑璁稿鍏ls銆亁lsx鏍煎紡鏂囦欢銆�</span>
+            <el-link type="primary" underline="never" style="font-size:12px;vertical-align: baseline;"
+              @click="importTemplate">涓嬭浇妯℃澘</el-link>
+          </div>
+        </template>
+      </el-upload>
+      <template #footer>
+        <div class="dialog-footer">
+          <el-button type="primary" @click="submitFileForm">纭� 瀹�</el-button>
+          <el-button @click="upload.open = false">鍙� 娑�</el-button>
+        </div>
+      </template>
+    </el-dialog>
+
+
+    <el-dialog title="棰勯厤璁㈠崟瑁呭嵏璐х偣鐧昏" v-model="open7" class="avue-dialog avue-dialog--top" width="80%">
+      <avue-form v-model="shipperReceiverForm" ref="shipperReceiverFormRef" :option="shipperReceiverFormOption">
+        <template #dispatchNos="{ disabled }">
+          <div class="dispatchNos">
+            <el-tag v-for="tag in shipperReceiverForm.dispatchNos" :key="tag" closable
+              @close="handleCloseDispatchNo(tag)">
+              {{ tag }}
+            </el-tag>
+          </div>
+
+        </template>
+        <template #shipperId="{ disabled }">
+          <div style="display:flex; align-items: center;justify-content: space-between">
+            <avue-input-table :props="consignorProps" dataType="string" :children="consignorOption" :disabled="disabled"
+              :on-load="onShipperLoad" suffixIcon="search" v-model="shipperReceiverForm.shipperId" style="width: 80%"
+              @change="changeShipper2" placeholder="璇烽�夋嫨瑁呰揣鐐�"></avue-input-table>
+            <el-button icon="plus" :disabled="disabled" @click="handleAddShipper2"></el-button>
+          </div>
+        </template>
+        <template #receiverId="{ disabled }">
+          <div style="display:flex; align-items: center;justify-content: space-between">
+            <avue-input-table :props="consignorProps" :children="consignorOption" dataType="string"
+              :on-load="onConsignorLoad" suffixIcon="search" v-model="shipperReceiverForm.receiverId"
+              :disabled="disabled" @change="changeReceiver2" style="width: 80%" placeholder="璇烽�夋嫨鍗歌揣鐐�"></avue-input-table>
+            <el-button icon="plus" :disabled="disabled" @click="handleAddReceiver2"></el-button>
+          </div>
+        </template>
+      </avue-form>
+      <template #footer>
+        <div class="dialog-footer">
+          <el-button type="primary" :loading="pageF.isUploading" @click="submitZxForm">
+            {{ pageF.isUploading ? '鎻愪氦涓�' : '纭� 瀹�' }}
+          </el-button>
+
+          <el-button @click="open7 = false">鍙� 娑�</el-button>
+        </div>
+      </template>
+    </el-dialog>
+
+    <el-dialog title="瀵煎叆鏃ュ織" v-model="importLogVisible" width="80%">
+      <avue-crud :data="importLogData" :option="importLogOption" :table-loading="importLogLoading"
+        @on-load="getImportLogList"></avue-crud>
+    </el-dialog>
+
+    <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>
 
 <script setup name="tmsDispatchOrder" lang="ts">
-  import {TmsDispatchOrderI,addTmsDispatchOrder, delTmsDispatchOrder, exportTmsDispatchOrder, getTmsDispatchOrder, listTmsDispatchOrder, updateTmsDispatchOrder} from "@/api/tms/tmsDispatchOrder";
-  import useCurrentInstance from "@/utils/useCurrentInstance";
-  import {computed,reactive, ref, toRefs} from "vue";
-  import {PagesInterface, PageQueryInterface} from "@/utils/globalInterface";
-  import {usePagePlus} from "@/hooks/usePagePlus";
-  import {hasPermission} from "@/utils/permissionUtils";
+import { listTmsDispatchOrderLog } from "@/api/tms/tmsDispatchOrderLog";
+import {
+  TmsDispatchOrderI,
+  addTmsDispatchOrder,
+  delTmsDispatchOrder,
+  exportTmsDispatchOrder,
+  getTmsDispatchOrder,
+  listTmsDispatchOrder,
+  updateTmsDispatchOrder,
+  tmsDispatchOrderRecord,
+  confirmOrder,
+  copyOrder,
+  okOrder,
+  initGenerate,
+  generateTmsDispatchOrder,
+  dropHook,
+  connectHang,
+  customsOrder,
+  loadingOrder,
+  checkCloseOrder,
+  closeOrder,
+  printDispatchOrder,
+  importTemplateTmsDispatchOrder, ypdddjSumbit,
+  tmsTmsDispatchOrderImportLog,
+  saveTmsFinanceDetail2,
+  getLastLicensePlate,
+} from "@/api/tms/tmsDispatchOrder";
+import useCurrentInstance from "@/utils/useCurrentInstance";
+import { computed, onMounted, onBeforeUnmount, reactive, ref, toRefs, watch, getCurrentInstance, nextTick } from "vue";
+import { PagesInterface, PageQueryInterface } from "@/utils/globalInterface";
+import { usePagePlus } from "@/hooks/usePagePlus";
+import { hasPermission } from "@/utils/permissionUtils";
+import { getTmsProject, listTmsProject } from "@/api/tms/tmsProject";
+import { getTmsServiceProvider, listTmsServiceProvider } from "@/api/tms/tmsServiceProvider";
+import { getTmsLoadingServiceProvider, listTmsLoadingServiceProvider } from "@/api/tms/tmsLoadingServiceProvider";
+import { getTmsCustomsServiceProvider, listTmsCustomsServiceProvider } from "@/api/tms/tmsCustomsServiceProvider";
+import { getTmsDriver, listTmsDriver } from "@/api/tms/tmsDriver";
+import { getTmsVehicle, listTmsVehicle } from "@/api/tms/tmsVehicle";
+import { getTmsContainer, listTmsContainer } from "@/api/tms/tmsContainer";
+import { getTmsShelf, listTmsShelf } from "@/api/tms/tmsShelf";
+import { addTmsConsignor, getTmsConsignor, listTmsConsignor } from "@/api/tms/tmsConsignor";
+import { ElMessage, ElMessageBox, type ElUpload } from "element-plus";
+import { addTmsTrip, listTmsTrip } from "@/api/tms/tmsTrip";
+import {
+  addTmsFinanceDetail,
+  listTmsFinanceDetail,
+  saveTmsFinanceDetail,
+  updateTmsFinanceDetail
+} from "@/api/tms/tmsFinanceDetail";
+import { getTmsProductInfo, listTmsProductInfo } from "@/api/tms/tmsProductInfo";
+import { addTmsGoodsDetail, delTmsGoodsDetail, listTmsGoodsDetail, updateTmsGoodsDetail } from "@/api/tms/tmsGoodsDetail";
+import { getTransportRouteVi, listTransportRouteVi } from "@/api/tms/tmsTransportRouteVi";
+import { listTmsQuoteItem } from "@/api/tms/tmsQuotePlanItem";
+import { $DialogForm, randomId } from '@smallwei/avue'
+import { getTmsCustomerInfo, listTmsCustomerInfo } from "@/api/tms/tmsCustomerInfo";
+import { getAddressCode } from "@/api/tms/tmsRegion";
+import { mapRegeo } from "@/api/common";
+import { getDicts } from "@/api/system/dict/data";
+import { pushTmsQuoteFee } from "@/api/tms/tmsQuoteFee";
+import { $Print } from '@smallwei/avue'
+import { getToken } from "@/utils/auth";
+import { useAvueTableShowHide } from "@/hooks/useAvueTableShowHide";
+import {
+  tmsFinanceDetail
+} from "@/api/tms/tmsDispatchOrder";
+const { appContext } = getCurrentInstance() as any;
 
-  const { proxy } = useCurrentInstance();
-  const crudRef = ref();
+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);
+/**
+ * 瀛楀吀鍏叡杞崲鍑芥暟
+ */
+const dictFormat = (dict: any, value: any) => {
+  const dictData = Array.isArray(dict) ? dict : (dict?.value || []);
+  if (value === undefined || value === null || value === '') return '';
+  return proxy.selectDictLabel(dictData, value);
+};
 
-  const permissionList = computed(()=>{
-    return {
-      addBtn: hasPermission(["tms:tmsDispatchOrder:add"]),
-      delBtn: hasPermission(["tms:tmsDispatchOrder:remove"]),
-      editBtn: hasPermission(["tms:tmsDispatchOrder:edit"]),
-      viewBtn: hasPermission(["tms:tmsDispatchOrder:query"]),
-    }
-  })
+const permissionList = (key: any, row: any, index: any) => {
+  if (key == 'addBtn') {
+    return hasPermission(["tms:tmsDispatchOrder:add"])
+  } else if (key == 'delBtn') {
+    return hasPermission(["tms:tmsDispatchOrder:remove"]) && row?.status == 0
+  } else if (key == 'editBtn') {
+    return hasPermission(["tms:tmsDispatchOrder:edit"]) && [0, 1].includes(row?.status)
+  } else if (key == 'viewBtn') {
+    return hasPermission(["tms:tmsDispatchOrder:query"])
+  } else {
+    return true;
+  }
+};
+const getNextDayMidnight = () => {
+  const date = new Date();
 
-  const data = reactive({
-    form:<TmsDispatchOrderI>{},
-    queryParams:<TmsDispatchOrderI&PageQueryInterface>{},
-    page: <PagesInterface>{
-      pageSize: 10,
-      total: 0,
-      currentPage: 1,
-    },
-    selectionList:[],
-  })
-  const {queryParams,form,page,selectionList} = toRefs(data);
-  const option = ref({
-    pageKey: 'TmsDispatchOrder',
-    rowKey: 'id',
-    column: {
-                                id: {
-          label: '涓婚敭ID',
-                  addDisplay : false,
-        editDisplay : false,
-        viewDisplay : false,
-        hide : true,
-        search : false,
-                  },
-                                dispatchNo: {
-          label: '璋冨害鍗曞彿',
-                  addDisplay :true,
-        editDisplay :true,
-        viewDisplay :true,
-        hide :false,
-        search :true,
-                      rules: [
-              {
-                required: true,
-                message: "璋冨害鍗曞彿涓嶈兘涓虹┖", trigger: "blur" }
-            ],                  },
-                                customerName: {
-          label: '瀹㈡埛鍚嶇О',
-                  addDisplay :true,
-        editDisplay :true,
-        viewDisplay :true,
-        hide :false,
-        search :true,
-                      rules: [
-              {
-                required: true,
-                message: "瀹㈡埛鍚嶇О涓嶈兘涓虹┖", trigger: "blur" }
-            ],                  },
-                                customerCode: {
-          label: '瀹㈡埛缂栫爜',
-                  addDisplay :true,
-        editDisplay :true,
-        viewDisplay : false,
-        hide : true,
-        search : false,
-                  },
-                                projectName: {
-          label: '椤圭洰鍚嶇О',
-                  addDisplay :true,
-        editDisplay :true,
-        viewDisplay :true,
-        hide :false,
-        search :true,
-                      rules: [
-              {
-                required: true,
-                message: "椤圭洰鍚嶇О涓嶈兘涓虹┖", trigger: "blur" }
-            ],                  },
-                                transportPlanNo: {
-          label: '杩愯緭璁″垝缂栧彿',
-                  addDisplay :true,
-        editDisplay :true,
-        viewDisplay :true,
-        hide :false,
-        search :true,
-                      rules: [
-              {
-                required: true,
-                message: "杩愯緭璁″垝缂栧彿涓嶈兘涓虹┖", trigger: "blur" }
-            ],                  },
-                                departureRegion: {
-          label: '鍑哄彂鍦拌鏀垮尯鍩�',
-                  addDisplay :true,
-        editDisplay :true,
-        viewDisplay :true,
-        hide :false,
-        search :true,
-                      rules: [
-              {
-                required: true,
-                message: "鍑哄彂鍦拌鏀垮尯鍩熶笉鑳戒负绌�", trigger: "blur" }
-            ],                  },
-                                destinationRegion: {
-          label: '鐩殑琛屾斂鍖哄煙',
-                  addDisplay :true,
-        editDisplay :true,
-        viewDisplay :true,
-        hide :false,
-        search :true,
-                      rules: [
-              {
-                required: true,
-                message: "鐩殑琛屾斂鍖哄煙涓嶈兘涓虹┖", trigger: "blur" }
-            ],                  },
-                                transportLine: {
-          label: '杩愯緭绾胯矾',
-                  addDisplay :true,
-        editDisplay :true,
-        viewDisplay :true,
-        hide :false,
-        search :true,
-                      rules: [
-              {
-                required: true,
-                message: "杩愯緭绾胯矾涓嶈兘涓虹┖", trigger: "blur" }
-            ],                  },
-                                vehicleProvider: {
-          label: '杞﹁締鏈嶅姟鍟�',
-                  addDisplay :true,
-        editDisplay :true,
-        viewDisplay :true,
-        hide :false,
-        search :true,
-                      rules: [
-              {
-                required: true,
-                message: "杞﹁締鏈嶅姟鍟嗕笉鑳戒负绌�", trigger: "blur" }
-            ],                  },
-                                mainDriver: {
-          label: '涓婚┚椹跺憳',
-                  addDisplay :true,
-        editDisplay :true,
-        viewDisplay :true,
-        hide :false,
-        search :true,
-                      rules: [
-              {
-                required: true,
-                message: "涓婚┚椹跺憳涓嶈兘涓虹┖", trigger: "blur" }
-            ],                  },
-                                assistantDriver: {
-          label: '鍓┚椹跺憳',
-                  addDisplay :true,
-        editDisplay :true,
-        viewDisplay : false,
-        hide : true,
-        search : false,
-                  },
-                                requiredVehicleType: {
-          label: '瑕佹眰杩愯緭宸ュ叿绫诲瀷',
-                      type: 'select', dataType:'string', dicUrl: '/system/dict/data/type/dispatch_transport_mode',
-                  addDisplay :true,
-        editDisplay :true,
-        viewDisplay :true,
-        hide :false,
-        search :true,
-                      rules: [
-              {
-                required: true,
-                message: "瑕佹眰杩愯緭宸ュ叿绫诲瀷涓嶈兘涓虹┖", trigger: "change"
-                 }
-            ],                  },
-                                vehicleNumber: {
-          label: '杩愯緭宸ュ叿鍙风爜',
-                  addDisplay :true,
-        editDisplay :true,
-        viewDisplay :true,
-        hide :false,
-        search :true,
-                      rules: [
-              {
-                required: true,
-                message: "杩愯緭宸ュ叿鍙风爜涓嶈兘涓虹┖", trigger: "blur" }
-            ],                  },
-                                transportMode: {
-          label: '杩愯緭鏂瑰紡',
-                      type: 'select', dataType:'string', dicUrl: '/system/dict/data/type/dispatch_transport_mode',
-                  addDisplay :true,
-        editDisplay :true,
-        viewDisplay : false,
-        hide : true,
-        search : false,
-                      rules: [
-              {
-                required: true,
-                message: "杩愯緭鏂瑰紡涓嶈兘涓虹┖", trigger: "change"
-                 }
-            ],                  },
-                                loadMode: {
-          label: '閰嶈浇鏂瑰紡',
-                      type: 'select', dataType:'string', dicUrl: '/system/dict/data/type/load_method',
-                  addDisplay :true,
-        editDisplay :true,
-        viewDisplay : false,
-        hide : true,
-        search : false,
-                      rules: [
-              {
-                required: true,
-                message: "閰嶈浇鏂瑰紡涓嶈兘涓虹┖", trigger: "change"
-                 }
-            ],                  },
-                                goodsName: {
-          label: '璐у搧鍚嶇О',
-                  addDisplay :true,
-        editDisplay :true,
-        viewDisplay : false,
-        hide : true,
-        search : false,
-                  },
-                                quantity: {
-          label: '鏁伴噺',
-                  addDisplay :true,
-        editDisplay :true,
-        viewDisplay : false,
-        hide : true,
-        search : false,
-                  },
-                                goodsType: {
-          label: '璐у搧绫诲瀷',
-                  addDisplay :true,
-        editDisplay :true,
-        viewDisplay : false,
-        hide : true,
-        search : false,
-                  },
-                                weight: {
-          label: '閲嶉噺(kg)',
-                  addDisplay :true,
-        editDisplay :true,
-        viewDisplay : false,
-        hide : true,
-        search : false,
-                  },
-                                netWeight: {
-          label: '鍑�閲�(kg)',
-                  addDisplay :true,
-        editDisplay :true,
-        viewDisplay : false,
-        hide : true,
-        search : false,
-                  },
-                                volume: {
-          label: '浣撶Н(m鲁)',
-                  addDisplay :true,
-        editDisplay :true,
-        viewDisplay : false,
-        hide : true,
-        search : false,
-                  },
-                                loosePieces: {
-          label: '鏁d欢鏁�',
-                  addDisplay :true,
-        editDisplay :true,
-        viewDisplay : false,
-        hide : true,
-        search : false,
-                  },
-                                fullContainers: {
-          label: '鏁寸鏁�',
-                  addDisplay :true,
-        editDisplay :true,
-        viewDisplay : false,
-        hide : true,
-        search : false,
-                  },
-                                containerNo: {
-          label: '闆嗚绠卞彿',
-                  addDisplay :true,
-        editDisplay :true,
-        viewDisplay : false,
-        hide : true,
-        search : false,
-                  },
-                                palletCount: {
-          label: '鎵樻暟',
-                  addDisplay :true,
-        editDisplay :true,
-        viewDisplay : false,
-        hide : true,
-        search : false,
-                  },
-                                earliestDeparture: {
-          label: '瑕佹眰鏈�鏃╁嚭鍙戞椂闂�',
-                      type: 'date', valueFormat: 'YYYY-MM-DD',
-                  addDisplay :true,
-        editDisplay :true,
-        viewDisplay : false,
-        hide : true,
-        search : false,
-                  },
-                                latestDeparture: {
-          label: '瑕佹眰鏈�鏅氬嚭鍙戞椂闂�',
-                      type: 'date', valueFormat: 'YYYY-MM-DD',
-                  addDisplay :true,
-        editDisplay :true,
-        viewDisplay : false,
-        hide : true,
-        search : false,
-                  },
-                                earliestArrival: {
-          label: '瑕佹眰鏈�鏃╁埌杈炬椂闂�',
-                      type: 'date', valueFormat: 'YYYY-MM-DD',
-                  addDisplay :true,
-        editDisplay :true,
-        viewDisplay : false,
-        hide : true,
-        search : false,
-                  },
-                                latestArrival: {
-          label: '瑕佹眰鏈�鏅氬埌杈炬椂闂�',
-                      type: 'date', valueFormat: 'YYYY-MM-DD',
-                  addDisplay :true,
-        editDisplay :true,
-        viewDisplay : false,
-        hide : true,
-        search : false,
-                  },
-                                departureAddress: {
-          label: '鍑哄彂鍦板湴鍧�',
-                      type: 'textarea', minRows: 3, maxRows: 5,
-                  addDisplay : false,
-        editDisplay :true,
-        viewDisplay : false,
-        hide : true,
-        search : false,
-                  },
-                                destinationAddress: {
-          label: '鐩殑鍦板湴鍧�',
-                      type: 'textarea', minRows: 3, maxRows: 5,
-                  addDisplay : false,
-        editDisplay :true,
-        viewDisplay : false,
-        hide : true,
-        search : false,
-                  },
-                                actualVehicleType: {
-          label: '瀹為檯杩愯緭宸ュ叿绫诲瀷',
-                  addDisplay : false,
-        editDisplay :true,
-        viewDisplay : false,
-        hide : true,
-        search : false,
-                  },
-                                actualLoadStart: {
-          label: '瀹為檯瑁呰溅寮�濮嬫椂闂�',
-                      type: 'date', valueFormat: 'YYYY-MM-DD',
-                  addDisplay : false,
-        editDisplay :true,
-        viewDisplay : false,
-        hide : true,
-        search : false,
-                  },
-                                actualUnloadEnd: {
-          label: '瀹為檯鍗歌溅瀹屾垚鏃堕棿',
-                      type: 'date', valueFormat: 'YYYY-MM-DD',
-                  addDisplay : false,
-        editDisplay :true,
-        viewDisplay : false,
-        hide : true,
-        search : false,
-                  },
-                                actualDeparture: {
-          label: '瀹為檯鍑哄彂鏃堕棿',
-                      type: 'date', valueFormat: 'YYYY-MM-DD',
-                  addDisplay : false,
-        editDisplay :true,
-        viewDisplay : false,
-        hide : true,
-        search : false,
-                  },
-                                actualArrival: {
-          label: '瀹為檯鍒拌揪鏃堕棿',
-                      type: 'date', valueFormat: 'YYYY-MM-DD',
-                  addDisplay : false,
-        editDisplay :true,
-        viewDisplay : false,
-        hide : true,
-        search : false,
-                  },
-                                actualQuantity: {
-          label: '瀹炲彂鏁伴噺',
-                  addDisplay : false,
-        editDisplay :true,
-        viewDisplay : false,
-        hide : true,
-        search : false,
-                  },
-                                actualWeight: {
-          label: '瀹炲彂閲嶉噺(kg)',
-                  addDisplay : false,
-        editDisplay :true,
-        viewDisplay : false,
-        hide : true,
-        search : false,
-                  },
-                                actualVolume: {
-          label: '瀹炲彂浣撶Н(m鲁)',
-                  addDisplay : false,
-        editDisplay :true,
-        viewDisplay : false,
-        hide : true,
-        search : false,
-                  },
-                                reweighWeight: {
-          label: '澶嶇閲嶉噺(kg)',
-                  addDisplay :true,
-        editDisplay :true,
-        viewDisplay : false,
-        hide : true,
-        search : false,
-                  },
-                                electronicLock: {
-          label: '鐢靛瓙閿佺紪鍙�',
-                  addDisplay :true,
-        editDisplay :true,
-        viewDisplay : false,
-        hide : true,
-        search : false,
-                  },
-                                containerInfo: {
-          label: '闆嗚绠卞彿',
-                  addDisplay :true,
-        editDisplay :true,
-        viewDisplay : false,
-        hide : true,
-        search : false,
-                  },
-                                carPlate: {
-          label: '杞︽澘鍙�',
-                  addDisplay :true,
-        editDisplay :true,
-        viewDisplay : false,
-        hide : true,
-        search : false,
-                  },
-                                emptyMileage: {
-          label: '绌鸿浇閲岀▼(Km)',
-                  addDisplay :true,
-        editDisplay :true,
-        viewDisplay : false,
-        hide : true,
-        search : false,
-                  },
-                                emptyFuel: {
-          label: '绌鸿浇娌硅��(L)',
-                  addDisplay :true,
-        editDisplay :true,
-        viewDisplay : false,
-        hide : true,
-        search : false,
-                  },
-                                loadedMileage: {
-          label: '閲嶈浇閲岀▼(Km)',
-                  addDisplay :true,
-        editDisplay :true,
-        viewDisplay : false,
-        hide : true,
-        search : false,
-                  },
-                                loadedFuel: {
-          label: '閲嶈浇娌硅��(L)',
-                  addDisplay :true,
-        editDisplay :true,
-        viewDisplay : false,
-        hide : true,
-        search : false,
-                  },
-                                shiftNo: {
-          label: '鐝鍙�',
-                  addDisplay :true,
-        editDisplay :true,
-        viewDisplay : false,
-        hide : true,
-        search : false,
-                  },
-                                lineNo: {
-          label: '绾胯矾鍙�',
-                  addDisplay :true,
-        editDisplay :true,
-        viewDisplay : false,
-        hide : true,
-        search : false,
-                  },
-                                status: {
-          label: '鐘舵��',
-                      type: 'select', dataType:'string', dicUrl: '/system/dict/data/type/tms_dispatch_order_status',
-                  addDisplay : false,
-        editDisplay : false,
-        viewDisplay :true,
-        hide :false,
-        search :true,
-                      rules: [
-              {
-                required: true,
-                message: "鐘舵�佷笉鑳戒负绌�", trigger: "change"
-                 }
-            ],                  },
-                                createBy: {
-          label: '鍒涘缓浜�',
-                  addDisplay : false,
-        editDisplay : false,
-        viewDisplay : false,
-        hide : true,
-        search : false,
-                  },
-                                createTime: {
-          label: '鍒涘缓鏃堕棿',
-                      type: 'date', valueFormat: 'YYYY-MM-DD',
-                  addDisplay : false,
-        editDisplay : false,
-        viewDisplay : false,
-        hide : true,
-        search : false,
-                  },
-                                updateBy: {
-          label: '鏇存柊浜�',
-                  addDisplay : false,
-        editDisplay : false,
-        viewDisplay : false,
-        hide :false,
-        search : false,
-                  },
-                                updateTime: {
-          label: '鏇存柊鏃堕棿',
-                      type: 'date', valueFormat: 'YYYY-MM-DD',
-                  addDisplay : false,
-        editDisplay : false,
-        viewDisplay : false,
-        hide :false,
-        search : false,
-                  },
-                                remark: {
-          label: '澶囨敞',
-                      type: 'textarea', minRows: 3, maxRows: 5,
-                  addDisplay :true,
-        editDisplay :true,
-        viewDisplay : false,
-        hide : true,
-        search : false,
-                  },
+  // 1. 灏嗘棩鏈熸帹杩涘埌鏄庡ぉ
+  date.setDate(date.getDate() + 1);
+
+  // 2. 灏嗘椂鍒嗙姣鍏ㄩ儴娓呴浂
+  date.setHours(0, 0, 0, 0);
+
+  const year = date.getFullYear();
+  const month = String(date.getMonth() + 1).padStart(2, '0');
+  const day = String(date.getDate()).padStart(2, '0');
+  const hours = String(date.getHours()).padStart(2, '0');
+  const minutes = String(date.getMinutes()).padStart(2, '0');
+  const seconds = String(date.getSeconds()).padStart(2, '0');
+
+  // 杩斿洖鏍煎紡锛�2024-01-20 00:00:00
+  return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
+};
+const data = reactive({
+  form: <TmsDispatchOrderI>{},
+  boxSelectionList: <any>[],
+  queryParams: <TmsDispatchOrderI & PageQueryInterface>{},
+  page: <PagesInterface>{
+    pageSize: 30,
+    total: 0,
+    currentPage: 1,
+  },
+  selectionList: [],
+  optionType: '',
+  boxTableData: <any>[],
+  boxForm: <any>{},
+  boxFormOption: <any>{},
+  boxTableOption: <any>{},
+  title: '',
+  open: false,
+  open2: false,
+  goodsTableData: <any>[],
+  selectionList2: <any>[],
+  goodsForm: <any>{},
+  open3: false,
+  actualForm: <any>{},
+  isCustoms: <any>-1,
+  isLoad: -1,
+  open5: false,
+  open6: false,
+  open7: false,
+  zxhdjSingle: false,
+})
+const {
+  queryParams, form, page, selectionList, open3,
+  boxTableData, optionType,
+  boxFormOption, boxForm, boxTableOption, title, open, open2,
+  goodsTableData, goodsForm, actualForm, selectionList2, isCustoms, isLoad, open5, open6, open7, zxhdjSingle, boxSelectionList
+} = toRefs(data);
+const option = ref({
+  menuType: 'icon',
+
+  viewBtn: false, // 鍏抽棴鍘熺敓鏌ョ湅
+  editBtn: false, // 鍏抽棴鍘熺敓缂栬緫
+  delBtn: false, // 鍏抽棴鍘熺敓缂栬緫
+
+  searchIndex: 7, // 鍏抽敭锛氭姌鍙犳椂鏄剧ず鐨勪釜鏁帮紙鏍规嵁浣犵殑瀛楁鏁伴噺璋冩暣锛�
+  searchIcon: true, // 鍏抽敭锛氭樉绀烘姌鍙�/灞曞紑鎸夐挳
+  searchMenuSpan: 6, // 鎼滅储鎸夐挳鏍忓崰浣嶏紙鍙�夛級
+
+  pageKey: 'TmsDispatchOrder',
+  rowKey: 'id',
+  labelWidth: 130,
+  searchSpan: 6,
+  searchLabelWidth: 150,
+  menuWidth: 350,
+  height: 530,
+  group: [
+    {
+      label: '鍩烘湰淇℃伅',
+      prop: 'jbxx',
+      column: {
+
+        quoteDetailId: {
+          label: '杩愯緭绾胯矾', span: 24,
+          display: true,
+          rules: [
+            {
+              required: true,
+              message: "璇烽�夋嫨杩愯緭璺嚎", trigger: "change"
+            }
+          ],
+          type: 'table', suffixIcon: 'search', dataType: 'string',
+          change: (val: any) => {
+            const table = crudRef.value?.getPropRef?.('quoteDetailId')?.$refs?.temp;
+            if (!table) return;
+            let active = table.active;
+            if (Array.isArray(active)) active = active[0];
+            if (active) {
+              Object.assign(form.value, {
+                quoteDetailId: active.quoteDetailId,
+                transportLine: active.transportRoute,
+                startRegionCode: active.startRegionCode,
+                endRegionCode: active.endRegionCode,
+                projectId: active.projectId,
+                projectName: active.projectName,
+                customerId: active.customerId,
+                customerName: active.customerFullName,
+                customerCode: active.customerCode,
+                contractId: active.contractId,
+                contractName: active.contractName,
+                requiredVehicleTypes: active.vehicleType + '',
+                quotePlanId: active.quotePlanId,
+              });
+              form.value.shipperId = undefined;
+              form.value.shipperRegionLabel = undefined;
+              form.value.shipperAddress = undefined;
+              form.value.shipperMobile = undefined;
+              form.value.receiverId = undefined;
+              form.value.receiverAddress = undefined;
+              form.value.receiverMobile = undefined;
+            }
+          },
+          children: {
+            border: true,
+            searchMenuSpan: 5,
+            column: {
+              transportRoute: {
+                label: '杩愯緭璺嚎', minWidth: 130,
+                search: true,
+              },
+              customerFullName: {
+                label: '瀹㈡埛鍏ㄧО', minWidth: 120,
+                search: true,
+              },
+              projectName: {
+                label: '鍏宠仈椤圭洰',
+                display: false, minWidth: 150,
+                search: true,
+              },
+
+              contractName: {
+                label: '鍏宠仈鍚堝悓',
+                display: false, minWidth: 150,
+                search: true,
+              },
+              vehicleType: {
+                label: '杞﹀瀷', dataType: 'string',
+                type: 'select', dicUrl: '/system/dict/data/type/vehicle_type', minWidth: 150,
+                hide: false,
+                search: true,
+              },
+            },
+
+          },
+          props: {
+            label: 'transportRoute',
+            value: 'quoteDetailId'
+          },
+          onLoad: ({ page, value, data }: { page: any, value: any, data: any }, callback: any) => {
+            if (value) {
+              let id = value;
+              if (Array.isArray(value)) {
+                id = value[0]
+              }
+              getTransportRouteVi(id).then(res => {
+                return callback(res.data || {})
+              })
+            } else {
+              listTransportRouteVi({ pageSize: page.pageSize, pageNum: page.currentPage, ...data }).then(res => {
+                return callback({
+                  total: res.total,
+                  data: res.rows || [],
+                })
+              })
+            }
+
           }
-  })
+        },
+        customerName: {
+          label: '瀹㈡埛鍚嶇О',
+          display: true, disabled: true
+        },
+        projectName: {
+          label: '鍏宠仈椤圭洰',
+          display: true, disabled: true
+        },
+        // customerCode: {
+        //   label: '瀹㈡埛缂栫爜',
+        //   display: true,disabled:true
+        // },
+        contractName: {
+          label: '鍏宠仈鍚堝悓',
+          display: true, disabled: true
+        },
+        requiredVehicleTypes: {
+          label: '涓嬪崟杞﹀瀷',
+          minWidth: 130,
+          display: true,        // 鉁� 鏀逛负 true 鍦ㄨ〃鏍兼樉绀�
+          type: 'select',
+          search: true,
+          dicUrl: '/system/dict/data/type/vehicle_type',
+          dataType: 'string',
 
-  const { tableData,pageF,rowSave,rowUpdate,rowDel,beforeOpen,searchChange,
-    searchReset,selectionChange,onLoad,currentChange,sizeChange,handleDelete,handleExport,handleUpdate,refreshChange} = usePagePlus({
-    form:form,
-    option:option,
-    queryParams:queryParams,
-    idKey:'id',
-    page:page.value,
-    getListApi:listTmsDispatchOrder,
-    getDetailApi:getTmsDispatchOrder,
-    exportApi:exportTmsDispatchOrder,
-    deleteApi:delTmsDispatchOrder,
-    addApi:addTmsDispatchOrder,
-    updateApi:updateTmsDispatchOrder,
-    handleUpdateFunc:()=>{
-      crudRef.value.rowEdit(selectionList.value[0]);
+        },
+
+        orderType: {
+          label: '璁㈠崟绫诲瀷',
+          display: true,
+          type: 'select', dataType: 'string',
+          dicUrl: '/system/dict/data/type/order_type',
+          rules: [
+            {
+              required: true,
+              message: "璁㈠崟绫诲瀷涓嶈兘涓虹┖", trigger: "change"
+            }
+          ],
+          change: ({ value }: any) => {
+
+            option.value.group.forEach((item: any) => {
+
+              if (item.prop == 'pcxx') {
+                item.column.shipperId.rules.forEach((cItem: any) => {
+
+
+                  cItem.required = !(value == 1);
+                });
+                item.column.receiverId.rules.forEach((cItem: any) => {
+                  cItem.required = !(value == 1);
+                });
+              }
+            })
+          }
+        },
+        // signType: {
+        //   label: '绛炬敹绫诲瀷',
+        //   display: true,
+        //   type: 'select', dataType: 'string',
+        //   dicUrl: '/system/dict/data/type/sign_type',
+        //   rules: [
+        //     {
+        //       required: true,
+        //       message: "绛炬敹绫诲瀷涓嶈兘涓虹┖", trigger: "change"
+        //     }
+        //   ],
+        // },
+
+        // loadingServiceProviderId: {
+        //   label: '瑁呰揣鏈嶅姟鍟�',
+        //   display: true,
+        //   rules: [
+        //     {
+        //       required: true,
+        //       message: "瑁呰揣鏈嶅姟鍟嗕笉鑳戒负绌�", trigger: "change"
+        //     }
+        //   ],
+        //   change: (val: any) => {
+        //     const table = crudRef.value?.getPropRef?.('loadingServiceProviderId')?.$refs?.temp;
+        //     if (!table) return;
+        //     let active = table.active;
+        //     if (Array.isArray(active)) active = active[0];
+        //     if (active) {
+        //       Object.assign(form.value, {
+        //         loadingServiceProviderId: active.id,
+        //         loadingServiceProviderName: active.serviceShortName,
+        //       });
+        //     }
+        //   },
+        //   type: 'table', suffixIcon: 'search',
+        //   children: {
+        //     border: true,
+        //     searchLabelWidth: 100,
+        //     searchMenuSpan: 5,
+        //     column: {
+        //       serviceCode: {
+        //         label: '鏈嶅姟鍟嗙紪鐮�', minWidth: 130,
+        //         search: true,
+        //       },
+        //       serviceShortName: {
+        //         label: '鏈嶅姟鍟嗙畝绉�', minWidth: 120,
+        //         search: true,
+        //       },
+        //       serviceType: {
+        //         label: '鏈嶅姟绫诲瀷', multiple: true,
+        //         type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/service_type',
+        //         minWidth: 150,
+        //       },
+        //       contactName: {
+        //         label: '鑱旂郴浜哄鍚�', minWidth: 120,
+        //       },
+        //     },
+        //
+        //   },
+        //   props: {
+        //     label: 'serviceShortName',
+        //     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]
+        //       }
+        //       getTmsLoadingServiceProvider(id).then(res => {
+        //         return callback(res.data || {})
+        //       })
+        //     } else {
+        //       listTmsLoadingServiceProvider({pageSize: page.pageSize, pageNum: page.currentPage, ...data}).then(res => {
+        //         return callback({
+        //           total: res.total,
+        //           data: res.rows || [],
+        //         })
+        //       })
+        //     }
+        //
+        //   }
+        //
+        // },
+        // customsServiceProviderId: {
+        //   label: '鎶ュ叧鏈嶅姟鍟�',
+        //   display: true,
+        //   rules: [
+        //     {
+        //       required: true,
+        //       message: "鎶ュ叧鏈嶅姟鍟嗕笉鑳戒负绌�", trigger: "change"
+        //     }
+        //   ],
+        //   change: (val: any) => {
+        //     const table = crudRef.value?.getPropRef?.('customsServiceProviderId')?.$refs?.temp;
+        //     if (!table) return;
+        //     let active = table.active;
+        //     if (Array.isArray(active)) active = active[0];
+        //     if (active) {
+        //       Object.assign(form.value, {
+        //         customsServiceProviderId: active.id,
+        //         customsServiceProviderName: active.serviceShortName,
+        //       });
+        //     }
+        //   },
+        //   type: 'table', suffixIcon: 'search',
+        //   children: {
+        //     border: true,
+        //     searchLabelWidth: 100,
+        //     searchMenuSpan: 5,
+        //     column: {
+        //       serviceCode: {
+        //         label: '鏈嶅姟鍟嗙紪鐮�', minWidth: 130,
+        //         search: true,
+        //       },
+        //       serviceShortName: {
+        //         label: '鏈嶅姟鍟嗙畝绉�', minWidth: 120,
+        //         search: true,
+        //       },
+        //       serviceType: {
+        //         label: '鏈嶅姟绫诲瀷', multiple: true,
+        //         type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/service_type',
+        //         minWidth: 150,
+        //       },
+        //       contactName: {
+        //         label: '鑱旂郴浜哄鍚�', minWidth: 120,
+        //       },
+        //     },
+        //
+        //   },
+        //   props: {
+        //     label: 'serviceShortName',
+        //     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]
+        //       }
+        //       getTmsCustomsServiceProvider(id).then(res => {
+        //         return callback(res.data || {})
+        //       })
+        //     } else {
+        //       listTmsCustomsServiceProvider({pageSize: page.pageSize, pageNum: page.currentPage, ...data}).then(res => {
+        //         return callback({
+        //           total: res.total,
+        //           data: res.rows || [],
+        //         })
+        //       })
+        //     }
+        //
+        //   }
+        // },
+        isCustoms: {
+          label: '濮旀墭鎶ュ叧',
+          display: true,
+          type: 'radio', dicUrl: '/system/dict/data/type/sys_number_is', dataType: 'string',
+          rules: [
+            {
+              required: true,
+              message: "濮旀墭鎶ュ叧涓嶈兘涓虹┖", trigger: "blur"
+            }
+          ],
+        },
+        isLoad: {
+          label: '濮旀墭瑁呭嵏',
+          display: true,
+          type: 'radio', dicUrl: '/system/dict/data/type/sys_number_is', dataType: 'string',
+          rules: [
+            {
+              required: true,
+              message: "濮旀墭瑁呭嵏涓嶈兘涓虹┖", trigger: "blur"
+            }
+          ],
+        },
+        isUrgent: {
+          label: '鏄惁绱ф��', value: '1',
+          display: true,
+          type: 'radio', dicUrl: '/system/dict/data/type/sys_number_is', dataType: 'string',
+          rules: [
+            {
+              required: true,
+              message: "鏄惁绱ф�ヤ笉鑳戒负绌�", trigger: "blur"
+            }
+          ],
+        },
+        // transportType: {
+        //   label: '杩愯緭鏂瑰紡',
+        //   display: true, type: 'select', dicUrl: '/system/dict/data/type/dispatch_transport_mode', dataType: 'string',
+        //
+        // },
+        // loadMethod: {
+        //   label: '閰嶈浇鏂瑰紡',
+        //   display: true, type: 'select', dicUrl: '/system/dict/data/type/load_method', dataType: 'string',
+        // },
+        orderTime: {
+          label: '涓嬪崟鏃堕棿',
+          type: 'date',  // 鏀逛负 datetime 绫诲瀷
+          format: 'YYYY-MM-DD',
+          valueFormat: 'YYYY-MM-DD',
+          display: true,
+          rules: [
+            {
+              required: true,
+              message: "涓嬪崟鏃堕棿涓嶈兘涓虹┖", trigger: "blur"
+            }
+          ],
+        },
+        latestDeparture: {
+          label: '瑕佹眰鏈�鏅氬嚭鍙戞椂闂�',
+          value: getNextDayMidnight(),
+          type: 'datetime',  // 鏀逛负 datetime 绫诲瀷
+          format: 'YYYY-MM-DD HH:mm:ss', labelWidth: 150,
+          valueFormat: 'YYYY-MM-DD HH:mm:ss',
+          display: true,
+          rules: [
+            {
+              required: true,
+              message: "瑕佹眰鏈�鏅氬嚭鍙戞椂闂翠笉鑳戒负绌�", trigger: "blur"
+            }
+          ],
+        },
+        latestArrival: {
+          label: '瑕佹眰鏈�鏅氬埌杈炬椂闂�', labelWidth: 150,
+          value: getNextDayMidnight(),
+          type: 'datetime',  // 鏀逛负 datetime 绫诲瀷
+          format: 'YYYY-MM-DD HH:mm:ss',
+          valueFormat: 'YYYY-MM-DD HH:mm:ss',
+          display: true,
+          rules: [
+            {
+              required: true,
+              message: "瑕佹眰鏈�鏅氬埌杈炬椂闂翠笉鑳戒负绌�", trigger: "blur"
+            }
+          ],
+        },
+
+
+      }
     },
-    handleSelectionChangeFunc:(selection:any)=>{
-      selectionList.value = selection;
+    {
+      label: '娲捐溅淇℃伅',
+      prop: 'pcxx',
+      column: {
+        operationMode: {
+          label: '鏄惁鏄嚜钀ヨ溅闃�', value: 0,
+          type: 'radio', dataType: 'string', dicUrl: '/system/dict/data/type/sys_number_is',
+          rules: [
+            {
+              required: true,
+              message: "鏄惁鏄嚜钀ヨ溅闃熶笉鑳戒负绌�", trigger: "change"
+            }
+          ],
+          change: ({ value }: any) => {
+            option.value.group.forEach((item: any) => {
+              if (item.prop == 'pcxx') {
+                item.column.commissionModel.display = value != 1;
+                item.column.containerId.display = value != 1;
+                item.column.shelfId.display = value != 1;
+                item.column.vehicleProviderId.display = value == 1;
+                item.column.containerNo.display = value == 1;
+                item.column.shelfCode.display = value == 1;
+                // item.column.vehicleProviderId.rules.forEach((cItem: any) => {
+                //   cItem.required = value == 1;
+                // });
+              }
+            })
+
+          },
+        },
+        commissionModel: {
+          label: '鎻愭垚妯″紡',
+          display: true, type: 'radio', dicUrl: '/system/dict/data/type/commission_model', dataType: 'string',
+          rules: [
+            {
+              required: true,
+              message: "鎻愭垚妯″紡涓嶈兘涓虹┖", trigger: "change"
+            }
+          ],
+        },
+        vehicleProviderId: {
+          label: '杞﹁締鏈嶅姟鍟�',
+          display: true,
+          rules: [
+            {
+              required: true,
+              message: "杞﹁締鏈嶅姟鍟嗕笉鑳戒负绌�", trigger: "change"
+            }
+          ],
+          change: (val: any) => {
+            const table = crudRef.value?.getPropRef?.('vehicleProviderId')?.$refs?.temp;
+            if (!table) return;
+            let active = table.active;
+            if (Array.isArray(active)) active = active[0];
+            if (active) {
+              Object.assign(form.value, {
+                vehicleProviderId: active.id,
+                vehicleProviderName: active.serviceShortName,
+              });
+            }
+          },
+          type: 'table', suffixIcon: 'search', dataType: 'string',
+          children: {
+            border: true,
+            searchLabelWidth: 100,
+            searchMenuSpan: 5,
+            column: {
+              serviceCode: {
+                label: '鏈嶅姟鍟嗙紪鐮�', minWidth: 130,
+                search: true,
+              },
+              serviceShortName: {
+                label: '鏈嶅姟鍟嗙畝绉�', minWidth: 120,
+                search: true,
+              },
+              serviceType: {
+                label: '鏈嶅姟绫诲瀷', multiple: true,
+                type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/service_type',
+                minWidth: 150,
+              },
+              isTransport: {
+                label: '鏄惁杩愯緭鏈嶅姟鍟�',
+                type: 'radio', dataType: 'string', dicUrl: '/system/dict/data/type/sys_number_is',
+                minWidth: 150,
+              },
+              isStorage: {
+                label: '鏄惁浠撳偍鏈嶅姟鍟�',
+                type: 'radio', dataType: 'string', dicUrl: '/system/dict/data/type/sys_number_is',
+                minWidth: 150,
+              },
+              isExpress: {
+                label: '鏄惁蹇�掓湇鍔″晢',
+                type: 'radio', dataType: 'string', dicUrl: '/system/dict/data/type/sys_number_is',
+                minWidth: 150,
+              },
+              contactName: {
+                label: '鑱旂郴浜哄鍚�', minWidth: 120,
+              },
+            },
+
+          },
+          props: {
+            label: 'serviceShortName',
+            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]
+              }
+              getTmsServiceProvider(id).then(res => {
+                return callback(res.data || {})
+              })
+            } else {
+              listTmsServiceProvider({ pageSize: page.pageSize, pageNum: page.currentPage, ...data }).then(res => {
+                return callback({
+                  total: res.total,
+                  data: res.rows || [],
+                })
+              })
+            }
+
+          }
+
+        },
+        mainDriverId: {
+          label: '涓婚┚椹跺憳',
+          display: true, dataType: 'string',
+          rules: [
+            {
+              required: true,
+              message: "涓婚┚椹跺憳涓嶈兘涓虹┖", trigger: "change"
+            }
+          ],
+          // 鍦� 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];
+            console.log('鑷姩濉厖鎴愬姛:', active);
+            if (active && active.driverName) {
+              try {
+
+                await nextTick(); // 绛夊緟娓呯┖鐢熸晥
+                const res = await getLastLicensePlate(active.driverName);
+
+                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();
+                  console.log('鑷姩濉厖鎴愬姛:', form.value);
+                }
+              } 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) => {
+          //   const table = crudRef.value?.getPropRef?.('mainDriverId')?.$refs?.temp;
+          //   if (!table) return;
+          //   let active = table.active;
+          //   if (Array.isArray(active)) active = active[0];
+          //   console.log(active,'888');
+
+          //   if (active) {
+          //     Object.assign(form.value, {
+          //       mainDriverId: active.id,
+          //       mainDriverName: active.driverName,
+          //     });
+          //     console.log(active.driverName,'44');
+          //     getLastLicensePlate(active.driverName).then(res => { 
+          //       console.log(res);
+
+          //     })
+          //   }
+          // },
+          type: 'table', suffixIcon: 'search',
+          children: {
+            border: true,
+            searchMenuSpan: 5,
+            column: {
+              vehicleProviderName: {
+                label: '杞﹁締鏈嶅姟鍟�', minWidth: 130,
+                search: true,
+              },
+              driverName: {
+                label: '椹鹃┒鍛樺鍚�', minWidth: 120,
+                search: true,
+              },
+              licenseType: {
+                label: '鍑嗛┚杞﹀瀷', minWidth: 120,
+                type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/license_type',
+                search: true, multiple: true,
+              },
+            },
+
+          },
+          props: {
+            label: 'driverName',
+            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]
+              }
+              getTmsDriver(id).then(res => {
+                return callback(res.data || {})
+              })
+            } else {
+              listTmsDriver({
+                pageSize: page.pageSize,
+                pageNum: page.currentPage, ...data,
+                carrierType: form.value.operationMode, vehicleProviderId: form.value.vehicleProviderId
+              }).then(res => {
+                return callback({
+                  total: res.total,
+                  data: res.rows || [],
+                })
+              })
+            }
+
+          }
+
+
+        },
+        assistantDriverId: {
+          label: '鍓┚椹跺憳',
+          display: true, dataType: 'string',
+          change: (val: any) => {
+            const table = crudRef.value?.getPropRef?.('assistantDriverId')?.$refs?.temp;
+            if (!table) return;
+            let active = table.active;
+            if (Array.isArray(active)) active = active[0];
+            if (active) {
+              Object.assign(form.value, {
+                assistantDriverId: active.id,
+                assistantDriverName: active.driverName,
+              });
+            }
+          },
+          type: 'table', suffixIcon: 'search',
+          children: {
+            border: true,
+            searchMenuSpan: 5,
+            column: {
+              vehicleProviderName: {
+                label: '杞﹁締鏈嶅姟鍟�', minWidth: 130,
+                search: true,
+              },
+              driverName: {
+                label: '椹鹃┒鍛樺鍚�', minWidth: 120,
+                search: true,
+              },
+              licenseType: {
+                label: '鍑嗛┚杞﹀瀷', minWidth: 120, multiple: true,
+                type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/license_type',
+                search: true,
+              },
+            },
+
+          },
+          props: {
+            label: 'driverName',
+            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(98521);
+
+              getTmsDriver(id).then(res => {
+                return callback(res.data || {})
+              })
+            } else {
+              listTmsDriver({
+                pageSize: page.pageSize,
+                pageNum: page.currentPage, ...data, vehicleProviderId: form.value.vehicleProviderId,
+                carrierType: form.value.operationMode
+              }).then(res => {
+                return callback({
+                  total: res.total,
+                  data: res.rows || [],
+                })
+              })
+            }
+
+          }
+
+        },
+        licensePlate: {
+          label: '杞︾墝鍙�', dataType: 'string',
+          display: true,
+          readonly: true,
+          rules: [
+            {
+              required: false,
+              message: "杞︾墝鍙蜂笉鑳戒负绌�", trigger: "change"
+            }
+          ],
+          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',
+        },
+        shipperId: {
+          label: '瑁呰揣鐐�', dataType: 'string',
+          display: true,
+
+          rules: [
+            {
+              required: false,
+              message: "瑁呰揣鐐逛笉鑳戒负绌�", trigger: "change"
+            }
+          ],
+
+        },
+        shipperRegionLabel: {
+          label: '瑁呰揣鐐硅鏀垮尯鍩�',
+          display: true, disabled: true
+
+        },
+        shipperAddress: {
+          label: '瑁呰揣鐐硅缁嗗湴鍧�',
+          display: true, disabled: true
+        },
+        shipperMobile: {
+          label: '瑁呰揣鐐硅仈绯绘柟寮�',
+          display: true, disabled: true
+        },
+        receiverId: {
+          label: '鍗歌揣鐐�',
+          display: true, dataType: 'string',
+          rules: [
+            {
+              required: true,
+              message: "鍗歌揣鐐逛笉鑳戒负绌�", trigger: "change"
+            }
+          ],
+        },
+        receiverRegionLabel: {
+          label: '鍗歌揣鐐硅鏀垮尯鍩�',
+          display: true, disabled: true
+        },
+        receiverAddress: {
+          label: '鍗歌揣鐐硅缁嗗湴鍧�',
+          display: true, disabled: true
+        },
+        receiverMobile: {
+          label: '鍗歌揣鐐硅仈绯绘柟寮�',
+          display: true, disabled: true
+        },
+        containerNo: {
+          label: '闆嗚绠卞彿',
+          display: false,
+        },
+        containerId: {
+          label: '鍏宠仈闆嗚绠变俊鎭�',
+          display: true,
+          change: (val: any) => {
+            const table = crudRef.value?.getPropRef?.('containerId')?.$refs?.temp;
+            if (!table) return;
+            let active = table.active;
+            if (Array.isArray(active)) active = active[0];
+            if (active) {
+              Object.assign(form.value, {
+                containerId: active.id,
+                containerNo: active.containerCode,
+              });
+            }
+          },
+          type: 'table', suffixIcon: 'search', dataType: 'string',
+          children: {
+            border: true,
+            searchLabelWidth: 100,
+            searchMenuSpan: 5,
+            column: {
+              containerCode: {
+                label: '闆嗚绠卞彿', minWidth: 130,
+                search: true,
+              },
+              containerUseType: {
+                label: '闆嗚绠辩敤閫旂被鍨�', minWidth: 120,
+                type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/container_use_type',
+                search: true,
+              },
+              selfLeasType: {
+                label: '鑷绫诲瀷', minWidth: 120,
+                type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/self_leas_type',
+                search: true,
+              },
+              containerSize: {
+                label: '绠卞瀷',
+                type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/container_type',
+                display: false,
+                hide: false, minWidth: 150,
+                search: true,
+              },
+            },
+
+          },
+          props: {
+            label: 'containerCode',
+            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]
+              }
+              getTmsContainer(id).then(res => {
+                return callback(res.data || {})
+              })
+            } else {
+              listTmsContainer({ pageSize: page.pageSize, pageNum: page.currentPage, ...data }).then(res => {
+                return callback({
+                  total: res.total,
+                  data: res.rows || [],
+                })
+              })
+            }
+
+          }
+
+        },
+        shelfCode: {
+          label: '鎵樻澘鍙�',
+          display: false,
+        },
+        shelfId: {
+          label: '鎵樻澘鍙�',
+          display: true,
+          change: (val: any) => {
+            const table = crudRef.value?.getPropRef?.('shelfId')?.$refs?.temp;
+            if (!table) return;
+            let active = table.active;
+            if (Array.isArray(active)) active = active[0];
+            if (active) {
+              Object.assign(form.value, {
+                shelfId: active.id,
+                shelfCode: active.shelfCode,
+              });
+            }
+          },
+          type: 'table', suffixIcon: 'search', dataType: 'string',
+          children: {
+            border: true,
+            searchLabelWidth: 100,
+            searchMenuSpan: 5,
+            column: {
+              shelfCode: {
+                label: '鎵樻灦鍙�', minWidth: 130,
+                search: true,
+              },
+              shelfType: {
+                label: '鎵樻灦绫诲瀷', minWidth: 120,
+                type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/shelf_type',
+                search: true,
+              },
+              selfLeasType: {
+                label: '鑷绫诲瀷', minWidth: 120,
+                type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/self_leas_type',
+                search: true,
+              },
+              compatibleContainerType: {
+                label: '閫傞厤闆嗚绠辩被鍨�', minWidth: 120,
+                type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/container_type',
+                search: true,
+              },
+            },
+
+          },
+          props: {
+            label: 'shelfCode',
+            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]
+              }
+              getTmsShelf(id).then(res => {
+                return callback(res.data || {})
+              })
+            } else {
+              listTmsShelf({ pageSize: page.pageSize, pageNum: page.currentPage, ...data }).then(res => {
+                return callback({
+                  total: res.total,
+                  data: res.rows || [],
+                })
+              })
+            }
+
+          }
+
+        },
+        remark: {
+          label: '澶囨敞', span: 24,
+          type: 'textarea', minRows: 3, maxRows: 5,
+          display: true,
+        },
+      },
+    },
+
+    // {
+    //   label: '杩愯緭瑕佹眰淇℃伅',
+    //   prop: 'ysyqxx',
+    //   column: {
+    //     earliestDeparture: {
+    //       label: '瑕佹眰鏈�鏃╁嚭鍙戞椂闂�',
+    //       type: 'datetime',  // 鏀逛负 datetime 绫诲瀷
+    //       format: 'YYYY-MM-DD HH:mm:ss',
+    //       valueFormat: 'YYYY-MM-DD HH:mm:ss',
+    //       display: true,
+    //     },
+    //     latestDeparture: {
+    //       label: '瑕佹眰鏈�鏅氬嚭鍙戞椂闂�',
+    //       type: 'datetime',  // 鏀逛负 datetime 绫诲瀷
+    //       format: 'YYYY-MM-DD HH:mm:ss',
+    //       valueFormat: 'YYYY-MM-DD HH:mm:ss',
+    //       display: true,
+    //     },
+    //     earliestArrival: {
+    //       label: '瑕佹眰鏈�鏃╁埌杈炬椂闂�',
+    //       type: 'datetime',  // 鏀逛负 datetime 绫诲瀷
+    //       format: 'YYYY-MM-DD HH:mm:ss',
+    //       valueFormat: 'YYYY-MM-DD HH:mm:ss',
+    //       display: true,
+    //     },
+    //
+    //   }
+    // },
+    // {
+    //   label: '杞﹁締淇℃伅',
+    //   prop: 'clxx',
+    //   column: {
+    //     emptyMileage: {
+    //       label: '绌鸿浇閲岀▼', append: 'Km',
+    //       display: true,
+    //     },
+    //     emptyFuel: {
+    //       label: '绌鸿浇娌硅��', append: 'L',
+    //       display: true,
+    //     },
+    //     loadedMileage: {
+    //       label: '閲嶈浇閲岀▼', append: 'Km',
+    //       display: true,
+    //     },
+    //     loadedFuel: {
+    //       label: '閲嶈浇娌硅��', append: 'L',
+    //       display: true,
+    //     },
+    //   }
+    // },
+    // {
+    //   label: '鍏朵粬淇℃伅',
+    //   prop: 'qtyxx',
+    //   column: {
+    //     shiftNo: {
+    //       label: '鐝鍙�',
+    //       display: true,
+    //     },
+    //     lineNo: {
+    //       label: '绾胯矾鍙�',
+    //       display: true,
+    //     },
+    //     remark: {
+    //       label: '澶囨敞', span: 24,
+    //       type: 'textarea', minRows: 3, maxRows: 5,
+    //       display: true,
+    //     },
+    //   }
+    // }
+  ],
+  column: {
+
+    dispatchNo: {
+      label: '璋冨害鍗曞彿', minWidth: 180,
+      display: false,
+      search: true,
+      overHidden: true
+    },
+    licensePlate: {
+      label: '杞︾墝鍙�', minWidth: 120,
+      display: false,
+      search: true,
+      overHidden: true
+    },
+    customerName: {
+      label: '瀹㈡埛',
+      display: false, minWidth: 250,
+      search: true,
+      overHidden: true
+    },
+    mainDriverName: {
+      label: '涓婚┚椹跺憳',
+      display: false, minWidth: 120,
+      search: true,
+      overHidden: true
+    },
+    requiredVehicleTypes: {
+      label: '涓嬪崟杞﹀瀷', minWidth: 130,
+      display: false, type: 'select', search: true,
+      dicUrl: '/system/dict/data/type/vehicle_type',
+      dataType: 'string',
+
+    },
+    // createTimeRange: {
+    //   label: '鍒涘缓鏃堕棿', display: false, searchRange: true, type: 'date',
+    //   format: 'YYYY-MM-DD', hide: true, searchSpan: 6,
+    //   valueFormat: 'YYYY-MM-DD',
+    //   overHidden: true
+    // },
+    createTimeRangeArray: {
+      label: '鍒涘缓鏃堕棿',
+      minWidth: 150,
+      search: true,
+      searchRange: true,
+      addDisplay: false,  // 鏂板鏃朵笉鏄剧ず
+      editDisplay: false, // 淇敼鏃朵笉鏄剧ず
+      viewDisplay: false,
+      type: 'daterange',
+      startPlaceholder: '寮�濮嬫棩鏈�',
+      endPlaceholder: '缁撴潫鏃ユ湡',
+      valueFormat: 'YYYY-MM-DD',
+      hide: true
+    },
+    updateTimeRange: {
+      label: '鏇存柊鏃堕棿', display: false, searchRange: true, type: 'date',
+      format: 'YYYY-MM-DD', hide: true, searchSpan: 6,
+      valueFormat: 'YYYY-MM-DD',
+      overHidden: true
+    },
+    updateTimeRangeArray: {
+      label: '鏇存柊鏃堕棿',
+      minWidth: 150,
+      search: true,
+      searchRange: true,
+      addDisplay: false,  // 鏂板鏃朵笉鏄剧ず
+      editDisplay: false, //
+      viewDisplay: false,
+      type: 'daterange',
+      startPlaceholder: '寮�濮嬫棩鏈�',
+      endPlaceholder: '缁撴潫鏃ユ湡',
+      valueFormat: 'YYYY-MM-DD',
+      hide: true
+    },
+    loadingServiceProviderName: {
+      label: '瑁呰揣鏈嶅姟鍟嗗悕绉�', minWidth: 150,
+      display: false,
+      search: true,
+      overHidden: true
+    },
+    customsServiceProviderName: {
+      label: '鎶ュ叧鏈嶅姟鍟嗗悕绉�', minWidth: 150,
+      display: false,
+      search: true,
+      overHidden: true
+    },
+    projectName: {
+      label: '椤圭洰鍚嶇О',
+      display: false, minWidth: 250,
+      search: true,
+      overHidden: true
+    },
+
+    contractName: {
+      label: '鍏宠仈鍚堝悓鍚嶇О', minWidth: 250,
+      display: false,
+      search: true,
+      overHidden: true
+    },
+    orderType: {
+      label: '璁㈠崟绫诲瀷',
+      display: false,
+      search: true, minWidth: 120,
+      type: 'select', dataType: 'string',
+      dicUrl: '/system/dict/data/type/order_type',
+    },
+    // signType: {
+    //   label: '璁㈠崟绫诲瀷',
+    //   display: false,
+    //   search: true, minWidth: 120,
+    //   type: 'select', dataType: 'string',
+    //   dicUrl: '/system/dict/data/type/order_type',
+    // },
+
+    transportLine: {
+      label: '杩愯緭绾胯矾',
+      display: false,
+      search: true, minWidth: 180, overHidden: true
+    },
+
+
+    vehicleProviderName: {
+      label: '杞﹁締鏈嶅姟鍟嗗悕绉�', minWidth: 150,
+      display: false,
+      search: true,
+      overHidden: true
+    },
+
+
+    isUrgent: {
+      label: '鏄惁绱ф��',
+      display: false, minWidth: 100,
+      search: true,
+      type: 'select', dicUrl: '/system/dict/data/type/sys_number_is', dataType: 'string',
+
+    },
+    iscc: {
+      label: '鏄惁鏌ヨ溅',
+      display: false, minWidth: 100,
+      search: true,
+      type: 'select', dicUrl: '/system/dict/data/type/sys_number_is', dataType: 'string',
+
+    },
+    isfk: {
+      label: '鏄惁鏀剧┖',
+      display: false, minWidth: 100,
+      search: true,
+      type: 'select', dicUrl: '/system/dict/data/type/sys_number_is', dataType: 'string',
+
+    },
+    isPrint: {
+      label: '鏄惁鎵撳嵃鎵胯繍鍗�',
+      display: false, minWidth: 120,
+      search: true,
+      type: 'select', dicUrl: '/system/dict/data/type/sys_number_is', dataType: 'string',
+
+    },
+
+    // requiredVehicleTypes: {
+    //   label: '瑕佹眰杩愯緭宸ュ叿绫诲瀷',
+    //   display: false,
+    //   search: true,
+    // },
+
+    actualVehicleType: {
+      label: '娲惧嚭杞﹀瀷', minWidth: 130,
+      display: false,
+      search: true,
+      type: 'select', dicUrl: '/system/dict/data/type/vehicle_type', dataType: 'string',
+    },
+
+
+
+    shipperName: {
+      label: '瑁呰揣鐐瑰悕绉�',
+      display: false, minWidth: 200,
+      search: true,
+      overHidden: true
+    },
+    receiverName: {
+      label: '鍗歌揣鐐瑰悕绉�', minWidth: 200,
+      display: false,
+      search: true,
+      overHidden: true
+    },
+    // accountsReceivableStatus: {
+    //   label: '搴旀敹璐圭敤鐢熸垚鐘舵��', minWidth: 160,
+    //   display: false,
+    //   hide: false,
+    //   search: true,
+    //   type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/accounts_status',
+    //
+    // },
+    // accountsPayableStatus: {
+    //   label: '搴斾粯璐圭敤鐢熸垚鐘舵��', minWidth: 160,
+    //   display: false,
+    //   hide: false,
+    //   search: true,
+    //   type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/accounts_status',
+    //
+    // },
+
+    status: {
+      label: '鐘舵��', minWidth: 150,
+      type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/tms_dispatch_order_status',
+      display: false,
+      hide: false, fixed: 'right',
+      search: false,
+      rules: [
+        {
+          required: true,
+          message: "鐘舵�佷笉鑳戒负绌�", trigger: "change"
+        }
+      ],
+    },
+    inStatusList: {
+      label: '鐘舵��', minWidth: 150,
+      type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/tms_dispatch_order_status',
+      display: false, multiple: true,
+      hide: true,
+      search: true,
+
+    },
+
+
+    createBy: {
+      label: '鍒涘缓浜�', minWidth: 150,
+      addDisplay: false,
+      editDisplay: false,
+      viewDisplay: false,
+      hide: false,
+      search: true,
+    },
+    createTime: {
+      label: '鍒涘缓鏃堕棿', minWidth: 180,
+      addDisplay: false,
+      editDisplay: false,
+      viewDisplay: true,
+      hide: false,
+      search: false,
+      overHidden: true,
+      searchSpan: 6,
+    },
+
+    updateBy: {
+      label: '鏇存柊浜�', minWidth: 150,
+      addDisplay: false,
+      editDisplay: false,
+      viewDisplay: false,
+      hide: false,
+      search: true,
+    },
+    updateTime: {
+      label: '鏇存柊鏃堕棿', minWidth: 180,
+      addDisplay: false,
+      editDisplay: false,
+      viewDisplay: true,
+      hide: false,
+      search: false,
+      overHidden: true,
+      searchSpan: 6,
+
+    },
+    confirmTime: {
+      label: '纭鏃堕棿', minWidth: 180,
+      addDisplay: false,
+      editDisplay: false,
+      viewDisplay: true,
+      hide: true,
+      search: false,
+      overHidden: true,
+      searchSpan: 6,
+    },
+    confirmTimeRange: {
+      label: '纭鏃堕棿', display: false, searchRange: true, type: 'date',
+      format: 'YYYY-MM-DD', hide: true, searchSpan: 6,
+      valueFormat: 'YYYY-MM-DD',
+    },
+    confirmTimeRangeArray: {
+      label: '纭鏃堕棿',
+      minWidth: 150,
+      search: true,
+      searchRange: true,
+      addDisplay: false,  // 鏂板鏃朵笉鏄剧ず
+      editDisplay: false, // 淇敼鏃朵笉鏄剧ず
+      viewDisplay: false,
+      type: 'daterange',
+      startPlaceholder: '寮�濮嬫棩鏈�',
+      endPlaceholder: '缁撴潫鏃ユ湡',
+      valueFormat: 'YYYY-MM-DD',
+      hide: true
+    },
+    okTime: {
+      label: '瀹屾垚鏃堕棿', minWidth: 180,
+      addDisplay: false,
+      editDisplay: false,
+      viewDisplay: true,
+      hide: true,
+      search: false,
+      searchSpan: 6,
+    },
+    // okTimeRange: {
+    //   label: '瀹屾垚鏃堕棿2', display: false, searchRange: true, type: 'date',
+    //   viewDisplay: true,
+    //   format: 'YYYY-MM-DD', hide: true, searchSpan: 6,
+    //   valueFormat: 'YYYY-MM-DD',
+    // },
+
+    okTimeRangeArray: {
+      label: '瀹屾垚鏃堕棿',
+      minWidth: 150,
+      search: true,
+      searchRange: true,
+      addDisplay: false,  // 鏂板鏃朵笉鏄剧ず
+      editDisplay: false, // 淇敼鏃朵笉鏄剧ず
+      viewDisplay: false,
+      type: 'daterange',
+      startPlaceholder: '寮�濮嬫棩鏈�',
+      endPlaceholder: '缁撴潫鏃ユ湡',
+      valueFormat: 'YYYY-MM-DD',
+      hide: true
+    },
+    orderTime: {
+      label: '涓嬪崟鏃堕棿', minWidth: 180,
+      addDisplay: false,
+      editDisplay: false,
+      viewDisplay: true,
+      hide: true,
+      search: false,
+      searchSpan: 6,
+    },
+    loadingDate: {
+      bind: 'orderTime',
+      label: '瑁呰揣鏃ユ湡', minWidth: 180,
+      addDisplay: false,
+      editDisplay: false,
+      viewDisplay: true,
+      hide: true,
+      search: false,
+      searchSpan: 6,
+    },
+    // orderTimeRange: {
+    //   label: '涓嬪崟鏃堕棿', display: false, searchRange: true, type: 'date',
+    //   format: 'YYYY-MM-DD', hide: true, searchSpan: 6,
+    //   valueFormat: 'YYYY-MM-DD',
+    // },
+    orderTimeRangeArray: {
+      label: '涓嬪崟鏃堕棿',
+      minWidth: 150,
+      search: true,
+      searchRange: true,
+      addDisplay: false,  // 鏂板鏃朵笉鏄剧ず
+      editDisplay: false, // 淇敼鏃朵笉鏄剧ず
+      viewDisplay: false,
+      type: 'daterange',
+      startPlaceholder: '寮�濮嬫棩鏈�',
+      endPlaceholder: '缁撴潫鏃ユ湡',
+      valueFormat: 'YYYY-MM-DD',
+      hide: true
+    },
+
+  }
+})
+
+const itineraryOption = ref({
+  menuBtn: false,
+  labelWidth: 120,
+  column: {
+
+    driverName: {
+      label: '涓婚┚椹跺憳鍚嶇О',
+      display: true, disabled: true,
+    },
+    vehicleNumber: {
+      label: '杞︾墝鍙风爜',
+      display: true, disabled: true,
+
+    },
+    tripType: {
+      label: '琛岀▼绫诲瀷',
+      display: true,
+      change: function ({ value }: any) {
+        if (value == '5') {
+          itineraryOption.value.column.iscc.display = true
+        }
+      },
+      type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/trip_type',
+      rules: [
+        {
+          required: true,
+          message: "琛岀▼绫诲瀷涓嶈兘涓虹┖", trigger: "change"
+        }
+      ],
+    },
+    iscc: {
+      label: '鏄惁鏌ヨ溅',
+      display: false,
+      type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/sys_number_is',
+      rules: [
+        {
+          required: true,
+          message: "鏄惁鏌ヨ溅涓嶈兘涓虹┖", trigger: "change"
+        }
+      ],
+    },
+    tripTime: {
+      label: '鏃堕棿',
+      type: 'datetime', valueFormat: 'YYYY-MM-DD HH:mm:ss',
+      display: true,
+      rules: [
+        {
+          required: true,
+          message: "鏃堕棿涓嶈兘涓虹┖", trigger: "change"
+        }
+      ],
+    },
+    odometer: {
+      label: '浠〃閲岀▼',
+      display: true,
+      rules: [
+        {
+          required: true,
+          message: "浠〃閲岀▼涓嶈兘涓虹┖", trigger: "change"
+        }
+      ],
+    },
+    address: {
+      label: '鍏蜂綋鍦板潃',
+      display: true,
+      rules: [
+        {
+          required: true,
+          message: "鍏蜂綋鍦板潃涓嶈兘涓虹┖", trigger: "change"
+        }
+      ],
+    },
+    voucherUrl: {
+      label: '琛岀▼鍑瘉',
+      display: true,
+      span: 24, dataType: 'string',
+      type: 'upload',
+      action: '/common/upload2',
+
+    },
+    dataSource: {
+      label: '鏁版嵁鏉ユ簮',
+      display: false,
+      value: 0
+    },
+  }
+})
+const urlApi = ref(import.meta.env.VITE_APP_BASE_API)
+const itineraryTableOption = ref({
+  menu: false,
+  addBtn: false,
+  header: false, selection: false,
+  title: '鍘嗗彶琛岀▼',
+  column: {
+    dataSource: {
+      label: '鏁版嵁鏉ユ簮',
+      display: false,
+      type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/data_source',
+
+    },
+    driverName: {
+      label: '涓婚┚椹跺憳鍚嶇О',
+      display: true, disabled: true,
+    },
+    vehicleNumber: {
+      label: '杞︾墝鍙风爜',
+      display: true, disabled: true,
+
+    },
+    tripType: {
+      label: '琛岀▼绫诲瀷',
+      display: true,
+      type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/trip_type',
+
+    },
+    tripTime: {
+      label: '鏃堕棿',
+      type: 'date', valueFormat: 'YYYY-MM-DD',
+      display: true,
+    },
+    odometer: {
+      label: '浠〃閲岀▼',
+      display: true,
+    },
+    address: {
+      label: '鍏蜂綋鍦板潃',
+      display: true,
+    },
+    voucherUrl: {
+      label: '鍑瘉',
+      display: true,
+      span: 24, dataType: 'string',
+      type: 'img',
+
+    },
+
+  }
+})
+
+const financeOption = ref({
+  menuBtn: false,
+  labelWidth: 120,
+  column: {
+    feeType: {
+      label: '璐圭敤绫诲瀷',
+      display: true,
+      type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/fee_type',
+      rules: [
+        {
+          required: true,
+          message: "璐圭敤绫诲瀷涓嶈兘涓虹┖", trigger: "change"
+        }
+      ],
+    },
+    actualFeeAmount: {
+      label: '璐圭敤閲戦',
+      type: 'number',
+      display: true,
+      rules: [
+        {
+          required: true,
+          message: "璐圭敤閲戦涓嶈兘涓虹┖", trigger: "change"
+        }
+      ],
+    },
+    currency: {
+      label: '甯佸埗',
+      display: true,
+      type: 'radio', dataType: 'string', dicUrl: '/system/dict/data/type/sys_currency',
+      rules: [
+        {
+          required: true,
+          message: "甯佸埗涓嶈兘涓虹┖", trigger: "change"
+        }
+      ],
+
+    },
+    voucherUrl: {
+      label: '璐圭敤鍑瘉1',
+      display: true,
+      accept: 'string', dataType: 'string',
+      type: 'upload',
+      action: '/common/upload2',
+
+    },
+    remark: {
+      label: '澶囨敞',
+      type: 'textarea', minRows: 3, maxRows: 5, span: 24
+    },
+    dataSource: {
+      label: '鏁版嵁鏉ユ簮',
+      display: false,
+      value: 0
+    },
+  }
+})
+
+const financeTableOption = ref({
+  menu: false,
+  addBtn: false,
+  selection: true,
+  header: true,
+  title: '鍘嗗彶鍨粯璐圭敤',
+  column: {
+    dataSource: {
+      label: '鏁版嵁鏉ユ簮',
+      display: false,
+      type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/data_source',
+
+    },
+    createBy: {
+      label: '娣诲姞浜�',
+      display: true, disabled: true,
+    },
+    feeCreateTime: {
+      label: '涓婁紶鏃堕棿',
+      display: true, disabled: true,
+
+    },
+    feeType: {
+      label: '璐圭敤绫诲瀷',
+      display: true,
+      type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/fee_type',
+
+    },
+    actualFeeAmount: {
+      label: '閲戦',
+      display: true,
+    },
+    currency: {
+      label: '甯佸埗',
+      display: true,
+      type: 'radio', dataType: 'string', dicUrl: '/system/dict/data/type/sys_currency',
+    },
+    feeVoucherUrl: {
+      label: '璐圭敤鍑瘉',
+      display: true,
+      span: 24,
+      accept: 'string', dataType: 'object',
+      type: 'upload',
+      action: '/common/upload2',
+    },
+    remark: {
+      label: '澶囨敞',
+    },
+    status: {
+      label: '鐘舵��',
+      display: true,
+      type: 'select', dicUrl: '/system/dict/data/type/sys_cancel_word', dataType: 'string',
+    },
+  }
+})
+
+const generateTableOption = ref({
+  menu: false,
+  addBtn: false,
+  header: false, selection: false,
+  column: {
+    collectionPlanName: {
+      label: '鍖归厤搴旀敹鏂规鍚嶇О', minWidth: 160,
+    },
+    accountsReceivableStatus: {
+      label: '搴旀敹璐圭敤鐢熸垚鐘舵��', minWidth: 160,
+      type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/accounts_status',
+    },
+    paymentPlanName: {
+      label: '鍖归厤搴斾粯鏂规鍚嶇О', minWidth: 160,
+    },
+
+    accountsPayableStatus: {
+      label: '搴斾粯璐圭敤鐢熸垚鐘舵��', minWidth: 160,
+      type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/accounts_status',
+    },
+    dispatchNo: {
+      label: '璋冨害鍗曞彿', minWidth: 120,
+      display: false,
+    },
+    customerName: {
+      label: '瀹㈡埛',
+      display: false, minWidth: 120,
+    },
+    vehicleProviderName: {
+      label: '杞﹁締鏈嶅姟鍟嗗悕绉�', minWidth: 150,
+      display: false,
+    },
+    shipperName: {
+      label: '瑁呰揣鐐瑰悕绉�',
+      display: false, minWidth: 120,
+    },
+    receiverName: {
+      label: '鍗歌揣鐐瑰悕绉�', minWidth: 120,
+      display: false,
+    },
+    transportLine: {
+      label: '杩愯緭绾胯矾',
+      display: false, minWidth: 180, overHidden: true
+    },
+    actualVehicleType: {
+      label: '杞﹀瀷', minWidth: 130,
+      display: false,
+      type: 'select', dicUrl: '/system/dict/data/type/vehicle_type', dataType: 'string',
+
+    },
+    licensePlate: {
+      label: '杞︾墝鍙�', minWidth: 120,
+      display: false,
+    },
+
+  }
+})
+const connectHangOption = ref({
+  menuBtn: false,
+  labelWidth: 120,
+  column: {
+    vehicleId: {
+      label: '鎺ユ寕杞﹁締鍙风爜',
+      display: true,
+      rules: [
+        {
+          required: true,
+          message: "鎺ユ寕杞﹁締鍙风爜涓嶈兘涓虹┖", trigger: "change"
+        }
+      ],
+      type: 'table', suffixIcon: 'search', dataType: 'string',
+      children: {
+        border: true,
+        searchLabelWidth: 100,
+        searchMenuSpan: 5,
+        column: {
+          serviceProviderName: {
+            label: '杞﹁締鏈嶅姟鍟�', minWidth: 130,
+            search: true,
+          },
+          vehicleType: {
+            label: '杞﹁締绫诲瀷', minWidth: 120,
+            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(998, 'xq1');
+
+          getTmsVehicle(id).then(res => {
+            return callback(res.data || {})
+          })
+        } else {
+          console.log(669, 'xq2');
+
+          listTmsVehicle({ pageSize: page.pageSize, pageNum: page.currentPage, ...data }).then(res => {
+            return callback({
+              total: res.total,
+              data: res.rows || [],
+            })
+          })
+        }
+
+      }
+    },
+    driverId: {
+      label: '鎺ユ寕鍙告満',
+      display: true,
+      rules: [
+        {
+          required: true,
+          message: "鎺ユ寕鍙告満涓嶈兘涓虹┖", trigger: "change"
+        }
+      ],
+      type: 'table', suffixIcon: 'search', dataType: 'string',
+      children: {
+        border: true,
+        searchMenuSpan: 5,
+        column: {
+          vehicleProviderName: {
+            label: '杞﹁締鏈嶅姟鍟�', minWidth: 130,
+            search: true,
+          },
+          driverName: {
+            label: '椹鹃┒鍛樺鍚�', minWidth: 120,
+            search: true,
+          },
+          licenseType: {
+            label: '鍑嗛┚杞﹀瀷', minWidth: 120,
+            type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/license_type',
+            search: true, multiple: true,
+          },
+        },
+
+      },
+      props: {
+        label: 'driverName',
+        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]
+          }
+          getTmsDriver(id).then(res => {
+            return callback(res.data || {})
+          })
+        } else {
+          listTmsDriver({ pageSize: page.pageSize, pageNum: page.currentPage, ...data }).then(res => {
+            return callback({
+              total: res.total,
+              data: res.rows || [],
+            })
+          })
+        }
+
+      }
+    },
+
+  }
+})
+
+
+const customsOption = ref({
+  menuBtn: false,
+  labelWidth: 120,
+  column: {
+    customsServiceProviderId: {
+      label: '鎶ュ叧鏈嶅姟鍟�', span: 24,
+      display: true,
+      rules: [
+        {
+          required: true,
+          message: "鎶ュ叧鏈嶅姟鍟嗕笉鑳戒负绌�", trigger: "change"
+        }
+      ],
+      type: 'table', suffixIcon: 'search', dataType: 'string',
+      change: (val: any) => {
+        const table = boxFormRef.value?.getPropRef?.('customsServiceProviderId')?.$refs?.temp;
+        if (!table) return;
+        let active = table.active;
+        if (Array.isArray(active)) active = active[0];
+        if (active) {
+          Object.assign(form.value, {
+            customsServiceProviderId: active.id,
+            customsServiceProviderName: active.serviceShortName,
+          });
+        }
+      },
+      children: {
+        border: true,
+        searchLabelWidth: 100,
+        searchMenuSpan: 5,
+        column: {
+          serviceCode: {
+            label: '鏈嶅姟鍟嗙紪鐮�',
+            search: true,
+          },
+          serviceShortName: {
+            label: '鏈嶅姟鍟嗙畝绉�', minWidth: 150,
+            search: true,
+          },
+          serviceName: {
+            label: '鏈嶅姟鍟嗗叏绉�', search: true,
+          },
+          serviceType: {
+            label: '鏈嶅姟绫诲瀷', minWidth: 150,
+            type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/service_type',
+            multiple: true,
+            search: true,
+          },
+        }
+      },
+      props: {
+        label: 'serviceShortName',
+        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]
+          }
+          getTmsCustomsServiceProvider(id).then(res => {
+            return callback(res.data || {})
+          })
+        } else {
+          listTmsCustomsServiceProvider({ pageSize: page.pageSize, pageNum: page.currentPage, ...data }).then(res => {
+            return callback({
+              total: res.total,
+              data: res.rows || [],
+            })
+          })
+        }
+
+      }
+    },
+  }
+})
+
+
+const loadingOption = ref({
+  menuBtn: false,
+  labelWidth: 120,
+  column: {
+    loadingServiceProviderId: {
+      label: '瑁呭嵏鏈嶅姟鍟�', span: 24,
+      display: true,
+      rules: [
+        {
+          required: true,
+          message: "瑁呭嵏鏈嶅姟鍟嗕笉鑳戒负绌�", trigger: "change"
+        }
+      ],
+      type: 'table', suffixIcon: 'search', dataType: 'string',
+      change: (val: any) => {
+        const table = boxFormRef.value?.getPropRef?.('loadingServiceProviderId')?.$refs?.temp;
+        if (!table) return;
+        let active = table.active;
+        if (Array.isArray(active)) active = active[0];
+        if (active) {
+          Object.assign(form.value, {
+            loadingServiceProviderId: active.id,
+            loadingServiceProviderName: active.serviceShortName,
+          });
+        }
+      },
+      children: {
+        border: true,
+        searchLabelWidth: 100,
+        searchMenuSpan: 5,
+        column: {
+          serviceCode: {
+            label: '鏈嶅姟鍟嗙紪鐮�',
+            search: true,
+          },
+          serviceShortName: {
+            label: '鏈嶅姟鍟嗙畝绉�', minWidth: 150,
+            search: true,
+          },
+          serviceName: {
+            label: '鏈嶅姟鍟嗗叏绉�', search: true,
+          },
+          serviceType: {
+            label: '鏈嶅姟绫诲瀷', minWidth: 150,
+            type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/service_type',
+            multiple: true,
+            search: true,
+          },
+        }
+      },
+      props: {
+        label: 'serviceShortName',
+        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]
+          }
+          getTmsLoadingServiceProvider(id).then(res => {
+            return callback(res.data || {})
+          })
+        } else {
+          listTmsLoadingServiceProvider({ pageSize: page.pageSize, pageNum: page.currentPage, ...data }).then(res => {
+            return callback({
+              total: res.total,
+              data: res.rows || [],
+            })
+          })
+        }
+
+      }
+    },
+  }
+})
+
+
+const closeOption = ref({
+  menuBtn: false,
+  labelWidth: 120,
+  column: {
+    closeWhy: {
+      label: '浣滃簾鍘熷洜', span: 24,
+      type: 'radio', dataType: 'string', dicUrl: '/system/dict/data/type/close_why',
+      rules: [
+        {
+          required: true,
+          message: "浣滃簾鍘熷洜涓嶈兘涓虹┖", trigger: "change"
+        }
+      ],
+    },
+    closeWhyRemark: {
+      label: '浣滃簾鍘熷洜璇存槑',
+      type: 'textarea',
+      span: 24,
+    },
+  }
+})
+
+
+
+const goodsTableOption = ref({
+  pageKey: 'TmsGoodsDetail',
+  rowKey: 'id',
+  selection: false,
+  viewBtn: false,
+  column: {
+    productId: {
+      label: '璐у搧鍚嶇О', hide: true,
+      display: true, minWidth: 120, type: 'table', suffixIcon: 'search', dataType: 'string',
+      children: {
+        border: true,
+        searchLabelWidth: 100,
+        searchMenuSpan: 5,
+        column: {
+          productCode: {
+            label: '璐у搧缂栫爜', minWidth: 130,
+            search: true,
+          },
+          productName: {
+            label: '璐у搧鍚嶇О', minWidth: 120,
+            search: true,
+          },
+          grossWeight: {
+            label: '璐у搧閲嶉噺', minWidth: 120,
+            search: true,
+          },
+          netWeight: {
+            label: '璐у搧鍑�閲�', minWidth: 120,
+            search: true,
+          },
+          volume: {
+            label: '璐у搧浣撶Н', minWidth: 120,
+            search: true,
+          },
+          productType: {
+            label: '璐у搧绫诲瀷', minWidth: 120,
+            search: true,
+          },
+        },
+
+      },
+      props: {
+        label: 'productName',
+        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]
+          }
+          getTmsProductInfo(id).then(res => {
+            return callback(res.data || {})
+          })
+        } else {
+          listTmsProductInfo({
+            pageSize: page.pageSize,
+            pageNum: page.currentPage,
+            ...data,
+            // customerId:form.value.customerId
+          }).then(res => {
+            return callback({
+              total: res.total,
+              data: res.rows || [],
+            })
+          })
+        }
+
+      },
+      change: (val: any) => {
+        const table = goodsCrudRef.value?.getPropRef?.('productId')?.$refs?.temp;
+        if (!table) return;
+        let active = table.active;
+        if (Array.isArray(active)) active = active[0];
+        if (active) {
+          Object.assign(goodsForm.value, {
+            productId: active.id,
+            productName: active.productName,
+            productType: active.productType,
+            grossWeight: active.grossWeight,
+            netWeight: active.netWeight,
+            volume: active.volume,
+            packUnit: active.packUnit,
+          });
+
+          goodsForm.value.sumWeight = active.grossWeight || 0 * goodsForm.value.quantity;
+          goodsForm.value.sumNetWeight = active.netWeight || 0 * goodsForm.value.quantity;
+          goodsForm.value.sumVolume = active.volume || 0 * goodsForm.value.quantity;
+
+        }
+      },
+    },
+    productName: {
+      label: '璐у搧鍚嶇О', minWidth: 120,
+      display: false,
+      hide: false,
+    },
+    quantity: {
+      label: '鏁伴噺',
+      addDisplay: true, minWidth: 100,
+      editDisplay: true,
+      viewDisplay: true,
+      value: 1,
+      change: () => {
+        goodsForm.value.sumWeight = goodsForm.value.grossWeight || 0 * goodsForm.value.quantity;
+        goodsForm.value.sumNetWeight = goodsForm.value.netWeight || 0 * goodsForm.value.quantity;
+        goodsForm.value.sumVolume = goodsForm.value.volume || 0 * goodsForm.value.quantity;
+      }
+    },
+    sumWeight: {
+      label: '閲嶉噺(kg)',
+      addDisplay: true, minWidth: 100, append: 'Kg',
+      editDisplay: true,
+      viewDisplay: true,
+    },
+    sumNetWeight: {
+      label: '鍑�閲�(kg)',
+      addDisplay: true,
+      editDisplay: true, minWidth: 100, append: 'Kg',
+      viewDisplay: true,
+    },
+    sumVolume: {
+      label: '浣撶Н(m鲁)',
+      addDisplay: true,
+      editDisplay: true, minWidth: 100, append: 'm鲁',
+      viewDisplay: true,
+    },
+
+
+    loosePieces: {
+      label: '鏁d欢鏁�',
+      addDisplay: true,
+      editDisplay: true, minWidth: 100,
+      viewDisplay: true,
+    },
+
+    fullContainers: {
+      label: '鏁寸鏁�',
+      addDisplay: true,
+      editDisplay: true, minWidth: 100,
+      viewDisplay: true,
+    },
+    containerNo: {
+      label: '闆嗚绠卞彿',
+      addDisplay: true,
+      editDisplay: true, minWidth: 100,
+      viewDisplay: true,
+    },
+    palletCount: {
+      label: '鎵樻暟',
+      addDisplay: true, minWidth: 100,
+      editDisplay: true,
+      viewDisplay: true,
+    }
+  }
+})
+
+const actualFormOption = ref({
+  menuBtn: false, labelWidth: 140,
+  column: {
+    departureAddress: {
+      label: '瀹為檯鍑哄彂鍦板湴鍧�',
+      span: 24,
+    },
+    destinationAddress: {
+      label: '瀹為檯鐩殑鍦板湴鍧�',
+      span: 24,
+    },
+    actualLoadStart: {
+      label: '瀹為檯瑁呰溅寮�濮嬫椂闂�',
+      type: 'datetime',  // 鏀逛负 datetime 绫诲瀷
+      format: 'YYYY-MM-DD HH:mm:ss',
+      valueFormat: 'YYYY-MM-DD HH:mm:ss',
+      display: true,
+    },
+    actualUnloadEnd: {
+      label: '瀹為檯鍗歌溅瀹屾垚鏃堕棿',
+      type: 'datetime',  // 鏀逛负 datetime 绫诲瀷
+      format: 'YYYY-MM-DD HH:mm:ss',
+      valueFormat: 'YYYY-MM-DD HH:mm:ss',
+      display: true,
+    },
+    actualDeparture: {
+      label: '瀹為檯鍑哄彂鏃堕棿',
+      type: 'datetime',  // 鏀逛负 datetime 绫诲瀷
+      format: 'YYYY-MM-DD HH:mm:ss',
+      valueFormat: 'YYYY-MM-DD HH:mm:ss',
+      display: true,
+    },
+    actualArrival: {
+      label: '瀹為檯鍒拌揪鏃堕棿',
+      type: 'datetime',  // 鏀逛负 datetime 绫诲瀷
+      format: 'YYYY-MM-DD HH:mm:ss',
+      valueFormat: 'YYYY-MM-DD HH:mm:ss',
+      display: true,
+    },
+    actualQuantity: {
+      label: '瀹炲彂鏁伴噺', type: 'number',
+    },
+    actualWeight: {
+      label: '瀹炲彂閲嶉噺', type: 'number',
+    },
+    actualVolume: {
+      label: '瀹炲彂浣撶Н', type: 'number',
+    },
+    reweighWeight: {
+      label: '澶嶇閲嶉噺', type: 'number',
+    },
+    electronicLock: {
+      label: '鐢靛瓙閿�',
+    }
+  }
+})
+
+
+const itemsTableOption = ref({
+  pageKey: 'itemsTable',
+  rowKey: 'rowKey',
+  header: false,
+  addBtn: false, menu: false,
+  column: {
+    feeType: {
+      label: '璐圭敤鍚嶇О',
+    },
+    unit: {
+      label: '*璁¢噺鍗曚綅',
+    },
+    price: {
+      label: '*璁¤垂閲戦',
+    },
+    currency: {
+      label: '甯佸埗',
+    },
+    count: {
+      label: '璁¤垂鏁伴噺', minWidth: 130,
+    },
+    sum: {
+      label: '鎬婚噾棰�',
+    }
+  }
+})
+
+const consignorOption = ref({
+  border: true,
+  searchLabelWidth: 100,
+  searchMenuSpan: 5,
+  column: {
+    consignorCode: {
+      label: '鏀惰璐х偣缂栫爜', minWidth: 130,
+      search: true,
+    },
+    consignorName: {
+      label: '鏀惰璐х偣鍚嶇О', minWidth: 130,
+      search: true,
+    },
+    consignorType: {
+      label: '鏀惰璐х偣绫诲瀷', minWidth: 80,
+      type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/consignor_type',
+      display: false,
+      hide: false,
+      search: true,
+    },
+    contactName: {
+      label: '鑱旂郴浜哄鍚�', minWidth: 110,
+      display: false,
+      hide: false,
+      search: true,
+    },
+    contactPhone: {
+      label: '鑱旂郴浜虹數璇�', minWidth: 110,
+      display: false,
+      hide: false,
+      search: true,
+    },
+    regionLabel: {
+      label: '琛屾斂鍖哄煙', minWidth: 180,
+      display: false,
+      hide: false,
+      search: true,
+    },
+  },
+})
+const consignorProps = ref({
+  label: 'consignorName',
+  value: 'id'
+})
+
+
+const itemsCrudRef = ref()
+const itemsTableData = ref<any>([])
+
+const tabsOption = ref({
+  column: [
+    {
+      label: '杩愯緭澧炲�间綔涓氱櫥璁�',
+      prop: 'tab1',
+      name: 'tab1',
+      value: '0',
+
+    },
+    {
+      label: '鎶ュ叧澧炲�间綔涓氱櫥璁�',
+      prop: 'tab2',
+      name: 'tab2',
+      value: '1',
+    },
+    {
+      label: '瑁呭嵏澧炲�间綔涓氱櫥璁�',
+      prop: 'tab3',
+      name: 'tab3',
+      value: '2',
+
+    },
+    {
+      label: '瀹炴姤瀹為攢璐圭敤鐧昏',
+      prop: 'tab4',
+      name: 'tab4',
+      value: '3',
+    }
+  ]
+})
+const tabsOptionRef = ref();
+const active = ref('tab1');
+const open4 = ref(false);
+const zzItemsTableOption = ref({
+  pageKey: 'zzItemsTable',
+  rowKey: 'rowKey',
+  header: false,
+  menu: false,
+  selection: false,
+  column: {
+    freeName: {
+      label: '璐圭敤鍚嶇О',
+    },
+    unit: {
+      label: '璁¢噺鍗曚綅',
+    },
+    count: {
+      label: '璁¤垂鏁伴噺'
+    },
+    remark: {
+      label: '澶囨敞'
+    }
+  }
+});
+const zzItemsTableData = ref();
+/* 鎶ュ叧鍒楄〃 */
+const clearanceList = ref([]);
+const optionNum = ref(''); // 鐢ㄤ簬鍖哄垎鏄姤鍏宠繕鏄鍗�
+
+const {
+  tableData,
+  pageF,
+  rowSave,
+  rowUpdate,
+  rowDel,
+  beforeOpen,
+  searchChange,
+  searchReset,
+  selectionChange,
+  onLoad,
+  currentChange,
+  sizeChange,
+  handleDelete,
+  handleExport,
+  handleUpdate,
+  refreshChange
+} = usePagePlus({
+  form: form,
+  option: option,
+  queryParams: queryParams,
+  idKey: 'id',
+  page: page.value,
+  getListApi: listTmsDispatchOrder,
+  getDetailApi: getTmsDispatchOrder,
+  exportApi: exportTmsDispatchOrder,
+  deleteApi: delTmsDispatchOrder,
+  addApi: addTmsDispatchOrder,
+  updateApi: updateTmsDispatchOrder,
+  handleUpdateFunc: () => {
+    crudRef.value.rowEdit(selectionList.value[0]);
+  },
+  handleSelectionChangeFunc: (selection: any) => {
+    selectionList.value = selection;
+    clearanceList.value = selection;
+    if (selection.length > 0) {
+      isCustoms.value = selection[0].isCustoms;
+      isLoad.value = selection[0].isLoad;
+    } else {
+      isCustoms.value = -1;
+      isLoad.value = -1;
+    }
+    isCustoms.value = isCustoms.value == 0 && !pageF.single ? 0 : -1;
+    isLoad.value = isLoad.value == 0 && !pageF.single ? 0 : -1;
+    zxhdjSingle.value = pageF.multiple || true;
+    let yp = selection.filter((item: any) => {
+      return item.orderType == 0
+    });
+    if (yp.length > 0) {
+      zxhdjSingle.value = false;
+    }
+  },
+
+  getBeginListFunc: (params = {}) => {
+    // 1. 浣跨敤娴呮嫹璐濓紝涓嶅奖鍝嶅師濮嬫煡璇㈠璞�
+    // 鍏抽敭鐐癸細浠庡師濮� queryParams.value 鍙栧�硷紝纭繚鍒嗛〉鏃朵緷鐒惰兘鎷垮埌鏁扮粍
+    let newParams = { ...queryParams.value, ...params };
+
+    // 2. 瀹氫箟鏃ユ湡瀛楁鏄犲皠 (鏁扮粍鍚� : 鎺ュ彛闇�瑕佺殑鍓嶇紑)
+    const dateMap = {
+      confirmTimeRangeArray: 'confirmTimeRange',
+      createTimeRangeArray: 'createTime',
+      updateTimeRangeArray: 'updateTimeRange',
+      okTimeRangeArray: 'okTime',
+      orderTimeRangeArray: 'orderTime'
+    };
+
+    // 3. 閬嶅巻澶勭悊鏃ユ湡
+    Object.keys(dateMap).forEach(arrayKey => {
+      const prefix = dateMap[arrayKey];
+      const range = newParams[arrayKey];
+
+      if (Array.isArray(range) && range.length === 2) {
+        // 璧嬪�兼帴鍙i渶瑕佺殑 Begin 鍜� End
+        newParams[`${prefix}Begin`] = range[0];
+        newParams[`${prefix}End`] = range[1];
+      }
+
+      // 鍙湪缁欐帴鍙g殑鍙傛暟涓垹闄ゆ暟缁勶紝涓嶅奖鍝嶉〉闈㈡樉绀虹殑 queryParams
+      delete newParams[arrayKey];
+    });
+
+    // 4. 娓呮礂鍙傛暟锛氳繃婊ょ┖鍊�
+    const finalParams = {};
+    Object.keys(newParams).forEach(key => {
+      const val = newParams[key];
+      if (val !== '' && val !== null && val !== undefined) {
+        finalParams[key] = val;
+      }
+    });
+
+
+    // 銆愭牳蹇冧慨鏀广�戯細鐩存帴杩斿洖锛屼笉瑕佽祴鍊肩粰 queryParams.value
+    return finalParams;
+  },
+  handleBeforeOpenFunc: (type: string) => {
+
+    if (type == 'add') {
+      form.value = {};
+    } else if (type == 'edit') {
+      // form.value = row;
+
+    }
+  }
+
+})
+
+useAvueTableShowHide(option.value);
+
+const handleConfirm = (row: any) => {
+  ElMessageBox.confirm("鏄惁瀵硅皟搴﹀崟鍙�" + row.dispatchNo + "纭畾 锛�", '绯荤粺鎻愮ず', {
+    confirmButtonText: '纭畾',
+    cancelButtonText: '鍙栨秷',
+    type: 'warning'
+  }).then(() => {
+    return confirmOrder(row.id);
+  }).then(() => {
+    onLoad(page.value);
+    ElMessage({
+      message: "鎿嶄綔鎴愬姛锛�",
+      type: 'success'
+    })
+  });
+}
+
+const handleCopy = (row: any) => {
+  ElMessageBox.confirm("鏄惁瀵硅皟搴﹀崟鍙�" + row.dispatchNo + "澶嶅埗 锛�", '绯荤粺鎻愮ず', {
+    confirmButtonText: '纭畾',
+    cancelButtonText: '鍙栨秷',
+    type: 'warning'
+  }).then(() => {
+    return copyOrder(row.id);
+  }).then(() => {
+    onLoad(page.value);
+    ElMessage({
+      message: "鎿嶄綔鎴愬姛锛�",
+      type: 'success'
+    })
+  });
+}
+const handleOk = (row: any) => {
+  ElMessageBox.confirm("鏄惁纭瀹屾垚璋冨害鍗曞彿锛�" + row.dispatchNo + " 鐨勮绋� 锛�", '绯荤粺鎻愮ず', {
+    confirmButtonText: '纭畾',
+    cancelButtonText: '鍙栨秷',
+    type: 'warning'
+  }).then(() => {
+    return okOrder(row.id);
+  }).then(() => {
+    onLoad(page.value);
+    ElMessage({
+      message: "鎿嶄綔鎴愬姛锛�",
+      type: 'success'
+    })
+  });
+}
+/**
+ * 涓婁紶琛岀▼
+ */
+const handleUploadItinerary = (row: any) => {
+  optionType.value = 'addItinerary';
+  boxFormOption.value = itineraryOption.value;
+
+  boxTableOption.value = itineraryTableOption.value;
+  listTmsTrip({ dispatchOrderId: row.id, pageNum: 1, pageSize: 999 }).then(res => {
+    boxTableData.value = res.rows || [];
+    pageF.open = true;
+    pageF.title = '涓婁紶琛岀▼';
+
+    boxForm.value = {
+      dispatchOrderId: row.id,
+      dataSource: 0,
+      driverId: row.mainDriverId,
+      driverName: row.mainDriverName,
+      vehicleNumber: row.licensePlate,
+      vehicleId: row.vehicleId,
+    }
+
+  })
+}
+const cancelBox = () => {
+  if (optionType.value === 'addItinerary' || optionType.value === 'addFinance') {
+    boxForm.value = {};
+    boxFormRef.value.resetFields();
+  }
+  pageF.open = false;
+}
+
+const submitForm = () => {
+  if (optionType.value === 'addItinerary') {
+    if (Array.isArray(boxForm.value.voucherUrl)) {
+      boxForm.value.voucherUrl = boxForm.value.voucherUrl.toString();
+    }
+    addTmsTrip(boxForm.value).then(res => {
+      ElMessage({
+        message: "鎿嶄綔鎴愬姛锛�",
+        type: 'success'
+      })
+      cancelBox();
+      onLoad(page.value);
+    })
+  } else if (optionType.value === 'addFinance') {
+    if (Array.isArray(boxForm.value.feeVoucherUrl)) {
+      boxForm.value.feeVoucherUrl = boxForm.value.feeVoucherUrl.toString();
+    }
+    let filter = selectionList2.value.filter((item: any) => {
+      return !item.count
+    });
+    if (filter.length > 0) {
+      proxy.$modal.msgError("鍕鹃�夋姤浠疯垂鐢ㄨ濉啓璁¤垂鏁伴噺");
+      return;
+    }
+    boxForm.value.items = selectionList2.value;
+    addTmsFinanceDetail(boxForm.value).then(res => {
+      ElMessage({
+        message: "鎿嶄綔鎴愬姛锛�",
+        type: 'success'
+      })
+      cancelBox();
+      onLoad(page.value);
+    })
+  }
+
+
+}
+
+
+const handleLog = (row: any) => {
+
+}
+const handleLogItinerary = (row: any) => {
+  optionType.value = 'view';
+  boxTableOption.value = itineraryTableOption.value;
+  listTmsTrip({ dispatchOrderId: row.id, pageNum: 1, pageSize: 999 }).then(res => {
+    boxTableData.value = res.rows || [];
+    pageF.open = true;
+    pageF.title = '鏌ョ湅琛岀▼';
+    boxFormOption.value.title = '';
+  })
+}
+
+const handleAddFinance = async (row: any) => {
+  optionType.value = 'addFinance';
+  boxFormOption.value = financeOption.value;
+  boxTableOption.value = financeTableOption.value;
+  const quotePlanItemRes = await listTmsQuoteItem({ quotePlanId: row.quotePlanId, pageNum: 1, pageSize: 999 });
+  let items = quotePlanItemRes.rows || [];
+  itemsTableData.value = items.map((item: any) => {
+    return {
+      rowKey: item.id,
+      feeType: item.freeName,
+      unit: item.unit,
+      price: item.price,
+      currency: item.currency,
+      count: 0,
+      sum: 0,
     }
   })
 
+  listTmsFinanceDetail({
+    dispatchOrderId: row.id, financeType: 2,
+    pageNum: 1, pageSize: 999
+  }).then(res => {
+
+
+    boxTableData.value = res.rows || [];
+    pageF.open = true;
+    pageF.title = '璐圭敤鐧昏';
+    boxForm.value = {
+      dispatchOrderId: row.id,
+      dataSource: 0,
+      financeType: 2,
+    }
+  })
+}
+
+const handleGenerate = () => {
+  let ids = selectionList.value.map((item: any) => item.id);
+  initGenerate(ids).then(res => {
+    boxTableData.value = res.data || [];
+    optionType.value = 'generate';
+    pageF.open = true;
+    pageF.title = '鐢熸垚搴旀敹搴斾粯璐圭敤鏁版嵁';
+    boxTableOption.value = generateTableOption.value;
+  })
+}
+
+const submitGenerate = () => {
+  pageF.isUploading = true;
+  let ids = selectionList.value.map((item: any) => item.id);
+
+  generateTmsDispatchOrder(ids).then(res => {
+    pageF.isUploading = false;
+    ElMessage({
+      message: "鎿嶄綔鎴愬姛锛�",
+      type: 'success'
+    })
+    cancelBox();
+    onLoad(page.value);
+  }).finally(() => {
+    pageF.isUploading = false;
+  })
+}
+/**
+ * 鐢╂寕
+ */
+const handleDropHook = () => {
+  title.value = '璋冨害鍗曠敥鎸�';
+  open.value = true;
+  form.value = selectionList.value[0];
+  optionType.value = 'dropHook';
+
+}
+/**
+ * 鎺ユ寕
+ */
+const handleConnectHang = () => {
+  title.value = '璋冨害鍗曟帴鎸�';
+  open.value = true;
+  form.value = selectionList.value[0];
+  optionType.value = 'connectHang';
+  boxFormOption.value = connectHangOption.value;
+}
+const submitForm2 = () => {
+  pageF.isUploading = true;
+  if (optionType.value === 'dropHook') {
+    dropHook(form.value.id).then(res => {
+      ElMessage({
+        message: "鎻愪氦鎴愬姛锛�",
+        type: 'success'
+      })
+      cancelBox2();
+      onLoad(page.value);
+    }).finally(() => {
+      pageF.isUploading = false;
+    })
+  } else if (optionType.value === 'customs') {
+    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'
+      })
+      cancelBox2();
+      onLoad(page.value);
+    }).finally(() => {
+      pageF.isUploading = false;
+    })
+  } else if (optionType.value === 'loading') {
+
+    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'
+      })
+      cancelBox2();
+      onLoad(page.value);
+    }).finally(() => {
+      pageF.isUploading = false;
+    })
+  } else {
+    connectHang({
+      dispatchId: form.value.id,
+      vehicleId: form.value.vehicleId,
+      driverId: form.value.driverId
+    }).then(res => {
+      ElMessage({
+        message: "鎻愪氦鎴愬姛锛�",
+        type: 'success'
+      })
+      cancelBox2();
+      onLoad(page.value);
+    }).finally(() => {
+      pageF.isUploading = false
+    })
+  }
+}
+
+
+const cancelBox2 = () => {
+  open.value = false;
+}
+
+const handleAddGoods = (row: any) => {
+  listTmsGoodsDetail({ dispatchId: row.id, pageSize: 999, pageNum: 1 }).then(res => {
+    goodsTableData.value = res.rows || [];
+    form.value = row;
+    open2.value = true;
+  })
+}
+const rowGoodsUpdate = (row: any, index: any, done: any, loading: any) => {
+  updateTmsGoodsDetail(row).then(res => {
+    ElMessage({
+      message: "淇敼鎴愬姛锛�",
+      type: 'success'
+    })
+    handleAddGoods(form.value);
+    onLoad(page.value);
+    done();
+  }).catch(() => {
+    loading()
+  })
+}
+const rowGoodsSave = (row: any, done: any, loading: any) => {
+  row.dispatchId = form.value.id;
+  row.dispatchNo = form.value.dispatchNo;
+  addTmsGoodsDetail(row).then(res => {
+    ElMessage({
+      message: "鏂板鎴愬姛锛�",
+      type: 'success'
+    })
+    handleAddGoods(form.value);
+    onLoad(page.value);
+    done();
+  }).catch(() => {
+    loading()
+  })
+}
+const rowGoodsDel = (row: any) => {
+  ElMessageBox.confirm("纭畾灏嗛�夋嫨鏁版嵁鍒犻櫎锛�", '绯荤粺鎻愮ず', {
+    confirmButtonText: '纭畾',
+    cancelButtonText: '鍙栨秷',
+    type: 'warning'
+  }).then(() => {
+    return delTmsGoodsDetail(row.id);
+  }).then(() => {
+    handleAddGoods(form.value);
+    ElMessage({
+      message: "鍒犻櫎鎴愬姛锛�",
+      type: 'success'
+    })
+  });
+}
+
+const handleActual = (row: any) => {
+  actualForm.value = row;
+  open3.value = true;
+
+}
+
+const submitForm3 = () => {
+  tmsDispatchOrderRecord(actualForm.value).then(res => {
+    ElMessage({
+      message: "鎿嶄綔鎴愬姛锛�",
+      type: 'success'
+    })
+    open3.value = false;
+    onLoad(page.value)
+  })
+}
+const countChange = (row: any) => {
+  row.sum = Number(row.price) * Number(row.count);
+}
+
+const selectionChange2 = (selection?: any[]) => {
+  selectionList2.value = selection;
+}
+
+const onShipperLoad = ({ page, value, data }: { page: any, value: any, data: any }, callback: any) => {
+  if (value) {
+    let id = value;
+    if (Array.isArray(value)) {
+      id = value[0]
+    }
+    getTmsConsignor(id).then(res => {
+      return callback(res.data || {})
+    })
+  } else {
+    if (form.value.startRegionCode) {
+      const split = form.value.startRegionCode.split(',');
+      const [provinceId, cityId, districtId, streetId] = split;
+
+      if (provinceId) data.provinceId = provinceId;
+      if (cityId) data.cityId = cityId;
+      if (districtId) data.districtId = districtId;
+      if (streetId) data.streetId = streetId;
+    }
+    if (shipperReceiverForm.value.customerId) {
+      form.value.customerId = shipperReceiverForm.value.customerId;
+    }
+    listTmsConsignor({ pageSize: page.pageSize, pageNum: page.currentPage, ...data, customerId: form.value.customerId }).then(res => {
+      return callback({
+        total: res.total,
+        data: res.rows || [],
+      })
+    })
+  }
+}
+const onConsignorLoad = ({ page, value, data }: { page: any, value: any, data: any }, callback: any) => {
+  if (value) {
+    let id = value;
+    if (Array.isArray(value)) {
+      id = value[0]
+    }
+    getTmsConsignor(id).then(res => {
+      return callback(res.data || {})
+    })
+  } else {
+    if (form.value.endRegionCode) {
+      const split = form.value.endRegionCode.split(',');
+      const [provinceId, cityId, districtId, streetId] = split;
+
+      if (provinceId) data.provinceId = provinceId;
+      if (cityId) data.cityId = cityId;
+      if (districtId) data.districtId = districtId;
+      if (streetId) data.streetId = streetId;
+    }
+    if (shipperReceiverForm.value.customerId) {
+      form.value.customerId = shipperReceiverForm.value.customerId;
+    }
+    listTmsConsignor({ pageSize: page.pageSize, pageNum: page.currentPage, ...data, customerId: form.value.customerId }).then(res => {
+      return callback({
+        total: res.total,
+        data: res.rows || [],
+      })
+    })
+  }
+}
+const changeShipper = ({ value }: any) => {
+
+  if (value) {
+    let id = value;
+    if (Array.isArray(value)) {
+      id = value[0]
+    }
+    getTmsConsignor(id).then(res => {
+      let active = res.data || {};
+      let shipperRegionCode = '';
+      if (active.provinceId) {
+        shipperRegionCode = active.provinceId;
+      }
+      if (active.cityId) {
+        shipperRegionCode = shipperRegionCode + "," + active.cityId;
+
+      }
+      if (active.districtId) {
+        shipperRegionCode = shipperRegionCode + "," + active.districtId;
+
+      }
+      if (active.streetId) {
+        shipperRegionCode = shipperRegionCode + "," + active.streetId;
+      }
+      Object.assign(form.value, {
+        shipperId: active.id,
+        shipperName: active.consignorName,
+        shipperRegionLabel: active.regionLabel,
+        shipperAddress: active.addressDetail,
+        shipperMobile: active.contactPhone,
+        shipperRegionCode: shipperRegionCode
+      });
+    })
+  }
+}
+const changeReceiver = ({ value }: any) => {
+
+  if (value) {
+    let id = value;
+    if (Array.isArray(value)) {
+      id = value[0]
+    }
+    getTmsConsignor(id).then(res => {
+      let active = res.data || {};
+      let receiverRegionCode = '';
+      if (active.provinceId) {
+        receiverRegionCode = active.provinceId;
+      }
+      if (active.cityId) {
+        receiverRegionCode = receiverRegionCode + "," + active.cityId;
+
+      }
+      if (active.districtId) {
+        receiverRegionCode = receiverRegionCode + "," + active.districtId;
+
+      }
+      if (active.streetId) {
+        receiverRegionCode = receiverRegionCode + "," + active.streetId;
+      }
+
+      Object.assign(form.value, {
+        receiverId: active.id,
+        receiverName: active.consignorName,
+        receiverRegionLabel: active.regionLabel,
+        receiverAddress: active.addressDetail,
+        receiverMobile: active.contactPhone,
+        receiverRegionCode: receiverRegionCode,
+      });
+    })
+  }
+}
+const consignorAddOption = ref({
+  labelWidth: 120,
+  group: [
+    {
+      label: '鍩虹淇℃伅',
+      prop: 'jcxx',
+      column: {
+        // consignorCode: {
+        //   label: '瑁呭嵏璐х偣缂栫爜',minWidth: 150,
+        //   addDisplay: false, disabled: true,
+        //   editDisplay: true,
+        //   viewDisplay: true,
+        //   hide: false,
+        //   search: true,
+        //   rules: [
+        //     {
+        //       required: true,
+        //       message: "瑁呭嵏璐х偣缂栫爜涓嶈兘涓虹┖", trigger: "blur"
+        //     }
+        //   ],
+        // },
+        consignorName: {
+          label: '瑁呭嵏璐х偣鍚嶇О', minWidth: 150,
+          addDisplay: true,
+          editDisplay: true,
+          viewDisplay: true,
+          hide: false,
+          search: true,
+          rules: [
+            {
+              required: true,
+              message: "瑁呭嵏璐х偣鍚嶇О涓嶈兘涓虹┖", trigger: "blur"
+            }
+          ],
+        },
+        customerName: {
+          label: '鎵�灞炲鎴�', minWidth: 150, disabled: true,
+        },
+        // customerId: {
+        //   label: '鎵�灞炲鎴�',minWidth: 150,
+        //   addDisplay: true,
+        //   editDisplay: true,suffixIcon:'search',
+        //   viewDisplay: true,
+        //   hide: true,
+        //   search: true,
+        //   rules: [
+        //     {
+        //       required: true,
+        //       message: "鎵�灞炲鎴蜂笉鑳戒负绌�", trigger: "change"
+        //     }
+        //   ],
+        //   type: 'table',
+        //   children:{
+        //     border: true,
+        //     searchMenuSpan: 5,
+        //     column:{
+        //       customerType: {
+        //         label: '瀹㈡埛绫诲瀷', minWidth: 120,
+        //         type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/customer_type',
+        //         search: true,
+        //       },
+        //       customerShortName: {
+        //         label: '瀹㈡埛绠�绉�', minWidth: 130,
+        //         search: true,
+        //       },
+        //       customerCode: {
+        //         label: '瀹㈡埛缂栧彿',minWidth: 120,
+        //         search: true,
+        //       },
+        //       contactName: {
+        //         label: '鑱旂郴浜哄鍚�',minWidth: 120,
+        //       },
+        //       signCompanyName: {
+        //         label: '绛剧害鍏徃', minWidth: 150,
+        //       },
+        //     },
+        //
+        //   },
+        //   props:{
+        //     label: 'customerShortName',
+        //     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]
+        //       }
+        //       getTmsCustomerInfo(id).then(res=>{
+        //         return callback(res.data||{})
+        //       })
+        //     }else{
+        //       listTmsCustomerInfo({pageSize:page.pageSize,pageNum:page.currentPage,...data}).then(res=>{
+        //         return callback({
+        //           total: res.total,
+        //           data: res.rows||[],
+        //         })
+        //       })
+        //     }
+        //
+        //   },
+        //   change: ({value}: any) => {
+        //     if(value){
+        //       getTmsCustomerInfo(value).then(res=>{
+        //         let active = res.data || {};
+        //         if (active){
+        //           console.log(dialForm.value)
+        //           form2.value.customerId = active.id
+        //           form2.value.customerSysCode = active.customerCode
+        //           form2.value.customerName = active.customerShortName
+        //         }
+        //       })
+        //     }
+        //   },
+        // },
+        // customerSysCode: {
+        //   label: '瀹㈡埛缂栫爜',minWidth: 150,
+        //   addDisplay: true,
+        //   editDisplay: true,
+        //   viewDisplay: true,
+        //   hide: false,
+        //   search: true,
+        //   disabled: true,
+        //   rules: [
+        //     {
+        //       required: true,
+        //       message: "瀹㈡埛缂栫爜涓嶈兘涓虹┖", trigger: "blur"
+        //     }
+        //   ],
+        // },
+        consignorType: {
+          label: '瑁呭嵏璐х偣绫诲瀷', minWidth: 150,
+          type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/consignor_type',
+          addDisplay: true,
+          editDisplay: true,
+          viewDisplay: true,
+          hide: false,
+          search: true,
+          rules: [
+            {
+              required: true,
+              message: "瑁呭嵏璐х偣绫诲瀷涓嶈兘涓虹┖", trigger: "change"
+            }
+          ],
+        },
+      }
+    },
+    {
+      label: '鑱旂郴浜轰俊鎭�',
+      prop: 'lxrxx',
+      column: {
+        contactName: {
+          label: '鑱旂郴浜哄鍚�', minWidth: 150,
+          addDisplay: true,
+          editDisplay: true,
+          viewDisplay: true,
+          hide: false,
+          search: true,
+          rules: [
+            {
+              required: true,
+              message: "鑱旂郴浜哄鍚嶄笉鑳戒负绌�", trigger: "blur"
+            }
+          ],
+        },
+        contactPhone: {
+          label: '鑱旂郴浜虹數璇�', minWidth: 150,
+          addDisplay: true,
+          editDisplay: true,
+          viewDisplay: true,
+          hide: true,
+          search: false,
+        },
+        contactEmail: {
+          label: '鑱旂郴浜洪偖绠�', minWidth: 150,
+          addDisplay: true,
+          editDisplay: true,
+          viewDisplay: true,
+          hide: true,
+          search: false,
+        },
+      }
+    },
+    {
+      label: '鍦板潃淇℃伅',
+      prop: 'dzxx',
+      column: {
+
+        mapLocationDetail: {
+          label: '鍦板浘浣嶇疆', minWidth: 150,
+          addDisplay: true,
+          editDisplay: true, span: 24,
+          viewDisplay: true,
+          hide: true,
+          search: false,
+          type: 'map',
+          // mapChange: async (params:any)=>{
+          //   if (params.info === "OK") {
+          //     let { province, city, district, township } = params.regeocode.addressComponent || {};
+          //     const res = await getAddressCode({province, city, district, township});
+          //     const {provinceCode, cityCode, districtCode, townshipCode} = res.data || {};
+          //     form2.value.regionLabel = province + " / " + city + " / " + district + " / " + township;
+          //     //form2.value.region = [provinceCode, cityCode, districtCode, townshipCode];
+          //     form2.value.provinceId = provinceCode;
+          //     form2.value.cityId = cityCode;
+          //     form2.value.districtId = districtCode;
+          //     form2.value.streetId = townshipCode;
+          //     form2.value.dispatchTransportArea = params.regeocode.formattedAddress;
+          //     console.log(form2.value,"form2")
+          //   }
+          // },
+          change: async ({ value }: any) => {
+            if (Array.isArray(value) && value.length === 3) {
+              mapRegeo(value[1], value[0]).then(async res => {
+                let params = res.data || {};
+                if (params.info === "OK") {
+                  let { province, city, district, township } = params.regeocode.addressComponent || {};
+                  const res = await getAddressCode({ province, city, district, township });
+                  const { provinceCode, cityCode, districtCode, townshipCode } = res.data || {};
+                  form2.value.regionLabel = province + " / " + city + " / " + district + " / " + township;
+                  form2.value.provinceId = provinceCode;
+                  form2.value.cityId = cityCode;
+                  form2.value.districtId = districtCode;
+                  form2.value.streetId = townshipCode;
+                  form2.value.dispatchTransportArea = params.regeocode.formatted_address || params.regeocode.formattedAddress;
+                }
+              });
+            }
+          },
+        },
+        // dispatchTransportArea: {
+        //   label: '璋冨害鍗曡繍杈撳湴',
+        //   addDisplay: true,minWidth: 150,
+        //   editDisplay: true,
+        //   viewDisplay: true,
+        //   hide: false,
+        //   search: true,
+        //   rules: [
+        //     {
+        //       required: true,
+        //       message: "璋冨害鍗曡繍杈撳湴涓嶈兘涓虹┖", trigger: "blur"
+        //     }
+        //   ],
+        // },
+        electronicFenceRange: {
+          label: '鐢靛瓙鍥存爮鑼冨洿',
+          addDisplay: true, minWidth: 150,
+          editDisplay: true,
+          viewDisplay: true, append: '绫�',
+          hide: false,
+          search: true,
+          rules: [
+            {
+              required: true,
+              message: "鐢靛瓙鍥存爮鑼冨洿涓嶈兘涓虹┖", trigger: "blur"
+            }
+          ],
+        },
+      }
+    },
+    {
+      label: '鍏朵粬淇℃伅',
+      prop: 'qtyxx',
+      column: {
+        remark: {
+          label: '澶囨敞', minWidth: 150,
+          type: 'textarea', minRows: 3, maxRows: 5,
+          addDisplay: true,
+          editDisplay: true, span: 24,
+          viewDisplay: true,
+          hide: true,
+          search: false,
+        },
+      }
+    }
+  ],
+})
+const form2 = ref<any>({});
+const dialForm = ref();
+
+const handleAddShipper = () => {
+  if (!form.value.customerId) {
+    return ElMessage.error('璇峰厛閫夋嫨杩愯緭璺嚎');
+  }
+  form2.value = {
+    customerId: form.value.customerId,
+    customerSysCode: form.value.customerCode,
+    customerName: form.value.customerName,
+  };
+  dialForm.value = $DialogForm(appContext)({
+    title: '鏂板瑁呰揣鍦�',
+    data: form2.value,
+    width: '80%',
+    option: consignorAddOption.value,
+    menuPosition: 'right',
+    callback: (res: any,) => {
+      let data1 = res.data;
+      if (data1.mapLocationDetail) {
+        data1.mapLocation = data1.mapLocationDetail[0] + ',' + data1.mapLocationDetail[1];
+        data1.addressDetail = data1.mapLocationDetail[2]
+      }
+      addTmsConsignor({ ...form2.value, ...data1 }).then(res2 => {
+        let active = res2.data || {};
+        if (active) {
+          let shipperRegionCode = '';
+          if (active.provinceId) {
+            shipperRegionCode = active.provinceId;
+          }
+          if (active.cityId) {
+            shipperRegionCode = shipperRegionCode + "," + active.cityId;
+
+          }
+          if (active.districtId) {
+            shipperRegionCode = shipperRegionCode + "," + active.districtId;
+
+          }
+          if (active.streetId) {
+            shipperRegionCode = shipperRegionCode + "," + active.streetId;
+          }
+          Object.assign(form.value, {
+            shipperId: active.id,
+            shipperName: active.consignorName,
+            shipperRegionLabel: active.regionLabel,
+            shipperAddress: active.addressDetail,
+            shipperMobile: active.contactPhone,
+            shipperRegionCode: shipperRegionCode
+          });
+        }
+        dialForm.value.close();
+        res.done();
+      }).catch(err => {
+        res.done();
+      })
+    },
+  })
+}
+
+const handleAddReceiver = () => {
+  if (!form.value.customerId) {
+    return ElMessage.error('璇峰厛閫夋嫨杩愯緭璺嚎');
+  }
+  form2.value = {
+    customerId: form.value.customerId,
+    customerSysCode: form.value.customerCode,
+    customerName: form.value.customerName,
+  };
+  dialForm.value = $DialogForm(appContext)({
+    title: '鏂板鍗歌揣鍦�',
+    data: form2.value,
+    width: '80%',
+    option: consignorAddOption.value,
+    menuPosition: 'right',
+    callback: (res: any,) => {
+      let data1 = res.data;
+      if (data1.mapLocationDetail) {
+        data1.mapLocation = data1.mapLocationDetail[0] + ',' + data1.mapLocationDetail[1];
+        data1.addressDetail = data1.mapLocationDetail[2]
+      }
+      addTmsConsignor({ ...form2.value, ...data1 }).then(res2 => {
+        let active = res2.data || {};
+        if (active) {
+          let receiverRegionCode = '';
+          if (active.provinceId) {
+            receiverRegionCode = active.provinceId;
+          }
+          if (active.cityId) {
+            receiverRegionCode = receiverRegionCode + "," + active.cityId;
+
+          }
+          if (active.districtId) {
+            receiverRegionCode = receiverRegionCode + "," + active.districtId;
+
+          }
+          if (active.streetId) {
+            receiverRegionCode = receiverRegionCode + "," + active.streetId;
+          }
+
+          Object.assign(form.value, {
+            receiverId: active.id,
+            receiverName: active.consignorName,
+            receiverRegionLabel: active.regionLabel,
+            receiverAddress: active.addressDetail,
+            receiverMobile: active.contactPhone,
+            receiverRegionCode: receiverRegionCode,
+          });
+        }
+        dialForm.value.close();
+        res.done();
+      }).catch(err => {
+        res.done();
+      })
+    },
+  })
+}
+
+const handleCustoms = () => {
+  title.value = '琛ュ厖濮旀墭鎶ュ叧淇℃伅';
+  open.value = true;
+  form.value = clearanceList.value[0];
+  optionType.value = 'customs';
+  optionNum.value = 'checkbox'
+  boxFormOption.value = customsOption.value;
+
+}
+
+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;
+  optionType.value = 'loading';
+  optionNum.value = 'radio';
+
+  boxFormOption.value = loadingOption.value;
+}
+const handleLoading = () => {
+  title.value = '琛ュ厖濮旀墭瑁呭嵏淇℃伅';
+  open.value = true;
+  form.value = selectionList.value[0];
+  optionType.value = 'loading';
+  optionNum.value = 'checkbox'
+  boxFormOption.value = loadingOption.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;
+
+  // 銆愯皟璇曘�戞鏃舵墦鍗帮紝闀垮害搴斾负 0
+}
+const quotationItems = ref();
+const getQuotationItems = async () => {
+  let res = await getDicts("sys_quotation_items");
+  quotationItems.value = res.data || [];
+}
+getQuotationItems();
+
+const getTabData = (val: string) => {
+  let filter = quotationItems.value.filter((item: any) => {
+    return item.remark == val;
+  });
+  if (filter.length > 0) {
+    zzItemsTableData.value = filter.map((item: any) => {
+      return { rowKey: randomId(), freeName: item.dictLabel, free: item.dictValue, unit: '娆�' }
+    })
+  } else {
+    zzItemsTableData.value = []
+  }
+}
+
+const getTab4Data = () => {
+  listTmsFinanceDetail({
+    dispatchOrderId: form.value.id, financeType: 2,
+    pageNum: 1, pageSize: 999
+  }).then(async res => {
+    boxTableData.value = res.rows || [];
+    boxForm.value = {
+      dispatchOrderId: form.value.id,
+      dataSource: 0,
+      financeType: 2,
+    }
+  })
+}
+
+
+
+const submitTabForm = () => {
+  if (['tab1', 'tab2', 'tab3'].includes(active.value)) {
+    let quoteFeeItems = zzItemsTableData.value.filter((item: any) => {
+      return item.count && item.count > 0;
+    })
+    pushTmsQuoteFee({ ...form.value, quoteFeeItems: quoteFeeItems }).then(res => {
+      ElMessage.success('淇濆瓨鎴愬姛');
+      open4.value = false;
+    })
+  } else if (active.value === 'tab4') {
+    // if (Array.isArray(boxForm.value.feeVoucherUrl)) {
+    //   boxForm.value.feeVoucherUrl = boxForm.value.feeVoucherUrl.toString();
+    // }
+    //boxForm.value.rowItems = boxTableData.value;
+    // console.log(tmsFinanceDetails.value);
+    // console.log(boxForm.value);
+    // 1. 鎻愬彇濉啓浜嗛噾棰濈殑鏁版嵁锛堥噾棰濆ぇ浜�0锛�
+    const validDetails = tmsFinanceDetails.value.filter(item => item.actualFeeAmount && item.actualFeeAmount > 0);
+
+    if (validDetails.length === 0) {
+      ElMessage.warning('璇疯嚦灏戝~鍐欎竴椤硅垂鐢ㄩ噾棰�');
+      return;
+    }
+
+    // 2. 鏍¢獙锛氬~鍐欎簡閲戦鐨勬槸鍚﹂兘閫変簡甯佸埗
+    const incomplete = validDetails.find(item => !item.currency);
+    if (incomplete) {
+      ElMessage.error(`璐圭敤绫诲瀷銆�${incomplete.feeTypeName}銆戝凡濉啓閲戦锛岃閫夋嫨甯佸埗锛乣);
+      return; // 鎷︽埅鎻愪氦
+    }
+
+    // 3. 澶勭悊鍑瘉 URL (濡傛灉鏈夊崟寮犳垨澶氬紶涓婁紶鐨勯�昏緫)
+    // 鍋囪鍚庣闇�瑕佺殑鏄�楀彿鍒嗛殧鐨勫瓧绗︿覆
+    const submitData = validDetails.map((item: any) => {
+      let url = item.voucherUrl;
+      item.dispatchOrderId = form.value.id;
+      item.financeType = 2;
+      item.status = 0;
+      item.dataSource = 1;
+      if (Array.isArray(url)) {
+        url = url.join(',');
+      }
+      return { ...item, voucherUrl: url };
+    });
+
+
+    saveTmsFinanceDetail2(submitData).then(res => {
+      ElMessage({
+        message: "鎿嶄綔鎴愬姛锛�",
+        type: 'success'
+      })
+      // open4.value = false;
+      onLoad(page.value)
+      initExpenditureData();
+      boxFormRef.value?.resetFields();
+      getTab4Data();
+    })
+    // saveTmsFinanceDetail(boxForm.value).then(res => {
+    //   ElMessage({
+    //     message: "鎿嶄綔鎴愬姛锛�",
+    //     type: 'success'
+    //   })
+    //   boxFormRef.value?.resetFields();
+    //   getTab4Data();
+    // })
+  }
+}
+
+
+
+const handleChange = (column: any) => {
+  active.value = column.prop;
+  if (['tab1', 'tab2', 'tab3'].includes(column.prop)) {
+    getTabData(column.value)
+  } else if (column.prop === 'tab4') {
+    getTab4Data()
+  }
+}
+
+const handleZZ = () => {
+  open4.value = true;
+  form.value = selectionList.value[0];
+  handleChange(tabsOption.value.column[0]);
+
+  boxFormOption.value = financeOption.value;
+  boxTableOption.value = financeTableOption.value;
+  nextTick(() => {
+    tabsOptionRef.value.active = "0";
+
+  })
+}
+
+const handleClose = (row: any) => {
+
+  if (row.status == 2) {
+    checkCloseOrder(row.id).then(res => {
+      open5.value = true;
+      form.value = row;
+      boxFormOption.value = closeOption.value;
+    });
+  } else {
+    open5.value = true;
+    form.value = row;
+    boxFormOption.value = closeOption.value;
+
+  }
+}
+const submitForm5 = () => {
+  boxFormRef.value.validate((valid: boolean, done: any) => {
+    if (valid) {
+      boxForm.value.id = form.value.id;
+      closeOrder(boxForm.value).then(res => {
+        ElMessage.success('鎿嶄綔鎴愬姛');
+        open5.value = false;
+        done();
+        onLoad(page.value)
+      }).catch(err => {
+        done();
+      })
+    }
+  })
+}
+const printOption = ref({
+  menuBtn: false,
+  labelWidth: 120,
+  column: {
+    sixLinkNo: {
+      label: '鍏仈鍗曞彿',
+    },
+    portName: {
+      label: '琛岄┒鍙e哺',
+      type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/sys_port',
+    },
+    billNo: {
+      label: '鎻愬崟鍙稴/O',
+    },
+    terminalName: {
+      label: '鐮佸ご鍚�',
+    },
+    cargoName: {
+      label: '璐х墿鍚�',
+    },
+    pieceCount: {
+      label: '浠舵暟',
+    },
+    weight: {
+      label: '閲嶉噺',
+    },
+    contactName: {
+      label: '瀹㈡埛鑱旂粶浜�',
+    },
+    contactPhone: {
+      label: '鑱旂粶浜烘墜鏈哄彿',
+    }
+  }
+})
+const print = ref(0)
+const handlePrint = () => {
+  form.value = selectionList.value[0];
+  boxFormOption.value = printOption.value;
+  boxForm.value = form.value
+
+  getTmsDriver(boxForm.value.mainDriverId).then(res => {
+    open6.value = true;
+    const driver = res.data || {};
+    boxForm.value.mainDriverMobile = driver.mobile;
+    print.value = 0
+  })
+
+}
+
+const submitForm6 = () => {
+  print.value = 1;
+  printDispatchOrder(boxForm.value).then(res => {
+    $Print('#print');
+    onLoad(page.value)
+  })
+
+
+}
+const upload = reactive({
+  // 鏄惁鏄剧ず寮瑰嚭灞傦紙鐢ㄦ埛瀵煎叆锛�
+  open: false,
+  // 鏄惁绂佺敤涓婁紶
+  isUploading: false,
+  // 鏄惁鏇存柊宸茬粡瀛樺湪鐨勭敤鎴锋暟鎹�
+  updateSupport: 0,
+  // 璁剧疆涓婁紶鐨勮姹傚ご閮�
+  headers: { Authorization: "Bearer " + getToken() },
+  // 涓婁紶鐨勫湴鍧�
+  url: import.meta.env.VITE_APP_BASE_API + "/tms/tmsDispatchOrder/importData"
+});
+
+
+const uploadRef = ref();
+
+function handleImport() {
+  upload.open = true;
+}
+
+
+/** 涓嬭浇妯℃澘鎿嶄綔 */
+function importTemplate() {
+  importTemplateTmsDispatchOrder();
+
+}
+const handleFileUploadProgress = (event: any, file: any) => {
+  upload.isUploading = true;
+};
+/** 鏂囦欢涓婁紶鎴愬姛澶勭悊 */
+const handleFileSuccess = (response: any, file: any) => {
+  upload.open = false;
+  upload.isUploading = false;
+  uploadRef.value!.clearFiles();
+  proxy.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "瀵煎叆缁撴灉", { dangerouslyUseHTMLString: true });
+  onLoad(page.value);
+};
+/** 鎻愪氦涓婁紶鏂囦欢 */
+function submitFileForm() {
+  uploadRef.value!.submit();
+}
+const shipperReceiverForm = ref<any>({});
+const shipperReceiverFormRef = ref();
+const shipperReceiverFormOption = ref({
+  menuBtn: false, labelWidth: 140,
+  column: {
+    dispatchNos: {
+      label: '璋冨害鍗曞彿', span: 24,
+      rules: [
+        {
+          required: true,
+          message: "璋冨害鍗曞彿涓嶈兘涓虹┖", trigger: "change"
+        }
+      ],
+    },
+    shipperId: {
+      label: '瑁呰揣鐐�', dataType: 'string', disabled: false,
+      display: true,
+      rules: [
+        {
+          required: true,
+          message: "瑁呰揣鐐逛笉鑳戒负绌�", trigger: "change"
+        }
+      ],
+
+    },
+    shipperRegionLabel: {
+      label: '瑁呰揣鐐硅鏀垮尯鍩�',
+      display: true, disabled: true
+
+    },
+    shipperAddress: {
+      label: '瑁呰揣鐐硅缁嗗湴鍧�',
+      display: true, disabled: true
+    },
+    shipperMobile: {
+      label: '瑁呰揣鐐硅仈绯绘柟寮�',
+      display: true, disabled: true
+    },
+    receiverId: {
+      label: '鍗歌揣鐐�',
+      display: true, dataType: 'string', disabled: false,
+      rules: [
+        {
+          required: true,
+          message: "鍗歌揣鐐逛笉鑳戒负绌�", trigger: "change"
+        }
+      ],
+    },
+    receiverRegionLabel: {
+      label: '鍗歌揣鐐硅鏀垮尯鍩�',
+      display: true, disabled: true
+    },
+    receiverAddress: {
+      label: '鍗歌揣鐐硅缁嗗湴鍧�',
+      display: true, disabled: true
+    },
+    receiverMobile: {
+      label: '鍗歌揣鐐硅仈绯绘柟寮�',
+      display: true, disabled: true
+    },
+  }
+});
+
+const changeShipper2 = ({ value }: any) => {
+
+  if (value) {
+    let id = value;
+    if (Array.isArray(value)) {
+      id = value[0]
+    }
+    getTmsConsignor(id).then(res => {
+      let active = res.data || {};
+      let shipperRegionCode = '';
+      if (active.provinceId) {
+        shipperRegionCode = active.provinceId;
+      }
+      if (active.cityId) {
+        shipperRegionCode = shipperRegionCode + "," + active.cityId;
+
+      }
+      if (active.districtId) {
+        shipperRegionCode = shipperRegionCode + "," + active.districtId;
+
+      }
+      if (active.streetId) {
+        shipperRegionCode = shipperRegionCode + "," + active.streetId;
+      }
+      Object.assign(shipperReceiverForm.value, {
+        shipperId: active.id,
+        shipperName: active.consignorName,
+        shipperRegionLabel: active.regionLabel,
+        shipperAddress: active.addressDetail,
+        shipperMobile: active.contactPhone,
+        shipperRegionCode: shipperRegionCode
+      });
+    })
+  }
+}
+const changeReceiver2 = ({ value }: any) => {
+
+  if (value) {
+    let id = value;
+    if (Array.isArray(value)) {
+      id = value[0]
+    }
+    getTmsConsignor(id).then(res => {
+      let active = res.data || {};
+      let receiverRegionCode = '';
+      if (active.provinceId) {
+        receiverRegionCode = active.provinceId;
+      }
+      if (active.cityId) {
+        receiverRegionCode = receiverRegionCode + "," + active.cityId;
+
+      }
+      if (active.districtId) {
+        receiverRegionCode = receiverRegionCode + "," + active.districtId;
+
+      }
+      if (active.streetId) {
+        receiverRegionCode = receiverRegionCode + "," + active.streetId;
+      }
+
+      Object.assign(shipperReceiverForm.value, {
+        receiverId: active.id,
+        receiverName: active.consignorName,
+        receiverRegionLabel: active.regionLabel,
+        receiverAddress: active.addressDetail,
+        receiverMobile: active.contactPhone,
+        receiverRegionCode: receiverRegionCode,
+      });
+    })
+  }
+}
+
+const hasDifferentCustomer = (() => {
+  const customerSet = new Set(
+    selectionList.value.map((item: any) => item.customerId)
+  );
+  return customerSet.size > 1;
+})();
+const handleZXHDJ = () => {
+  if (hasDifferentCustomer) {
+    ElMessage.error('鍗曟鎿嶄綔鍙兘鎿嶄綔涓�涓鎴风殑鏁版嵁');
+    return;
+  }
+  let filter = selectionList.value.filter((item: any) => !item.shipperId);
+  let filter2 = selectionList.value.filter((item: any) => !item.receiverId);
+  let zLen = filter.length || 0;
+  let xLen = filter2.length || 0;
+  if (zLen == 0 && xLen == 0) {
+    ElMessage.error('閫夋嫨鐨勬暟鎹凡瀹屾垚瀵硅鍗歌揣鐐圭櫥璁�');
+    return;
+  }
+  if (zLen > 0 && xLen > 0) {
+    if (zLen > xLen) {
+      ElMessage.error('閫夋嫨鐨勬暟鎹凡濉啓鍗歌揣鐐规暟鎹紝璇峰崟鐙紪杈�');
+      return;
+    }
+    if (zLen < xLen) {
+      ElMessage.error('閫夋嫨鐨勬暟鎹凡濉啓瑁呰揣鐐规暟鎹紝璇峰崟鐙紪杈�');
+      return;
+    }
+  }
+  let item: any = selectionList.value[0];
+  shipperReceiverForm.value.customerId = item?.customerId
+  shipperReceiverForm.value.customerCode = item?.customerCode
+  shipperReceiverForm.value.customerName = item?.customerName;
+  shipperReceiverForm.value.dispatchNos = selectionList.value.map((item: any) => item.dispatchNo) || [];
+
+  shipperReceiverFormOption.value.column.shipperId.disabled = zLen == 0;
+  shipperReceiverFormOption.value.column.shipperId.rules[0].required = zLen != 0;
+  shipperReceiverFormOption.value.column.receiverId.disabled = xLen == 0;
+  shipperReceiverFormOption.value.column.receiverId.rules[0].required = xLen != 0;
+
+
+  open7.value = true;
+}
+
+const handleAddShipper2 = () => {
+
+  form2.value = {
+    customerId: shipperReceiverForm.value.customerId,
+    customerSysCode: shipperReceiverForm.value.customerCode,
+    customerName: shipperReceiverForm.value.customerName,
+  };
+  dialForm.value = $DialogForm(appContext)({
+    title: '鏂板瑁呰揣鍦�',
+    data: form2.value,
+    width: '80%',
+    option: consignorAddOption.value,
+    menuPosition: 'right',
+    callback: (res: any,) => {
+      let data1 = res.data;
+      if (data1.mapLocationDetail) {
+        data1.mapLocation = data1.mapLocationDetail[0] + ',' + data1.mapLocationDetail[1];
+        data1.addressDetail = data1.mapLocationDetail[2]
+      }
+      addTmsConsignor({ ...form2.value, ...data1 }).then(res2 => {
+        let active = res2.data || {};
+        if (active) {
+          let shipperRegionCode = '';
+          if (active.provinceId) {
+            shipperRegionCode = active.provinceId;
+          }
+          if (active.cityId) {
+            shipperRegionCode = shipperRegionCode + "," + active.cityId;
+
+          }
+          if (active.districtId) {
+            shipperRegionCode = shipperRegionCode + "," + active.districtId;
+
+          }
+          if (active.streetId) {
+            shipperRegionCode = shipperRegionCode + "," + active.streetId;
+          }
+          Object.assign(shipperReceiverForm.value, {
+            shipperId: active.id,
+            shipperName: active.consignorName,
+            shipperRegionLabel: active.regionLabel,
+            shipperAddress: active.addressDetail,
+            shipperMobile: active.contactPhone,
+            shipperRegionCode: shipperRegionCode
+          });
+        }
+        dialForm.value.close();
+        res.done();
+      }).catch(err => {
+        res.done();
+      })
+    },
+  })
+}
+
+const handleAddReceiver2 = () => {
+  if (!form.value.customerId) {
+    return ElMessage.error('璇峰厛閫夋嫨杩愯緭璺嚎');
+  }
+  form2.value = {
+    customerId: shipperReceiverForm.value.customerId,
+    customerSysCode: shipperReceiverForm.value.customerCode,
+    customerName: shipperReceiverForm.value.customerName,
+  };
+  dialForm.value = $DialogForm(appContext)({
+    title: '鏂板鍗歌揣鍦�',
+    data: form2.value,
+    width: '80%',
+    option: consignorAddOption.value,
+    menuPosition: 'right',
+    callback: (res: any,) => {
+      let data1 = res.data;
+      if (data1.mapLocationDetail) {
+        data1.mapLocation = data1.mapLocationDetail[0] + ',' + data1.mapLocationDetail[1];
+        data1.addressDetail = data1.mapLocationDetail[2]
+      }
+      addTmsConsignor({ ...form2.value, ...data1 }).then(res2 => {
+        let active = res2.data || {};
+        if (active) {
+          let receiverRegionCode = '';
+          if (active.provinceId) {
+            receiverRegionCode = active.provinceId;
+          }
+          if (active.cityId) {
+            receiverRegionCode = receiverRegionCode + "," + active.cityId;
+
+          }
+          if (active.districtId) {
+            receiverRegionCode = receiverRegionCode + "," + active.districtId;
+
+          }
+          if (active.streetId) {
+            receiverRegionCode = receiverRegionCode + "," + active.streetId;
+          }
+
+          Object.assign(shipperReceiverForm.value, {
+            receiverId: active.id,
+            receiverName: active.consignorName,
+            receiverRegionLabel: active.regionLabel,
+            receiverAddress: active.addressDetail,
+            receiverMobile: active.contactPhone,
+            receiverRegionCode: receiverRegionCode,
+          });
+        }
+        dialForm.value.close();
+        res.done();
+      }).catch(err => {
+        res.done();
+      })
+    },
+  })
+}
+
+const handleCloseDispatchNo = (tag: string) => {
+  let indexOf = shipperReceiverForm.value.dispatchNos.indexOf(tag);
+  shipperReceiverForm.value.dispatchNos.splice(indexOf, 1);
+}
+
+const submitZxForm = () => {
+  shipperReceiverFormRef.value.validate((valid: boolean, done: any) => {
+    if (valid) {
+      ypdddjSumbit(shipperReceiverForm.value).then(res => {
+        ElMessage.success('鐧昏鎴愬姛');
+        open7.value = false;
+        onLoad(page.value);
+
+        done();
+      }).catch(err => {
+        done();
+      })
+    }
+  })
+}
+const importLogVisible = ref(false);
+const importLogLoading = ref(false);
+const importLogData = ref([]);
+
+// 寮圭獥琛ㄦ牸閰嶇疆
+const importLogOption = {
+  header: false,
+  addBtn: false,
+  menu: false, // 浠呭睍绀猴紝涓嶉渶瑕佹搷浣滃垪
+  column: [
+    { label: '瀵煎叆鏃堕棿', prop: 'importTime', type: 'datetime', format: 'YYYY-MM-DD HH:mm:ss' },
+    { label: '瀵煎叆鏂囦欢鍚嶇О', prop: 'fileName' },
+    { label: '鎿嶄綔浜�', prop: 'operator' },
+    { label: '鎴愬姛琛屾暟', prop: 'successCount' },
+    { label: '澶辫触琛屾暟', prop: 'failureCount' },
+    { label: '澶辫触璇存槑', prop: 'failureDescription', overHidden: true }
+  ]
+};
+
+// 鎵撳紑鏃ュ織寮圭獥
+const handleImportLog = () => {
+  importLogVisible.value = true;
+};
+
+// 鑾峰彇鏃ュ織鍒楄〃鏁版嵁锛堥渶鏍规嵁瀹為檯 API 璋冩暣锛�
+const getImportLogList = () => {
+  importLogData.value = []
+  // 鍋囪鏈変竴涓� getLogApi 鐨勬帴鍙�
+  tmsTmsDispatchOrderImportLog().then(res => {
+    if (res.code == 200) {
+      importLogLoading.value = true;
+      importLogData.value = res.data;
+      importLogLoading.value = false;
+    }
+  });
+
+};
+// 1. 瀹氫箟鍞竴鐨勫彉閲忓悕
+const tmsFinanceDetails = ref([]); // 鏁版嵁婧�
+const expenditureTableOption = ref({
+  addBtn: false,
+  menu: false,
+  header: false,
+  border: true,
+  index: false,
+  selection: false,
+  column: [
+    {
+      label: '璐圭敤绫诲瀷',
+      prop: 'feeTypeName',
+      width: 150
+    },
+    {
+      label: '璐圭敤閲戦',
+      prop: 'actualFeeAmount',
+      slot: true,
+      width: 150
+    },
+    {
+      label: '甯佸埗',
+      prop: 'currency',
+      slot: true,
+      width: 200
+    },
+    {
+
+      label: '璐圭敤鍑瘉',
+      display: true,
+      span: 24,
+      accept: 'string', dataType: 'object',
+      type: 'upload',
+      // action: '/common/upload2',
+      prop: 'voucherUrl', // 杩欓噷鏀规垚 prop 灞炴��
+      slot: true,        // 寮�鍚彃妲�
+      width: 200
+    },
+    {
+      label: '澶囨敞',
+      prop: 'remark',
+      slot: true
+    }
+  ]
+});
+// 3. 鍥炴樉鍒濆鍖�
+const initExpenditureData = () => {
+  tmsFinanceDetails.value = []
+  if (fee_type.value && fee_type.value.length > 0 && tmsFinanceDetails.value.length === 0) {
+    tmsFinanceDetails.value = fee_type.value.map(item => ({
+      feeType: item.value,
+      feeTypeName: item.label,
+      feeAmount: undefined,
+      currency: '',
+      voucherUrl: '',
+      remark: ''
+    }));
+  }
+};
+// 4. 鐩戝惉鍒囨崲
+watch(() => active.value, (val) => {
+  if (val === 'tab4') {
+    initExpenditureData();
+  }
+});
+const handleUploadAfter = (res: any, row: any) => {
+  // res 鏄帴鍙h繑鍥炵殑瀹屾暣鏁版嵁
+  if (res.code === 200) {
+    // 鎵嬪姩缁欒繖涓�琛岀殑鏁版嵁璧嬪��
+    row.voucherUrl = res.data.url;
+  } else if (res.data && res.data.url) {
+    // 濡傛灉杩斿洖鐨勬暟鎹寘瑁瑰湪 data 閲�
+    row.voucherUrl = res.data.url;
+  }
+};
+/** 褰撴枃浠惰秴鍑洪檺鍒舵椂锛堝疄鐜拌嚜鍔ㄦ浛鎹㈤�昏緫锛� */
+const handleExceed = (files: any, row: any) => {
+  // 1. 娓呴櫎褰撳墠鏄剧ず鐨勬枃浠跺垪琛�
+  uploadRef.value.clearFiles();
+  // 2. 鎵嬪姩鎶婃柊閫夋嫨鐨勬枃浠舵坊鍔犺繘鍘婚噸鏂颁笂浼�
+  const file = files[0];
+  uploadRef.value.handleStart(file);
+  uploadRef.value.submit();
+};
+
+const flowLogIshow = ref()
+const flowParams = ref([])
+
+const handleFlow = (row: string) => {
+  let data = {
+    headId: row.id,
+  }
+  listTmsDispatchOrderLog(data).then((res) => {
+    flowParams.value = res.rows
+    flowLogIshow.value.openModel()
+
+  })
+}
+
+const boxSelectionChange = (selection: any[]) => {
+  boxSelectionList.value = selection;
+}
+const handleBatchBoxDel = () => {
+  if (boxSelectionList.value.length === 0) {
+    ElMessage.warning('璇烽�夋嫨瑕佷綔搴熺殑璐圭敤鏄庣粏');
+    return;
+  }
+
+  ElMessageBox.confirm(`纭瑕佷綔搴熼�変腑鐨� ${boxSelectionList.value.length} 鏉¤垂鐢ㄦ槑缁嗗悧锛焋, '璀﹀憡', {
+    confirmButtonText: '纭畾',
+    cancelButtonText: '鍙栨秷',
+    type: 'warning'
+  }).then(() => {
+    let data = {
+      id: boxSelectionList.value[0].id,
+      status: 1
+    }
+    tmsFinanceDetail(data).then(res => {
+      ElMessage.success('浣滃簾鎴愬姛');
+      getTab4Data(); // 鍒锋柊鏁版嵁
+    }).catch(err => {
+      ElMessage.error('浣滃簾澶辫触');
+    });
+  }).catch(() => {
+    // 鍙栨秷鎿嶄綔
+  });
+}
+
+const handleOrderTypeChange = (value: any) => {
+  // 闃叉 value 涓� null 鎴� undefined 鏃跺嚭閿� (褰撴竻绌洪�夋嫨鏃�)
+  if (value === null || value === undefined) {
+    return;
+  }
+
+  option.value.group.forEach((item: any) => {
+    if (item.prop == 'pcxx') {
+      // 澶勭悊瑁呰揣鐐瑰繀濉鍒�
+      if (item.column.shipperId && item.column.shipperId.rules) {
+        item.column.shipperId.rules.forEach((cItem: any) => {
+          cItem.required = !(value == 1);
+        });
+      }
+
+      // 澶勭悊鍗歌揣鐐瑰繀濉鍒�
+      if (item.column.receiverId && item.column.receiverId.rules) {
+        item.column.receiverId.rules.forEach((cItem: any) => {
+          cItem.required = !(value == 1);
+        });
+      }
+    }
+  });
+
+  // 銆愭柊澧為�昏緫銆戝鏋滃垏鎹㈠埌浜嗛潪蹇呭~鐘舵�� (value == 1)锛屽垯娓呴櫎杩欎袱涓瓧娈电殑鏍¢獙鎻愮ず
+  if (value == 1) {
+    // 纭繚 crudRef 瀛樺湪涓旀毚闇蹭簡 clearValidate 鏂规硶
+    if (crudRef.value && typeof crudRef.value.clearValidate === 'function') {
+      // 娓呴櫎鎸囧畾瀛楁鐨勬牎楠岀姸鎬�
+      crudRef.value.clearValidate(['shipperId', 'receiverId']);
+    }
+  }
+};
+/* 杞︾墝鍙� */
+// --- 鐘舵�佺鐞� ---
+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>
+::v-deep .cydprint .el-dialog__body {
+  overflow: hidden;
+  //padding: 0;
+  margin: 0;
+}
+
+#print {
+  .title {
+    text-align: center;
+    font-size: 14pt;
+    color: #000;
+    line-height: 23pt;
+    font-weight: bold;
+    margin: 0;
+  }
+
+  .header {
+    position: relative;
+
+    .order {
+      font-size: 12pt;
+      color: #000;
+      line-height: 23pt;
+    }
+
+    .sub-title {
+      position: absolute;
+      left: 50%;
+      transform: translateX(-50%);
+      top: 0;
+      font-size: 12pt;
+      color: #000;
+      line-height: 23pt;
+      text-decoration: underline;
+    }
+
+  }
+
+  table {
+    width: 100%;
+    border-collapse: collapse;
+    /* 鍚堝苟杈规 */
+    font-size: 12px;
+    table-layout: fixed;
+    /* 鍏抽敭鐐� */
+  }
+
+  table,
+  td {
+    border: 1px solid #000;
+
+  }
+
+  td {
+    padding: 4px;
+    vertical-align: middle;
+    width: 50%;
+    /* 寮哄埗绛夊 */
+    word-break: break-all;
+  }
+}
+
+.dispatchNos {
+  //border: 1px solid #ebeef5;
+  border-radius: 4px;
+  min-height: 73px;
+  padding: 1px 11px;
+  box-shadow: 0 0 0 1px var(--el-disabled-border-color) inset;
+}
+
+.link-btn {
+  font-size: 18px;
+}
+
+/*  */
+/* 鐜版湁鐨勬牱寮忎繚鎸佷笉鍙�... */
+.specific-drag-area {
+  width: 100%;
+
+  :deep(.full-width-drag) {
+
+    // 1. 鏍稿績锛氶殣钘� Avue 榛樿鍦� dragger 涓嬫柟鐢熸垚鐨勯偅涓�滅偣鍑讳笂浼犫�濇寜閽�
+    // 鍦� 3.x 鐗堟湰涓紝瀹冩槸 el-upload 鍚庣殑涓�涓厔寮熻妭鐐规垨鑰呮槸鍐呴儴鑺傜偣
+    .el-button--primary {
+      display: none !important;
+    }
+
+    .el-upload {
+      width: 100%;
+      display: block; // 纭繚鍧楃骇鏄剧ず
+
+      .el-upload-dragger {
+        width: 100%;
+        height: 120px;
+        background-color: #fcfdfe;
+        border: 2px dashed #dcdfe6;
+        border-radius: 8px;
+        display: flex;
+        flex-direction: column;
+        align-items: center;
+        justify-content: center;
+        padding: 0 !important;
+
+        // 瑕嗙洊 Element Plus 榛樿鐨勫唴閮ㄦ枃瀛楁帓鐗堬紝闃叉鍐茬獊
+        .el-upload__text {
+          display: none !important;
+        }
+
+        &:hover {
+          border-color: #409eff;
+          background-color: #f5f7fa;
+        }
+      }
+    }
+  }
+
+  // 3. 鑷畾涔夊唴瀹圭殑鏍峰紡锛堢‘淇濆畠涓嶈 display:none 褰卞搷锛�
+  .drag-zone-inner {
+    pointer-events: none;
+    text-align: center;
+
+    .upload-icon {
+      font-size: 32px !important;
+      color: #909399;
+      margin-bottom: 8px;
+    }
+
+    .drag-text {
+      .main-title {
+        font-size: 14px;
+        color: #606266;
+        font-weight: bold;
+        line-height: 1.5;
+      }
+
+      .sub-title {
+        font-size: 12px;
+        color: #a8abb2;
+        margin-top: 4px;
+      }
+    }
+  }
+}
+</style>

--
Gitblit v1.8.0