From 6fcb00f27e80b38cea4ccb059112ad7cf99d8745 Mon Sep 17 00:00:00 2001
From: baoshiwei <baoshiwei@shlanbao.cn>
Date: 星期五, 25 十月 2024 15:18:22 +0800
Subject: [PATCH] 新增干草配方历史功能模块

---
 src/views/dry/dataDefine/DryHerbInfo.data.ts |   94 +++++++++++++++++++++++++++++++++--------------
 1 files changed, 66 insertions(+), 28 deletions(-)

diff --git a/src/views/dry/dataDefine/DryHerbInfo.data.ts b/src/views/dry/dataDefine/DryHerbInfo.data.ts
index d34afa8..925f7da 100644
--- a/src/views/dry/dataDefine/DryHerbInfo.data.ts
+++ b/src/views/dry/dataDefine/DryHerbInfo.data.ts
@@ -1,5 +1,6 @@
 import {BasicColumn} from '/@/components/Table';
 import {FormSchema} from '/@/components/Table';
+import {rules} from "/@/utils/helper/validator";
 
 //鍒楄〃鏁版嵁
 export const columns: BasicColumn[] = [
@@ -23,6 +24,11 @@
     align:"center",
     dataIndex: 'english'
    },
+  {
+    title: '鑽潗鍒嗙被',
+    align: 'center',
+    dataIndex: 'type_dictText',
+  },
    {
     title: '鑽敤閮ㄤ綅',
     align:"center",
@@ -78,11 +84,11 @@
     align:"center",
     dataIndex: 'usageTaboo'
    },
-   {
-    title: '绉熸埛id',
-    align:"center",
-    dataIndex: 'tenantId'
-   },
+  //  {
+  //   title: '绉熸埛id',
+  //   align:"center",
+  //   dataIndex: 'tenantId'
+  //  },
 ];
 //鏌ヨ鏁版嵁
 export const searchFormSchema: FormSchema[] = [
@@ -104,24 +110,36 @@
       component: 'JInput',
       colProps: {span: 6},
  	},
-	{
-      label: "鑻辨枃鍚�",
-      field: 'english',
-      component: 'JInput',
-      colProps: {span: 6},
- 	},
-	{
-      label: "浜у湴鍒嗗竷",
-      field: 'origin',
-      component: 'JInput',
-      colProps: {span: 6},
- 	},
-	{
-      label: "鍔熸晥涓庝綔鐢�",
-      field: 'efficacy',
-      component: 'JInput',
-      colProps: {span: 6},
- 	},
+	// {
+  //     label: "鑻辨枃鍚�",
+  //     field: 'english',
+  //     component: 'JInput',
+  //     colProps: {span: 6},
+ 	// },
+	// {
+  //     label: "浜у湴鍒嗗竷",
+  //     field: 'origin',
+  //     component: 'JInput',
+  //     colProps: {span: 6},
+ 	// },
+	// {
+  //     label: "鍔熸晥涓庝綔鐢�",
+  //     field: 'efficacy',
+  //     component: 'JInput',
+  //     colProps: {span: 6},
+ 	// },
+  {
+    label: '鑽潗鍒嗙被',
+    field: 'type',
+    component: 'JTreeSelect',
+    componentProps: {
+      dict: 'dry_herb_type,name,id',
+      pidField: 'pid',
+      hasChildField: 'has_child',
+      converIsLeafVal: 1,
+    },
+    colProps: { span: 6 },
+  },
 ];
 //琛ㄥ崟鏁版嵁
 export const formSchema: FormSchema[] = [
@@ -129,11 +147,17 @@
     label: '涓嵂鍚�',
     field: 'name',
     component: 'Input',
+    dynamicRules: ({ model, schema }) => {
+      return [{ required: true, message: '璇疯緭鍏ヨ嵂鏉愬悕绉�!' }, { ...rules.duplicateCheckRule('dry_herb_info', 'name', model, schema)[0] }]
+    },
   },
   {
     label: '鎷奸煶',
     field: 'pinyin',
     component: 'Input',
+    dynamicRules: ({ model, schema }) => {
+      return [{ required: true, message: '璇疯緭鍏ヨ嵂鏉愭嫾闊�!' }, { ...rules.duplicateCheckRule('dry_herb_info', 'pinyin', model, schema)[0] }]
+    },
   },
   {
     label: '鍒悕',
@@ -144,6 +168,20 @@
     label: '鑻辨枃鍚�',
     field: 'english',
     component: 'Input',
+  },
+  {
+    label: '鑽潗鍒嗙被',
+    field: 'type',
+    component: 'JTreeSelect',
+    componentProps: {
+      dict: 'dry_herb_type,name,id',
+      pidField: 'pid',
+      hasChildField: 'has_child',
+      converIsLeafVal: 1,
+    },
+    dynamicRules: ({ model, schema }) => {
+      return [{ required: true, message: '璇疯緭鍏ヨ嵂鏉愬垎绫�!' }]
+    },
   },
   {
     label: '鑽敤閮ㄤ綅',
@@ -200,11 +238,11 @@
     field: 'usageTaboo',
     component: 'Input',
   },
-  {
-    label: '绉熸埛id',
-    field: 'tenantId',
-    component: 'InputNumber',
-  },
+  // {
+  //   label: '绉熸埛id',
+  //   field: 'tenantId',
+  //   component: 'InputNumber',
+  // },
 	// TODO 涓婚敭闅愯棌瀛楁锛岀洰鍓嶅啓姝讳负ID
 	{
 	  label: '',

--
Gitblit v1.9.3