From 670b7447377b404be225726f28999432a5c03e58 Mon Sep 17 00:00:00 2001 From: ljlong_2630 Date: Mon, 25 Mar 2024 14:02:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../eam/device/deviceInspectionMain/index.ts | 6 + src/utils/dict.ts | 1 + .../device/deviceRepair/deviceRepair.data.ts | 26 ++-- .../eam/device/deviceinspectionjob/index.vue | 23 +++- .../deviceMaintenanceMain.data.ts | 15 ++- .../eam/device/devicemaintenancejob/index.vue | 124 +++++++++++++++--- .../eam/mold/moldRepair/moldRepair.data.ts | 26 ++-- .../eam/mold/moldinspectionjob/index.vue | 2 +- .../eam/mold/moldmaintenancejob/index.vue | 97 +++++++++++++- .../moldMaintenanceMain.data.ts | 17 ++- 10 files changed, 281 insertions(+), 56 deletions(-) diff --git a/src/api/eam/device/deviceInspectionMain/index.ts b/src/api/eam/device/deviceInspectionMain/index.ts index 1b701ef..5f2e1c1 100644 --- a/src/api/eam/device/deviceInspectionMain/index.ts +++ b/src/api/eam/device/deviceInspectionMain/index.ts @@ -61,4 +61,10 @@ export const importTemplate = () => { // 检修完成 export const finishInspection = (id: number) => { return request.get({ url: `/eam/device-inspection-job-main/onClick?id=` + id }) +} + + +// 查询检修工单主列表 +export const getDeviceInspectionMainNoPage = async (params) => { + return await request.get({ url: `/eam/device-inspection-job-main/noPage`, params }) } \ No newline at end of file diff --git a/src/utils/dict.ts b/src/utils/dict.ts index 48604a2..f49c322 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -301,5 +301,6 @@ export enum DICT_TYPE { APP_DEVICE_MOLD_TYPE = 'app_device_mold_type', //设备/模具/工艺:类型 ITEM_SUBJECT = 'item_subject', //备件的科目 TURN_TYPE = 'turn_type', //转移类型 + ORDER_COMPLETE_RESULT = 'order_complete_result', //维修工单完成结果 } diff --git a/src/views/eam/device/deviceRepair/deviceRepair.data.ts b/src/views/eam/device/deviceRepair/deviceRepair.data.ts index 0c56e61..c0ed804 100644 --- a/src/views/eam/device/deviceRepair/deviceRepair.data.ts +++ b/src/views/eam/device/deviceRepair/deviceRepair.data.ts @@ -182,19 +182,19 @@ export const DeviceRepair = useCrudSchemas(reactive([ }, }, }, - { - label: '故障类型', - field: 'faultType', - sort: 'custom', - table: { - width: '150', - }, - dictType: DICT_TYPE.FAULT_TYPE, - dictClass: 'string', - form: { - component: 'Select' - }, - }, + // { + // label: '故障类型', + // field: 'faultType', + // sort: 'custom', + // table: { + // width: '150', + // }, + // dictType: DICT_TYPE.FAULT_TYPE, + // dictClass: 'string', + // form: { + // component: 'Select' + // }, + // }, { label: '描述', field: 'describes', diff --git a/src/views/eam/device/deviceinspectionjob/index.vue b/src/views/eam/device/deviceinspectionjob/index.vue index 0bd1662..40780d5 100644 --- a/src/views/eam/device/deviceinspectionjob/index.vue +++ b/src/views/eam/device/deviceinspectionjob/index.vue @@ -223,8 +223,29 @@ const openForm = async (type: string, row?: any) => { DeviceInspectionMain.allSchemas.formSchema.find(item => item.field == 'deviceNumber').componentProps.disabled = true DeviceInspectionMain.allSchemas.formSchema.find(item => item.field == 'deviceNumber').componentProps.options = deviceListAll } else { + const res = await DeviceInspectionMainApi.getDeviceInspectionMainNoPage() + const repairList = await DeviceMaintenanceMainApi.getDeviceMainTempList('DEVICE') + const newDeviceList = deviceList.filter(item => { + let flag = true + res.forEach(element => { + if (item.number == element.deviceNumber && element.status != 'COMPLETED' && element.status != 'VERIFIED' && element.status != 'REJECTED') { + flag = false + } + }) + return flag + }) + const newRepairList = repairList.filter(item => { + let flag = false + newDeviceList.forEach(element => { + if (item.deviceNumber == element.number) { + flag = true + } + }) + return flag + }) + DeviceInspectionMain.allSchemas.formSchema.find(item => item.field == 'maintenanceNumber').componentProps.options = newRepairList DeviceInspectionMain.allSchemas.formSchema.find(item => item.field == 'deviceNumber').componentProps.disabled = false - DeviceInspectionMain.allSchemas.formSchema.find(item => item.field == 'deviceNumber').componentProps.options = deviceList + DeviceInspectionMain.allSchemas.formSchema.find(item => item.field == 'deviceNumber').componentProps.options = newDeviceList } tableData.value = [] // 重置明细数据 basicFormRef.value.open(type, row) diff --git a/src/views/eam/device/devicemaintenancejob/deviceMaintenanceMain.data.ts b/src/views/eam/device/devicemaintenancejob/deviceMaintenanceMain.data.ts index 5cc9e32..003fab0 100644 --- a/src/views/eam/device/devicemaintenancejob/deviceMaintenanceMain.data.ts +++ b/src/views/eam/device/devicemaintenancejob/deviceMaintenanceMain.data.ts @@ -742,7 +742,7 @@ export const DeviceMaintenanceMainSec = useCrudSchemas(reactive([ }, }, { - label: '是否完成', + label: '状态', field: 'status', sort: 'custom', table: { @@ -766,6 +766,19 @@ export const DeviceMaintenanceMainSec = useCrudSchemas(reactive([ } }, }, + { + label: '完成方式', + field: 'result', + sort: 'custom', + table: { + width: '150', + }, + isSearch: false, + isTable: true, + isForm: false, + dictType: DICT_TYPE.ORDER_COMPLETE_RESULT, + dictClass: 'string', + }, { label: '操作', field: 'action', diff --git a/src/views/eam/device/devicemaintenancejob/index.vue b/src/views/eam/device/devicemaintenancejob/index.vue index ded6dd6..5952b9e 100644 --- a/src/views/eam/device/devicemaintenancejob/index.vue +++ b/src/views/eam/device/devicemaintenancejob/index.vue @@ -395,6 +395,12 @@ const onChange = (field, cur, item) => { const onChangeSec = (field, cur, item,formRefSec) => { if (field == 'type') { + DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => { + return item.field == 'maintenance' + }).componentProps.optionsAlias = { + labelField: 'name', + valueField: 'id' + } DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => { return item.field == 'deviceNumber' }).componentProps.disabled = false @@ -430,7 +436,7 @@ const onChangeSec = (field, cur, item,formRefSec) => { const setV = {} setV['deviceNumber'] = '' formRefSec.setValues(setV) - } else { + } else if(cur == 'DEVICE'){ DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => { return item.field == 'deviceNumber' }).componentProps.options = deviceList.value @@ -456,23 +462,55 @@ const onChangeSec = (field, cur, item,formRefSec) => { const setV = {} setV['factoryAreaNumber'] = newRow.value.factoryAreaNumber setV['maintenance'] = newRow.value.maintenance + setV['deviceNumber'] = newRow.value.deviceNumber + setV['type'] = newRow.value.type formRefSec.setValues(setV) DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => { return item.field == 'type' }).componentProps.disabled = false DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => { return item.field == 'deviceNumber' - }).componentProps.disabled = false + }).componentProps.disabled = true DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => { return item.field == 'factoryAreaNumber' }).componentProps.disabled = true DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => { return item.field == 'maintenance' - }).componentProps.disabled = true + }).componentProps.disabled = true + if (formRefSec.formModel.type == 'MOLD') { + MoldAccountsApi.getMoldAccountsAllNoPage({}) + .then(res => { + moldList.value = res + DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => { + return item.field == 'deviceNumber' + }).componentProps.options = moldList.value + }) + } else { + DeviceAccountsApi.getDeviceAccountsAllNoPage({}) + .then(res => { + deviceList.value = res + DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => { + return item.field == 'deviceNumber' + }).componentProps.options = deviceList.value + }) + } + UserApi.getSimpleUserList().then(res => { + DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => { + return item.field == 'maintenance' + }).componentProps.options = res + }) + DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => { + return item.field == 'maintenance' + }).componentProps.optionsAlias = { + labelField: 'nickname', + valueField: 'id' + } } else if (cur == '1') { const setV = {} setV['deviceNumber'] = newRow.value.deviceNumber setV['type'] = newRow.value.type + setV['factoryAreaNumber'] = newRow.value.factoryAreaNumber + setV['maintenance'] = newRow.value.maintenance formRefSec.setValues(setV) DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => { return item.field == 'type' @@ -485,20 +523,56 @@ const onChangeSec = (field, cur, item,formRefSec) => { }).componentProps.disabled = false DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => { return item.field == 'maintenance' - }).componentProps.disabled = false + }).componentProps.disabled = true + UserApi.getSimpleUserList().then(res => { + DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => { + return item.field == 'maintenance' + }).componentProps.options = res + }) + DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => { + return item.field == 'maintenance' + }).componentProps.optionsAlias = { + labelField: 'nickname', + valueField: 'id' + } } } if (field == 'factoryAreaNumber') { - selecUserByType({ classType: 'DEVICE', factoryAreaNumber: cur, flag: null }).then(res => { - repairUser.value = res - const setV = {} - setV['maintenance'] = '' - formRefSec.setValues(setV) - DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => { - return item.field == 'maintenance' - }).componentProps.options = res - }) + DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => { + return item.field == 'maintenance' + }).componentProps.optionsAlias = { + labelField: 'name', + valueField: 'id' + } + if (formRefSec.formModel.type == 'DEVICE') { + selecUserByType({ classType: 'DEVICE', factoryAreaNumber: cur, flag: null }).then(res => { + repairUser.value = res + const setV = {} + setV['maintenance'] = '' + formRefSec.setValues(setV) + DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => { + return item.field == 'maintenance' + }).componentProps.options = res + DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => { + return item.field == 'maintenance' + }).componentProps.disabled = false + }) + } else if (formRefSec.formModel.type == 'TECH') { + selecUserByType({ classType: 'TECH', factoryAreaNumber: cur, flag: null }).then(res => { + repairUser.value = res + const setV = {} + setV['maintenance'] = '' + formRefSec.setValues(setV) + DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => { + return item.field == 'maintenance' + }).componentProps.options = res + DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => { + return item.field == 'maintenance' + }).componentProps.disabled = false + }) + } + } } @@ -525,7 +599,7 @@ const buttonTableClick = async (val, row) => { } else if (val == 'repair') { openDetail(row, '代码', row.number) } else if (val == 'turnOrder') { - openFormSec('turnOrder', row) + turnOrder('turnOrder', row) } else if (val == 'finishOrder') { finishOrder(row) } else if (val == 'verifyOrder') { @@ -552,18 +626,18 @@ const openFormSec = async (type: string, row?: any) => { }).componentProps.disabled = false DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => { return item.field == 'deviceNumber' - }).componentProps.disabled = false + }).componentProps.disabled = true DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => { return item.field == 'factoryAreaNumber' }).componentProps.disabled = true DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => { return item.field == 'maintenance' - }).componentProps.disabled = true - await MoldAccountsApi.getMoldAccountsNoPage({}) + }).componentProps.disabled = true + await MoldAccountsApi.getMoldAccountsAllNoPage({}) .then(res => { moldList.value = res }) - await DeviceAccountsApi.getDeviceAccountsNoPage({}) + await DeviceAccountsApi.getDeviceAccountsAllNoPage({}) .then(res => { deviceList.value = res }) @@ -576,6 +650,16 @@ const openFormSec = async (type: string, row?: any) => { return item.field == 'deviceNumber' }).componentProps.options = deviceList.value } + const userListAll = await UserApi.getSimpleUserList() + DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => { + return item.field == 'maintenance' + }).componentProps.options = userListAll + DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => { + return item.field == 'maintenance' + }).componentProps.optionsAlias = { + labelField: 'nickname', + valueField: 'id' + } formRefSec.value.open(type, newRow.value) } @@ -652,7 +736,9 @@ function acceptOrder(row) { getList() } // 转办 -function turnOrder() { } +function turnOrder(type, row) { + openFormSec(type,row) +} // 完成 function finishOrder(row) { diff --git a/src/views/eam/mold/moldRepair/moldRepair.data.ts b/src/views/eam/mold/moldRepair/moldRepair.data.ts index 8e516cc..fde3092 100644 --- a/src/views/eam/mold/moldRepair/moldRepair.data.ts +++ b/src/views/eam/mold/moldRepair/moldRepair.data.ts @@ -127,19 +127,19 @@ export const MoldRepair = useCrudSchemas(reactive([ width: '150', }, }, - { - label: '故障类型', - field: 'faultType', - sort: 'custom', - table: { - width: '150', - }, - dictType: DICT_TYPE.FAULT_TYPE, - dictClass: 'string', - form: { - component: 'Select' - }, - }, + // { + // label: '故障类型', + // field: 'faultType', + // sort: 'custom', + // table: { + // width: '150', + // }, + // dictType: DICT_TYPE.FAULT_TYPE, + // dictClass: 'string', + // form: { + // component: 'Select' + // }, + // }, { label: '描述', field: 'describes', diff --git a/src/views/eam/mold/moldinspectionjob/index.vue b/src/views/eam/mold/moldinspectionjob/index.vue index 229d6c8..8a58c12 100644 --- a/src/views/eam/mold/moldinspectionjob/index.vue +++ b/src/views/eam/mold/moldinspectionjob/index.vue @@ -234,7 +234,7 @@ const openForm = async (type: string, row?: any) => { const newRepairList = repairList.filter(item => { let flag = false newMoldList.forEach(element => { - if (item.number == element.number) { + if (item.deviceNumber == element.number) { flag = true } }) diff --git a/src/views/eam/mold/moldmaintenancejob/index.vue b/src/views/eam/mold/moldmaintenancejob/index.vue index 3df7775..b723662 100644 --- a/src/views/eam/mold/moldmaintenancejob/index.vue +++ b/src/views/eam/mold/moldmaintenancejob/index.vue @@ -712,18 +712,18 @@ const openFormSec = async (type: string, row?: any) => { }).componentProps.disabled = false MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { return item.field == 'deviceNumber' - }).componentProps.disabled = false + }).componentProps.disabled = true MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { return item.field == 'factoryAreaNumber' }).componentProps.disabled = true MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { return item.field == 'maintenance' }).componentProps.disabled = true - await MoldAccountsApi.getMoldAccountsNoPage({}) + await MoldAccountsApi.getMoldAccountsAllNoPage({}) .then(res => { moldList.value = res }) - await DeviceAccountsApi.getDeviceAccountsNoPage({}) + await DeviceAccountsApi.getDeviceAccountsAllNoPage({}) .then(res => { deviceList.value = res }) @@ -736,6 +736,16 @@ const openFormSec = async (type: string, row?: any) => { return item.field == 'deviceNumber' }).componentProps.options = deviceList.value } + const userListAll = await UserApi.getSimpleUserList() + MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { + return item.field == 'maintenance' + }).componentProps.options = userListAll + MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { + return item.field == 'maintenance' + }).componentProps.optionsAlias = { + labelField: 'nickname', + valueField: 'id' + } formRefSec.value.open(type, newRow.value) } @@ -743,6 +753,12 @@ const openFormSec = async (type: string, row?: any) => { const onChangeSec = (field, cur, item,formRefSec) => { if (field == 'type') { + MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { + return item.field == 'maintenance' + }).componentProps.optionsAlias = { + labelField: 'name', + valueField: 'id' + } MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { return item.field == 'deviceNumber' }).componentProps.disabled = false @@ -762,7 +778,23 @@ const onChangeSec = (field, cur, item,formRefSec) => { const setV = {} setV['deviceNumber'] = '' formRefSec.setValues(setV) - } else { + } else if (cur == 'TECH') { + MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { + return item.field == 'deviceNumber' + }).componentProps.options = deviceList.value + selecUserByType({ classType: 'TECH', factoryAreaNumber: '', flag: null }).then(res => { + repairUser.value = res + const setV = {} + setV['maintenance'] = '' + formRefSec.setValues(setV) + MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { + return item.field == 'maintenance' + }).componentProps.options = res + }) + const setV = {} + setV['deviceNumber'] = '' + formRefSec.setValues(setV) + } else if(cur == 'DEVICE'){ MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { return item.field == 'deviceNumber' }).componentProps.options = deviceList.value @@ -788,21 +820,54 @@ const onChangeSec = (field, cur, item,formRefSec) => { const setV = {} setV['factoryAreaNumber'] = newRow.value.factoryAreaNumber setV['maintenance'] = newRow.value.maintenance + setV['deviceNumber'] = newRow.value.deviceNumber + setV['type'] = newRow.value.type formRefSec.setValues(setV) MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { return item.field == 'type' }).componentProps.disabled = false MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { return item.field == 'deviceNumber' - }).componentProps.disabled = false + }).componentProps.disabled = true MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { return item.field == 'factoryAreaNumber' }).componentProps.disabled = true MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { return item.field == 'maintenance' }).componentProps.disabled = true + if (formRefSec.formModel.type == 'MOLD') { + MoldAccountsApi.getMoldAccountsAllNoPage({}) + .then(res => { + moldList.value = res + DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => { + return item.field == 'deviceNumber' + }).componentProps.options = moldList.value + }) + + } else { + DeviceAccountsApi.getDeviceAccountsAllNoPage({}) + .then(res => { + deviceList.value = res + DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => { + return item.field == 'deviceNumber' + }).componentProps.options = deviceList.value + }) + } + UserApi.getSimpleUserList().then(res => { + MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { + return item.field == 'maintenance' + }).componentProps.options = res + }) + MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { + return item.field == 'maintenance' + }).componentProps.optionsAlias = { + labelField: 'nickname', + valueField: 'id' + } } else if (cur == '1') { const setV = {} + setV['factoryAreaNumber'] = newRow.value.factoryAreaNumber + setV['maintenance'] = newRow.value.maintenance setV['deviceNumber'] = newRow.value.deviceNumber setV['type'] = newRow.value.type formRefSec.setValues(setV) @@ -817,16 +882,36 @@ const onChangeSec = (field, cur, item,formRefSec) => { }).componentProps.disabled = false MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { return item.field == 'maintenance' - }).componentProps.disabled = false + }).componentProps.disabled = true + UserApi.getSimpleUserList().then(res => { + MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { + return item.field == 'maintenance' + }).componentProps.options = res + }) + MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { + return item.field == 'maintenance' + }).componentProps.optionsAlias = { + labelField: 'nickname', + valueField: 'id' + } } } if (field == 'factoryAreaNumber') { + MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { + return item.field == 'maintenance' + }).componentProps.optionsAlias = { + labelField: 'name', + valueField: 'id' + } selecUserByType({ classType: 'MOLD', factoryAreaNumber: cur, flag: null }).then(res => { repairUser.value = res const setV = {} setV['maintenance'] = '' formRefSec.setValues(setV) + MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { + return item.field == 'maintenance' + }).componentProps.disabled = false MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { return item.field == 'maintenance' }).componentProps.options = res diff --git a/src/views/eam/mold/moldmaintenancejob/moldMaintenanceMain.data.ts b/src/views/eam/mold/moldmaintenancejob/moldMaintenanceMain.data.ts index 71f5fb9..6c64ffa 100644 --- a/src/views/eam/mold/moldmaintenancejob/moldMaintenanceMain.data.ts +++ b/src/views/eam/mold/moldmaintenancejob/moldMaintenanceMain.data.ts @@ -248,7 +248,7 @@ export const MoldMaintenanceMain = useCrudSchemas(reactive([ }, }, { - label: '是否完成', + label: '状态', field: 'status', sort: 'custom', table: { @@ -272,6 +272,19 @@ export const MoldMaintenanceMain = useCrudSchemas(reactive([ } }, }, + { + label: '完成方式', + field: 'result', + sort: 'custom', + table: { + width: '150', + }, + isSearch: false, + isTable: true, + isForm: false, + dictType: DICT_TYPE.ORDER_COMPLETE_RESULT, + dictClass: 'string', + }, { label: '操作', field: 'action', @@ -688,7 +701,7 @@ export const MoldMaintenanceMainSec = useCrudSchemas(reactive([ }, }, { - label: '是否完成', + label: '状态', field: 'status', sort: 'custom', table: {