From 3c4d241b9ef0d14a0cea5cd69b7919dfba1d14c5 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期五, 24 七月 2026 16:17:15 +0800
Subject: [PATCH] 银川 1.销售订单生产状态不匹配, 2.采购订单中没有退货状态字段,筛选项有退货状态 3.采购申请添加查看订单、查看审批功能 4.物料管理与mes产品管理的联动逻辑修改

---
 src/views/basicData/mdm/data.ts |   62 ++++++++++++++----------------
 1 files changed, 29 insertions(+), 33 deletions(-)

diff --git a/src/views/basicData/mdm/data.ts b/src/views/basicData/mdm/data.ts
index c77d66f..953b9f2 100644
--- a/src/views/basicData/mdm/data.ts
+++ b/src/views/basicData/mdm/data.ts
@@ -19,7 +19,7 @@
 let unitListPromise: Promise<any[]> | null = null;
 
 /** 灏嗘墎骞冲垎绫诲垪琛ㄨ浆涓� TreeSelect 鎵�闇�鐨勬爲褰㈢粨鏋� */
-function buildCategoryTree(list: any[]): any[] {
+export function buildCategoryTree(list: any[]): any[] {
   const map = new Map<number, any>();
   const roots: any[] = [];
   for (const item of list) {
@@ -59,7 +59,7 @@
 }
 
 /** 鏂板/淇敼鐨勮〃鍗� */
-export function useFormSchema(formApi?: VbenFormApi): VbenFormSchema[] {
+export function useFormSchema(formApi?: VbenFormApi, categoryTreeData: any[] = []): VbenFormSchema[] {
   return [
     {
       component: "Input",
@@ -103,7 +103,7 @@
       rules: "required",
     },
     {
-      component: "ApiTreeSelect",
+      component: "TreeSelect",
       fieldName: "categoryId",
       label: "鐗╂枡鍒嗙被",
       rules: "selectRequired",
@@ -111,10 +111,8 @@
         placeholder: "璇烽�夋嫨鐗╂枡鍒嗙被",
         allowClear: true,
         treeDefaultExpandAll: true,
-        api: async () => {
-          const res = await getItemTypeSimpleList();
-          return buildCategoryTree(res || []);
-        },
+        treeData: categoryTreeData,
+        fieldNames: { label: 'label', value: 'value', children: 'children' },
       },
     },
     {
@@ -276,17 +274,6 @@
       fieldName: 'isBatchManaged',
       label: '鎵规绠$悊',
       defaultValue: false,
-      componentProps: {
-        class: "w-auto",
-        checkedChildren: "鏄�",
-        unCheckedChildren: "鍚�",
-      },
-      rules: z.boolean().default(false),
-    },
-    {
-      component: "Switch",
-      fieldName: "syncMes",
-      label: "鍚屾鍒� MES",
       componentProps: {
         class: "w-auto",
         checkedChildren: "鏄�",
@@ -554,27 +541,36 @@
       },
     },
     {
-      field: "isBatchManaged",
-      title: "鎵规绠$悊",
-      minWidth: 80,
-      slots: { default: "isBatchManaged" },
-    },
-    {
-      field: "status",
-      title: "鐘舵��",
-      minWidth: 80,
-      cellRender: {
-        name: "CellDict",
-        props: { type: DICT_TYPE.COMMON_STATUS },
-      },
-    },
-    {
       field: "createTime",
       title: "鍒涘缓鏃堕棿",
       minWidth: 180,
       formatter: "formatDateTime",
     },
     {
+      field: "isBatchManaged",
+      title: "鎵规绠$悊",
+      width: 80,
+      fixed: "right",
+      slots: { default: "isBatchManaged" },
+    },
+    {
+      field: "syncedMes",
+      title: "鍚屾鐘舵��",
+      width: 90,
+      fixed: "right",
+      slots: { default: "syncedMes" },
+    },
+    {
+      field: "status",
+      title: "鐘舵��",
+      width: 80,
+      fixed: "right",
+      cellRender: {
+        name: "CellDict",
+        props: { type: DICT_TYPE.COMMON_STATUS },
+      },
+    },
+    {
       title: "鎿嶄綔",
       width: 180,
       fixed: "right",

--
Gitblit v1.9.3