From 3a7267cd8eebce7c75afb142f8632bfadd5e7a49 Mon Sep 17 00:00:00 2001
From: gongchunyi <deslre0381@gmail.com>
Date: 星期一, 20 四月 2026 11:33:20 +0800
Subject: [PATCH] Merge branch 'dev_河南_鹤壁天沐玻璃厂' of http://114.132.189.42:9002/r/product-inventory-management into dev_河南_鹤壁天沐玻璃厂
---
src/views/qualityManagement/rawMaterialInspection/components/formDia.vue | 56 +++++++++++++++++++++++++++++++++++++++++++++++++-------
1 files changed, 49 insertions(+), 7 deletions(-)
diff --git a/src/views/qualityManagement/rawMaterialInspection/components/formDia.vue b/src/views/qualityManagement/rawMaterialInspection/components/formDia.vue
index 21c4323..5170b60 100644
--- a/src/views/qualityManagement/rawMaterialInspection/components/formDia.vue
+++ b/src/views/qualityManagement/rawMaterialInspection/components/formDia.vue
@@ -14,6 +14,7 @@
v-model="form.supplier"
placeholder="璇烽�夋嫨"
clearable
+ :disabled="supplierQuantityDisabled"
>
<el-option
v-for="item in supplierList"
@@ -71,13 +72,20 @@
<el-row :gutter="30">
<el-col :span="12">
<el-form-item label="鍗曚綅锛�" prop="unit">
- <el-input v-model="form.unit" disabled/>
+ <el-input v-model="form.unit" placeholder="鑷姩甯﹀嚭" readonly class="readonly-display"/>
</el-form-item>
</el-col>
<el-col :span="12">
+ <el-form-item label="鍘氬害锛�" prop="thickness">
+ <el-input v-model="form.thickness" placeholder="鑷姩甯﹀嚭" readonly class="readonly-display"/>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row :gutter="30">
+ <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"/>
+ clearable :precision="2" :disabled="supplierQuantityDisabled"/>
</el-form-item>
</el-col>
</el-row>
@@ -99,8 +107,9 @@
<el-row :gutter="30">
<el-col :span="12">
<el-form-item label="妫�楠屽憳锛�" prop="checkName">
- <el-input v-model="form.checkName" placeholder="璇疯緭鍏�" clearable/>
-
+ <el-select v-model="form.checkName" placeholder="璇烽�夋嫨" clearable style="width: 100%">
+ <el-option v-for="item in userList" :key="item.nickName" :label="item.nickName" :value="item.nickName"/>
+ </el-select>
</el-form-item>
</el-col>
<el-col :span="12">
@@ -143,12 +152,13 @@
</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";
import {qualityInspectParamDel, qualityInspectParamInfo} from "@/api/qualityManagement/qualityInspectParam.js";
import {qualityInspectDetailByProductId, getQualityTestStandardParamByTestStandardId} from "@/api/qualityManagement/metricMaintenance.js";
+import {userListNoPage} from "@/api/system/user.js";
const {proxy} = getCurrentInstance()
const emit = defineEmits(['close'])
@@ -166,6 +176,7 @@
model: "",
testStandardId: "",
unit: "",
+ thickness: "",
quantity: "",
checkCompany: "",
checkResult: "",
@@ -178,6 +189,7 @@
productModelId: [{required: true, message: "璇烽�夋嫨浜у搧鍨嬪彿", trigger: "change"}],
testStandardId: [{required: false, message: "璇烽�夋嫨鎸囨爣", trigger: "change"}],
unit: [{required: false, message: "璇疯緭鍏�", trigger: "blur"}],
+ thickness: [{required: false, message: "璇疯緭鍏�", trigger: "blur"}],
quantity: [{required: true, message: "璇疯緭鍏�", trigger: "blur"}],
checkCompany: [{required: false, message: "璇疯緭鍏�", trigger: "blur"}],
checkResult: [{required: true, message: "璇烽�夋嫨妫�娴嬬粨鏋�", trigger: "change"}],
@@ -216,6 +228,13 @@
const currentProductId = ref(0);
const testStandardOptions = ref([]); // 鎸囨爣閫夋嫨涓嬫媺妗嗘暟鎹�
const modelOptions = ref([]);
+const userList = ref([]); // 妫�楠屽憳涓嬫媺鍒楄〃
+
+// 缂栬緫鏃讹細productMainId 鎴� purchaseLedgerId 浠讳竴鏈夊�煎垯渚涘簲鍟嗐�佹暟閲忕疆鐏�
+const supplierQuantityDisabled = computed(() => {
+ const v = form.value || {};
+ return !!(v.productMainId != null || v.purchaseLedgerId != null);
+});
// 鎵撳紑寮规
const openDialog = async (type, row) => {
@@ -223,6 +242,14 @@
getOptions().then((res) => {
supplierList.value = res.data;
});
+
+ try {
+ const userRes = await userListNoPage();
+ userList.value = userRes.data || [];
+ } catch (e) {
+ console.error("鍔犺浇妫�楠屽憳鍒楄〃澶辫触", e);
+ userList.value = [];
+ }
// 鍏堥噸缃〃鍗曟暟鎹紙淇濇寔瀛楁瀹屾暣锛岄伩鍏嶅脊绐楅娆℃覆鏌撴椂瑙﹀彂蹇呭~绾㈡鈥滈棯涓�涓嬧�濓級
form.value = {
checkTime: "",
@@ -234,6 +261,7 @@
model: "",
testStandardId: "",
unit: "",
+ thickness: "",
quantity: "",
checkCompany: "",
checkResult: "",
@@ -316,6 +344,7 @@
const getModels = (value) => {
form.value.productModelId = undefined;
form.value.unit = undefined;
+ form.value.thickness = undefined;
modelOptions.value = [];
currentProductId.value = value
form.value.productName = findNodeById(productOptions.value, value);
@@ -328,8 +357,10 @@
};
const handleChangeModel = (value) => {
- form.value.model = modelOptions.value.find(item => item.id == value)?.model || '';
- form.value.unit = modelOptions.value.find(item => item.id == value)?.unit || '';
+ const selectedModel = modelOptions.value.find(item => item.id == value);
+ form.value.model = selectedModel?.model || '';
+ form.value.unit = selectedModel?.unit || '';
+ form.value.thickness = selectedModel?.thickness ?? '';
}
const findNodeById = (nodes, productId) => {
@@ -446,4 +477,15 @@
<style scoped>
+:deep(.readonly-display .el-input__wrapper) {
+ background-color: var(--el-disabled-bg-color);
+ box-shadow: 0 0 0 1px var(--el-disabled-border-color) inset;
+}
+
+:deep(.readonly-display .el-input__inner) {
+ color: var(--el-disabled-text-color);
+ -webkit-text-fill-color: var(--el-disabled-text-color);
+ cursor: not-allowed;
+}
+
</style>
\ No newline at end of file
--
Gitblit v1.9.3