From 90c4fbd121dd18013e333346c99bbc9844cd6fec Mon Sep 17 00:00:00 2001
From: zhangback <zhangback@163.com>
Date: 星期一, 08 十二月 2025 13:24:16 +0800
Subject: [PATCH] 提交

---
 ui/admin-ui3/src/views/tms/tmsDispatchOrder/index.vue | 2359 ++++++++++++++++++++++++++++++++++++++++------------------
 1 files changed, 1,620 insertions(+), 739 deletions(-)

diff --git a/ui/admin-ui3/src/views/tms/tmsDispatchOrder/index.vue b/ui/admin-ui3/src/views/tms/tmsDispatchOrder/index.vue
index 5858882..afdb80f 100644
--- a/ui/admin-ui3/src/views/tms/tmsDispatchOrder/index.vue
+++ b/ui/admin-ui3/src/views/tms/tmsDispatchOrder/index.vue
@@ -21,21 +21,21 @@
         @on-load="onLoad"
     >
       <template #menu-left>
-<!--        <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="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
@@ -69,30 +69,54 @@
         >鎺ユ寕
         </el-button>
 
+        <el-button
+            type="warning"
+            icon="Avatar"
+            :disabled="!( isCustoms == 0)"
+            @click="handleCustoms"
+            v-hasPermi="['tms:tmsDispatchOrder:customs']"
+        >濮旀墭鎶ュ叧淇℃伅
+        </el-button>
+        <el-button
+            type="primary"
+            icon="UserFilled"
+            :disabled="!( isLoad == 0)"
+            @click="handleLoading"
+            v-hasPermi="['tms:tmsDispatchOrder:loading']"
+        >濮旀墭鍗歌揣淇℃伅
+        </el-button>
       </template>
       <template #menu-before="{row}">
-        <el-link size="small" type="primary"  @click="handleAddGoods(row)" class="link-btn"
+        <el-link size="small" type="primary" @click="handleAddGoods(row)" class="link-btn"
+                 v-hasPermi="['tms:tmsGoodsDetail:add']"
                  :underline="false" icon="el-icon-document-add">杩愯緭璐у搧鐧昏
         </el-link>
-        <el-link size="small" type="primary"  @click="handleActual(row)" class="link-btn"
+        <el-link size="small" type="primary" @click="handleActual(row)" class="link-btn"
+                 v-hasPermi="['tms:tmsDispatchOrder:update']"
                  :underline="false" icon="el-icon-set-up">瀹為檯杩愯緭璁板綍
         </el-link>
         <el-link size="small" type="primary" v-if="row.status == 0" @click="handleConfirm(row)" class="link-btn"
+                 v-hasPermi="['tms:tmsDispatchOrder:confirmOrder']"
                  :underline="false" icon="el-icon-pointer">纭畾
         </el-link>
         <el-link size="small" type="primary" @click="handleCopy(row)" class="link-btn" :underline="false"
+                 v-hasPermi="['tms:tmsDispatchOrder:copyOrder']"
                  icon="el-icon-connection">澶嶅埗
         </el-link>
         <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="false" icon="el-icon-upload">涓婁紶琛岀▼
         </el-link>
         <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="false" icon="el-icon-view">鏌ョ湅琛岀▼
         </el-link>
         <el-link size="small" type="primary" v-if="[2].includes(row.status)" @click="handleOk(row)" class="link-btn"
+                 v-hasPermi="['tms:tmsDispatchOrder:okOrder']"
                  :underline="false" icon="el-icon-circle-check">瀹屾垚琛岀▼
         </el-link>
-        <el-link size="small" type="primary" v-if="[2,3].includes(row.status)" @click="handleAddFinance(row)" class="link-btn"
+        <el-link size="small" type="primary" v-if="[2,3].includes(row.status)" @click="handleAddFinance(row)"
+                 class="link-btn" v-hasPermi="['tms:tmsFinanceDetail:add']"
                  :underline="false" icon="el-icon-edit-pen">璐圭敤鐧昏
         </el-link>
       </template>
@@ -101,9 +125,46 @@
                  icon="el-icon-tickets">鏃ュ織
         </el-link>
       </template>
+
+      <template #shipperId-form="{disabled}">
+        <div style="display:flex; align-items: center;justify-content: space-between">
+          <avue-input-table :props="consignorProps"
+                            :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"
+                            :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%">
-      <avue-form v-if="optionType == 'addItinerary' || optionType == 'addFinance'" v-model="boxForm" ref="boxFormRef" :option="boxFormOption">
+      <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
@@ -113,11 +174,13 @@
       </avue-crud>
       <template #footer>
         <div class="dialog-footer">
-          <el-button type="primary" v-if="optionType == 'addItinerary' || optionType == 'addFinance'" :loading="pageF.isUploading" @click="submitForm">
+          <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">
+          <el-button type="primary" v-if="optionType == 'generate' " :loading="pageF.isUploading"
+                     @click="submitGenerate">
             {{ pageF.isUploading ? '鐢熸垚涓�' : '鐢熸垚璐圭敤' }}
           </el-button>
           <el-button @click="cancelBox">鍙� 娑�</el-button>
@@ -132,23 +195,53 @@
             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-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'">
+      <div v-if="optionType == 'connectHang'">
         <el-descriptions style="margin-bottom: 20px"
