From 115bc268902a9899d7d159133c2ba693eddfe00d Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期二, 03 十一月 2026 17:58:50 +0800
Subject: [PATCH] 完善门户与会员审批交互

---
 src/views/ums/application/detail/approve/index.vue |   49 ++++++++++++++++++++++++++++++++-----------------
 1 files changed, 32 insertions(+), 17 deletions(-)

diff --git a/src/views/ums/application/detail/approve/index.vue b/src/views/ums/application/detail/approve/index.vue
index e4edc48..31a5d43 100644
--- a/src/views/ums/application/detail/approve/index.vue
+++ b/src/views/ums/application/detail/approve/index.vue
@@ -8,13 +8,13 @@
 import { DICT_TYPE } from '@vben/constants';
 import { formatDateTime } from '@vben/utils';
 
-import { Alert, Spin } from 'ant-design-vue';
+import { Alert, Button, Select, Spin, message } from 'ant-design-vue';
 
-import { getApplication } from '#/api/ums/application';
+import { canConfirmApplicationFee, confirmApplicationFee, getApplication } from '#/api/ums/application';
 import { DictTag } from '#/components/dict-tag';
 import { useDescription } from '#/components/description';
 
-import { ApplicationStatus, MemberType } from '../../data';
+import { ApplicationStatus, MemberType, getApplicationGradeLabel } from '../../data';
 
 defineOptions({ name: 'UmsApplicationApproveDetail' });
 
@@ -22,17 +22,13 @@
 
 const loading = ref(false);
 const formData = ref<UmsApplicationApi.Application>();
+const canConfirmFee = ref(false);
+const selectedFee = ref<boolean | undefined>();
+const savingFee = ref(false);
 
 /** 鏂囨湰瀛楁绌哄�煎崰浣� */
 function textRender(val: unknown) {
   return val === 0 || val ? String(val) : '-';
-}
-
-/** 鐢宠绛夌骇锛氭寜浼氬憳绫诲瀷鍙栦釜浜�/鍗曚綅涓嶅悓鐨勭瓑绾у瓧鍏� */
-function getGradeDictType(memberType?: number) {
-  return memberType === MemberType.UNIT
-    ? DICT_TYPE.UMS_UNIT_GRADE
-    : DICT_TYPE.UMS_PERSONAL_GRADE;
 }
 
 const [Descriptions] = useDescription({
@@ -50,12 +46,9 @@
     {
       label: '鐢宠绛夌骇',
       field: 'memberGrade',
-      render: (val, data) =>
-        h(DictTag, {
-          type: getGradeDictType(data?.memberType),
-          value: val,
-        }),
+      render: (val, data) => getApplicationGradeLabel(data?.memberType, val as string),
     },
+    { label: '鏄惁缂磋垂', field: 'feePaid', render: (val) => val == null ? '鏈褰�' : val ? '宸茬即' : '鏈即' },
     {
       label: '鐘舵��',
       field: 'status',
@@ -121,7 +114,7 @@
   if (status === ApplicationStatus.APPROVING) {
     return {
       type: 'warning' as const,
-      message: `瀹℃壒閫氳繃鍚庡皢鑷姩涓虹敵璇蜂汉鍒涘缓绯荤粺鐧诲綍璐﹀彿锛堢敤鎴峰悕涓庡垵濮嬪瘑鐮佸潎涓鸿仈绯荤數璇� ${phone || '鏈~鍐�'}锛夛紝璇峰厛鏍稿鑱旂郴鐢佃瘽鏄惁鍑嗙‘鍚庡啀閫氳繃銆俙,
+      message: '瀹℃壒閫氳繃鍚庡皢鑷姩涓虹敵璇蜂汉鍒涘缓璐﹀彿銆傝鍏堟牳瀹炵即璐圭姸鎬侊紝鍐嶆墽琛屽鎵广��',
     };
   }
   if (status === ApplicationStatus.APPROVED) {
@@ -129,7 +122,7 @@
       return {
         type: 'warning' as const,
         message:
-          '鏈~鍐欒仈绯荤數璇濓紝璐﹀彿鐢ㄦ埛鍚�/瀵嗙爜浣跨敤浜嗗厹搴曞�� unknown锛岃鍒颁細鍛樺垪琛ㄦ牳瀹炲苟鎵嬪伐淇銆�',
+          '鏈幏鍙栧埌鎵嬫満鍙凤紝宸插垱寤洪殢鏈鸿处鍙凤紝浼氬憳鍙娇鐢ㄤ紒涓氬井淇℃壂鐮佺櫥褰曞苟璁剧疆瀵嗙爜銆�',
       };
     }
     return {
@@ -144,10 +137,24 @@
   try {
     loading.value = true;
     formData.value = await getApplication(Number(props.id));
+    if (formData.value?.status === ApplicationStatus.APPROVING) {
+      canConfirmFee.value = await canConfirmApplicationFee(Number(props.id));
+      selectedFee.value = formData.value.feePaid ?? undefined;
+    }
   } finally {
     loading.value = false;
   }
 });
+
+async function saveFee() {
+  if (selectedFee.value === undefined) { message.warning('璇烽�夋嫨宸茬即璐规垨鏈即璐�'); return; }
+  savingFee.value = true;
+  try {
+    await confirmApplicationFee(Number(props.id), selectedFee.value);
+    if (formData.value) formData.value.feePaid = selectedFee.value;
+    message.success('缂磋垂鐘舵�佸凡纭锛屽彲浠ョ户缁鎵�');
+  } finally { savingFee.value = false; }
+}
 </script>
 
 <template>
@@ -161,6 +168,14 @@
           :message="credentialTip.message"
           show-icon
         />
+        <div v-if="canConfirmFee" class="rounded-lg border border-border bg-background p-4">
+          <div class="mb-2 font-semibold">纭浼氳垂缂寸撼鎯呭喌</div>
+          <div class="flex flex-wrap items-center gap-3">
+            <Select v-model:value="selectedFee" placeholder="璇烽�夋嫨缂磋垂鐘舵��" class="w-40"
+              :options="[{ label: '宸茬即璐�', value: true }, { label: '鏈即璐�', value: false }]" />
+            <Button type="primary" :loading="savingFee" @click="saveFee">纭缂磋垂鐘舵��</Button>
+          </div>
+        </div>
         <!-- 鍏ヤ細鐢宠鍩烘湰淇℃伅 -->
         <div class="rounded-lg border border-border bg-background p-4">
           <div class="mb-4 flex items-center gap-2">

--
Gitblit v1.9.3