gaoluyang
2025-02-25 bf5b5448a8879003c55cf99a46eba99184624881
质量监控计划
已修改1个文件
已添加6个文件
1984 ■■■■■ 文件已修改
src/api/cnas/process/ensureResultsValidity/qualityMonitor.js 86 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/process/ensureResultsValidity/components/ViewRecord.vue 183 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/process/ensureResultsValidity/components/carryOutDialog.vue 356 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/process/ensureResultsValidity/components/detailFormDialog.vue 158 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/process/ensureResultsValidity/components/evaluateDialog.vue 351 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/process/ensureResultsValidity/index.vue 837 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/business/inspectionReview/index.vue 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/cnas/process/ensureResultsValidity/qualityMonitor.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,86 @@
// è´¨é‡ç›‘控计划页面相关接口
import request from '@/utils/request'
// ç›‘控年度计划列表
export function pageQualityMonitor(query) {
  return request({
    url: '/qualityMonitor/pageQualityMonitor',
    method: 'get',
    params: query
  })
}
// ç›‘控计划审核
export function examineQualityMonitor(query) {
  return request({
    url: '/qualityMonitor/examineQualityMonitor',
    method: 'post',
    data: query
  })
}
// ç›‘控计划批准
export function ratifyQualityMonitor(query) {
  return request({
    url: '/qualityMonitor/ratifyQualityMonitor',
    method: 'post',
    data: query
  })
}
// æ‰¹å‡†å®ŒæˆæŠ¥å‘Š
export function ratifyFinishReport(query) {
  return request({
    url: '/qualityMonitor/ratifyFinishReport',
    method: 'post',
    data: query
  })
}
// å¯¼å‡ºç›‘控计划
export function exportQualityMonitorDetail(query) {
  return request({
    url: '/qualityMonitor/exportQualityMonitorDetail',
    method: 'get',
    params: query,
    responseType: "blob"
  })
}
// åˆ é™¤ç›‘督计划
export function delQualitySupervise(query) {
  return request({
    url: '/qualityMonitor/delQualitySupervise',
    method: 'delete',
    params: query
  })
}
// ç›‘控计划详情列表
export function pageQualityMonitorDetail(query) {
  return request({
    url: '/qualityMonitor/pageQualityMonitorDetail',
    method: 'get',
    params: query
  })
}
// è´¨é‡ç›‘控实施计划导出
export function exportQualityMonitorRatify(query) {
  return request({
    url: '/qualityMonitor/exportQualityMonitorRatify',
    method: 'get',
    params: query,
    responseType: "blob"
  })
}
// è´¨é‡ç›‘控评价导出
export function exportQualityMonitorEvaluate(query) {
  return request({
    url: '/qualityMonitor/exportQualityMonitorEvaluate',
    method: 'get',
    params: query,
    responseType: "blob"
  })
}
// åˆ é™¤ç›‘控计划详情
export function delQualityMonitorDetail(query) {
  return request({
    url: '/qualityMonitor/delQualityMonitorDetail',
    method: 'delete',
    params: query
  })
}
src/views/CNAS/process/ensureResultsValidity/components/ViewRecord.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,183 @@
<template>
  <div>
    <el-dialog :visible.sync="filesDialogVisible" title="附件上传" width="80%" @closed="closeFilesLook">
      <div style="display: flex;justify-content: space-between;">
        <el-upload ref='upload'
                   :action="fileAction"
                   :auto-upload="true"
                   :before-upload="fileBeforeUpload" :data="{detailsEvaluateId: info.detailsEvaluateId}"
                   :headers="headers" :on-error="onError"
                   :on-success="handleSuccessUp"
                   :show-file-list="false"
                   accept='.jpg,.jpeg,.png,.gif,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.zip,.rar' style="width: 80px !important;">
          <el-button size="small" style="height: 38px" type="primary">附件上传</el-button>
        </el-upload>
      </div>
      <div>
        <lims-table :tableData="tableData" :column="columnData" :tableLoading="tableLoading"
                    :height="'calc(100vh - 270px)'" key="tableData"></lims-table>
      </div>
    </el-dialog>
    <el-dialog
      :visible.sync="lookDialogVisible"
      fullscreen
      title="查看附件" width="800px">
      <filePreview v-if="lookDialogVisible" :currentFile="{}"
                   :fileUrl="javaApi+'/word/'+currentInfo.fileUrl" style="height: 90vh;overflow-y: auto;top: 0"/>
    </el-dialog>
  </div>
