From 6f35f9dc767e99ad701f7f6e2f5d4c52b6cc1d0f Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期三, 14 十月 2026 14:05:26 +0800
Subject: [PATCH] refactor(wls): 将级联选择组件替换为普通输入框
---
src/views/mes/process-design/route/data.ts | 45 ++++++++++++++++++++++++++++++---------------
1 files changed, 30 insertions(+), 15 deletions(-)
diff --git a/src/views/mes/process-design/route/data.ts b/src/views/mes/process-design/route/data.ts
index 7990b1e..6d0e614 100644
--- a/src/views/mes/process-design/route/data.ts
+++ b/src/views/mes/process-design/route/data.ts
@@ -154,7 +154,7 @@
field: "createTime",
title: "鍒涘缓鏃堕棿",
width: 180,
- formatter: "formatDateTime",
+ formatter: 'formatDate',
},
{
title: "鎿嶄綔",
@@ -219,7 +219,7 @@
options: getDictOptions(DICT_TYPE.MES_PRO_LINK_TYPE, "number"),
placeholder: "璇烽�夋嫨",
},
- rules: z.number().default(3),
+ rules: z.number().optional(),
},
{
fieldName: "colorCode",
@@ -410,8 +410,11 @@
];
}
-/** 宸ヨ壓璺嚎浜у搧琛ㄥ崟 */
-export function useRouteProductFormSchema(onItemChange?: (item: any) => void): VbenFormSchema[] {
+/** 宸ヨ壓璺嚎浜у搧琛ㄥ崟锛沵ultiple = true锛堟柊澧炴ā寮忥級鏃朵骇鍝佸彲澶氶�夛紝涓�娆℃�х粦瀹氬涓� */
+export function useRouteProductFormSchema(
+ onItemChange?: (item: any) => void,
+ multiple = false,
+): VbenFormSchema[] {
return [
{
fieldName: "id",
@@ -423,17 +426,29 @@
component: "Input",
dependencies: { triggerFields: [""], show: () => false },
},
- // 浜у搧鐗╂枡锛氫娇鐢ㄤ笟鍔¤嚜瀹氫箟閫夋嫨鍣紝change 鍥炲~缂栫爜/鍚嶇О/瑙勬牸/鍗曚綅
- {
- fieldName: "itemId",
- label: "浜у搧",
- component: markRaw(MdItemSelect),
- componentProps: {
- onChange: onItemChange,
- },
- formItemClass: "col-span-2",
- rules: "selectRequired",
- },
+ // 鏂板锛堝閫夛級锛氫竴娆$粦瀹氬涓骇鍝侊紱缂栬緫锛堝崟閫夛級锛歝hange 鍥炲~缂栫爜/鍚嶇О/瑙勬牸/鍗曚綅
+ multiple
+ ? {
+ fieldName: "itemIds",
+ label: "浜у搧锛堝彲澶氶�夛級",
+ component: markRaw(MdItemSelect),
+ componentProps: {
+ multiple: true,
+ placeholder: "璇烽�夋嫨瑕佺粦瀹氱殑浜у搧锛堝彲澶氶�夛級",
+ },
+ formItemClass: "col-span-2",
+ rules: "selectRequired",
+ }
+ : {
+ fieldName: "itemId",
+ label: "浜у搧",
+ component: markRaw(MdItemSelect),
+ componentProps: {
+ onChange: onItemChange,
+ },
+ formItemClass: "col-span-2",
+ rules: "selectRequired",
+ },
{
fieldName: "quantity",
label: "鐢熶骇鏁伴噺",
--
Gitblit v1.9.3