-            :column="2"
-            border
+                         :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-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 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>
+        <avue-form v-model="form" ref="boxFormRef" :option="boxFormOption">
+
+        </avue-form>
+      </div>
+
+      <div v-if="optionType == 'loading'">
+        <el-descriptions style="margin-bottom: 20px"
+                         :column="2"
+                         border
+        >
+          <el-descriptions-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>
         <avue-form v-model="form" ref="boxFormRef" :option="boxFormOption">
 
@@ -156,7 +249,7 @@
       </div>
       <template #footer>
         <div class="dialog-footer">
-          <el-button type="primary"  :loading="pageF.isUploading" @click="submitForm2">
+          <el-button type="primary" :loading="pageF.isUploading" @click="submitForm2">
             {{ pageF.isUploading ? '鎻愪氦涓�' : '纭� 瀹�' }}
           </el-button>
           <el-button @click="cancelBox2">鍙� 娑�</el-button>
@@ -175,32 +268,31 @@
           :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>-->
+      <!--      <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 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>
+      <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>
-
 
 
   </basicContainer>
@@ -215,10 +307,10 @@
   getTmsDispatchOrder,
   listTmsDispatchOrder,
   updateTmsDispatchOrder,
-  confirmOrder, copyOrder, okOrder, initGenerate, generateTmsDispatchOrder, dropHook, connectHang
+  confirmOrder, copyOrder, okOrder, initGenerate, generateTmsDispatchOrder, dropHook, connectHang,customsOrder,loadingOrder,
 } from "@/api/tms/tmsDispatchOrder";
 import useCurrentInstance from "@/utils/useCurrentInstance";
-import {computed, onMounted, reactive, ref, toRefs, watch} from "vue";
+import {computed, onMounted, reactive, ref, toRefs, watch, getCurrentInstance} from "vue";
 import {PagesInterface, PageQueryInterface} from "@/utils/globalInterface";
 import {usePagePlus} from "@/hooks/usePagePlus";
 import {hasPermission} from "@/utils/permissionUtils";
@@ -230,12 +322,20 @@
 import {getTmsVehicle, listTmsVehicle} from "@/api/tms/tmsVehicle";
 import {getTmsContainer, listTmsContainer} from "@/api/tms/tmsContainer";
 import {getTmsShelf, listTmsShelf} from "@/api/tms/tmsShelf";
-import {getTmsConsignor, listTmsConsignor} from "@/api/tms/tmsConsignor";
+import {addTmsConsignor, getTmsConsignor, listTmsConsignor} from "@/api/tms/tmsConsignor";
 import {ElMessage, ElMessageBox} from "element-plus";
 import {addTmsTrip, listTmsTrip} from "@/api/tms/tmsTrip";
 import {addTmsFinanceDetail, listTmsFinanceDetail, 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} from '@smallwei/avue'
+import {getTmsCustomerInfo, listTmsCustomerInfo} from "@/api/tms/tmsCustomerInfo";
+import {getAddressCode} from "@/api/tms/tmsRegion";
+import {mapRegeo} from "@/api/common";
+
+const {appContext} = getCurrentInstance();
 
 const {proxy} = useCurrentInstance();
 const crudRef = ref();
@@ -250,7 +350,7 @@
   } 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)
+    return hasPermission(["tms:tmsDispatchOrder:edit"]) && [0, 1].includes(row?.status)
   } else if (key == 'viewBtn') {
     return hasPermission(["tms:tmsDispatchOrder:query"])
   } else {
@@ -273,16 +373,20 @@
   boxTableOption: <any>{},
   title: '',
   open: false,
-  open2:false,
+  open2: false,
   goodsTableData: <any>[],
-  goodsForm:<any>{},
+  selectionList2: <any>[],
+  goodsForm: <any>{},
   open3: false,
-  actualForm:<any>{},
+  actualForm: <any>{},
+  isCustoms:<any> -1,
+  isLoad: -1,
 })
