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', //检修明细状态
DEPT_BUSI_TYPE = 'dept_busi_type', //部门类型
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 { 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: '创建时间',

Loading…
Cancel
Save