From 1326e6cbc83325f91abf8786f5800efab880647d Mon Sep 17 00:00:00 2001 From: ljlong_2630 Date: Fri, 22 Mar 2024 10:49:44 +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 --- .../Detail/src/DetailDeviceLedger.vue | 6 +- .../deviceSpotInspectionRecordMain/index.vue | 2 - .../deviceInspectionMain.data.ts | 3 +- .../eam/device/devicemaintainjob/index.vue | 4 +- .../eam/device/devicemaintenancejob/index.vue | 21 +++++-- .../mold/moldAccounts/moldAccounts.data.ts | 21 ------- .../moldInspectionMain.data.ts | 3 +- .../eam/mold/moldmaintenancejob/index.vue | 57 +++++++++++-------- 8 files changed, 55 insertions(+), 62 deletions(-) diff --git a/src/components/Detail/src/DetailDeviceLedger.vue b/src/components/Detail/src/DetailDeviceLedger.vue index b81e182..4b27883 100644 --- a/src/components/Detail/src/DetailDeviceLedger.vue +++ b/src/components/Detail/src/DetailDeviceLedger.vue @@ -235,9 +235,6 @@ const dialogAllSchemasRef = ref() const dialogTableObjectRef = ref() const dialogTableMethodsRef = ref() const dialogUploadTitle = ref() -const fileDialogUploadData = ref({ - filePathList: [] -}) const dialogUploadVisible = ref(false) const dialogUploadNumber = ref() const dialogUploadBusiCode = ref() @@ -445,6 +442,9 @@ const imageFormData = ref({ const fileFormData = ref({ filePathList: [] }) +const fileDialogUploadData = ref({ + filePathList: [] +}) const subIndex = ref('A') const isShowDrawer = ref(false) const detailLoading = ref(false) diff --git a/src/views/eam/device/deviceSpotInspectionRecordMain/index.vue b/src/views/eam/device/deviceSpotInspectionRecordMain/index.vue index c6a3c43..fdfff01 100644 --- a/src/views/eam/device/deviceSpotInspectionRecordMain/index.vue +++ b/src/views/eam/device/deviceSpotInspectionRecordMain/index.vue @@ -249,8 +249,6 @@ const butttondata = (row) => { } const onChange = (field, cur, item) => { if (field == 'deviceNumber') { - // DeviceSpotInspectionRecordMain.allSchemas.formSchema[1].componentProps.disabled = true - // DeviceSpotInspectionRecordMain.allSchemas.formSchema[2].componentProps.disabled = true formRef.value.formRef.formModel.factoryAreaNumber =String(item.componentProps.options.find((item) => item.number == cur).factoryAreaNumber) console.log(typeof formRef.value.formRef.formModel.factoryAreaNumber) // console.log(item) diff --git a/src/views/eam/device/deviceinspectionjob/deviceInspectionMain.data.ts b/src/views/eam/device/deviceinspectionjob/deviceInspectionMain.data.ts index 9337efb..2c1a1fc 100644 --- a/src/views/eam/device/deviceinspectionjob/deviceInspectionMain.data.ts +++ b/src/views/eam/device/deviceinspectionjob/deviceInspectionMain.data.ts @@ -100,7 +100,6 @@ export const DeviceInspectionMain = useCrudSchemas(reactive([ return factoryList.find((account) => account.id == cellValue)?.name }, search: { - show: true, component: 'Select', api: () => factoryList, componentProps: { @@ -138,7 +137,7 @@ export const DeviceInspectionMain = useCrudSchemas(reactive([ search: { show: true, component: 'Select', - api: () => deviceList, + api: () => deviceListAll, componentProps: { optionsAlias: { labelField: 'name', diff --git a/src/views/eam/device/devicemaintainjob/index.vue b/src/views/eam/device/devicemaintainjob/index.vue index c5b5e0c..8725df7 100644 --- a/src/views/eam/device/devicemaintainjob/index.vue +++ b/src/views/eam/device/devicemaintainjob/index.vue @@ -267,9 +267,7 @@ const buttonTableClick = async (val, row) => { openForm('turnOrder', row) } else if (val == 'finishOrder') { finishOrder(row) - } else if (val == 'finishOrder') { - finishOrder(row) - } + } } /** 添加/修改操作 */ diff --git a/src/views/eam/device/devicemaintenancejob/index.vue b/src/views/eam/device/devicemaintenancejob/index.vue index ed201ac..a327a9a 100644 --- a/src/views/eam/device/devicemaintenancejob/index.vue +++ b/src/views/eam/device/devicemaintenancejob/index.vue @@ -81,7 +81,7 @@ @handleDeleteTable="handleDeleteTable" @searchTableSuccess="searchTableSuccess" @submitForm="submitFormSec" - @success="submitForm" + @success="submitFormSec" :isSearchTableItem="true" /> @@ -146,6 +146,7 @@ import * as MoldAccountsApi from '@/api/eam/mold/moldAccounts' import { useUserStore } from '@/store/modules/user' import { selecUserByType } from '@/api/system/dept' import { DICT_TYPE, getStrDictOptions } from '@/utils/dict' +import * as UserApi from '@/api/system/user' import { emit } from 'process' const deviceMoldTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE) const deviceTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE).filter(item => item.value != 'MOLD') @@ -401,13 +402,16 @@ const onChangeSec = (field, cur, item,formRefSec) => { setV['maintenance'] = '' formRefSec.setValues(setV) MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { - return item.field == 'maintenance' - }).componentProps.options = res + return item.field == 'maintenance' + }).componentProps.options = res }) const setV = {} setV['deviceNumber'] = '' formRefSec.setValues(setV) } + DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => { + return item.field == 'maintenance' + }).componentProps.disabled = false } if (field == 'turnType') { if (cur == '0') { @@ -424,6 +428,9 @@ const onChangeSec = (field, cur, item,formRefSec) => { DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => { return item.field == 'factoryAreaNumber' }).componentProps.disabled = true + DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => { + return item.field == 'maintenance' + }).componentProps.disabled = true } else if (cur == '1') { const setV = {} setV['deviceNumber'] = newRow.value.deviceNumber @@ -438,6 +445,9 @@ const onChangeSec = (field, cur, item,formRefSec) => { DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => { return item.field == 'factoryAreaNumber' }).componentProps.disabled = false + DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => { + return item.field == 'maintenance' + }).componentProps.disabled = false } } @@ -508,6 +518,9 @@ const openFormSec = async (type: string, row?: any) => { 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({}) .then(res => { moldList.value = res @@ -672,12 +685,10 @@ const submitForm = async (formType, data) => { message.success(t('common.updateSuccess')) } formRef.value.dialogVisible = false - formRefSec.value.dialogVisible = false // 刷新当前列表 getList() } finally { formRef.value.formLoading = false - formRefSec.value.formLoading = false } } diff --git a/src/views/eam/mold/moldAccounts/moldAccounts.data.ts b/src/views/eam/mold/moldAccounts/moldAccounts.data.ts index 3d1bbb1..2e847d9 100644 --- a/src/views/eam/mold/moldAccounts/moldAccounts.data.ts +++ b/src/views/eam/mold/moldAccounts/moldAccounts.data.ts @@ -255,27 +255,6 @@ export const MoldMilestoneRules = reactive({ export const MoldMilestone = useCrudSchemas(reactive([ - { - label: 'id', - field: 'id', - sort: 'custom', - isSearch: true, - isForm: false - }, - { - label: '编号唯一标识', - field: 'number', - sort: 'custom', - isSearch: true, - isForm: false - }, - { - label: '模具编号', - field: 'moldNumber', - sort: 'custom', - isSearch: true, - isForm: false - }, { label: '里程碑阶段', field: 'milestoneStage', diff --git a/src/views/eam/mold/moldinspectionjob/moldInspectionMain.data.ts b/src/views/eam/mold/moldinspectionjob/moldInspectionMain.data.ts index ff143d2..59f54db 100644 --- a/src/views/eam/mold/moldinspectionjob/moldInspectionMain.data.ts +++ b/src/views/eam/mold/moldinspectionjob/moldInspectionMain.data.ts @@ -99,7 +99,7 @@ export const MoldInspectionMain = useCrudSchemas(reactive([ search: { show: true, component: 'Select', - api: () => moldList, + api: () => moldListAll, componentProps: { optionsAlias: { labelField: 'name', @@ -132,7 +132,6 @@ export const MoldInspectionMain = useCrudSchemas(reactive([ return factoryList.find((account) => account.id == cellValue)?.name }, search: { - show: true, component: 'Select', api: () => factoryList, componentProps: { diff --git a/src/views/eam/mold/moldmaintenancejob/index.vue b/src/views/eam/mold/moldmaintenancejob/index.vue index 0b74f01..90f7a0e 100644 --- a/src/views/eam/mold/moldmaintenancejob/index.vue +++ b/src/views/eam/mold/moldmaintenancejob/index.vue @@ -81,7 +81,7 @@ @handleDeleteTable="handleDeleteTable" @searchTableSuccess="searchTableSuccess" @submitForm="submitFormSec" - @success="submitForm" + @success="submitFormSec" :isSearchTableItem="true" /> @@ -148,7 +148,7 @@ import * as DeviceAccountsApi from '@/api/eam/device/deviceAccounts' import * as MoldAccountsApi from '@/api/eam/mold/moldAccounts' const deviceMoldTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE) const moldTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE).filter(item => item.value == 'MOLD') - +const userListAll = await UserApi.getSimpleUserList() defineOptions({ name: 'MoldMaintenanceMain' }) const message = useMessage() // 消息弹窗 const { t } = useI18n() // 国际化 @@ -408,9 +408,14 @@ const buttonTableClick = async (val, row) => { /** 添加/修改操作 */ -const openForm = (type: string, row?: any) => { - tableData.value = [] // 重置明细数据 - formRef.value.open(type, row) +const openForm = async (type: string, row?: any) => { + await MoldAccountsApi.getMoldAccountsNoPage({}).then(res => { + MoldMaintenanceMain.allSchemas.formSchema.find(item => { + return item.field === 'deviceNumber' + }).componentProps.options = res + tableData.value = [] // 重置明细数据 + formRef.value.open(type, row) + }) } /** 详情操作 */ @@ -679,6 +684,9 @@ const openFormSec = async (type: string, row?: any) => { }).componentProps.disabled = false 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({}) .then(res => { @@ -740,6 +748,9 @@ const onChangeSec = (field, cur, item,formRefSec) => { setV['deviceNumber'] = '' formRefSec.setValues(setV) } + MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { + return item.field == 'maintenance' + }).componentProps.disabled = false } if (field == 'turnType') { if (cur == '0') { @@ -755,7 +766,10 @@ const onChangeSec = (field, cur, item,formRefSec) => { }).componentProps.disabled = false MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { return item.field == 'factoryAreaNumber' - }).componentProps.disabled = true + }).componentProps.disabled = true + MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { + return item.field == 'maintenance' + }).componentProps.disabled = true } else if (cur == '1') { const setV = {} setV['deviceNumber'] = newRow.value.deviceNumber @@ -769,7 +783,10 @@ const onChangeSec = (field, cur, item,formRefSec) => { }).componentProps.disabled = true MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { return item.field == 'factoryAreaNumber' - }).componentProps.disabled = false + }).componentProps.disabled = false + MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { + return item.field == 'maintenance' + }).componentProps.disabled = false } } @@ -789,25 +806,17 @@ const onChangeSec = (field, cur, item,formRefSec) => { // 主子数据 提交 const submitFormSec = async (formType, data) => { - data.subList = tableData.value.map((item) => { - return { - describes: item.describes, - describes1: item.describes1, - itemNumbers: item.itemNumbers, - maintenances: item.maintenances.join(','), - workOut: item.workOut, - factoryAreaNumber: newRow.value.factoryAreaNumber, - } - }) // 拼接子表数据参数 + const data1 = { + status: data.turnType, + deviceNumber: data.deviceNumber, + type: data.type, + maintenance: data.maintenance, + id: data.id + } console.log(data.subList) try { - if (formType === 'create') { - await DeviceMaintenanceMainApi.createDeviceMaintenanceMain(data) - message.success(t('common.createSuccess')) - } else { - await DeviceMaintenanceMainApi.updateDeviceMaintenanceMain(data) - message.success(t('common.updateSuccess')) - } + await MoldMaintenanceMainApi.orderTurnTo(data1) + message.success(t('common.updateSuccess')) formRefSec.value.dialogVisible = false // 刷新当前列表 getList()