-const {queryParams, form, page, selectionList,open3,
+const {
+  queryParams, form, page, selectionList, open3,
   boxTableData, optionType,
-  boxFormOption,boxForm,boxTableOption,title,open,open2,
-  goodsTableData,goodsForm,actualForm
+  boxFormOption, boxForm, boxTableOption, title, open, open2,
+  goodsTableData, goodsForm, actualForm, selectionList2,isCustoms,isLoad
 } = toRefs(data);
 const option = ref({
   pageKey: 'TmsDispatchOrder',
@@ -296,77 +400,77 @@
       label: '鍩烘湰淇℃伅',
       prop: 'jbxx',
       column: {
-        projectId: {
-          label: '鍏宠仈椤圭洰',
+
+        quoteDetailId: {
+          label: '杩愯緭绾胯矾', span: 24,
           display: true,
           rules: [
             {
               required: true,
-              message: "鍏宠仈椤圭洰涓嶈兘涓虹┖", trigger: "change"
+              message: "璇烽�夋嫨杩愯緭璺嚎", trigger: "change"
             }
           ],
+          type: 'table', suffixIcon: 'search',dataType: 'string',
           change: (val: any) => {
-            const table = crudRef.value?.getPropRef?.('projectId')?.$refs?.temp;
+            console.log(val)
+            const table = crudRef.value?.getPropRef?.('quoteDetailId')?.$refs?.temp;
             if (!table) return;
             let active = table.active;
             if (Array.isArray(active)) active = active[0];
             if (active) {
+              console.log(active)
               Object.assign(form.value, {
-                projectId: active.id,
+                quoteDetailId: active.quoteDetailId,
+                transportLine: active.transportRoute,
+                startRegionCode: active.startRegionCode,
+                endRegionCode: active.endRegionCode,
+                projectId: active.projectId,
                 projectName: active.projectName,
-                customerId: active.relatedCustomerId,
-                customerName: active.relatedCustomerName,
-                customerCode: active.relatedCustomerCode,
-                contractId: active.relatedContractId,
-                contractName: active.relatedContractName,
+                customerId: active.customerId,
+                customerName: active.customerFullName,
+                customerCode: active.customerCode,
+                contractId: active.contractId,
+                contractName: active.contractName,
+                requiredVehicleTypes: active.vehicleType,
+                quotePlanId: active.quotePlanId,
               });
             }
           },
-          type: 'table', suffixIcon: 'search',
           children: {
             border: true,
             searchMenuSpan: 5,
             column: {
+              transportRoute: {
+                label: '杩愯緭璺嚎', minWidth: 130,
+                search: true,
+              },
+              customerFullName: {
+                label: '瀹㈡埛鍏ㄧО', minWidth: 120,
+                search: true,
+              },
               projectName: {
-                label: '椤圭洰鍚嶇О', minWidth: 130,
-                search: true,
-              },
-              projectCode: {
-                label: '椤圭洰缂栧彿', minWidth: 120,
-                search: true,
-              },
-              relatedContractName: {
-                label: '鍏宠仈鍚堝悓',
+                label: '鍏宠仈椤圭洰',
                 display: false, minWidth: 150,
                 search: true,
               },
 
-              relatedCustomerName: {
-                label: '鍏宠仈瀹㈡埛',
+              contractName: {
+                label: '鍏宠仈鍚堝悓',
                 display: false, minWidth: 150,
                 search: true,
               },
-              status: {
-                label: '鐘舵��', dataType: 'string',
-                type: 'radio', dicUrl: '/system/dict/data/type/data_status',
-                addDisplay: false, minWidth: 150,
-                editDisplay: false,
-                viewDisplay: true,
+              vehicleType: {
+                label: '杞﹀瀷', dataType: 'string',
+                type: 'select', dicUrl: '/system/dict/data/type/vehicle_type', minWidth: 150,
                 hide: false,
                 search: true,
-                rules: [
-                  {
-                    required: true,
-                    message: "鐘舵�佷笉鑳戒负绌�", trigger: "blur"
-                  }
-                ],
               },
             },
 
           },
           props: {
-            label: 'projectName',
-            value: 'id'
+            label: 'transportRoute',
+            value: 'quoteDetailId'
           },
           onLoad: ({page, value, data}: { page: any, value: any, data: any }, callback: any) => {
             if (value) {
@@ -374,11 +478,11 @@
               if (Array.isArray(value)) {
                 id = value[0]
               }
-              getTmsProject(id).then(res => {
+              getTransportRouteVi(id).then(res => {
                 return callback(res.data || {})
               })
             } else {
-              listTmsProject({pageSize: page.pageSize, pageNum: page.currentPage, ...data}).then(res => {
+              listTransportRouteVi({pageSize: page.pageSize, pageNum: page.currentPage, ...data}).then(res => {
                 return callback({
                   total: res.total,
                   data: res.rows || [],
@@ -387,10 +491,13 @@
             }
 
           }
-
         },
         customerName: {
           label: '瀹㈡埛鍚嶇О',
+          display: true, disabled: true
+        },
+        projectName: {
+          label: '鍏宠仈椤圭洰',
           display: true, disabled: true
         },
         // customerCode: {
@@ -398,10 +505,19 @@
         //   display: true,disabled:true
         // },
         contractName: {
-          label: '鍏宠仈鍚堝悓鍚嶇О',
+          label: '鍏宠仈鍚堝悓',
           display: true, disabled: true
         },
-
+        requiredVehicleTypes: {
+          label: '涓嬪崟杞﹀瀷', disabled: true,
+          display: true, type: 'select', dicUrl: '/system/dict/data/type/vehicle_type', dataType: 'string',
+          rules: [
+            {
+              required: true,
+              message: "涓嬪崟杞﹀瀷涓嶈兘涓虹┖", trigger: "blur"
+            }
+          ],
+        },
         orderType: {
           label: '璁㈠崟绫诲瀷',
           display: true,
@@ -413,16 +529,283 @@
               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: '绛炬敹绫诲瀷',
+        // 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: 'select', dataType: 'string',
-          dicUrl: '/system/dict/data/type/sign_type',
+          type: 'radio', dicUrl: '/system/dict/data/type/sys_number_is', dataType: 'string',
           rules: [
             {
               required: true,
-              message: "绛炬敹绫诲瀷涓嶈兘涓虹┖", trigger: "change"
+              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',
+        // },
+        latestDeparture: {
+          label: '瑕佹眰鏈�鏅氬嚭鍙戞椂闂�',
+          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,
+          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"
+            }
+          ],
+        },
+
+
+      }
+    },
+    {
+      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) => {
+            console.log(value)
+            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"
             }
           ],
         },
@@ -447,7 +830,7 @@
               });
             }
           },
-          type: 'table', suffixIcon: 'search',
+          type: 'table', suffixIcon: 'search',dataType: 'string',
           children: {
             border: true,
             searchLabelWidth: 100,
@@ -512,170 +895,9 @@
           }
 
         },
-        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 || [],
-                })
-              })
-            }
-
-          }
-        },
-        isUrgent: {
-          label: '鏄惁绱ф��',
-          display: true,
-          type: 'select', 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',
-        },
         mainDriverId: {
           label: '涓婚┚椹跺憳',
-          display: true,dataType: 'string',
+          display: true, dataType: 'string',
           rules: [
             {
               required: true,
@@ -710,7 +932,7 @@
               licenseType: {
                 label: '鍑嗛┚杞﹀瀷', minWidth: 120,
                 type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/license_type',
-                search: true,multiple:true,
+                search: true, multiple: true,
               },
             },
 
@@ -729,7 +951,11 @@
                 return callback(res.data || {})
               })
             } else {
-              listTmsDriver({pageSize: page.pageSize, pageNum: page.currentPage, ...data}).then(res => {
+              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 || [],
@@ -743,7 +969,7 @@
         },
         assistantDriverId: {
           label: '鍓┚椹跺憳',
-          display: true,dataType: 'string',
+          display: true, dataType: 'string',
           change: (val: any) => {
             const table = crudRef.value?.getPropRef?.('assistantDriverId')?.$refs?.temp;
             if (!table) return;
@@ -770,7 +996,7 @@
                 search: true,
               },
               licenseType: {
-                label: '鍑嗛┚杞﹀瀷', minWidth: 120,multiple:true,
+                label: '鍑嗛┚杞﹀瀷', minWidth: 120, multiple: true,
                 type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/license_type',
                 search: true,
               },
@@ -791,7 +1017,11 @@
                 return callback(res.data || {})
               })
             } else {
-              listTmsDriver({pageSize: page.pageSize, pageNum: page.currentPage, ...data}).then(res => {
+              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 || [],
@@ -802,22 +1032,8 @@
           }
 
         },
-        requiredVehicleTypes: {
-          label: '瑕佹眰杞﹀瀷',
-          display: true, type: 'select', dicUrl: '/system/dict/data/type/vehicle_type', dataType: 'string',
-          rules: [
-            {
-              required: true,
-              message: "瑕佹眰杞﹀瀷涓嶈兘涓虹┖", trigger: "blur"
-            }
-          ],
-        },
-        actualVehicleType: {
-          label: '瀹為檯杩愯緭宸ュ叿绫诲瀷',
-          display: true, type: 'select', dicUrl: '/system/dict/data/type/vehicle_type', dataType: 'string',
-        },
         vehicleId: {
-          label: '杞︾墝鍙�',dataType: 'string',
+          label: '杞︾墝鍙�', dataType: 'string',
           display: true,
           rules: [
             {
@@ -834,6 +1050,7 @@
               Object.assign(form.value, {
                 vehicleId: active.id,
                 licensePlate: active.licensePlate,
+                actualVehicleType: active.vehicleType,
               });
             }
           },
@@ -849,6 +1066,8 @@
               },
               vehicleType: {
                 label: '杞﹁締绫诲瀷', minWidth: 120,
+                type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/vehicle_type',
+
                 search: true,
               },
               internalCode: {
@@ -884,7 +1103,11 @@
                 return callback(res.data || {})
               })
             } else {
-              listTmsVehicle({pageSize: page.pageSize, pageNum: page.currentPage, ...data}).then(res => {
+              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 || [],
@@ -894,6 +1117,61 @@
 
           }
 
+        },
+        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: '鍏宠仈闆嗚绠变俊鎭�',
@@ -910,7 +1188,7 @@
               });
             }
           },
