From 3849263b31a16a91ff08acaa42786ecfde76f33c Mon Sep 17 00:00:00 2001
From: zhangback <zhangback@163.com>
Date: 星期四, 27 十一月 2025 20:18:08 +0800
Subject: [PATCH] 提交

---
 ui/admin-ui3/src/views/tms/tmsDispatchOrder/index.vue | 1263 ++++++++++++++++++++++++++++++++-------------------------
 1 files changed, 710 insertions(+), 553 deletions(-)

diff --git a/ui/admin-ui3/src/views/tms/tmsDispatchOrder/index.vue b/ui/admin-ui3/src/views/tms/tmsDispatchOrder/index.vue
index 05e1e27..1d8e947 100644
--- a/ui/admin-ui3/src/views/tms/tmsDispatchOrder/index.vue
+++ b/ui/admin-ui3/src/views/tms/tmsDispatchOrder/index.vue
@@ -103,6 +103,17 @@
       </template>
     </avue-crud>
     <el-dialog :title="pageF.title" v-model="pageF.open" class="avue-dialog avue-dialog--top" width="80%">
+      <h2 v-if="optionType == 'addFinance'">鎶ヤ环璐圭敤</h2>
+      <avue-crud v-if="optionType == 'addFinance'"
+          :option="itemsTableOption"
+          :data="itemsTableData"
+                 @selection-change="selectionChange2"
+      >
+        <template #count="{row}">
+          <el-input-number v-model="row.count" @change="countChange(row)" placeholder="璇疯緭鍏ヨ璐规暟閲�" min="0"></el-input-number>
+        </template>
+      </avue-crud>
+      <h2 v-if="optionType == 'addFinance'">瀹炴姤瀹為攢璐圭敤</h2>
       <avue-form v-if="optionType == 'addItinerary' || optionType == 'addFinance'" v-model="boxForm" ref="boxFormRef" :option="boxFormOption">
 
       </avue-form>
@@ -236,6 +247,8 @@
 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";
 
 const {proxy} = useCurrentInstance();
 const crudRef = ref();
@@ -275,6 +288,7 @@
   open: false,
   open2:false,
   goodsTableData: <any>[],
+  selectionList2: <any>[],
   goodsForm:<any>{},
   open3: false,
   actualForm:<any>{},
@@ -282,7 +296,7 @@
 const {queryParams, form, page, selectionList,open3,
   boxTableData, optionType,
   boxFormOption,boxForm,boxTableOption,title,open,open2,
-  goodsTableData,goodsForm,actualForm
+  goodsTableData,goodsForm,actualForm,selectionList2
 } = toRefs(data);
 const option = ref({
   pageKey: 'TmsDispatchOrder',
@@ -296,77 +310,75 @@
       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',
           change: (val: any) => {
-            const table = crudRef.value?.getPropRef?.('projectId')?.$refs?.temp;
+            const table = crudRef.value?.getPropRef?.('quoteDetailId')?.$refs?.temp;
             if (!table) return;
             let active = table.active;
             if (Array.isArray(active)) active = active[0];
             if (active) {
               Object.assign(form.value, {
-                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 +386,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 +399,13 @@
             }
 
           }
-
         },
         customerName: {
           label: '瀹㈡埛鍚嶇О',
+          display: true, disabled: true
+        },
+        projectName: {
+          label: '鍏宠仈椤圭洰',
           display: true, disabled: true
         },
         // customerCode: {
@@ -398,10 +413,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,18 +437,258 @@
               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"
             }
           ],
+        },
+        isUrgent: {
+          label: '鏄惁绱ф��',
+          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.vehicleProviderId.rules.forEach((cItem:any)=>{
+                  cItem.required = value != 1;
+                }) ;
+              }
+            })
+          },
         },
         vehicleProviderId: {
           label: '杞﹁締鏈嶅姟鍟�',
@@ -512,167 +776,6 @@
           }
 
         },
-        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',
@@ -729,7 +832,7 @@
                 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}).then(res => {
                 return callback({
                   total: res.total,
                   data: res.rows || [],
@@ -791,7 +894,7 @@
                 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}).then(res => {
                 return callback({
                   total: res.total,
                   data: res.rows || [],
@@ -801,20 +904,6 @@
 
           }
 
-        },
-        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',
@@ -884,7 +973,7 @@
                 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}).then(res => {
                 return callback({
                   total: res.total,
                   data: res.rows || [],
@@ -894,6 +983,269 @@
 
           }
 
+        },
+        actualVehicleType: {
+          label: '娲惧嚭杞﹀瀷',
+          display: true, type: 'select', dicUrl: '/system/dict/data/type/vehicle_type', dataType: 'string',
+        },
+        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
+              });
+             }
+          },
+          rules: [
+            {
+              required: false,
+              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 {
+              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;
+              }
+              console.log(form.value.startRegionCode)
+              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,
+              });
+            }
+          },
+          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 {
+              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 || [],
+                })
+              })
+            }
+
+          }
+
+        },
+        receiverRegionLabel: {
+          label: '鍗歌揣鐐硅鏀垮尯鍩�',
+          display: true, disabled: true
+        },
+        receiverAddress: {
+          label: '鍗歌揣鐐硅缁嗗湴鍧�',
+          display: true, disabled: true
+        },
+        receiverMobile: {
+          label: '鍗歌揣鐐硅仈绯绘柟寮�',
+          display: true, disabled: true
         },
         containerId: {
           label: '鍏宠仈闆嗚绠变俊鎭�',
@@ -1022,338 +1374,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: {
 
@@ -2119,6 +2216,35 @@
 })
 
 
+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 itemsCrudRef =ref()
+const itemsTableData = ref<any>([])
+
 const {
   tableData,
   pageF,
@@ -2248,6 +2374,14 @@
     if (Array.isArray(boxForm.value.feeVoucherUrl)) {
       boxForm.value.feeVoucherUrl = boxForm.value.feeVoucherUrl.toString();
     }
+    let filter = selectionList2.value.filter((item:any)=>{
+      return !item.count
+    });
+    if (filter.length > 0){
+      proxy.$modal.msgError("鍕鹃�夋姤浠疯垂鐢ㄨ濉啓璁¤垂鏁伴噺");
+      return;
+    }
+    boxForm.value.items = selectionList2.value;
     addTmsFinanceDetail(boxForm.value).then(res=>{
       ElMessage({
         message: "鎿嶄綔鎴愬姛锛�",
@@ -2276,13 +2410,29 @@
   })
 }
 
-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 => {
+
+
     boxTableData.value = res.rows || [];
     pageF.open = true;
     pageF.title = '璐圭敤鐧昏';
@@ -2440,6 +2590,13 @@
     onLoad(page.value)
   })
 }
+const countChange = (row:any) => {
+  row.sum = Number(row.price) * Number(row.count);
+}
+
+const selectionChange2 = (selection?: any[]) => {
+  selectionList2.value = selection;
+}
 
 
 </script>
\ No newline at end of file

--
Gitblit v1.8.0