From 3bea505c75d0f545bb5aad3d81a38417b1056e92 Mon Sep 17 00:00:00 2001
From: wupengfei <834520024@qq.com>
Date: 星期五, 05 九月 2025 11:04:58 +0800
Subject: [PATCH] feat: 页面

---
 src/views/ServiceChargeManage/ServiceChargeManage.vue |   85 +++++++++++++++++++-----------------------
 1 files changed, 39 insertions(+), 46 deletions(-)

diff --git a/src/views/ServiceChargeManage/ServiceChargeManage.vue b/src/views/ServiceChargeManage/ServiceChargeManage.vue
index 868fbbf..f60c590 100644
--- a/src/views/ServiceChargeManage/ServiceChargeManage.vue
+++ b/src/views/ServiceChargeManage/ServiceChargeManage.vue
@@ -46,7 +46,7 @@
         </template>
         <template #btn>
           <el-button type="primary" link @click="handleDownloadTemplate()">缁撶畻鍗曟ā鏉�</el-button>
-          <el-button type="primary" @click="openDialog()">涓婁紶缁撶畻鍗�</el-button>
+          <el-button type="primary" @click="handleAdd()">涓婁紶缁撶畻鍗�</el-button>
           <el-button type="primary" @click="handleDownloadTemplate()">瀵煎嚭</el-button>
         </template>
       </ProTableQueryFilterBar>
@@ -55,18 +55,39 @@
         :columns="ServiceChargeManageColumns"
         :operationBtns="operationBtns"
       >
-        <template #operationBtn-uploadBtn="{ data, row }">
+        <template #operationBtn-uploadBtn="{ row }">
           <BlFileUpload
-            v-model:file-url="row.listFiles"
-            multiple
+            v-if="row.settlementOrderStatus === EnumTaskSettlementOrderStatus.Wait"
+            v-model:file-url="editForm.settlementUrl"
             ref="uploadRef"
             :showTip="false"
             :show-file-list="false"
             class="pro-table-operation-btn upload-style-btn"
             :on-success="(event) => handleUploadSuccess(event, row)"
             :limitFileSize="null"
+            :limit="1"
+            accept="xlsx,xls"
           >
             <el-button text type="primary" class="pro-table-operation-btn">涓婁紶</el-button>
+          </BlFileUpload>
+        </template>
+        <template #operationBtn-reUploadBtn="{ data, row }">
+          <BlFileUpload
+            v-if="
+              row.settlementOrderStatus === EnumTaskSettlementOrderStatus.Completed &&
+              row.settlementStatus === EnumTaskSettlementStatus.Wait
+            "
+            v-model:file-url="editForm.settlementUrl"
+            ref="uploadRef"
+            :showTip="false"
+            :show-file-list="false"
+            class="pro-table-operation-btn upload-style-btn"
+            :on-success="(event) => handleUploadSuccess(event, row)"
+            :limitFileSize="null"
+            :limit="1"
+            accept="xlsx,xls"
+          >
+            <el-button text type="primary" class="pro-table-operation-btn">閲嶆柊涓婁紶</el-button>
           </BlFileUpload>
         </template>
       </ProTableV2>
@@ -93,7 +114,12 @@
   BlFileUpload,
 } from '@bole-core/components';
 import { ServiceChargeManageColumns } from './constants';
-import { EnumTaskSettlementStatusText, EnumTaskSettlementOrderStatusText } from '@/constants';
+import {
+  EnumTaskSettlementStatusText,
+  EnumTaskSettlementOrderStatusText,
+  EnumTaskSettlementOrderStatus,
+  EnumTaskSettlementStatus,
+} from '@/constants';
 import { downloadFileByUrl } from '@/utils';
 import * as taskServices from '@/services/api/task';
 import { ModelValueType } from 'element-plus';
@@ -106,30 +132,6 @@
 });
 
 const operationBtns = defineOperationBtns([
-  // {
-  //   data: {
-  //     enCode: 'uploadBtn',
-  //     name: '涓婁紶',
-  //   },
-  //   emits: {
-  //     onClick: (role) => openDialog(role),
-  //   },
-  //   extraProps: {
-  //     hide: () => false,
-  //   },
-  // },
-  // {
-  //   data: {
-  //     enCode: 'reUploadBtn',
-  //     name: '閲嶆柊涓婁紶',
-  //   },
-  //   emits: {
-  //     onClick: (role) => openDialog(role),
-  //   },
-  //   extraProps: {
-  //     hide: () => false,
-  //   },
-  // },
   {
     data: {
       enCode: 'settleBtn',
@@ -161,7 +163,7 @@
       name: '璇︽儏',
     },
     emits: {
-      onClick: (role) => goDetail(role),
+      onClick: (role: API.GetSettlementTasksQueryResultItem) => goDetail(role.id),
     },
   },
   {
@@ -245,28 +247,19 @@
   }
 );
 
-const { dialogProps, handleAdd, handleEdit, editForm } = useFormDialog({
+const { dialogProps, handleAdd, editForm } = useFormDialog({
   onConfirm: handleAddOrEdit,
   defaultFormParams: {
+    code: '',
     id: '',
     name: '',
     settlementUrl: [] as UploadUserFile[],
   },
 });
 
-function openDialog(row?: API.GetSettlementTasksQueryResultItem) {
-  if (row) {
-    handleEdit({
-      id: row?.id,
-      name: row?.name,
-      settlementUrl: [] as UploadUserFile[],
-    });
-  } else {
-    handleAdd();
-  }
+async function handleAddOrEdit() {
+  goDetail(editForm.id, editForm.settlementUrl[0]?.url);
 }
-
-async function handleAddOrEdit() {}
 
 const {
   dialogProps: dialogSettleProps,
@@ -325,15 +318,15 @@
   row: API.GetSettlementTasksQueryResultItem
 ) {
   if (response.url) {
-    goDetail(row, response.url);
+    goDetail(row.id, response.url);
   }
 }
 
-function goDetail(row: API.GetSettlementTasksQueryResultItem, url?: string) {
+function goDetail(id: string, url?: string) {
   router.push({
     name: 'ServiceChargeDetail',
     query: {
-      id: row.id,
+      id: id,
       url: url ? url : '',
     },
   });

--
Gitblit v1.9.1