-          type: 'table', suffixIcon: 'search',
+          type: 'table', suffixIcon: 'search',dataType: 'string',
           children: {
             border: true,
             searchLabelWidth: 100,
@@ -923,6 +1201,11 @@
               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: {
@@ -960,6 +1243,10 @@
           }
 
         },
+        shelfCode: {
+          label: '鎵樻澘鍙�',
+          display: false,
+        },
         shelfId: {
           label: '鎵樻澘鍙�',
           display: true,
@@ -975,7 +1262,7 @@
               });
             }
           },
-          type: 'table', suffixIcon: 'search',
+          type: 'table', suffixIcon: 'search',dataType: 'string',
           children: {
             border: true,
             searchLabelWidth: 100,
@@ -986,7 +1273,13 @@
                 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: {
@@ -1022,338 +1315,83 @@
           }
 
         },
-      }
-    },
-    {
-      label: '鏀跺彂璐т汉淇℃伅',
-      prop: 'shffxrxx',
-      column: {
-        shipperId: {
-          label: '鍙戣揣浜�',dataType:'string',
-          display: true,
-          change: (val: any) => {
-            const table = crudRef.value?.getPropRef?.('shipperId')?.$refs?.temp;
-            if (!table) return;
-            let active = table.active;
-            if (Array.isArray(active)) active = active[0];
-            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
-              });
-              form.value.transportLine = form.value.shipperRegionLabel
-                  + (form.value.receiverRegionLabel ? '>' + form.value.receiverRegionLabel : '');
-            }
-          },
-          rules: [
-            {
-              required: true,
-              message: "鍙戣揣浜轰笉鑳戒负绌�", trigger: "change"
-            }
-          ],
-          type: 'table', suffixIcon: 'search',
-          children: {
-            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,
-              },
-            },
-
-          },
-          props: {
-            label: 'consignorName',
-            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]
-              }
-              getTmsConsignor(id).then(res => {
-                return callback(res.data || {})
-              })
-            } else {
-              listTmsConsignor({pageSize: page.pageSize, pageNum: page.currentPage, ...data}).then(res => {
-                return callback({
-                  total: res.total,
-                  data: res.rows || [],
-                })
-              })
-            }
-
-          }
-
-        },
-        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"
-            }
-          ],
-          change: (val: any) => {
-            const table = crudRef.value?.getPropRef?.('receiverId')?.$refs?.temp;
-            if (!table) return;
-            let active = table.active;
-            if (Array.isArray(active)) active = active[0];
-            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,
-              });
-              form.value.transportLine =
-                  (form.value.shipperRegionLabel ? form.value.shipperRegionLabel + '>' : '') + form.value.receiverRegionLabel;
-
-            }
-          },
-          type: 'table', suffixIcon: 'search',
-          children: {
-            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,
-              },
-            },
-
-          },
-          props: {
-            label: 'consignorName',
-            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]
-              }
-              getTmsConsignor(id).then(res => {
-                return callback(res.data || {})
-              })
-            } else {
-              listTmsConsignor({pageSize: page.pageSize, pageNum: page.currentPage, ...data}).then(res => {
-                return callback({
-                  total: res.total,
-                  data: res.rows || [],
-                })
-              })
-            }
-
-          }
-
-        },
-        receiverRegionLabel: {
-          label: '鏀惰揣浜鸿鏀垮尯鍩�',
-          display: true, disabled: true
-        },
-        receiverAddress: {
-          label: '鏀惰揣浜鸿缁嗗湴鍧�',
-          display: true, disabled: true
-        },
-        receiverMobile: {
-          label: '鏀惰揣浜鸿仈绯绘柟寮�',
-          display: true, disabled: true
-        },
-        transportLine: {
-          label: '杩愯緭绾胯矾', span: 24,
-          display: true, disabled: 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,
-        },
-        latestArrival: {
-          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,
         },
