import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter } from '@/utils/formatTime' // 表单校验 export const ToolAccountsRules = reactive({ code: [required], name: [required], concurrencyStamp: [required] }) export const ToolAccounts = useCrudSchemas(reactive([ { label: '工装编号', field: 'code', sort: 'custom', isSearch: true, isForm: false, }, { label: '名称', field: 'name', sort: 'custom', isSearch: true }, { label: '型号', field: 'specification', sort: 'custom', isSearch: true }, { label: '类型', field: 'type', sort: 'custom', isSearch: false, form: { component: 'Select' } }, { label: '产权', field: 'equity', sort: 'custom', isSearch: false }, { label: '电机', field: 'electricMachine', sort: 'custom', isSearch: false }, { label: '是否客户资质', field: 'isCustomerAptitude', sort: 'custom', isSearch: false, form: { component: 'Switch' } }, { label: '客户id', field: 'customerId', sort: 'custom', isSearch: false }, { label: '存放位置', field: 'storageLocation', sort: 'custom', isSearch: false }, { label: '使用部门', field: 'useDept', sort: 'custom', isSearch: false }, { label: '负责人', field: 'principal', sort: 'custom', isSearch: false }, { label: '负责人联系方式', field: 'principalTelephone', sort: 'custom', isSearch: false }, { label: '设备状态', field: 'status', sort: 'custom', isSearch: false, form: { component: 'Switch' } }, { label: '启用日期', field: 'startDate', sort: 'custom', formatter: dateFormatter, isSearch: false, search: { component: 'DatePicker', componentProps: { valueFormat: 'YYYY-MM-DD HH:mm:ss', type: 'daterange', defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] } }, form: { component: 'DatePicker', componentProps: { type: 'datetime', valueFormat: 'x' } } }, { label: '供应商编号', field: 'supplierCode', sort: 'custom', isSearch: false }, { label: '采购时间', field: 'purchaseTime', sort: 'custom', formatter: dateFormatter, isSearch: false, search: { component: 'DatePicker', componentProps: { valueFormat: 'YYYY-MM-DD HH:mm:ss', type: 'daterange', defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] } }, form: { component: 'DatePicker', componentProps: { type: 'datetime', valueFormat: 'x' } } }, { label: '采购部门', field: 'purchaseDept', sort: 'custom', isSearch: true }, { label: '采购人', field: 'purchaser', sort: 'custom', isSearch: true }, { label: '出厂日期', field: 'productionDate', sort: 'custom', formatter: dateFormatter, isSearch: false, search: { component: 'DatePicker', componentProps: { valueFormat: 'YYYY-MM-DD HH:mm:ss', type: 'daterange', defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] } }, form: { component: 'DatePicker', componentProps: { type: 'datetime', valueFormat: 'x' } } }, { label: '生产厂商编码', field: 'manufactureCode', sort: 'custom', isSearch: false }, { label: '设备使用寿命', field: 'equipmentLife', sort: 'custom', isSearch: false }, { label: '验收日期', field: 'acceptanceDate', sort: 'custom', formatter: dateFormatter, isSearch: false, search: { component: 'DatePicker', componentProps: { valueFormat: 'YYYY-MM-DD HH:mm:ss', type: 'daterange', defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] } }, form: { component: 'DatePicker', componentProps: { type: 'datetime', valueFormat: 'x' } } }, { label: '价格', field: 'purchasePrice', sort: 'custom', isSearch: false }, { label: '所属厂区编号', field: 'factoryAreaCode', sort: 'custom', isSearch: true }, { label: '车间编号', field: 'workshopCode', sort: 'custom', isSearch: true }, { label: '工段编号', field: 'workshopSectionCode', sort: 'custom', isSearch: true }, { label: '部门', field: 'departmentCode', sort: 'custom', isSearch: false }, { label: '备注', field: 'remark', sort: 'custom', isSearch: false }, // { // label: '是否可用', // field: 'available', // sort: 'custom', // dictType: DICT_TYPE.TRUE_FALSE, // dictClass: 'string', // 默认都是字符串类型其他暂不考虑 // isSearch: false, // form: { // component: 'Switch', // value: 'TRUE', // componentProps: { // inactiveValue: 'FALSE', // activeValue: 'TRUE' // } // } // }, { label: '操作', field: 'action', isForm: false, table: { width: 150, fixed: 'right' } } ]))