From 8ef070c84a703c4a8b838bf9320d68d00a7d6dca Mon Sep 17 00:00:00 2001
From: huminmin <mac@MacBook-Pro.local>
Date: 星期四, 28 五月 2026 11:15:32 +0800
Subject: [PATCH] 设备巡检去掉高度限制
---
src/views/qualityManagement/finalInspection/components/formDia.vue | 32 ++++++++++++++++++++++++--------
1 files changed, 24 insertions(+), 8 deletions(-)
diff --git a/src/views/qualityManagement/finalInspection/components/formDia.vue b/src/views/qualityManagement/finalInspection/components/formDia.vue
index 6a3e774..2866cca 100644
--- a/src/views/qualityManagement/finalInspection/components/formDia.vue
+++ b/src/views/qualityManagement/finalInspection/components/formDia.vue
@@ -58,7 +58,7 @@
</el-col>
<el-col :span="12">
<el-form-item label="鏁伴噺锛�" prop="quantity">
- <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="form.quantity" placeholder="璇疯緭鍏�" clearable :precision="2"/>
+ <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="form.quantity" placeholder="璇疯緭鍏�" clearable :precision="2" :disabled="quantityDisabled"/>
</el-form-item>
</el-col>
</el-row>
@@ -80,7 +80,7 @@
<el-row :gutter="30">
<el-col :span="12">
<el-form-item label="妫�楠屽憳锛�" prop="checkName">
- <el-select v-model="form.checkName" placeholder="璇烽�夋嫨" clearable>
+ <el-select v-model="form.checkName" placeholder="璇烽�夋嫨" clearable filterable>
<el-option v-for="item in userList" :key="item.nickName" :label="item.nickName"
:value="item.nickName"/>
</el-select>
@@ -123,7 +123,7 @@
</template>
<script setup>
-import {ref, reactive, toRefs, getCurrentInstance, nextTick} from "vue";
+import {ref, reactive, toRefs, computed, getCurrentInstance, nextTick} from "vue";
import {getOptions} from "@/api/procurementManagement/procurementLedger.js";
import {modelList, productTreeList} from "@/api/basicData/product.js";
import {qualityInspectAdd, qualityInspectUpdate} from "@/api/qualityManagement/rawMaterialInspection.js";
@@ -164,6 +164,11 @@
},
});
const { form, rules } = toRefs(data);
+// 缂栬緫鏃讹細productMainId 鎴� purchaseLedgerId 浠讳竴鏈夊�煎垯鏁伴噺缃伆
+const quantityDisabled = computed(() => {
+ const v = form.value || {};
+ return !!(v.productMainId != null || v.purchaseLedgerId != null);
+});
const supplierList = ref([]);
const productOptions = ref([]);
const tableColumn = ref([
@@ -198,13 +203,13 @@
const modelOptions = ref([]);
// 鎵撳紑寮规
-const openDialog = async (type, row) => {
+const openDialog = async (type, row, defaultCheckResult = "", defaultCheckName = "") => {
operationType.value = type;
dialogFormVisible.value = true;
// 鍏堟竻绌鸿〃鍗曢獙璇佺姸鎬侊紝閬垮厤闂儊
await nextTick();
proxy.$refs.formRef?.clearValidate();
-
+
// 骞惰鍔犺浇鍩虹鏁版嵁
const [userListsRes] = await Promise.all([
userListNoPage(),
@@ -213,17 +218,28 @@
supplierList.value = res.data;
})
]);
- userList.value = userListsRes.data;
-
+ // 绛涢�� roleIds 鍖呭惈 106 鐨勭敤鎴�
+ userList.value = (userListsRes.data || []).filter(user => {
+ const roleIds = user.roleIds || [];
+ return roleIds.includes(106) || roleIds.includes('106');
+ });
+
form.value = {}
testStandardOptions.value = [];
tableData.value = [];
-
+
if (operationType.value === 'edit') {
// 鍏堜繚瀛� testStandardId锛岄伩鍏嶈娓呯┖
const savedTestStandardId = row.testStandardId;
// 鍏堣缃〃鍗曟暟鎹紝浣嗘殏鏃舵竻绌� testStandardId锛岀瓑閫夐」鍔犺浇瀹屾垚鍚庡啀璁剧疆
form.value = {...row, testStandardId: ''}
+ // 濡傛灉浼犲叆浜嗛粯璁ゆ娴嬬粨鏋滐紝瑕嗙洊row涓殑鍊�
+ if (defaultCheckResult) {
+ form.value.checkResult = defaultCheckResult;
+ }
+ // 濡傛灉浼犲叆浜嗛粯璁ゆ楠屽憳锛岃鐩杛ow涓殑鍊硷紙浼樺厛浣跨敤浼犲叆鐨勬楠屽憳锛�
+ console.log('formDia checkName debug:', { defaultCheckName, rowCheckName: row.checkName });
+ form.value.checkName = defaultCheckName || row.checkName || "";
currentProductId.value = row.productId || 0
// 娓呯┖楠岃瘉鐘舵�侊紝閬垮厤鏁版嵁鍔犺浇杩囩▼涓殑鏍¢獙闂儊
nextTick(() => {
--
Gitblit v1.9.3