</template>
<script>
import file from '@/utils/file';
import filePreview from '@/components/Preview/filePreview.vue';
import limsTable from "@/components/Table/lims-table.vue";
export default {
  name: 'ViewRecord',
  // import å¼•入的组件需要注入到对象中才能使用
  components: {limsTable, filePreview },
  data() {
    // è¿™é‡Œå­˜æ”¾æ•°æ®
    return {
      filesDialogVisible: false,
      tableLoading: false,
      filesLookInfo: {},
      columnData: [
        {
          label: '文件名称',
          prop: 'fileName',
          minWidth: '150px'
        },
        {
          dataType: 'action',
          minWidth: '100',
          label: '操作',
          fixed: 'right',
          operation: [
            {
              name: '预览',
              type: 'text',
              clickFun: (row) => {
                this.handleLook(row)
              }
            },
            {
              name: '下载',
              type: 'text',
              clickFun: (row) => {
                this.upload(row)
              }
            },
            {
              name: '删除',
              type: 'text',
              color: '#f56c6c',
              clickFun: (row) => {
                this.delete(row)
              }
            }
          ]
        }
      ],
      tableData: [],
      info: {},
      currentInfo:{},
      lookDialogVisible: false,
    };
  },
  // æ–¹æ³•集合
  methods: {
    openDia(row) {
      this.filesDialogVisible = true
      this.info = row
      this.searchTableList()
    },
    // æŸ¥è¯¢é™„件列表
    searchTableList () {
      this.tableLoading = true
      this.$axios.get(this.$api.qualityMonitor.getEvaluateFileList + '?detailsEvaluateId=' + this.info.detailsEvaluateId).then(res => {
        this.tableLoading = false
        if (res.code === 201) return
        this.tableData = res.data
      }).catch(err => {
        this.tableLoading = false
        console.log('err---', err);
      })
    },
    closeFilesLook () {
      this.filesDialogVisible = false
    },
    // ä¸‹è½½
    upload (row) {
      let url = '';
      if(row.type==1){
        url = this.javaApi+'/img/'+row.fileUrl
        file.downloadIamge(url,row.fileName)
      }else{
        url = this.javaApi+'/word/'+row.fileUrl
        const link = document.createElement('a');
        link.href = url;
        link.download = row.fileName;
        link.click();
      }
    },
    // åˆ é™¤
    delete (row) {
      this.tableLoading = true
      this.$axios.get(this.$api.qualityMonitor.delVerifyEvaluateFileList + '?evaluateFileId=' + row.evaluateFileId).then(res => {
        this.tableLoading = false
        if (res.code === 201) return
        this.$message.success('删除成功')
        this.searchTableList()
      }).catch(err => {
        this.tableLoading = false
        console.log('err---', err);
      })
    },
    // ä¸Šä¼ éªŒè¯
    fileBeforeUpload(file) {
      let flag = true
      if (file.size > 1024 * 1024 * 10) {
        this.$message.error('上传文件不超过10M');
        this.$refs.upload.clearFiles()
        flag = false
      }
      if (!flag) {
        return Promise.reject(flag); //正确的终止
      }
    },
    onError(err, file, fileList,type) {
      this.$message.error('上传失败')
      this.$refs.upload.clearFiles()
    },
    handleSuccessUp(response, ) {
      this.upLoading = false;
      if (response.code == 200) {
        this.$message.success('上传成功');
        this.searchTableList()
      }
    },
    // æŸ¥çœ‹æ–‡ä»¶
    handleLook(row){
      this.currentInfo = row
      this.lookDialogVisible = true
    },
  },
  computed: {
    headers() {
      return {
        'token': sessionStorage.getItem('token')
      }
    },
    fileAction() {
      return this.javaApi + this.$api.qualityMonitor.uploadEvaluateFile
    }
  },
};
</script>
<style scoped>
</style>
src/views/CNAS/process/ensureResultsValidity/components/carryOutDialog.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,356 @@
<template>
  <div>
    <el-dialog :close-on-click-modal="false" :close-on-press-escape="false"
               :visible.sync="formDia"
               title="实施"
               width="60%" @close="closeCarryOutDia">
      <el-steps :active="currentStep" align-center finish-status="success">
        <el-step title="实施"></el-step>
        <el-step title="批准"></el-step>
      </el-steps>
      <div style="height: 620px;overflow-y: auto">
        <table border="1" cellspacing="10" class="tables">
          <tr>
            <td class="td-title">
              <p>监控项目:</p>
            </td>
            <td colspan="3">
              <el-input v-if="currentStep === 0" v-model="form.monitorProject"
                        placeholder="请输入内容"
                        size="small">
              </el-input>
              <span v-else class="td-info"> {{ form.monitorProject }}</span>
            </td>
            <td class="td-title">
              <p>监控时间:</p>
            </td>
            <td colspan="3">
              <el-input v-if="currentStep === 0" v-model="form.monitorData"
                        placeholder="请输入内容"
                        size="small">
              </el-input>
              <span v-else class="td-info"> {{ form.monitorData }}</span>
            </td>
          </tr>
          <tr>
            <td colspan="8">
              <div>
                <p>监控目的:</p>
              </div>
              <div>
                <el-input v-if="currentStep === 0" v-model="form.monitorPurpose"
                          :rows="3"
                          placeholder="请输入内容"
                          size="small"
                          type="textarea">
                </el-input>
                <span v-else class="td-info2"> {{ form.monitorPurpose }}</span>
              </div>
            </td>
          </tr>
          <tr>
            <td colspan="8">
              <div>
                <p>监控方法:</p>
              </div>
              <div>
                <el-input v-if="currentStep === 0" v-model="form.monitorMethod"
                          :rows="4"
                          placeholder="请输入内容"
                          size="small"
                          type="textarea">
                </el-input>
                <span v-else class="td-info2"> {{ form.monitorMethod }}</span>
              </div>
            </td>
          </tr>
          <tr>
            <td colspan="8">
              <div>
                <p>参加人员:</p>
              </div>
              <div>
                <el-input v-if="currentStep === 0" v-model="form.participant"
                          :rows="3"
                          placeholder="请输入内容"
                          size="small"
                          type="textarea">
                </el-input>
                <span v-else class="td-info2"> {{ form.participant }}</span>
              </div>
            </td>
          </tr>
          <tr>
            <td colspan="8">
              <div>
                <p>过程控制:</p>
              </div>
              <div>
                <el-input v-if="currentStep === 0" v-model="form.processControl"
                          :rows="3"
                          placeholder="请输入内容"
                          size="small"
                          type="textarea">
                </el-input>
                <span v-else class="td-info2"> {{ form.processControl }}</span>
              </div>
            </td>
          </tr>
          <tr>
            <td colspan="8">
              <div>
                <p>结果评价标准(如何评价):</p>
              </div>
              <div>
                <el-input v-if="currentStep === 0" v-model="form.howEvaluate"
                          :rows="3"
                          placeholder="请输入内容"
                          size="small"
                          type="textarea">
                </el-input>
                <span v-else class="td-info2"> {{ form.howEvaluate }}</span>
              </div>
            </td>
          </tr>
          <tr>
            <td colspan="8">
              <div>
                <p>经费预算:</p>
              </div>
              <div>
                <el-input v-if="currentStep === 0" v-model="form.budget"
                          placeholder="请输入内容"
                          size="small">
                </el-input>
                <span v-else class="td-info2"> {{ form.budget }}</span>
              </div>
            </td>
          </tr>
          <tr>
            <td colspan="4">
              <div>
                <p>检测部门:</p>
              </div>
              <div>
                <el-input v-if="currentStep === 0" v-model="form.inspectionDepartment"
                          placeholder="请输入内容"
                          size="small">
                </el-input>
                <span v-else class="td-info2"> {{ form.inspectionDepartment }}</span>
              </div>
            </td>
            <td colspan="4">
              <div v-if="currentStep === 0">
                <div>批准人:</div>
                <div>
                  <el-select v-if="currentStep === 0" v-model="form.ratifyUserId" clearable
                             filterable
                             placeholder="请选择" size="small">
                    <el-option v-for="(item,i) in personList" :key="i" :label="item.label" :value="item.value">
                    </el-option>
                  </el-select>
                  <span v-else class="td-info2"> {{ form.ratifyName }}</span>
                </div>
              </div>
              <div>
                <div v-if="currentStep !== 0">
                  <p>批准意见:</p>
                </div>
                <div>
                  <el-input v-if="currentStep === 1" v-model="form.ratifyOpinion"
                            :rows="3"
                            placeholder="请输入内容"
                            size="small"
                            type="textarea">
                  </el-input>
                  <span v-if="currentStep === 2" class="td-info2"> {{ form.ratifyOpinion }}</span>
                  <span v-if="currentStep !== 0" class="td-info3"> {{ '批准人:' + form.ratifyName }}</span>
                </div>
              </div>
            </td>
          </tr>
        </table>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button @click="closeCarryOutDia">取 æ¶ˆ</el-button>
        <el-button v-if="currentStep !== 2" :loading="editLoad" type="primary" @click="handleEdit">提 äº¤</el-button>
      </span>
    </el-dialog>
  </div>
