From 34c674d503e23c0cf6d0b6dec063f3049885e5f8 Mon Sep 17 00:00:00 2001
From: 朱桂飞 <zhuguifei@zhuguifeideMacBook-Air.local>
Date: 星期一, 10 二月 2025 13:17:10 +0800
Subject: [PATCH] 新增盘点明细

---
 eims-ui/apps/web-antd/src/views/eims/inventory-detail/data.tsx |  277 ++++++++++---------------------------------------------
 1 files changed, 52 insertions(+), 225 deletions(-)

diff --git a/eims-ui/apps/web-antd/src/views/eims/inventory-detail/data.tsx b/eims-ui/apps/web-antd/src/views/eims/inventory-detail/data.tsx
index adec6df..6acc5ef 100644
--- a/eims-ui/apps/web-antd/src/views/eims/inventory-detail/data.tsx
+++ b/eims-ui/apps/web-antd/src/views/eims/inventory-detail/data.tsx
@@ -1,18 +1,16 @@
 import type { VxeGridProps } from '#/adapter/vxe-table';
 
 import { DictEnum } from '@vben/constants';
-import { getPopupContainer } from '@vben/utils';
 
-import { Tag } from 'ant-design-vue';
-
-import { type FormSchemaGetter, z } from '#/adapter/form';
+import { type FormSchemaGetter } from '#/adapter/form';
 import { getDictOptions } from '#/utils/dict';
+import { renderDict } from '#/utils/render';
 
 export const querySchema: FormSchemaGetter = () => [
   {
     component: 'Input',
     fieldName: 'equCode',
-    label: '璁惧缂栫爜'
+    label: '璁惧缂栧彿'
   },
   {
     component: 'Input',
@@ -36,83 +34,73 @@
     },
     fieldName: 'equStatus',
     label: '璁惧鐘舵��'
-  },
-  {
+  }
+  /* {
     component: 'Select',
     componentProps: {
       options: getDictOptions(DictEnum.EIMS_INVENTORY_DETAIL_STATU)
     },
     fieldName: 'status',
     label: '鐩樼偣鏄庣粏'
-  }
+  }*/
 ];
 
 export const columns: VxeGridProps['columns'] = [
   { type: 'checkbox', width: 60, fixed: 'left' },
   {
+    title: '鐩樼偣鐘舵��',
+    field: 'status',
+    sortable: true,
+    minWidth: 100,
+    fixed: 'left',
+    slots: {
+      default: ({ row }) => {
+        return renderDict(row.status, DictEnum.EIMS_INVENTORY_DETAIL_STATU);
+      }
+    }
+  },
+  {
     title: '璁惧缂栧彿',
     field: 'equCode',
     minWidth: 120,
-    fixed: 'left',
+    fixed: 'left'
   },
   {
     title: '璁惧鍚嶇О',
     field: 'equName',
-    minWidth: 100,
-    fixed: 'left',
+    minWidth: 100
   },
   {
     title: '璧勪骇缂栧彿',
     field: 'equAssetNo',
-    sortable: true,
-    minWidth: 100,
-  },
-  {
-    title: '浣跨敤閮ㄩ棬',
-    field: 'deptName',
-    minWidth: 100,
-  },
-  {
-    title: '璁惧绫诲瀷',
-    field: 'equTypeName',
-    minWidth: 100,
-  },
-  {
-    title: '璁惧浣嶇疆',
-    field: 'location',
-    minWidth: 100,
+    minWidth: 100
   },
   {
     title: '璁惧鐘舵��',
     field: 'equStatus',
     sortable: true,
+    minWidth: 100,
     slots: {
       default: ({ row }) => {
-        const statu = row.status;
-        switch (statu) {
-          case '0': {
-            return <Tag color="cyan">璇曠敤</Tag>;
-          }
-          case '1': {
-            return <Tag color="green">鍏ュ浐</Tag>;
-          }
-          case '2': {
-            return <Tag color="orange">杩佺Щ</Tag>;
-          }
-          case '3': {
-            return <Tag color="red">鎶ュ簾</Tag>;
-          }
-          case null: {
-            return '';
-          }
-          // No default
-        }
-        return '';
+        return renderDict(row.equStatus, DictEnum.SYS_EQU_STATUS);
       }
-    },
-    minWidth: 80,
+    }
   },
-
+  {
+    title: '浣跨敤閮ㄩ棬',
+    field: 'deptName',
+    minWidth: 100
+  },
+  {
+    title: '璁惧绫诲瀷',
+    field: 'equTypeName',
+    minWidth: 100
+  },
+  {
+    title: '璁惧浣嶇疆',
+    field: 'location',
+    minWidth: 100
+  },
   {
     title: '鐩樼偣浜�',
     field: 'inventoryUser',
@@ -135,194 +123,33 @@
       show: () => false,
       triggerFields: ['']
     },
