From b331f884097a2dc5086c8cf043c8c8f52e7640fe Mon Sep 17 00:00:00 2001
From: wupengfei <834520024@qq.com>
Date: 星期五, 12 九月 2025 17:34:39 +0800
Subject: [PATCH] Merge branch 'master' into dev-v1.1

---
 src/views/ServiceChargeManage/ServiceChargeManage.vue |  101 +++++++++++++++++++++++++++++++++-----------------
 1 files changed, 67 insertions(+), 34 deletions(-)

diff --git a/src/views/ServiceChargeManage/ServiceChargeManage.vue b/src/views/ServiceChargeManage/ServiceChargeManage.vue
index 134f3d2..b697403 100644
--- a/src/views/ServiceChargeManage/ServiceChargeManage.vue
+++ b/src/views/ServiceChargeManage/ServiceChargeManage.vue
@@ -55,7 +55,7 @@
         :columns="ServiceChargeManageColumns"
         :operationBtns="operationBtns"
       >
-        <template #operationBtn-uploadBtn="{ row }">
+        <!-- <template #operationBtn-uploadBtn="{ row }">
           <BlFileUpload
             v-model:file-url="editForm.settlementUrl"
             ref="uploadRef"
@@ -84,11 +84,12 @@
           >
             <el-button text type="primary" class="pro-table-operation-btn">閲嶆柊涓婁紶</el-button>
           </BlFileUpload>
-        </template>
+        </template> -->
       </ProTableV2>
     </AppContainer>
     <UploadStatementDialog v-bind="dialogProps" />
     <SettleDetailDialog v-bind="dialogSettleProps" />
+    <RechargeEnterpriseWalletDialog v-bind="dialogRechargeProps" />
   </LoadingLayout>
 </template>
 
@@ -120,6 +121,7 @@
 import { ModelValueType } from 'element-plus';
 import UploadStatementDialog from './components/UploadStatementDialog.vue';
 import SettleDetailDialog from './components/SettleDetailDialog.vue';
+import RechargeEnterpriseWalletDialog from './components/RechargeEnterpriseWalletDialog.vue';
 import { Message } from '@bole-core/core';
 
 defineOptions({
@@ -127,36 +129,36 @@
 });
 
 const operationBtns = defineOperationBtns([
-  {
-    data: {
-      enCode: 'uploadBtn',
-      name: '涓婁紶',
-    },
-    extraProps: {
-      hide: (row: API.GetSettlementTasksQueryResultItem) =>
-        row.settlementOrderStatus !== EnumTaskSettlementOrderStatus.Wait,
-    },
-  },
-  {
-    data: {
-      enCode: 'reUploadBtn',
-      name: '閲嶆柊涓婁紶',
-    },
-    extraProps: {
-      hide: (row: API.GetSettlementTasksQueryResultItem) =>
-        !(
-          row.settlementOrderStatus === EnumTaskSettlementOrderStatus.Completed &&
-          row.settlementStatus === EnumTaskSettlementStatus.Wait
-        ),
-    },
-  },
+  // {
+  //   data: {
+  //     enCode: 'uploadBtn',
+  //     name: '涓婁紶',
+  //   },
+  //   extraProps: {
+  //     hide: (row: API.GetSettlementTasksQueryResultItem) =>
+  //       row.settlementOrderStatus !== EnumTaskSettlementOrderStatus.Wait,
+  //   },
+  // },
+  // {
+  //   data: {
+  //     enCode: 'reUploadBtn',
+  //     name: '閲嶆柊涓婁紶',
+  //   },
+  //   extraProps: {
+  //     hide: (row: API.GetSettlementTasksQueryResultItem) =>
+  //       !(
+  //         row.settlementOrderStatus === EnumTaskSettlementOrderStatus.Completed &&
+  //         row.settlementStatus === EnumTaskSettlementStatus.Wait
+  //       ),
+  //   },
+  // },
   {
     data: {
       enCode: 'settleBtn',
       name: '缁撶畻',
     },
     emits: {
-      onClick: (role: API.GetSettlementTasksQueryResultItem) => openSettleDialog(role),
+      onClick: (role: API.GetSettlementTasksQueryResultItem) => goDetail(role, 'settlement'),
     },
     extraProps: {
       hide: (role: API.GetSettlementTasksQueryResultItem) =>
@@ -185,7 +187,7 @@
       name: '璇︽儏',
     },
     emits: {
-      onClick: (role: API.GetSettlementTasksQueryResultItem) => goDetail(role.id),
+      onClick: (role: API.GetSettlementTasksQueryResultItem) => goDetail(role),
     },
     extraProps: {
       hide: (role: API.GetSettlementTasksQueryResultItem) =>
@@ -201,12 +203,14 @@
       onClick: (role) => handleExport(role),
     },
     extraProps: {
-      hide: () => false,
+      hide: () => true,
     },
   },
 ]);
 
 const router = useRouter();
+
+const { userDetail } = useUser();
 
 const eventContext = useGlobalEventContext();
 
@@ -288,8 +292,7 @@
 });
 
 async function handleAddOrEdit() {
-  console.log('editForm: ', editForm);
-  goDetail(editForm.id, editForm.settlementUrl[0]?.path);
+  goSettlementDetail(editForm.id, editForm.settlementUrl[0]?.path);
 }
 
 const {
@@ -312,13 +315,31 @@
     let params: API.SureTaskSettlementCommand = {
       taskInfoId: settleEditForm.id,
     };
-    let res = await taskServices.sureTaskSettlement(params);
+    let res = await taskServices.sureTaskSettlement(params, {
+      skipErrorHandler: true,
+    });
     if (res) {
       Message.successMessage('鎿嶄綔鎴愬姛');
       getList(paginationState.pageIndex);
     }
-  } catch (error) {}
+  } catch (error) {
+    if (error?.info?.errorCode == 's510') {
+      handleRechargeAdd();
+    }
+  }
 }
+
+const {
+  dialogProps: dialogRechargeProps,
+  handleAdd: handleRechargeAdd,
+  editForm: rechargeEditForm,
+} = useFormDialog({
+  defaultFormParams: {
+    access: EnumEnterpriseWalletAccess.Alipay,
+    amount: null as number,
+    remark: '',
+  },
+});
 
 function openSettleDialog(row: API.GetSettlementTasksQueryResultItem) {
   handleSettleEdit({
@@ -349,11 +370,11 @@
   row: API.GetSettlementTasksQueryResultItem
 ) {
   if (response.path) {
-    goDetail(row.id, response.path);
+    goSettlementDetail(row.id, response.path);
   }
 }
 
-async function goDetail(id: string, url?: string) {
+async function goSettlementDetail(id: string, url?: string) {
   await router.push({
     name: 'ServiceChargeDetail',
     params: {
@@ -366,6 +387,18 @@
   editForm.settlementUrl = [] as UploadUserFile[];
 }
 
+function goDetail(row: API.GetSettlementTasksQueryResultItem, settlement?: string) {
+  router.push({
+    name: 'ServiceChargeDetail',
+    params: {
+      id: row?.id ?? '',
+    },
+    query: {
+      settlement: settlement ? settlement : '',
+    },
+  });
+}
+
 function handleExport(val) {
   console.log('val: ', val);
 }

--
Gitblit v1.9.1