</template>
<script>
export default {
  name: 'carryOutDialog',
  // import å¼•入的组件需要注入到对象中才能使用
  components: {},
  data() {
    // è¿™é‡Œå­˜æ”¾æ•°æ®
    return {
      formDia: false,
      currentStep: 0,
      form: {
        monitorProject: '',
        monitorData: '',
        monitorPurpose: '',
        monitorMethod: '',
        participant: '',
        processControl: '',
        howEvaluate: '',
        budget: '',
        inspectionDepartment: '',
        ratifyUserId: '',
        ratifyOpinion: '',
        qualityMonitorDetailsId: '',
        ratifyName: '',
      },
      personList: [],
      editLoad: false,
      isCarryOut: false, // æ˜¯å¦ä¸ºå®žæ–½
    };
  },
  // æ–¹æ³•集合
  methods: {
    openDia(row) {
      this.formDia = true
      this.searchInfo(row)
      this.getAuthorizedPerson()
    },
    // æŸ¥è¯¢ç›‘控计划详情实施信息
    searchInfo (row) {
      this.$axios.get(this.$api.qualityMonitor.getQualityMonitorRatify + '?qualityMonitorDetailsId=' + row.qualityMonitorDetailsId).then(res => {
        if (res.code === 201) return
        // æœ‰detailsRatifyId则说明提交过实施信息
        if (res.data.detailsRatifyId) {
          // æ˜¯å¦ç»“束0:未结束, 1:已结束
          if (res.data.isFinish == 0) {
            this.currentStep = 1
          } else if (res.data.isFinish == 1) {
            this.currentStep = 2
          }
        } else {
          this.currentStep = 0
        }
        this.form = res.data
      }).catch(err => {
        console.log('err---', err);
      })
    },
    // æäº¤
    handleEdit() {
      if (!this.form.ratifyUserId) {
        this.$message.warning('请选择批准人')
        return
      }
      this.editLoad = true
      if (this.currentStep == 0) {
        this.addInfo()
      } else {
        this.editInfo()
      }
    },
    // æäº¤å®žæ–½
    addInfo () {
      this.$axios.post(this.$api.qualityMonitor.addQualityMonitorRatify, this.form, {
        headers: {
          "Content-Type": "application/json"
        },
        noQs: true
      }).then(res => {
        this.editLoad = false
        if (res.code === 201) return
        this.$message.success('操作成功')
        this.closeCarryOutDia()
      }).catch(err => {
        console.log('err---', err);
        this.editLoad = false
      })
    },
    // æäº¤æ‰¹å‡†
    editInfo () {
      this.$axios.post(this.$api.qualityMonitor.addQualityMonitorRatifyOpinion, this.form, {
        headers: {
          "Content-Type": "application/json"
        },
        noQs: true
      }).then(res => {
        this.editLoad = false
        if (res.code === 201) return
        this.$message.success('操作成功')
        this.closeCarryOutDia()
      }).catch(err => {
        console.log('err---', err);
        this.editLoad = false
      })
    },
    // å…³é—­å¼¹æ¡†
    closeCarryOutDia () {
      this.formDia = false
      this.$emit('closeCarryOutDia')
    },
    getAuthorizedPerson() {
      this.$axios.get(this.$api.user.getUserMenu).then(res => {
        let data = []
        res.data.forEach(a => {
          data.push({
            label: a.name,
            value: a.id
          })
        })
        this.personList = data
      })
    },
  }
};
</script>
<style scoped>
>>>.el-dialog {
  margin: 20px auto 50px !important;
}
.tables {
  table-layout: fixed;
  width: 100%;
  margin-top: 10px;
}
.td-title {
  height: 40px;
  width: 100px;
  text-align: center;
  font-size: 14px;
  word-wrap: break-word;
  white-space: normal;
  padding: 6px;
}
.td-info {
  display: inline-block;
  width: 100%;
  text-align: center;
  font-size: 14px;
  word-wrap: break-word;
  white-space: normal;
}
.td-info2 {
  display: inline-block;
  width: 90%;
  text-align: left;
  font-size: 16px;
  word-wrap: break-word;
  white-space: normal;
  margin-left: 20px;
}
.tables td {
  height: 40px;
  width: 100px;
  font-size: 14px;
  word-wrap: break-word;
  white-space: normal;
  padding: 6px;
}
.td-info3 {
  width: 90%;
  display: inline-block;
  text-align: right;
}
</style>
src/views/CNAS/process/ensureResultsValidity/components/detailFormDialog.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,158 @@
<template>
  <div>
    <el-dialog title="编辑" :visible.sync="formDia"
               :close-on-click-modal="false"
               :close-on-press-escape="false"
               width="80%" @close="closeDia">
      <el-form :model="form" :rules="rules" ref="form" label-width="140px">
        <el-col :span="12">
          <el-form-item label="监控目的" prop="monitorPurpose">
            <el-input v-model="form.monitorPurpose" size="small" clearable></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="计划开展时间" prop="plannedTime">
            <el-input v-model="form.plannedTime" size="small" clearable></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="监控项目" prop="monitorProject">
            <el-input v-model="form.monitorProject" size="small" clearable></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="参加单位(人员)" prop="participant">
            <el-input v-model="form.participant" size="small" clearable></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="预算(元)" prop="budget">
            <el-input v-model="form.budget" size="small" clearable></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="组织人员" prop="organization">
            <el-input v-model="form.organization" size="small" clearable></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="监控方式" prop="monitorWay">
            <el-input v-model="form.monitorWay" size="small" clearable></el-input>
          </el-form-item>
        </el-col>
      </el-form>
      <span slot="footer" class="dialog-footer">
                    <el-button @click="closeDia">取 æ¶ˆ</el-button>
                    <el-button type="primary" @click="submitForm" :loading="upLoad">ç¡® å®š</el-button>
        </span>
    </el-dialog>
  </div>