-      }
-    }
+      },
+    },
+
+    // {
+    //   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: {
 
@@ -1438,7 +1476,7 @@
       label: '瀹為檯杩愯緭宸ュ叿绫诲瀷', minWidth: 130,
       display: false,
       search: true,
-      type: 'select', dicUrl: '/system/dict/data/type/license_type', dataType: 'string',
+      type: 'select', dicUrl: '/system/dict/data/type/vehicle_type', dataType: 'string',
 
     },
 
@@ -1449,12 +1487,12 @@
     },
 
     shipperName: {
-      label: '鍙戣揣浜哄悕绉�',
+      label: '瑁呰揣鐐瑰悕绉�',
       display: false, minWidth: 120,
       search: true,
     },
     receiverName: {
-      label: '鏀惰揣浜哄悕绉�', minWidth: 120,
+      label: '鍗歌揣鐐瑰悕绉�', minWidth: 120,
       display: false,
       search: true,
     },
@@ -1505,7 +1543,21 @@
       hide: false,
       search: false,
     },
-
+    updateTimeRange: {
+      label: '鏇存柊鏃堕棿', display: false, search: true, searchRange: true, type: 'date',
+      format: 'YYYY-MM-DD', hide: true, searchSpan: 5,
+      valueFormat: 'YYYY-MM-DD',
+    },
+    confirmTimeRange: {
+      label: '纭鏃堕棿', display: false, search: true, searchRange: true, type: 'date',
+      format: 'YYYY-MM-DD', hide: true, searchSpan: 5,
+      valueFormat: 'YYYY-MM-DD',
+    },
+    okTimeRange: {
+      label: '瀹屾垚鏃堕棿', display: false, search: true, searchRange: true, type: 'date',
+      format: 'YYYY-MM-DD', hide: true, searchSpan: 5,
+      valueFormat: 'YYYY-MM-DD',
+    },
 
   }
 })
@@ -1569,15 +1621,10 @@
     voucherUrl: {
       label: '琛岀▼鍑瘉',
       display: true,
-      span: 24,
-      accept:'string',dataType: 'string',
+      span: 24, dataType: 'string',
       type: 'upload',
       action: '/common/upload2',
-      propsHttp:{
-        url: 'url',
-        name: 'name',
-        res: 'data',
-      },
+
     },
     dataSource: {
       label: '鏁版嵁鏉ユ簮',
@@ -1630,14 +1677,10 @@
     voucherUrl: {
       label: '琛岀▼鍑瘉',
       display: true,
-      span: 24,dataType: 'string',
+      span: 24, dataType: 'string',
       type: 'upload',
       action: '/common/upload2',
-      propsHttp:{
-        url: 'url',
-        name: 'name',
-        res: 'data',
-      },
+
     },
 
   }
@@ -1673,14 +1716,10 @@
       label: '琛岀▼鍑瘉',
       display: true,
       span: 24,
