zhuo
2025-05-20 7eb190f13437b2e67788e9f4bdea725fdb165f01
src/views/CNAS/process/ensureResults/ensureResultsValidity/index.vue
@@ -2,18 +2,19 @@
  <!--  7.7质量监控计划-->
  <div class="app-container">
    <div class="table-card">
      <div style="display: flex;justify-content: space-between;">
        <el-form :model="yearForm" ref="yearForm" size="small" :inline="true">
          <el-form-item label="计划名称" prop="monitorName">
      <div style="display: flex;justify-content: space-between">
        <div style="display: flex;">
          <div style="margin-bottom: 18px;margin-right: 10px;display: flex;align-items: center;line-height: 32px;">
            <span style="width: 88px;font-size: 14px;font-weight: 700;color: #606266;">计划名称</span>
            <el-input size="small" placeholder="请输入" clearable v-model="yearForm.monitorName"
              @keyup.enter.native="getYearPlanList"></el-input>
          </el-form-item>
          <el-form-item>
                      @keyup.enter.native="getYearPlanList"></el-input>
          </div>
          <div style="line-height: 30px;">
            <el-button type="primary" size="mini" @click="getYearPlanList">查询</el-button>
            <el-button size="mini" @click="clearYear">重置</el-button>
          </el-form-item>
        </el-form>
        <div>
          </div>
        </div>
        <div style="line-height: 30px;">
          <el-button size="small" type="primary" @click="leadInto">导入</el-button>
        </div>
      </div>
@@ -21,20 +22,25 @@
                  :height="'calc(100vh - 34em)'" @pagination="pagination" :rowClick="rowClick" key="yearTableData"></lims-table>
    </div>
    <div style="margin-top: 20px">
      <div style="display: flex;justify-content: space-between;">
        <el-form :model="yearDetailForm" ref="yearDetailForm" size="small" :inline="true">
          <el-form-item label="监控目的" prop="monitorPurpose">
            <el-input v-model="yearDetailForm.monitorPurpose" placeholder="请输入" size="small"></el-input>
          </el-form-item>
          <el-form-item label="监控项目" prop="monitorProject">
            <el-input v-model="yearDetailForm.monitorProject" placeholder="请输入" size="small"></el-input>
          </el-form-item>
          <el-form-item>
      <div style="display: flex;justify-content: space-between">
        <div style="display: flex;">
          <div style="margin-bottom: 18px;margin-right: 10px;display: flex;align-items: center;line-height: 32px;">
            <span style="width: 88px;font-size: 14px;font-weight: 700;color: #606266;">监控目的</span>
            <el-input v-model="yearDetailForm.monitorPurpose" placeholder="请输入" size="small"
                      @keyup.enter.native="getYearDetailPlanList"></el-input>
          </div>
          <div style="margin-bottom: 18px;margin-right: 10px;display: flex;align-items: center;line-height: 32px;">
            <span style="width: 88px;font-size: 14px;font-weight: 700;color: #606266;">监控项目</span>
            <el-input v-model="yearDetailForm.monitorProject" placeholder="请输入" size="small"
                      @keyup.enter.native="getYearDetailPlanList"></el-input>
          </div>
          <div style="line-height: 30px;">
            <el-button type="primary" size="mini" @click="getYearDetailPlanList">查询</el-button>
            <el-button size="mini" @click="clearDetail">重置</el-button>
          </el-form-item>
        </el-form>
        <div>
          </div>
        </div>
        <div style="line-height: 30px;">
          <el-button size="small" type="primary" @click="exportSignatureTemplate">导出签名模板</el-button>
          <el-button size="small" type="primary" @click="showDialog('add')">新增</el-button>
        </div>
      </div>
@@ -79,7 +85,7 @@
    </el-dialog>
    <!--预览报告-->
    <el-dialog :visible.sync="lookDialogVisible" fullscreen title="查看附件" top="5vh" width="800px">
      <filePreview v-if="lookDialogVisible" :currentFile="{}"
      <filePreview v-if="lookDialogVisible" :currentFile="{}" :option="option"
        :fileUrl="javaApi + '/word/' + currentInfo.finishReportUrl" style="height: 70vh;overflow-y: auto;" />
      <div>
        批准状态:
@@ -97,9 +103,11 @@
    </el-dialog>
    <el-dialog :visible.sync="downloadDialog" title="导出" width="600px">
      <span>
        <el-button plain type="primary" :disabled="!download.qualityMonitorDetailsId"
        <el-button plain type="primary" :disabled="download.detailsRatifyStatus !== 3"
          @click="controlDown">实施计划导出</el-button>
        <el-button plain type="primary" :disabled="!download.qualityMonitorDetailsId"
        <el-button plain type="primary" :disabled="!download.finishReportUrl"
                           @click="finishReportExport">完成报告导出</el-button>
        <el-button plain type="primary" :disabled="download.evaluateStatus !== 3"
          @click="processingDown">评价导出</el-button>
      </span>
      <span slot="footer" class="dialog-footer">
