| | |
| | | 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 = () => [ |
| | | { |
| | |
| | | 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); |
| | |
| | | } |
| | | ]; |
| | | |
| | | 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', |
| | |
| | | show: () => false, |
| | | triggerFields: ['imgUrl'] |
| | | }, |
| | | label: '备件预览', |
| | | label: '备件预览' |
| | | }, |
| | | { |
| | | component: 'Input', |