diff --git a/src/api/wms/supplierinvoiceInvoiced/index.ts b/src/api/wms/supplierinvoiceInvoiced/index.ts index 88e303e78..2be01466c 100644 --- a/src/api/wms/supplierinvoiceInvoiced/index.ts +++ b/src/api/wms/supplierinvoiceInvoiced/index.ts @@ -96,4 +96,10 @@ export const agreeSupplierinvoiceInvoiced = async (id: number) => { // 审批拒绝待开票 export const refuseSupplierinvoiceInvoiced = async (id: number) => { return await request.post({ url: `/wms/supplierinvoice-invoiced/refuse?id=` + id }) +} + + +// 恢复被删除的待开票 +export const receverySupplierinvoiceInvoiced = async (id: number) => { + return await request.post({ url: `/wms/supplierinvoice-invoiced/recevery?id=` + id }) } \ No newline at end of file diff --git a/src/utils/disposition/defaultButtons.ts b/src/utils/disposition/defaultButtons.ts index e693de83d..ee1e4b756 100644 --- a/src/utils/disposition/defaultButtons.ts +++ b/src/utils/disposition/defaultButtons.ts @@ -463,6 +463,18 @@ export function mainListFinishBtn(option: any) { }) } +// 待开票被删除数据-恢复按钮 +export function mainListReceveryBtn(option: any) { + return __defaultBtnOption(option, { + label: t(`ts.恢复`).replace('ts.', ''), + name: 'recevery', + hide: false, + type: 'primary', + color: '', + link: true, // 文本展现按钮 + hasPermi: '' + }) +} export function mainListSendBtn(option: any) { return __defaultBtnOption(option, { label: t(`ts.发送邮件`).replace('ts.', ''), diff --git a/src/views/wms/supplierManage/supplierinvoiceInvoicedScheduleDeleted/index.vue b/src/views/wms/supplierManage/supplierinvoiceInvoicedScheduleDeleted/index.vue index 88ea8b7fb..5bdfc78f5 100644 --- a/src/views/wms/supplierManage/supplierinvoiceInvoicedScheduleDeleted/index.vue +++ b/src/views/wms/supplierManage/supplierinvoiceInvoicedScheduleDeleted/index.vue @@ -146,7 +146,7 @@ const butttondata = (row) =>{ return [ // defaultButtons.mainListEditBtn({hasPermi:'wms:supplierinvoice-invoiced:update'}), // 编辑 // defaultButtons.mainListDeleteBtn({hasPermi:'wms:supplierinvoice-invoiced:delete'}), // 删除 - // defaultButtons.mainListEditBtn({hasPermi:'wms:supplierinvoice-invoiced:update'}), + defaultButtons.mainListReceveryBtn({hasPermi:'wms:supplierinvoice-invoiced:recevery'}),//恢复 { label: t('ts.审核通过'), name: 'agree', @@ -164,6 +164,15 @@ const butttondata = (row) =>{ color: '', link: true, // 文本展现按钮 hasPermi: 'wms:supplierinvoice-invoiced:refuse' + }, + { + label: t('ts.恢复'), + name: 'recevery', + hide: isShowMainButton(row, ['1']), + type: 'danger', + color: '', + link: true, // 文本展现按钮 + hasPermi: 'wms:supplierinvoice-invoiced:recevery' } ] } @@ -178,6 +187,8 @@ const buttonTableClick = async (val, row) => { handleAgree(row.id) } else if(val == 'refuse'){//作废 handleRefuse(row.id) + }else if(val == 'recevery'){//恢复 + handleRecevery(row.id) } } @@ -230,6 +241,19 @@ const handleDelete = async (id: number) => { } catch {} } +/** 恢复按钮操作 */ +const handleRecevery = async (id: number) => { + try { + // 恢复的二次确认 + await message.delConfirm() + // 发起恢复 + await SupplierinvoiceInvoicedApi.receverySupplierinvoiceInvoiced(id) + message.success(t('common.delSuccess')) + // 刷新列表 + await getList() + } catch {} +} + /** 审批通过按钮操作 */ const handleAgree = async (id : number) => { try {