gaoluyang
2025-02-26 869dbe90202f17a5ac2c0262653e763d95aea039
质量监督记录搬迁
已修改1个文件
已重命名6个文件
已添加6个文件
2503 ■■■■■ 文件已修改
src/api/cnas/process/ensureResults/qualityMonitor.js 补丁 | 查看 | 原始文档 | blame | 历史
src/api/cnas/process/ensureResults/qualitySupervise.js 182 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main.js 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/process/ensureResults/ensureResultsValidity/components/ViewRecord.vue 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/process/ensureResults/ensureResultsValidity/components/carryOutDialog.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/process/ensureResults/ensureResultsValidity/components/detailFormDialog.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/process/ensureResults/ensureResultsValidity/components/evaluateDialog.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/process/ensureResults/ensureResultsValidity/index.vue 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/process/ensureResults/qualityControlPlan/components/detailFormDialog.vue 174 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/process/ensureResults/qualityControlPlan/components/processingSheet.vue 510 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/process/ensureResults/qualityControlPlan/components/recordsDialog.vue 426 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/process/ensureResults/qualityControlPlan/components/rectifyDialogNew.vue 460 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/process/ensureResults/qualityControlPlan/index.vue 716 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/cnas/process/ensureResults/qualityMonitor.js
src/api/cnas/process/ensureResults/qualitySupervise.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,182 @@
// è´¨é‡ç›‘督计划页面相关接口
import request from '@/utils/request'
// è´¨é‡ç›‘督年计划列表
export function pageQualitySupervise(query) {
  return request({
    url: '/qualitySupervise/pageQualitySupervise',
    method: 'get',
    params: query
  })
}
// è´¨é‡ç›‘督年计划列表
export function ratifyQualitySupervise(query) {
  return request({
    url: '/qualitySupervise/ratifyQualitySupervise',
    method: 'post',
    data: query
  })
}
// è´¨é‡ç›‘督年计划列表
export function exportQualitySupervise(query) {
  return request({
    url: '/qualitySupervise/exportQualitySupervise',
    method: 'get',
    data: query,
    responseType: "blob"
  })
}
// åˆ é™¤ç›‘督计划
export function delQualitySupervise(query) {
  return request({
    url: '/qualitySupervise/delQualitySupervise',
    method: 'delete',
    params: query,
  })
}
// è´¨é‡ç›‘督年计划列表
export function pageQualitySuperviseDetail(query) {
  return request({
    url: '/qualitySupervise/pageQualitySuperviseDetail',
    method: 'get',
    params: query,
  })
}
// å¯¼å‡ºè´¨é‡ç›‘督计划记录单
export function exportSuperviseDetailRecord(query) {
  return request({
    url: '/qualitySupervise/exportSuperviseDetailRecord',
    method: 'get',
    params: query,
    responseType: "blob"
  })
}
// å¯¼å‡ºä¸ç¬¦åˆé¡¹
export function superviseDetailAccordingExport(query) {
  return request({
    url: '/qualitySupervise/superviseDetailAccordingExport',
    method: 'get',
    params: query,
    responseType: "blob"
  })
}
// å¯¼å‡ºç›‘督纠正措施
export function exportSuperviseDetaillCorrect(query) {
  return request({
    url: '/qualitySupervise/exportSuperviseDetaillCorrect',
    method: 'get',
    params: query,
    responseType: "blob"
  })
}
// åˆ é™¤ç›‘督计划详情
export function delQualitySuperviseDetail(query) {
  return request({
    url: '/qualitySupervise/delQualitySuperviseDetail',
    method: 'delete',
    params: query,
  })
}
// æ–°å¢žç›‘督计划详情
export function addQualitySuperviseDetail(query) {
  return request({
    url: '/qualitySupervise/addQualitySuperviseDetail',
    method: 'post',
    data: query,
  })
}
// ä¿®æ”¹ç›‘督计划详情
export function updateQualitySuperviseDetail(query) {
  return request({
    url: '/qualitySupervise/updateQualitySuperviseDetail',
    method: 'post',
    data: query,
  })
}
// æŸ¥è¯¢ç›‘督计划记录流程详情
export function getSuperviseDetailRecord(query) {
  return request({
    url: '/qualitySupervise/getSuperviseDetailRecord',
    method: 'get',
    params: query,
  })
}
// æ–°å¢žç›‘督记录信息
export function addSuperviseDetailRecord(query) {
  return request({
    url: '/qualitySupervise/addSuperviseDetailRecord',
    method: 'post',
    data: query,
  })
}
// æäº¤ç›‘督记录批准
export function addSuperviseRecordOpinion(query) {
  return request({
    url: '/qualitySupervise/addSuperviseRecordOpinion',
    method: 'post',
    data: query,
  })
}
// èŽ·å–å½“å‰ç›‘ç£è®°å½•çš„ç›‘ç£å‘˜åˆ—è¡¨
export function getRecordUser(query) {
  return request({
    url: '/qualitySupervise/getRecordUser',
    method: 'get',
    params: query,
  })
}
// æŸ¥è¯¢ç›‘督记录不符合控制信息
export function getSuperviseDetailAccording(query) {
  return request({
    url: '/qualitySupervise/getSuperviseDetailAccording',
    method: 'get',
    params: query,
  })
}
// (装备流程)新增监督记录不符合控制信息
export function addEquipSuperviseDetailAccording(query) {
  return request({
    url: '/qualitySupervise/addEquipSuperviseDetailAccording',
    method: 'post',
    data: query,
  })
}
// (装备流程)批准监督记录不符合控制信息
export function approverEquipSuperviseDetailAccording(query) {
  return request({
    url: '/qualitySupervise/approverEquipSuperviseDetailAccording',
    method: 'post',
    data: query,
  })
}
// æŸ¥è¯¢ç›‘督纠正处理
export function getSuperviseDetailCorrect(query) {
  return request({
    url: '/qualitySupervise/getSuperviseDetailCorrect',
    method: 'get',
    params: query,
  })
}
// (装备流程)新增监督纠正处理
export function addEquipSuperviseDetailCorrect(query) {
  return request({
    url: '/qualitySupervise/addEquipSuperviseDetailCorrect',
    method: 'post',
    data: query,
  })
}
// (装备流程)批准监督纠正处理
export function approveEquipSuperviseDetailCorrect(query) {
  return request({
    url: '/qualitySupervise/approveEquipSuperviseDetailCorrect',
    method: 'post',
    data: query,
  })
}
// (装备流程)批准监督纠正处理
export function getThisYearTrainingDetailed(query) {
  return request({
    url: '/personTraining/getThisYearTrainingDetailed',
    method: 'get'
  })
}
src/main.js
@@ -66,11 +66,20 @@
};
Vue.prototype.javaApi = process.env.VUE_APP_BASE_API
  ? process.env.VUE_APP_BASE_API
  : "http://192.168.0.170:8002";
  : "http://192.168.1.36:8002";
Vue.prototype.checkPermi = checkPermi;
Vue.prototype.uploadHeader = {
  Authorization: "Bearer " + getToken(),
};
// è§£å†³el-radio-group单选框自身的bug
Vue.directive('removeAriaHidden', {
  bind(el, binding) {
    let ariaEls = el.querySelectorAll('.el-radio__original');
    ariaEls.forEach((item) => {
      item.removeAttribute('aria-hidden');
    });
  }
})
// å…¨å±€ç»„件挂载
Vue.component("DictTag", DictTag);
src/views/CNAS/process/ensureResults/ensureResultsValidity/components/ViewRecord.vue
src/views/CNAS/process/ensureResults/ensureResultsValidity/components/carryOutDialog.vue
ÎļþÃû´Ó src/views/CNAS/process/ensureResultsValidity/components/carryOutDialog.vue ÐÞ¸Ä
@@ -184,7 +184,7 @@
import {
  addQualityMonitorRatify, addQualityMonitorRatifyOpinion,
  getQualityMonitorRatify
} from "@/api/cnas/process/ensureResultsValidity/qualityMonitor";
} from "@/api/cnas/process/ensureResults/qualityMonitor";
import {selectUserCondition} from "@/api/business/inspectionTask";
export default {
src/views/CNAS/process/ensureResults/ensureResultsValidity/components/detailFormDialog.vue
ÎļþÃû´Ó src/views/CNAS/process/ensureResultsValidity/components/detailFormDialog.vue ÐÞ¸Ä
@@ -53,7 +53,7 @@
import {
  addQualityMonitorDetail,
  updateQualityMonitorDetail
} from "@/api/cnas/process/ensureResultsValidity/qualityMonitor";
} from "@/api/cnas/process/ensureResults/qualityMonitor";
export default {
  name: 'detailFormDialog',
src/views/CNAS/process/ensureResults/ensureResultsValidity/components/evaluateDialog.vue
ÎļþÃû´Ó src/views/CNAS/process/ensureResultsValidity/components/evaluateDialog.vue ÐÞ¸Ä
@@ -162,7 +162,7 @@
import {
  addMonitorEvaluateOpinion, addQualityMonitorEvaluate,
  getQualityMonitorEvaluate
} from "@/api/cnas/process/ensureResultsValidity/qualityMonitor";
} from "@/api/cnas/process/ensureResults/qualityMonitor";
import {selectUserCondition} from "@/api/business/inspectionTask";
import {selectUserDepartmentLimsName} from "@/api/system/user";
src/views/CNAS/process/ensureResults/ensureResultsValidity/index.vue
ÎļþÃû´Ó src/views/CNAS/process/ensureResultsValidity/index.vue ÐÞ¸Ä
@@ -19,7 +19,7 @@
        </div>
      </div>
      <lims-table :tableData="yearTableData" :column="yearColumnData" :page="yearPage" :tableLoading="yearLoading"
                  height="40vh" @pagination="pagination"
                  height="40vh" @pagination="pagination" :rowClick="rowClick"
                  key="yearTableData"></lims-table>
    </div>
    <div style="margin-top: 20px">