</template>
<script>
export default {
  name: 'detailFormDialog',
  // import å¼•入的组件需要注入到对象中才能使用
  components: {},
  props: ['qualityMonitorId'],
  data() {
    // è¿™é‡Œå­˜æ”¾æ•°æ®
    return {
      formDia: false,
      form: {
        qualityMonitorDetailsId: '',
        monitorPurpose: '',
        plannedTime: '',
        monitorProject: '',
        participant: '',
        budget: '',
        organization: '',
        monitorWay: '',
      },
      rules: {
        monitorPurpose: [{ required: true, message: '请输入监控目的', trigger: 'blur' }],
        monitorProject: [{ required: true, message: '请输入监控项目', trigger: 'blur' }],
      },
      upLoad: false,
      operationType: '',
    };
  },
  // æ–¹æ³•集合
  methods: {
    openDia(type, row) {
      this.formDia = true
      this.operationType = type
      if (type === 'edit') {
        this.searchInfo(row)
      }
    },
    searchInfo (row) {
      this.form = {...row}
    },
    // æäº¤è¡¨å•
    submitForm () {
      this.$refs['form'].validate((valid) => {
        if (valid) {
          if (this.operationType === 'add') {
            this.handleAdd()
          } else {
            this.handleEdit()
          }
        }
      })
    },
    // æäº¤æ–°å¢ž
    handleAdd () {
      let entity = this.HaveJson(this.form)
      entity.qualityMonitorId = this.qualityMonitorId
      this.upLoad = true
      this.$axios.post(this.$api.qualityMonitor.addQualityMonitorDetail, entity, {
        headers: {
          "Content-Type": "application/json"
        },
        noQs: true
      }).then(res => {
        this.upLoad = false
        if (res.code === 201) return
        this.$message.success('新增成功')
        this.closeDia()
      }).catch(err => {
        console.log('err---', err);
        this.upLoad = false
      })
    },
    // æäº¤ä¿®æ”¹
    handleEdit () {
      const entity = this.HaveJson(this.form)
      this.upLoad = true
      this.$axios.post(this.$api.qualityMonitor.updateQualityMonitorDetail, entity, {
        headers: {
          "Content-Type": "application/json"
        },
        noQs: true
      }).then(res => {
        this.upLoad = false
        if (res.code === 201) return
        this.$message.success('修改成功')
        this.closeDia()
      }).catch(err => {
        console.log('err---', err);
        this.upLoad = false
      })
    },
    // å…³é—­å¼¹æ¡†
    closeDia () {
      this.$refs.form.resetFields();
      this.formDia = false
      this.$emit('closeDia')
    },
  }
};
</script>
<style scoped>
>>>.el-dialog__body {
  max-height: 720px;
  overflow-y: auto;
}
</style>
src/views/CNAS/process/ensureResultsValidity/components/evaluateDialog.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,351 @@
<template>
  <div>
    <el-dialog :close-on-click-modal="false" :close-on-press-escape="false"
               :visible.sync="formDia"
               title="质量监控评价"
               width="60%" @close="closeEvaDia">
      <div style="text-align: right">
        <el-button size="small" type="primary" @click="viewTestRecord">附件上传</el-button>
      </div>
      <el-steps :active="currentStep" align-center finish-status="success">
        <el-step title="监控计划实施情况" @click.native="setStep(0)"></el-step>
        <el-step title="监控结果评价" @click.native="setStep(1)"></el-step>
        <el-step title="评审结论(是否采取措施)" @click.native="setStep(2)"></el-step>
      </el-steps>
      <div>
        <table border="1" cellspacing="10" class="tables">
          <tr v-if="showStep === 0">
            <td class="td-title">
              <p><span class="required-span">* </span>评审目的:</p>
            </td>
            <td class="td-info" colspan="3">
              <el-input v-if="showStep === 0 && currentStep === 0" v-model="form.reviewPurpose"
                        placeholder="请输入内容"
                        size="small">
              </el-input>
              <span v-if="showStep === 0 && currentStep !== 0" class="td-info1"> {{ form.reviewPurpose }}</span>
            </td>
          </tr>
          <tr v-if="showStep === 0">
            <td class="td-title">
              <p><span class="required-span">* </span>评审人员:</p>
            </td>
            <td class="td-info" colspan="3">
              <el-input v-if="showStep === 0 && currentStep === 0" v-model="form.reviewUser"
                        placeholder="请输入内容"
                        size="small">
              </el-input>
              <span v-if="showStep === 0 && currentStep !== 0" class="td-info1"> {{ form.reviewUser }}</span>
            </td>
          </tr>
          <tr v-if="showStep === 0">
            <td class="td-title">
              <p><span class="required-span">* </span>评审日期:</p>
            </td>
            <td class="td-info" colspan="3">
              <el-input v-if="showStep === 0 && currentStep === 0" v-model="form.reviewTime"
                        placeholder="请输入内容"
                        size="small">
              </el-input>
              <span v-if="showStep === 0 && currentStep !== 0" class="td-info1"> {{ form.reviewTime }}</span>
            </td>
          </tr>
          <tr v-if="showStep === 0">
            <td class="td-title">
              <p><span class="required-span">* </span>监控计划实施情况:</p>
            </td>
            <td class="td-info" colspan="3">
              <el-input v-if="showStep === 0 && currentStep === 0" v-model="form.implementCondition"
                        :rows="5"
                        placeholder="请输入内容"
                        size="small"
                        type="textarea">
              </el-input>
              <span v-if="showStep === 0 && currentStep !== 0" class="td-info1"> {{ form.implementCondition }}</span>
            </td>
          </tr>
          <tr v-if="showStep === 0">
            <td class="td-title">
              <p>实施部门:</p>
            </td>
            <td class="td-info">
              <span> {{ form.implementDepartment }}</span>
            </td>
            <td v-if="currentStep === 0" class="td-title">
              <p>请选择下一步负责人:</p>
            </td>
            <td v-if="currentStep === 0" class="td-info">
              <el-select v-model="form.implementUserId" clearable filterable
                         placeholder="请选择" size="small">
                <el-option v-for="(item,i) in personList" :key="i" :label="item.label" :value="item.value">
                </el-option>
              </el-select>
            </td>
          </tr>
          <tr v-if="showStep === 1">
            <td class="td-title">
              <p>监控结果评价:</p>
            </td>
            <td class="td-info" colspan="4">
              <el-input v-if="showStep === 1 && currentStep === 1" v-model="form.implementResult"
                        :rows="5"
                        placeholder="请输入内容"
                        size="small"
                        type="textarea">
              </el-input>
              <span v-if="showStep === 1 && currentStep !== 1" class="td-info1"> {{ form.implementResult }}</span>
            </td>
          </tr>
          <tr v-if="showStep === 1">
            <td class="td-title">
              <p>当前负责人:</p>
            </td>
            <td class="td-info" colspan="4">
              {{form.implementName}}
            </td>
          </tr>
          <tr v-if="showStep === 1">
            <td v-if="currentStep === 1" class="td-title">
              <p>请选择下一步负责人:</p>
            </td>
            <td v-if="currentStep === 1" class="td-info" colspan="4">
              <el-select v-model="form.ratifyUserId" clearable filterable
                         placeholder="请选择" size="small">
                <el-option v-for="(item,i) in personList" :key="i" :label="item.label" :value="item.value">
                </el-option>
              </el-select>
            </td>
          </tr>
          <tr v-if="showStep === 2">
            <td class="td-title">
              <p>评审结论(是否采取措施):</p>
            </td>
            <td class="td-info" colspan="4">
              <el-input v-if="showStep === 2 && currentStep === 2" v-model="form.ratifyOpinion"
                        :rows="5"
                        placeholder="请输入内容"
                        size="small"
                        type="textarea">
              </el-input>
              <span v-if="showStep === 2 && currentStep !== 2" class="td-info1"> {{ form.ratifyOpinion }}</span>
            </td>
          </tr>
          <tr v-if="showStep === 2">
            <td class="td-title">
              <p>当前负责人:</p>
            </td>
            <td class="td-info" colspan="4">
              {{form.ratifyUserName}}
            </td>
          </tr>
          <tr v-if="showStep === 2">
            <td class="td-title">
              <p>审批日期:</p>
            </td>
            <td class="td-info" colspan="4">
              {{form.ratifyTime}}
            </td>
          </tr>
        </table>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button @click="closeEvaDia">取 æ¶ˆ</el-button>
        <el-button v-if="currentStep !== 3" :loading="editLoad" type="primary" @click="handleEdit">提 äº¤</el-button>
      </span>
    </el-dialog>
    <view-record v-if="ViewRecord" ref="ViewRecord"></view-record>
  </div>
