import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter } from '@/utils/formatTime' // 表单校验 export const ItemAccountsRules = reactive({ itemNumber: [required], areaNumber: [required], concurrencyStamp: [required] }) export const ItemAccounts = useCrudSchemas( reactive([ { label: '备件编号', field: 'itemNumber', sort: 'custom', isSearch: true, table: { width: 180, fixed: 'left' } }, { label: '库位编号', field: 'locationNumber', sort: 'custom', table: { width: 110 } }, { label: '库区编号', field: 'areaNumber', sort: 'custom', table: { width: 110 } }, { label: '备件名称', field: 'name', sort: 'custom', table: { width: 110 }, isSearch: false }, { label: '规格', field: 'specifications', sort: 'custom' }, { label: '库存数量', field: 'qty', sort: 'custom', table: { width: 110 } }, { label: '是否账内库', field: 'isInAccount', dictType: DICT_TYPE.TRUE_FALSE, dictClass: 'string', isSearch: false, isTable: true, sort: 'custom', table: { width: 130 }, tableForm: { type: 'Select', inactiveValue: 'FALSE', disabled: true }, form: { component: 'Switch', value: 'TRUE', componentProps: { inactiveValue: 'FALSE', activeValue: 'TRUE' } } }, { label: '是否常储', field: 'isConstant', dictType: DICT_TYPE.TRUE_FALSE, dictClass: 'string', isSearch: false, isTable: true, sort: 'custom', table: { width: 110 }, tableForm: { type: 'Select', inactiveValue: 'FALSE', disabled: true }, form: { component: 'Switch', value: 'TRUE', componentProps: { inactiveValue: 'FALSE', activeValue: 'TRUE' } } }, { label: '科目', field: 'subject', sort: 'custom', dictType: DICT_TYPE.SUBJECT, dictClass: 'string', isSearch: false, isTable: true, tableForm: { type: 'Select' } }, { label: '科目代码', field: 'subjectCode', sort: 'custom', isTable: true }, { label: '单位', field: 'uom', sort: 'custom', dictType: DICT_TYPE.UOM, dictClass: 'string', isSearch: false, isTable: true, tableForm: { type: 'Select' } }, { label: '类别', field: 'category', sort: 'custom', dictType: DICT_TYPE.ITEM_CATEGORY, dictClass: 'string', isSearch: false, isTable: true, tableForm: { type: 'Select' } }, { label: '备件分类', field: 'classification', sort: 'custom', dictType: DICT_TYPE.PART_CLASS, dictClass: 'string', isSearch: false, isTable: true, tableForm: { type: 'Select' } }, { label: '区域', field: 'region', sort: 'custom', dictType: DICT_TYPE.REGION, dictClass: 'string', isSearch: false, isTable: true, tableForm: { type: 'Select' } }, // { // label: '单价', // field: 'singlePrice', // sort: 'custom', // }, { label: '重采购点', field: 'reprocurement', sort: 'custom', table: { width: 110 }, form: { component: 'InputNumber', value: 0 } }, { label: '安全库存', field: 'safetyStock', sort: 'custom', table: { width: 110 }, form: { component: 'InputNumber', value: 0 } }, { label: '成本中心', field: 'cost', sort: 'custom', table: { width: 110 } }, { label: '采购员', field: 'purchaser', sort: 'custom', table: { width: 100 } }, { label: '财务', field: 'financer', sort: 'custom' }, { label: '是否以旧换新', field: 'isRadeIn', dictType: DICT_TYPE.TRUE_FALSE, dictClass: 'string', isSearch: false, isTable: true, sort: 'custom', table: { width: 140 }, tableForm: { type: 'Select', inactiveValue: 'FALSE', disabled: true }, form: { component: 'Switch', value: 'TRUE', componentProps: { inactiveValue: 'FALSE', activeValue: 'TRUE' } } }, { label: '是否框架协议', field: 'isFramework', dictType: DICT_TYPE.TRUE_FALSE, dictClass: 'string', isSearch: false, isTable: true, sort: 'custom', table: { width: 140 }, tableForm: { type: 'Select', inactiveValue: 'FALSE', disabled: true }, form: { component: 'Switch', value: 'TRUE', componentProps: { inactiveValue: 'FALSE', activeValue: 'TRUE' } } }, { label: '是否可用', field: 'available', dictType: DICT_TYPE.TRUE_FALSE, dictClass: 'string', isSearch: false, isTable: true, sort: 'custom', table: { width: 150 }, tableForm: { type: 'Select', inactiveValue: 'FALSE', disabled: true }, form: { component: 'Switch', value: 'TRUE', componentProps: { inactiveValue: 'FALSE', activeValue: 'TRUE' } } }, { label: '操作', field: 'action', isForm: false, table: { width: 150, fixed: 'right' } } ]) )