gaoluyang
2 天以前 7b21512f6cb5aaa9e53024a80e92ca877b5c4aa1
进销存pro
1.附件预览、下载修改
已修改21个文件
76 ■■■■■ 文件已修改
src/plugins/download.js 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/basicData/customerFile/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/basicData/customerFileOpenSea/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/basicData/supplierManage/filesDia.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/collaborativeApproval/approvalProcess/fileList.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/collaborativeApproval/shipmentReview/fileList.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/equipmentManagement/measurementEquipment/filesDia.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/lavorissue/ledger/filesDia.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/personnelManagement/contractManagement/filesDia.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/procurementManagement/procurementLedger/fileList.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productionManagement/workOrder/components/filesDia.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productionManagement/workOrderManagement/components/filesDia.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/projectManagement/Management/components/formDia.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/projectManagement/Management/projectDetail.vue 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/projectManagement/projectType/index.vue 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/qualityManagement/finalInspection/components/filesDia.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/qualityManagement/processInspection/components/filesDia.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/qualityManagement/rawMaterialInspection/components/filesDia.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/safeProduction/safeWorkApproval/fileList.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/salesManagement/invoiceLedger/index.vue 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/salesManagement/salesLedger/fileList.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/plugins/download.js
@@ -82,6 +82,16 @@
  saveAs(text, name, opts) {
    saveAs(text, name, opts);
  },
  byUrl(url, filename) {
    // 将URL中的preview替换成download
    const downloadUrl = url.replace(/preview/g, 'download')
    const link = document.createElement('a')
    link.href = downloadUrl
    link.download = filename || ''
    document.body.appendChild(link)
    link.click()
    document.body.removeChild(link)
  },
  async printErrMsg(data) {
    const resText = await data.text();
    const rspObj = JSON.parse(resText);
src/views/basicData/customerFile/index.vue
@@ -1413,7 +1413,7 @@
  const downloadAttachment = row => {
    if (row.url) {
      // proxy.download(row.url, {}, row.name);
      proxy.$download.name(row.url);
            proxy.$download.byUrl(row.url, row.originalFilename);
    } else {
      proxy.$modal.msgError("下载链接不存在");
    }
src/views/basicData/customerFileOpenSea/index.vue
@@ -1651,7 +1651,7 @@
  const downloadAttachment = row => {
    if (row.url) {
      // proxy.download(row.url, {}, row.name);
      proxy.$download.name(row.url);
            proxy.$download.byUrl(row.url, row.originalFilename);
    } else {
      proxy.$modal.msgError("下载链接不存在");
    }
src/views/basicData/supplierManage/filesDia.vue
@@ -164,7 +164,7 @@
}
// 下载附件
const downLoadFile = (row) => {
  proxy.$download.name(row.url);
    proxy.$download.byUrl(row.url, row.originalFilename);
}
// 删除
const handleDelete = () => {
src/views/collaborativeApproval/approvalProcess/fileList.vue
@@ -32,8 +32,7 @@
  tableData.value = list
}
const downLoadFile = (row) => {
  proxy.$download.name(row.url);
    proxy.$download.byUrl(row.url, row.originalFilename);
}
const lookFile = (row) => {
  filePreviewRef.value.open(row.url)
src/views/collaborativeApproval/shipmentReview/fileList.vue
@@ -29,8 +29,7 @@
  tableData.value = list
}
const downLoadFile = (row) => {
  proxy.$download.name(row.url);
    proxy.$download.byUrl(row.url, row.originalFilename);
}
const lookFile = (row) => {
  filePreviewRef.value.open(row.url)
src/views/equipmentManagement/measurementEquipment/filesDia.vue
@@ -157,7 +157,7 @@
}
// 下载附件
const downLoadFile = (row) => {
  proxy.$download.name(row.url);
    proxy.$download.byUrl(row.url, row.originalFilename);
}
// 删除
const handleDelete = () => {
src/views/lavorissue/ledger/filesDia.vue
@@ -163,7 +163,7 @@
}
// 下载附件
const downLoadFile = (row) => {
  proxy.$download.name(row.url);
    proxy.$download.byUrl(row.url, row.originalFilename);
}
// 删除
const handleDelete = () => {
src/views/personnelManagement/contractManagement/filesDia.vue
@@ -158,7 +158,7 @@
}
// 下载附件
const downLoadFile = (row) => {
  proxy.$download.name(row.url);
    proxy.$download.byUrl(row.url, row.originalFilename);
}
// 删除
const handleDelete = () => {
src/views/procurementManagement/procurementLedger/fileList.vue
@@ -32,8 +32,7 @@
  tableData.value = list
}
const downLoadFile = (row) => {
  proxy.$download.name(row.url);
    proxy.$download.byUrl(row.url, row.originalFilename);
}
const lookFile = (row) => {
  filePreviewRef.value.open(row.url)
src/views/productionManagement/workOrder/components/filesDia.vue
@@ -78,7 +78,7 @@
        name: "下载",
        type: "text",
        clickFun: row => {
          proxy.$download.name(row.url);
                    proxy.$download.byUrl(row.url, row.originalFilename);
        },
      },
      {
src/views/productionManagement/workOrderManagement/components/filesDia.vue
@@ -78,7 +78,7 @@
        name: "下载",
        type: "text",
        clickFun: row => {
          proxy.$download.name(row.url);
                    proxy.$download.byUrl(row.url, row.originalFilename);
        },
      },
      {
src/views/projectManagement/Management/components/formDia.vue
@@ -1342,9 +1342,9 @@
}
function downloadAttachment(att) {
  if (att?.name) {
  if (att) {
    try {
      proxy.$download.name(att.url);
            proxy.$download.byUrl(att.url, att.originalFilename);
      return
    } catch (e) {}
  }
src/views/projectManagement/Management/projectDetail.vue
@@ -364,16 +364,10 @@
  }
}
function downloadAttachment(att) {
  if (att?.url) {
function downloadAttachment(row) {
  if (row?.url) {
    try {
      proxy.$download.resource(att.url)
      return
    } catch (e) {}
  }
  if (att?.name) {
    try {
      proxy.$download.name(att.name, false)
            proxy.$download.byUrl(row.url, row.originalFilename);
      return
    } catch (e) {}
  }
src/views/projectManagement/projectType/index.vue
@@ -250,13 +250,8 @@
}
/** 下载附件 */
function handleDownload(attachment) {
  const url = attachment?.url || attachment?.fileUrl || attachment?.tempPath || attachment?.fileName;
  if (!url) {
    ElMessage.warning("未找到可下载的文件地址");
    return;
  }
  proxy.$download.name(url);
function handleDownload(row) {
    proxy.$download.byUrl(row.url, row.originalFilename);
}
onMounted(() => {
src/views/qualityManagement/finalInspection/components/filesDia.vue
@@ -120,7 +120,7 @@
};
// 下载附件
const downLoadFile = (row) => {
  proxy.$download.name(row.url);
    proxy.$download.byUrl(row.url, row.originalFilename);
}
// 关闭弹框
const closeDia = () => {
src/views/qualityManagement/processInspection/components/filesDia.vue
@@ -124,7 +124,7 @@
};
// 下载附件
const downLoadFile = (row) => {
  proxy.$download.name(row.url);
    proxy.$download.byUrl(row.url, row.originalFilename);
}
// 关闭弹框
const closeDia = () => {
src/views/qualityManagement/rawMaterialInspection/components/filesDia.vue
@@ -153,7 +153,7 @@
}
// 下载附件
const downLoadFile = (row) => {
  proxy.$download.name(row.url);
    proxy.$download.byUrl(row.url, row.originalFilename);
}
// 预览附件
const lookFile = (row) => {
src/views/safeProduction/safeWorkApproval/fileList.vue
@@ -32,7 +32,7 @@
  tableData.value = list
}
const downLoadFile = (row) => {
  proxy.$download.name(row.url);
    proxy.$download.byUrl(row.url, row.originalFilename);
}
const lookFile = (row) => {
src/views/salesManagement/invoiceLedger/index.vue
@@ -409,12 +409,6 @@
  }
};
const handleFile = (commonFiles) => {
  commonFiles.forEach((e) => {
    proxy.$download.name(e.url);
  });
};
const clearRange = () => {
  searchForm.invoiceDate = [];
  searchForm.invoiceDateStart = undefined;
src/views/salesManagement/salesLedger/fileList.vue
@@ -29,7 +29,7 @@
  tableData.value = list
}
const downLoadFile = (row) => {
  proxy.$download.name(row.url);
    proxy.$download.byUrl(row.url, row.originalFilename);
}
const lookFile = (row) => {