From 39b2b67a94947f5dca9fa52ae4a2e561bf3e2576 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期二, 03 三月 2026 09:50:27 +0800
Subject: [PATCH] 公司 1.商机管理添加字段合同金额与付款描述字段,以及其他字段优化修改

---
 src/views/salesManagement/opportunityManagement/fileList.vue |   36 ++++++++++++++++++++++++++++++++++--
 1 files changed, 34 insertions(+), 2 deletions(-)

diff --git a/src/views/salesManagement/opportunityManagement/fileList.vue b/src/views/salesManagement/opportunityManagement/fileList.vue
index 025218d..51e3d15 100644
--- a/src/views/salesManagement/opportunityManagement/fileList.vue
+++ b/src/views/salesManagement/opportunityManagement/fileList.vue
@@ -2,10 +2,11 @@
   <el-dialog v-model="dialogVisible" title="闄勪欢" width="40%" :before-close="handleClose">
     <el-table :data="tableData" border height="40vh" stripe>
       <el-table-column label="闄勪欢鍚嶇О" prop="name" min-width="400" show-overflow-tooltip />
-      <el-table-column fixed="right" label="鎿嶄綔" width="100" align="center">
+      <el-table-column fixed="right" label="鎿嶄綔" width="150" align="center">
         <template #default="scope">
           <el-button link type="primary" size="small" @click="downLoadFile(scope.row)">涓嬭浇</el-button>
           <el-button link type="primary" size="small" @click="lookFile(scope.row)">棰勮</el-button>
+          <el-button link type="primary" size="small" @click="delFile(scope.row)">鍒犻櫎</el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -16,17 +17,24 @@
 <script setup>
 import { ref, getCurrentInstance } from 'vue'
 import filePreview from '@/components/filePreview/index.vue'
+import { ElMessageBox } from 'element-plus'
+import {
+  delLedgerFile
+} from "@/api/salesManagement/salesLedger.js";
 
+const emit = defineEmits(['refresh'])
 const dialogVisible = ref(false)
 const tableData = ref([])
+const currentRowId = ref(null)
 const { proxy } = getCurrentInstance();
 const filePreviewRef = ref()
 const handleClose = () => {
   dialogVisible.value = false
 }
-const open = (list) => {
+const open = (list, rowId = null) => {
   dialogVisible.value = true
   tableData.value = list
+  currentRowId.value = rowId
 }
 const downLoadFile = (row) => {
   proxy.$download.name(row.url);
@@ -35,6 +43,30 @@
 const lookFile = (row) => {
   filePreviewRef.value.open(row.url)
 }
+const delFile = (row) => {
+  ElMessageBox.confirm('纭畾瑕佸垹闄よ闄勪欢鍚楋紵', '鍒犻櫎纭', {
+    confirmButtonText: '纭畾',
+    cancelButtonText: '鍙栨秷',
+    type: 'warning',
+  }).then(() => {
+    let ids = [];
+    ids.push(row.id);
+    delLedgerFile(ids).then((res) => {
+      if (res.code === 200) {
+        proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+        // 閫氱煡鐖剁粍浠跺埛鏂版暟鎹�
+        emit('refresh', currentRowId.value);
+      } else {
+        proxy.$modal.msgError(res.msg || "鍒犻櫎澶辫触");
+      }
+    }).catch((error) => {
+      console.error("鍒犻櫎闄勪欢澶辫触:", error);
+      proxy.$modal.msgError("鍒犻櫎澶辫触锛岃绋嶅悗閲嶈瘯");
+    });
+  }).catch(() => {
+    // 鐢ㄦ埛鍙栨秷鍒犻櫎
+  });
+}
 defineExpose({
   open
 })

--
Gitblit v1.9.3