From cc41746818af3b619167947ecb4401ccdfbec2d8 Mon Sep 17 00:00:00 2001
From: sen <sen@qq.com>
Date: 星期二, 31 三月 2026 10:40:47 +0800
Subject: [PATCH] 修改搜索

---
 ui/admin-ui3/src/views/tms/generationCost/index.vue |  132 ++++++++++++++++++++++++++++++++++++-------
 1 files changed, 110 insertions(+), 22 deletions(-)

diff --git a/ui/admin-ui3/src/views/tms/generationCost/index.vue b/ui/admin-ui3/src/views/tms/generationCost/index.vue
index cff296f..a598463 100644
--- a/ui/admin-ui3/src/views/tms/generationCost/index.vue
+++ b/ui/admin-ui3/src/views/tms/generationCost/index.vue
@@ -72,8 +72,9 @@
                 </el-select>
               </el-descriptions-item>
               <el-descriptions-item label="鏄惁瀛樺湪搴斾粯鎶ヤ环">
-                <span :style="{ color: row.isCZYF == 0 ? 'red' : '' }">{{ row.isCZYF == 0 ? '鍚�' : row.isCZYF == 1 ? '鏄�' :
-                  ''}}</span>
+                <span :style="{ color: row.isCZYF == 0 ? 'red' : '' }">{{ row.isCZYF == 0 ? '鍚�' : row.isCZYF == 1 ? '鏄�'
+                  :
+                  '' }}</span>
 
               </el-descriptions-item>
               <el-descriptions-item label="璁¤垂閲戦">
@@ -83,7 +84,7 @@
               <el-descriptions-item label="甯佸埗">
                 <el-radio-group v-model="row.yfCurrency">
                   <el-radio v-for="dict in sys_currency" :key="dict.value" :label="dict.value">{{ dict.label
-                    }}</el-radio>
+                  }}</el-radio>
                 </el-radio-group>
               </el-descriptions-item>
               <el-descriptions-item label="璁¤垂鏁伴噺">
@@ -99,15 +100,31 @@
       <div v-if="active === 'tab2'">
         <h2>瀹炴姤瀹為攢璐圭敤</h2>
         <avue-form v-model="boxForm" ref="boxFormRef" :option="boxFormOption">
+          <template #voucherUrl="{ row }">
+            <el-upload class="upload-demo" ref="uploadRef" :limit="1" drag :action="urlApi + '/common/upload2'" multiple
+              :show-file-list="true" :on-success="(res) => handleUploadAfter(res, row)"
+              :on-exceed="(files) => handleExceed(files, row)">
+              <el-icon class="el-icon--upload"><upload-filled /></el-icon>
+              <div class="el-upload__text">
+                鐐瑰嚮鎴栧皢鍥剧墖鎷栨嫿鍒版鍖哄煙涓婁紶
+              </div>
 
+            </el-upload>
+          </template>
         </avue-form>
-        <avue-crud :option="boxTableOption" :data="boxTableData">
+        <avue-crud :option="boxTableOption" :data="boxTableData" @selection-change="boxSelectionChange">
+          <template #menu-left>
+            <el-button type="danger" plain icon="Delete" :disabled="boxSelectionList.length !== 1"
+              @click="handleBatchBoxDel">
+              浣滃簾
+            </el-button>
+          </template>
           <template #isYF="{ row }">
-            <el-checkbox v-model="row.isYF" :true-value="1" :false-value="0"
+            <el-checkbox v-model="row.isYF"   :disabled="row.status == 1"  :true-value="1" :false-value="0"
               @change="(e: number) => isYFChange(e, row)"></el-checkbox>
           </template>
           <template #yfServiceProviderId="{ row }">
-            <el-select v-model="row.yfServiceProviderIdType" placeholder="璇烽�夋嫨鏈嶅姟鍟�"
+            <el-select   :disabled="row.status == 1" v-model="row.yfServiceProviderIdType" placeholder="璇烽�夋嫨鏈嶅姟鍟�"
               @change="(e: any) => ysServiceProviderChange(e, row)" :filterable="true">
               <el-option v-for="item in serviceProviderList"
                 :key="item.serviceProviderId + '_' + item.serviceProviderType" :label="item.serviceProviderName"
@@ -115,10 +132,10 @@
             </el-select>
           </template>
           <template #yfPrice="{ row }">
-            <el-input v-model="row.yfPrice" :min="1" type="number" placeholder="璇疯緭鍏ラ噾棰�"></el-input>
+            <el-input   :disabled="row.status == 1" v-model="row.yfPrice" :min="1" type="number" placeholder="璇疯緭鍏ラ噾棰�"></el-input>
           </template>
           <template #yfCurrency="{ row }">
