spring
2025-02-20 037a7112a2bc9e38bb2f398ff5ca740ac01a8fb2
src/views/business/inspectionTask/index.vue
@@ -89,43 +89,27 @@
</style>
<template>
  <div class="ins-order-plan-main">
    <div v-show="activeFace == 0 && state == 0" style="height: 100%">
    <div v-show="activeFace == 0" style="height: 100%">
      <div class="search">
        <div class="search_thing">
          <div class="search_label">委托编号:</div>
          <div class="search_input">
            <el-input
              v-model="queryParams.entrustCode"
              clearable
              placeholder="请输入"
              size="small"
              @keyup.enter.native="refreshTable()"
            ></el-input>
            <el-input v-model="queryParams.entrustCode" clearable placeholder="请输入" size="small"
              @keyup.enter.native="refreshTable()"></el-input>
          </div>
        </div>
        <div class="search_thing">
          <div class="search_label">检验状态:</div>
          <div class="search_input">
            <el-select
              v-model="queryParams.insState"
              size="small"
              style="width: 100%"
              @change="refreshTable()"
            >
              <el-option
                v-for="(a, i) in dict.type.inspection_task_state"
                :key="i"
                :label="a.label"
                :value="a.value"
              ></el-option>
            <el-select v-model="queryParams.insState" size="small" style="width: 100%" @change="refreshTable()">
              <el-option v-for="(a, i) in dict.type.inspection_task_state" :key="i" :label="a.label"
                :value="a.value"></el-option>
            </el-select>
          </div>
        </div>
        <div class="search_thing" style="padding-left: 30px">
          <el-button size="small" @click="refresh()">重 置</el-button>
          <el-button size="small" type="primary" @click="refreshTable()"
            >查 询</el-button
          >
          <el-button size="small" type="primary" @click="refreshTable()">查 询</el-button>
        </div>
      </div>
      <div class="center">
@@ -135,22 +119,13 @@
              <div style="display: flex; align-items: center">
                <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)"
                  >
                  <li v-for="(m, i) in tabList" :key="i" :class="{ active: i == tabIndex }" @click="handleTab(m, i)">
                    {{ m.label.replace("试验室", "") }}
                  </li>
                </ul>
                <div>
                  <el-checkbox
                    v-model="alone"
                    class="view-self-checkbox"
                    @change="changeCheckBox"
                    ><span>我的任务</span></el-checkbox
                  >
                  <el-checkbox v-model="alone" class="view-self-checkbox"
                    @change="changeCheckBox"><span>我的任务</span></el-checkbox>
                </div>
              </div>
            </el-col>
@@ -162,27 +137,17 @@
            </el-col>
          </el-row>
        </div>
        <lims-table
          :tableData="tableData"
          :column="column"
          :page="page"
          :tableLoading="tableLoading"
          :height="'calc(100vh - 300px)'"
          @pagination="pagination"
          key="tableData0"
        ></lims-table>
        <lims-table :tableData="tableData" :column="column" :page="page" :tableLoading="tableLoading"
          :height="'calc(100vh - 300px)'" @pagination="pagination" key="tableData0"></lims-table>
      </div>
    </div>
    <el-dialog :visible.sync="claimVisible" title="提示" width="400px">
      是否认领委托编号<span style="color: #33c130">{{
        sampleUserForm.entrustCode
      }}</span
      >的任务
      }}</span>的任务
      <span slot="footer" class="dialog-footer">
        <el-button @click="claimVisible = false">取 消</el-button>
        <el-button :loading="loading" type="primary" @click="confirmClaim"
          >确 定</el-button
        >
        <el-button :loading="loading" type="primary" @click="confirmClaim">确 定</el-button>
      </span>
    </el-dialog>
    <el-dialog :visible.sync="connectVisible" title="检验交接" width="400px">
