|
|
@ -1,7 +1,7 @@ |
|
|
|
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|
|
|
import { dateFormatter } from '@/utils/formatTime' |
|
|
|
import { selectAllFactoryArea } from '@/api/system/dept' |
|
|
|
|
|
|
|
const factoryList = await selectAllFactoryArea() |
|
|
|
// 表单校验
|
|
|
|
export const DeviceAccountsRules = reactive({ |
|
|
|
// number: [required],
|
|
|
@ -21,41 +21,107 @@ export const DeviceAccounts = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
sort: 'custom', |
|
|
|
isSearch: true, |
|
|
|
isForm: false, |
|
|
|
table: { |
|
|
|
width: '150', |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '名称', |
|
|
|
field: 'name', |
|
|
|
sort: 'custom', |
|
|
|
isSearch: true |
|
|
|
isSearch: true, |
|
|
|
table: { |
|
|
|
width: '150', |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '规格型号', |
|
|
|
field: 'specification', |
|
|
|
sort: 'custom' |
|
|
|
sort: 'custom', |
|
|
|
table: { |
|
|
|
width: '150', |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '设备功率(kw)', |
|
|
|
field: 'power', |
|
|
|
sort: 'custom', |
|
|
|
isSearch: false, |
|
|
|
table: { |
|
|
|
width: '200', |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '设备功率范围', |
|
|
|
field: 'powerRange', |
|
|
|
sort: 'custom', |
|
|
|
dictType: DICT_TYPE.POWER_RANGE, |
|
|
|
dictClass: 'string', |
|
|
|
isSearch: true, |
|
|
|
search: { |
|
|
|
show: true, |
|
|
|
component: 'Select', |
|
|
|
}, |
|
|
|
isTable: false, |
|
|
|
isForm: false, |
|
|
|
isTableForm: true, |
|
|
|
isDetail: true, |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '设备类型', |
|
|
|
field: 'type', |
|
|
|
sort: 'custom', |
|
|
|
isSearch: true, |
|
|
|
table: { |
|
|
|
width: '150', |
|
|
|
}, |
|
|
|
isSearch: false, |
|
|
|
isForm: true, |
|
|
|
dictType: DICT_TYPE.DEVICE_MOLD_TYPE, |
|
|
|
dictClass: 'string', |
|
|
|
form: { |
|
|
|
component: 'Select' |
|
|
|
value: 'DEVICE', |
|
|
|
component: 'Select', |
|
|
|
componentProps: { |
|
|
|
disabled: true, |
|
|
|
} |
|
|
|
}, |
|
|
|
search: { |
|
|
|
value: 'DEVICE' |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '所属厂区', |
|
|
|
field: 'factoryAreaNumber', |
|
|
|
sort: 'custom', |
|
|
|
isSearch: false, |
|
|
|
table: { |
|
|
|
width: '150', |
|
|
|
}, |
|
|
|
api: () => factoryList, |
|
|
|
formatter: (_: Recordable, __: TableColumn, cellValue: number) => { |
|
|
|
return factoryList.find((account) => account.id == cellValue)?.name |
|
|
|
}, |
|
|
|
search: { |
|
|
|
show: true, |
|
|
|
component: 'Select', |
|
|
|
api: () => factoryList, |
|
|
|
componentProps: { |
|
|
|
optionsAlias: { |
|
|
|
labelField: 'name', |
|
|
|
valueField: 'id' |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
form: { |
|
|
|
component: 'Select', |
|
|
|
api: () => selectAllFactoryArea(), |
|
|
|
api: () => factoryList, |
|
|
|
componentProps: { |
|
|
|
disabled: false, |
|
|
|
optionsAlias: { |
|
|
|
labelField: 'name', |
|
|
|
valueField: 'id' |
|
|
|
}, |
|
|
|
placeholder: "请选择所属厂区", |
|
|
|
placeholder: "请选择设备" |
|
|
|
}, |
|
|
|
} |
|
|
|
}, |
|
|
@ -64,6 +130,9 @@ export const DeviceAccounts = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
field: 'purchaseTime', |
|
|
|
sort: 'custom', |
|
|
|
formatter: dateFormatter, |
|
|
|
table: { |
|
|
|
width: '150', |
|
|
|
}, |
|
|
|
form: { |
|
|
|
component: 'DatePicker', |
|
|
|
componentProps: { |
|
|
@ -82,6 +151,9 @@ export const DeviceAccounts = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
isSearch: false, |
|
|
|
isForm: true, |
|
|
|
isTable: true, |
|
|
|
table: { |
|
|
|
width: '150', |
|
|
|
}, |
|
|
|
form: { |
|
|
|
component: 'Input', |
|
|
|
} |
|
|
@ -92,18 +164,27 @@ export const DeviceAccounts = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
sort: 'custom', |
|
|
|
form: { |
|
|
|
component: 'Input', |
|
|
|
} |
|
|
|
}, |
|
|
|
table: { |
|
|
|
width: '150', |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '供应商编号', |
|
|
|
field: 'supplierNumber', |
|
|
|
sort: 'custom' |
|
|
|
sort: 'custom', |
|
|
|
table: { |
|
|
|
width: '150', |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '出厂日期', |
|
|
|
field: 'productionDate', |
|
|
|
sort: 'custom', |
|
|
|
formatter: dateFormatter, |
|
|
|
table: { |
|
|
|
width: '150', |
|
|
|
}, |
|
|
|
form: { |
|
|
|
component: 'DatePicker', |
|
|
|
componentProps: { |
|
|
@ -115,7 +196,10 @@ export const DeviceAccounts = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
{ |
|
|
|
label: '价格', |
|
|
|
field: 'purchasePrice', |
|
|
|
sort: 'custom' |
|
|
|
sort: 'custom', |
|
|
|
table: { |
|
|
|
width: '150', |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '创建时间', |
|
|
|