-      accept:'string',dataType: 'string',
+      accept: 'string', dataType: 'string',
       type: 'upload',
       action: '/common/upload2',
-      propsHttp:{
-        url: 'url',
-        name: 'name',
-        res: 'data',
-      },
+
     },
     dataSource: {
       label: '鏁版嵁鏉ユ簮',
@@ -1725,14 +1764,10 @@
       label: '璐圭敤鍑瘉',
       display: true,
       span: 24,
-      accept:'string',dataType: 'object',
+      accept: 'string', dataType: 'object',
       type: 'upload',
       action: '/common/upload2',
-      propsHttp:{
-        url: 'url',
-        name: 'name',
-        res: 'data',
-      },
+
     },
 
   }
@@ -1771,21 +1806,21 @@
       display: false,
     },
     shipperName: {
-      label: '鍙戣揣浜哄悕绉�',
+      label: '瑁呰揣鐐瑰悕绉�',
       display: false, minWidth: 120,
     },
     receiverName: {
-      label: '鏀惰揣浜哄悕绉�', minWidth: 120,
+      label: '鍗歌揣鐐瑰悕绉�', minWidth: 120,
       display: false,
     },
     transportLine: {
       label: '杩愯緭绾胯矾',
-      display: false,minWidth: 180, overHidden: true
+      display: false, minWidth: 180, overHidden: true
     },
     actualVehicleType: {
       label: '杞﹀瀷', minWidth: 130,
       display: false,
-      type: 'select', dicUrl: '/system/dict/data/type/license_type', dataType: 'string',
+      type: 'select', dicUrl: '/system/dict/data/type/vehicle_type', dataType: 'string',
 
     },
     licensePlate: {
@@ -1808,7 +1843,7 @@
           message: "鎺ユ寕杞﹁締鍙风爜涓嶈兘涓虹┖", trigger: "change"
         }
       ],
-      type: 'table', suffixIcon: 'search',dataType: 'string',
+      type: 'table', suffixIcon: 'search', dataType: 'string',
       children: {
         border: true,
         searchLabelWidth: 100,
@@ -1874,7 +1909,7 @@
           message: "鎺ユ寕鍙告満涓嶈兘涓虹┖", trigger: "change"
         }
       ],
-      type: 'table', suffixIcon: 'search',dataType: 'string',
+      type: 'table', suffixIcon: 'search', dataType: 'string',
       children: {
         border: true,
         searchMenuSpan: 5,
@@ -1890,7 +1925,7 @@
           licenseType: {
             label: '鍑嗛┚杞﹀瀷', minWidth: 120,
             type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/license_type',
-            search: true,multiple:true,
+            search: true, multiple: true,
           },
         },
 
@@ -1923,6 +1958,165 @@
   }
 })
 
