From 27c416bf9742574411401fb67203ee9669e57c8a Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期三, 26 十一月 2025 14:20:02 +0800
Subject: [PATCH] fix: 绞线报工的盘具领用和芯线领用的厂家字段使用字典维护做下拉框
---
src/pages/production/twist/receive/steelCore/form.vue | 31 +++++++++++++++++++++++++++++--
1 files changed, 29 insertions(+), 2 deletions(-)
diff --git a/src/pages/production/twist/receive/steelCore/form.vue b/src/pages/production/twist/receive/steelCore/form.vue
index 4561801..d3fb9a4 100644
--- a/src/pages/production/twist/receive/steelCore/form.vue
+++ b/src/pages/production/twist/receive/steelCore/form.vue
@@ -43,19 +43,22 @@
clearable
placeholder="璇疯緭鍏ラ噸閲�"
/>
- <wd-input
+ <wd-picker
v-model="model.supplier"
+ :columns="supplierOptions"
label="鍘傚"
label-width="100px"
prop="supplier"
+ placeholder="璇烽�夋嫨鍘傚"
clearable
- placeholder="璇疯緭鍏ュ巶瀹�"
+ @confirm="handleSupplierChange"
/>
</wd-cell-group>
</wd-form>
</template>
<script lang="ts" setup>
+import { onMounted, watch } from "vue";
import useFormData from "@/hooks/useFormData";
import TwistApi from "@/api/product/twist";
import ManageApi from "@/api/product/manage";
@@ -95,6 +98,9 @@
const diskMaterialOptions = ref<Array<{ label: string; value: string }>>([]);
const diskMaterialValue = ref("");
+// 鍘傚瀛楀吀鏁版嵁
+const supplierOptions = ref<Array<{ label: string; value: string }>>([]);
+
// 鍔犺浇鑺嚎绫诲瀷瀛楀吀鏁版嵁
const loadDiskMaterialDict = async () => {
try {
@@ -110,9 +116,29 @@
}
};
+// 鍔犺浇鍘傚瀛楀吀鏁版嵁
+const loadSupplierDict = async () => {
+ try {
+ const res = await ManageApi.dictAPI("factory");
+ if (res.data && Array.isArray(res.data)) {
+ supplierOptions.value = res.data.map((item: any) => ({
+ label: item.dictLabel || "",
+ value: item.dictValue || "",
+ }));
+ }
+ } catch (error) {
+ // 鍔犺浇瀛楀吀澶辫触锛岄潤榛樺鐞�
+ }
+};
+
// 澶勭悊鑺嚎绫诲瀷閫夋嫨
const handleDiskMaterialChange = (val: any) => {
model.diskMaterial = val.value;
+};
+
+// 澶勭悊鍘傚閫夋嫨
+const handleSupplierChange = (val: any) => {
+ model.supplier = val.value;
};
// 鐩戝惉 model.diskMaterial 鍙樺寲锛屽悓姝ラ�夋嫨鍣ㄦ樉绀�
@@ -256,6 +282,7 @@
onMounted(async () => {
await loadDiskMaterialDict();
+ await loadSupplierDict();
});
defineExpose({
--
Gitblit v1.9.3