@@ -191,18 +156,8 @@
          <span class="required-span">* </span>交接人员:
        </div>
        <div class="search_input">
          <el-select
            v-model="connect.connectPerson"
            filterable
            placeholder="请选择"
            style="width: 100%"
          >
            <el-option
              v-for="item in personList"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            >
          <el-select v-model="connect.connectPerson" filterable placeholder="请选择" style="width: 100%">
            <el-option v-for="item in personList" :key="item.value" :label="item.label" :value="item.value">
            </el-option>
          </el-select>
        </div>
@@ -212,39 +167,21 @@
          <span class="required-span">* </span>试验室:
        </div>
        <div class="search_input">
          <el-select
            v-model="connect.sonLaboratory"
            filterable
            placeholder="请选择"
            style="width: 100%"
          >
            <el-option
              v-for="item in sonLaboratoryList"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            >
          <el-select v-model="connect.sonLaboratory" filterable placeholder="请选择" style="width: 100%">
            <el-option v-for="item in sonLaboratoryList" :key="item.value" :label="item.label" :value="item.value">
            </el-option>
          </el-select>
        </div>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button @click="connectVisible = false">取 消</el-button>
        <el-button :loading="loading" type="primary" @click="confirmConnect"
          >确 定</el-button
        >
        <el-button :loading="loading" type="primary" @click="confirmConnect">确 定</el-button>
      </span>
    </el-dialog>
    <div
      v-if="activeFace > 0 && isCopper == null"
      style="width: 100%; height: 100%"
    >
    <div v-if="activeFace > 0 && isCopper == null" style="width: 100%; height: 100%">
      <!-- <Add :active="activeFace" :currentId="currentId" :examine="examine" /> -->
    </div>
    <div
      v-if="activeFace > 0 && isCopper == 0"
      style="width: 100%; height: 100%"
    >
    <div v-if="activeFace > 0 && isCopper == 0" style="width: 100%; height: 100%">
      <!-- <CustomsInspection
        :active="activeFace"
        :currentId="currentId"
@@ -252,10 +189,7 @@
        :isReport="isReport"
      /> -->
    </div>
    <div
      v-if="activeFace > 0 && isCopper == 1"
      style="width: 100%; height: 100%"
    >
    <div v-if="activeFace > 0 && isCopper == 1" style="width: 100%; height: 100%">
      <!-- <CopperOrder :active="activeFace" :currentId="currentId"></CopperOrder> -->
    </div>
    <!--<Inspection
@@ -271,46 +205,23 @@
    />-->
    <el-dialog :visible.sync="dataDialogVisible" title="数据查看" width="80%">
      <div v-if="dataDialogVisible" style="height: 70vh; overflow-y: auto">
        <lims-table
          :tableData="lookTableData"
          :column="lookColumn"
          :page="lookPage"
          :tableLoading="lookTableLoading"
          :height="'60vh'"
          @pagination="lookPagination"
          key="tableData1"
        ></lims-table>
        <lims-table :tableData="lookTableData" :column="lookColumn" :page="lookPage" :tableLoading="lookTableLoading"
          :height="'60vh'" @pagination="lookPagination" key="tableData1"></lims-table>
      </div>
    </el-dialog>
    <el-dialog
      :visible.sync="bindDialogVisible"
      title="检验项绑定"
      width="600px"
    >
      <div
        slot="title"
        style="
    <el-dialog :visible.sync="bindDialogVisible" title="检验项绑定" width="600px">
      <div slot="title" style="
          display: flex;
          align-items: center;
          justify-content: space-between;
        "
      >
        ">
        <span>检验项绑定</span>
        <el-button
          style="float: right; margin-left: 360px"
          size="small"
          @click="openBindAdd"
          type="primary"
        >
        <el-button style="float: right; margin-left: 360px" size="small" @click="openBindAdd" type="primary">
          新增
        </el-button>
      </div>
      <el-table :data="bindTableData" style="width: 100%" height="70vh">
        <el-table-column
          prop="inspectionItemClass"
          label="检验项分类"
          width="150"
        >
        <el-table-column prop="inspectionItemClass" label="检验项分类" width="150">
        </el-table-column>
        <el-table-column prop="inspectionItem" label="检验项" width="150">
        </el-table-column>
