From bb79260cbeeac88cfbadc9606eea57002e8945bc Mon Sep 17 00:00:00 2001 From: baoshiwei <baoshiwei@shlanbao.cn> Date: 星期四, 17 四月 2025 09:43:16 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/main' --- eims-ui/apps/web-antd/src/views/eims/spare/data.tsx | 89 +++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 86 insertions(+), 3 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 index 8228ae6..709705a 100644 --- a/eims-ui/apps/web-antd/src/views/eims/spare/data.tsx +++ b/eims-ui/apps/web-antd/src/views/eims/spare/data.tsx @@ -1,11 +1,13 @@ 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 } from '#/adapter/form'; import { getDictOptions } from '#/utils/dict'; import { renderDict } from '#/utils/render'; -import { getPopupContainer } from '@vben/utils'; export const querySchema: FormSchemaGetter = () => [ { @@ -84,7 +86,7 @@ sortable: true, slots: { default: ({ row }) => { - if (row.unit === null || row.unit === '') { + if (!row.unit || row.unit === '') { return ''; } return renderDict(row.unit, DictEnum.EIMS_SPARE_UNIT); @@ -138,6 +140,87 @@ } ]; +export const inoutCol: VxeGridProps['columns'] = [ + { + title: '鍑哄叆搴撳崟鍙�', + field: 'orderCode', + width: 180 + }, + { + title: '鏃ユ湡', + field: 'orderTime', + width: 180 + }, + { + title: '鏂瑰悜', + field: 'type1', + width: 80, + slots: { + default: ({ row }) => { + const type = row.type; + switch (type) { + case '1': { + return <Tag color="green"> 鍏ュ簱 </Tag>; + } + case '2': { + return <Tag color="blue"> 鍑哄簱 </Tag>; + } + // No default + } + return ''; + } + } + }, + { + title: '绫诲瀷', + field: 'type', + width: 100, + slots: { + default: ({ row }) => { + if (!row.type || row.type === '') { + return ''; + } + return renderDict(row.type, DictEnum.SPARE_INOUT_TYPE); + } + } + }, + { + title: '鍏ュ簱', + field: 'inQuantity', + width: 120, + slots: { + default: ({ row }) => { + return row.type && row.type === '1' ? row.quantity : ''; + } + } + }, + { + title: '鍑哄簱', + field: 'outQuantity', + width: 120, + slots: { + default: ({ row }) => { + return row.type && row.type === '2' ? row.quantity : ''; + } + } + }, + { + title: '搴撳瓨', + field: 'actualStock', + width: 80 + }, + { + title: '鍗曚环', + field: 'unitPrice', + width: 80 + }, + { + title: '閲戦', + field: 'amount', + width: 80 + } +]; + export const drawerSchema: FormSchemaGetter = () => [ { component: 'Input', @@ -173,7 +256,7 @@ show: () => false, triggerFields: ['imgUrl'] }, - label: '澶囦欢棰勮', + label: '澶囦欢棰勮' }, { component: 'Input', -- Gitblit v1.9.3