+
+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 goodsTableOption = ref({
   pageKey: 'TmsGoodsDetail',
   rowKey: 'id',
@@ -1930,8 +2124,8 @@
   viewBtn: false,
   column: {
     productId: {
-      label: '璐у搧鍚嶇О',hide:true,
-      display: true,minWidth: 120, type: 'table', suffixIcon: 'search',dataType: 'string',
+      label: '璐у搧鍚嶇О', hide: true,
+      display: true, minWidth: 120, type: 'table', suffixIcon: 'search', dataType: 'string',
       children: {
         border: true,
         searchLabelWidth: 100,
@@ -1978,10 +2172,11 @@
             return callback(res.data || {})
           })
         } else {
-          listTmsProductInfo({pageSize: page.pageSize,
+          listTmsProductInfo({
+            pageSize: page.pageSize,
             pageNum: page.currentPage,
             ...data,
-            customerId:form.value.customerId
+            // customerId:form.value.customerId
           }).then(res => {
             return callback({
               total: res.total,
@@ -2007,87 +2202,88 @@
             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;
+          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,
+      label: '璐у搧鍚嶇О', minWidth: 120,
+      display: false,
       hide: false,
     },
     quantity: {
       label: '鏁伴噺',
-      addDisplay :true,minWidth: 100,
-      editDisplay :true,
-      viewDisplay :true,
+      addDisplay: true, minWidth: 100,
+      editDisplay: true,
+      viewDisplay: true,
       value: 1,
-      change:()=>{
+      change: () => {
         goodsForm.value.sumWeight = goodsForm.value.grossWeight || 0 * goodsForm.value.quantity;
-        goodsForm.value.sumNetWeight = goodsForm.value.netWeight || 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,
+      addDisplay: true, minWidth: 100, append: 'Kg',
+      editDisplay: true,
+      viewDisplay: true,
     },
     sumNetWeight: {
       label: '鍑�閲�(kg)',
-      addDisplay :true,
-      editDisplay :true,minWidth: 100,append: 'Kg',
-      viewDisplay :true,
+      addDisplay: true,
+      editDisplay: true, minWidth: 100, append: 'Kg',
+      viewDisplay: true,
     },
     sumVolume: {
       label: '浣撶Н(m鲁)',
-      addDisplay :true,
-      editDisplay :true,minWidth: 100,append: 'm鲁',
-      viewDisplay :true,
+      addDisplay: true,
+      editDisplay: true, minWidth: 100, append: 'm鲁',
+      viewDisplay: true,
     },
 
 
     loosePieces: {
       label: '鏁d欢鏁�',
-      addDisplay :true,
-      editDisplay :true,minWidth: 100,
-      viewDisplay :true,
+      addDisplay: true,
+      editDisplay: true, minWidth: 100,
+      viewDisplay: true,
     },
 
     fullContainers: {
       label: '鏁寸鏁�',
-      addDisplay :true,
-      editDisplay :true,minWidth: 100,
-      viewDisplay :true,
+      addDisplay: true,
+      editDisplay: true, minWidth: 100,
+      viewDisplay: true,
     },
     containerNo: {
       label: '闆嗚绠卞彿',
-      addDisplay :true,
-      editDisplay :true,minWidth: 100,
-      viewDisplay :true,
+      addDisplay: true,
+      editDisplay: true, minWidth: 100,
+      viewDisplay: true,
     },
     palletCount: {
       label: '鎵樻暟',
-      addDisplay :true,minWidth: 100,
-      editDisplay :true,
-      viewDisplay :true,
+      addDisplay: true, minWidth: 100,
+      editDisplay: true,
+      viewDisplay: true,
     }
-  }})
+  }
+})
 
 const actualFormOption = ref({
-   menuBtn: false, labelWidth: 140,
-  column:{
-    departureAddress:{
+  menuBtn: false, labelWidth: 140,
+  column: {
+    departureAddress: {
       label: '瀹為檯鍑哄彂鍦板湴鍧�',
-      span:24,
+      span: 24,
     },
-    destinationAddress:{
+    destinationAddress: {
       label: '瀹為檯鐩殑鍦板湴鍧�',
-      span:24,
+      span: 24,
     },
     actualLoadStart: {
       label: '瀹為檯瑁呰溅寮�濮嬫椂闂�',
@@ -2118,23 +2314,99 @@
       display: true,
     },
     actualQuantity: {
-      label: '瀹炲彂鏁伴噺',type: 'number',
+      label: '瀹炲彂鏁伴噺', type: 'number',
     },
     actualWeight: {
-      label: '瀹炲彂閲嶉噺',type: 'number',
+      label: '瀹炲彂閲嶉噺', type: 'number',
     },
     actualVolume: {
-      label: '瀹炲彂浣撶Н',type: 'number',
+      label: '瀹炲彂浣撶Н', type: 'number',
     },
     reweighWeight: {
-      label: '澶嶇閲嶉噺',type: 'number',
+      label: '澶嶇閲嶉噺', type: 'number',
     },
-    electronicLock:{
+    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 {
   tableData,
@@ -2170,7 +2442,24 @@
   },
   handleSelectionChangeFunc: (selection: any) => {
     selectionList.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;
+    console.log(pageF.single)
+  },
+  getBeginListFunc: () => {
+    queryParams.value = proxy.addDateRangeNew(queryParams.value, queryParams.value?.createTimeRange, 'createTime') || {};
+    queryParams.value = proxy.addDateRangeNew(queryParams.value, queryParams.value?.updateTimeRange, 'updateTime') || {};
+    queryParams.value = proxy.addDateRangeNew(queryParams.value, queryParams.value?.confirmTimeRange, 'confirmTime') || {};
+    queryParams.value = proxy.addDateRangeNew(queryParams.value, queryParams.value?.okTimeRange, 'okTime') || {};
+  },
+
 })
 const handleConfirm = (row: any) => {
   ElMessageBox.confirm("鏄惁瀵硅皟搴﹀崟鍙�" + row.dispatchNo + "纭畾 锛�", '绯荤粺鎻愮ず', {
@@ -2249,7 +2538,7 @@
 }
 
 const submitForm = () => {
-  if (optionType.value === 'addItinerary'){
+  if (optionType.value === 'addItinerary') {
     if (Array.isArray(boxForm.value.voucherUrl)) {
       boxForm.value.voucherUrl = boxForm.value.voucherUrl.toString();
     }
@@ -2261,11 +2550,19 @@
       cancelBox();
       onLoad(page.value);
     })
-  }else if (optionType.value === 'addFinance'){
+  } else if (optionType.value === 'addFinance') {
     if (Array.isArray(boxForm.value.feeVoucherUrl)) {
       boxForm.value.feeVoucherUrl = boxForm.value.feeVoucherUrl.toString();
     }
-    addTmsFinanceDetail(boxForm.value).then(res=>{
+    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'
@@ -2293,28 +2590,45 @@
   })
 }
 
-const handleAddFinance = (row:any)=>{
+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 => {
+    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,
+      financeType: 2,
     }
   })
 }
 
 const handleGenerate = () => {
-  let ids = selectionList.value.map((item:any) => item.id);
+  let ids = selectionList.value.map((item: any) => item.id);
   initGenerate(ids).then(res => {
-    boxTableData.value = res.data|| [];
+    boxTableData.value = res.data || [];
     optionType.value = 'generate';
     pageF.open = true;
     pageF.title = '鐢熸垚搴旀敹搴斾粯璐圭敤鏁版嵁';
@@ -2324,7 +2638,7 @@
 
 const submitGenerate = () => {
   pageF.isUploading = true;
-  let ids = selectionList.value.map((item:any) => item.id);
+  let ids = selectionList.value.map((item: any) => item.id);
 
   generateTmsDispatchOrder(ids).then(res => {
     pageF.isUploading = false;
@@ -2334,7 +2648,7 @@
     })
     cancelBox();
     onLoad(page.value);
-  }).finally(()=>{
+  }).finally(() => {
     pageF.isUploading = false;
   })
 }
@@ -2342,7 +2656,7 @@
  * 鐢╂寕
  */
 const handleDropHook = () => {
-    title.value = '璋冨害鍗曠敥鎸�';
+  title.value = '璋冨害鍗曠敥鎸�';
   open.value = true;
   form.value = selectionList.value[0];
   optionType.value = 'dropHook';
@@ -2368,14 +2682,36 @@
       })
       cancelBox2();
       onLoad(page.value);
-    }).finally(()=>{
+    }).finally(() => {
       pageF.isUploading = false;
     })
-  }else{
+  }else if (optionType.value === 'customs') {
+    customsOrder({id:form.value.id}).then(res => {
+      ElMessage({
+        message: "鎻愪氦鎴愬姛锛�",
+        type: 'success'
+      })
+      cancelBox2();
+      onLoad(page.value);
+    }).finally(() => {
+      pageF.isUploading = false;
+    })
+  }else if (optionType.value === 'loading') {
+    loadingOrder({id:form.value.id}).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
+      dispatchId: form.value.id,
+      vehicleId: form.value.vehicleId,
+      driverId: form.value.driverId
     }).then(res => {
       ElMessage({
         message: "鎻愪氦鎴愬姛锛�",
@@ -2383,7 +2719,7 @@
       })
       cancelBox2();
       onLoad(page.value);
-    }).finally(()=>{
+    }).finally(() => {
       pageF.isUploading = false
     })
   }
@@ -2395,13 +2731,13 @@
 }
 
 const handleAddGoods = (row: any) => {
-  listTmsGoodsDetail({dispatchId: row.id,pageSize:999,pageNum:1}).then(res=>{
-    goodsTableData.value =  res.rows || [];
+  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) => {
+const rowGoodsUpdate = (row: any, index: any, done: any, loading: any) => {
   updateTmsGoodsDetail(row).then(res => {
     ElMessage({
       message: "淇敼鎴愬姛锛�",
@@ -2410,14 +2746,14 @@
     handleAddGoods(form.value);
     onLoad(page.value);
     done();
-  }).catch(()=>{
+  }).catch(() => {
     loading()
   })
 }
-const rowGoodsSave = (row:any, done:any, loading:any) => {
+const rowGoodsSave = (row: any, done: any, loading: any) => {
   row.dispatchId = form.value.id;
   row.dispatchNo = form.value.dispatchNo;
-  addTmsGoodsDetail(row).then(res=>{
+  addTmsGoodsDetail(row).then(res => {
     ElMessage({
       message: "鏂板鎴愬姛锛�",
       type: 'success'
@@ -2425,12 +2761,16 @@
     handleAddGoods(form.value);
     onLoad(page.value);
     done();
-  }).catch(()=>{
+  }).catch(() => {
     loading()
   })
 }
-const rowGoodsDel = (row:any) => {
-  ElMessageBox.confirm("纭畾灏嗛�夋嫨鏁版嵁鍒犻櫎锛�", '绯荤粺鎻愮ず', {confirmButtonText: '纭畾', cancelButtonText: '鍙栨秷', type: 'warning'}).then(() => {
+const rowGoodsDel = (row: any) => {
+  ElMessageBox.confirm("纭畾灏嗛�夋嫨鏁版嵁鍒犻櫎锛�", '绯荤粺鎻愮ず', {
+    confirmButtonText: '纭畾',
+    cancelButtonText: '鍙栨秷',
+    type: 'warning'
+  }).then(() => {
     return delTmsGoodsDetail(row.id);
   }).then(() => {
     handleAddGoods(form.value);
@@ -2441,14 +2781,14 @@
   });
 }
 
-const handleActual = (row:any) => {
-    actualForm.value = row;
-    open3.value = true;
+const handleActual = (row: any) => {
+  actualForm.value = row;
+  open3.value = true;
 
 }
 
-const submitForm3 = ()=>{
-  updateTmsDispatchOrder(actualForm.value).then(res=>{
+const submitForm3 = () => {
+  updateTmsDispatchOrder(actualForm.value).then(res => {
     ElMessage({
       message: "鎿嶄綔鎴愬姛锛�",
       type: 'success'
@@ -2457,6 +2797,547 @@
     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;
+    }
+    listTmsConsignor({pageSize: page.pageSize, pageNum: page.currentPage, ...data}).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;
+    }
+    listTmsConsignor({pageSize: page.pageSize, pageNum: page.currentPage, ...data}).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;
+                    console.log(form2.value, "form2")
+                  }
+                });
+            }
+          },
+        },
+        // 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 = selectionList.value[0];
+  optionType.value = 'customs';
+  boxFormOption.value = customsOption.value;
+}
+const handleLoading = () => {
+  title.value = '琛ュ厖濮旀墭瑁呭嵏淇℃伅';
+  open.value = true;
+  form.value = selectionList.value[0];
+  optionType.value = 'loading';
+  boxFormOption.value = loadingOption.value;
+}
 </script>
\ No newline at end of file

--
Gitblit v1.8.0