From 5753ac921ddded73b1e2a33baf37ec3e39991eb6 Mon Sep 17 00:00:00 2001 From: yejiaxing <591141169@qq.com> Date: Tue, 6 Feb 2024 14:11:13 +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 --- .../eam/item/applicationRecordMain/index.ts | 10 + src/components/Detail/src/approveDetail.vue | 574 ++++++++++++++++++ src/utils/disposition/defaultButtons.ts | 30 +- .../eam/item/applicationRecord/index.vue | 21 +- 4 files changed, 626 insertions(+), 9 deletions(-) create mode 100644 src/components/Detail/src/approveDetail.vue diff --git a/src/api/eam/item/applicationRecordMain/index.ts b/src/api/eam/item/applicationRecordMain/index.ts index aba5ca4..af7ea56 100644 --- a/src/api/eam/item/applicationRecordMain/index.ts +++ b/src/api/eam/item/applicationRecordMain/index.ts @@ -46,6 +46,16 @@ export const deleteApplicationRecordMain = async (id: number) => { return await request.delete({ url: `/eam/item-apply-main/delete?id=` + id }) } +// 审批通过备件申领记录主 +export const agreeApplicationRecordMain = async (id: number) => { + return await request.delete({ url: `/eam/item-apply-main/agree?id=` + id }) +} + +// 审批驳回备件申领记录主 +export const disAgreeApplicationRecordMain = async (id: number) => { + return await request.delete({ url: `/eam/item-apply-main/disAgree?id=` + id }) +} + // 导出备件申领记录主 Excel export const exportApplicationRecordMain = async (params) => { return await request.download({ url: `/eam/item-apply-main/export-excel`, params }) diff --git a/src/components/Detail/src/approveDetail.vue b/src/components/Detail/src/approveDetail.vue new file mode 100644 index 0000000..607a6b6 --- /dev/null +++ b/src/components/Detail/src/approveDetail.vue @@ -0,0 +1,574 @@ + + + + + diff --git a/src/utils/disposition/defaultButtons.ts b/src/utils/disposition/defaultButtons.ts index e8fc2d0..2dbf155 100644 --- a/src/utils/disposition/defaultButtons.ts +++ b/src/utils/disposition/defaultButtons.ts @@ -788,6 +788,32 @@ export function chooseDeviceBtn(option:any) { }) } +// 审批通过按钮 +export function agree(option:any) { + return __defaultBtnOption(option,{ + label: '通过', + name: 'agree', + hide: false, + type: 'primary', + // icon: 'ep:plus', + color: 'green', + hasPermi: '' + }) +} + +// 审批驳回按钮 +export function disAgree(option:any) { + return __defaultBtnOption(option,{ + label: '驳回', + name: 'disAgree', + hide: false, + type: 'primary', + // icon: 'ep:plus', + color: 'red', + hasPermi: '' + }) +} + // 主列表-撤销 export function backoutBtn(option:any) { return __defaultBtnOption(option,{ @@ -892,10 +918,6 @@ export function finishOrderBtn(option:any) { }) } - - - - // 默认按钮规则 function __defaultBtnOption(option:any,specific:any){ return { diff --git a/src/views/eam/item/applicationRecord/index.vue b/src/views/eam/item/applicationRecord/index.vue index c67f0d5..a58386a 100644 --- a/src/views/eam/item/applicationRecord/index.vue +++ b/src/views/eam/item/applicationRecord/index.vue @@ -44,7 +44,13 @@ :apiPage="ApplicationRecordDetailApi.getApplicationRecordDetailPage" :apiDelete="ApplicationRecordDetailApi.deleteApplicationRecordDetail" @searchTableSuccessDetail="searchTableSuccessDetail" /> - + + @@ -58,6 +64,7 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons' import TableHead from '@/components/TableHead/src/TableHead.vue' import ImportForm from '@/components/ImportForm/src/ImportForm.vue' + import approveDetail from '@/components/Detail/src/approveDetail.vue' // 采购订单 defineOptions({ name: 'ApplicationRecord' }) @@ -163,8 +170,8 @@ // 列表-操作按钮 const butttondata = (row) => { return [ - defaultButtons.approveBtn({ hide: isShowMainButton(row, ['0']) }), // 撤回 - // defaultButtons.mainListEditBtn(null), // 编辑 + defaultButtons.approveBtn({ hide: isShowMainButton(row, ['0']) }), // 审批 + defaultButtons.mainListEditBtn(null), // 编辑 // defaultButtons.mainListDeleteBtn(null), // 删除 ] } @@ -173,8 +180,8 @@ const buttonTableClick = async (val, row) => { if (val == 'edit') { // 编辑 openForm('update', row) - }else if (val == 'approve') { // 删除 - // handleDelete(row.id) + } else if (val == 'approve') { // 删除 + handleApprove(row, '单据号', row.number) } else if (val == 'delete') { // 删除 handleDelete(row.id) } @@ -192,6 +199,10 @@ const openDetail = (row : any, titleName : any, titleValue : any) => { detailRef.value.openDetail(row, titleName, titleValue, 'basicApplicationRecordMain') } + const detailRef1 = ref() + const handleApprove = (row : any, titleName : any, titleValue : any) => { + detailRef1.value.openDetail(row, titleName, titleValue, 'basicApplicationRecordMain') + } /** 删除按钮操作 */ const handleDelete = async (id : number) => {