From c2e20ac680e03cb26cf7c00f573f0cb917afaece Mon Sep 17 00:00:00 2001
From: zhangback <zhangback@163.com>
Date: 星期五, 14 十一月 2025 13:56:33 +0800
Subject: [PATCH] 提交

---
 ui/admin-ui3/src/views/tms/tmsDispatchOrder/index.vue |  788 +++++++++++++++++++++++++++++++++++++++++++++----------
 1 files changed, 641 insertions(+), 147 deletions(-)

diff --git a/ui/admin-ui3/src/views/tms/tmsDispatchOrder/index.vue b/ui/admin-ui3/src/views/tms/tmsDispatchOrder/index.vue
index cad24bc..9b6509c 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
@@ -44,9 +44,67 @@
             v-hasPermi="['tms:tmsDispatchOrder:export']"
         >瀵煎嚭
         </el-button>
-      </template>
+        <el-button
+            type="success"
+            icon="Delete"
+            :disabled="pageF.multiple"
+            @click="handleGenerate"
+            v-hasPermi="['tms:tmsDispatchOrder:generate']"
+        >鐢熸垚搴旀敹搴斾粯璐圭敤
+        </el-button>
 
+      </template>
+      <template #menu-before="{row}">
+        <el-link size="small" type="primary" v-if="row.status == 0" @click="handleConfirm(row)" class="link-btn"
+                 :underline="false" icon="el-icon-pointer">纭畾
+        </el-link>
+        <el-link size="small" type="primary" @click="handleCopy(row)" class="link-btn" :underline="false"
+                 icon="el-icon-connection">澶嶅埗
+        </el-link>
+        <el-link size="small" type="primary" v-if="[1,2].includes(row.status)" @click="handleUploadItinerary(row)"
+                 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)"
+                 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"
+                 :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"
+                 :underline="false" icon="el-icon-edit-pen">璐圭敤鐧昏
+        </el-link>
+      </template>
+      <template #menu="{row}">
+        <el-link size="small" type="primary" @click="handleLog(row)" class="link-btn" :underline="false"
+                 icon="el-icon-tickets">鏃ュ織
+        </el-link>
+      </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">
+
+      </avue-form>
+      <avue-crud
+          :option="boxTableOption"
+          :data="boxTableData"
+      >
+      </avue-crud>
+      <template #footer>
+        <div class="dialog-footer">
+          <el-button type="primary" v-if="optionType == 'addItinerary' || optionType == 'addFinance'" :loading="pageF.isUploading" @click="submitForm">
+            {{ pageF.isUploading ? '鎻愪氦涓�' : '纭� 瀹�' }}
+          </el-button>
+
+          <el-button type="primary" v-if="optionType == 'generate' " :loading="pageF.isUploading" @click="submitGenerate">
+            {{ pageF.isUploading ? '鐢熸垚涓�' : '鐢熸垚璐圭敤' }}
+          </el-button>
+          <el-button @click="cancelBox">鍙� 娑�</el-button>
+        </div>
+      </template>
+    </el-dialog>
+
+
+
   </basicContainer>
 </template>
 
@@ -58,7 +116,8 @@
   exportTmsDispatchOrder,
   getTmsDispatchOrder,
   listTmsDispatchOrder,
-  updateTmsDispatchOrder
+  updateTmsDispatchOrder,
+  confirmOrder, copyOrder, okOrder
 } from "@/api/tms/tmsDispatchOrder";
 import useCurrentInstance from "@/utils/useCurrentInstance";
 import {computed, onMounted, reactive, ref, toRefs, watch} from "vue";
@@ -74,19 +133,28 @@
 import {getTmsContainer, listTmsContainer} from "@/api/tms/tmsContainer";
 import {getTmsShelf, listTmsShelf} from "@/api/tms/tmsShelf";
 import {getTmsConsignor, listTmsConsignor} from "@/api/tms/tmsConsignor";
+import {ElMessage, ElMessageBox} from "element-plus";
+import {addTmsTrip, listTmsTrip} from "@/api/tms/tmsTrip";
+import {addTmsFinanceDetail, listTmsFinanceDetail} from "@/api/tms/tmsFinanceDetail";
 
 const {proxy} = useCurrentInstance();
 const crudRef = ref();
+const boxFormRef = ref();
 