-            <el-radio-group v-model="row.yfCurrency">
+            <el-radio-group v-model="row.yfCurrency"   :disabled="row.status == 1" >
               <el-radio v-for="dict in sys_currency" :key="dict.value" :label="dict.value">{{ dict.label }}</el-radio>
             </el-radio-group>
           </template>
@@ -210,7 +227,7 @@
   updateTmsDispatchOrder,
   generateTmsDispatchOrder, initGenerate, initYSGenerate,
   ysGenerateTmsDispatchOrder, initYFGenerate, yfGenerateTmsDispatchOrder,
-  getServiceProvider, checkCloseOrder, closeOrder
+  getServiceProvider, checkCloseOrder, closeOrder,tmsFinanceDetail
 } from "@/api/tms/tmsDispatchOrder";
 import useCurrentInstance from "@/utils/useCurrentInstance";
 import { computed, onMounted, reactive, ref, toRefs, watch, getCurrentInstance, nextTick } from "vue";
@@ -227,6 +244,7 @@
 import { listTmsLoadingServiceProvider } from "@/api/tms/tmsLoadingServiceProvider";
 import { selectPaymentTmsQuotePlan } from "@/api/tms/tmsQuotePlan";
 import { addTmsQuoteFee, listTmsQuoteFee, pushTmsQuoteFee } from "@/api/tms/tmsQuoteFee";
+import { status } from "nprogress";
 
 
 
