|
@ -9,46 +9,27 @@ const supplierList = await SupplierApi.getSupplierNoPage({}) |
|
|
const userListAll = await UserApi.getSimpleUserList() |
|
|
const userListAll = await UserApi.getSimpleUserList() |
|
|
// 表单校验
|
|
|
// 表单校验
|
|
|
export const DeviceAccountsRules = reactive({ |
|
|
export const DeviceAccountsRules = reactive({ |
|
|
name: [ |
|
|
name: [required, { max: 50, message: '不得超过50个字符', trigger: 'blur' }], |
|
|
required, |
|
|
specification: [{ max: 20, message: '不得超过20个字符', trigger: 'blur' }], |
|
|
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }, |
|
|
type: [{ max: 20, message: '不得超过20个字符', trigger: 'blur' }], |
|
|
], |
|
|
status: [{ max: 20, message: '不得超过20个字符', trigger: 'blur' }], |
|
|
specification: [ |
|
|
|
|
|
{ max: 20, message: '不得超过20个字符', trigger: 'blur' }, |
|
|
|
|
|
], |
|
|
|
|
|
type: [ |
|
|
|
|
|
{ max: 20, message: '不得超过20个字符', trigger: 'blur' }, |
|
|
|
|
|
], |
|
|
|
|
|
status: [ |
|
|
|
|
|
{ max: 20, message: '不得超过20个字符', trigger: 'blur' }, |
|
|
|
|
|
], |
|
|
|
|
|
power: [ |
|
|
power: [ |
|
|
{ max: 20, message: '不得超过20个字符', trigger: 'blur' }, |
|
|
{ max: 20, message: '不得超过20个字符', trigger: 'blur' }, |
|
|
{ validator: validateNumDot, message: '请输入数字格式', trigger: 'blur' } |
|
|
{ validator: validateNumDot, message: '请输入数字格式', trigger: 'blur' } |
|
|
], |
|
|
], |
|
|
describes: [ |
|
|
describes: [{ max: 600, message: '不得超过600个字符', trigger: 'blur' }], |
|
|
{ max: 600, message: '不得超过600个字符', trigger: 'blur' }, |
|
|
factoryAreaNumber: [required, { max: 20, message: '不得超过20个字符', trigger: 'blur' }], |
|
|
], |
|
|
purchaseDept: [{ max: 100, message: '不得超过100个字符', trigger: 'blur' }], |
|
|
factoryAreaNumber: [ |
|
|
purchaser: [{ max: 300, message: '不得超过300个字符', trigger: 'blur' }], |
|
|
required, |
|
|
supplierNumber: [{ max: 20, message: '不得超过20个字符', trigger: 'blur' }], |
|
|
{ max: 20, message: '不得超过20个字符', trigger: 'blur' }, |
|
|
|
|
|
], |
|
|
|
|
|
purchaseDept: [ |
|
|
|
|
|
{ max: 100, message: '不得超过100个字符', trigger: 'blur' }, |
|
|
|
|
|
], |
|
|
|
|
|
purchaser: [ |
|
|
|
|
|
{ max: 300, message: '不得超过300个字符', trigger: 'blur' }, |
|
|
|
|
|
], |
|
|
|
|
|
supplierNumber: [ |
|
|
|
|
|
{ max: 20, message: '不得超过20个字符', trigger: 'blur' }, |
|
|
|
|
|
], |
|
|
|
|
|
purchasePrice: [ |
|
|
purchasePrice: [ |
|
|
{ validator: validateNumberMax20Length, message: '请填写合理的价格', trigger: 'blur' }, |
|
|
{ validator: validateNumberMax20Length, message: '请填写合理的价格', trigger: 'blur' }, |
|
|
{ validator: validateNumDot, message: '请输入数字格式', trigger: 'blur' } |
|
|
{ validator: validateNumDot, message: '请输入数字格式', trigger: 'blur' } |
|
|
], |
|
|
] |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
export const DeviceAccounts = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
export const DeviceAccounts = useCrudSchemas( |
|
|
|
|
|
reactive<CrudSchema[]>([ |
|
|
{ |
|
|
{ |
|
|
label: '设备台账编号', |
|
|
label: '设备台账编号', |
|
|
field: 'number', |
|
|
field: 'number', |
|
@ -57,8 +38,8 @@ export const DeviceAccounts = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
isForm: false, |
|
|
isForm: false, |
|
|
table: { |
|
|
table: { |
|
|
width: '150', |
|
|
width: '150', |
|
|
fixed: 'left', |
|
|
fixed: 'left' |
|
|
}, |
|
|
} |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
label: '名称', |
|
|
label: '名称', |
|
@ -66,16 +47,16 @@ export const DeviceAccounts = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
sort: 'custom', |
|
|
sort: 'custom', |
|
|
isSearch: true, |
|
|
isSearch: true, |
|
|
table: { |
|
|
table: { |
|
|
width: '150', |
|
|
width: '150' |
|
|
}, |
|
|
} |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
label: '规格型号', |
|
|
label: '规格型号', |
|
|
field: 'specification', |
|
|
field: 'specification', |
|
|
sort: 'custom', |
|
|
sort: 'custom', |
|
|
table: { |
|
|
table: { |
|
|
width: '150', |
|
|
width: '150' |
|
|
}, |
|
|
} |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
label: '设备功率(kw)', |
|
|
label: '设备功率(kw)', |
|
@ -83,8 +64,8 @@ export const DeviceAccounts = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
sort: 'custom', |
|
|
sort: 'custom', |
|
|
isSearch: false, |
|
|
isSearch: false, |
|
|
table: { |
|
|
table: { |
|
|
width: '200', |
|
|
width: '200' |
|
|
}, |
|
|
} |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
label: '设备功率范围', |
|
|
label: '设备功率范围', |
|
@ -95,19 +76,19 @@ export const DeviceAccounts = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
isSearch: true, |
|
|
isSearch: true, |
|
|
search: { |
|
|
search: { |
|
|
show: true, |
|
|
show: true, |
|
|
component: 'Select', |
|
|
component: 'Select' |
|
|
}, |
|
|
}, |
|
|
isTable: false, |
|
|
isTable: false, |
|
|
isTableForm: false, |
|
|
isTableForm: false, |
|
|
isDetail: false, |
|
|
isDetail: false, |
|
|
isForm: false, |
|
|
isForm: false |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
label: '设备类型', |
|
|
label: '设备类型', |
|
|
field: 'type', |
|
|
field: 'type', |
|
|
sort: 'custom', |
|
|
sort: 'custom', |
|
|
table: { |
|
|
table: { |
|
|
width: '150', |
|
|
width: '150' |
|
|
}, |
|
|
}, |
|
|
isSearch: false, |
|
|
isSearch: false, |
|
|
isForm: true, |
|
|
isForm: true, |
|
@ -118,7 +99,7 @@ export const DeviceAccounts = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
value: 'DEVICE', |
|
|
value: 'DEVICE', |
|
|
component: 'Select', |
|
|
component: 'Select', |
|
|
componentProps: { |
|
|
componentProps: { |
|
|
disabled: true, |
|
|
disabled: true |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
search: { |
|
|
search: { |
|
@ -132,7 +113,7 @@ export const DeviceAccounts = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
isSearch: false, |
|
|
isSearch: false, |
|
|
isDetail: false, |
|
|
isDetail: false, |
|
|
table: { |
|
|
table: { |
|
|
width: '150', |
|
|
width: '150' |
|
|
}, |
|
|
}, |
|
|
api: () => factoryDeptList, |
|
|
api: () => factoryDeptList, |
|
|
formatter: (_: Recordable, __: TableColumn, cellValue: number) => { |
|
|
formatter: (_: Recordable, __: TableColumn, cellValue: number) => { |
|
@ -147,7 +128,7 @@ export const DeviceAccounts = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
labelField: 'name', |
|
|
labelField: 'name', |
|
|
valueField: 'id' |
|
|
valueField: 'id' |
|
|
}, |
|
|
}, |
|
|
filterable: true, |
|
|
filterable: true |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
form: { |
|
|
form: { |
|
@ -160,8 +141,8 @@ export const DeviceAccounts = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
valueField: 'id' |
|
|
valueField: 'id' |
|
|
}, |
|
|
}, |
|
|
filterable: true, |
|
|
filterable: true, |
|
|
placeholder: "请选择设备" |
|
|
placeholder: '请选择设备' |
|
|
}, |
|
|
} |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
@ -172,7 +153,7 @@ export const DeviceAccounts = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
isForm: false, |
|
|
isForm: false, |
|
|
isSearch: false, |
|
|
isSearch: false, |
|
|
isTable: false, |
|
|
isTable: false, |
|
|
isTableForm: false, |
|
|
isTableForm: false |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
label: '负责人', |
|
|
label: '负责人', |
|
@ -181,7 +162,7 @@ export const DeviceAccounts = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
isSearch: false, |
|
|
isSearch: false, |
|
|
isDetail: false, |
|
|
isDetail: false, |
|
|
table: { |
|
|
table: { |
|
|
width: '150', |
|
|
width: '150' |
|
|
}, |
|
|
}, |
|
|
api: () => userListAll, |
|
|
api: () => userListAll, |
|
|
formatter: (_: Recordable, __: TableColumn, cellValue: number) => { |
|
|
formatter: (_: Recordable, __: TableColumn, cellValue: number) => { |
|
@ -204,12 +185,12 @@ export const DeviceAccounts = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
componentProps: { |
|
|
componentProps: { |
|
|
optionsAlias: { |
|
|
optionsAlias: { |
|
|
labelField: 'nickname', |
|
|
labelField: 'nickname', |
|
|
valueField: 'id', |
|
|
valueField: 'id' |
|
|
}, |
|
|
}, |
|
|
filterable: true, |
|
|
filterable: true, |
|
|
placeholder: "请选择负责人" |
|
|
placeholder: '请选择负责人' |
|
|
}, |
|
|
} |
|
|
}, |
|
|
} |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
label: '负责人', |
|
|
label: '负责人', |
|
@ -219,7 +200,7 @@ export const DeviceAccounts = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
isForm: false, |
|
|
isForm: false, |
|
|
isSearch: false, |
|
|
isSearch: false, |
|
|
isTable: false, |
|
|
isTable: false, |
|
|
isTableForm: false, |
|
|
isTableForm: false |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
label: '采购时间', |
|
|
label: '采购时间', |
|
@ -227,7 +208,7 @@ export const DeviceAccounts = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
sort: 'custom', |
|
|
sort: 'custom', |
|
|
formatter: dateFormatter, |
|
|
formatter: dateFormatter, |
|
|
table: { |
|
|
table: { |
|
|
width: '150', |
|
|
width: '150' |
|
|
}, |
|
|
}, |
|
|
form: { |
|
|
form: { |
|
|
component: 'DatePicker', |
|
|
component: 'DatePicker', |
|
@ -248,10 +229,10 @@ export const DeviceAccounts = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
isForm: true, |
|
|
isForm: true, |
|
|
isTable: true, |
|
|
isTable: true, |
|
|
table: { |
|
|
table: { |
|
|
width: '150', |
|
|
width: '150' |
|
|
}, |
|
|
}, |
|
|
form: { |
|
|
form: { |
|
|
component: 'Input', |
|
|
component: 'Input' |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
@ -259,11 +240,11 @@ export const DeviceAccounts = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
field: 'purchaser', |
|
|
field: 'purchaser', |
|
|
sort: 'custom', |
|
|
sort: 'custom', |
|
|
form: { |
|
|
form: { |
|
|
component: 'Input', |
|
|
component: 'Input' |
|
|
}, |
|
|
}, |
|
|
table: { |
|
|
table: { |
|
|
width: '150', |
|
|
width: '150' |
|
|
}, |
|
|
} |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
label: '供应商', |
|
|
label: '供应商', |
|
@ -271,7 +252,7 @@ export const DeviceAccounts = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
sort: 'custom', |
|
|
sort: 'custom', |
|
|
isDetail: false, |
|
|
isDetail: false, |
|
|
table: { |
|
|
table: { |
|
|
width: '150', |
|
|
width: '150' |
|
|
}, |
|
|
}, |
|
|
formatter: (_: Recordable, __: TableColumn, cellValue: number) => { |
|
|
formatter: (_: Recordable, __: TableColumn, cellValue: number) => { |
|
|
return supplierList.find((account) => account.number == cellValue)?.name |
|
|
return supplierList.find((account) => account.number == cellValue)?.name |
|
@ -285,7 +266,7 @@ export const DeviceAccounts = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
valueField: 'number' |
|
|
valueField: 'number' |
|
|
}, |
|
|
}, |
|
|
filterable: true, |
|
|
filterable: true, |
|
|
placeholder: "请选择供应商" |
|
|
placeholder: '请选择供应商' |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
@ -297,7 +278,7 @@ export const DeviceAccounts = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
isForm: false, |
|
|
isForm: false, |
|
|
isSearch: false, |
|
|
isSearch: false, |
|
|
isTable: false, |
|
|
isTable: false, |
|
|
isTableForm: false, |
|
|
isTableForm: false |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
label: '出厂日期', |
|
|
label: '出厂日期', |
|
@ -305,7 +286,7 @@ export const DeviceAccounts = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
sort: 'custom', |
|
|
sort: 'custom', |
|
|
formatter: dateFormatter, |
|
|
formatter: dateFormatter, |
|
|
table: { |
|
|
table: { |
|
|
width: '150', |
|
|
width: '150' |
|
|
}, |
|
|
}, |
|
|
form: { |
|
|
form: { |
|
|
component: 'DatePicker', |
|
|
component: 'DatePicker', |
|
@ -323,8 +304,8 @@ export const DeviceAccounts = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
field: 'purchasePrice', |
|
|
field: 'purchasePrice', |
|
|
sort: 'custom', |
|
|
sort: 'custom', |
|
|
table: { |
|
|
table: { |
|
|
width: '150', |
|
|
width: '150' |
|
|
}, |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
{ |
|
|
{ |
|
@ -334,7 +315,7 @@ export const DeviceAccounts = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
dictType: DICT_TYPE.BASIC_STATUS, |
|
|
dictType: DICT_TYPE.BASIC_STATUS, |
|
|
dictClass: 'string', |
|
|
dictClass: 'string', |
|
|
isSearch: true, |
|
|
isSearch: true, |
|
|
isForm: false, |
|
|
isForm: false |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
label: '创建者', |
|
|
label: '创建者', |
|
@ -349,11 +330,33 @@ export const DeviceAccounts = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
{ |
|
|
{ |
|
|
label: '创建时间', |
|
|
label: '创建时间', |
|
|
field: 'createTime', |
|
|
field: 'createTime', |
|
|
sort: 'custom', |
|
|
|
|
|
formatter: dateFormatter, |
|
|
formatter: dateFormatter, |
|
|
isForm: false, |
|
|
detail: { |
|
|
|
|
|
dateFormat: 'YYYY-MM-DD HH:mm:ss' |
|
|
|
|
|
}, |
|
|
|
|
|
sort: 'custom', |
|
|
table: { |
|
|
table: { |
|
|
width: 170 |
|
|
width: 180 |
|
|
|
|
|
}, |
|
|
|
|
|
isTable: true, |
|
|
|
|
|
form: { |
|
|
|
|
|
component: 'DatePicker', |
|
|
|
|
|
componentProps: { |
|
|
|
|
|
style: { width: '100%' }, |
|
|
|
|
|
type: 'datetime', |
|
|
|
|
|
dateFormat: 'YYYY-MM-DD HH:mm:ss', |
|
|
|
|
|
valueFormat: 'x' |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
isForm: false, |
|
|
|
|
|
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')] |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
@ -364,25 +367,27 @@ export const DeviceAccounts = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
width: 200, |
|
|
width: 200, |
|
|
fixed: 'right' |
|
|
fixed: 'right' |
|
|
}, |
|
|
}, |
|
|
isDetail: false, |
|
|
isDetail: false |
|
|
} |
|
|
} |
|
|
])) |
|
|
]) |
|
|
|
|
|
) |
|
|
// 表单校验
|
|
|
// 表单校验
|
|
|
export const UpImageRules = reactive({ |
|
|
export const UpImageRules = reactive({ |
|
|
filePath: [required], |
|
|
filePath: [required] |
|
|
}) |
|
|
}) |
|
|
export const UpImage = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
export const UpImage = useCrudSchemas( |
|
|
|
|
|
reactive<CrudSchema[]>([ |
|
|
{ |
|
|
{ |
|
|
label: '上传图片', |
|
|
label: '上传图片', |
|
|
field: 'filePathList', |
|
|
field: 'filePathList', |
|
|
sort: 'custom', |
|
|
sort: 'custom', |
|
|
isForm: true, |
|
|
isForm: true, |
|
|
form: { |
|
|
form: { |
|
|
component:'UploadImgs', |
|
|
component: 'UploadImgs' |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
}, |
|
|
} |
|
|
])) |
|
|
]) |
|
|
|
|
|
) |
|
|
// // 表单校验
|
|
|
// // 表单校验
|
|
|
// export const UpFileRules = reactive({
|
|
|
// export const UpFileRules = reactive({
|
|
|
// filePath: [required],
|
|
|
// filePath: [required],
|
|
|