diff --git a/src/api/eam/device/deviceMaintenanceMain/index.ts b/src/api/eam/device/deviceMaintenanceMain/index.ts index e4ea50f..c9f08a4 100644 --- a/src/api/eam/device/deviceMaintenanceMain/index.ts +++ b/src/api/eam/device/deviceMaintenanceMain/index.ts @@ -66,3 +66,9 @@ export const orderStepChange = async (data: DeviceMaintenanceMainVO) => { export const orderTurnTo = async (data: DeviceMaintenanceMainVO) => { return await request.get({ url: `/eam/device-maintenance-main/turnTo?deviceNumber=`+data.deviceNumber +`&id=`+data.id + `&receiverType=`+ data.type +`&receiverUserId=` + data.maintenance }) } + + +// 查询维修工单主列表不分页 +export const getDeviceMainTempList = async (type: String) => { + return await request.get({ url: `/eam/device-maintenance-main/getList?type=` + type }) +} diff --git a/src/views/eam/device/deviceInspectionMain/deviceInspectionMain.data.ts b/src/views/eam/device/deviceInspectionMain/deviceInspectionMain.data.ts index 11d68fc..75eff32 100644 --- a/src/views/eam/device/deviceInspectionMain/deviceInspectionMain.data.ts +++ b/src/views/eam/device/deviceInspectionMain/deviceInspectionMain.data.ts @@ -3,20 +3,22 @@ import { selectAllFactoryArea } from '@/api/system/dept' import * as DeviceAccountsApi from '@/api/eam/device/deviceAccounts' import { useUserStore } from '@/store/modules/user' import { selecUserByType } from '@/api/system/dept' +import * as DeviceMaintenanceMainApi from '@/api/eam/device/deviceMaintenanceMain' const userStore = useUserStore() const factoryList = await selectAllFactoryArea() const deviceList = await DeviceAccountsApi.getDeviceAccountsNoPage({}) const userList = await selecUserByType({ classType: 'DEVICE', factoryAreaNumber: '', flag: 1 }) - +const repairList = await DeviceMaintenanceMainApi.getDeviceMainTempList('DEVICE') // 表单校验 export const DeviceInspectionMainRules = reactive({ number: [required], - maintenanceNumber: [required], + // maintenanceNumber: [required], deviceNumber: [required], factoryAreaNumber: [required], status: [required], type: [required], concurrencyStamp: [required], + faultType: [required], }) export const DeviceInspectionMain = useCrudSchemas(reactive([ @@ -34,10 +36,34 @@ export const DeviceInspectionMain = useCrudSchemas(reactive([ label: '维修工单号', field: 'maintenanceNumber', sort: 'custom', - isSearch: true, table: { width: '150', }, + api: () => repairList, + // formatter: (_: Recordable, __: TableColumn, cellValue: number) => { + // return repairList.find((account) => account.number == cellValue)?.name + // }, + search: { + show: true, + component: 'Select', + api: () => repairList, + componentProps: { + optionsAlias: { + labelField: 'number', + valueField: 'number' + } + } + }, + form: { + component: 'Select', + api: () => repairList, + componentProps: { + optionsAlias: { + labelField: 'number', + valueField: 'number' + }, + }, + } }, { label: '设备', @@ -74,7 +100,7 @@ export const DeviceInspectionMain = useCrudSchemas(reactive([ } }, { - label: '厂区编号', + label: '厂区', field: 'factoryAreaNumber', sort: 'custom', isSearch: false, @@ -105,7 +131,7 @@ export const DeviceInspectionMain = useCrudSchemas(reactive([ labelField: 'name', valueField: 'id' }, - placeholder: "请先选择设备" + placeholder: "请选择设备" }, } }, @@ -141,25 +167,10 @@ export const DeviceInspectionMain = useCrudSchemas(reactive([ labelField: 'name', valueField: 'id' }, - placeholder: "请先选择设备" + placeholder: "请选择设备" }, } }, - { - label: '描述', - field: 'describe', - sort: 'custom', - isSearch: false, - table: { - width: '230', - }, - form: { - component: 'Input', - componentProps: { - type: 'textarea', - } - }, - }, // { // label: '维修人联系电话', // field: 'maintenancePhone', @@ -169,7 +180,6 @@ export const DeviceInspectionMain = useCrudSchemas(reactive([ label: '状态', field: 'status', sort: 'custom', - isSearch: true, table: { width: '150', }, @@ -177,7 +187,11 @@ export const DeviceInspectionMain = useCrudSchemas(reactive([ dictType: DICT_TYPE.JX_STATUS, dictClass: 'string', form: { - component: 'Select' + component: 'Select', + componentProps: { + disabled: true, + placeholder: "请选择设备" + }, }, }, { @@ -191,7 +205,30 @@ export const DeviceInspectionMain = useCrudSchemas(reactive([ dictType: DICT_TYPE.DEVICE_MOLD_TYPE, dictClass: 'string', form: { - component: 'Select' + component: 'Select', + componentProps: { + disabled: true, + placeholder: "请选择设备" + } + }, + }, + { + label: '故障类型', + field: 'faultType', + sort: 'custom', + table: { + width: '150', + }, + // isSearch: false, + dictType: DICT_TYPE.FAULT_TYPE, + dictClass: 'string', + form: { + value: 'PM', + component: 'Select', + componentProps: { + // disabled: true, + placeholder: "请选择故障类型" + } }, }, // { @@ -201,7 +238,21 @@ export const DeviceInspectionMain = useCrudSchemas(reactive([ // formatter: dateFormatter, // isForm: false, // }, - + { + label: '描述', + field: 'describe', + sort: 'custom', + isSearch: false, + table: { + width: '230', + }, + form: { + component: 'Input', + componentProps: { + type: 'textarea', + } + }, + }, { label: '操作', field: 'action', diff --git a/src/views/eam/device/deviceInspectionMain/index.vue b/src/views/eam/device/deviceInspectionMain/index.vue index 40dbe9e..884246d 100644 --- a/src/views/eam/device/deviceInspectionMain/index.vue +++ b/src/views/eam/device/deviceInspectionMain/index.vue @@ -30,7 +30,7 @@ + :isBusiness="false" @onChange="onChange"/> @@ -46,6 +46,7 @@ import { DeviceInspectionMain, DeviceInspectionMainRules } from './deviceInspect import * as DeviceInspectionMainApi from '@/api/eam/device/deviceInspectionMain' import * as defaultButtons from '@/utils/disposition/defaultButtons' import { useUserStore } from '@/store/modules/user' + // import TableHead from '@/components/TableHead/src/TableHead.vue' // import ImportForm from '@/components/ImportForm/src/ImportForm.vue' // import Detail from '@/components/Detail/src/Detail.vue' @@ -104,6 +105,8 @@ const HeadButttondata = [ // 头部按钮事件 const buttonBaseClick = (val, item) => { if (val == 'add') { // 新增 + DeviceInspectionMain.allSchemas.formSchema[4].value = 'PROCCED'; + DeviceInspectionMain.allSchemas.formSchema[5].value = 'DEVICE'; openForm('create') } else if (val == 'import') { // 导入 handleImport() @@ -236,6 +239,19 @@ function handleFinishOrder(row) { } +const onChange = (field, cur, item) => { + // 当有效天数 和 生效时间 发生变化 + if (field == 'deviceNumber') { + basicFormRef.value.formRef.formModel.factoryAreaNumber = Number(item.componentProps.options.find(element => element.number == cur).factoryAreaNumber) + basicFormRef.value.formRef.formModel.maintenance = String(userStore?.getUser?.id) + basicFormRef.value.formRef.formModel.maintenanceNumber = '' + } else if (field == 'maintenanceNumber') { + basicFormRef.value.formRef.formModel.deviceNumber = item.componentProps.options.find(element => element.number == cur).deviceNumber + basicFormRef.value.formRef.formModel.factoryAreaNumber = Number(item.componentProps.options.find(element => element.number == cur).factoryAreaNumber) + basicFormRef.value.formRef.formModel.maintenance = String(userStore?.getUser?.id) + } +} + /** 初始化 **/ onMounted(async () => { getList() diff --git a/src/views/eam/device/deviceMaintenanceMain/deviceMaintenanceMain.data.ts b/src/views/eam/device/deviceMaintenanceMain/deviceMaintenanceMain.data.ts index 66dcc76..a49f750 100644 --- a/src/views/eam/device/deviceMaintenanceMain/deviceMaintenanceMain.data.ts +++ b/src/views/eam/device/deviceMaintenanceMain/deviceMaintenanceMain.data.ts @@ -40,13 +40,10 @@ export const DeviceMaintenanceMain = useCrudSchemas(reactive([ table: { width: '150', }, - isForm: false, - isSearch: true, - isTable: true, }, { - label: '设备模具编号', + label: '设备', field: 'deviceNumber', sort: 'custom', table: {