Crunchy
2025-04-29 e5454b769d44a34af423bf87ac8a740bf8c20341
src/views/business/unpass/components/unPassDialog.vue
@@ -62,7 +62,7 @@
          </el-form-item>
        </el-form>
        <el-upload v-if="type === 'add'" ref="upload" :action="action2" :on-change="beforeUpload" :on-error="onError"
          :on-remove="handleRemoveFile" :on-success="getUnpassUrl" :headers="headers" :file-list="unPassFilesList">
          :on-remove="handleRemoveFile" :on-success="getUnpassUrl" :headers="uploadHeader" :file-list="unPassFilesList">
          <el-button size="small" type="primary" style="text-align: left">附件上传</el-button>
        </el-upload>
        <div v-if="type !== 'add'">
@@ -84,6 +84,7 @@
<script>
import { getInsOrder, getUnqualifiedHandler, downFile, addUnqualifiedHandler } from '@/api/business/unpass.js'
import {mapGetters} from "vuex";
export default {
  name: "unPassDialog",
  // import 引入的组件需要注入到对象中才能使用
@@ -148,17 +149,17 @@
          orderId: this.orderId
        }).then(res => {
          if (res.code === 200) {
            this.unPassForm.headline = `No.0005-中天装备电线-外购品不合格反馈评审及纠正预防流程(正式版)-${JSON.parse(localStorage.getItem("user")).name}-${new Date().toISOString().substring(0, 10)}` // 标题
            this.unPassForm.inventoryQuantityId = res.data.insOrderTemplate.inventoryQuantityId // 原材料id
            this.unPassForm.headline = `No.0005-中天装备电线-外购品不合格反馈评审及纠正预防流程(正式版)-${this.nickName}-${new Date().toISOString().substring(0, 10)}` // 标题
            this.unPassForm.feedbackTime = new Date().toISOString().substring(0, 10) // 报检时间
            this.unPassForm.feedbackUser = this.nickName // 反馈人
            this.unPassForm.insOrderId = res.data.insOrder.id // 订单id
            this.unPassForm.supplierName = res.data.insOrderTemplate.supplierName // 供应商名称
            this.unPassForm.materialName = res.data.insOrder.sampleType // 物料名称
            this.unPassForm.specsModels = res.data.insOrder.partDetail // 规格型号
            this.unPassForm.inventoryQuantityId = res.data.insOrderTemplate.inventoryQuantityId // 原材料id
            this.unPassForm.supplierName = res.data.insOrderTemplate.supplierName // 供应商名称
            this.unPassForm.productionBatch = res.data.insOrderTemplate.updateBatchNo // 生产批次
            this.unPassForm.cargoQuantity = res.data.insOrderTemplate.qtyArrived + res.data.insOrderTemplate.buyUnitMeas // 到货数量
            this.unPassForm.specsModels = res.data.insOrder.partDetail // 规格型号
            this.unPassForm.inspectTime = res.data.insOrderTemplate.sendTime.substring(0, 10)  // 报检时间
            this.unPassForm.feedbackTime = new Date().toISOString().substring(0, 10) // 报检时间
            this.unPassForm.feedbackUser = JSON.parse(localStorage.getItem("user")).name // 反馈人
          }
        })
      } else {
@@ -179,16 +180,7 @@
      downFile({
        id: row.id,
      }).then(res => {
        if (res.code === 200) {
          let url = '';
          if (res.data.type == 1) {
            url = this.javaApi + '/img/' + res.data.fileUrl
            this.$download.saveAs(url, row.fileName);
          } else {
            url = this.javaApi + '/word/' + res.data.fileUrl
            this.$download.saveAs(url, row.fileName);
          }
        }
        this.$download.saveAs(res.data.fileUrl, row.fileName);
      }).catch(error => {
      })
@@ -256,11 +248,7 @@
    },
  },
  computed: {
    headers() {
      return {
        'token': sessionStorage.getItem('token')
      }
    },
    ...mapGetters(["nickName"]),
    action2() {
      return this.javaApi + '/unqualifiedHandler/uploadFileByUnqualified'
    }