</template>
<script>
import ViewRecord from './ViewRecord.vue';
export default {
  name: 'evaluateDialog',
  // import å¼•入的组件需要注入到对象中才能使用
  components: { ViewRecord },
  data() {
    // è¿™é‡Œå­˜æ”¾æ•°æ®
    return {
      formDia: false,
      currentStep: 0,
      showStep: 0,
      form: {
        implementDepartment: '',
        reviewPurpose: '',
        reviewUser: '',
        reviewTime: '',
        implementCondition: '',
        implementName: '',
        implementUserId: '',
        implementResult: '',
        ratifyUserName: '',
        ratifyUserId: '',
        ratifyOpinion: '',
        qualityMonitorDetailsId: '',
        ratifyTime: '',
        detailsEvaluateId: '',
      },
      editLoad: false,
      personList: [],
      ViewRecord: false,
    };
  },
  // æ–¹æ³•集合
  methods: {
    openDia (row) {
      this.formDia = true
      this.searchInfo(row)
      this.getAuthorizedPerson()
      this.getDepartment()
    },
    // æŸ¥è¯¢ç›‘控计划详情实施信息
    searchInfo (row) {
      this.form.qualityMonitorDetailsId = row.qualityMonitorDetailsId
      this.$axios.get(this.$api.qualityMonitor.getQualityMonitorEvaluate + '?qualityMonitorDetailsId=' + row.qualityMonitorDetailsId).then(res => {
        if (res.code === 201) return
        if (res.data === null) {
          this.showStep = 0
          this.currentStep = 0
        } else {
          this.form = res.data
          if (res.data.isFinish === 0) {
            if (res.data.implementUserId && !res.data.ratifyUserId) {
              this.showStep = 1
              this.currentStep = 1
            } else if (res.data.implementUserId && res.data.ratifyUserId) {
              this.showStep = 2
              this.currentStep = 2
            }
          } else {
            this.currentStep = 3
            this.showStep = 2
          }
        }
      }).catch(err => {
        console.log('err---', err);
      })
    },
    // æäº¤
    handleEdit () {
      if (this.currentStep === 2) {
        this.$axios.post(this.$api.qualityMonitor.addMonitorEvaluateOpinion, this.form, {
          headers: {
            "Content-Type": "application/json"
          },
          noQs: true
        }).then(res => {
          this.editLoad = false
          if (res.code === 201) return
          this.$message.success('操作成功')
          this.closeEvaDia()
        }).catch(err => {
          console.log('err---', err);
          this.editLoad = false
        })
      } else {
        if (!this.form.reviewPurpose) {
          this.$message.warning('请填写评审目的')
          return
        }
        if (!this.form.reviewUser) {
          this.$message.warning('请填写评审人员')
          return
        }
        if (!this.form.reviewTime) {
          this.$message.warning('请填写评审日期')
          return
        }
        if (!this.form.implementCondition) {
          this.$message.warning('请填写监控计划实施情况')
          return
        }
        if (!this.form.implementUserId) {
          this.$message.warning('请选择下一步负责人')
          return
        }
        if (this.currentStep === 1) {
          if (!this.form.ratifyUserId) {
            this.$message.warning('请选择下一步负责人')
            return
          }
        }
        this.$axios.post(this.$api.qualityMonitor.addQualityMonitorEvaluate, this.form, {
          headers: {
            "Content-Type": "application/json"
          },
          noQs: true
        }).then(res => {
          this.editLoad = false
          if (res.code === 201) return
          this.$message.success('操作成功')
          this.closeEvaDia()
        }).catch(err => {
          console.log('err---', err);
          this.editLoad = false
        })
      }
    },
    // å…³é—­å¼¹æ¡†
    closeEvaDia () {
      this.formDia = false
      this.$emit('closeEvaDia')
    },
    setStep (step) {
      this.showStep = step
    },
    viewTestRecord () {
      this.ViewRecord = true
      this.$nextTick(() => {
        this.$refs.ViewRecord.openDia( this.form)
      })
    },
    getAuthorizedPerson() {
      this.$axios.get(this.$api.user.getUserMenu).then(res => {
        let data = []
        res.data.forEach(a => {
          data.push({
            label: a.name,
            value: a.id
          })
        })
        this.personList = data
      })
    },
    getDepartment() {
      this.$axios.get(this.$api.user.selectUserDepartmentLimsName).then(res => {
        if (res.code === 201) return
        this.form.implementDepartment = res.data
      })
    },
  }
};
</script>
<style scoped>
.tables {
  table-layout: fixed;
  width: 100%;
  margin-top: 10px;
}
.td-title {
  height: 40px;
  width: 170px;
  text-align: center;
  font-size: 14px;
  word-wrap: break-word;
  white-space: normal;
  padding: 6px;
}
.td-info {
  padding: 6px;
}
.td-info1 {
  display: inline-block;
  width: 100%;
  text-align: left;
  font-size: 14px;
  word-wrap: break-word;
  white-space: normal;
}
</style>
src/views/CNAS/process/ensureResultsValidity/index.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,837 @@
<template>
  <!--  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">
            <el-input size="small" placeholder="请输入" clearable
                      v-model="yearForm.monitorName"
                      @keyup.enter.native="getYearPlanList"></el-input>
          </el-form-item>
          <el-form-item>
            <el-button icon="el-icon-refresh" size="mini" @click="clearYear">重 ç½®</el-button>
            <el-button type="primary" icon="el-icon-search" size="mini" @click="getYearPlanList">查 è¯¢</el-button>
          </el-form-item>
        </el-form>
        <div>
          <el-button size="small" type="primary" @click="leadInto">导入</el-button>
        </div>
      </div>
      <lims-table :tableData="yearTableData" :column="yearColumnData" :page="yearPage" :tableLoading="yearLoading"
                  height="40vh" @pagination="pagination"
                  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>
            <el-button icon="el-icon-refresh" size="mini" @click="clearDetail">重 ç½®</el-button>
            <el-button type="primary" icon="el-icon-search" size="mini" @click="getYearDetailPlanList">查 è¯¢</el-button>
          </el-form-item>
        </el-form>
        <div>
          <el-button size="small" type="primary" @click="showDialog('add')">新增</el-button>
        </div>
      </div>
      <lims-table :tableData="yearDetailTableData" :column="yearDetailColumnData" :page="yearDetailPage" :tableLoading="yearDetailLoading"
                  height="40vh" @pagination="pagination1"
                  key="yearDetailTableData"></lims-table>
    </div>
    <!--新增修改弹框-->
    <detail-form-dialog v-if="formDia" ref="formDia" :qualityMonitorId="qualityMonitorId" @closeDia="closeDia"></detail-form-dialog>
    <!--实施流程弹框-->
    <carry-out-dialog v-if="carryOutDia" ref="carryOutDia" :qualityMonitorId="qualityMonitorId" @closeDia="closeCarryOutDia"></carry-out-dialog>
    <!--评价流程弹框-->
    <evaluate-dialog v-if="evaluateDialog" ref="evaluateDialog" @closeEvaDia="closeEvaDia"></evaluate-dialog>
    <el-dialog :visible.sync="examineDialog" title="审核" width="30%" @close="closeExamineDia">
      <span>
        å®¡æ ¸å¤‡æ³¨ï¼š
        <el-input v-model="examineInfo.examineRemark" type="textarea"></el-input>
      </span>
      <span style="margin-top: 10px;display: inline-block">
        æ‰¹å‡†äººï¼š
        <el-select v-model="examineInfo.ratifyUserId" clearable
                   filterable size="small" style="width: 70%;">
          <el-option v-for="item in responsibleOptions" :key="item.id" :label="item.name" :value="item.id">
          </el-option>
        </el-select>
      </span>
      <span slot="footer" class="dialog-footer">
        <el-button :loading="examineLoading" @click="handleReview(0)">不通过</el-button>
        <el-button :loading="examineLoading" type="primary" @click="handleReview(1)">通 è¿‡</el-button>
      </span>
    </el-dialog>
    <el-dialog :visible.sync="ratifyDialog" title="批准" width="30%" @close="closeRatifyDia">
      <span>
        æ‰¹å‡†å¤‡æ³¨ï¼š
        <el-input v-model="ratifyInfo.ratifyRemark" type="textarea"></el-input>
      </span>
      <span slot="footer" class="dialog-footer">
        <el-button :loading="ratifyLoading" @click="handleRatify(0)">不批准</el-button>
        <el-button :loading="ratifyLoading" type="primary" @click="handleRatify(1)">批 å‡†</el-button>
      </span>
    </el-dialog>
    <!--预览报告-->
    <el-dialog
      :visible.sync="lookDialogVisible"
      fullscreen
      title="查看附件" top="5vh" width="800px">
      <filePreview v-if="lookDialogVisible" :currentFile="{}"
                   :fileUrl="javaApi+'/word/' + currentInfo.finishReportUrl" style="height: 70vh;overflow-y: auto;"/>
      <div>
        æ‰¹å‡†çŠ¶æ€ï¼š
        <el-tag v-if="this.ratifyStatus ===  1" type="success">批准</el-tag>
        <el-tag v-if="this.ratifyStatus ===  0" type="danger">不批准</el-tag>
      </div>
      <div>
        æ‰¹å‡†æ„è§ï¼š
        <el-input v-model="approvalRemarks" :disabled="this.ratifyStatus === 1" type="textarea"></el-input>
      </div>
      <span v-if="this.ratifyStatus !== 1" slot="footer" class="dialog-footer">
        <el-button :loading="lookDialogLoading" @click="handleApproval(0)">不批准</el-button>
        <el-button :loading="lookDialogLoading" type="primary" @click="handleApproval(1)">批 å‡†</el-button>
      </span>
    </el-dialog>
    <el-dialog :visible.sync="downloadDialog" title="导出" width="600px">
      <span>
        <el-button plain type="primary" @click="controlDown">实施计划导出</el-button>
        <el-button plain type="primary" @click="processingDown">评价导出</el-button>
      </span>
      <span slot="footer" class="dialog-footer">
        <el-button @click="downloadDialog = false">取 æ¶ˆ</el-button>
      </span>
    </el-dialog>
    <!--导入计划-->
    <el-dialog :visible.sync="uploadDia" title="数据导入" width="500px" :close-on-click-modal="false" :close-on-press-escape="false">
      <div style="display: flex; align-items: center;">
        <span style="width: 60px">年份:</span>
        <el-date-picker
          v-model="planYear"
          type="year"
          value-format="yyyy"
          clearable
          size="small"
          format="yyyy"
          placeholder="选择年">
        </el-date-picker>
      </div>
      <div style="display: flex;align-items: center;margin: 10px 0">
        <div style="width: 60px">审核人:</div>
        <el-select v-model="examineUserId" clearable
                   filterable size="small" style="width: 50%;">
          <el-option v-for="item in responsibleOptions" :key="item.id" :label="item.name" :value="item.id">
          </el-option>
        </el-select>
      </div>
      <div style="margin: 0 auto;">
        <el-upload ref="upload" :action="action" :auto-upload="false" :file-list="fileList"
                   :headers="headers" :limit="1"
                   accept='.jpg,.jpeg,.png,.gif,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.zip,.rar'
                   :on-change="beforeUpload" :on-error="onError" :on-success="handleSuccessUp" drag
                   :data="{planYear: planYear, examineUserId: examineUserId}"
                   name="file">
          <i class="el-icon-upload"></i>
          <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
        </el-upload>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button @click="uploadDia = false">取 æ¶ˆ</el-button>
        <el-button :loading="uploading" type="primary" @click="submitUpload">上 ä¼ </el-button>
      </span>
    </el-dialog>
    <!--生成报告弹框-->
    <el-dialog :visible.sync="uploadDia1" title="生成报告" width="500px">
      <div v-if="approvalRemarks">
        æ‰¹å‡†æ„è§ï¼š
        <el-input v-model="approvalRemarks" :disabled="this.ratifyStatus === 1" type="textarea"></el-input>
      </div>
      <div style="margin: 0 auto;">
        <el-upload ref="upload1" :action="action1" :auto-upload="false"
                   :data="{qualityMonitorDetailsId: qualityMonitorDetailsId}" :file-list="fileList1" :headers="headers"
                   :limit="1"
                   :on-change="beforeUpload1" :on-error="onError1" :on-success="onSuccess1" accept='.doc,.docx'
                   drag
                   name="file">
          <i class="el-icon-upload"></i>
          <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
        </el-upload>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button @click="uploadDia1 = false">取 æ¶ˆ</el-button>
        <el-button :loading="uploading1" type="primary" @click="submitUpload1()">上 ä¼ </el-button>
      </span>
    </el-dialog>
  </div>
