From 3baaad59171ded6aca17340fcc907acbeeb45b7b Mon Sep 17 00:00:00 2001
From: zhuguifei <zhuguifei@zhuguifeideiMac.local>
Date: 星期二, 08 四月 2025 08:14:43 +0800
Subject: [PATCH] Merge branch 'main' of http://lanpucloud.cn:1111/r/eims-master

---
 eims-ui/apps/web-antd/src/views/eims/spare/data.tsx |  282 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 282 insertions(+), 0 deletions(-)

diff --git a/eims-ui/apps/web-antd/src/views/eims/spare/data.tsx b/eims-ui/apps/web-antd/src/views/eims/spare/data.tsx
new file mode 100644
index 0000000..8228ae6
--- /dev/null
+++ b/eims-ui/apps/web-antd/src/views/eims/spare/data.tsx
@@ -0,0 +1,282 @@
+import type { VxeGridProps } from '#/adapter/vxe-table';
+
+import { DictEnum } from '@vben/constants';
+
+import { type FormSchemaGetter } from '#/adapter/form';
+import { getDictOptions } from '#/utils/dict';
+import { renderDict } from '#/utils/render';
+import { getPopupContainer } from '@vben/utils';
+
+export const querySchema: FormSchemaGetter = () => [
+  {
+    component: 'Input',
+    fieldName: 'name',
+    label: '澶囦欢鍚嶇О'
+  },
+  {
+    component: 'Input',
+    fieldName: 'code',
+    label: '澶囦欢缂栫爜'
+  },
+  {
+    component: 'Input',
+    fieldName: 'modelNo',
+    label: '澶囦欢鍨嬪彿'
+  },
+  {
+    component: 'Input',
+    fieldName: 'madeIn',
+    label: '鐢熶骇浜у晢'
+  },
+  {
+    component: 'Input',
+    fieldName: 'supplier',
+    label: '渚涘簲鍟�'
+  }
+];
+
+export const columns: VxeGridProps['columns'] = [
+  { type: 'checkbox', width: 60, fixed: 'left' },
+  {
+    title: '澶囦欢棰勮',
+    field: 'imgUrl',
+    showOverflow: true,
+    width: 100,
+    fixed: 'left',
+    align: 'center',
+    slots: { default: 'imgUrl' }
+  },
+  {
+    title: '澶囦欢鍚嶇О',
+    field: 'name',
+    fixed: 'left',
+    align: 'center',
+    width: 200
+  },
+  {
+    title: '澶囦欢缂栫爜',
+    field: 'code',
+    width: 140
+  },
+  {
+    title: '澶囦欢鍨嬪彿',
+    field: 'modelNo',
+    width: 100
+  },
+  {
+    title: '澶囦欢绫诲瀷',
+    field: 'typeName',
+    width: 100
+  },
+  {
+    title: '鐢熶骇浜у晢',
+    field: 'madeIn',
+    width: 140
+  },
+  {
+    title: '渚涘簲鍟�',
+    field: 'supplier',
+    width: 140
+  },
+  {
+    title: '璁¢噺鍗曚綅',
+    field: 'unit',
+    sortable: true,
+    slots: {
+      default: ({ row }) => {
+        if (row.unit === null || row.unit === '') {
+          return '';
+        }
+        return renderDict(row.unit, DictEnum.EIMS_SPARE_UNIT);
+      }
+    },
+    width: 100
+  },
+  {
+    title: '鍙傝�冧环',
+    field: 'referPrice',
+    sortable: true,
+    width: 120
+  },
+  {
+    title: '搴撳瓨涓婇檺',
+    field: 'upperStock',
+    sortable: true,
+    width: 120
+  },
+  {
+    title: '搴撳瓨涓嬮檺',
+    field: 'lowerStock',
+    width: 120
+  },
+  {
+    title: '瀹為檯搴撳瓨',
+    field: 'actualStock',
+    width: 120
+  },
+  {
+    title: '搴撳瓨閲戦',
+    field: 'stockAmount',
+    width: 120
+  },
+  {
+    title: '鏇存崲鍛ㄦ湡',
+    field: 'replaceCycle',
+    width: 120
+  },
+  {
+    title: '澶囨敞',
+    field: 'remark',
+    width: 120
+  },
+  {
+    field: 'action',
+    fixed: 'right',
+    slots: { default: 'action' },
+    title: '鎿嶄綔',
+    width: 180
+  }
+];
+
+export const drawerSchema: FormSchemaGetter = () => [
+  {
+    component: 'Input',
+    dependencies: {
+      show: () => false,
+      triggerFields: ['']
+    },
+    fieldName: 'id'
+  },
+  {
+    component: 'TreeSelect',
+    defaultValue: 0,
+    fieldName: 'type',
+    label: '澶囦欢绫诲瀷',
+    rules: 'selectRequired'
+  },
+  {
+    component: 'Input',
+    fieldName: 'name',
+    label: '澶囦欢鍚嶇О',
+    rules: 'required'
+  },
+  {
+    component: 'Input',
+    fieldName: 'code',
+    label: '澶囦欢缂栫爜',
+    rules: 'required'
+  },
+  {
+    component: 'Input',
+    fieldName: 'img',
+    dependencies: {
+      show: () => false,
+      triggerFields: ['imgUrl']
+    },
+    label: '澶囦欢棰勮',
+  },
+  {
+    component: 'Input',
+    fieldName: 'imgUrl',
+    label: '澶囦欢棰勮'
+  },
+  {
+    component: 'Input',
+    fieldName: 'modelNo',
+    label: '鍨嬪彿'
+  },
+  {
+    component: 'Input',
+    fieldName: 'madeIn',
+    label: '鐢熶骇浜у晢'
+  },
+  {
+    component: 'Input',
+    fieldName: 'supplier',
+    label: '渚涘簲鍟�'
+  },
+  {
+    component: 'InputNumber',
+    fieldName: 'referPrice',
+    label: '鍙傝�冧环鏍�',
+    componentProps: {
+      min: 0,
+      precision: 2,
+      addonAfter: '锟�',
+      placeholder: '璇疯緭鍏�'
+    }
+  },
+  {
+    component: 'InputNumber',
+    fieldName: 'upperStock',
+    label: '搴撳瓨涓婇檺',
+    componentProps: {
+      min: 0
+    }
+  },
+  {
+    component: 'InputNumber',
+    fieldName: 'lowerStock',
+    label: '搴撳瓨涓嬮檺',
+    componentProps: {
+      min: 0
+    }
+  },
+  {
+    component: 'InputNumber',
+    fieldName: 'actualStock',
+    formItemClass: 'col-span-1',
+    label: '瀹為檯搴撳瓨',
+    componentProps: {
+      min: 0
+    }
+  },
+  {
+    component: 'Select',
+    componentProps: {
+      getPopupContainer,
+      options: getDictOptions(DictEnum.EIMS_SPARE_UNIT)
+    },
+    fieldName: 'unit',
+    formItemClass: 'col-span-1 w-[80px]',
+    labelWidth: 0,
+    label: ''
+  },
+  {
+    component: 'InputNumber',
+    fieldName: 'stockAmount',
+    label: '搴撳瓨閲戦',
+    componentProps: {
+      min: 0,
+      precision: 2,
+      addonAfter: '锟�',
+      placeholder: '璇疯緭鍏�'
+    }
+  },
+  {
+    component: 'InputNumber',
+    fieldName: 'replaceCycle',
+    formItemClass: 'col-span-1',
+    label: '鏇存崲鍛ㄦ湡',
+    componentProps: {
+      min: 0
+    }
+  },
+  {
+    component: 'Select',
+    componentProps: {
+      getPopupContainer,
+      options: getDictOptions(DictEnum.MAINT_CYCLE_UNIT)
+    },
+    fieldName: 'cycleUnit',
+    formItemClass: 'col-span-1 w-[80px]',
+    labelWidth: 0,
+    label: ''
+  },
+  {
+    component: 'Textarea',
+    formItemClass: 'items-baseline',
+    fieldName: 'remark',
+    label: '澶囨敞'
+  }
+];

--
Gitblit v1.9.3