From e5aced11100ffd999b67dd0292cd5e9a662029d6 Mon Sep 17 00:00:00 2001
From: yyb <995253665@qq.com>
Date: 星期四, 30 四月 2026 13:17:21 +0800
Subject: [PATCH] 更新工序相关逻辑,改用部件类型字典 `product_process_type`,并调整界面显示和数据格式化以兼容新字段名
---
src/views/qualityManagement/processInspection/index.vue | 49 ++++++++++++++++++++++++++++++++++++-------------
1 files changed, 36 insertions(+), 13 deletions(-)
diff --git a/src/views/qualityManagement/processInspection/index.vue b/src/views/qualityManagement/processInspection/index.vue
index 6f5ddec..de0cfec 100644
--- a/src/views/qualityManagement/processInspection/index.vue
+++ b/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()
+// 閮ㄤ欢绫诲瀷瀛楀吀锛坴alue -> label锛�
+const { product_process_type } = proxy.useDict('product_process_type')
const changeDaterange = (value) => {
searchForm.value.entryDateStart = undefined;
searchForm.value.entryDateEnd = undefined;
--
Gitblit v1.9.3