@@ -182,7 +182,7 @@
  examineQualityMonitor, exportQualityMonitorDetail, exportQualityMonitorEvaluate, exportQualityMonitorRatify,
  pageQualityMonitor, pageQualityMonitorDetail, ratifyFinishReport,
  ratifyQualityMonitor
} from "@/api/cnas/process/ensureResultsValidity/qualityMonitor";
} from "@/api/cnas/process/ensureResults/qualityMonitor";
import {selectUserCondition} from "@/api/performance/class";
import {mapGetters} from "vuex";
@@ -534,6 +534,13 @@
      this.uploading = false;
      if (response.code == 200) {
        this.$message.success('上传成功');
        this.timer = setTimeout(() => {
          this.uploadDia = false
          this.fileList = []
          this.planYear = ''
          this.examineUserId = ''
          this.getYearPlanList()
        }, 1000)
      } else {
        this.$message.error(response.msg)
      }
@@ -548,13 +555,6 @@
        return;
      }
      this.$refs.upload.submit();
      this.timer = setTimeout(() => {
        this.uploadDia = false
        this.fileList = []
        this.planYear = ''
        this.examineUserId = ''
        this.getYearPlanList()
      }, 1000)
    },
    // end
    // å®¡æ ¸
src/views/CNAS/process/ensureResults/qualityControlPlan/components/detailFormDialog.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,174 @@
<template>
  <div>
    <el-dialog :close-on-click-modal="false" :close-on-press-escape="false"
               :title="operationType === 'edit'? '编辑' : '新增'"
               :visible.sync="formDia"
               width="80%" @close="closeDia">
      <el-form ref="form" :model="form" :rules="rules" label-width="140px">
        <el-col :span="12">
          <el-form-item label="监督日期" prop="superviseTime">
            <el-date-picker
              v-model="form.superviseTime"
              clearable
              format="yyyy-MM"
              placeholder="选择日期"
              size="small"
              style="width: 100%"
              type="month"
              value-format="yyyy-MM">
            </el-date-picker>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="监督目的" prop="supervisePurpose">
            <el-input v-model="form.supervisePurpose" clearable size="small"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="监控项目" prop="superviseProject">
            <el-input v-model="form.superviseProject" clearable size="small"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="被监督人员" prop="supervisedUserId">
            <el-select @change="usePersonName" v-model="form.supervisedUserId" placeholder="请选择" size="small" style="width: 100%">
              <el-option v-for="item in userList" :key="item.id" :label="item.name" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="监督原因" prop="superviseReason">
            <el-input v-model="form.superviseReason" clearable size="small"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="备注" prop="remark">
            <el-input v-model="form.remark" clearable size="small"></el-input>
          </el-form-item>
        </el-col>
      </el-form>
      <span slot="footer" class="dialog-footer">
                    <el-button @click="closeDia">取 æ¶ˆ</el-button>
                    <el-button :loading="upLoad" type="primary" @click="submitForm">ç¡® å®š</el-button>
        </span>
    </el-dialog>
  </div>
</template>
<script>
import {
  addQualitySuperviseDetail,
  updateQualitySuperviseDetail
} from "@/api/cnas/process/ensureResults/qualitySupervise";
import {selectUserCondition} from "@/api/business/inspectionTask";
export default {
  name: 'detailFormDialog',
  // import å¼•入的组件需要注入到对象中才能使用
  components: {},
  props: ['superviseId'],
  data() {
    // è¿™é‡Œå­˜æ”¾æ•°æ®
    return {
      formDia: false,
      form: {
        qualityMonitorDetailsId: '',
        superviseTime: '',
        supervisePurpose: '',
        superviseProject: '',
        supervisee: '',
        supervisedUserId: '',
        superviseReason: '',
        remark: '',
        superviseDetailsId: '',
      },
      rules: {
        superviseTime: [{ required: true, message: '请输入监督日期', trigger: 'blur' }],
        supervisePurpose: [{ required: true, message: '请输入监督目的', trigger: 'blur' }],
        superviseProject: [{ required: false, message: '请输入监控项目', trigger: 'blur' }],
      },
      upLoad: false,
      operationType: '',
      userList: [],
    };
  },
  // æ–¹æ³•集合
  methods: {
    openDia(type, row) {
      this.formDia = true
      this.operationType = type
      this.getUserList()
      if (type === 'edit') {
        this.searchInfo(row)
      }
    },
    usePersonName (value) {
      const index = this.userList.findIndex(item => item.id === value)
      if (index > -1) {
        this.form.supervisee = this.userList[index].name
      }
    },
    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.superviseId = this.superviseId
      this.upLoad = true
      addQualitySuperviseDetail(entity).then(res => {
        this.upLoad = false
        this.$message.success('新增成功')
        this.closeDia()
      }).catch(err => {
        console.log('err---', err);
        this.upLoad = false
      })
    },
    // æäº¤ä¿®æ”¹
    handleEdit () {
      const entity = this.HaveJson(this.form)
      this.upLoad = true
      updateQualitySuperviseDetail(entity).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')
    },
    getUserList(){
      selectUserCondition({ type: 0 }).then((res) => {
        this.userList = res.data;
      })
    },
  }
};
</script>
<style scoped>
>>>.el-dialog__body {
  max-height: 720px;
  overflow-y: auto;
}
</style>
src/views/CNAS/process/ensureResults/qualityControlPlan/components/processingSheet.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,510 @@
<template>
  <div>
    <el-dialog :close-on-click-modal="false" :close-on-press-escape="false"
               :visible.sync="formDia"
               title="不符合工作控制单"
               width="60%" @close="closeProcessingDia">
      <el-steps :active="currentStep" align-center finish-status="success">
        <el-step title="不符合工作情况记录"></el-step>
        <el-step title="批准"></el-step>
      </el-steps>
      <div style="height: 510px;overflow-y: auto">
        <table border="1" cellspacing="10" class="tables">
          <tr>
            <td class="td-title">
              <p>发生部门:</p>
            </td>
            <td class="td-info">
              <el-input v-if="currentStep === 0" v-model="form.occurrenceDepartment"
                        placeholder="请输入内容"
                        size="small">
              </el-input>
              <span v-if="currentStep !== 0" class="td-info1"> {{ form.occurrenceDepartment }}</span>
            </td>
            <td class="td-title">
              <p>部门负责人:</p>
            </td>
            <td class="td-info">
              <el-input v-if="currentStep === 0" v-model="form.headDepartment"
                        placeholder="请输入内容"
                        size="small">
              </el-input>
              <span v-if="currentStep !== 0" class="td-info1"> {{ form.headDepartment }}</span>
            </td>
          </tr>
          <tr>
            <td class="td-title">
              <p><span class="required-span">* </span>不符合工作发现途径:</p>
            </td>
            <td class="td-info" colspan="3">
              <el-radio-group v-model="form.findWay" v-removeAriaHidden :disabled="currentStep !== 0">
                <el-radio :label="0">管理评审</el-radio>
                <el-radio :label="1">内部审核</el-radio>
                <el-radio :label="2">检测过程控制</el-radio>
                <el-radio :label="3">内部质量控制</el-radio>
                <el-radio :label="4">内部监督</el-radio>
                <el-radio :label="5">外部评审</el-radio>
                <el-radio :label="6">外部投诉</el-radio>
                <el-radio :label="7">其他</el-radio>
              </el-radio-group>
            </td>
          </tr>
          <tr>
            <td class="td-title">
              <p>不符合工作的详细记录:</p>
            </td>
            <td class="td-info" colspan="3">
              <el-input v-if="currentStep === 0" v-model="form.recordDetail"
                        :rows="4"
                        placeholder="请输入内容"
                        size="small"
                        type="textarea">
              </el-input>
              <span v-if="currentStep !== 0" class="td-info1"> {{ form.recordDetail }}</span>
            </td>
          </tr>
          <tr>
            <td class="td-title">
              <p>不符合工作的以及及条款号:</p>
            </td>
            <td class="td-info" colspan="3">
              <el-input v-if="currentStep === 0" v-model="form.recordAccording"
                        :rows="4"
                        placeholder="请输入内容"
                        size="small"
                        type="textarea">
              </el-input>
              <span v-if="currentStep !== 0" class="td-info1"> {{ form.recordAccording }}</span>
            </td>
          </tr>
          <tr>
            <td class="td-title">
              <p><span class="required-span">* </span>被监督人:</p>
            </td>
            <td class="td-info">
