From d14994e10797ce5bc0d29668d358f7c5274dcc5b Mon Sep 17 00:00:00 2001
From: wujianwei <wjw@11.com>
Date: 星期三, 15 四月 2026 15:46:17 +0800
Subject: [PATCH] 新增调用外部接口api

---
 ui/admin-ui3/src/views/cwgl/voucherSubjectFee/index.vue |  103 +++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 79 insertions(+), 24 deletions(-)

diff --git a/ui/admin-ui3/src/views/cwgl/voucherSubjectFee/index.vue b/ui/admin-ui3/src/views/cwgl/voucherSubjectFee/index.vue
index 05e01ac..b601b8e 100644
--- a/ui/admin-ui3/src/views/cwgl/voucherSubjectFee/index.vue
+++ b/ui/admin-ui3/src/views/cwgl/voucherSubjectFee/index.vue
@@ -10,22 +10,30 @@
       @search-reset="searchReset" @selection-change="selectionChange" @current-change="currentChange"
       @size-change="sizeChange" @on-load="onLoad">
       <template #menu-left>
-        <el-button type="success" icon="Edit" :disabled="pageF.single" v-hasPermi="['cwgl:voucherSubjectFee:edit']"
+        <!-- <el-button type="success" icon="Edit" :disabled="pageF.single" v-hasPermi="['cwgl:voucherSubjectFee:edit']"
           @click="handleUpdate">淇敼
         </el-button>
         <el-button type="danger" icon="Delete" :disabled="pageF.multiple" @click="handleDelete"
           v-hasPermi="['cwgl:voucherSubjectFee:remove']">鍒犻櫎
-        </el-button>
+        </el-button> -->
         <el-button type="warning" plain icon="Download" @click="handleExport"
           v-hasPermi="['cwgl:voucherSubjectFee:export']">瀵煎嚭
         </el-button>
       </template>
+      <template #menu="{ row, index, size }">
+
+        <el-button type="text" icon="View" @click="handleFlow(row)"
+          v-hasPermi="['cwgl:voucherSubjectFee:flow']">鏃ュ織</el-button>
+      </template>
     </avue-crud>
   </basicContainer>
+  <OperationLogModal ref="logModalRef" />
+
 </template>
 
 <script setup name="voucherSubjectFee" lang="ts">
 import { listVoucherSubjectSetting } from "@/api/cwgl/voucherSubjectSetting";
+import { listVoucherSubjectFeeLog, } from "@/api/cwgl/voucherSubjectFeeLog";
 
 import { VoucherSubjectFeeI, addVoucherSubjectFee, delVoucherSubjectFee, exportVoucherSubjectFee, getVoucherSubjectFee, listVoucherSubjectFee, updateVoucherSubjectFee } from "@/api/cwgl/voucherSubjectFee";
 import useCurrentInstance from "@/utils/useCurrentInstance";
@@ -33,6 +41,7 @@
 import { PagesInterface, PageQueryInterface } from "@/utils/globalInterface";
 import { usePagePlus } from "@/hooks/usePagePlus";
 import { hasPermission } from "@/utils/permissionUtils";
+import OperationLogModal from '@/components/OperationLogModal/index.vue';
 
 const { proxy } = useCurrentInstance();
 const crudRef = ref();
