From 89fd2cf7202c321512c2ea699a3a220a7138ed44 Mon Sep 17 00:00:00 2001
From: wujianwei <wjw@11.com>
Date: 星期四, 09 四月 2026 10:40:52 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/cwxt_master' into cwxt_master
---
ui/admin-ui3/src/views/cwgl/voucherSubjectFee/index.vue | 99 +++++++++++++++++++++++++++++++++----------------
1 files changed, 67 insertions(+), 32 deletions(-)
diff --git a/ui/admin-ui3/src/views/cwgl/voucherSubjectFee/index.vue b/ui/admin-ui3/src/views/cwgl/voucherSubjectFee/index.vue
index 6710319..b601b8e 100644
--- a/ui/admin-ui3/src/views/cwgl/voucherSubjectFee/index.vue
+++ b/ui/admin-ui3/src/views/cwgl/voucherSubjectFee/index.vue
@@ -20,8 +20,8 @@
v-hasPermi="['cwgl:voucherSubjectFee:export']">瀵煎嚭
</el-button>
</template>
- <template #menu="{ row, index, size }">
-
+ <template #menu="{ row, index, size }">
+
<el-button type="text" icon="View" @click="handleFlow(row)"
v-hasPermi="['cwgl:voucherSubjectFee:flow']">鏃ュ織</el-button>
</template>
@@ -33,7 +33,7 @@
<script setup name="voucherSubjectFee" lang="ts">
import { listVoucherSubjectSetting } from "@/api/cwgl/voucherSubjectSetting";
- import { listVoucherSubjectFeeLog, } from "@/api/cwgl/voucherSubjectFeeLog";
+import { listVoucherSubjectFeeLog, } from "@/api/cwgl/voucherSubjectFeeLog";
import { VoucherSubjectFeeI, addVoucherSubjectFee, delVoucherSubjectFee, exportVoucherSubjectFee, getVoucherSubjectFee, listVoucherSubjectFee, updateVoucherSubjectFee } from "@/api/cwgl/voucherSubjectFee";
import useCurrentInstance from "@/utils/useCurrentInstance";
@@ -69,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,
@@ -89,28 +89,29 @@
},
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 && Object.keys(item).length > 0) {
- form.value.subjectCode = item.subjectCode;
- form.value.subjectType = item.subjectType;
- form.value.feeName = item.expenseName;
- }
- // 鍙湁褰撶敤鎴锋墜鍔ㄦ竻闄ら�夋嫨锛坴alue 涓虹┖锛夋椂锛屾墠娓呯┖鍏朵粬瀛楁
- else if (!value) {
- form.value.subjectCode = '';
- form.value.subjectType = '';
- form.value.feeName = '';
- }
- // 濡傛灉鏄湁 value 浣嗘病 item锛堥�氬父鏄洖鏄剧灛闂达級锛屼粈涔堥兘涓嶅仛锛屼繚鎶ゅ凡鏈夋暟鎹�
-},
+ change: ({ value, column, item }) => {
+ if (item && Object.keys(item).length > 0) {
+ form.value.subjectCode = item.subjectCode;
+ form.value.subjectType = item.subjectType;
+ form.value.feeName = item.expenseName;
+
+ // 銆愪慨鏀圭偣銆戝湪閫変腑鏃讹紝鑾峰彇闅愯棌鐨� 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" }],
},
@@ -236,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');
@@ -280,7 +315,7 @@
// 绀轰緥妯℃嫙鏁版嵁
listVoucherSubjectFeeLog({ subjectId: row.id }).then((res) => {
if (res.code == 200) {
- logModalRef.value.open(res.rows,'payable');
+ logModalRef.value.open(res.rows, 'payable');
}
});
--
Gitblit v1.8.0