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/supplierinvoiceInvoicedDiscrete/index.vue b/src/views/wms/supplierManage/supplierinvoiceInvoicedDiscrete/index.vue index 6796b9b69..f94068de2 100644 --- a/src/views/wms/supplierManage/supplierinvoiceInvoicedDiscrete/index.vue +++ b/src/views/wms/supplierManage/supplierinvoiceInvoicedDiscrete/index.vue @@ -145,7 +145,7 @@ const buttonBaseClick = (val, item) => { const butttondata = (row) =>{ return [ // defaultButtons.mainListEditBtn({hasPermi:'wms:supplierinvoice-invoiced:update'}), // 编辑 - // defaultButtons.mainListDeleteBtn({hasPermi:'wms:supplierinvoice-invoiced:delete'}), // 删除 + defaultButtons.mainListDeleteBtn({hasPermi:'wms:supplierinvoice-invoiced:delete'}), // 删除 // defaultButtons.mainListEditBtn({hasPermi:'wms:supplierinvoice-invoiced:update'}), { label: t('ts.审核通过'), diff --git a/src/views/wms/supplierManage/supplierinvoiceInvoicedSchedule/index.vue b/src/views/wms/supplierManage/supplierinvoiceInvoicedSchedule/index.vue index caebb3108..ce444d982 100644 --- a/src/views/wms/supplierManage/supplierinvoiceInvoicedSchedule/index.vue +++ b/src/views/wms/supplierManage/supplierinvoiceInvoicedSchedule/index.vue @@ -145,7 +145,7 @@ const buttonBaseClick = (val, item) => { const butttondata = (row) =>{ return [ // defaultButtons.mainListEditBtn({hasPermi:'wms:supplierinvoice-invoiced:update'}), // 编辑 - // defaultButtons.mainListDeleteBtn({hasPermi:'wms:supplierinvoice-invoiced:delete'}), // 删除 + defaultButtons.mainListDeleteBtn({hasPermi:'wms:supplierinvoice-invoiced:delete'}), // 删除 // defaultButtons.mainListEditBtn({hasPermi:'wms:supplierinvoice-invoiced:update'}), { label: t('ts.审核通过'), diff --git a/src/views/wms/supplierManage/supplierinvoiceInvoicedScheduleDeleted/index.vue b/src/views/wms/supplierManage/supplierinvoiceInvoicedScheduleDeleted/index.vue index 88ea8b7fb..0b739ebb6 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.confirm(t('是否恢复所选中数据?')) + // 发起恢复 + await SupplierinvoiceInvoicedApi.receverySupplierinvoiceInvoiced(id) + message.success(t('恢复成功!')) + // 刷新列表 + await getList() + } catch {} +} + /** 审批通过按钮操作 */ const handleAgree = async (id : number) => { try {