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