src/views/qualityManagement/processInspection/index.vue
@@ -2,11 +2,11 @@
  <div class="app-container">
    <div class="search_form">
      <div>
        <span class="search_title">工序:</span>
        <span class="search_title">部件类型:</span>
        <el-input
            v-model="searchForm.process"
            style="width: 240px"
            placeholder="请输入工序搜索"
            placeholder="请输入部件类型搜索"
            @change="handleQuery"
            clearable
            :prefix-icon="Search"
@@ -62,7 +62,7 @@
<script setup>
import { Search } from "@element-plus/icons-vue";
import {onMounted, ref} from "vue";
import {onMounted, ref, reactive, toRefs, getCurrentInstance, nextTick} from "vue";
import InspectionFormDia from "@/views/qualityManagement/processInspection/components/inspectionFormDia.vue";
import FormDia from "@/views/qualityManagement/processInspection/components/formDia.vue";
import {ElMessageBox} from "element-plus";
@@ -75,6 +75,7 @@
import FilesDia from "@/views/qualityManagement/processInspection/components/filesDia.vue";
import dayjs from "dayjs";
import {userListNoPage} from "@/api/system/user.js";
import useUserStore from "@/store/modules/user";
const data = reactive({
  searchForm: {
@@ -95,9 +96,19 @@
    width: 120
  },
  {
    label: "工序",
    label: "生产工单号",
    prop: "workOrderNo",
    width: 120
  },
  {
    label: "部件类型",
    prop: "process",
    width: 230
    width: 230,
    formatData: (params) => {
      const dictItems = product_process_type?.value || []
      const hit = dictItems.find(i => String(i.value) === String(params))
      return hit?.label || params
    }
  },
  {
    label: "检验员",
@@ -164,7 +175,13 @@
          openForm("edit", row);
        },
            disabled: (row) => {
               return row.inspectState == 1;
               // 已提交则禁用
               if (row.inspectState == 1) return true;
               // 如果检验员有值,只有当前登录用户能编辑
               if (row.checkName) {
                  return row.checkName !== userStore.nickName;
               }
               return false;
            }
      },
      {
@@ -181,7 +198,13 @@
               submit(row.id);
            },
            disabled: (row) => {
               return row.inspectState == 1;
               // 已提交则禁用
               if (row.inspectState == 1) return true;
               // 如果检验员有值,只有当前登录用户能提交
               if (row.checkName) {
                  return row.checkName !== userStore.nickName;
               }
               return false;
            }
         },
         {
@@ -226,6 +249,9 @@
const filesDia = ref()
const inspectionFormDia = ref()
const { proxy } = getCurrentInstance()
const userStore = useUserStore()
// 部件类型字典(value -> label)
const { product_process_type } = proxy.useDict('product_process_type')
const changeDaterange = (value) => {
  searchForm.value.entryDateStart = undefined;
  searchForm.value.entryDateEnd = undefined;