From 8e365fd875b7c1962b90b80ffc18db4b619dd9e3 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期五, 03 七月 2026 13:44:29 +0800
Subject: [PATCH] 银川 1.销售订单页面开发、联调 2.合同管理页面开发联调 3.项目代码相关配置修改

---
 src/views/basicData/mdm/data.ts |  183 ++++++++++++++++++++++++++++++++-------------
 1 files changed, 131 insertions(+), 52 deletions(-)

diff --git a/src/views/basicData/mdm/data.ts b/src/views/basicData/mdm/data.ts
index 2ae684a..479f150 100644
--- a/src/views/basicData/mdm/data.ts
+++ b/src/views/basicData/mdm/data.ts
@@ -5,6 +5,8 @@
 import { getDictOptions } from '#/packages/effects/hooks/src';
 
 import { z } from '#/adapter/form';
+import { getUnitPage } from '#/api/mdm/unit';
+import { getWarehouseSimpleList } from '#/api/erp/stock/warehouse';
 
 /** 鐗╂枡绫诲瀷閫夐」 */
 export const ITEM_TYPE_OPTIONS = [
@@ -13,6 +15,22 @@
   { label: '鎴愬搧', value: 3 },
   { label: '杈呮枡', value: 4 },
 ];
+
+/** 鐗╂枡绫诲瀷鏄犲皠 */
+export const ITEM_TYPE_MAP: Record<number, string> = {
+  1: '鍘熸枡',
+  2: '鍗婃垚鍝�',
+  3: '鎴愬搧',
+  4: '杈呮枡',
+};
+
+/** 鐗╂枡绫诲瀷棰滆壊鏄犲皠 */
+export const ITEM_TYPE_COLOR_MAP: Record<number, string> = {
+  1: 'green',
+  2: 'orange',
+  3: 'blue',
+  4: 'purple',
+};
 
 /** 鏂板/淇敼鐨勮〃鍗� */
 export function useFormSchema(): VbenFormSchema[] {
@@ -44,12 +62,15 @@
       rules: 'required',
     },
     {
-      component: 'Input',
-      fieldName: 'barCode',
-      label: '鏉$爜',
+      component: 'RadioGroup',
+      fieldName: 'itemType',
+      label: '鐗╂枡绫诲瀷',
       componentProps: {
-        placeholder: '璇疯緭鍏ユ潯鐮�',
+        options: ITEM_TYPE_OPTIONS,
+        buttonStyle: 'solid',
+        optionType: 'button',
       },
+      rules: 'required',
     },
     {
       component: 'Input',
@@ -60,47 +81,97 @@
       },
     },
     {
-      component: 'TreeSelect',
-      fieldName: 'categoryId',
-      label: '鐗╂枡鍒嗙被',
-      componentProps: {
-        placeholder: '璇烽�夋嫨鐗╂枡鍒嗙被',
-        allowClear: true,
-        treeData: [],
-        fieldNames: { label: 'name', value: 'id', children: 'children' },
-      },
-    },
-    {
-      component: 'Select',
+      component: 'ApiSelect',
       fieldName: 'unitMeasureId',
       label: '璁¢噺鍗曚綅',
+      rules: 'required',
+      formItemClass: 'col-span-1',
       componentProps: {
         placeholder: '璇烽�夋嫨璁¢噺鍗曚綅',
         allowClear: true,
-        options: [],
-        fieldNames: { label: 'name', value: 'id' },
+        api: async () => {
+          const res = await getUnitPage({ pageNo: 1, pageSize: 100, status: 0 });
+          return res.list || [];
+        },
+        labelField: 'name',
+        valueField: 'id',
       },
     },
     {
-      component: 'Select',
-      fieldName: 'brandId',
-      label: '鍝佺墝',
+      component: 'ApiSelect',
+      fieldName: 'unitMeasureId2',
+      label: '杈呭崟浣�1',
+      formItemClass: 'col-span-1',
       componentProps: {
-        placeholder: '璇烽�夋嫨鍝佺墝',
+        placeholder: '璇烽�夋嫨杈呭崟浣�1',
         allowClear: true,
-        options: [],
-        fieldNames: { label: 'name', value: 'id' },
+        api: async () => {
+          const res = await getUnitPage({ pageNo: 1, pageSize: 100, status: 0 });
+          return res.list || [];
+        },
+        labelField: 'name',
+        valueField: 'id',
       },
     },
     {
-      component: 'Select',
-      fieldName: 'itemType',
-      label: '鐗╂枡绫诲瀷',
+      component: 'InputNumber',
+      fieldName: 'unitMeasureRate1',
+      label: '杈呭崟浣�1鎹㈢畻姣旂巼',
+      formItemClass: 'col-span-1',
       componentProps: {
-        placeholder: '璇烽�夋嫨鐗╂枡绫诲瀷',
-        options: ITEM_TYPE_OPTIONS,
+        class: '!w-full',
+        min: 0,
+        precision: 6,
+        placeholder: '璇疯緭鍏ユ崲绠楁瘮鐜�',
       },
-      rules: 'required',
+    },
+    {
+      component: 'ApiSelect',
+      fieldName: 'unitMeasureId3',
+      label: '杈呭崟浣�2',
+      formItemClass: 'col-span-1',
+      componentProps: {
+        placeholder: '璇烽�夋嫨杈呭崟浣�2',
+        allowClear: true,
+        api: async () => {
+          const res = await getUnitPage({ pageNo: 1, pageSize: 100, status: 0 });
+          return res.list || [];
+        },
+        labelField: 'name',
+        valueField: 'id',
+      },
+    },
+    {
+      component: 'InputNumber',
+      fieldName: 'unitMeasureRate2',
+      label: '杈呭崟浣�2鎹㈢畻姣旂巼',
+      formItemClass: 'col-span-1',
+      componentProps: {
+        class: '!w-full',
+        min: 0,
+        precision: 6,
+        placeholder: '璇疯緭鍏ユ崲绠楁瘮鐜�',
+      },
+    },
+    {
+      component: 'ApiSelect',
+      fieldName: 'warehouseId',
+      label: '榛樿浠撳簱',
+      componentProps: {
+        placeholder: '璇烽�夋嫨榛樿浠撳簱',
+        allowClear: true,
+        api: getWarehouseSimpleList,
+        labelField: 'name',
+        valueField: 'id',
+      },
+    },
+    {
+      component: 'Input',
+      fieldName: 'barCode',
+      label: '鏉$爜',
+      componentProps: {
+        placeholder: '璇疯緭鍏ユ潯鐮�',
+      },
     },
     {
       component: 'InputNumber',
@@ -173,10 +244,11 @@
       fieldName: 'isBatchManaged',
       label: '鎵规绠$悊',
       componentProps: {
+        class: 'w-auto',
         checkedChildren: '鏄�',
         unCheckedChildren: '鍚�',
       },
-      rules: z.boolean().default(false),
+      rules: z.boolean().default(true),
     },
     {
       component: 'InputNumber',
@@ -203,6 +275,7 @@
       component: 'Textarea',
       fieldName: 'remark',
       label: '澶囨敞',
+      formItemClass: 'col-span-2',
       componentProps: {
         placeholder: '璇疯緭鍏ュ娉�',
         rows: 3,
@@ -230,17 +303,6 @@
       componentProps: {
         placeholder: '璇疯緭鍏ョ墿鏂欏悕绉�',
         allowClear: true,
-      },
-    },
-    {
-      fieldName: 'categoryId',
-      label: '鐗╂枡鍒嗙被',
-      component: 'TreeSelect',
-      componentProps: {
-        placeholder: '璇烽�夋嫨鐗╂枡鍒嗙被',
-        allowClear: true,
-        treeData: [],
-        fieldNames: { label: 'name', value: 'id', children: 'children' },
       },
     },
     {
@@ -286,23 +348,40 @@
       minWidth: 150,
     },
     {
-      field: 'categoryName',
-      title: '鍒嗙被',
-      minWidth: 100,
-    },
-    {
       field: 'unitMeasureName',
       title: '鍗曚綅',
       minWidth: 80,
     },
     {
+      field: 'unitMeasureName2',
+      title: '杈呭崟浣�1',
+      minWidth: 80,
+    },
+    {
+      field: 'unitMeasureRate1',
+      title: '杈呭崟浣�1鎹㈢畻姣旂巼',
+      minWidth: 130,
+    },
+    {
+      field: 'unitMeasureName3',
+      title: '杈呭崟浣�2',
+      minWidth: 80,
+    },
+    {
+      field: 'unitMeasureRate2',
+      title: '杈呭崟浣�2鎹㈢畻姣旂巼',
+      minWidth: 130,
+    },
+    {
+      field: 'warehouseName',
+      title: '榛樿浠撳簱',
+      minWidth: 100,
+    },
+    {
       field: 'itemType',
       title: '鐗╂枡绫诲瀷',
       minWidth: 100,
-      cellRender: {
-        name: 'CellDict',
-        props: { type: DICT_TYPE.MDM_ITEM_TYPE },
-      },
+      slots: { default: 'itemType' },
     },
     {
       field: 'purchasePrice',
@@ -348,4 +427,4 @@
       slots: { default: 'actions' },
     },
   ];
-}
+}
\ No newline at end of file

--
Gitblit v1.9.3