From df485333eaed80c0b34e772f1bf52e10253c642a Mon Sep 17 00:00:00 2001 From: zhang_li <2235006734@qqq.com> Date: Thu, 15 Aug 2024 14:38:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A3=80=E9=AA=8C=E8=AE=B0=E5=BD=95=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=85=B3=E9=97=AD=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/qms/inspectionRecord/index.vue | 81 ++++++++++++++++-------- 1 file changed, 53 insertions(+), 28 deletions(-) diff --git a/src/views/qms/inspectionRecord/index.vue b/src/views/qms/inspectionRecord/index.vue index 636e3e2de..ed885c7b2 100644 --- a/src/views/qms/inspectionRecord/index.vue +++ b/src/views/qms/inspectionRecord/index.vue @@ -244,6 +244,7 @@ const isShowPackageBtn = (row, val) => { const butttondata = (row) => { return [ // defaultButtons.mainListOrderCOMPLETEBtn({ hide: isShowMainButton(row, ['INCOMPLETE']) }), // 完成 + defaultButtons.mainApplyDecisionBtn({ hide: isShowMainButton(row, null), hasPermi: 'qms:inspection-recode-main:edit' @@ -253,6 +254,10 @@ const butttondata = (row) => { hide: isShowMainButton(row, 'publish'), hasPermi: 'qms:inspection-recode-main:pub' }), // 发布 + defaultButtons.mainListCloseBtn({ + hide: isShowMainButton(row, null), + hasPermi: 'qms:inspection-recode-main:close' + }), // 关闭 defaultButtons.mainListPackageBtn({ hide: isShowPackageBtn(row, ['11']) }), // 包装 // defaultButtons.mainListJobExeBtn({ // hide:row.useDecision, @@ -269,7 +274,9 @@ const useDecisionList = getStrDictOptions(DICT_TYPE.USAGE_DECISION) // const useDecisionList = InspectionRecordMain.allSchemas.formSchema.filter(item=>item.field == "useDecision") // 列表-操作按钮事件 const buttonTableClick = async (val, row) => { - if (val == 'applyDecision') { + if (val == 'mainClose') { + handleOrderClose(row) + } else if (val == 'applyDecision') { // 编辑 // 评估代码值是1,接收时候,使用决策下拉列表是全部合格 if (row.estimateCode == 1) { @@ -366,7 +373,20 @@ const handleOrderPub = async (row: object) => { await getList() } catch {} } - +/** 关闭按钮操作 */ +const handleOrderClose = async (row: object) => { + try { + // 二次确认 + await message.confirm(t('ts.是否关闭所选中数据?')) + row.isPublished = true + row.packageList = await InspectionRecordPackageApi.getInspectionRecordPackageList(row.id) + await InspectionRecordMainApi.updateInspectionRecordMain(row) + message.success(t('ts.关闭成功!')) + await getList() + } catch { + row.isPublished = false + } +} //执行 const execute = async (type: string, row?: number) => { @@ -445,33 +465,38 @@ const searchFormClick = (searchData) => { let isHave = searchData?.filters?.some((item) => item.column == 'inspectionType') if (!isHave) { if (route.name == 'inspectionRecordPurchase') { - searchData.filters.push({ - action: '==', - column: 'inspectionType', - value: '1' - },{ - action: '==', - column: 'available', - value: true - }) - } else if (route.name == 'inspectionRecordProduction') { - searchData.filters.push({ - action: '==', - column: 'inspectionType', - value: '4' - },{ - action: '==', - column: 'available', - value: true - }) - } else { + searchData.filters.push( + { + action: '==', + column: 'inspectionType', + value: '1' + }, + { + action: '==', + column: 'available', + value: true + } + ) + } else if (route.name == 'inspectionRecordProduction') { + searchData.filters.push( + { + action: '==', + column: 'inspectionType', + value: '4' + }, + { + action: '==', + column: 'available', + value: true + } + ) + } else { searchData.filters.push({ - action: 'notIn', - column: 'inspectionType', - value: '1,4,11' - }) - } - + action: 'notIn', + column: 'inspectionType', + value: '1,4,11' + }) + } } tableObject.params = { isSearch: true,