| | |
| | | import { DictEnum } from '@vben/constants'; |
| | | import { getPopupContainer } from '@vben/utils'; |
| | | |
| | | import { Tag } from 'ant-design-vue'; |
| | | |
| | | import { type FormSchemaGetter, z } from '#/adapter/form'; |
| | | import { getDictOptions } from '#/utils/dict'; |
| | | import { renderDict } from '#/utils/render'; |
| | | |
| | | export const querySchema: FormSchemaGetter = () => [ |
| | | { |
| | |
| | | }, |
| | | { |
| | | component: 'RangePicker', |
| | | fieldName: 'createTime', |
| | | fieldName: 'deployDate', |
| | | label: '使用日期' |
| | | } |
| | | ]; |
| | |
| | | { |
| | | title: '设备名称', |
| | | field: 'equName', |
| | | minWidth: 100, |
| | | minWidth: 140, |
| | | fixed: 'left', |
| | | slots: { default: 'equName' } |
| | | }, |
| | |
| | | { |
| | | title: '状态', |
| | | field: 'status', |
| | | sortable: true, |
| | | 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 |
| | | if (row.status === null || row.status === '') { |
| | | return ''; |
| | | } |
| | | return ''; |
| | | return renderDict(row.status, DictEnum.SYS_EQU_STATUS); |
| | | } |
| | | }, |
| | | minWidth: 80, |
| | |
| | | { |
| | | title: '资产编号', |
| | | field: 'assetNo', |
| | | minWidth: 100, |
| | | sortable: true, |
| | | minWidth: 140, |
| | | fixed: 'left' |
| | | }, |
| | | { |
| | | title: '设备编号', |
| | | title: '设备编码', |
| | | field: 'equCode', |
| | | sortable: true, |
| | | minWidth: 100 |
| | | }, |
| | | { |
| | | title: '设备类型', |
| | | field: 'equTypeName', |
| | | minWidth: 100 |
| | | }, |
| | | { |
| | | title: '销售商', |
| | | field: 'seller', |
| | | minWidth: 100 |
| | | }, |
| | | { |
| | | title: '单位', |
| | | field: 'unit', |
| | | minWidth: 60 |
| | | }, |
| | | { |
| | | title: '采购人', |
| | | field: 'purchaseUser', |
| | | minWidth: 100 |
| | | }, |
| | | { |
| | | title: '经手人', |
| | | field: 'handleUser', |
| | | minWidth: 100 |
| | | }, |
| | | { |
| | | title: '资料', |
| | | field: 'profile', |
| | | minWidth: 100 |
| | | }, |
| | | { |
| | |
| | | { |
| | | title: '采购日期', |
| | | field: 'purchaseDate', |
| | | sortable: true, |
| | | minWidth: 120 |
| | | }, |
| | | { |
| | |
| | | { |
| | | title: '导入状态', |
| | | field: 'importStatus', |
| | | slots: { |
| | | default: ({ row }) => { |
| | | return row.importStatus === null || row.importStatus === '' ? '' : renderDict(row.importStatus, DictEnum.EQU_IMPORT_STATU); |
| | | } |
| | | }, |
| | | minWidth: 100 |
| | | }, |
| | | { |
| | | title: '盘点标志', |
| | | field: 'inventoryFlag', |
| | | slots: { |
| | | default: ({ row }) => { |
| | | return row.inventoryFlag === null || row.inventoryFlag === '' ? '' : renderDict(row.inventoryFlag, DictEnum.EIMS_INVENTORY_STATU); |
| | | } |
| | | }, |
| | | minWidth: 100 |
| | | }, |
| | | { |
| | |
| | | fixed: 'right', |
| | | slots: { default: 'action' }, |
| | | title: '操作', |
| | | width: 180 |
| | | width: 200 |
| | | } |
| | | ]; |
| | | |
| | |
| | | label: '资产编号' |
| | | }, |
| | | { |
| | | component: 'Select', |
| | | componentProps: { |
| | | options: getDictOptions(DictEnum.EIMS_EQU_UNIT) |
| | | }, |
| | | fieldName: 'unit', |
| | | label: '单位' |
| | | }, |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'purchaseUserName', |
| | | label: '采购人' |
| | | }, |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'purchaseUser', |
| | | label: '采购人', |
| | | dependencies: { |
| | | show: () => false, |
| | | triggerFields: [''] |
| | | } |
| | | }, |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'handleUserName', |
| | | label: '经手人' |
| | | }, |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'handleUser', |
| | | label: '经手人', |
| | | dependencies: { |
| | | show: () => false, |
| | | triggerFields: [''] |
| | | } |
| | | }, |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'modelNo', |
| | | label: '型号' |
| | |
| | | component: 'Input', |
| | | fieldName: 'madeIn', |
| | | label: '制造商' |
| | | }, |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'seller', |
| | | label: '销售商' |
| | | }, |
| | | { |
| | | component: 'Input', |
| | |
| | | options: getDictOptions(DictEnum.SYS_EQU_STATUS), |
| | | optionType: 'button' |
| | | }, |
| | | defaultValue: '0', |
| | | defaultValue: '5', |
| | | fieldName: 'status', |
| | | label: '状态' |
| | | }, |
| | |
| | | { |
| | | component: 'Select', |
| | | componentProps: { |
| | | // 选中了就只能修改 不能重置为无负责人 |
| | | allowClear: true, |
| | | showSearch: true, |
| | | getPopupContainer |
| | | }, |
| | | fieldName: 'respPerson', |
| | |
| | | component: 'RadioGroup', |
| | | componentProps: { |
| | | buttonStyle: 'solid', |
| | | options: getDictOptions(DictEnum.SYS_NORMAL_DISABLE), |
| | | options: getDictOptions(DictEnum.EQU_IMPORT_STATU), |
| | | optionType: 'button' |
| | | }, |
| | | defaultValue: '0', |
| | |
| | | component: 'RadioGroup', |
| | | componentProps: { |
| | | buttonStyle: 'solid', |
| | | options: getDictOptions(DictEnum.SYS_NORMAL_DISABLE), |
| | | options: getDictOptions(DictEnum.EIMS_INVENTORY_STATU), |
| | | optionType: 'button' |
| | | }, |
| | | defaultValue: '0', |
| | | fieldName: 'inventoryFlag', |
| | | formItemClass: 'col-span-2 lg:col-span-1', |
| | | formItemClass: 'col-span-2', |
| | | label: '盘点标志' |
| | | }, |
| | | { |