import { request } from '@eciol/request'; import { useUserStoreWithOut } from '@/store/modules/user'; import type { BillsOtherPayableService } from './typing'; enum Api { GetBillsOtherPayableList = '/api/BillsOtherPayable/QueryPage', SubmitBillsOtherPayable = '/api/BillsOtherPayable/SubmitOtherPayable', ApproveBillsOtherPayable = '/api/BillsOtherPayable/ApproveOtherPayable', ReversalBillsOtherPayable = '/api/BillsOtherPayable/ReversalOtherPayable', } /** * 其他应付单列表 * @param data */ function getBillsOtherPayableList(data: BillsOtherPayableService.GetBillsOtherPayableListParams) { const { getCompanyId } = useUserStoreWithOut(); return request.post( { url: Api.GetBillsOtherPayableList, data: { ...data, orgId: getCompanyId }, }, { showLoading: true, }, ); } /** * 提交审核 * @param ids */ function submitBillsOtherPayable(ids: number[]) { return request.post( { url: Api.SubmitBillsOtherPayable, data: { ids }, }, { showLoading: true, loadingTip: 'EMPTY', successMessage: '提交审核成功', successMessageMode: 'message', }, ); } /** * 审核应付单 * @param ids */ function approvalBillsOtherPayable(ids: number[]) { return request.post( { url: Api.ApproveBillsOtherPayable, data: { ids }, }, { showLoading: true, loadingTip: 'EMPTY', successMessage: '审核成功', successMessageMode: 'message', }, ); } /** * 红冲应付单 * @param ids */ function reversalBillsOtherPayable(ids: number[]) { return request.post( { url: Api.ReversalBillsOtherPayable, data: { ids }, }, { showLoading: true, loadingTip: 'EMPTY', successMessage: '红冲成功', successMessageMode: 'message', }, ); } export { approvalBillsOtherPayable, getBillsOtherPayableList, reversalBillsOtherPayable, submitBillsOtherPayable, }; export type { BillsOtherPayableService } from './typing';