gaoluyang
昨天 fcadf16afa65a8a5ca53a33c4b8f4bf2efe2ea03
Merge remote-tracking branch 'origin/dev_新疆_新聚' into dev_新疆_新聚
已修改3个文件
42 ■■■■ 文件已修改
src/api/business/insReport.js 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/business/inspectionView/index.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/business/reportPreparation/index.vue 29 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/business/insReport.js
@@ -25,6 +25,16 @@
    params: query
  })
}
// 单份报告下载
export function downloadReport(id) {
  return request({
    url: '/insReport/download',
    method: 'get',
    params: { id },
    responseType: 'blob'
  })
}
// 报告退回到检验任务
export function sendBackTask(query) {
  return request({
src/views/business/inspectionView/index.vue
@@ -2029,7 +2029,7 @@
    openAddVerifyDia() {
      this.addVerifyDia = true;
    },
    submit() {
    async submit() {
      if (this.verifyUser === null || this.verifyUser === "") {
        this.$message.error("请指定复核人员");
        return;
@@ -2042,6 +2042,7 @@
        this.$message.error("请输入温度");
        return;
      }
      await this.waitForPendingSaves();
      this.submitLoading = true;
      checkSubmitPlan({
        orderId: this.orderId,
src/views/business/reportPreparation/index.vue
@@ -72,7 +72,8 @@
              <el-button link type="text" size="small">更多</el-button>
            </template>
            <div>
              <el-button style="margin-left: 10px" type="text" size="small" @click="download(scope.row)">下载</el-button>
              <el-button style="margin-left: 10px" type="text" size="small"
                :disabled="!scope.row.url && !scope.row.urlS" @click="download(scope.row)">下载</el-button>
              <el-button type="text" size="small" @click="viewInspectInfo(scope.row)">原始记录</el-button>
              <el-button type="text" size="small" @click="handleFileLook(scope.row)">附件上传</el-button>
            </div>
@@ -210,6 +211,7 @@
// import ShowInfo from "../do/b1-material-ins-order/showInfo.vue";
import {
  downAll,
  downloadReport,
  examineReport,
  pageInsReport,
  ratifyReport,
@@ -754,12 +756,25 @@
      }
    },
    download(row) {
      let url = row.urlS ? row.urlS : row.url;
      const link = document.createElement('a');
      link.href = this.javaApi + url;
      link.target = '_blank';
      document.body.appendChild(link);
      link.click();
      downloadReport(row.id).then(res => {
        if (res.type && res.type.includes('application/json')) {
          const reader = new FileReader()
          reader.onload = () => {
            try {
              this.$message.error(JSON.parse(reader.result).msg || '报告下载失败')
            } catch (e) {
              this.$message.error('报告下载失败')
            }
          }
          reader.readAsText(res)
          return
        }
        const reportUrl = row.urlS || row.url || ''
        const filename = decodeURIComponent(reportUrl.substring(reportUrl.lastIndexOf('/') + 1)) || `${row.code}.docx`
        this.$download.saveAs(res, filename)
      }).catch(() => {
        this.$message.error('报告下载失败')
      })
    },
    // 还原操作
    handleRestore(row) {