</template>
<script>
import DetailFormDialog from './components/detailFormDialog.vue';
import CarryOutDialog from './components/carryOutDialog.vue';
import EvaluateDialog from './components/evaluateDialog.vue';
import filePreview from "@/components/Preview/filePreview.vue";
import limsTable from "@/components/Table/lims-table.vue";
import {
  delQualityMonitorDetail,
  delQualitySupervise,
  examineQualityMonitor, exportQualityMonitorDetail, exportQualityMonitorEvaluate, exportQualityMonitorRatify,
  pageQualityMonitor, pageQualityMonitorDetail, ratifyFinishReport,
  ratifyQualityMonitor
} from "@/api/cnas/process/ensureResultsValidity/qualityMonitor";
import {selectUserCondition} from "@/api/performance/class";
import {getToken} from "@/utils/auth";
export default {
  name: 'a7-Ensure-results-validity',
  // import å¼•入的组件需要注入到对象中才能使用
  components: {limsTable, filePreview, EvaluateDialog, CarryOutDialog, DetailFormDialog },
  data() {
    // è¿™é‡Œå­˜æ”¾æ•°æ®
    return {
      examineUserId: '',
      responsibleOptions: [],
      yearForm: {
        monitorName: '',
      },
      yearPage: {
        current: 1,
        size: 20,
        total: 0
      },
      yearColumnData: [
        {
          label: '计划名称',
          prop: 'monitorName',
          minWidth: '150px'
        }, {
          label: '编制人',
          prop: 'writeName',
          minWidth: '100'
        }, {
          label: '编制日期',
          prop: 'writeTime',
          minWidth: '160'
        }, {
          dataType: 'tag',
          label: '审核状态',
          prop: 'examineStatus',
          minWidth: '100',
          formatData: (params) => {
            if (params === 0) {
              return '不通过';
            } else if (params === 1) {
              return '通过';
            } else {
              return null;
            }
          },
          formatType: (params) => {
            if (params === 0) {
              return 'danger';
            } else if (params === 1) {
              return 'success';
            } else {
              return null;
            }
          }
        }, {
          label: '审核内容',
          prop: 'examineRemark',
          minWidth: '100'
        }, {
          label: '审核人',
          prop: 'examineName',
          minWidth: '100'
        }, {
          label: '审核日期',
          prop: 'examineTime',
          minWidth: '160'
        },{
          dataType: 'tag',
          label: '批准状态',
          prop: 'ratifyStatus',
          minWidth: '100',
          formatData: (params) => {
            if (params === 0) {
              return '不批准';
            } else if (params === 1) {
              return '批准';
            } else {
              return null;
            }
          },
          formatType: (params) => {
            if (params === 0) {
              return 'danger';
            } else if (params === 1) {
              return 'success';
            } else {
              return null;
            }
          }
        },{
          label: '批准内容',
          prop: 'ratifyRemark',
          minWidth: '100'
        },{
          label: '批准人',
          prop: 'ratifyName',
          minWidth: '100'
        },{
          label: '批准日期',
          prop: 'ratifyTime',
          minWidth: '160'
        }, {
          dataType: 'action',
          minWidth: '190',
          label: '操作',
          fixed: 'right',
          operation: [
            {
              name: '审核',
              type: 'text',
              disabled: (row) => {
                if (row.examineStatus === 1 || JSON.parse(localStorage.getItem("user")).userId != row.examineUserId) {
                  return true
                } else {
                  return false
                }
              },
              clickFun: (row) => {
                this.examinePlan(row)
              }
            },
            {
              name: '批准',
              type: 'text',
              disabled: (row) => {
                if (row.ratifyStatus === 1 || row.examineStatus !== 1 || JSON.parse(localStorage.getItem("user")).userId != row.ratifyUserId) {
                  return true
                } else {
                  return false
                }
              },
              clickFun: (row) => {
                this.approvalPlan(row)
              }
            },
            {
              name: '导出',
              type: 'text',
              clickFun: (row) => {
                this.handleDown(row)
              },
              disabled: (row) => {
                if (row.ratifyStatus !== 1) {
                  return true
                } else {
                  return false
                }
              },
            },
            {
              name: '删除',
              type: 'text',
              color: '#f56c6c',
              clickFun: (row) => {
                this.delPlan(row)
              },
              disabled: (row) => {
                if(row.examineStatus === 1) {
                  return true;
                } else {
                  return false;
                }
              },
            }
          ]
        }],
      yearTableData: [],  // å¹´è¡¨
      yearLoading: false,
      yearDetailForm: {
        monitorPurpose: '',
        monitorProject: '',
      },
      yearDetailColumnData: [
        {
          label: '监控目的',
          prop: 'monitorPurpose',
          width: '150px',
          showOverflowTooltip: true,
        }, {
          label: '计划开展时间',
          prop: 'plannedTime',
          minWidth: '150px'
        }, {
          label: '监控项目',
          prop: 'monitorProject',
          minWidth: '150px'
        }, {
          label: '参加单位(人员)',
          prop: 'participant',
          minWidth: '150px'
        }, {
          label: '预算(元)',
          prop: 'budget',
          minWidth: '150px'
        },{
          label: '组织人员',
          prop: 'organization',
          minWidth: '150px'
        },{
          label: '监控方式',
          prop: 'monitorWay',
          minWidth: '150px'
        }, {
          dataType: 'action',
          width: '280',
          label: '操作',
          fixed: 'right',
          operation: [
            {
              name: '编辑',
              type: 'text',
              clickFun: (row) => {
                this.showDialog('edit', row)
              }
            },
            {
              name: '实施',
              type: 'text',
              clickFun: (row) => {
                this.carryOut(row)
              }
            },
            {
              name: '完成报告',
              type: 'text',
              clickFun: (row) => {
                this.record(row)
              },
            },
            {
              name: '评价',
              type: 'text',
              clickFun: (row) => {
                this.evaluate(row)
              }
            },
            {
              name: '导出',
              type: 'text',
              clickFun: (row) => {
                this.downLoadPost(row);
              },
            },
            {
              name: '删除',
              type: 'text',
              color: '#f56c6c',
              clickFun: (row) => {
                this.delYearPlanDetail(row)
              }
            }
          ]
        }
      ],
      yearDetailTableData: [], // å¹´æ˜Žç»†è¡¨
      yearDetailLoading: false,
      yearDetailPage: {
        current: 1,
        size: 20,
        total: 0
      },
      formDia: false,
      qualityMonitorId: '',
      carryOutDia: false,
      evaluateDialog: false,
      examineDialog: false,
      examineLoading: false,
      ratifyDialog: false,
      ratifyLoading: false,
      examineInfo: {},
      ratifyInfo: {},
      upLoading: false,
      uploadDia: false,
      uploadDia1: false,
      uploading: false,
      uploading1: false,
      fileList: [],
      fileList1: [],
      lookDialogVisible: false,
      lookDialogLoading: false,
      currentInfo: {},
      qualityMonitorDetailsId: '',
      ratifyStatus: '',
      approvalRemarks: '',
      downloadDialog: false,
      download: {},
      planYear: '',
      headers: {
        Authorization: "Bearer " + getToken(),
      },
    };
  },
  mounted() {
    this.getYearPlanList()
  },
  // æ–¹æ³•集合
  methods: {
    // æŸ¥è¯¢å¹´åº¦è®¡åˆ’表
    getYearPlanList () {
      const entity = {
        monitorName: this.yearForm.monitorName,
      }
      const page = this.yearPage
      this.yearLoading = true
      pageQualityMonitor({ ...entity, ...page }).then(res => {
        this.yearLoading = false
        this.yearTableData = res.data.records
        this.yearPage.total = res.data.total
        if (this.yearTableData.length > 0) {
          this.rowClick(this.yearTableData[0])
        }
      }).catch(err => {
        console.log('err---', err);
        this.yearLoading = false
      })
    },
    clearYear () {
      this.yearForm.monitorName = ''
      this.getYearPlanList()
    },
    pagination({ page, limit }) {
      this.yearPage.current = page;
      this.yearPage.size = limit;
      this.getYearPlanList();
    },
    pagination1({ page, limit }) {
      this.yearDetailPage.current = page;
      this.yearDetailPage.size = limit;
      this.getYearPlanList();
    },
    leadInto () {
      this.uploadDia = true
      this.getUserList()
    },
    // å¯¼å…¥æµç¨‹
    beforeUpload(file) {
      if (file.size > 1024 * 1024 * 10) {
        this.$message.error('上传文件不超过10M');
        this.$refs.upload.clearFiles()
        return false;
      } else {
        return true;
      }
    },
    onError(err, file, fileList) {
      this.$message.error('上传失败')
      this.$refs.upload.clearFiles()
    },
    handleSuccessUp(response) {
      this.uploading = false;
      if (response.code == 200) {
        this.$message.success('上传成功');
      } else {
        this.$message.error(response.msg)
      }
    },
    submitUpload () {
      if (!this.planYear) {
        this.$message.warning('请选择年份')
        return;
      }
      if (!this.examineUserId) {
        this.$message.warning('请选择批准人')
        return;
      }
      this.$refs.upload.submit();
      this.timer = setTimeout(() => {
        this.uploadDia = false
        this.fileList = []
        this.planYear = ''
        this.examineUserId = ''
        this.getYearPlanList()
      }, 1000)
    },
    // end
    // å®¡æ ¸
    examinePlan (row) {
      this.examineDialog = true
      this.examineInfo = row
      this.getUserList()
    },
    handleReview (examineStatus) {
      // å®¡æ ¸çŠ¶æ€ , 0 ä¸é€šè¿‡, 1通过
      this.examineInfo.examineStatus = examineStatus
      this.examineLoading = true
      examineQualityMonitor(this.examineInfo).then(res => {
        this.examineLoading = false
        this.$message.success('操作成功')
        this.closeExamineDia()
      }).catch(err => {
        console.log('err---', err);
        this.examineLoading = false
      })
    },
    closeExamineDia () {
      this.examineDialog = false
      this.examineInfo.examineRemark = ''
      this.getYearPlanList()
    },
    // æ‰¹å‡†
    approvalPlan (row) {
      this.ratifyDialog = true
      this.ratifyInfo = row
    },
    handleRatify (ratifyStatus) {
      // æ‰¹å‡†çŠ¶æ€ , 0 ä¸é€šè¿‡, 1通过
      this.ratifyInfo.ratifyStatus = ratifyStatus
      this.ratifyLoading = true
      ratifyQualityMonitor(this.ratifyInfo).then(res => {
        this.ratifyLoading = false
        this.$message.success('操作成功')
        this.closeRatifyDia()
      }).catch(err => {
        console.log('err---', err);
        this.ratifyLoading = false
      })
    },
    closeRatifyDia () {
      this.ratifyDialog = false
      this.ratifyInfo.ratifyRemark = ''
      this.getYearPlanList()
    },
    // æ‰¹å‡†æŠ¥å‘Š
    handleApproval (status) {
      const personTrainingUpdateDto = {
        qualityMonitorDetailsId: this.currentInfo.qualityMonitorDetailsId,
        ratifyRemark: this.approvalRemarks,
        ratifyStatus: status
      }
      this.lookDialogLoading = true
      ratifyFinishReport(personTrainingUpdateDto).then(res => {
        if (res.code === 200) {
          this.$message.success('提交成功!');
          this.lookDialogVisible = false
          this.getYearDetailPlanList();
        }
        this.lookDialogLoading = false
      }).catch(() => {
        this.lookDialogLoading = false
      })
    },
    // å¯¼å‡º
    handleDown (row) {
      exportQualityMonitorDetail({qualityMonitorId: row.qualityMonitorId}).then(res => {
        this.outLoading = false
        const blob = new Blob([res],{ type: 'application/msword' });
        this.$download.saveAs(blob, row.monitorName + '.docx')
        this.$message.success('导出成功')
      })
    },
    // åˆ é™¤è¿›åº¦è®¡åˆ’表
    delPlan (row) {
      this.$confirm('此操作将永久删除该数据, æ˜¯å¦ç»§ç»­?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.yearLoading = true
        delQualitySupervise({qualityMonitorId: row.qualityMonitorId}).then(res => {
          this.yearLoading = false
          this.$message.success('删除成功')
          this.getYearPlanList()
        }).catch(err => {
          this.yearLoading = false
          console.log('err---', err);
        })
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '已取消删除'
        });
      });
    },
    // å¹´åº¦è®¡åˆ’表格,点击行数据后刷新详情
    rowClick(row) {
      this.qualityMonitorId = row.qualityMonitorId
      this.getYearDetailPlanList()
    },
    // èŽ·å–å¹´åº¦æ˜Žç»†è¡¨
    getYearDetailPlanList () {
      const entity = {
        qualityMonitorId: this.qualityMonitorId,
        monitorPurpose: this.yearDetailForm.monitorPurpose,
        monitorProject: this.yearDetailForm.monitorProject,
      }
      const page = this.yearDetailPage
      this.yearDetailLoading = true
      pageQualityMonitorDetail({ ...entity, ...page }).then(res => {
        this.yearDetailLoading = false
        this.yearDetailTableData = res.data.records
        this.yearDetailPage.total = res.data.total
      }).catch(err => {
        console.log('err---', err);
        this.yearDetailLoading = false
      })
    },
    // é‡ç½®æ˜Žç»†è¡¨
    clearDetail () {
      this.yearDetailForm = {
        monitorPurpose: '',
        monitorProject: ''
      }
      this.getYearDetailPlanList()
    },
    // æ˜Žç»†è¡¨å®žæ–½
    carryOut (row) {
      this.carryOutDia = true
      this.$nextTick(() => {
        this.$refs.carryOutDia.openDia(row)
      })
    },
    closeCarryOutDia () {
      this.carryOutDia = false
      this.getYearDetailPlanList()
    },
    // æ‰“开报告弹框
    record (row) {
      this.qualityMonitorDetailsId = row.qualityMonitorDetailsId
      this.approvalRemarks = row.approvalRemarks
      if (row.finishReportUrl) {
        this.currentInfo = row
        this.ratifyStatus = row.ratifyStatus
        this.lookDialogVisible = true
      } else {
        this.uploadDia1 = true
      }
    },
    onSuccess1(response, file, fileList) {
      this.$refs.upload1.clearFiles()
      this.uploading1 = false
      if (response.code == 200) {
        this.$message.success('上传成功');
        this.uploadDia1 = false
      } else {
        this.$message.error(response.msg)
      }
      this.getYearDetailPlanList()
    },
    beforeUpload1(file) {
      if (file.size > 1024 * 1024 * 10) {
        this.$message.error('上传文件不超过10M');
        this.$refs.upload1.clearFiles()
        return false;
      } else {
        return true;
      }
    },
    onError1(err, file, fileList) {
      this.$message.error('上传失败')
      this.$refs.upload1.clearFiles()
      this.uploading1 = false
    },
    submitUpload1() {
      if (this.$refs.upload1.uploadFiles.length === 0) {
        this.$message.error('未选择文件')
        return
      }
      this.uploading1 = true
      this.$refs.upload1.submit();
      this.uploadDia1 = false;
    },
    // end
    // æ‰“开评价弹框
    evaluate (row) {
      this.evaluateDialog = true
      this.$nextTick(() => {
        this.$refs.evaluateDialog.openDia(row)
      })
    },
    closeEvaDia () {
      this.evaluateDialog = false
      this.getYearDetailPlanList()
    },
    // æ‰“开导出弹框
    downLoadPost (row) {
      this.downloadDialog = true
      this.download = row
    },
    // æ‰“开年度明细新增、修改弹框
    showDialog (type, row) {
      this.formDia = true
      this.$nextTick(() => {
        this.$refs.formDia.openDia(type, row)
      })
    },
    closeDia () {
      this.formDia = false
      this.getYearDetailPlanList()
    },
    // æŽ§åˆ¶å•导出
    controlDown() {
      exportQualityMonitorRatify({qualityMonitorDetailsId: this.download.qualityMonitorDetailsId}).then(res => {
        this.outLoading = false
        const blob = new Blob([res], { type: 'application/msword' });
        this.$download.saveAs(blob, '质量监控实施计划.docx')
        this.$message.success('导出成功')
      })
    },
    // å¤„理单导出
    processingDown() {
      exportQualityMonitorEvaluate({qualityMonitorDetailsId: this.download.qualityMonitorDetailsId}).then(res => {
        this.outLoading = false
        const blob = new Blob([res], { type: 'application/msword' });
        this.$download.saveAs(blob, '质量监控评价.docx')
        this.$message.success('导出成功')
      })
    },
    delYearPlanDetail (row) {
      this.$confirm('此操作将永久删除该数据, æ˜¯å¦ç»§ç»­?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.yearDetailLoading = true
        delQualityMonitorDetail({qualityMonitorDetailsId: row.qualityMonitorDetailsId}).then(res => {
          this.yearDetailLoading = false
          this.$message.success('删除成功')
          this.getYearDetailPlanList()
        }).catch(err => {
          this.yearDetailLoading = false
          console.log('err---', err);
        })
      })
    },
    // èŽ·å–è´Ÿè´£äººä¿¡æ¯æŽ¥å£
    getUserList() {
      selectUserCondition().then((res) => {
        this.responsibleOptions = res.data;
      })
    }
  },
  // ç”¨äºŽä¸Šä¼ æ–‡ä»¶çš„信息
  computed: {
    action() {
      return this.javaApi + '/qualityMonitor/importQualityMonitor'
    },
    action1() {
      return this.javaApi + '/qualityMonitor/uploadFinishReport'
    }
  },
  beforeDestroy() {
    clearTimeout(this.timer);
  }
};
</script>
<style scoped>
</style>
src/views/business/inspectionReview/index.vue
@@ -27,18 +27,6 @@
                  :rowClassName="rowClassName" :height="'calc(100vh - 270px)'" @pagination="pagination"
                  key="tableData0"></lims-table>
    </div>
