吴羡
4 小时以前 6f90e7110190d146fde06cf1f5b2272fd49b53d6
src/views/business/inspectionTask/index.vue
@@ -3,7 +3,7 @@
    <div style="height: 100%">
      <div class="search">
        <el-form :model="queryParams" ref="queryParams" size="small" :inline="true">
          <el-form-item label="委托编号" prop="entrustCode">
          <el-form-item :label="taskSource === 'QUALITY_MONITOR' ? '监控任务编号' : '委托编号'" prop="entrustCode">
            <el-input v-model="queryParams.entrustCode" clearable placeholder="请输入" size="small"
                      @keyup.enter="refreshTable()"></el-input>
          </el-form-item>
@@ -29,7 +29,7 @@
      <div class="center" v-loading="tableLoading">
        <div class="center-options">
          <div style="display: flex; align-items: center">
            <span style="font-size: 14px">试验室:</span>
            <span style="font-size: 14px">任务来源:</span>
            <ul class="tab">
              <li v-for="(m, i) in tabList" :key="i" :class="{ active: i == tabIndex }" @click="handleTab(m, i)">
                {{ m.label.replace("试验室", "") }}
@@ -45,7 +45,7 @@
            <span>{{ page.total }}</span>
          </div>
        </div>
        <lims-table :tableData="tableData" :column="column" :page="page"
        <lims-table :tableData="tableData" :column="displayColumns" :page="page"
          :rowClassName="rowClassName" :height="'calc(100vh - 300px)'" @pagination="pagination"
          key="tableData0">
          <template #action="scope"><div>
@@ -56,7 +56,7 @@
                  (scope.row.userName && !scope.row.userName.includes(nickName))
                )"
                       @click="handleInspection(scope.row)">检验</el-button>
            <el-button link type="primary" size="small" :disabled="(
            <el-button v-if="scope.row.taskSource !== 'QUALITY_MONITOR'" link type="primary" size="small" :disabled="(
                  scope.row.userName == null ||
                  scope.row.insState == 5 ||
                  scope.row.insState == 3 ||
@@ -64,12 +64,13 @@
                )"
                       @click="handleConnect(scope.row)">交接</el-button>
            <el-button link type="primary" size="small" @click="viewInspectInfo(scope.row)">原始记录</el-button>
            <el-popover placement="bottom" trigger="hover" style="margin-left: 6px" :disabled="(scope.row.insState != 3 || scope.row.userName == null ||(scope.row.userName && !scope.row.userName.includes(nickName)))">
            <el-button v-if="scope.row.taskSource === 'QUALITY_MONITOR'" link type="primary" size="small" @click="showMonitorRequirement(scope.row)">{{ Number(scope.row.insState) === 5 ? '评价记录' : '评价要求' }}</el-button>
            <el-popover v-if="scope.row.taskSource !== 'QUALITY_MONITOR'" placement="bottom" trigger="hover" style="margin-left: 6px" :disabled="(scope.row.insState != 3 || scope.row.userName == null ||(scope.row.userName && !scope.row.userName.includes(nickName)))">
              <template #reference>
                <el-button link type="primary" size="small" :disabled="(scope.row.insState != 3 || scope.row.userName == null ||
                <el-button link type="primary" size="small" :disabled="(scope.row.taskSource === 'QUALITY_MONITOR' || scope.row.insState != 3 || scope.row.userName == null ||
                  (scope.row.userName && !scope.row.userName.includes(nickName)))">更多</el-button>
              </template>
              <div>
              <div v-if="scope.row.taskSource !== 'QUALITY_MONITOR'">
                <el-button :disabled="(scope.row.insState != 3 || scope.row.userName == null ||
                  (scope.row.userName && !scope.row.userName.includes(nickName)))" style="margin-left: 10px" link type="primary" size="small" @click="download(scope.row)">下载报告</el-button>
                <el-button :disabled="(scope.row.insState != 3 || scope.row.userName == null ||