+    fieldName: 'id'
+  },
+  {
+    component: 'Input',
+    dependencies: {
+      show: () => false,
+      triggerFields: ['']
+    },
     fieldName: 'equId'
   },
   {
-    component: 'TreeSelect',
-    defaultValue: 0,
-    fieldName: 'equTypeId',
-    label: '璁惧绫诲瀷',
-    rules: 'selectRequired'
-  },
-  {
     component: 'Input',
-    fieldName: 'equName',
-    label: '璁惧鍚嶇О',
-    rules: 'required'
-  },
-  {
-    component: 'Input',
-    fieldName: 'equCode',
-    label: '璁惧缂栫爜',
-    help: '璁惧鍞竴缂栫爜'
-  },
-  {
-    component: 'Input',
-    fieldName: 'assetNo',
-    label: '璧勪骇缂栧彿'
-  },
-  {
-    component: 'Input',
-    fieldName: 'modelNo',
-    label: '鍨嬪彿'
-  },
-  {
-    component: 'Input',
-    fieldName: 'madeIn',
-    label: '鍒堕�犲晢'
-  },
-  {
-    component: 'Input',
-    fieldName: 'ratedPower',
-    label: '棰濆畾鍔熺巼'
-  },
-  {
-    component: 'Input',
-    fieldName: 'plateInfo',
-    label: '閾墝淇℃伅'
-  },
-  {
-    component: 'DatePicker',
-    componentProps: {
-      format: 'YYYY-MM-DD',
-      showTime: false,
-      valueFormat: 'YYYY-MM-DD',
-      getPopupContainer
+    dependencies: {
+      show: () => false,
+      triggerFields: ['']
     },
-    fieldName: 'purchaseDate',
-    label: '閲囪喘鏃ユ湡'
+    fieldName: 'inventoryId'
   },
   {
     component: 'RadioGroup',
     componentProps: {
       buttonStyle: 'solid',
-      options: getDictOptions(DictEnum.SYS_EQU_STATUS),
+      options: getDictOptions(DictEnum.EIMS_INVENTORY_DETAIL_STATU),
       optionType: 'button'
     },
     defaultValue: '0',
     fieldName: 'status',
     label: '鐘舵��'
-  },
-  {
-    component: 'Input',
-    fieldName: 'location',
-    label: '鎵�鍦ㄥ満鎵�',
-    help: `璁惧瀹為檯鎽嗘斁鍦烘墍`
-  },
-
-  {
-    component: 'TreeSelect',
-    // 鍦╠rawer閲屾洿鏂� 杩欓噷涓嶉渶瑕侀粯璁ょ殑componentProps
-    defaultValue: undefined,
-    fieldName: 'deptUsed',
-    label: '浣跨敤閮ㄩ棬'
-    // rules: 'selectRequired',
-  },
-  {
-    component: 'Select',
-    componentProps: {
-      allowClear: true,
-      showSearch: true,
-      getPopupContainer
-    },
-    fieldName: 'respPerson',
-    label: '璐d换浜�',
-    help: `璁惧璐熻矗浜猴紝绠$悊浜哄憳`
-  },
-  {
-    component: 'Input',
-    fieldName: 'contactPhone',
-    label: '鑱旂郴鐢佃瘽',
-    defaultValue: undefined,
-    rules: z
-      .string()
-      .regex(/^1[3-9]\d{9}$/, '璇疯緭鍏ユ纭殑鎵嬫満鍙风爜')
-      .optional()
-      .or(z.literal(''))
-  },
-  {
-    component: 'DatePicker',
-    componentProps: {
-      format: 'YYYY-MM-DD',
-      showTime: false,
-      valueFormat: 'YYYY-MM-DD',
-      getPopupContainer
-    },
-    fieldName: 'deployDate',
-    label: '姝e紡浣跨敤鏃ユ湡'
-  },
-  {
-    component: 'DatePicker',
-    componentProps: {
-      format: 'YYYY-MM-DD',
-      showTime: false,
-      valueFormat: 'YYYY-MM-DD',
-      getPopupContainer
-    },
-    fieldName: 'trialDate',
-    label: '寮�濮嬭瘯鐢ㄦ棩鏈�'
-  },
-  {
-    component: 'DatePicker',
-    componentProps: {
-      format: 'YYYY-MM-DD',
-      showTime: false,
-      valueFormat: 'YYYY-MM-DD',
-      getPopupContainer
-    },
-    fieldName: 'planAcceptDate',
-    label: '璁″垝楠屾敹鏃ユ湡'
-  },
-  {
-    component: 'DatePicker',
-    componentProps: {
-      format: 'YYYY-MM-DD',
-      showTime: false,
-      valueFormat: 'YYYY-MM-DD',
-      getPopupContainer
-    },
-    fieldName: 'actualAcceptDate',
-    label: '瀹為檯楠屾敹鏃ユ湡'
-  },
-  {
-    component: 'RadioGroup',
-    componentProps: {
-      buttonStyle: 'solid',
-      options: getDictOptions(DictEnum.SYS_NORMAL_DISABLE),
-      optionType: 'button'
-    },
-    defaultValue: '0',
-    fieldName: 'importStatus',
-    formItemClass: 'col-span-2 lg:col-span-1',
-    label: '瀵煎叆鐘舵��'
-  },
-
-  {
-    component: 'Input',
-    fieldName: 'serviceLife',
-    label: '浣跨敤骞撮檺'
-  },
-  {
-    component: 'RadioGroup',
-    componentProps: {
-      buttonStyle: 'solid',
-      options: getDictOptions(DictEnum.SYS_NORMAL_DISABLE),
-      optionType: 'button'
-    },
-    defaultValue: '0',
-    fieldName: 'inventoryFlag',
-    formItemClass: 'col-span-2 lg:col-span-1',
-    label: '鐩樼偣鏍囧織'
-  },
-  {
-    component: 'DatePicker',
-    componentProps: {
-      format: 'YYYY-MM-DD',
-      showTime: false,
-      valueFormat: 'YYYY-MM-DD',
-      getPopupContainer
-    },
-    fieldName: 'inventoryDate',
-    label: '涓婃鐩樼偣鏃ユ湡'
   }
 ];

--
Gitblit v1.9.3