|
|
@ -1,6 +1,19 @@ |
|
|
|
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|
|
|
import { dateFormatter } from '@/utils/formatTime' |
|
|
|
|
|
|
|
import { selectAllFactoryArea } from '@/api/system/dept' |
|
|
|
import * as MoldAccountsApi from '@/api/eam/mold/moldAccounts' |
|
|
|
import { useUserStore } from '@/store/modules/user' |
|
|
|
import { selecUserByType } from '@/api/system/dept' |
|
|
|
import { ItemSearchTable } from '../../basic/item/item.data' |
|
|
|
import * as ItemApi from '@/api/eam/basic/item' |
|
|
|
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict' |
|
|
|
// 邮箱账号的列表
|
|
|
|
const factoryList = await selectAllFactoryArea() |
|
|
|
const moldList = await MoldAccountsApi.getMoldAccountsNoPage({}) |
|
|
|
const userList = await selecUserByType({ classType: 'MOLD', factoryAreaNumber: '', flag: 1 }) |
|
|
|
const moldListNoPage = await MoldAccountsApi.getMoldAccountsAllNoPage({}) |
|
|
|
const moldTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE).filter(item => item.value == 'MOLD') |
|
|
|
const deviceMoldTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE) |
|
|
|
// 表单校验
|
|
|
|
export const DeviceSpotInspectionRecordMainRules = reactive({ |
|
|
|
number: [required], |
|
|
@ -16,80 +29,126 @@ export const DeviceSpotInspectionRecordMain = useCrudSchemas(reactive<CrudSchema |
|
|
|
field: 'number', |
|
|
|
sort: 'custom', |
|
|
|
isSearch: true, |
|
|
|
table: { |
|
|
|
width: '150', |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '设备模具', |
|
|
|
field: 'deviceNumber', |
|
|
|
sort: 'custom', |
|
|
|
table: { |
|
|
|
width: '150', |
|
|
|
}, |
|
|
|
isSearch: true, |
|
|
|
api: () => MoldAccountsApi.getMoldAccountsNoPage({ |
|
|
|
isSearch: false |
|
|
|
}), |
|
|
|
formatter: (_: Recordable, __: TableColumn, cellValue: number) => { |
|
|
|
return moldListNoPage.find((account) => account.number == cellValue)?.name |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '描述', |
|
|
|
field: 'describe', |
|
|
|
sort: 'custom', |
|
|
|
form: { |
|
|
|
component: 'Select', |
|
|
|
componentProps: { |
|
|
|
options: moldList, |
|
|
|
optionsAlias: { |
|
|
|
labelField: 'name', |
|
|
|
valueField: 'number' |
|
|
|
}, |
|
|
|
}, |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '维修人', |
|
|
|
field: 'maintenance', |
|
|
|
sort: 'custom', |
|
|
|
table: { |
|
|
|
width: '150', |
|
|
|
}, |
|
|
|
api: () => userList, |
|
|
|
formatter: (_: Recordable, __: TableColumn, cellValue: number) => { |
|
|
|
return userList.find((account) => account.id == cellValue)?.name |
|
|
|
}, |
|
|
|
form: { |
|
|
|
component: 'InputNumber', |
|
|
|
value: 0 |
|
|
|
component: 'Select', |
|
|
|
api: () => userList, |
|
|
|
componentProps: { |
|
|
|
disabled: true, |
|
|
|
optionsAlias: { |
|
|
|
labelField: 'name', |
|
|
|
valueField: 'id' |
|
|
|
}, |
|
|
|
}, |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '维修人联系电话', |
|
|
|
field: 'maintenancePhone', |
|
|
|
sort: 'custom', |
|
|
|
table: { |
|
|
|
width: '200', |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '状态', |
|
|
|
field: 'status', |
|
|
|
sort: 'custom', |
|
|
|
isSearch: true, |
|
|
|
dictType: DICT_TYPE.WEI_XIU_ORDER_STATUS, |
|
|
|
dictClass: 'string', |
|
|
|
table: { |
|
|
|
width: '150', |
|
|
|
}, |
|
|
|
form: { |
|
|
|
component: 'Radio' |
|
|
|
component: 'Select' |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '类型', |
|
|
|
field: 'type', |
|
|
|
sort: 'custom', |
|
|
|
table: { |
|
|
|
width: '150', |
|
|
|
}, |
|
|
|
formatter: (_: Recordable, __: TableColumn, cellValue: number) => { |
|
|
|
return deviceMoldTypeList.find((account) => account.value == cellValue)?.label |
|
|
|
}, |
|
|
|
isSearch: true, |
|
|
|
form: { |
|
|
|
component: 'Select' |
|
|
|
search: { |
|
|
|
component: 'Select', |
|
|
|
componentProps: { |
|
|
|
options: moldTypeList, |
|
|
|
optionsAlias: { |
|
|
|
labelField: 'label', |
|
|
|
valueField: 'value' |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '创建时间', |
|
|
|
field: 'createTime', |
|
|
|
sort: 'custom', |
|
|
|
formatter: dateFormatter, |
|
|
|
isForm: false, |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '地点ID', |
|
|
|
field: 'siteId', |
|
|
|
sort: 'custom', |
|
|
|
form: { |
|
|
|
component: 'Select', |
|
|
|
componentProps: { |
|
|
|
options: moldTypeList, |
|
|
|
optionsAlias: { |
|
|
|
labelField: 'label', |
|
|
|
valueField: 'value' |
|
|
|
}, |
|
|
|
placeholder: "请选择设备" |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '是否可用', |
|
|
|
field: 'available', |
|
|
|
sort: 'custom', |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '并发乐观锁', |
|
|
|
field: 'concurrencyStamp', |
|
|
|
label: '描述', |
|
|
|
field: 'describe', |
|
|
|
sort: 'custom', |
|
|
|
form: { |
|
|
|
component: 'InputNumber', |
|
|
|
value: 0 |
|
|
|
table: { |
|
|
|
width: '300', |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '操作', |
|
|
|
field: 'action', |
|
|
|
isForm: false, |
|
|
|
isTable: false, |
|
|
|
table: { |
|
|
|
width: 150, |
|
|
|
fixed: 'right' |
|
|
@ -107,88 +166,49 @@ export const DeviceSpotInspectionRecordDetailRules = reactive({ |
|
|
|
}) |
|
|
|
|
|
|
|
export const DeviceSpotInspectionRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
|
|
|
|
{ |
|
|
|
label: 'id', |
|
|
|
field: 'id', |
|
|
|
sort: 'custom', |
|
|
|
isForm: false |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '检修工单号与主表一致', |
|
|
|
label: '检修工单号', |
|
|
|
field: 'number', |
|
|
|
sort: 'custom', |
|
|
|
isSearch: true |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '是否符合TRUE/FALSE', |
|
|
|
field: 'isConform', |
|
|
|
sort: 'custom', |
|
|
|
isSearch: true |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '创建时间', |
|
|
|
field: 'createTime', |
|
|
|
sort: 'custom', |
|
|
|
formatter: dateFormatter, |
|
|
|
isSearch: true, |
|
|
|
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')] |
|
|
|
} |
|
|
|
}, |
|
|
|
isForm: false |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '地点ID', |
|
|
|
field: 'siteId', |
|
|
|
sort: 'custom', |
|
|
|
isSearch: true |
|
|
|
table: { |
|
|
|
width: '300', |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '是否可用', |
|
|
|
field: 'available', |
|
|
|
sort: 'custom', |
|
|
|
isSearch: true |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '并发乐观锁', |
|
|
|
field: 'concurrencyStamp', |
|
|
|
label: '是否符合', |
|
|
|
field: 'isConform', |
|
|
|
sort: 'custom', |
|
|
|
isSearch: true, |
|
|
|
form: { |
|
|
|
component: 'InputNumber', |
|
|
|
value: 0 |
|
|
|
} |
|
|
|
table: { |
|
|
|
width: '300', |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '主表id', |
|
|
|
field: 'masterId', |
|
|
|
sort: 'custom', |
|
|
|
isSearch: true, |
|
|
|
form: { |
|
|
|
component: 'InputNumber', |
|
|
|
value: 0 |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
label: '检查内容', |
|
|
|
field: 'name', |
|
|
|
sort: 'custom', |
|
|
|
table: { |
|
|
|
width: '300', |
|
|
|
}, |
|
|
|
isSearch: true |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '设备部位名称', |
|
|
|
field: 'equipmentPosition', |
|
|
|
sort: 'custom', |
|
|
|
table: { |
|
|
|
width: '300', |
|
|
|
}, |
|
|
|
isSearch: true |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '操作', |
|
|
|
field: 'action', |
|
|
|
isForm: false, |
|
|
|
isTable: false, |
|
|
|
table: { |
|
|
|
width: 150, |
|
|
|
fixed: 'right' |
|
|
|