@@ -145,7 +153,7 @@
      <div style="margin: 0 auto;">
        <el-upload ref="upload1" :action="action1" :auto-upload="false"
          :data="{ qualityMonitorDetailsId: qualityMonitorDetailsId }" :file-list="fileList1" :headers="uploadHeader"
          :limit="1" :on-change="beforeUpload1" :on-error="onError1" :on-success="onSuccess1" accept='.doc,.docx' drag
          :limit="1" :on-change="beforeUpload1" :on-error="onError1" :on-success="onSuccess1" accept='.doc,.docx,application/pdf,' drag
          name="file">
          <i class="el-icon-upload"></i>
          <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
@@ -156,6 +164,7 @@
        <el-button :loading="uploading1" type="primary" @click="submitUpload1()">上 传</el-button>
      </span>
    </el-dialog>
    <view-record v-if="ViewRecord" ref="ViewRecord"></view-record>
  </div>
</template>
@@ -174,14 +183,16 @@
} from "@/api/cnas/process/ensureResults/qualityMonitor";
import { selectUserCondition } from "@/api/performance/class";
import { mapGetters } from "vuex";
import ViewRecord from "./components/ViewRecord.vue";
export default {
  name: 'EnsureResultsValidity',
  // import 引入的组件需要注入到对象中才能使用
  components: { limsTable, filePreview, EvaluateDialog, CarryOutDialog, DetailFormDialog },
  components: {ViewRecord, limsTable, filePreview, EvaluateDialog, CarryOutDialog, DetailFormDialog },
  data() {
    // 这里存放数据
    return {
      ViewRecord: false,
      examineUserId: '',
      responsibleOptions: [],
      yearForm: {
@@ -384,8 +395,10 @@
            if (params === 0) {
              return '未开始';
            } else if (params === 1) {
              return '待批准';
            } else if (params === 2) {
              return '待评价';
            }  else if (params === 2) {
              return '不批准';
            } else if (params === 3) {
              return '已批准';
            } else {
              return null;
@@ -397,6 +410,39 @@
            } else if (params === 1) {
              return 'warning';
            } else if (params === 2) {
              return 'danger';
            }  else if (params === 3) {
              return 'success';
            } else {
              return null;
            }
          }
        },{
          dataType: 'tag',
          label: '报告状态',
          prop: 'reportStatus',
          width: '100',
          formatData: (params) => {
            if (params === 0) {
              return '未开始';
            } else if (params === 1) {
              return '待评价';
            }  else if (params === 2) {
              return '不批准';
            } else if (params === 3) {
              return '已批准';
            } else {
              return null;
            }
          },
          formatType: (params) => {
            if (params === 0) {
              return '';
            } else if (params === 1) {
              return 'warning';
            } else if (params === 2) {
              return 'danger';
            }  else if (params === 3) {
              return 'success';
            } else {
              return null;
@@ -467,6 +513,13 @@
              }
            },
            {
              name: '附件上传',
              type: 'text',
              clickFun: (row) => {
                this.viewTestRecord(row)
              }
            },
            {
              name: '导出',
              type: 'text',
              clickFun: (row) => {
@@ -516,7 +569,8 @@
      ratifyRemark: '',
      downloadDialog: false,
      download: {},
      planYear: ''
      planYear: '',
      option: {}
    };
  },
  mounted() {
@@ -749,6 +803,23 @@
      if (row.finishReportUrl) {
        this.currentInfo = row
        this.ratifyStatus = row.ratifyStatus
        const userName = this.nickName
        const isPdf = /\.pdf$/i.test(row.finishReportUrl)
        if (isPdf) {
          this.option = {
            url: this.javaApi + "/word/" + row.finishReportUrl,
            isEdit: false,
            fileType: 'pdf',
            title: '报告',
            lang: 'zh-CN',
            isPrint: false,
            user_id: 1,
            user_name: userName,
            editUrl: this.javaApi + "/insReport/onlyOffice/save?fileName=" + row.finishReportUrl
          }
        } else {
          this.option = {}
        }
        this.lookDialogVisible = true
      } else {
        this.uploadDia1 = true
@@ -800,6 +871,13 @@
      this.evaluateDialog = false
      this.getYearDetailPlanList()
    },
    // 附件上传
    viewTestRecord (row) {
      this.ViewRecord = true
      this.$nextTick(() => {
        this.$refs.ViewRecord.openDia(row)
      })
    },
    // 打开导出弹框
    downLoadPost(row) {
      this.downloadDialog = true
@@ -823,6 +901,15 @@
        const blob = new Blob([res], { type: 'application/msword' });
        this.$download.saveAs(blob, '质量监控实施计划.docx')
      })
    },
    // 完成报告导出
    finishReportExport() {
      let url = this.download.finishReportUrl;
      const link = document.createElement('a');
      link.href = this.javaApi +'/word/' + url;
      link.target = '_blank';
      document.body.appendChild(link);
      link.click();
    },
    // 处理单导出
    processingDown() {
@@ -854,11 +941,19 @@
      selectUserCondition().then((res) => {
        this.responsibleOptions = res.data;
      })
    },
    exportSignatureTemplate() {
      let url = '质量监控记录签名模板.docx';
      const link = document.createElement('a');
      link.href = this.javaApi +'/word/' + url;
      link.target = '_blank';
      document.body.appendChild(link);
      link.click();
    }
  },
  // 用于上传文件的信息
  computed: {
    ...mapGetters(["userId"]),
    ...mapGetters(["userId", "nickName"]),
    action() {
      return this.javaApi + '/qualityMonitor/importQualityMonitor'
    },