<!--              <el-select v-if="currentStep === 0" v-model="form.supervisedUserId" clearable-->
<!--                         filterable-->
<!--                         placeholder="请选择" size="small">-->
<!--                <el-option v-for="(item,i) in supervisedUserList" :key="i" :label="item.label" :value="item.value">-->
<!--                </el-option>-->
<!--              </el-select>-->
              <span class="td-info1"> {{ form.supervisedUserName }}</span>
            </td>
            <td class="td-title">
              <p><span class="required-span">* </span>被监督时间:</p>
            </td>
            <td class="td-info">
              <el-date-picker
                v-if="currentStep === 0"
                v-model="form.supervisedTime"
                format="yyyy-MM-dd"
                placeholder="选择日期"
                size="small"
                style="width: 80%"
                type="date"
                value-format="yyyy-MM-dd">
              </el-date-picker>
              <span v-if="currentStep !== 0" class="td-info1"> {{ form.supervisedTime }}</span>
            </td>
          </tr>
          <tr v-if="currentStep !== 0">
            <td class="td-title">
              <p>发现部门:</p>
            </td>
            <td class="td-info">
              {{form.foundDepartment}}
            </td>
            <td class="td-title">
              <p>时间:</p>
            </td>
            <td class="td-info">
              {{form.recordTime}}
            </td>
          </tr>
          <tr>
            <td class="td-title" v-if="currentStep !== 0">
              <p>记录人:</p>
            </td>
            <td class="td-info" v-if="currentStep !== 0">
              {{form.recordUserName}}
            </td>
            <td class="td-title">
              <p>记录时间:</p>
            </td>
            <td class="td-info" v-if="currentStep === 0">
              <el-date-picker
                v-model="form.recordTime"
                format="yyyy-MM-dd"
                placeholder="选择日期"
                size="small"
                style="width: 80%"
                type="date"
                value-format="yyyy-MM-dd">
              </el-date-picker>
            </td>
            <td class="td-info" v-if="currentStep !== 0">
              {{form.recordTime}}
            </td>
          </tr>
          <tr>
            <td class="td-title">
              <p><span class="required-span">* </span>消除不符合工作所采取的措施:</p>
            </td>
            <td class="td-info" colspan="3">
              <el-input v-if="currentStep === 0" v-model="form.eliminateMeasure"
                        :rows="5"
                        placeholder="请输入内容"
                        size="small"
                        type="textarea">
              </el-input>
              <span v-if="currentStep !== 0" class="td-info1"> {{ form.eliminateMeasure }}</span>
            </td>
          </tr>
          <tr>
            <td class="td-title" v-if="currentStep !== 0">
              <p>当前负责人:</p>
            </td>
            <td class="td-info" v-if="currentStep !== 0">
              {{form.actionsUserName}}
            </td>
            <td class="td-title">
              <p>处理时间:</p>
            </td>
            <td class="td-info" v-if="currentStep === 0">
              <el-date-picker
                v-model="form.actionsTime"
                format="yyyy-MM-dd"
                placeholder="选择日期"
                size="small"
                style="width: 80%"
                type="date"
                value-format="yyyy-MM-dd">
              </el-date-picker>
            </td>
            <td class="td-info" v-if="currentStep !== 0">
              {{form.actionsTime}}
            </td>
          </tr>
          <tr>
            <td class="td-title">
              <p><span class="required-span">* </span>是否需要采取纠正措施:</p>
            </td>
            <td class="td-info" colspan="3">
              <el-radio-group v-model="form.isCorrect" v-removeAriaHidden :disabled="currentStep !== 0">
                <el-radio :label="0">否</el-radio>
                <el-radio :label="1">是</el-radio>
              </el-radio-group>
            </td>
          </tr>
          <tr>
            <td class="td-title">
              <p>纠正措施处理单跟踪:</p>
            </td>
            <td class="td-info" colspan="3">
              <el-input v-if="currentStep === 0" v-model="form.correctContent"
                        :rows="5"
                        placeholder="请输入内容"
                        size="small"
                        type="textarea">
              </el-input>
              <span v-if="currentStep !== 0" class="td-info1"> {{ form.correctContent }}</span>
            </td>
          </tr>
          <tr>
            <td class="td-title" v-if="currentStep !== 0">
              <p>当前负责人:</p>
            </td>
            <td class="td-info" v-if="currentStep !== 0">
              {{form.correctUserName}}
            </td>
            <td class="td-title">
              <p>纠正填写时间:</p>
            </td>
            <td class="td-info" v-if="currentStep === 0">
              <el-date-picker
                v-model="form.correctTime"
                format="yyyy-MM-dd"
                placeholder="选择日期"
                size="small"
                style="width: 80%"
                type="date"
                value-format="yyyy-MM-dd">
              </el-date-picker>
            </td>
            <td v-if="currentStep !== 0" class="td-info">
              {{form.correctTime}}
            </td>
          </tr>
          <tr>
            <td rowspan="3">
              <p>是否通知客户及可恢复工作</p>
            </td>
          </tr>
          <tr>
            <td class="td-title">
              <p><span class="required-span">* </span>通知客户:</p>
            </td>
            <td class="td-info" colspan="2">
              <el-radio-group v-model="form.notifyCustomer" v-removeAriaHidden :disabled="currentStep !== 0">
                <el-radio :label="0">否</el-radio>
                <el-radio :label="1">是</el-radio>
              </el-radio-group>
            </td>
          </tr>
          <tr>
            <td class="td-title">
              <p><span class="required-span">* </span>恢复工作:</p>
            </td>
            <td class="td-info" colspan="2">
              <el-radio-group v-model="form.backToWork" v-removeAriaHidden :disabled="currentStep !== 0">
                <el-radio :label="0">否</el-radio>
                <el-radio :label="1">是</el-radio>
              </el-radio-group>
            </td>
          </tr>
          <tr>
            <td class="td-title" v-if="currentStep !== 0">
              <p>当前负责人:</p>
            </td>
            <td class="td-info" v-if="currentStep !== 0">
              {{form.qualityManagerUserName}}
            </td>
            <td class="td-title">
              <p>质量负责人填写时间:</p>
            </td>
            <td class="td-info" v-if="currentStep === 0">
              <el-date-picker
                v-model="form.qualityManagerTime"
                format="yyyy-MM-dd"
                placeholder="选择日期"
                size="small"
                style="width: 80%"
                type="date"
                value-format="yyyy-MM-dd">
              </el-date-picker>
            </td>
            <td v-if="currentStep !== 0" class="td-info">
              {{form.qualityManagerTime}}
            </td>
          </tr>
          <tr v-if=" currentStep === 0">
            <td v-if="currentStep === 0" class="td-title">
              <p><span class="required-span">* </span>请选择批准人:</p>
            </td>
            <td v-if="currentStep === 0" class="td-info" colspan="3">
              <el-select v-model="form.approverUserId" 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>
        </table>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button @click="closeProcessingDia">取 æ¶ˆ</el-button>
        <el-button v-if="currentStep !== 2" :loading="editLoad" type="primary" @click="handleEdit">提 äº¤</el-button>
      </span>
    </el-dialog>
  </div>
