张诺
12 小时以前 2d9b1755730f5fbd4f91f9efb789659acbe48d7e
feat(销售报价): 添加附件删除功能并修复文件ID提交问题

- 新增销售报价附件删除API接口
- 将附件删除功能从销售台账模块迁移至销售报价模块
- 修复编辑报价时附件ID未提交的问题,确保文件关联正确
已修改2个文件
16 ■■■■ 文件已修改
src/api/salesManagement/salesQuotation.js 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/salesManagement/salesQuotation/index.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/salesManagement/salesQuotation.js
@@ -110,3 +110,13 @@
    responseType: "blob",
  });
}
// 删除文件
// salesQuotationFile/del
export function deleteFile(data) {
  return request({
    url: "/salesQuotationFile/del",
    method: "delete",
    data: data,
  });
}
src/views/salesManagement/salesQuotation/index.vue
@@ -407,7 +407,7 @@
import { Search, Document, UserFilled, Box, EditPen, Plus, ArrowRight, Delete, Paperclip, View, Download } from '@element-plus/icons-vue'
import Pagination from '@/components/PIMTable/Pagination.vue'
import FormDialog from '@/components/Dialog/FormDialog.vue'
import {getQuotationList,addQuotation,updateQuotation,deleteQuotation} from '@/api/salesManagement/salesQuotation.js'
import {getQuotationList,addQuotation,updateQuotation,deleteQuotation,deleteFile} from '@/api/salesManagement/salesQuotation.js'
import {userListNoPage} from "@/api/system/user.js";
import { customerList, delLedgerFile } from "@/api/salesManagement/salesLedger.js";
import {modelList, productTreeList} from "@/api/basicData/product.js";
@@ -893,7 +893,7 @@
function handleRemove(file) {
  if (!isEdit.value) return
  if (!file?.id) return
  delLedgerFile([file.id]).then((res) => {
  deleteFile([file.id]).then((res) => {
    if (res?.code === 200) {
      ElMessage.success("删除成功")
    } else {
@@ -939,6 +939,7 @@
      form.approveUserIds = approverNodes.value.map(node => node.userId).join(',')
      form.files = fileList.value.map(f => ({
        id: f.id,
        tempId: f.tempId,
        name: f.name,
        url: f.url,
@@ -950,7 +951,6 @@
        const price = Number(product.unitPrice) || 0
        return sum + price
      }, 0)
      if (isEdit.value) {
        // 编辑
        const index = quotationList.value.findIndex(item => item.id === editId.value)