diff --git a/src/api/wms/supplierinvoiceInvoiced/index.ts b/src/api/wms/supplierinvoiceInvoiced/index.ts index 4ec7469ef..9be7c7d15 100644 --- a/src/api/wms/supplierinvoiceInvoiced/index.ts +++ b/src/api/wms/supplierinvoiceInvoiced/index.ts @@ -62,4 +62,14 @@ export const exportSupplierinvoiceInvoiced = async (params) => { // 下载用户导入模板 export const importTemplate = () => { return request.download({ url: '/wms/supplierinvoice-invoiced/get-import-template' }) +} + +// 审批通过待开票 +export const agreeSupplierinvoiceInvoiced = async (id: number) => { + return await request.post({ url: `/wms/supplierinvoice-invoiced/agree?id=` + id }) +} + +// 审批拒绝待开票 +export const refuseSupplierinvoiceInvoiced = async (id: number) => { + return await request.post({ url: `/wms/supplierinvoice-invoiced/refuse?id=` + id }) } \ No newline at end of file diff --git a/src/views/wms/supplierManage/supplierinvoiceInvoiced/index.vue b/src/views/wms/supplierManage/supplierinvoiceInvoiced/index.vue index adfe8d487..19982feb2 100644 --- a/src/views/wms/supplierManage/supplierinvoiceInvoiced/index.vue +++ b/src/views/wms/supplierManage/supplierinvoiceInvoiced/index.vue @@ -33,7 +33,7 @@ @@ -63,7 +63,6 @@ import { SupplierinvoiceInvoiced,SupplierinvoiceInvoicedRules } from './supplier import * as SupplierinvoiceInvoicedApi from '@/api/wms/supplierinvoiceInvoiced' import * as defaultButtons from '@/utils/disposition/defaultButtons' import TableHead from '@/components/TableHead/src/TableHead.vue' -import ImportForm from '@/components/ImportForm/src/ImportForm.vue' import Detail from '@/components/Detail/src/Detail.vue' defineOptions({ name: 'SupplierinvoiceInvoiced' }) @@ -99,9 +98,7 @@ const { getList, setSearchParams } = tableMethods // 根据状态返回该按钮是否显示 const isShowMainButton = (row, val) => { - console.log("1111111",row.status) if (val.indexOf(row.status) > -1) { - console.log("1111111") return false } else { return true @@ -145,7 +142,7 @@ const buttonBaseClick = (val, item) => { // 列表-操作按钮 const butttondata = (row) =>{ return [ - defaultButtons.mainListEditBtn({hasPermi:'wms:supplierinvoice-invoiced:update'}), // 编辑 + // defaultButtons.mainListEditBtn({hasPermi:'wms:supplierinvoice-invoiced:update'}), // 编辑 // defaultButtons.mainListDeleteBtn({hasPermi:'wms:supplierinvoice-invoiced:delete'}), // 删除 // defaultButtons.mainListEditBtn({hasPermi:'wms:supplierinvoice-invoiced:update'}), { @@ -175,6 +172,8 @@ const buttonTableClick = async (val, row) => { openForm('update', row) } else if (val == 'delete') { // 删除 handleDelete(row.id) + } else if(val == 'agree'){ + handleAgree(row.id) } } @@ -227,6 +226,41 @@ const handleDelete = async (id: number) => { } catch {} } +/** 审批通过按钮操作 */ +const handleAgree = async (id : number) => { + try { + // 审批通过的二次确认 + await message.confirm('是否审批通过所选中数据?') + tableObject.loading = true + // 发起审批通过 + await SupplierinvoiceInvoicedApi.agreeSupplierinvoiceInvoiced(id) + message.success(t('审批通过成功!')) + tableObject.loading = false + // 刷新列表 + await getList() + } catch { }finally{ + tableObject.loading = false + } +} + + +/** 审批通过按钮操作 */ +const handleRefuse = async (id : number) => { + try { + // 审批通过的二次确认 + await message.confirm('是否审批拒绝所选中数据?') + tableObject.loading = true + // 发起审批通过 + await SupplierinvoiceInvoicedApi.refuseSupplierinvoiceInvoiced(id) + message.success(t('审批成功!')) + tableObject.loading = false + // 刷新列表 + await getList() + } catch { }finally{ + tableObject.loading = false + } +} + /** 导出按钮操作 */ const exportLoading = ref(false) // 导出的加载中 const handleExport = async () => { diff --git a/src/views/wms/supplierManage/supplierinvoiceInvoiced/supplierinvoiceInvoiced.data.ts b/src/views/wms/supplierManage/supplierinvoiceInvoiced/supplierinvoiceInvoiced.data.ts index 371d09f00..aa7073a7d 100644 --- a/src/views/wms/supplierManage/supplierinvoiceInvoiced/supplierinvoiceInvoiced.data.ts +++ b/src/views/wms/supplierManage/supplierinvoiceInvoiced/supplierinvoiceInvoiced.data.ts @@ -161,7 +161,7 @@ export const SupplierinvoiceInvoiced = useCrudSchemas(reactive([ field: 'action', isForm: false, table: { - width: 150, + width: 200, fixed: 'right' } }