</template>
<script>
import {
  addEquipSuperviseDetailAccording, approverEquipSuperviseDetailAccording,
  getSuperviseDetailAccording
} from "@/api/cnas/process/ensureResults/qualitySupervise";
import {selectUserCondition} from "@/api/business/inspectionTask";
export default {
  name: 'processingSheet',
  // import å¼•入的组件需要注入到对象中才能使用
  components: {},
  data() {
    // è¿™é‡Œå­˜æ”¾æ•°æ®
    return {
      formDia: false,
      currentStep: 0,
      form: {
        occurrenceDepartment: '',
        headDepartment: '',
        findWay: '',
        recordDetail: '',
        recordAccording: '',
        supervisedUserId: '',
        supervisedUserName: '',
        supervisedTime: '',
        actionsUserName: '',
        eliminateMeasure: '',
        // correctUserId: '',
        correctUserName: '',
        isCorrect: '',
        // qualityManagerUserId: '',
        correctContent: '',
        superviseDetailsId: '',
        superviseDetailsAccordingId: '',
        flowType: '',
        recordUserName: '',
        recordTime: '',
        foundDepartment: '',
        actionsTime: '',
        correctTime: '',
        notifyCustomer: '',
        backToWork: '',
        qualityManagerUserName: '',
        qualityManagerTime: '',
        approverUserId: '',
        approveId: '',
      },
      editLoad: false,
      personList: [],
      supervisedUserList: [],
    };
  },
  // æ–¹æ³•集合
  methods: {
    openDia (row) {
      this.formDia = true
      this.searchInfo(row)
      this.form.superviseDetailsId = row.superviseDetailsId
      this.form.approveId = row.approveId
      this.getAuthorizedPerson() // èŽ·å–äººå‘˜åˆ—è¡¨
      // this.getSupervisedUserList() // èŽ·å–å½“å‰éƒ¨é—¨äººå‘˜
    },
    // æŸ¥è¯¢ç›‘控计划详情实施信息
    searchInfo (row) {
      this.form.qualityMonitorDetailsId = row.qualityMonitorDetailsId
      getSuperviseDetailAccording({superviseDetailsId: row.superviseDetailsId}).then(res => {
        this.form.supervisedUserId = res.data.supervisedUserId
        this.form.supervisedUserName = res.data.supervisedUserName
        if (res.data.superviseDetailsAccordingId === null) {
          this.currentStep = 0
        } else {
          this.form = res.data
          if (res.data.isFinish === 0) {
            if (res.data.approverUserId) {
              this.currentStep = 1
            }
          } else {
            this.currentStep = 2
          }
        }
      }).catch(err => {
        console.log('err---', err);
      })
    },
    // æäº¤
    handleEdit () {
      if (this.currentStep === 0) {
        if (this.form.findWay === null) {
          this.$message.warning('请选择不符合工作发现途径')
          return
        }
        if (!this.form.supervisedTime) {
          this.$message.warning('请选择被监督时间')
          return
        }
        if (this.form.notifyCustomer === null) {
          this.$message.warning('请选择是否通知客户')
          return
        }
        if (this.form.backToWork === null) {
          this.$message.warning('请选择是否恢复工作')
          return
        }
        if (this.form.isCorrect === null) {
          this.$message.warning('请选择是否需要采取纠正措施')
          return
        }
        if (!this.form.approverUserId) {
          this.$message.warning('请选择批准人')
          return
        }
      }
      this.editLoad = true
      this.form.flowType = this.currentStep
      if (this.currentStep === 0) {
        addEquipSuperviseDetailAccording(this.form).then(res => {
          this.editLoad = false
          if (res.code === 201) return
          this.$message.success('提交成功')
          this.closeProcessingDia()
        }).catch(err => {
          console.log('err---', err);
          this.editLoad = false
        })
      } else {
        approverEquipSuperviseDetailAccording(this.form).then(res => {
          this.editLoad = false
          if (res.code === 201) return
          this.$message.success('批准成功')
          this.closeProcessingDia()
        }).catch(err => {
          console.log('err---', err);
          this.editLoad = false
        })
      }
    },
    // å…³é—­å¼¹æ¡†
    closeProcessingDia () {
      this.formDia = false
      this.$emit('closeProcessingDia')
    },
    getAuthorizedPerson() {
      selectUserCondition({ type: 1 }).then((res) => {
        let data = [];
        res.data.forEach((a) => {
          data.push({
            label: a.name,
            value: a.id,
          });
        });
        this.personList = data;
      });
    },
    // getSupervisedUserList () {
    //   this.$axios.get(this.$api.user.selectDepartmentLimsUserList).then(res => {
    //     let data = []
    //     res.data.forEach(a => {
    //       data.push({
    //         label: a.name,
    //         value: a.id
    //       })
    //     })
    //     this.supervisedUserList = 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: 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/ensureResults/qualityControlPlan/components/recordsDialog.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,426 @@
<template>
  <div>
    <el-dialog :close-on-click-modal="false" :close-on-press-escape="false"
               :visible.sync="formDia"
               title="检测工作监督记录表"
               width="70%" @close="closeRecordsDia">
      <el-steps :active="currentStep" align-center finish-status="success">
        <el-step title="实施"></el-step>
        <el-step title="批准"></el-step>
      </el-steps>
      <div style="height: 470px;overflow-y: auto">
        <table border="1" cellspacing="10" class="tables">
          <tr>
            <td class="td-title">
              <p><span class="required-span">* </span>检测人员:</p>
            </td>
            <td colspan="2">
              <el-input v-if="currentStep === 0" v-model="form.testMember"
                        placeholder="请输入内容"
                        size="small">
              </el-input>
              <span v-else class="td-info"> {{ form.testMember }}</span>
            </td>
            <td class="td-title">
              <p><span class="required-span">* </span>监督员:</p>
            </td>
            <td colspan="2">
              <el-select v-if="currentStep === 0" @change="usePersonName" v-model="form.supervisorId" placeholder="请选择" size="small" style="width: 100%">
                <el-option v-for="item in recordUserList" :key="item.userId" :label="item.userName" :value="item.userId"></el-option>
              </el-select>
              <span v-else class="td-info"> {{ form.supervisor }}</span>
            </td>
          </tr>
          <tr>
            <td class="td-title">
              <p><span class="required-span">* </span>检测项目:</p>
            </td>
            <td>
              <el-input v-if="currentStep === 0" v-model="form.testItem"
                        placeholder="请输入内容"
                        size="small">
              </el-input>
              <span v-else class="td-info"> {{ form.testItem }}</span>
            </td>
            <td class="td-title">
              <p><span class="required-span">* </span>样品编号:</p>
            </td>
            <td>
              <el-input v-if="currentStep === 0" v-model="form.sampleNumber"
                        placeholder="请输入内容"
                        size="small">
              </el-input>
              <span v-else class="td-info"> {{ form.sampleNumber }}</span>
            </td>
            <td class="td-title">
              <p><span class="required-span">* </span>检测日期:</p>
            </td>
            <td>
              <el-input v-if="currentStep === 0" v-model="form.testDate"
                        placeholder="请输入内容"
                        size="small">
              </el-input>
              <span v-else class="td-info"> {{ form.testDate }}</span>
            </td>
          </tr>
          <tr>
            <td class="td-title">
              <p><span class="required-span">* </span>人员:</p>
            </td>
            <td colspan="5">
              <el-input v-if="currentStep === 0" v-model="form.personnel"
                        placeholder="请输入内容"
                        size="small">
              </el-input>
              <span v-else class="td-info"> {{ form.personnel }}</span>
            </td>
          </tr>
          <tr>
            <td class="td-title">
              <p><span class="required-span">* </span>仪器设备:</p>
            </td>
            <td colspan="5">
              <el-input v-if="currentStep === 0" v-model="form.device"
                        placeholder="请输入内容"
                        size="small">
              </el-input>
              <span v-else class="td-info"> {{ form.device }}</span>
            </td>
          </tr>
          <tr>
            <td class="td-title">
              <p><span class="required-span">* </span>工作环境:</p>
            </td>
            <td colspan="5">
              <el-input v-if="currentStep === 0" v-model="form.environment"
                        placeholder="请输入内容"
                        size="small">
              </el-input>
              <span v-else class="td-info"> {{ form.environment }}</span>
            </td>
          </tr>
          <tr>
            <td class="td-title">
              <p><span class="required-span">* </span>样品采集:</p>
            </td>
            <td colspan="5">
              <el-input v-if="currentStep === 0" v-model="form.sampleCollection"
                        placeholder="请输入内容"
                        size="small">
              </el-input>
              <span v-else class="td-info"> {{ form.sampleCollection }}</span>
            </td>
          </tr>
          <tr>
            <td class="td-title">
              <p><span class="required-span">* </span>样品的准备:</p>
            </td>
            <td colspan="5">
              <el-input v-if="currentStep === 0" v-model="form.samplePreparation"
                        placeholder="请输入内容"
                        size="small">
              </el-input>
              <span v-else class="td-info"> {{ form.samplePreparation }}</span>
            </td>
          </tr>
          <tr>
            <td class="td-title">
              <p><span class="required-span">* </span>检测方法:</p>
            </td>
            <td colspan="5">
              <el-input v-if="currentStep === 0" v-model="form.detectionMethod"
                        placeholder="请输入内容"
                        size="small">
              </el-input>
              <span v-else class="td-info"> {{ form.detectionMethod }}</span>
            </td>
          </tr>
          <tr>
            <td class="td-title">
              <p><span class="required-span">* </span>检测记录:</p>
            </td>
            <td colspan="5">
              <el-input v-if="currentStep === 0" v-model="form.inspectionRecord"
                        placeholder="请输入内容"
                        size="small">
              </el-input>
              <span v-else class="td-info"> {{ form.inspectionRecord }}</span>
            </td>
          </tr>
          <tr>
            <td class="td-title">
              <p><span class="required-span">* </span>检测报告:</p>
            </td>
            <td colspan="5">
              <el-input v-if="currentStep === 0" v-model="form.examiningReport"
                        placeholder="请输入内容"
                        size="small">
              </el-input>
              <span v-else class="td-info"> {{ form.examiningReport }}</span>
            </td>
          </tr>
          <tr>
            <td class="td-title">
              <p><span class="required-span">* </span>监督情况评价:</p>
            </td>
            <td colspan="5">
              <el-input v-if="currentStep === 0" v-model="form.supervisionEvaluation"
                        :rows="4"
                        placeholder="请输入内容"
                        size="small"
                        type="textarea">
              </el-input>
              <span v-else class="td-info"> {{ form.supervisionEvaluation }}</span>
            </td>
          </tr>
          <tr>
            <td class="td-title">
              <p><span class="required-span">* </span>不符合处理意见:</p>
            </td>
            <td colspan="5">
              <el-input v-if="currentStep === 0" v-model="form.handlingAdvice"
                        :rows="4"
                        placeholder="请输入内容"
                        size="small"
                        type="textarea">
              </el-input>
              <span v-else class="td-info"> {{ form.handlingAdvice }}</span>
            </td>
          </tr>
          <tr>
            <td v-if="currentStep === 0" class="td-title">
              <p><span class="required-span">* </span>请选择下一步批准人:</p>
            </td>
            <td v-if="currentStep === 0" colspan="5">
              <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>
            <td v-if="currentStep === 1" class="td-title">
              <p>批准负责人:</p>
            </td>
            <td v-if="currentStep === 1" class="td-info" colspan="5">
              {{form.ratifyUserName}}
            </td>
          </tr>
          <tr v-if="currentStep === 1 || currentStep === 2">
            <td class="td-title">
              <p><span class="required-span">* </span>审批结论:</p>
            </td>
            <td colspan="2">
              <el-input v-if="currentStep === 1"
                        v-model="form.ratifyOpinion"
                        :rows="4"
                        placeholder="请输入内容"
                        size="small"
                        type="textarea">
              </el-input>
              <span v-if="currentStep === 2" class="td-info"> {{ form.ratifyOpinion }}</span>
            </td>
            <td class="td-title">
              <p v-if="currentStep === 1">请选择是否符合:</p>
              <p v-if="currentStep === 2">是否符合:</p>
            </td>
            <td colspan="2">
              <el-radio-group v-if="currentStep === 1" v-model="form.isAccording">
                <el-radio :label="0">不符合</el-radio>
                <el-radio :label="1">符合</el-radio>
              </el-radio-group>
              <span v-if="currentStep === 2" class="td-info"> {{ form.isAccording === 0 ? '不符合' : '符合' }}</span>
            </td>
          </tr>
        </table>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button @click="closeRecordsDia">取 æ¶ˆ</el-button>
        <el-button v-if="currentStep !== 2" :loading="editLoad" type="primary" @click="handleEdit">提 äº¤</el-button>
      </span>
    </el-dialog>
  </div>
</template>
<script>
import {
  addSuperviseDetailRecord,
  addSuperviseRecordOpinion, getRecordUser,
  getSuperviseDetailRecord
} from "@/api/cnas/process/ensureResults/qualitySupervise";
import {selectUserCondition} from "@/api/business/inspectionTask";
export default {
  name: 'recordsDialog',
  // import å¼•入的组件需要注入到对象中才能使用
  components: {},
  data() {
    // è¿™é‡Œå­˜æ”¾æ•°æ®
    return {
      formDia: false,
      form: {
        superviseDetailsId: '',
        superviseDetailsRecordId: '',
        testMember: '',
        supervisor: '',
        supervisorId: '',
        testItem: '',
        sampleNumber: '',
        testDate: '',
        personnel: '',
        device: '',
        environment: '',
        sampleCollection: '',
        samplePreparation: '',
        detectionMethod: '',
        inspectionRecord: '',
        examiningReport: '',
        supervisionEvaluation: '',
        handlingAdvice: '',
        ratifyUserId: '',
        ratifyUserName: '',
        ratifyOpinion: '',
        isAccording: '',
      },
      currentStep: 0,
      editLoad: false,
      personList: [],
      recordUserList: [],
    };
  },
  // æ–¹æ³•集合
  methods: {
    openDia(row) {
      this.formDia = true
      this.searchInfo(row)
      this.getAuthorizedPerson()
    },
    usePersonName (value) {
      const index = this.recordUserList.findIndex(item => item.userId === value)
      if (index > -1) {
        this.form.supervisor = this.recordUserList[index].userName
      }
    },
    // æŸ¥è¯¢ç›‘督计划详情记录流程信息
    searchInfo (row) {
      getSuperviseDetailRecord({superviseDetailsId: row.superviseDetailsId}).then(res => {
        // æœ‰superviseDetailsRecordId说明提交过记录
        if (res.data.superviseDetailsRecordId) {
          // æ˜¯å¦ç»“束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
        this.form.superviseDetailsId = row.superviseDetailsId
        this.getRecordUser()
      }).catch(err => {
        console.log('err---', err);
      })
    },
    // æäº¤æµç¨‹
    handleEdit () {
      if (!this.form.testMember || !this.form.supervisor || !this.form.testItem || !this.form.sampleNumber
        || !this.form.testDate) {
        this.$message.warning('请填写完整')
        return
      }
      if (this.currentStep === 0) {
        this.addInfo()
      } else {
        this.editInfo()
      }
    },
    // æäº¤è®°å½•
    addInfo () {
      if (!this.form.ratifyUserId) {
        this.$message.warning('请选择下一步批准人')
        return
      }
      this.editLoad = true
      addSuperviseDetailRecord(this.form).then(res => {
        this.editLoad = false
        this.$message.success('操作成功')
        this.closeRecordsDia()
      }).catch(err => {
        console.log('err---', err);
        this.editLoad = false
      })
    },
    // æäº¤æ‰¹å‡†
    editInfo () {
      if (!this.form.ratifyOpinion) {
        this.$message.warning('请填写审批意见')
        return
      }
      if (this.form.isAccording === null) {
        this.$message.warning('请选择是否符合')
        return
      }
      this.editLoad = true
      addSuperviseRecordOpinion(this.form).then(res => {
        this.editLoad = false
        this.$message.success('操作成功')
        this.closeRecordsDia()
      }).catch(err => {
        console.log('err---', err);
        this.editLoad = false
      })
    },
    // å…³é—­å¼¹æ¡†
    closeRecordsDia () {
      this.formDia = false
      this.$emit('closeRecordsDia')
    },
    getAuthorizedPerson() {
      selectUserCondition({ type: 1 }).then((res) => {
        let data = [];
        res.data.forEach((a) => {
          data.push({
            label: a.name,
            value: a.id,
          });
        });
        this.personList = data;
      });
    },
    getRecordUser () {
      getRecordUser({superviseDetailsId: this.form.superviseDetailsId}).then(res => {
        this.recordUserList = res.data
      })
    },
  }
};
</script>
<style scoped>
.tables {
  table-layout: fixed;
  width: 100%;
  margin-top: 10px;
}
.td-title {
  height: 40px;
  text-align: center;
  font-size: 14px;
  word-wrap: break-word;
  white-space: normal;
  padding: 6px;
}
.td-info {
  text-align: center;
  font-size: 14px;
  word-wrap: break-word;
  white-space: normal;
}
.tables td {
  height: 40px;
  font-size: 14px;
  word-wrap: break-word;
  white-space: normal;
  padding: 6px;
}
</style>
src/views/CNAS/process/ensureResults/qualityControlPlan/components/rectifyDialogNew.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,460 @@
<template>
  <div>
    <el-dialog :close-on-click-modal="false" :close-on-press-escape="false"
               :visible.sync="formDia"
               title="纠正措施处理单"
               width="60%" @close="closeRectifyDia">
      <el-steps :active="currentStep" align-center finish-status="success">
        <el-step title="不合格或偏离事实的描述" @click.native="setStep(0)"></el-step>
        <el-step title="批准" @click.native="setStep(2)"></el-step>
      </el-steps>
      <div style="height: 510px;overflow-y: auto">
        <table border="1" cellspacing="10" class="tables">
          <tr>
            <td class="td-title">
              <p><span class="required-span">* </span>培训计划:</p>
            </td>
            <td class="td-info" colspan="3">
              <el-select v-model="form.personTrainingDetailedId" clearable filterable
                         style="width: 100%"
                         :disabled="currentStep !== 0"
                         placeholder="请选择" size="small">
                <el-option v-for="item in yearTrainingDetailed" :key="item.id" :label="item.trainingObjectives" :value="item.id">
                </el-option>
              </el-select>
            </td>
          </tr>
          <tr>
            <td class="td-title">
              <p><span class="required-span">* </span>不合格或偏离事实的描述:</p>
            </td>
            <td class="td-info" colspan="3">
              <el-input v-if="currentStep === 0" v-model="form.raiseResult"
                        :rows="2"
                        placeholder="请输入内容"
                        size="small"
                        type="textarea">
              </el-input>
              <span v-if="currentStep !== 0" class="td-info1"> {{ form.raiseResult }}</span>
            </td>
          </tr>
<!--          <tr v-if="showStep === 0">-->
<!--            <td v-if="currentStep === 0" class="td-title">-->
<!--              <p><span class="required-span">* </span>请选择下一步负责人:</p>-->
<!--            </td>-->
<!--            <td v-if="currentStep === 0" class="td-info" colspan="3">-->
<!--              <el-select v-model="form.causeUserId" 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="currentStep !== 0">
            <td class="td-title">
              <p>提出人:</p>
            </td>
            <td class="td-info">
              {{form.raiseUserName}}
            </td>
            <td class="td-title">
              <p>提出部门:</p>
            </td>
            <td class="td-info">
              {{form.raiseDepartment}}
            </td>
          </tr>
          <tr>
            <td class="td-title">
              <p>提出日期:</p>
            </td>
            <td class="td-info" v-if="currentStep === 0">
              <el-date-picker
                v-model="form.raiseTime"
                format="yyyy-MM-dd"
                placeholder="选择日期"
                size="small"
                style="width: 80%"
                type="date"
                value-format="yyyy-MM-dd">
              </el-date-picker>
            </td>
            <td class="td-info" colspan="3" v-if="currentStep !== 0">
              {{form.raiseTime}}
            </td>
          </tr>
          <tr>
            <td class="td-title">
              <p><span class="required-span">* </span>原因分析:</p>
            </td>
            <td class="td-info" colspan="3">
              <el-input v-if="currentStep === 0" v-model="form.causeResult"
                        :rows="2"
                        placeholder="请输入内容"
                        size="small"
                        type="textarea">
              </el-input>
              <span v-if="currentStep !== 0" class="td-info1"> {{ form.causeResult }}</span>
            </td>
          </tr>
          <tr v-if="currentStep !== 0">
            <td class="td-title">
              <p>原因分析人:</p>
            </td>
            <td class="td-info">
              {{form.causeUserName}}
            </td>
            <td class="td-title">
              <p>责任部门:</p>
            </td>
            <td class="td-info">
              {{form.causeDepartment}}
            </td>
          </tr>
          <tr>
            <td class="td-title">
              <p>原因分析日期:</p>
            </td>
            <td class="td-info" colspan="3" v-if="currentStep === 0">
              <el-date-picker
                v-model="form.causeTime"
                format="yyyy-MM-dd"
                placeholder="选择日期"
                size="small"
                style="width: 80%"
                type="date"
                value-format="yyyy-MM-dd">
              </el-date-picker>
            </td>
            <td class="td-info" colspan="3" v-if="currentStep !== 0">
              {{form.causeTime}}
            </td>
          </tr>
<!--          <tr v-if="showStep === 0">-->
<!--            <td v-if="currentStep === 0" class="td-title">-->
<!--              <p><span class="required-span">* </span>请选择下一步负责人:</p>-->
<!--            </td>-->
<!--            <td v-if="currentStep === 0" class="td-info" colspan="3">-->
<!--              <el-select v-model="form.correctUserId" 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>
            <td class="td-title">
              <p><span class="required-span">* </span>纠正措施:</p>
            </td>
            <td class="td-info" colspan="3">
              <el-input v-if="currentStep === 0" v-model="form.correctResult"
                        :rows="2"
                        placeholder="请输入内容"
                        size="small"
                        type="textarea">
              </el-input>
              <span v-if="currentStep !== 0" class="td-info1"> {{ form.correctResult }}</span>
            </td>
          </tr>
          <tr>
            <td class="td-title">
              <p>提出要求部门确认:</p>
            </td>
            <td class="td-info" colspan="3">
              <el-input v-if="currentStep === 0" v-model="form.raiseDepartmentAffirm"
                        :rows="2"
                        placeholder="请输入内容"
                        size="small"
                        type="textarea">
              </el-input>
              <span v-if="currentStep !== 0" class="td-info1"> {{ form.raiseDepartmentAffirm }}</span>
            </td>
          </tr>
          <tr v-if="currentStep !== 0">
            <td class="td-title">
              <p>纠正人:</p>
            </td>
            <td class="td-info">
              {{form.correctUserName}}
            </td>
            <td class="td-title">
              <p>责任部门:</p>
            </td>
            <td class="td-info">
              {{form.correctDepartment}}
            </td>
          </tr>
          <tr>
            <td class="td-title">
              <p>纠正日期:</p>
            </td>
            <td class="td-info" v-if="currentStep === 0">
              <el-date-picker
                v-model="form.correctTime"
                format="yyyy-MM-dd"
                placeholder="选择日期"
                size="small"
                style="width: 80%"
                type="date"
                value-format="yyyy-MM-dd">
              </el-date-picker>
            </td>
            <td class="td-info" colspan="3" v-if="currentStep !== 0">
              {{form.correctTime}}
            </td>
          </tr>
          <tr>
            <td class="td-title">
              <p><span class="required-span">* </span>实施验证结果:</p>
            </td>
            <td class="td-info" colspan="3">
              <el-input v-if="currentStep === 0" v-model="form.validationResult"
                        :rows="2"
                        placeholder="请输入内容"
                        size="small"
                        type="textarea">
              </el-input>
              <span v-if="currentStep !== 0" class="td-info1"> {{ form.validationResult }}</span>
            </td>
          </tr>
          <tr v-if="currentStep !== 0">
            <td class="td-title">
              <p>验证人:</p>
            </td>
            <td class="td-info">
              {{form.validationUserName}}
            </td>
            <td class="td-title">
              <p>责任部门:</p>
            </td>
            <td class="td-info">
              {{form.validationDepartment}}
            </td>
          </tr>
          <tr>
            <td class="td-title">
              <p>验证日期:</p>
            </td>
            <td class="td-info" v-if="currentStep === 0">
              <el-date-picker
                v-model="form.validationTime"
                format="yyyy-MM-dd"
                placeholder="选择日期"
                size="small"
                style="width: 80%"
                type="date"
                value-format="yyyy-MM-dd">
              </el-date-picker>
            </td>
            <td class="td-info" colspan="3" v-if="currentStep !== 0">
              {{form.validationTime}}
            </td>
          </tr>
          <tr v-if="currentStep === 0">
            <td v-if="currentStep === 0" class="td-title">
              <p><span class="required-span">* </span>请选择批准人:</p>
            </td>
            <td v-if="currentStep === 0" class="td-info" colspan="3">
              <el-select v-model="form.approverUserId" 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>
        </table>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button @click="closeRectifyDia">取 æ¶ˆ</el-button>
        <el-button v-if="currentStep !== 2" :loading="editLoad" type="primary" @click="handleEdit">提 äº¤</el-button>
      </span>
    </el-dialog>
  </div>
</template>
<script>
import {
  addEquipSuperviseDetailCorrect, approveEquipSuperviseDetailCorrect,
  getSuperviseDetailCorrect
} from "@/api/cnas/process/ensureResults/qualitySupervise";
import {selectUserCondition} from "@/api/business/inspectionTask";
import {getThisYearTrainingDetailed} from "@/api/cnas/systemManagement/correctiveAction";
export default {
  name: 'rectifyDialog',
  // import å¼•入的组件需要注入到对象中才能使用
  components: {},
  data() {
    // è¿™é‡Œå­˜æ”¾æ•°æ®
    return {
      formDia: false,
      currentStep: 0,
      showStep: 0,
      form: {
        superviseDetailsId: '',
        raiseResult: '',
        vdeRaiseResult: '',
        // causeUserId: '',
        raiseUserName: '',
        raiseDepartment: '',
        raiseTime: '',
        causeResult: '',
        causeUserName: '',
        causeDepartment: '',
        causeTime: '',
        // correctUserId: '',
        correctResult: '',
        raiseDepartmentAffirm: '',
        correctUserName: '',
        correctDepartment: '',
        correctTime: '',
        approverUserId: '',
        validationResult: '',
        validationUserName: '',
        validationDepartment: '',
        validationTime: '',
        superviseDetailsCorrectId: '',
        approveId: '',
        personTrainingDetailedId: '',
      },
      editLoad: false,
      personList: [],
      yearTrainingDetailed: [],
    };
  },
  // æ–¹æ³•集合
  methods: {
    openDia (row) {
      this.formDia = true
      this.searchInfo(row)
      this.form.superviseDetailsId = row.superviseDetailsId
      this.form.approveId = row.approveId
      this.getAuthorizedPerson() // èŽ·å–äººå‘˜åˆ—è¡¨
      this.getYearTrainingDetailed() // èŽ·å–åŸ¹è®­è®¡åˆ’
    },
    // æŸ¥è¯¢ç›‘控计划详情实施信息
    searchInfo (row) {
      this.form.qualityMonitorDetailsId = row.qualityMonitorDetailsId
      getSuperviseDetailCorrect({superviseDetailsId: row.superviseDetailsId}).then(res => {
        if (res.data.superviseDetailsCorrectId === null) {
          this.showStep = 0
          this.currentStep = 0
        } else {
          this.form = res.data
          if (res.data.isFinish === 0) {
            if (res.data.approverUserId) {
              this.showStep = 1
              this.currentStep = 1
            }
          } else {
            this.currentStep = 2
            this.showStep = 1
          }
        }
      }).catch(err => {
        console.log('err---', err);
      })
    },
    // æäº¤
    handleEdit () {
      if (this.currentStep === 0) {
        if (!this.form.raiseResult) {
          this.$message.warning('请填写不合格描述')
          return
        }
        if (!this.form.causeResult) {
          this.$message.warning('请填写原因分析')
          return
        }
        if (!this.form.correctResult) {
          this.$message.warning('请填写纠正措施')
          return
        }
        if (!this.form.validationResult) {
          this.$message.warning('请填写实施验证结果')
          return
        }
      }
      this.editLoad = true
      this.form.flowType = this.currentStep
      if (this.currentStep === 0) {
        addEquipSuperviseDetailCorrect(this.form).then(res => {
          this.editLoad = false
          if (res.code === 201) return
          this.$message.success('提交成功')
          this.closeRectifyDia()
        }).catch(err => {
          console.log('err---', err);
          this.editLoad = false
        })
      } else {
        approveEquipSuperviseDetailCorrect(this.form).then(res => {
          this.editLoad = false
          if (res.code === 201) return
          this.$message.success('批准成功')
          this.closeRectifyDia()
        }).catch(err => {
          console.log('err---', err);
          this.editLoad = false
        })
      }
    },
    // å…³é—­å¼¹æ¡†
    closeRectifyDia () {
      this.formDia = false
      this.$emit('closeRectifyDia')
    },
    setStep (step) {
      this.showStep = step
    },
    getAuthorizedPerson() {
      selectUserCondition({ type: 1 }).then((res) => {
        let data = [];
        res.data.forEach((a) => {
          data.push({
            label: a.name,
            value: a.id,
          });
        });
        this.personList = data;
      });
    },
    getYearTrainingDetailed () {
      getThisYearTrainingDetailed().then(res => {
        this.yearTrainingDetailed = res.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: 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/ensureResults/qualityControlPlan/index.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,716 @@
<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="superviseName">
            <el-input size="small" placeholder="请输入" clearable
                      v-model="yearForm.superviseName"
                      @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="record">导入</el-button>
        </div>
      </div>
      <lims-table :tableData="yearTableData" :column="yearColumnData" :page="yearPage" :tableLoading="yearLoading"
                  height="40vh" @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>
            <el-radio-group v-model="yearDetailForm.causeType" @change="getYearDetailPlanList" size="small">
              <el-radio-button :label="1">定期监督</el-radio-button>
              <el-radio-button :label="2">动态监督</el-radio-button>
            </el-radio-group>
          </el-form-item>
          <el-form-item label="监控目的" prop="supervisePurpose">
            <el-input v-model="yearDetailForm.supervisePurpose" placeholder="请输入" size="small"></el-input>
          </el-form-item>
          <el-form-item label="监控项目" prop="superviseProject">
            <el-input v-model="yearDetailForm.superviseProject" 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" :superviseId="superviseId" @closeDia="closeDia"></detail-form-dialog>
    <!--记录流程弹框-->
    <records-dialog v-if="recordsDia" ref="recordsDia" :superviseId="superviseId" @closeRecordsDia="closeRecordsDia"></records-dialog>
    <!--不符合处理流程弹框-->
    <processing-sheet v-if="processingDia" ref="processingDia" :superviseId="superviseId" @closeProcessingDia="closeProcessingDia"></processing-sheet>
    <!--纠正处理流程弹框-->
    <rectify-dialog-new v-if="rectifyDia" ref="rectifyDia" :superviseId="superviseId" @closeProcessingDia="closeRectifyDia"></rectify-dialog-new>
    <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="downloadDialog"
      title="导出"
      width="600px">
          <span>
            <el-button plain type="primary" @click="controlDown">记录单导出</el-button>
            <el-button plain type="primary" @click="processingDown">处理单导出</el-button>
            <el-button plain type="primary" @click="supervisoryDown">纠正单导出</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: 80px">年份:</span>
        <el-date-picker
          v-model="superviseYear"
          type="year"
          value-format="yyyy"
          clearable
          size="small"
          format="yyyy"
          placeholder="选择年">
        </el-date-picker>
        <span  style="width: 110px">监督员:</span>
        <el-select v-model="recordUserIds" placeholder="请选择" size="small"
                   @change="splitList"
                   :multiple-limit="2" filterable multiple style="width: 100%">
          <el-option v-for="item in userList" :key="item.id" :label="item.name" :value="item.id"></el-option>
        </el-select>
      </div>
      <div style="display: flex;align-items: center;margin: 10px 0">
        <div style="width: 60px">批准人:</div>
        <el-select v-model="ratifyUserId" clearable
                   filterable size="small" style="width: 50%;">
          <el-option v-for="item in userList" :key="item.id" :label="item.name" :value="item.id">
          </el-option>
        </el-select>
      </div>
      <div style="margin: 0 auto;">
        <el-upload ref="upload1" :action="action" :auto-upload="false" :file-list="fileList" :headers="uploadHeader" :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="{recordUserIds: recordUserIds1, superviseYear: superviseYear, ratifyUserId: ratifyUserId}"
                   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="closeUploadDia">取 æ¶ˆ</el-button>
        <el-button :loading="uploading" type="primary" @click="submitUpload()">上 ä¼ </el-button>
      </span>
    </el-dialog>
  </div>
</template>
<script>
import DetailFormDialog from './components/detailFormDialog.vue';
import RecordsDialog from './components/recordsDialog.vue';
import ProcessingSheet from './components/processingSheet.vue';
import RectifyDialogNew from './components/rectifyDialogNew.vue';
import limsTable from "@/components/Table/lims-table.vue";
import {
  delQualitySupervise, delQualitySuperviseDetail,
  exportQualitySupervise, exportSuperviseDetailRecord,
  pageQualitySupervise, pageQualitySuperviseDetail,
  ratifyQualitySupervise, superviseDetailAccordingExport,
  exportSuperviseDetaillCorrect
} from "@/api/cnas/process/ensureResults/qualitySupervise";
import {selectUserCondition} from "@/api/business/inspectionTask";
import {mapGetters} from "vuex";
export default {
  name: 'a7-quality-control-plan',
  // import å¼•入的组件需要注入到对象中才能使用
  components: {limsTable, RectifyDialogNew, ProcessingSheet, RecordsDialog, DetailFormDialog},
  data() {
    // è¿™é‡Œå­˜æ”¾æ•°æ®
    return {
      yearForm: {
        superviseName: '',
      },
      yearPage: {
        current: 1,
        size: 20,
        total: 0
      },
      yearColumnData: [
        {
          label: '计划名称',
          prop: 'superviseName',
          minWidth: '150px'
        }, {
          label: '编制人',
          prop: 'writeUserName',
          minWidth: '100'
        }, {
          label: '编制日期',
          prop: 'writeTime',
          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: 'ratifyUserName',
          minWidth: '100'
        },{
          label: '批准日期',
          prop: 'ratifyTime',
          minWidth: '160'
        }, {
          dataType: 'action',
          minWidth: '170',
          label: '操作',
          fixed: 'right',
          operation: [
            {
              name: '批准',
              type: 'text',
              disabled: (row) => {
                if (row.ratifyStatus === 1 || this.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.ratifyStatus === 1) {
                  return true
                } else {
                  return false
                }
              },
            }
          ]
        }],
      yearTableData: [],  // å¹´è¡¨
      yearLoading: false,
      yearDetailForm: {
        supervisePurpose: '',
        superviseProject: '',
        causeType: 1
      },
      yearDetailColumnData: [
        {
          label: '监督日期',
          prop: 'superviseTime',
          minWidth: '150px'
        }, {
          label: '监督目的',
          prop: 'supervisePurpose',
          minWidth: '150px',
          showOverflowTooltip: true,
        }, {
          label: '监控项目',
          prop: 'superviseProject',
          minWidth: '150px'
        }, {
          label: '被监督人员',
          prop: 'supervisee',
          minWidth: '150px'
        }, {
          label: '监督原因',
          prop: 'superviseReason',
          minWidth: '150px'
        },{
          label: '备注',
          prop: 'remark',
          minWidth: '150px'
        },{
          dataType: 'action',
          width: '260',
          label: '操作',
          fixed: 'right',
          operation: [
            {
              name: '编辑',
              type: 'text',
              clickFun: (row) => {
                this.showDialog('edit', row)
              }
            },
            {
              name: '记录',
              type: 'text',
              clickFun: (row) => {
                this.records(row)
              }
            },
            {
              name: '处理',
              type: 'text',
              clickFun: (row) => {
                this.processing(row)
              },
              disabled: (row) => {
                if (row.isAccording === 1 || row.isAccording === null) {
                  return true
                } else {
                  return false
                }
              },
            },
            {
              name: '纠正',
              type: 'text',
              clickFun: (row) => {
                this.rectify(row)
              },
              disabled: (row) => {
                if (row.isAccording === 1 || row.isAccording === null || row.isCorrect === null || row.isCorrect === 0) {
                  return true
                } else {
                  return false
                }
              },
            },
            {
              name: '导出',
              type: 'text',
              clickFun: (row) => {
                this.openDownloadDia(row);
              },
            },
            {
              name: '删除',
              type: 'text',
              color: '#f56c6c',
              clickFun: (row) => {
                this.delYearPlanDetail(row)
              }
            }
          ]
        }
      ],
      yearDetailTableData: [], // å¹´æ˜Žç»†è¡¨
      yearDetailLoading: false,
      yearDetailPage: {
        current: 1,
        size: 20,
        total: 0
      },
      superviseId: '',
      formDia: false,
      recordsDia: false,
      processingDia: false,
      rectifyDia: false,
      ratifyDialog: false,
      ratifyLoading: false,
      ratifyInfo: {},
      downloadDialog: false,
      download: {},
      uploadDia: false,
      uploading: false,
      fileList: [],
      userList: [],
      recordUserIds: [],
      recordUserIds1: '',
      superviseYear: '',
      ratifyUserId: '',
    };
  },
  mounted() {
    this.getYearPlanList()
  },
  // æ–¹æ³•集合
  methods: {
    // æŸ¥è¯¢å¹´åº¦è®¡åˆ’表
    getYearPlanList () {
      const entity = {
        superviseName: this.yearForm.superviseName,
      }
      const page = this.yearPage
      this.yearLoading = true
      pageQualitySupervise({ ...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.superviseName = ''
      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();
    },
    // å¯¼å…¥æµç¨‹
    beforeUpload(file) {
      if (file.size > 1024 * 1024 * 10) {
        this.$message.error('上传文件不超过10M');
        this.$refs.upload1.clearFiles()
        return false;
      }
    },
    onError(err, file, fileList) {
      this.$message.error('上传失败')
      this.$refs.upload1.clearFiles()
    },
    handleSuccessUp(response) {
      this.uploading = false;
      if (response.code == 200) {
        this.$message.success('上传成功');
        this.recordUserIds = []
        this.superviseYear = ''
        this.fileList = []
        this.timer = setTimeout(() => {
          this.closeUploadDia()
        }, 1000)
      }
    },
    splitList (val) {
      const string = this.HaveJson(val)
      this.recordUserIds1 = string.join(',');
      console.log(this.recordUserIds1)
    },
    // æäº¤å¯¼å…¥
    submitUpload() {
      if (!this.superviseYear) {
        this.$message.warning('请选择年份')
        return;
      }
      if (this.recordUserIds.length === 0) {
        this.$message.warning('请选择监督员')
        return;
      }
      if (!this.ratifyUserId) {
        this.$message.warning('请选择批准人')
        return;
      }
      this.uploading = true
      this.$refs.upload1.submit();
    },
    // å…³é—­å¯¼å…¥å¼¹æ¡†
    closeUploadDia () {
      this.uploadDia = false;
      this.recordUserIds = []
      this.ratifyUserId = ''
      this.superviseYear = ''
      this.getYearPlanList()
    },
    // æ‰“开报告弹框
    record (row) {
      this.uploadDia = true
      this.getUserList()
    },
    getUserList(){
      selectUserCondition({ type: 0 }).then((res) => {
        this.userList = res.data;
      })
    },
    // æ‰¹å‡†
    approvalPlan (row) {
      this.ratifyDialog = true
      this.ratifyInfo = row
    },
    handleRatify (ratifyStatus) {
      // æ‰¹å‡†çŠ¶æ€ , 0 ä¸é€šè¿‡, 1通过
      this.ratifyInfo.ratifyStatus = ratifyStatus
      this.ratifyLoading = true
      ratifyQualitySupervise(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()
    },
    // å¯¼å‡º
    handleDown (row) {
      exportQualitySupervise({superviseId: row.superviseId}).then(res => {
        try {
          this.outLoading = false
          const blob = new Blob([res],{ type: 'application/msword' });
          this.$download.saveAs(blob, row.superviseName + '.docx')
          this.$message.success('导出成功')
        } catch (error) {
          console.error('创建Blob对象时出错:', error);
        }
      })
    },
    // åˆ é™¤è¿›åº¦è®¡åˆ’表
    delPlan (row) {
      this.$confirm('此操作将永久删除该数据, æ˜¯å¦ç»§ç»­?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.yearLoading = true
        delQualitySupervise({superviseId: row.superviseId}).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.superviseId = row.superviseId
      this.getYearDetailPlanList()
    },
    // èŽ·å–å¹´åº¦æ˜Žç»†è¡¨
    getYearDetailPlanList () {
      const entity = {
        superviseId: this.superviseId,
        supervisePurpose: this.yearDetailForm.supervisePurpose,
        superviseProject: this.yearDetailForm.superviseProject,
        causeType: this.yearDetailForm.causeType,
      }
      const page = this.yearDetailPage
      this.yearDetailLoading = true
      pageQualitySuperviseDetail({ ...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 = {
        supervisePurpose: '',
        superviseProject: ''
      }
      this.getYearDetailPlanList()
    },
    // æ‰“开年度明细新增、修改弹框
    showDialog (type, row) {
      this.formDia = true
      this.$nextTick(() => {
        this.$refs.formDia.openDia(type, row)
      })
    },
    closeDia () {
      this.formDia = false
      this.getYearDetailPlanList()
    },
    // è®°å½•流程
    records (row) {
      this.recordsDia = true
      this.$nextTick(() => {
        this.$refs.recordsDia.openDia(row)
      })
    },
    closeRecordsDia () {
      this.recordsDia = false
      this.getYearDetailPlanList()
    },
    // ä¸ç¬¦åˆæµç¨‹å¼¹æ¡†
    processing (row) {
      this.processingDia = true
      this.$nextTick(() => {
        this.$refs.processingDia.openDia(row)
      })
    },
    closeProcessingDia () {
      this.processingDia = false
      this.getYearDetailPlanList()
    },
    // çº æ­£æµç¨‹å¼¹æ¡†
    rectify (row) {
      this.rectifyDia = true
      this.$nextTick(() => {
        this.$refs.rectifyDia.openDia(row)
      })
    },
    closeRectifyDia () {
      this.rectifyDia = false
      this.getYearDetailPlanList()
    },
    // æ‰“开导出弹框
    openDownloadDia (row) {
      this.downloadDialog = true
      this.download = row
    },
    // å¯¼å‡ºè®°å½•
    controlDown () {
      exportSuperviseDetailRecord({superviseDetailsId: this.download.superviseDetailsId}).then(res => {
        const blob = new Blob([res], { type: 'application/msword' });
        this.$download.saveAs(blob, '记录导出.docx')
        this.$message.success('导出成功')
      }).catch(err => {
        console.log('err---', err);
      })
    },
    // å¤„理单导出
    processingDown () {
      superviseDetailAccordingExport({superviseDetailsId: this.download.superviseDetailsId}).then(res => {
        const blob = new Blob([res], { type: 'application/msword' });
        this.$download.saveAs(blob, '不符合项导出.docx')
        this.$message.success('导出成功')
      }).catch(err => {
        console.log('err---', err);
      })
    },
    // çº æ­£å•导出
    supervisoryDown () {
      exportSuperviseDetaillCorrect({superviseDetailsCorrectId: this.download.superviseDetailsCorrectId}).then(res => {
        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
        delQualitySuperviseDetail({superviseDetailsId: row.superviseDetailsId}).then(res => {
          this.yearDetailLoading = false
          this.$message.success('删除成功')
          this.getYearDetailPlanList()
        }).catch(err => {
          this.yearDetailLoading = false
          console.log('err---', err);
        })
      })
    },
  },
  // ç”¨äºŽä¸Šä¼ æ–‡ä»¶çš„信息
  computed: {
    action() {
      return this.javaApi + '/qualitySupervise/importQualitySupervise'
    },
    ...mapGetters(["userId"]),
  },
};
</script>
<style scoped>
.table-card {
  background-color: #ffffff;
}
.flex_column {
  display: flex;
  height: 80vh;
  flex-direction: column;
  overflow: auto;
  justify-content: space-between;
}
.pagination {
  display: flex;
  justify-content: space-between
}
.items_center {
  display: flex;
  align-items: center;
}
.date_box {
  margin: 0 5px;
}
.search {
  width: 150px;
  padding: 0 16px;
}
</style>