From b7eae98bda2b101a2070b5a85016c221a90fa3ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B7=BB=E7=A0=96-JAVA=5CAdministrator?= <591141169@qq.com> Date: Tue, 13 Aug 2024 10:42:16 +0800 Subject: [PATCH] =?UTF-8?q?BUG=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/qms/inspectionJob/index.vue | 85 +++++++------------ .../qms/inspectionJobProduction/index.vue | 7 +- src/views/qms/inspectionJobPurchase/index.vue | 7 +- src/views/qms/inspectionRecord/index.vue | 10 +-- src/views/qms/inspectionRecordFirst/index.vue | 8 +- src/views/qms/inspectionRequest/index.vue | 4 +- 6 files changed, 57 insertions(+), 64 deletions(-) diff --git a/src/views/qms/inspectionJob/index.vue b/src/views/qms/inspectionJob/index.vue index be20c57a1..3d430b68f 100644 --- a/src/views/qms/inspectionJob/index.vue +++ b/src/views/qms/inspectionJob/index.vue @@ -4,8 +4,11 @@ + @reset="setSearchParams({ + available: true, + excludeInspectionType: '1,4' + })" + /> @@ -20,8 +23,7 @@ - - + v-model="showQualityReport" + :title="t('质检明细')" + :append-to-body="false" + destroy-on-close + fullscreen + > + @@ -121,7 +122,6 @@ import TableHead from '@/components/TableHead/src/TableHead.vue' import AddForm from './addForm.vue' import Detail from './detail.vue' import { getReportUrl } from '@/utils/systemParam' -import { useUserStore } from '@/store/modules/user' // 采购订单 defineOptions({ name: 'inspectionJobMain' }) @@ -132,7 +132,6 @@ const route = useRoute() // 路由信息 const routeName = ref() routeName.value = route.name const tableColumns = ref(InspectionJobMain.allSchemas.tableColumns) -const userStore = useUserStore() // 字段设置 更新主列表字段 const updataTableColumns = (val) => { @@ -203,7 +202,7 @@ const buttonBaseClick = (val, item) => { handleExport() } else if (val == 'refresh') { // 刷新 - if (tableObject.params.filters && tableObject.params.filters.length > 0) { + if (tableObject.params.filters && tableObject.params.filters.length > 0 ) { searchFormClick({ filters: tableObject.params.filters }) @@ -235,35 +234,24 @@ const isShowMainButton2 = (row, val) => { return true } } -// 根据状态返回该按钮是否显示 -const isShowMainButton1 = (row, val) => { - if (val.indexOf(row.status) > -1) { - if (userStore.getUser.id == row.acceptUserId) { - return false - } else { - return true - } - } else { - return true - } -} + // 列表-操作按钮 const butttondata = (row) => { return [ - // defaultButtons.mainListJobAccBtn({ - // hide: isShowMainButton(row, ['1']), - // hasPermi: 'qms:inspection-job-main:accept' - // }), // 承接 + defaultButtons.mainListJobAccBtn({ + hide: isShowMainButton(row, ['1']), + hasPermi: 'qms:inspection-job-main:accept' + }), // 承接 defaultButtons.mainListJobCloBtn({ hide: isShowMainButton(row, ['1']), hasPermi: 'qms:inspection-job-main:close' }), // 关闭 defaultButtons.mainListJobAbaBtn({ - hide: isShowMainButton1(row, ['2']), + hide: isShowMainButton(row, ['2']), hasPermi: 'qms:inspection-job-main:abandon' }), // 放弃 defaultButtons.mainListJobExeBtn({ - hide: isShowMainButton(row, ['1', '2']), + hide: isShowMainButton(row, ['2']), hasPermi: 'qms:inspection-job-main:execute' }), // 执行 defaultButtons.mainListOrderPubBtn({ @@ -327,19 +315,10 @@ const openDetail = (row: any, titleName: any, titleValue: any) => { detailRef.value.openDetail(row, titleName, titleValue, 'basicInspectionJobMain') } //执行 + const formRef = ref() -const execute = async (type: string, row?: any) => { - if (row.status == '2') { - if (userStore.getUser.id == row.acceptUserId) { - formRef.value.open(type, row) - } else { - message.error('承接人与当前登录人不一致') - } - } else if (row.status == '1') { - await handleAccept(row.id) - formRef.value.open(type, row) - await getList() - } +const execute = async (type: string, row?: number) => { + formRef.value.open(type, row) } /** 关闭按钮操作 */ const handleClose = async (id: number) => { @@ -350,7 +329,7 @@ const handleClose = async (id: number) => { await InspectionJobMainApi.closeInspectionJobMain(id) message.success(t('common.closeSuccess')) // 刷新列表 - buttonBaseClick('refresh', null) + buttonBaseClick('refresh',null) } catch {} } /** 发布按钮操作 */ @@ -362,19 +341,19 @@ const handleRelease = async (id: number) => { await InspectionJobMainApi.releaseInspectionJobMain(id) message.success('发布成功!') // 刷新列表 - buttonBaseClick('refresh', null) + buttonBaseClick('refresh',null) } catch {} } // 承接 const handleAccept = async (id: number) => { try { // 承接的二次确认 - // await message.confirm(t('common.confirmAccept')) + await message.confirm(t('common.confirmAccept')) // 发起承接 await InspectionJobMainApi.acceptInspectionJobMain(id) - // message.success(t('common.acceptSuccess')) + message.success(t('common.acceptSuccess')) // 刷新列表(TB反馈,取消承接后刷新页面) - // buttonBaseClick('refresh',null) + buttonBaseClick('refresh',null) } catch {} } // 放弃任务 @@ -386,7 +365,7 @@ const handleAbandon = async (id: number) => { await InspectionJobMainApi.abandonInspectionJobMain(id) message.success(t('common.giveupSuccess')) // 刷新列表 - buttonBaseClick('refresh', null) + buttonBaseClick('refresh',null) } catch {} } @@ -432,8 +411,8 @@ const submitForm = async (formType, data) => { // 刷新当前列表 if (formType === 'create') { getList() - } else { - buttonBaseClick('refresh', null) + }else{ + buttonBaseClick('refresh',null) } } finally { formRef.value.formLoading = false diff --git a/src/views/qms/inspectionJobProduction/index.vue b/src/views/qms/inspectionJobProduction/index.vue index de5e92027..04c960c99 100644 --- a/src/views/qms/inspectionJobProduction/index.vue +++ b/src/views/qms/inspectionJobProduction/index.vue @@ -4,8 +4,11 @@ + @reset="setSearchParams({ + available: true, + inspectionType: '4' + })" + /> diff --git a/src/views/qms/inspectionJobPurchase/index.vue b/src/views/qms/inspectionJobPurchase/index.vue index 3b276eb79..3b9d26dd4 100644 --- a/src/views/qms/inspectionJobPurchase/index.vue +++ b/src/views/qms/inspectionJobPurchase/index.vue @@ -4,8 +4,11 @@ + @reset="setSearchParams({ + available: true, + inspectionType: '1' + })" + /> diff --git a/src/views/qms/inspectionRecord/index.vue b/src/views/qms/inspectionRecord/index.vue index d3f6c3cc0..705aaac2d 100644 --- a/src/views/qms/inspectionRecord/index.vue +++ b/src/views/qms/inspectionRecord/index.vue @@ -4,8 +4,11 @@ + @reset="setSearchParams({ + available: true, + excludeInspectionType: '11' + })" + /> @@ -315,10 +318,8 @@ const basicFormRef = ref() // } /** 使用决策操作操作 */ const formRef = ref() -const rowData = ref() const openUseForm = async (type: string, row?: number) => { tableData.value = [] // 重置明细数据 - rowData.value = row formRef.value.open(type, row) } @@ -395,7 +396,6 @@ const submitForm = async (formType, data) => { message.success(t('common.updateSuccess')) } formRef.value.dialogVisible = false - handleOrderPub(rowData.value ) // 刷新当前列表 getList() } finally { diff --git a/src/views/qms/inspectionRecordFirst/index.vue b/src/views/qms/inspectionRecordFirst/index.vue index 5fc6a5ad2..3ad3462ac 100644 --- a/src/views/qms/inspectionRecordFirst/index.vue +++ b/src/views/qms/inspectionRecordFirst/index.vue @@ -1,7 +1,13 @@