From bd2f01b77e9c3ac2885e508584c1791be9037af6 Mon Sep 17 00:00:00 2001
From: liding <756868258@qq.com>
Date: 星期六, 16 五月 2026 09:42:16 +0800
Subject: [PATCH] fix:1.生产订单bom结构更改刷新页面

---
 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