yyb
15 小时以前 ca51c6068364c5c76c97b4ebad08eabe9f398604
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,16 +75,14 @@
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: {
    process: "",
    entryDate: [
      dayjs().format("YYYY-MM-DD"),
      dayjs().add(1, "day").format("YYYY-MM-DD"),
    ], // 录入日期
    entryDateStart: dayjs().format("YYYY-MM-DD"),
    entryDateEnd: dayjs().add(1, "day").format("YYYY-MM-DD"),
    entryDate: undefined, // 录入日期
    entryDateStart: undefined,
    entryDateEnd: undefined,
  },
   rules: {
      checkName: [{required: true, message: "请选择", trigger: "change"}],
@@ -98,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: "检验员",
@@ -167,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;
            }
      },
      {
@@ -184,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;
            }
         },
         {
@@ -229,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;
@@ -253,7 +276,8 @@
  tableLoading.value = true;
  const params = { ...searchForm.value, ...page };
  params.entryDate = undefined
  qualityInspectListPage({...params, inspectType: 1}).then(res => {
  params.processType = params.process
  qualityInspectListPage({ ...params, inspectType: 1 }).then(res => {
    tableLoading.value = false;
    tableData.value = res.data.records
    page.total = res.data.total;