@@ -318,30 +229,16 @@
        </el-table-column>
        <el-table-column label="操作">
          <template slot-scope="scope">
            <el-button size="mini" type="text" @click="handleDelete(scope.row)"
              >删除</el-button
            >
            <el-button size="mini" type="text" @click="handleDelete(scope.row)">删除</el-button>
          </template>
        </el-table-column>
      </el-table>
    </el-dialog>
    <el-dialog
      :visible.sync="bindAddDialogVisible"
      title="选择绑定"
      width="600px"
    >
      <el-table
        :data="bindAddTableData"
        style="width: 100%"
        height="60vh"
        @selection-change="handleBindAddSelectionChange"
      >
    <el-dialog :visible.sync="bindAddDialogVisible" title="选择绑定" width="600px">
      <el-table :data="bindAddTableData" style="width: 100%" height="60vh"
        @selection-change="handleBindAddSelectionChange">
        <el-table-column type="selection" width="55"> </el-table-column>
        <el-table-column
          prop="inspectionItemClass"
          label="检验项分类"
          width="150"
        >
        <el-table-column prop="inspectionItemClass" label="检验项分类" width="150">
        </el-table-column>
        <el-table-column prop="inspectionItem" label="检验项" width="150">
        </el-table-column>
@@ -350,17 +247,9 @@
      </el-table>
      <span slot="footer" class="dialog-footer">
        <el-button @click="bindAddDialogVisible = false">取 消</el-button>
        <el-button :loading="loading" type="primary" @click="bindAdd"
          >绑 定</el-button
        >
        <el-button :loading="loading" type="primary" @click="bindAdd">绑 定</el-button>
      </span>
    </el-dialog>
    <!-- <un-pass-retest-result
      v-if="retestVisible"
      :retestInfo="retestInfo"
      :retestVisible="retestVisible"
      @closeRetestLook="closeRetestLook"
    ></un-pass-retest-result> -->
    <!--产业链信息查看-->
    <!-- <ShowInfo
      v-if="showInfoDialog"
@@ -379,11 +268,9 @@
// import Add from "../do/b1-ins-order/add.vue";
// import ShowInfo from "../do/b1-material-ins-order/showInfo.vue";
// import CopperOrder from "../do/b1-material-ins-order/copper-order.vue";
// import UnPassRetestResult from "../do/b1-material-ins-order/unPassRetestResult.vue";
import EditInspectionItem from "./components/EditInspectionItem.vue";
import limsTable from "@/components/Table/lims-table.vue";
import {
  getRetestResult,
  claimInsOrderPlan,
  upPlanUser2,
  upPlanUser,
@@ -406,11 +293,10 @@
    // Inspection,
    // Add,
    // CustomsInspection,
    // UnPassRetestResult
  },
  dicts: ["urgency_level", "inspection_task_state"],
  computed: {
    ...mapGetters(["name", "userId"]),
    ...mapGetters(["nickName", "userId"]),
  },
  data() {
    return {
@@ -435,85 +321,6 @@
      ],
      active: 1,
      tabIndex: 0,
      componentDataDataLook: {
        entity: {
          id: 0,
          orderBy: {
            field: "sampleCode",
            order: "asc",
          },
        },
        isIndex: false,
        showSelect: false,
        select: false,
        do: [
          {
            id: "parent",
            font: "不合格复测查看",
            type: "text",
            method: "getRetestResult",
            disabFun: (row, index) => {
              return row.insResult != 0;
            },
          },
          {
            id: "parent",
            font: "检验项绑定",
            type: "text",
            method: "getBinding",
            disabFun: (row, index) => {
              return (
                this.lookInfo.userName == null ||
                this.lookInfo.insState == 3 ||
                this.lookInfo.insState == 5
              );
            },
          },
        ],
        tagField: {
          insState: {
            select: [],
          },
          insResult: {
            select: [
              {
                value: 1,
                label: "合格",
                type: "success",
              },
              {
                value: 0,
                label: "不合格",
                type: "danger",
              },
              {
                value: 3,
                label: "不判定",
                type: "",
              },
            ],
          },
        },
        selectField: {},
        spanConfig: {
          rows: [
            {
              name: "sampleCode",
              index: 0,
            },
            {
              name: "sample",
              index: 1,
            },
            {
              name: "model",
              index: 6,
            },
          ],
        },
        requiredAdd: [],
        requiredUp: [],
      },
      dataDialogVisible: false,
      planTotal: 0,
      insStateList: [],
@@ -540,7 +347,6 @@
      customsInspection: {},
      showInfoDialog: false, // 产业链信息查看
      isReport: 0,
      retestVisible: false,
      retestInfo: [],
      isCopper: null,
      bindCurrentInfo: {},
@@ -668,7 +474,7 @@
                  row.userName == null ||
                  row.insState == 3 ||
                  row.insState == 5 ||
                  (row.userName && !row.userName.includes(this.name))
                  (row.userName && !row.userName.includes(this.nickName))
                );
              },
            },