@@ -60,12 +69,12 @@
 const option = ref({
   pageKey: 'VoucherSubjectFee',
   rowKey: 'id',
-    viewBtn: false,
+  viewBtn: false,
   column: {
     // id: {
     //   label: 'ID',
     // },
-    accountSet: {
+    type: {
       label: '璐﹀',
       minWidth: 120,
       addDisabled: true,
@@ -80,27 +89,27 @@
     },
     subjectName: {
       label: '绉戠洰鍚嶇О',
-      type: 'select', // 濡傛灉闇�瑕佹爲褰㈠彲浠ユ敼涓� 'tree'
+      type: 'tree',
       search: true,
       props: {
-        label: 'subjectName',
-        value: 'subjectName' // 寤鸿缁戝畾 ID 浣滀负 value
+        label: 'subjectName', // 涓嬫媺鏍戦噷渚濈劧鍙樉绀哄崟鍚嶏紙濡傦細宸梾璐癸級
+        value: 'subjectName'
       },
-      // 鍏抽敭锛氱洃鍚�変腑鍊肩殑鍙樺寲
       change: ({ value, column, item }) => {
-        // item 鏄綋鍓嶉�変腑鐨勬暣琛屾暟鎹璞�
-        if (item) {
-          form.value.subjectCode = item.subjectCode; // 璧嬪�肩鐩唬鐮�
-          form.value.subjectType = item.subjectType; // 璧嬪�肩鐩被鍒�
-
-          // 娉ㄦ剰锛氳纭 listVoucherSubjectSetting 鎺ュ彛杩斿洖鐨勫璞′腑鏈� expenseName 瀛楁
-          // 濡傛灉鎺ュ彛瀛楁鍙� feeName锛屽垯鏀逛负 item.feeName
+        if (item && Object.keys(item).length > 0) {
+          form.value.subjectCode = item.subjectCode;
+          form.value.subjectType = item.subjectType;
           form.value.feeName = item.expenseName;
-        } else {
-          // 濡傛灉娓呯┖浜嗛�夋嫨锛屽垯閲嶇疆鐩稿叧瀛楁
+
+          // 銆愪慨鏀圭偣銆戝湪閫変腑鏃讹紝鑾峰彇闅愯棌鐨� fullName锛堝甫 / 鐨勫叏璺緞锛�
+          // 濡傛灉娌℃湁 fullName锛堥《绾э級锛屽垯浣跨敤鍘熷鍚嶇О
+          form.value.fullPathName = item.fullName || item.subjectName;
+        }
+        else if (!value) {
           form.value.subjectCode = '';
           form.value.subjectType = '';
           form.value.feeName = '';
+          form.value.fullPathName = '';
         }
       },
       rules: [{ required: true, message: "绉戠洰鍚嶇О涓嶈兘涓虹┖", trigger: "change" }],
@@ -228,26 +237,60 @@
       selectionList.value = selection;
     },
     // --- 鍏抽敭淇敼锛氬鐞嗗脊绐楁墦寮�鍓嶇殑閫昏緫 ---
+    // --- 鏍稿績閫昏緫 1锛氫繚瀛樺墠鎷︽埅 ---
+    // 鍦� usePagePlus 鐨勯厤缃璞′腑
+    rowSaveBegin: (row, done) => {
+      // 鎻愪氦鏃讹紝灏� subjectName 鏇挎崲涓烘垜浠湪 change 鏃舵嬁鍒扮殑鍏ㄨ矾寰�
+      if (row.fullPathName) {
+        row.subjectName = row.fullPathName;
+      }
+      delete row.fullPathName; // 娓呯悊涓存椂鍙橀噺
+      done(row);
+    },
+
+    rowUpdateBegin: (row, done) => {
+      if (row.fullPathName) {
+        row.subjectName = row.fullPathName;
+      }
+      delete row.fullPathName;
+      done(row);
+    },
+
+    // --- 鏍稿績閫昏緫 3锛氭墦寮�寮圭獥鍓嶅姞杞藉苟澶勭悊瀛楀吀 ---
     handleBeforeOpenFunc: (type: string) => {
       if (type === 'add') {
         form.value.accountSet = activeAccountSet.value;
         form.value.type = activeAccountSet.value;
       }
+
       listVoucherSubjectSetting({ type: activeAccountSet.value }).then(res => {
         const subjectNameCol = option.value.column.subjectName;
         if (subjectNameCol) {
-          // 鍋囪鎺ュ彛杩斿洖鐨勬暟鎹湪 res.data 鎴� res.rows 涓�
-          const listData = res.rows  || [];
+          const listData = res.rows || [];
 
-          // 濡傛灉浣犻渶瑕佹爲褰㈠睍绀猴紝鍙互浣跨敤 handleTree 杞崲
-          subjectNameCol.type = 'tree'; 
-          subjectNameCol.dicData = proxy.handleTree(listData, "id");
+          // 閫掑綊鍑芥暟锛氳绠楀叏璺緞锛屼娇鐢� / 鍒嗛殧
+          const injectFullPath = (list: any[], parentPath = '') => {
+            return list.map(item => {
+              // 銆愭牳蹇冧慨鏀圭偣銆戝皢鎷兼帴绗︽敼涓� /
+              const currentPath = parentPath ? `${parentPath}/${item.subjectName}` : item.subjectName;
+              const newItem = {
+                ...item,
+                fullName: currentPath // 姝ゆ椂 fullName 鏍煎紡涓� "绠$悊璐圭敤/宸梾璐�"
+              };
+              if (newItem.children && newItem.children.length > 0) {
+                newItem.children = injectFullPath(newItem.children, currentPath);
+              }
+              return newItem;
+            });
+          };
 
-      
+          const treeData = proxy.handleTree(listData, "id");
+          subjectNameCol.dicData = injectFullPath(treeData);
         }
       });
-
     },
+
+    // ... 鍏朵粬閽╁瓙濡� handleUpdateFunc, getBeginListFunc 淇濇寔涓嶅彉 ...
   })
 const activeAccountSet = ref('0');
 
@@ -265,4 +308,16 @@
   page.value.currentPage = 1;
   onLoad(page.value, nextParams);
 }
+
+const logModalRef = ref(null);
+const handleFlow = (row: any) => {
+  // 杩欓噷鍙互浠� row 涓洿鎺ヨ幏鍙栨棩蹇楋紝鎴栬�呰皟鐢ㄥ悗绔帴鍙f煡璇�
+  // 绀轰緥妯℃嫙鏁版嵁
+  listVoucherSubjectFeeLog({ subjectId: row.id }).then((res) => {
+    if (res.code == 200) {
+      logModalRef.value.open(res.rows, 'payable');
+
+    }
+  });
+}
 </script>

--
Gitblit v1.8.0