From f83f1ed35a7504319948bdf97d6921a39e6c0240 Mon Sep 17 00:00:00 2001 From: ljlong_2630 Date: Fri, 15 Mar 2024 13:02:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=B5=8B=E8=AF=95bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../deviceSpotInspectionRecordMain/index.vue | 2 +- .../eam/device/deviceinspectionjob/index.vue | 10 ++-- .../deviceMaintainOrderMain.data.ts | 11 ++++ .../eam/device/devicemaintainjob/index.vue | 43 +++++++++++--- .../deviceMaintenanceMain.data.ts | 40 ++++++++----- .../eam/device/devicemaintenancejob/index.vue | 2 +- .../eam/mold/moldinspectionjob/index.vue | 14 +++-- .../moldInspectionMain.data.ts | 20 +++++++ src/views/eam/mold/moldmaintainjob/index.vue | 57 ++++++++++++++----- .../moldMaintainOrderMain.data.ts | 21 +++++-- .../eam/mold/moldmaintenancejob/index.vue | 2 +- 11 files changed, 169 insertions(+), 53 deletions(-) diff --git a/src/views/eam/device/deviceSpotInspectionRecordMain/index.vue b/src/views/eam/device/deviceSpotInspectionRecordMain/index.vue index 5437305..9ce90ef 100644 --- a/src/views/eam/device/deviceSpotInspectionRecordMain/index.vue +++ b/src/views/eam/device/deviceSpotInspectionRecordMain/index.vue @@ -453,7 +453,7 @@ const detailSubmitForm= async (formType,data,getList,formRef,tableList) => { describes:data.describes, describes1:data.describes1, itemNumbers:data.itemNumbers, - maintenances:data.maintenances.join(','), + maintenances:data.maintenances?.join(','), workOut:data.workOut, } console.log(data1) diff --git a/src/views/eam/device/deviceinspectionjob/index.vue b/src/views/eam/device/deviceinspectionjob/index.vue index 782ac68..84e5f06 100644 --- a/src/views/eam/device/deviceinspectionjob/index.vue +++ b/src/views/eam/device/deviceinspectionjob/index.vue @@ -504,11 +504,11 @@ function detailOnChange(field, cur, item) { if (field == 'status') { if (cur == '1') { DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = false - DeviceInspectionDetailRules.uncompleted = [required] + DeviceInspectionDetailRules.uncompleted = [{ required: true }] } else { DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.value = '' - delete DeviceInspectionDetailRules.uncompleted; + DeviceInspectionDetailRules.uncompleted = [{ required: false }] } } } @@ -517,16 +517,16 @@ const openFormCallBack = (type, row, masterParmas, callback) => { if (row == undefined || row == null) { DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.value = '' - delete DeviceInspectionDetailRules.uncompleted; + DeviceInspectionDetailRules.uncompleted = [{ required: false }] DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'status').value = '0' } else { if (row.status == '1') { DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = false - DeviceInspectionDetailRules.uncompleted = [required] + DeviceInspectionDetailRules.uncompleted = [{ required: true }] } else { DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.value = '' - delete DeviceInspectionDetailRules.uncompleted; + DeviceInspectionDetailRules.uncompleted = [{ required: false }] } } diff --git a/src/views/eam/device/devicemaintainjob/deviceMaintainOrderMain.data.ts b/src/views/eam/device/devicemaintainjob/deviceMaintainOrderMain.data.ts index deb6e78..b40f23f 100644 --- a/src/views/eam/device/devicemaintainjob/deviceMaintainOrderMain.data.ts +++ b/src/views/eam/device/devicemaintainjob/deviceMaintainOrderMain.data.ts @@ -60,6 +60,7 @@ export const DeviceMaintainOrderMain = useCrudSchemas(reactive([ label: '厂区编号', field: 'factoryAreaNumber', sort: 'custom', + isDetail: false, table: { width: '150', }, @@ -93,6 +94,15 @@ export const DeviceMaintainOrderMain = useCrudSchemas(reactive([ detail: { } }, + { + label: '厂区', + field: 'factoryAreaNumber1', + sort: 'custom', + isSearch: false, + isTable: false, + isForm: false, + isDetail: true + }, { label: '状态', field: 'status', @@ -220,6 +230,7 @@ export const DeviceMaintainOrderDetailRules = reactive({ chargePeoples: [required], completionTime: [required], engineer: [required], + uncompleted: [required], }) export const DeviceMaintainOrderDetail = useCrudSchemas(reactive([ diff --git a/src/views/eam/device/devicemaintainjob/index.vue b/src/views/eam/device/devicemaintainjob/index.vue index 05a050b..8dd8398 100644 --- a/src/views/eam/device/devicemaintainjob/index.vue +++ b/src/views/eam/device/devicemaintainjob/index.vue @@ -452,16 +452,22 @@ const detailValidate = (data) => { } } // 子表提交 -const detailSubmitForm= async (formType,data,getList,formRef,tableList) => { +const detailSubmitForm= async (formType,data,getList1,formRef,tableList) => { try { let data1 = { id:data.id, - maintenanceNumber:data.maintenanceNumber, + number:data.number, describes:data.describes, - describes1:data.describes1, - itemNumbers:data.itemNumbers, - maintenances:data.maintenances.join(','), + describes1: data.describes1, + peoples: data.peoples, + status: data.status, + itemNumbers: data.itemNumbers, + estimatedMinutes: data.estimatedMinutes, + actualMinutes: data.actualMinutes, + chargePeoples:data.chargePeoples?.join(','), workOut:data.workOut, + engineer: data.engineer, + completionTime: data.completionTime, } console.log(data1) if (formType === 'create') { @@ -473,7 +479,7 @@ const detailSubmitForm= async (formType,data,getList,formRef,tableList) => { } formRef.dialogVisible = false // 刷新当前列表 - await getList() + await formRef.getList1 detailRef.value.tableObject.tableList.forEach(item=>{ if (item.itemNumbers?.length>0) { let str = '' @@ -485,7 +491,7 @@ const detailSubmitForm= async (formType,data,getList,formRef,tableList) => { }) } finally { - formRef.formLoading = false + detailRef.formLoading = false } } @@ -513,13 +519,32 @@ function detailOnChange(field, cur, item) { if (field == 'status') { if (cur == '1') { DeviceMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = false - DeviceMaintainOrderDetailRules.uncompleted = [required] + DeviceMaintainOrderDetailRules.uncompleted = [{ required: true }] + } else { + DeviceMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true + DeviceMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.value = '' + DeviceMaintainOrderDetailRules.uncompleted= [{ required: false }] + } + } +} + +const openFormCallBack = (type, row, masterParmas, callback) => { + if (row == undefined || row == null) { + DeviceMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true + DeviceMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.value = '' + DeviceMaintainOrderDetailRules.uncompleted = [{ required: false }] + DeviceMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'status').value = '0' + } else { + if (row.status == '1') { + DeviceMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = false + DeviceMaintainOrderDetailRules.uncompleted = [{ required: true }] } else { DeviceMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true DeviceMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.value = '' - delete DeviceMaintainOrderDetailRules.uncompleted; + DeviceMaintainOrderDetailRules.uncompleted = [{ required: false }] } } + callback() } diff --git a/src/views/eam/device/devicemaintenancejob/deviceMaintenanceMain.data.ts b/src/views/eam/device/devicemaintenancejob/deviceMaintenanceMain.data.ts index f9125c5..57760d6 100644 --- a/src/views/eam/device/devicemaintenancejob/deviceMaintenanceMain.data.ts +++ b/src/views/eam/device/devicemaintenancejob/deviceMaintenanceMain.data.ts @@ -88,6 +88,7 @@ export const DeviceMaintenanceMain = useCrudSchemas(reactive([ label: '厂区编号', field: 'factoryAreaNumber', sort: 'custom', + isDetail: false, table: { width: '150', }, @@ -119,10 +120,23 @@ export const DeviceMaintenanceMain = useCrudSchemas(reactive([ }, } }, + { + label: '厂区编号', + field: 'factoryAreaNumber1', + sort: 'custom', + isDetail: true, + isSearch: false, + isForm: false, + isTable: false, + table: { + width: 150 + } + }, { label: '维修人', field: 'maintenance', sort: 'custom', + isDetail: false, table: { width: '150', }, @@ -143,6 +157,18 @@ export const DeviceMaintenanceMain = useCrudSchemas(reactive([ }, } }, + { + label: '维修人', + field: 'maintenance1', + sort: 'custom', + isDetail: true, + isSearch: false, + isForm: false, + isTable: false, + table: { + width: 150 + } + }, { label: '类型', field: 'type', @@ -315,7 +341,7 @@ export const DeviceMaintenanceDetail = useCrudSchemas(reactive([ }, { label: '维修人', - field: 'maintenances', + field: 'maintenance', sort: 'custom', isDetail: false, api: () => userListAll, @@ -347,18 +373,6 @@ export const DeviceMaintenanceDetail = useCrudSchemas(reactive([ } } }, - { - label: '维修人', - field: 'maintenances1', - sort: 'custom', - isDetail: true, - isSearch: false, - isForm: false, - isTable: false, - table: { - width: 150 - } - }, { label: '备件', field: 'itemNumbers1', diff --git a/src/views/eam/device/devicemaintenancejob/index.vue b/src/views/eam/device/devicemaintenancejob/index.vue index 10fa28e..2f2fc1a 100644 --- a/src/views/eam/device/devicemaintenancejob/index.vue +++ b/src/views/eam/device/devicemaintenancejob/index.vue @@ -517,7 +517,7 @@ const detailSubmitForm= async (formType,data,getList,formRef,tableList) => { describes:data.describes, describes1:data.describes1, itemNumbers:data.itemNumbers, - maintenances:data.maintenances.join(','), + maintenances:data.maintenances?.join(','), workOut:data.workOut, } console.log(data1) diff --git a/src/views/eam/mold/moldinspectionjob/index.vue b/src/views/eam/mold/moldinspectionjob/index.vue index f62b344..3c29d50 100644 --- a/src/views/eam/mold/moldinspectionjob/index.vue +++ b/src/views/eam/mold/moldinspectionjob/index.vue @@ -86,6 +86,8 @@ import * as MoldInspectionMainApi from '@/api/eam/mold/moldInspectionMain' import * as MoldInspectionDetailApi from '@/api/eam/mold/moldInspectionDetail' import * as defaultButtons from '@/utils/disposition/defaultButtons' import { useUserStore } from '@/store/modules/user' +import { selectAllFactoryArea } from '@/api/system/dept' +import * as UserApi from '@/api/system/user' // import TableHead from '@/components/TableHead/src/TableHead.vue' // import ImportForm from '@/components/ImportForm/src/ImportForm.vue' @@ -232,7 +234,11 @@ const formsSuccess = async (formType, data) => { /** 详情操作 */ const detailRef = ref() -const openDetail = (row: any, titleName: any, titleValue: any) => { +const openDetail = async (row: any, titleName: any, titleValue: any) => { + const factoryList = await selectAllFactoryArea() + const userListAll = await UserApi.getSimpleUserList() + row.factoryAreaNumber1 = factoryList.find((account) => account.id == row.factoryAreaNumber)?.name + row.maintenance1 = userListAll.find((account) => account.id == row.maintenance)?.nickname detailRef.value.openDetail(row, titleName, titleValue, 'basicMoldInspectionMain') } @@ -461,7 +467,7 @@ function detailOnChange(field, cur, item) { if (field == 'status') { if (cur == '1') { MoldInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = false - MoldInspectionDetailRules.uncompleted = [required] + MoldInspectionDetailRules.uncompleted = [{ required: true }] } else { MoldInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true MoldInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.value = '' @@ -474,12 +480,12 @@ const openFormCallBack = (type, row, masterParmas, callback) => { if (row == undefined || row == null) { MoldInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true MoldInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.value = '' - delete MoldInspectionDetailRules.uncompleted; + MoldInspectionDetailRules.uncompleted = [{ required: false }] MoldInspectionDetail.allSchemas.formSchema.find(item => item.field == 'status').value = '0' } else { if (row.status == '1') { MoldInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = false - MoldInspectionDetailRules.uncompleted = [required] + MoldInspectionDetailRules.uncompleted = [{ required: true }] } else { MoldInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true MoldInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.value = '' diff --git a/src/views/eam/mold/moldinspectionjob/moldInspectionMain.data.ts b/src/views/eam/mold/moldinspectionjob/moldInspectionMain.data.ts index 8335150..05521c5 100644 --- a/src/views/eam/mold/moldinspectionjob/moldInspectionMain.data.ts +++ b/src/views/eam/mold/moldinspectionjob/moldInspectionMain.data.ts @@ -119,6 +119,7 @@ export const MoldInspectionMain = useCrudSchemas(reactive([ label: '厂区', field: 'factoryAreaNumber', sort: 'custom', + isDetail: false, isSearch: false, table: { width: '150', @@ -151,10 +152,20 @@ export const MoldInspectionMain = useCrudSchemas(reactive([ }, } }, + { + label: '厂区', + field: 'factoryAreaNumber1', + sort: 'custom', + isSearch: false, + isTable: false, + isForm: false, + isDetail: true + }, { label: '维修人', field: 'maintenance', sort: 'custom', + isDetail: false, isSearch: false, table: { width: '150', @@ -187,6 +198,15 @@ export const MoldInspectionMain = useCrudSchemas(reactive([ }, } }, + { + label: '维修人', + field: 'maintenance1', + sort: 'custom', + isSearch: false, + isTable: false, + isForm: false, + isDetail: true + }, // { // label: '维修人联系电话', // field: 'maintenancePhone', diff --git a/src/views/eam/mold/moldmaintainjob/index.vue b/src/views/eam/mold/moldmaintainjob/index.vue index 33ed0ec..b8b4065 100644 --- a/src/views/eam/mold/moldmaintainjob/index.vue +++ b/src/views/eam/mold/moldmaintainjob/index.vue @@ -108,6 +108,8 @@ import * as MoldMaintainOrderMainApi from '@/api/eam/mold/moldMaintainOrderMain' import * as MoldMaintainOrderDetailApi from '@/api/eam/mold/moldMaintainOrderDetail' import * as defaultButtons from '@/utils/disposition/defaultButtons' import { useUserStore } from '@/store/modules/user' +import { selectAllFactoryArea } from '@/api/system/dept' +import * as UserApi from '@/api/system/user' defineOptions({ name: 'MoldMaintainOrderMain' }) const message = useMessage() // 消息弹窗 @@ -288,7 +290,9 @@ const openForm = (type: string, row?: any) => { /** 详情操作 */ const detailRef = ref() -const openDetail = (row: any, titleName: any, titleValue: any) => { +const openDetail = async (row: any, titleName: any, titleValue: any) => { + const factoryList = await selectAllFactoryArea() + row.factoryAreaNumber1 = factoryList.find((account) => account.id == row.factoryAreaNumber)?.name detailRef.value.openDetail(row, titleName, titleValue,'MoldMaintainOrderMain') } @@ -392,7 +396,7 @@ const submitForm = async (formType, data) => { describes: item.describes, describes1: item.describes1, itemNumbers: item.itemNumbers1, - maintenances: item.maintenances.join(','), + maintenances: item.maintenances?.join(','), workOut: item.workOut, } }) // 拼接子表数据参数 @@ -451,16 +455,22 @@ const detailValidate = (data) => { } } // 子表提交 -const detailSubmitForm= async (formType,data,getList,formRef,tableList) => { +const detailSubmitForm= async (formType,data,getList1,formRef,tableList) => { try { let data1 = { id:data.id, number:data.number, describes:data.describes, - describes1:data.describes1, - itemNumbers:data.itemNumbers, - maintenances:data.maintenances.join(','), - workOut:data.workOut, + describes1: data.describes1, + peoples: data.peoples, + status: data.status, + itemNumbers: data.itemNumbers, + estimatedMinutes: data.estimatedMinutes, + actualMinutes: data.actualMinutes, + chargePeoples:data.chargePeoples?.join(','), + workOut: data.workOut, + engineer: data.engineer, + completionTime: data.completionTime, } console.log(data1) if (formType === 'create') { @@ -472,7 +482,7 @@ const detailSubmitForm= async (formType,data,getList,formRef,tableList) => { } formRef.dialogVisible = false // 刷新当前列表 - await getList() + await formRef.getList1 detailRef.value.tableObject.tableList.forEach(item=>{ if (item.itemNumbers?.length>0) { let str = '' @@ -484,7 +494,7 @@ const detailSubmitForm= async (formType,data,getList,formRef,tableList) => { }) } finally { - formRef.formLoading = false + detailRef.formLoading = false } } @@ -506,16 +516,35 @@ function buttonControllFunction(row, val) { function detailOnChange(field, cur, item) { if (field == 'status') { if (cur == '1') { - DeviceMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = false - DeviceMaintainOrderDetailRules.uncompleted = [required] + MoldMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = false + MoldMaintainOrderDetailRules.uncompleted = [{ required: true }] } else { - DeviceMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true - DeviceMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.value = '' - delete DeviceMaintainOrderDetailRules.uncompleted; + MoldMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true + MoldMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.value = '' + MoldMaintainOrderDetailRules.uncompleted = [{ required: false }] } } } +const openFormCallBack = (type, row, masterParmas, callback) => { + if (row == undefined || row == null) { + MoldMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true + MoldMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.value = '' + MoldMaintainOrderDetailRules.uncompleted = [{ required: false }] + MoldMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'status').value = '0' + } else { + if (row.status == '1') { + MoldMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = false + MoldMaintainOrderDetailRules.uncompleted = [{ required: true }] + } else { + MoldMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true + MoldMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.value = '' + MoldMaintainOrderDetailRules.uncompleted = [{ required: false }] + } + } + + callback() +} /** 初始化 **/ onMounted(async () => { getList() diff --git a/src/views/eam/mold/moldmaintainjob/moldMaintainOrderMain.data.ts b/src/views/eam/mold/moldmaintainjob/moldMaintainOrderMain.data.ts index 1b7cc4d..657b50f 100644 --- a/src/views/eam/mold/moldmaintainjob/moldMaintainOrderMain.data.ts +++ b/src/views/eam/mold/moldmaintainjob/moldMaintainOrderMain.data.ts @@ -52,6 +52,7 @@ export const MoldMaintainOrderMain = useCrudSchemas(reactive([ label: '厂区编号', field: 'factoryAreaNumber', sort: 'custom', + isDetail: false, table: { width: '150', }, @@ -85,6 +86,15 @@ export const MoldMaintainOrderMain = useCrudSchemas(reactive([ detail: { } }, + { + label: '厂区', + field: 'factoryAreaNumber1', + sort: 'custom', + isSearch: false, + isTable: false, + isForm: false, + isDetail: true + }, { label: '状态', field: 'status', @@ -267,7 +277,8 @@ export const MoldMaintainOrderDetailRules = reactive({ actualMinutes: [required], chargePeoples: [required], completionTime: [required], - engineer: [required] + engineer: [required], + uncompleted: [required] }) export const MoldMaintainOrderDetail = useCrudSchemas(reactive([ @@ -429,8 +440,8 @@ export const MoldMaintainOrderDetail = useCrudSchemas(reactive([ // tableData.value.itemNumbers1 = value.map(item => item.itemNumber) }, searchCondition: [{ - key: 'moldNumber', - value: 'moldNumber', + key: 'deviceNumber', + value: 'deviceNumber', message: '请选择设备模具编号!', isMainValue: true }] @@ -446,8 +457,8 @@ export const MoldMaintainOrderDetail = useCrudSchemas(reactive([ searchAllSchemas: ItemSearchTable.allSchemas, // 查询弹窗所需类 searchPage: ItemApi.getItemList, // 查询弹窗所需分页方法 searchCondition: [{ - key: 'moldNumber', - value: 'moldNumber', + key: 'deviceNumber', + value: 'deviceNumber', message: '请选择设备模具编号!', isMainValue: true }] diff --git a/src/views/eam/mold/moldmaintenancejob/index.vue b/src/views/eam/mold/moldmaintenancejob/index.vue index d787f18..8cc9296 100644 --- a/src/views/eam/mold/moldmaintenancejob/index.vue +++ b/src/views/eam/mold/moldmaintenancejob/index.vue @@ -526,7 +526,7 @@ const detailSubmitForm= async (formType,data,getList,formRef,tableList) => { describes:data.describes, describes1:data.describes1, itemNumbers:data.itemNumbers, - maintenances:data.maintenances.join(','), + maintenances:data.maintenances?.join(','), workOut:data.workOut, } console.log(data1)