@@ -683,7 +489,7 @@
                  row.userName == null ||
                  row.insState == 5 ||
                  row.insState == 3 ||
                  (row.userName && !row.userName.includes(this.name))
                  (row.userName && !row.userName.includes(this.nickName))
                );
              },
            },
@@ -721,6 +527,7 @@
          type: "",
        },
      ],
      // 数据查看相关字段---开始
      lookTableData: [],
      lookColumn: [
        {
@@ -756,16 +563,6 @@
          label: "操作",
          operation: [
            {
              name: "不合格复测查看",
              type: "text",
              clickFun: (row) => {
                this.getRetestResult(row);
              },
              disabled: (row) => {
                return row.insResult != 0;
              },
            },
            {
              name: "检验项绑定",
              type: "text",
              clickFun: (row) => {
@@ -788,6 +585,7 @@
        current: 0,
      },
      lookTableLoading: false,
      // 数据查看相关字段---结束
    };
  },
  created() {
@@ -837,6 +635,7 @@
          if (res.code === 200) {
            this.lookTableData = res.data.records;
            this.lookPage.total = res.data.total;
            this.dataDialogVisible = true;
          }
        })
        .catch((err) => {
@@ -860,19 +659,6 @@
    handleDataLook(row) {
      this.lookInfo = row;
      this.getLookList();
      this.dataDialogVisible = true;
    },
    // 查看不合格复测结果
    getRetestResult(row) {
      getRetestResult({ insProductId: row.insProductId }).then((res) => {
        if (res.code == 201) return;
        this.retestVisible = true;
        this.retestInfo = res.data;
      });
    },
    //
    closeRetestLook() {
      this.retestVisible = false;
    },
    // 权限分配
    getPower(radio) {
@@ -1023,14 +809,24 @@
      if (row.userName) {
        inspectorList = row.userName.split(",");
      }
      if (this.name) {
        inspectorList.push(this.name);
      if (this.nickName) {
        inspectorList.push(this.nickName);
      }
      this.inspectorList = inspectorList;
      this.sonLaboratory = row.sonLaboratory;
      this.state = 1;
      this.typeSource = row.typeSource;
      this.orderId = row.id;
      this.$router.push({
        path: "/inspectionTask/inspection",
        query: {
          inspectorList: this.inspectorList,
          sonLaboratory: this.sonLaboratory,
          state: this.state,
          typeSource: this.typeSource,
          orderId: this.orderId,
        },
      });
    },
    // 查看检验数据
    viewInspectInfo(row) {
@@ -1039,8 +835,8 @@
      if (row.userName) {
        inspectorList = row.userName.split(",");
      }
      if (this.name) {
        inspectorList.push(this.name);
      if (this.nickName) {
        inspectorList.push(this.nickName);
      }
      this.inspectorList = inspectorList;
      this.sonLaboratory = row.sonLaboratory;
@@ -1106,7 +902,7 @@
      this.orderId = row.id;
    },
    getAuthorizedPerson() {
      selectUserCondition().then((res) => {
      selectUserCondition({ type: 1 }).then((res) => {
        let data = [];
        res.data.forEach((a) => {
          data.push({