Browse Source

台账添加功率字段

master
ljlong_2630 9 months ago
parent
commit
3ba5f2f55e
  1. 1
      src/utils/dict.ts
  2. 104
      src/views/eam/device/deviceAccounts/deviceAccounts.data.ts

1
src/utils/dict.ts

@ -295,6 +295,7 @@ export enum DICT_TYPE {
CLASSIFICATION = 'classification', //检修明细状态 CLASSIFICATION = 'classification', //检修明细状态
DEPT_BUSI_TYPE = 'dept_busi_type', //部门类型 DEPT_BUSI_TYPE = 'dept_busi_type', //部门类型
DEPT_GROUP = 'dept_group', //部门分组 DEPT_GROUP = 'dept_group', //部门分组
POWER_RANGE = 'power_range', //功率范围
} }

104
src/views/eam/device/deviceAccounts/deviceAccounts.data.ts

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

Loading…
Cancel
Save