@@ -253,6 +271,8 @@
 };
 const data = reactive({
   form: <TmsDispatchOrderI>{},
+  selectionList2: <any>[],
+  boxSelectionList: <any>[],
   queryParams: <TmsDispatchOrderI & PageQueryInterface>{},
   page: <PagesInterface>{
     pageSize: 10,
@@ -270,7 +290,6 @@
   open: false,
   open2: false,
   goodsTableData: <any>[],
-  selectionList2: <any>[],
   goodsForm: <any>{},
   open3: false,
   actualForm: <any>{},
@@ -283,7 +302,7 @@
 })
 const {
   queryParams, form, page, selectionList,
-  boxTableData, optionType, open, open5,
+  boxTableData, optionType, open, open5, boxSelectionList,
   boxFormOption, boxForm, boxTableOption, boxItemTableOption, selectionList2, isCustoms, isLoad, active, quotationItems, serviceProviderList
 } = toRefs(data);
 const option = ref({
@@ -808,7 +827,7 @@
       display: true,
     },
     voucherUrl: {
-      label: '琛岀▼鍑瘉',
+      label: '琛岀▼鍑瘉3',
       display: true,
       span: 24, dataType: 'string',
       type: 'upload',
@@ -861,8 +880,8 @@
       display: true,
       accept: 'string', dataType: 'string',
       type: 'upload',
-      action: '/common/upload2',
-
+      // action: '/common/upload2',
+      slot: true,
     },
     remark: {
       label: '澶囨敞', span: 24,
@@ -881,7 +900,8 @@
 const financeTableOption = ref({
   menu: false,
   addBtn: false,
-  header: false, selection: false,
+  header: true, 
+  selection: true,
   title: '鍘嗗彶鍨粯璐圭敤',
   column: {
     dataSource: {
@@ -952,9 +972,13 @@
     yfCurrency: {
       label: '搴斾粯甯佸埗',
       display: true,
+    },
+     status: {
+      label: '鐘舵��',
+      display: true,
+      type: 'select', dicUrl: '/system/dict/data/type/sys_cancel_word', dataType: 'string',
 
-    }
-
+    },
   }
 })
 
@@ -1261,7 +1285,6 @@
 
 const submitForm = () => {
   if (active.value === 'tab1') {
-    console.log()
     pushTmsQuoteFee({
       ...form.value,
       quoteFeeItems: selectionList2.value
@@ -1278,6 +1301,7 @@
     if (Array.isArray(boxForm.value.feeVoucherUrl)) {
       boxForm.value.feeVoucherUrl = boxForm.value.feeVoucherUrl.toString();
     }
+
     boxForm.value.rowItems = boxTableData.value;
     saveTmsFinanceDetail(boxForm.value).then(res => {
       ElMessage({
@@ -1285,6 +1309,7 @@
         type: 'success'
       })
       boxFormRef.value?.resetFields();
+      uploadRef.value?.clearFiles();
       getTab2Data();
     })
   }
@@ -1329,7 +1354,6 @@
   const quotePlanItemRes2 = await listTmsQuoteItem({ quotePlanId: form.value.quotePlanId, pageNum: 1, pageSize: 999 });
   let list = quotePlanItemRes2.rows || [];
   let quotePlanItemRes = await getDicts("sys_quotation_items");
-  console.log(quotePlanItemRes)
   let items = quotePlanItemRes.data || [];
   let res = await listTmsQuoteFee({ dispatchId: form.value.id, pageNum: 1, pageSize: 999 });
   let rowsData = res.rows || [];
@@ -1457,7 +1481,6 @@
   if (value == 1) {
     let find: any = quotationItems.value.find((item: any) => item.dictLabel === row.feeType);
     if (find) {
-      console.log(find, "find")
       let opt = find.remark;
       row.serviceProviderType = opt;
       if (opt == 0) {
@@ -1548,7 +1571,6 @@
       let receivableAmountHKD = items.filter((cItem: any) => cItem.currency == 'HKD').reduce((pre: any, cur: any) => {
         return pre + Number(cur.registerAmount)
       }, 0);
-      console.log(receivableAmountRMB, receivableAmountHKD)
       item.receivableAmountRMB = receivableAmountRMB;
       item.receivableAmountHKD = receivableAmountHKD;
 
@@ -1630,7 +1652,6 @@
 }
 const submitForm5 = () => {
   boxFormRef.value.validate((valid: boolean, done: any) => {
-    console.log(valid)
     if (valid) {
       boxForm.value.id = form.value.id;
       closeOrder(boxForm.value).then(res => {
@@ -1644,4 +1665,71 @@
     }
   })
 }
+const uploadRef = ref<any>()
+const urlApi = ref(import.meta.env.VITE_APP_BASE_API)
+// 鍦� script 閮ㄥ垎淇敼 handleUploadAfter 鍑芥暟
+const handleUploadAfter = (res: any, row: any) => {
+  if (res.code === 200) {
+    // 纭繚 res.data.url 瀛樺湪
+    const url = res.data?.url || res.url;
+    if (url) {
+      boxForm.value.feeVoucherUrl = url
+    } else {
+      ElMessage.error('鏈幏鍙栧埌涓婁紶鏂囦欢 URL');
+    }
+  } else {
+    ElMessage.error(res.msg || '涓婁紶澶辫触');
+  }
+};
+
+// 鍚屾椂淇敼 handleExceed 鍑芥暟
+const handleExceed = (files: any, row: any) => {
+  if (!row) {
+    ElMessage.error('琛屾暟鎹负绌�');
+    return;
+  }
+
+  uploadRef.value?.clearFiles();
+  const file = files[0];
+  uploadRef.value?.handleStart(file);
+  uploadRef.value?.submit();
+};
+
+const boxSelectionChange = (selection: any[]) => {
+  console.log(selection);
+
+  boxSelectionList.value = selection;
+}
+/**
+ * 鎵归噺浣滃簾璐圭敤鏄庣粏
+ */
+const handleBatchBoxDel = () => {
+  if (boxSelectionList.value.length === 0) {
+    ElMessage.warning('璇烽�夋嫨瑕佷綔搴熺殑璐圭敤鏄庣粏');
+    return;
+  }
+  
+  ElMessageBox.confirm(`纭瑕佷綔搴熼�変腑鐨� ${boxSelectionList.value.length} 鏉¤垂鐢ㄦ槑缁嗗悧锛焋, '璀﹀憡', {
+    confirmButtonText: '纭畾',
+    cancelButtonText: '鍙栨秷',
+    type: 'warning'
+  }).then(() => {
+    // 浠� boxTableData 涓Щ闄ら�変腑鐨勯」
+    // const ids = boxSelectionList.value.map((item: any) => item.id).join(',');
+    let data = {
+      id:boxSelectionList.value[0].id,
+      status:1
+    }
+      tmsFinanceDetail(data).then(res => {
+        ElMessage.success('浣滃簾鎴愬姛');
+        getTab2Data(); // 鍒锋柊鏁版嵁
+      }).catch(err => {
+        ElMessage.error('浣滃簾澶辫触');
+      });
+    // ElMessage.success('浣滃簾鎴愬姛');
+    // boxSelectionList.value = []; // 娓呯┖閫夋嫨
+  }).catch(() => {
+    // 鍙栨秷鎿嶄綔
+  });
+}
 </script>
\ No newline at end of file

--
Gitblit v1.8.0