@@ -80,6 +81,23 @@
        </lims-table>
      </div>
    </div>
    <el-dialog v-model="monitorRequirementVisible" title="质量监控评价要求" width="560px">
      <el-descriptions :column="1" border>
        <el-descriptions-item label="监控任务编号">{{ monitorRequirement.entrustCode }}</el-descriptions-item>
        <el-descriptions-item label="监控项目">{{ monitorRequirement.monitorProject }}</el-descriptions-item>
        <el-descriptions-item label="监控目的">{{ monitorRequirement.monitorPurpose }}</el-descriptions-item>
        <el-descriptions-item label="监控方式">{{ monitorRequirement.monitorWay }}</el-descriptions-item>
        <el-descriptions-item label="检测标准">{{ monitorRequirement.standardCode }}</el-descriptions-item>
        <el-descriptions-item label="样品及规格">{{ monitorRequirement.sample }} {{ monitorRequirement.sampleSpec }}</el-descriptions-item>
        <el-descriptions-item label="完成期限">{{ monitorRequirement.dueDate }}</el-descriptions-item>
      </el-descriptions>
      <p>请在“原始记录”中填写检测数据,复核通过后由评价人员填写质量控制评价记录。</p>
      <template #footer>
        <el-button @click="monitorRequirementVisible=false">关闭</el-button>
        <el-button v-if="Number(monitorRequirement.insState) === 5" type="primary" @click="openMonitorEvaluation">打开评价记录</el-button>
      </template>
    </el-dialog>
    <inspection-evaluation-dialog v-if="inspectionEvaluateDialog" ref="inspectionEvaluateDialog" @close="inspectionEvaluateDialog=false" />
    <el-dialog v-model="claimVisible" title="提示" width="400px">
      是否认领委托编号<span style="color: #33c130">{{
        sampleUserForm.entrustCode
@@ -210,10 +228,11 @@
import {getRetestResult} from "@/api/business/rawMaterialOrder";
import onlyoffice from "@/components/Onlyoffice/onlyoffice.vue";
import filePreview from "@/components/Preview/filePreview.vue";
import InspectionEvaluationDialog from "@/views/CNAS/process/ensureResults/ensureResultsValidity/components/inspectionEvaluationDialog.vue";
export default {
  name: 'InspectionTask',
  components: {
    filePreview, onlyoffice,
    filePreview, onlyoffice, InspectionEvaluationDialog,
    limsTable,
    viewManHourDia,
    UnPassRetestResult
@@ -221,10 +240,18 @@
  dicts: ["urgency_level", "inspection_task_state","material_prop_type"],
  computed: {
    ...mapGetters(["nickName", "userId"]),
    displayColumns() {
      return this.column.filter(item => this.taskSource === 'QUALITY_MONITOR'
        ? !['typeSource', 'orderType'].includes(item.prop)
        : !['monitorProject', 'dueDate'].includes(item.prop))
    },
  },
  data() {
    return {
      issuedVisible: false,
      monitorRequirementVisible: false,
      monitorRequirement: {},
      inspectionEvaluateDialog: false,
      fullscreen: false,
      lookDialogVisible: false,
      option: null,
@@ -245,7 +272,8 @@
      },
      claimVisible: false,
      tabList: [
        { label: "委托", value: -1 },
        { label: "委托", value: "ENTRUSTED" },
        { label: "质量监控", value: "QUALITY_MONITOR" },
        // { label: "原材料", value: 1 },
        // { label: "外购", value: 0 },
      ],
@@ -255,6 +283,7 @@
      insStateList: [],
      state: 0, // 0:台账页,1:检验页面,2检验页面(复核),默认为0,3数据查看
      typeSource: -1, // 0:外购成品下单,1:原材料下单
      taskSource: 'ENTRUSTED',
      sonLaboratory: null, // 0:委托,1:原材料
      activeFace: 0, // 1:下单,2:查看,3:审核,默认为0
      currentId: null,
@@ -328,12 +357,14 @@
      tableData: [],
      column: [
        {
          label: "委托编号",
          label: "任务编号",
          prop: "entrustCode",
          width: "160px",
          dataType: "link",
          linkMethod: "selectAllByOne",
        },
        { label: "监控项目", prop: "monitorProject", width: "150px" },
        { label: "计划期限", prop: "dueDate", width: "120px" },
        { label: "样品名称", prop: "sample", width: "160px" },
        {
          label: "下单类别",
@@ -445,6 +476,7 @@
    this.getAuthorizedPerson();
    this.queryParams.userId = this.userId;
    this.queryParams.typeSource = this.typeSource
    this.queryParams.taskSource = this.taskSource
    this.currentTime = getYearAndMonthAndDays();
    this.getDicts("urgency_level").then((response) => {
      this.urgencyLevel = this.dictToValue(response.data);
@@ -464,9 +496,19 @@
      this.inspectionTaskState = this.dictToValue(response.data);
    });
    this.queryParams.typeSource = this.typeSource
    this.queryParams.taskSource = this.taskSource
    this.refreshTable();
  },
  methods: {
    showMonitorRequirement(row) {
      this.monitorRequirement = row
      this.monitorRequirementVisible = true
    },
    openMonitorEvaluation() {
      this.monitorRequirementVisible = false
      this.inspectionEvaluateDialog = true
      this.$nextTick(() => this.$refs.inspectionEvaluateDialog.open(this.monitorRequirement))
    },
    getList() {
      this.tableLoading = true;
      let param = { ...this.queryParams, ...this.page };
@@ -505,7 +547,8 @@
    refreshTable(e) {
      this.page.current = 1;
      this.queryParams.tabLabel = this.tabLabel;
      this.queryParams.typeSource = this.typeSource;
      this.queryParams.taskSource = this.taskSource;
      this.queryParams.typeSource = this.taskSource === 'ENTRUSTED' ? -1 : null;
      this.getList();
    },
    // 下载报告
@@ -576,11 +619,15 @@
    },
    handleTab(m, i) {
      this.tabIndex = i;
      this.typeSource =m.value;
      this.taskSource = m.value;
      this.queryParams.sonLaboratory = "";
      this.refreshTable();
    },
    selectAllByOne(row) {
      if (row.taskSource === 'QUALITY_MONITOR') {
        this.viewInspectInfo(row)
        return
      }
      this.isCopper = row.isCopper;
      this.customsInspection = row;
      this.activeFace = 2;
@@ -647,6 +694,7 @@
          sonLaboratory: this.sonLaboratory,
          state: this.state,
          typeSource: this.typeSource,
          taskSource: row.taskSource,
          orderId: this.orderId
        },
      });
@@ -673,6 +721,7 @@
          sonLaboratory: this.sonLaboratory,
          state: this.state,
          typeSource: this.typeSource,
          taskSource: row.taskSource,
          orderId: this.orderId,
        },
      });