From 4176e32a81069a4fd038ef0bfb34ffd203d5de7d Mon Sep 17 00:00:00 2001 From: ljlong_2630 Date: Mon, 25 Mar 2024 00:39:22 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=B5=8B=E8=AF=95bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/eam/mold/moldInspectionMain/index.ts | 6 ++ .../Detail/src/DetailDeviceLedger.vue | 15 ++-- .../device/deviceRepair/deviceRepair.data.ts | 69 +++++++++---------- .../eam/device/deviceinspectionjob/index.vue | 2 +- .../mold/moldAccounts/moldAccounts.data.ts | 7 +- .../eam/mold/moldinspectionjob/index.vue | 30 +++++++- .../moldInspectionMain.data.ts | 2 +- 7 files changed, 82 insertions(+), 49 deletions(-) diff --git a/src/api/eam/mold/moldInspectionMain/index.ts b/src/api/eam/mold/moldInspectionMain/index.ts index 1f4857e..8f857ba 100644 --- a/src/api/eam/mold/moldInspectionMain/index.ts +++ b/src/api/eam/mold/moldInspectionMain/index.ts @@ -55,4 +55,10 @@ export const exportMoldInspectionMain = async (params) => { // 下载用户导入模板 export const importTemplate = () => { return request.download({ url: '/eam/device-inspection-job-main/get-import-template' }) +} + + +// 查询检修工单主列表 +export const getMoldInspectionMainNoPage = async (params) => { + return await request.get({ url: `/eam/device-inspection-job-main/noPage`, params }) } \ No newline at end of file diff --git a/src/components/Detail/src/DetailDeviceLedger.vue b/src/components/Detail/src/DetailDeviceLedger.vue index 4b27883..a0bea80 100644 --- a/src/components/Detail/src/DetailDeviceLedger.vue +++ b/src/components/Detail/src/DetailDeviceLedger.vue @@ -208,6 +208,7 @@ :rules="dialogFormAllSchemasRules" :formAllSchemas="dialogFormAllSchemas" :isBusiness="false" + :key="milestoneUpdateKey" /> @@ -234,12 +235,12 @@ const dialogTitle = ref() const dialogAllSchemasRef = ref() const dialogTableObjectRef = ref() const dialogTableMethodsRef = ref() -const dialogUploadTitle = ref() +const dialogUploadTitle = ref('文件上传') const dialogUploadVisible = ref(false) const dialogUploadNumber = ref() const dialogUploadBusiCode = ref() const dialogFormKey = ref(0) - +const milestoneUpdateKey = ref(0) const props = defineProps({ // 标签参数 tabs: { @@ -894,10 +895,12 @@ const buttonMilestoneClick = async (val, row) => { } } -function submitDialogForm(type, row) { - props.diaLogApiUpdate(row).then(res => { - console.log(res.code); - }) +const submitDialogForm = async (type, row) => { + await props.diaLogApiUpdate(row) + dialogFormRef.value.dialogVisible = false + debugger + await getList() + milestoneUpdateKey.value += 1 } function openDialogUpload(row) { diff --git a/src/views/eam/device/deviceRepair/deviceRepair.data.ts b/src/views/eam/device/deviceRepair/deviceRepair.data.ts index b7b9e3e..0c56e61 100644 --- a/src/views/eam/device/deviceRepair/deviceRepair.data.ts +++ b/src/views/eam/device/deviceRepair/deviceRepair.data.ts @@ -84,27 +84,37 @@ export const DeviceRepair = useCrudSchemas(reactive([ } }, { - label: '报修人', - field: 'declarer', + label: '类型', + field: 'type', sort: 'custom', table: { width: '150', }, - isForm: false, - isDetail: false, formatter: (_: Recordable, __: TableColumn, cellValue: number) => { - return userListAll.find((account) => account.id == cellValue)?.nickname + return deviceMoldTypeList.find((account) => account.value == cellValue)?.label }, + isSearch: true, search: { component: 'Select', componentProps: { - options: userListAll, + options: deviceTypeList, optionsAlias: { - labelField: 'nickname', - valueField: 'id' + labelField: 'label', + valueField: 'value' }, }, }, + form: { + component: 'Select', + componentProps: { + options: deviceTypeList, + optionsAlias: { + labelField: 'label', + valueField: 'value' + }, + placeholder: "请选择设备" + } + }, }, { label: '设备', @@ -142,47 +152,36 @@ export const DeviceRepair = useCrudSchemas(reactive([ } }, { - label: '类型', - field: 'type', + label: '报修人电话', + field: 'declarerPhone', + sort: 'custom', + table: { + width: '150', + }, + }, + { + label: '报修人', + field: 'declarer', sort: 'custom', table: { width: '150', }, + isForm: false, + isDetail: false, formatter: (_: Recordable, __: TableColumn, cellValue: number) => { - return deviceMoldTypeList.find((account) => account.value == cellValue)?.label + return userListAll.find((account) => account.id == cellValue)?.nickname }, - isSearch: true, search: { component: 'Select', componentProps: { - options: deviceTypeList, + options: userListAll, optionsAlias: { - labelField: 'label', - valueField: 'value' + labelField: 'nickname', + valueField: 'id' }, }, }, - form: { - component: 'Select', - componentProps: { - options: deviceTypeList, - optionsAlias: { - labelField: 'label', - valueField: 'value' - }, - placeholder: "请选择设备" - } - }, - }, - { - label: '报修人电话', - field: 'declarerPhone', - sort: 'custom', - table: { - width: '150', - }, }, - { label: '故障类型', field: 'faultType', diff --git a/src/views/eam/device/deviceinspectionjob/index.vue b/src/views/eam/device/deviceinspectionjob/index.vue index 752139a..0bd1662 100644 --- a/src/views/eam/device/deviceinspectionjob/index.vue +++ b/src/views/eam/device/deviceinspectionjob/index.vue @@ -197,7 +197,7 @@ const butttondata = (row) => { return [ // defaultButtons.mainListEditBtn({hasPermi:'eam:deviceInspectionMain:update'}), // 编辑 // defaultButtons.mainListDeleteBtn({hasPermi:'eam:deviceInspectionMain:delete'}), // 删除 - defaultButtons.mainListEditBtn({ hide: !(row.status != 'COMPLETED' && row.status != 'VERIFIED' && row.status != 'REJECTED' && isReceiver(row.maintenance))}), // 编辑 + // defaultButtons.mainListEditBtn({ hide: !(row.status != 'COMPLETED' && row.status != 'VERIFIED' && row.status != 'REJECTED' && isReceiver(row.maintenance))}), // 编辑 defaultButtons.mainInspectionOrderBtn({ hide: !(row.status == 'PROCCED' && (userStore.getUser.id == row.maintenance)) }), //检修 defaultButtons.finishOrderBtn({ hide: !(row.status == 'PROCCED' && (userStore.getUser.id == row.maintenance)) }), //完成 ] diff --git a/src/views/eam/mold/moldAccounts/moldAccounts.data.ts b/src/views/eam/mold/moldAccounts/moldAccounts.data.ts index c0dd922..85e5318 100644 --- a/src/views/eam/mold/moldAccounts/moldAccounts.data.ts +++ b/src/views/eam/mold/moldAccounts/moldAccounts.data.ts @@ -265,15 +265,14 @@ export const MoldMilestone = useCrudSchemas(reactive([ search: { component: 'DatePicker', componentProps: { - valueFormat: 'YYYY-MM-DD HH:mm:ss', - type: 'daterange', - defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] + valueFormat: 'YYYY-MM-DD', + type: 'date', } }, form: { component: 'DatePicker', componentProps: { - type: 'datetime', + type: 'date', valueFormat: 'x' } } diff --git a/src/views/eam/mold/moldinspectionjob/index.vue b/src/views/eam/mold/moldinspectionjob/index.vue index e5f4753..229d6c8 100644 --- a/src/views/eam/mold/moldinspectionjob/index.vue +++ b/src/views/eam/mold/moldinspectionjob/index.vue @@ -91,6 +91,8 @@ import { selectAllFactoryArea } from '@/api/system/dept' import * as UserApi from '@/api/system/user' import * as DeviceInspectionDetailApi from '@/api/eam/device/deviceInspectionDetail' import * as DeviceInspectionMainApi from '@/api/eam/device/deviceInspectionMain' +import * as MoldAccountsApi from '@/api/eam/mold/moldAccounts' +import * as MoldMaintenanceMainApi from '@/api/eam/mold/moldMaintenanceMain' // import TableHead from '@/components/TableHead/src/TableHead.vue' // import ImportForm from '@/components/ImportForm/src/ImportForm.vue' @@ -196,7 +198,7 @@ const butttondata = (row) => { return [ // defaultButtons.mainListEditBtn({hasPermi:'eam:moldInspectionMain:update'}), // 编辑 // defaultButtons.mainListDeleteBtn({hasPermi:'eam:moldInspectionMain:delete'}), // 删除 - defaultButtons.mainListEditBtn({ hide: !(row.status != 'COMPLETED' && row.status != 'VERIFIED' && row.status != 'REJECTED' && isReceiver(row.maintenance))}), // 编辑 + // defaultButtons.mainListEditBtn({ hide: !(row.status != 'COMPLETED' && row.status != 'VERIFIED' && row.status != 'REJECTED' && isReceiver(row.maintenance))}), // 编辑 defaultButtons.mainInspectionOrderBtn({ hide: !(row.status == 'PROCCED' && (userStore.getUser.id == row.maintenance)) }), //检修 defaultButtons.finishOrderBtn({ hide: !(row.status == 'PROCCED' && (userStore.getUser.id == row.maintenance)) }), //完成 ] @@ -215,8 +217,32 @@ const buttonTableClick = async (val, row) => { /** 添加/修改操作 */ const basicFormRef = ref() -const openForm = (type: string, row?: any) => { +const openForm = async (type: string, row?: any) => { tableData.value = [] // 重置明细数据 + const res = await MoldInspectionMainApi.getMoldInspectionMainNoPage() + const moldList = await MoldAccountsApi.getMoldAccountsNoPage({}) + const repairList = await MoldMaintenanceMainApi.getMoldMainTempList('MOLD') + const newMoldList = moldList.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 + newMoldList.forEach(element => { + if (item.number == element.number) { + flag = true + } + }) + return flag + }) + MoldInspectionMain.allSchemas.formSchema.find(item => item.field == 'deviceNumber').componentProps.options = newMoldList + MoldInspectionMain.allSchemas.formSchema.find(item => item.field == 'maintenanceNumber').componentProps.options = newRepairList + basicFormRef.value.open(type, row) } diff --git a/src/views/eam/mold/moldinspectionjob/moldInspectionMain.data.ts b/src/views/eam/mold/moldinspectionjob/moldInspectionMain.data.ts index 59f54db..3c7e30a 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: () => moldListAll, + api: () => moldList, componentProps: { optionsAlias: { labelField: 'name',