From a567edf28abb00581c93b27405ed9657b63a8bd7 Mon Sep 17 00:00:00 2001
From: yyb <995253665@qq.com>
Date: 星期二, 19 五月 2026 13:32:17 +0800
Subject: [PATCH] 模板类型设置
---
src/views/financialManagement/assets/intangibleAssets.vue | 37 +++++++++++++++++++++++++++++++------
1 files changed, 31 insertions(+), 6 deletions(-)
diff --git a/src/views/financialManagement/assets/intangibleAssets.vue b/src/views/financialManagement/assets/intangibleAssets.vue
index 649ec5b..4642166 100644
--- a/src/views/financialManagement/assets/intangibleAssets.vue
+++ b/src/views/financialManagement/assets/intangibleAssets.vue
@@ -39,11 +39,12 @@
<div>
<el-button type="primary" @click="add" icon="Plus">鏂板璧勪骇</el-button>
<el-button type="warning" @click="handleAmortization" icon="Money">鎽婇攢璁℃彁</el-button>
- <el-button @click="handleOut" icon="Download">瀵煎嚭</el-button>
+ <!-- <el-button @click="handleOut" icon="Download">瀵煎嚭</el-button> -->
</div>
</div>
<PIMTable
rowKey="id"
+ isSelection
:column="columns"
:tableData="dataList"
:page="{
@@ -51,6 +52,7 @@
size: pagination.pageSize,
total: pagination.total,
}"
+ @selection-change="handleSelectionChange"
@pagination="changePage"
>
<template #originalValue="{ row }">
@@ -77,7 +79,7 @@
</div>
<FormDialog :title="dialogTitle" v-model="dialogVisible" width="800px" @confirm="submitForm" @cancel="dialogVisible = false">
- <el-form :model="form" :rules="rules" ref="formRef" label-width="120px">
+ <el-form :model="form" :rules="rules" :disabled="isView" ref="formRef" label-width="120px">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="璧勪骇缂栧彿" prop="assetCode">
@@ -171,7 +173,7 @@
</el-form-item>
</el-form>
<template #footer>
- <el-button type="primary" @click="submitForm">纭畾</el-button>
+ <el-button v-if="!isView" type="primary" @click="submitForm">纭畾</el-button>
<el-button @click="dialogVisible = false">鍙栨秷</el-button>
</template>
</FormDialog>
@@ -220,11 +222,18 @@
];
const dataList = ref([]);
+const multipleList = ref([]);
const dialogVisible = ref(false);
const dialogTitle = ref("");
const formRef = ref(null);
const isEdit = ref(false);
+const isView = ref(false);
const currentId = ref(null);
+const selectedIds = computed(() =>
+ multipleList.value
+ .map(item => item?.id)
+ .filter(id => id !== undefined && id !== null && id !== "")
+);
const createDefaultForm = () => ({
assetCode: "",
@@ -319,10 +328,15 @@
status: filters.status,
});
dataList.value = data?.records || [];
+ multipleList.value = [];
pagination.total = Number(data?.total || 0);
} catch (error) {
// 鎻愮ず鐢卞叏灞�璇锋眰鎷︽埅鍣ㄥ鐞嗭紝杩欓噷浠呴槻姝㈡湭鎹曡幏寮傚父
}
+};
+
+const handleSelectionChange = (selectionList) => {
+ multipleList.value = selectionList;
};
const resetFilters = () => {
@@ -344,6 +358,7 @@
const add = () => {
isEdit.value = false;
+ isView.value = false;
currentId.value = null;
dialogTitle.value = "鏂板鏃犲舰璧勪骇";
Object.assign(form, createDefaultForm(), {
@@ -355,6 +370,7 @@
const edit = (row) => {
isEdit.value = true;
+ isView.value = false;
currentId.value = row.id;
dialogTitle.value = "缂栬緫鏃犲舰璧勪骇";
Object.assign(form, createDefaultForm(), row);
@@ -362,7 +378,8 @@
};
const view = (row) => {
- ElMessage.info(`鏌ョ湅璧勪骇: ${row.assetName}`);
+ edit(row);
+ isView.value = true;
};
const handleDelete = (row) => {
@@ -382,12 +399,16 @@
};
const handleAmortization = () => {
- ElMessageBox.confirm("纭杩涜鏈湀鎽婇攢璁℃彁鍚楋紵", "鎻愮ず", {
+ const ids = selectedIds.value;
+ const confirmText = ids.length
+ ? `纭瀵归�変腑鐨� ${ids.length} 鏉¤祫浜ц繘琛屾湰鏈堟憡閿�璁℃彁鍚楋紵`
+ : "纭杩涜鏈湀鎽婇攢璁℃彁鍚楋紵";
+ ElMessageBox.confirm(confirmText, "鎻愮ず", {
confirmButtonText: "纭",
cancelButtonText: "鍙栨秷",
type: "info",
}).then(async () => {
- await amortizeIntangibleAsset({});
+ await amortizeIntangibleAsset({ ids });
ElMessage.success("鎽婇攢璁℃彁瀹屾垚");
await getTableData();
});
@@ -398,6 +419,10 @@
};
const submitForm = () => {
+ if (isView.value) {
+ dialogVisible.value = false;
+ return;
+ }
formRef.value.validate(async valid => {
if (valid) {
try {
--
Gitblit v1.9.3