huminmin
2026-05-12 dea4fd4af1fb436666c3db38535a21aa448339f7
Merge branch 'dev_NEW_pro' of http://114.132.189.42:9002/r/product-inventory-management into dev_西宁_青铝绿行
已修改23个文件
114 ■■■■ 文件已修改
src/components/Dialog/FileList.vue 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/filePreview/index.vue 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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/components/Dialog/FileList.vue
@@ -36,9 +36,16 @@
        <el-table-column v-if="showActions"
                         fixed="right"
                         label="操作"
                         :width="120"
                         :width="150"
                         align="center">
          <template #default="scope">
            <el-button link
                       type="primary"
                       size="small"
                       class="download-link"
                       @click="previewFile(scope.row.previewURL)">
              预览
            </el-button>
            <el-button link
                       type="primary"
                       size="small"
@@ -58,9 +65,11 @@
      </el-table>
    </div>
  </el-dialog>
  <filePreview ref="filePreviewRef" />
</template>
<script setup>
import { ElMessage } from 'element-plus'
  import { ref, computed, getCurrentInstance, onMounted, watch } from "vue";
  import AttachmentUpload from "@/components/AttachmentUpload/file/index.vue";
  import {
@@ -68,6 +77,8 @@
    deleteAttachment,
    createAttachment,
  } from "@/api/basicData/storageAttachment.js";
  import filePreview from '@/components/filePreview/index.vue'
  const filePreviewRef = ref()
  const props = defineProps({
    visible: {
@@ -122,6 +133,15 @@
    isShow.value = false;
  };
  // 预览文件
  const previewFile = (url) => {
    if (url) {
      filePreviewRef.value.open(url)
    } else {
      ElMessage.warning('文件地址无效,无法预览')
    }
  }
  const handleUpload = () => {
    uploadDialogVisible.value = true;
  };
src/components/filePreview/index.vue
@@ -78,9 +78,9 @@
  transformData: (workbookData) => workbookData,
});
// 计算属性 - 判断文件类型
// 计算属性 - 判断文件类型(支持URL带查询参数)
const isImage = computed(() => {
  const state = /\.(jpg|jpeg|png|gif)$/i.test(fileUrl.value);
  const state = /\.(jpg|jpeg|png|gif)(\?.*)?$/i.test(fileUrl.value);
  if (state) {
    imgUrl.value = fileUrl.value.replaceAll('word', 'img');
  }
@@ -89,23 +89,23 @@
const isPdf = computed(() => {
  console.log(fileUrl.value)
  return /\.pdf$/i.test(fileUrl.value);
  return /\.pdf(\?.*)?$/i.test(fileUrl.value);
});
const isDoc = computed(() => {
  return /\.(doc|docx)$/i.test(fileUrl.value);
  return /\.(doc|docx)(\?.*)?$/i.test(fileUrl.value);
});
const isXls = computed(() => {
  const state = /\.(xls|xlsx)$/i.test(fileUrl.value);
  const state = /\.(xls|xlsx)(\?.*)?$/i.test(fileUrl.value);
  if (state) {
    options.value.xls = /\.(xls)$/i.test(fileUrl.value);
    options.value.xls = /\.(xls)(\?.*)?$/i.test(fileUrl.value);
  }
  return state;
});
const isZipOrRar = computed(() => {
  return /\.(zip|rar)$/i.test(fileUrl.value);
  return /\.(zip|rar)(\?.*)?$/i.test(fileUrl.value);
});
const isSupported = computed(() => {
@@ -164,7 +164,7 @@
};
const open = (url) => {
  fileUrl.value = window.location.protocol+'//'+window.location.host+ url;
  fileUrl.value = url;
  dialogVisible.value = true;
};
const handleClose = () => {
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) => {