From df605c69a17bb548e3f98e10f7cc3c3298e5d8f7 Mon Sep 17 00:00:00 2001
From: huminmin <mac@MacBook-Pro.local>
Date: 星期三, 25 三月 2026 16:31:10 +0800
Subject: [PATCH] 过程检验列表加上不良数量、合格数量字段。过程检验编辑页面也加上不良数量、合格数量字段,不良数量输入框手填,合格数量,数量输入框置灰,根据根据不良数量+合格数量=数量这一逻辑计算。若不填默认不良数量为0。数量是订单本次生产数量-报废数量
---
src/views/qualityManagement/processInspection/index.vue | 58 ++++++++++++++++++++++++++++++++++++++++++++++------------
1 files changed, 46 insertions(+), 12 deletions(-)
diff --git a/src/views/qualityManagement/processInspection/index.vue b/src/views/qualityManagement/processInspection/index.vue
index 6908322..b022b1b 100644
--- a/src/views/qualityManagement/processInspection/index.vue
+++ b/src/views/qualityManagement/processInspection/index.vue
@@ -40,7 +40,7 @@
<InspectionFormDia ref="inspectionFormDia" @close="handleQuery"></InspectionFormDia>
<FormDia ref="formDia" @close="handleQuery"></FormDia>
<files-dia ref="filesDia" @close="handleQuery"></files-dia>
- <el-dialog v-model="dialogFormVisible" title="缂栬緫妫�楠屽憳" width="70%"
+ <el-dialog v-model="dialogFormVisible" title="缂栬緫妫�楠屽憳" width="30%"
@close="closeDia">
<el-form :model="form" label-width="140px" label-position="top" :rules="rules" ref="formRef">
<el-form-item label="妫�楠屽憳锛�" prop="checkName">
@@ -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,23 +75,29 @@
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"}],
+ },
});
const { searchForm } = toRefs(data);
const tableColumn = ref([
{
label: "妫�娴嬫棩鏈�",
prop: "checkTime",
+ width: 120
+ },
+ {
+ label: "鐢熶骇宸ュ崟鍙�",
+ prop: "workOrderNo",
width: 120
},
{
@@ -114,6 +120,16 @@
{
label: "鍗曚綅",
prop: "unit",
+ },
+ {
+ label: "鍚堟牸鏁伴噺",
+ prop: "qualifiedQuantity",
+ width: 100
+ },
+ {
+ label: "涓嶈壇鏁伴噺",
+ prop: "defectiveQuantity",
+ width: 100
},
{
label: "鏁伴噺",
@@ -164,7 +180,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 +203,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;
}
},
{
@@ -195,7 +223,7 @@
}
},
disabled: (row) => {
- return row.inspectState == 1 || row.checkName !== '';
+ return row.inspectState == 1 || row.checkName;
}
},
{
@@ -226,6 +254,7 @@
const filesDia = ref()
const inspectionFormDia = ref()
const { proxy } = getCurrentInstance()
+const userStore = useUserStore()
const changeDaterange = (value) => {
searchForm.value.entryDateStart = undefined;
searchForm.value.entryDateEnd = undefined;
@@ -252,7 +281,12 @@
params.entryDate = undefined
qualityInspectListPage({...params, inspectType: 1}).then(res => {
tableLoading.value = false;
- tableData.value = res.data.records
+ tableData.value = res.data.records.map(item => {
+ return {
+ ...item,
+ qualifiedQuantity: item.quantity - item.defectiveQuantity
+ };
+ });
page.total = res.data.total;
}).catch(err => {
tableLoading.value = false;
--
Gitblit v1.9.3