<!--    <div style="width: 100%;height: 100%;" v-if="activeFace >0 && isCopper == null">-->
<!--      <Add :active="activeFace" :currentId="currentId"/>-->
<!--    </div>-->
<!--    <div style="width: 100%;height: 100%;" v-if="activeFace >0 && isCopper == 0">-->
<!--      <CustomsInspection :active="activeFace" :customsInspection="customsInspection" :currentId="currentId"/>-->
<!--    </div>-->
<!--    <div style="width: 100%;height: 100%;" v-if="activeFace >0 && isCopper == 1">-->
<!--      <CopperOrder :active="activeFace" :currentId="currentId"></CopperOrder>-->
<!--    </div>-->
<!--    <Inspection v-if="state>0" @goback="goback" :orderId="orderId" :sonLaboratory="componentData.entity.sonLaboratory" :typeSource="typeSource" :state="state"/>-->
<!--    &lt;!&ndash;产业链信息查看&ndash;&gt;-->
<!--    <ShowInfo v-if="showInfoDialog" :showInfoDialog="showInfoDialog" ref="showInfoDialog"></ShowInfo>-->
    <!--报告查看-->
    <el-dialog title="报告查看" :visible.sync="issuedVisible" width="80vw" :modal-append-to-body="false"
               :fullscreen="fullscreen">
@@ -65,7 +53,6 @@
import {selectInsOrderPlanList, selectUserCondition} from "@/api/business/inspectionTask";
import {mapGetters} from "vuex";
import {upReportUrl} from "@/api/business/insReport";
import {delfile} from "@/api/business/rawMaterialOrder";
import filePreview from "@/components/Preview/filePreview.vue";
export default {