-const permissionList = computed(() => {
-  return {
-    addBtn: hasPermission(["tms:tmsDispatchOrder:add"]),
-    delBtn: hasPermission(["tms:tmsDispatchOrder:remove"]),
-    editBtn: hasPermission(["tms:tmsDispatchOrder:edit"]),
-    viewBtn: hasPermission(["tms:tmsDispatchOrder:query"]),
+
+const permissionList = (key: any, row: any, index: any) => {
+  if (key == 'addBtn') {
+    return hasPermission(["tms:tmsDispatchOrder:add"])
+  } else if (key == 'delBtn') {
+    return hasPermission(["tms:tmsDispatchOrder:remove"]) && row?.status == 0
+  } else if (key == 'editBtn') {
+    return hasPermission(["tms:tmsDispatchOrder:edit"]) && [0,1].includes(row?.status)
+  } else if (key == 'viewBtn') {
+    return hasPermission(["tms:tmsDispatchOrder:query"])
+  } else {
+    return true;
   }
-})
-console.log()
+};
 const data = reactive({
   form: <TmsDispatchOrderI>{},
   queryParams: <TmsDispatchOrderI & PageQueryInterface>{},
@@ -96,19 +164,27 @@
     currentPage: 1,
   },
   selectionList: [],
+  optionType: '',
+  boxTableData: <any>[],
+  boxForm: <any>{},
+  boxFormOption: <any>{},
+  boxTableOption: <any>{}
 })
