Browse Source

SBBJ-897设备保养项、设备巡检点检项增加厂区字段,同设备台账所属厂区

master
zhaoyiran 2 weeks ago
parent
commit
4b755f2cba
  1. 51
      src/views/eam/basic/deviceMaintenance/deviceMaintenance.data.ts
  2. 53
      src/views/eam/basic/inspection/inspection.data.ts

51
src/views/eam/basic/deviceMaintenance/deviceMaintenance.data.ts

@ -1,6 +1,8 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import * as DeviceMoldItemsApi from '@/api/eam/basic/deviceMaintenance'
import { selectAllFactoryAreaDept } from '@/api/system/dept'
const factoryDeptList = await selectAllFactoryAreaDept()
// 表单校验
export const DeviceMaintenanceRules = reactive({
@ -186,6 +188,55 @@ export const DeviceMaintenance = useCrudSchemas(reactive<CrudSchema[]>([
}
},
},
{
label: '所属厂区',
field: 'factoryAreaNumber',
sort: 'custom',
isSearch: false,
isDetail: false,
table: {
width: '150',
},
api: () => factoryDeptList,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return factoryDeptList.find((account) => account.id == cellValue)?.name
},
search: {
show: true,
component: 'Select',
api: () => factoryDeptList,
componentProps: {
optionsAlias: {
labelField: 'name',
valueField: 'id'
},
filterable: true,
}
},
form: {
component: 'Select',
api: () => factoryDeptList,
componentProps: {
disabled: false,
optionsAlias: {
labelField: 'name',
valueField: 'id'
},
filterable: true,
placeholder: "请选择所属厂区"
},
}
},
{
label: '所属厂区',
field: 'factoryAreaNumberDetail',
sort: 'custom',
isDetail: true,
isForm: false,
isSearch: false,
isTable: false,
isTableForm: false,
},
// {
// label: '是否可用',
// field: 'available',

53
src/views/eam/basic/inspection/inspection.data.ts

@ -2,6 +2,10 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import * as DeviceMoldItemsApi from '@/api/eam/basic/deviceMaintenance'
import { selectAllFactoryAreaDept } from '@/api/system/dept'
const factoryDeptList = await selectAllFactoryAreaDept()
// 表单校验
export const DeviceMoldItemsRules = reactive({
name: [required],
@ -157,6 +161,55 @@ export const DeviceMoldItems = useCrudSchemas(reactive<CrudSchema[]>([
value: false,
}
},
{
label: '所属厂区',
field: 'factoryAreaNumber',
sort: 'custom',
isSearch: false,
isDetail: false,
table: {
width: '150',
},
api: () => factoryDeptList,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return factoryDeptList.find((account) => account.id == cellValue)?.name
},
search: {
show: true,
component: 'Select',
api: () => factoryDeptList,
componentProps: {
optionsAlias: {
labelField: 'name',
valueField: 'id'
},
filterable: true,
}
},
form: {
component: 'Select',
api: () => factoryDeptList,
componentProps: {
disabled: false,
optionsAlias: {
labelField: 'name',
valueField: 'id'
},
filterable: true,
placeholder: "请选择所属厂区"
},
}
},
{
label: '所属厂区',
field: 'factoryAreaNumberDetail',
sort: 'custom',
isDetail: true,
isForm: false,
isSearch: false,
isTable: false,
isTableForm: false,
},
// {
// label: '是否可用',
// field: 'available',

Loading…
Cancel
Save