-const {queryParams, form, page, selectionList} = toRefs(data);
+const {queryParams, form, page, selectionList,
+  boxTableData, optionType,
+  boxFormOption,boxForm,boxTableOption
+} = toRefs(data);
 const option = ref({
   pageKey: 'TmsDispatchOrder',
   rowKey: 'id',
-  labelWidth:130,
-  searchSpan:6,
-  searchLabelWidth:150,
-  group:[
+  labelWidth: 130,
+  searchSpan: 6,
+  searchLabelWidth: 150,
+  group: [
     {
       label: '鍩烘湰淇℃伅',
       prop: 'jbxx',
-      column:{
+      column: {
         projectId: {
           label: '鍏宠仈椤圭洰',
           display: true,
@@ -124,44 +200,44 @@
             let active = table.active;
             if (Array.isArray(active)) active = active[0];
             if (active) {
-                  Object.assign(form.value, {
-                    projectId: active.id,
-                    projectName: active.projectName,
-                    customerId: active.relatedCustomerId,
-                    customerName: active.relatedCustomerName,
-                    contractId: active.relatedContractId,
-                    contractName: active.relatedContractName,
-                  });
+              Object.assign(form.value, {
+                projectId: active.id,
+                projectName: active.projectName,
+                customerId: active.relatedCustomerId,
+                customerName: active.relatedCustomerName,
+                contractId: active.relatedContractId,
+                contractName: active.relatedContractName,
+              });
             }
           },
-          type: 'table',suffixIcon:'search',
-          children:{
+          type: 'table', suffixIcon: 'search',
+          children: {
             border: true,
             searchMenuSpan: 5,
-            column:{
+            column: {
               projectName: {
                 label: '椤圭洰鍚嶇О', minWidth: 130,
                 search: true,
               },
               projectCode: {
-                label: '椤圭洰缂栧彿',minWidth: 120,
+                label: '椤圭洰缂栧彿', minWidth: 120,
                 search: true,
               },
               relatedContractName: {
                 label: '鍏宠仈鍚堝悓',
-                display: false,minWidth: 150,
+                display: false, minWidth: 150,
                 search: true,
               },
 
               relatedCustomerName: {
                 label: '鍏宠仈瀹㈡埛',
-                display: false,minWidth: 150,
+                display: false, minWidth: 150,
                 search: true,
               },
               status: {
-                label: '鐘舵��',dataType: 'string',
+                label: '鐘舵��', dataType: 'string',
                 type: 'radio', dicUrl: '/system/dict/data/type/data_status',
-                addDisplay: false,minWidth: 150,
+                addDisplay: false, minWidth: 150,
                 editDisplay: false,
                 viewDisplay: true,
                 hide: false,
@@ -176,24 +252,24 @@
             },
 
           },
-          props:{
+          props: {
             label: 'projectName',
             value: 'id'
           },
-          onLoad: ({ page, value, data }: { page: any, value: any, data: any }, callback:any) => {
-            if (value){
+          onLoad: ({page, value, data}: { page: any, value: any, data: any }, callback: any) => {
+            if (value) {
               let id = value;
-              if (Array.isArray(value)){
+              if (Array.isArray(value)) {
                 id = value[0]
               }
-              getTmsProject(id).then(res=>{
-                return callback(res.data||{})
+              getTmsProject(id).then(res => {
+                return callback(res.data || {})
               })
-            }else{
-              listTmsProject({pageSize:page.pageSize,pageNum:page.currentPage,...data}).then(res=>{
+            } else {
+              listTmsProject({pageSize: page.pageSize, pageNum: page.currentPage, ...data}).then(res => {
                 return callback({
                   total: res.total,
-                  data: res.rows||[],
+                  data: res.rows || [],
                 })
               })
             }
@@ -203,7 +279,7 @@
         },
         customerName: {
           label: '瀹㈡埛鍚嶇О',
-          display: true,disabled:true
+          display: true, disabled: true
         },
         // customerCode: {
         //   label: '瀹㈡埛缂栫爜',
@@ -211,7 +287,7 @@
         // },
         contractName: {
           label: '鍏宠仈鍚堝悓鍚嶇О',
-          display: true,disabled:true
+          display: true, disabled: true
         },
 
         orderType: {
@@ -506,45 +582,45 @@
               });
             }
           },
-          type: 'table',suffixIcon:'search',
-          children:{
+          type: 'table', suffixIcon: 'search',
+          children: {
             border: true,
             searchMenuSpan: 5,
-            column:{
+            column: {
               vehicleProviderName: {
                 label: '杞﹁締鏈嶅姟鍟�', minWidth: 130,
                 search: true,
               },
               driverName: {
-                label: '椹鹃┒鍛樺鍚�',minWidth: 120,
+                label: '椹鹃┒鍛樺鍚�', minWidth: 120,
                 search: true,
               },
               licenseType: {
-                label: '鍑嗛┚杞﹀瀷',minWidth: 120,
+                label: '鍑嗛┚杞﹀瀷', minWidth: 120,
                 type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/license_type',
                 search: true,
               },
             },
 
           },
-          props:{
+          props: {
             label: 'driverName',
             value: 'id'
           },
-          onLoad: ({ page, value, data }: { page: any, value: any, data: any }, callback:any) => {
-            if (value){
+          onLoad: ({page, value, data}: { page: any, value: any, data: any }, callback: any) => {
+            if (value) {
               let id = value;
-              if (Array.isArray(value)){
+              if (Array.isArray(value)) {
                 id = value[0]
               }
-              getTmsDriver(id).then(res=>{
-                return callback(res.data||{})
+              getTmsDriver(id).then(res => {
+                return callback(res.data || {})
               })
-            }else{
-              listTmsDriver({pageSize:page.pageSize,pageNum:page.currentPage,...data}).then(res=>{
+            } else {
+              listTmsDriver({pageSize: page.pageSize, pageNum: page.currentPage, ...data}).then(res => {
                 return callback({
                   total: res.total,
-                  data: res.rows||[],
+                  data: res.rows || [],
                 })
               })
             }
@@ -569,44 +645,44 @@
             }
           },
           type: 'table', suffixIcon: 'search',
-          children:{
+          children: {
             border: true,
             searchMenuSpan: 5,
-            column:{
+            column: {
               vehicleProviderName: {
                 label: '杞﹁締鏈嶅姟鍟�', minWidth: 130,
                 search: true,
               },
               driverName: {
-                label: '椹鹃┒鍛樺鍚�',minWidth: 120,
+                label: '椹鹃┒鍛樺鍚�', minWidth: 120,
                 search: true,
               },
               licenseType: {
-                label: '鍑嗛┚杞﹀瀷',minWidth: 120,
+                label: '鍑嗛┚杞﹀瀷', minWidth: 120,
                 type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/license_type',
                 search: true,
               },
             },
 
           },
-          props:{
+          props: {
             label: 'driverName',
             value: 'id'
           },
-          onLoad: ({ page, value, data }: { page: any, value: any, data: any }, callback:any) => {
-            if (value){
+          onLoad: ({page, value, data}: { page: any, value: any, data: any }, callback: any) => {
+            if (value) {
               let id = value;
-              if (Array.isArray(value)){
+              if (Array.isArray(value)) {
                 id = value[0]
               }
-              getTmsDriver(id).then(res=>{
-                return callback(res.data||{})
+              getTmsDriver(id).then(res => {
+                return callback(res.data || {})
               })
-            }else{
-              listTmsDriver({pageSize:page.pageSize,pageNum:page.currentPage,...data}).then(res=>{
+            } else {
+              listTmsDriver({pageSize: page.pageSize, pageNum: page.currentPage, ...data}).then(res => {
                 return callback({
                   total: res.total,
-                  data: res.rows||[],
+                  data: res.rows || [],
                 })
               })
             }
@@ -615,7 +691,7 @@
 
         },
         requiredVehicleTypes: {
-          label: '瑕佹眰杞﹀瀷',multiple:true,
+          label: '瑕佹眰杞﹀瀷', multiple: true,
           display: true, type: 'select', dicUrl: '/system/dict/data/type/license_type', dataType: 'string',
           rules: [
             {
@@ -741,7 +817,7 @@
                 label: '绠卞瀷',
                 type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/container_type',
                 display: false,
-                hide: false,minWidth:150,
+                hide: false, minWidth: 150,
                 search: true,
               },
             },
@@ -839,7 +915,7 @@
     {
       label: '鏀跺彂璐т汉淇℃伅',
       prop: 'shffxrxx',
-      column:{
+      column: {
         shipperId: {
           label: '鍙戣揣浜�',
           display: true,
@@ -850,14 +926,14 @@
             if (Array.isArray(active)) active = active[0];
             if (active) {
               Object.assign(form.value, {
-                      shipperId: active.id,
-                      shipperName: active.consignorName,
-                      shipperRegionCode: active.regionLabel,
-                      shipperAddress: active.addressDetail,
-                      shipperMobile: active.contactPhone,
+                shipperId: active.id,
+                shipperName: active.consignorName,
+                shipperRegionCode: active.regionLabel,
+                shipperAddress: active.addressDetail,
+                shipperMobile: active.contactPhone,
               });
               form.value.transportLine = form.value.shipperRegionCode
-                    +(form.value.receiverRegionCode? '>' + form.value.receiverRegionCode : '') ;
+                  + (form.value.receiverRegionCode ? '>' + form.value.receiverRegionCode : '');
             }
           },
           rules: [
@@ -881,26 +957,26 @@
                 search: true,
               },
               consignorType: {
-                label: '鏀跺彂璐т汉绫诲瀷',minWidth: 80,
+                label: '鏀跺彂璐т汉绫诲瀷', minWidth: 80,
                 type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/consignor_type',
                 display: false,
                 hide: false,
                 search: true,
               },
               contactName: {
-                label: '鑱旂郴浜哄鍚�',minWidth: 110,
+                label: '鑱旂郴浜哄鍚�', minWidth: 110,
                 display: false,
                 hide: false,
                 search: true,
               },
               contactPhone: {
-                label: '鑱旂郴浜虹數璇�',minWidth: 110,
+                label: '鑱旂郴浜虹數璇�', minWidth: 110,
                 display: false,
                 hide: false,
                 search: true,
               },
               regionLabel: {
-                label: '琛屾斂鍖哄煙',minWidth: 180,
+                label: '琛屾斂鍖哄煙', minWidth: 180,
                 display: false,
                 hide: false,
                 search: true,
@@ -935,16 +1011,16 @@
         },
         shipperRegionCode: {
           label: '鍙戣揣浜鸿鏀垮尯鍩�',
-          display: true,disabled:true
+          display: true, disabled: true
 
         },
         shipperAddress: {
           label: '鍙戣揣浜鸿缁嗗湴鍧�',
-          display: true,disabled:true
+          display: true, disabled: true
         },
         shipperMobile: {
           label: '鍙戣揣浜鸿仈绯绘柟寮�',
-          display: true,disabled:true
+          display: true, disabled: true
         },
         receiverId: {
           label: '鏀惰揣浜�',
@@ -962,14 +1038,14 @@
             if (Array.isArray(active)) active = active[0];
             if (active) {
               Object.assign(form.value, {
-                      receiverId: active.id,
-                      receiverName: active.consignorName,
-                      receiverRegionCode: active.regionLabel,
-                      receiverAddress: active.addressDetail,
-                      receiverMobile: active.contactPhone,
+                receiverId: active.id,
+                receiverName: active.consignorName,
+                receiverRegionCode: active.regionLabel,
+                receiverAddress: active.addressDetail,
+                receiverMobile: active.contactPhone,
               });
-                  form.value.transportLine =
-                      (form.value.shipperRegionCode? form.value.shipperRegionCode + '>': '') +form.value.receiverRegionCode;
+              form.value.transportLine =
+                  (form.value.shipperRegionCode ? form.value.shipperRegionCode + '>' : '') + form.value.receiverRegionCode;
 
             }
           },
@@ -988,26 +1064,26 @@
                 search: true,
               },
               consignorType: {
-                label: '鏀跺彂璐т汉绫诲瀷',minWidth: 80,
+                label: '鏀跺彂璐т汉绫诲瀷', minWidth: 80,
                 type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/consignor_type',
                 display: false,
                 hide: false,
                 search: true,
               },
               contactName: {
-                label: '鑱旂郴浜哄鍚�',minWidth: 110,
+                label: '鑱旂郴浜哄鍚�', minWidth: 110,
                 display: false,
                 hide: false,
                 search: true,
               },
               contactPhone: {
-                label: '鑱旂郴浜虹數璇�',minWidth: 110,
+                label: '鑱旂郴浜虹數璇�', minWidth: 110,
                 display: false,
                 hide: false,
                 search: true,
               },
               regionLabel: {
-                label: '琛屾斂鍖哄煙',minWidth: 180,
+                label: '琛屾斂鍖哄煙', minWidth: 180,
                 display: false,
                 hide: false,
                 search: true,
@@ -1042,26 +1118,26 @@
         },
         receiverRegionCode: {
           label: '鏀惰揣浜鸿鏀垮尯鍩�',
-          display: true,disabled:true
+          display: true, disabled: true
         },
         receiverAddress: {
           label: '鏀惰揣浜鸿缁嗗湴鍧�',
-          display: true,disabled:true
+          display: true, disabled: true
         },
         receiverMobile: {
           label: '鏀惰揣浜鸿仈绯绘柟寮�',
-          display: true,disabled:true
+          display: true, disabled: true
         },
         transportLine: {
-          label: '杩愯緭绾胯矾',span:24,
-          display: true,disabled:true
+          label: '杩愯緭绾胯矾', span: 24,
+          display: true, disabled: true
         },
       }
     },
     {
       label: '杩愯緭瑕佹眰淇℃伅',
       prop: 'ysyqxx',
-      column:{
+      column: {
         earliestDeparture: {
           label: '瑕佹眰鏈�鏃╁嚭鍙戞椂闂�',
           type: 'date', valueFormat: 'YYYY-MM-DD',
@@ -1087,21 +1163,21 @@
     {
       label: '杞﹁締淇℃伅',
       prop: 'clxx',
-      column:{
+      column: {
         emptyMileage: {
-          label: '绌鸿浇閲岀▼',append:'Km',
+          label: '绌鸿浇閲岀▼', append: 'Km',
           display: true,
         },
         emptyFuel: {
-          label: '绌鸿浇娌硅��',append:'L',
+          label: '绌鸿浇娌硅��', append: 'L',
           display: true,
         },
         loadedMileage: {
-          label: '閲嶈浇閲岀▼',append:'Km',
+          label: '閲嶈浇閲岀▼', append: 'Km',
           display: true,
         },
         loadedFuel: {
-          label: '閲嶈浇娌硅��',append:'L',
+          label: '閲嶈浇娌硅��', append: 'L',
           display: true,
         },
       }
@@ -1109,7 +1185,7 @@
     {
       label: '鍏朵粬淇℃伅',
       prop: 'qtyxx',
-      column:{
+      column: {
         shiftNo: {
           label: '鐝鍙�',
           display: true,
@@ -1119,7 +1195,7 @@
           display: true,
         },
         remark: {
-          label: '澶囨敞',span:24,
+          label: '澶囨敞', span: 24,
           type: 'textarea', minRows: 3, maxRows: 5,
           display: true,
         },
@@ -1135,31 +1211,31 @@
     },
     customerName: {
       label: '瀹㈡埛',
-      display: false,minWidth: 120,
+      display: false, minWidth: 120,
       search: true,
     },
 
     projectName: {
       label: '椤圭洰鍚嶇О',
-      display: false,minWidth: 120,
+      display: false, minWidth: 120,
       search: true,
     },
     contractName: {
-      label: '鍏宠仈鍚堝悓鍚嶇О',minWidth: 120,
+      label: '鍏宠仈鍚堝悓鍚嶇О', minWidth: 120,
       display: false,
       search: true,
     },
     orderType: {
       label: '璁㈠崟绫诲瀷',
       display: false,
-      search: true,minWidth: 120,
+      search: true, minWidth: 120,
       type: 'select', dataType: 'string',
       dicUrl: '/system/dict/data/type/order_type',
     },
     signType: {
       label: '璁㈠崟绫诲瀷',
       display: false,
-      search: true,minWidth: 120,
+      search: true, minWidth: 120,
       type: 'select', dataType: 'string',
       dicUrl: '/system/dict/data/type/order_type',
     },
@@ -1167,36 +1243,36 @@
     transportLine: {
       label: '杩愯緭绾胯矾',
       display: false,
-      search: true,minWidth: 180, overHidden:true
+      search: true, minWidth: 180, overHidden: true
     },
 
 
     vehicleProviderName: {
-      label: '杞﹁締鏈嶅姟鍟嗗悕绉�',minWidth: 150,
+      label: '杞﹁締鏈嶅姟鍟嗗悕绉�', minWidth: 150,
       display: false,
       search: true,
     },
 
     loadingServiceProviderName: {
-      label: '瑁呰揣鏈嶅姟鍟嗗悕绉�',minWidth: 150,
+      label: '瑁呰揣鏈嶅姟鍟嗗悕绉�', minWidth: 150,
       display: false,
       search: true,
     },
     customsServiceProviderName: {
-      label: '鎶ュ叧鏈嶅姟鍟嗗悕绉�',minWidth: 150,
+      label: '鎶ュ叧鏈嶅姟鍟嗗悕绉�', minWidth: 150,
       display: false,
       search: true,
     },
     isUrgent: {
       label: '鏄惁绱ф�ュ惁',
-      display: false,minWidth: 100,
+      display: false, minWidth: 100,
       search: true,
       type: 'select', dicUrl: '/system/dict/data/type/sys_number_is', dataType: 'string',
 
     },
     mainDriverName: {
       label: '涓婚┚椹跺憳',
-      display: false,minWidth: 120,
+      display: false, minWidth: 120,
       search: true,
     },
 
@@ -1206,31 +1282,31 @@
     //   search: true,
     // },
     actualVehicleType: {
-      label: '瀹為檯杩愯緭宸ュ叿绫诲瀷',minWidth: 130,
+      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/license_type', dataType: 'string',
 
     },
 
     licensePlate: {
-      label: '杞︾墝鍙�',minWidth: 120,
+      label: '杞︾墝鍙�', minWidth: 120,
       display: false,
       search: true,
     },
 
     shipperName: {
       label: '鍙戣揣浜哄悕绉�',
-      display: false,minWidth: 120,
+      display: false, minWidth: 120,
       search: true,
     },
     receiverName: {
-      label: '鏀惰揣浜哄悕绉�',minWidth: 120,
+      label: '鏀惰揣浜哄悕绉�', minWidth: 120,
       display: false,
       search: true,
     },
     accountsReceivableStatus: {
-      label: '搴旀敹璐圭敤鐢熸垚鐘舵��',minWidth: 160,
+      label: '搴旀敹璐圭敤鐢熸垚鐘舵��', minWidth: 160,
       display: false,
       hide: false,
       search: true,
@@ -1242,7 +1318,7 @@
       ],
     },
     accountsPayableStatus: {
-      label: '搴斾粯璐圭敤鐢熸垚鐘舵��',minWidth: 160,
+      label: '搴斾粯璐圭敤鐢熸垚鐘舵��', minWidth: 160,
       display: false,
       hide: false,
       search: true,
@@ -1255,10 +1331,10 @@
     },
 
     status: {
-      label: '鐘舵��',minWidth: 120,
+      label: '鐘舵��', minWidth: 150,
       type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/tms_dispatch_order_status',
       display: false,
-      hide: false,
+      hide: false, fixed: 'right',
       search: true,
       rules: [
         {
@@ -1269,7 +1345,7 @@
     },
 
     updateBy: {
-      label: '鏇存柊浜�',minWidth: 150,
+      label: '鏇存柊浜�', minWidth: 150,
       addDisplay: false,
       editDisplay: false,
       viewDisplay: false,
@@ -1277,7 +1353,7 @@
       search: false,
     },
     updateTime: {
-      label: '鏇存柊鏃堕棿',minWidth: 180,
+      label: '鏇存柊鏃堕棿', minWidth: 180,
       addDisplay: false,
       editDisplay: false,
       viewDisplay: false,
@@ -1288,6 +1364,273 @@
 
   }
 })
+
+const itineraryOption = ref({
+  menuBtn: false,
+  labelWidth: 120,
+  column: {
+
+    driverName: {
+      label: '涓婚┚椹跺憳鍚嶇О',
+      display: true, disabled: true,
+    },
+    vehicleNumber: {
+      label: '杞︾墝鍙风爜',
+      display: true, disabled: true,
+
+    },
+    tripType: {
+      label: '琛岀▼绫诲瀷',
+      display: true,
+      type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/trip_type',
+      rules: [
+        {
+          required: true,
+          message: "琛岀▼绫诲瀷涓嶈兘涓虹┖", trigger: "change"
+        }
+      ],
+    },
+    tripTime: {
+      label: '鏃堕棿',
+      type: 'datetime', valueFormat: 'YYYY-MM-DD HH:mm:ss',
+      display: true,
+      rules: [
+        {
+          required: true,
+          message: "鏃堕棿涓嶈兘涓虹┖", trigger: "change"
+        }
+      ],
+    },
+    odometer: {
+      label: '浠〃閲岀▼',
+      display: true,
+      rules: [
+        {
+          required: true,
+          message: "浠〃閲岀▼涓嶈兘涓虹┖", trigger: "change"
+        }
+      ],
+    },
+    address: {
+      label: '鍏蜂綋鍦板潃',
+      display: true,
+      rules: [
+        {
+          required: true,
+          message: "鍏蜂綋鍦板潃涓嶈兘涓虹┖", trigger: "change"
+        }
+      ],
+    },
+    voucherUrl: {
+      label: '琛岀▼鍑瘉',
+      display: true,
+      type: 'upload',
+      multiple: true,
+      span: 24,
+      propsHttp: {
+        url: 'url',
+        name: 'name',
+        res: 'data'
+      },
+    },
+    dataSource: {
+      label: '鏁版嵁鏉ユ簮',
+      display: false,
+      value: 0
+    },
+  }
+})
+
+const itineraryTableOption = ref({
+  menu: false,
+  addBtn: false,
+  header: false, selection: false,
+  title: '鍘嗗彶琛岀▼',
+  column: {
+    dataSource: {
+      label: '鏁版嵁鏉ユ簮',
+      display: false,
+      type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/data_source',
+
+    },
+    driverName: {
+      label: '涓婚┚椹跺憳鍚嶇О',
+      display: true, disabled: true,
+    },
+    vehicleNumber: {
+      label: '杞︾墝鍙风爜',
+      display: true, disabled: true,
+
+    },
+    tripType: {
+      label: '琛岀▼绫诲瀷',
+      display: true,
+      type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/trip_type',
+
+    },
+    tripTime: {
+      label: '鏃堕棿',
+      type: 'date', valueFormat: 'YYYY-MM-DD',
+      display: true,
+    },
+    odometer: {
+      label: '浠〃閲岀▼',
+      display: true,
+    },
+    address: {
+      label: '鍏蜂綋鍦板潃',
+      display: true,
+    },
+    voucherUrl: {
+      label: '琛岀▼鍑瘉',
+      display: true,
+    },
+
+  }
+})
+
+const financeOption = ref({
+  menuBtn: false,
+  labelWidth: 120,
+  column: {
+    feeType: {
+      label: '璐圭敤绫诲瀷',
+      display: true,
+      type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/fee_type',
+      rules: [
+        {
+          required: true,
+          message: "璐圭敤绫诲瀷涓嶈兘涓虹┖", trigger: "change"
+        }
+      ],
+    },
+    actualFeeAmount: {
+      label: '璐圭敤閲戦',
+      type: 'number',
+      display: true,
+      rules: [
+        {
+          required: true,
+          message: "璐圭敤閲戦涓嶈兘涓虹┖", trigger: "change"
+        }
+      ],
+    },
+    voucherUrl: {
+      label: '琛岀▼鍑瘉',
+      display: true,
+      type: 'upload',
+      multiple: true,
+      span: 24,
+      propsHttp: {
+        url: 'url',
+        name: 'name',
+        res: 'data'
+      },
+    },
+    dataSource: {
+      label: '鏁版嵁鏉ユ簮',
+      display: false,
+      value: 0
+    },
+  }
+})
+
+const financeTableOption = ref({
+  menu: false,
+  addBtn: false,
+  header: false, selection: false,
+  title: '鍘嗗彶鍨粯璐圭敤',
+  column: {
+    dataSource: {
+      label: '鏁版嵁鏉ユ簮',
+      display: false,
+      type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/data_source',
+
+    },
+    createBy: {
+      label: '娣诲姞浜�',
+      display: true, disabled: true,
+    },
+    feeCreateTime: {
+      label: '涓婁紶鏃堕棿',
+      display: true, disabled: true,
+
+    },
+    feeType: {
+      label: '璐圭敤绫诲瀷',
+      display: true,
+      type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/fee_type',
+
+    },
+    actualFeeAmount: {
+      label: '閲戦',
+      display: true,
+    },
+    feeVoucherUrl: {
+      label: '璐圭敤鍑瘉',
+      display: true,
+    },
+
+  }
+})
+
+const generateTableOption = ref({
+  menu: false,
+  addBtn: false,
+  header: false, selection: false,
+  column: {
+    accountsReceivableName: {
+      label: '鍖归厤搴旀敹鏂规鍚嶇О', minWidth: 160,
+    },
+    accountsPayableName: {
+      label: '鍖归厤搴斾粯鏂规鍚嶇О', minWidth: 160,
+    },
+    accountsReceivableStatus: {
+      label: '搴旀敹璐圭敤鐢熸垚鐘舵��', minWidth: 160,
+      type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/tms_dispatch_order_status',
+    },
+    accountsPayableStatus: {
+      label: '搴斾粯璐圭敤鐢熸垚鐘舵��', minWidth: 160,
+      type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/tms_dispatch_order_status',
+    },
+    dispatchNo: {
+      label: '璋冨害鍗曞彿', minWidth: 120,
+      display: false,
+    },
+    customerName: {
+      label: '瀹㈡埛',
+      display: false, minWidth: 120,
+    },
+    vehicleProviderName: {
+      label: '杞﹁締鏈嶅姟鍟嗗悕绉�', minWidth: 150,
+      display: false,
+    },
+    shipperName: {
+      label: '鍙戣揣浜哄悕绉�',
+      display: false, minWidth: 120,
+    },
+    receiverName: {
+      label: '鏀惰揣浜哄悕绉�', minWidth: 120,
+      display: false,
+    },
+    transportLine: {
+      label: '杩愯緭绾胯矾',
+      display: false,minWidth: 180, overHidden: true
+    },
+    actualVehicleType: {
+      label: '杞﹀瀷', minWidth: 130,
+      display: false,
+      type: 'select', dicUrl: '/system/dict/data/type/license_type', dataType: 'string',
+
+    },
+    licensePlate: {
+      label: '杞︾墝鍙�', minWidth: 120,
+      display: false,
+    },
+
+  }
+})
+
 
 const {
   tableData,
@@ -1325,6 +1668,157 @@
     selectionList.value = selection;
   }
 })
+const handleConfirm = (row: any) => {
+  ElMessageBox.confirm("鏄惁瀵硅皟搴﹀崟鍙�" + row.dispatchNo + "纭畾 锛�", '绯荤粺鎻愮ず', {
+    confirmButtonText: '纭畾',
+    cancelButtonText: '鍙栨秷',
+    type: 'warning'
+  }).then(() => {
+    return confirmOrder(row.id);
+  }).then(() => {
+    onLoad(page.value);
+    ElMessage({
+      message: "鎿嶄綔鎴愬姛锛�",
+      type: 'success'
+    })
+  });
+}
+
+const handleCopy = (row: any) => {
+  ElMessageBox.confirm("鏄惁瀵硅皟搴﹀崟鍙�" + row.dispatchNo + "澶嶅埗 锛�", '绯荤粺鎻愮ず', {
+    confirmButtonText: '纭畾',
+    cancelButtonText: '鍙栨秷',
+    type: 'warning'
+  }).then(() => {
+    return copyOrder(row.id);
+  }).then(() => {
+    onLoad(page.value);
+    ElMessage({
+      message: "鎿嶄綔鎴愬姛锛�",
+      type: 'success'
+    })
+  });
+}
+const handleOk = (row: any) => {
+  ElMessageBox.confirm("鏄惁纭瀹屾垚璋冨害鍗曞彿锛�" + row.dispatchNo + " 鐨勮绋� 锛�", '绯荤粺鎻愮ず', {
+    confirmButtonText: '纭畾',
+    cancelButtonText: '鍙栨秷',
+    type: 'warning'
+  }).then(() => {
+    return okOrder(row.id);
+  }).then(() => {
+    onLoad(page.value);
+    ElMessage({
+      message: "鎿嶄綔鎴愬姛锛�",
+      type: 'success'
+    })
+  });
+}
+/**
+ * 涓婁紶琛岀▼
+ */
+const handleUploadItinerary = (row: any) => {
+  optionType.value = 'addItinerary';
+  boxFormOption.value = itineraryOption.value;
+  boxTableOption.value = itineraryTableOption.value;
+  listTmsTrip({dispatchOrderId: row.id, pageNum: 1, pageSize: 999}).then(res => {
+    boxTableData.value = res.rows || [];
+    pageF.open = true;
+    pageF.title = '涓婁紶琛岀▼';
+
+    boxForm.value = {
+      dispatchOrderId: row.id,
+      dataSource: 0,
+      driverId: row.mainDriverId,
+      driverName: row.mainDriverName,
+      vehicleNumber: row.licensePlate,
+      vehicleId: row.vehicleId,
+    }
+  })
+}
+const cancelBox = () => {
+  if (optionType.value === 'addItinerary' || optionType.value === 'addFinance') {
+    boxForm.value = {};
+    boxFormRef.value.resetFields();
+  }
+  pageF.open = false;
+}
+
+const submitForm = () => {
+  if (optionType.value === 'addItinerary'){
+    if (Array.isArray(boxForm.value.voucherUrl)) {
+      boxForm.value.voucherUrl = boxForm.value.voucherUrl.toString();
+    }
+    addTmsTrip(boxForm.value).then(res => {
+      ElMessage({
+        message: "鎿嶄綔鎴愬姛锛�",
+        type: 'success'
+      })
+      cancelBox();
+      onLoad(page.value);
+    })
+  }else if (optionType.value === 'addFinance'){
+    if (Array.isArray(boxForm.value.feeVoucherUrl)) {
+      boxForm.value.feeVoucherUrl = boxForm.value.feeVoucherUrl.toString();
+    }
+    addTmsFinanceDetail(boxForm.value).then(res=>{
+      ElMessage({
+        message: "鎿嶄綔鎴愬姛锛�",
+        type: 'success'
+      })
+      cancelBox();
+      onLoad(page.value);
+    })
+  }
+
+
+}
+
+
+const handleLog = (row: any) => {
+
+}
+const handleLogItinerary = (row: any) => {
+  optionType.value = 'view';
+  boxTableOption.value = itineraryTableOption.value;
+  listTmsTrip({dispatchOrderId: row.id, pageNum: 1, pageSize: 999}).then(res => {
+    boxTableData.value = res.rows || [];
+    pageF.open = true;
+    pageF.title = '鏌ョ湅琛岀▼';
+    boxFormOption.value.title = '';
+  })
+}
+
+const handleAddFinance = (row:any)=>{
+  optionType.value = 'addFinance';
+  boxFormOption.value = financeOption.value;
+  boxTableOption.value = financeTableOption.value;
+  listTmsFinanceDetail({
+    dispatchOrderId: row.id,financeType:2,
+    pageNum: 1, pageSize: 999}).then(res => {
+    boxTableData.value = res.rows || [];
+    pageF.open = true;
+    pageF.title = '璐圭敤鐧昏';
+    boxForm.value = {
+      dispatchOrderId: row.id,
+      dataSource: 0,
+      financeType:2,
+    }
+  })
+}
+
+const handleGenerate = () => {
+  optionType.value = 'generate';
+  pageF.open = true;
+  pageF.title = '鐢熸垚搴旀敹搴斾粯璐圭敤鏁版嵁';
+  boxTableOption.value = generateTableOption.value;
+}
+
+const submitGenerate = () => {
+  
+}
+
+
 
 onMounted(() => {
 

--
Gitblit v1.8.0