| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342 |
- import request from "@/utils/request";
- const API_PATH = "/payment/account";
- export const AccountAPI = {
- statAmount(tenantId?: number, enterpriseId?: string, payeeType?: string) {
- return request<
- ApiResponse<{ amount_of_today: string; amount_of_7days: string; amount_of_all: string }>
- >({
- url: `${API_PATH}/stat/transfer/amount`,
- method: "get",
- params: { tenant_id: tenantId, enterprise_id: enterpriseId, payee_type: payeeType },
- });
- },
- statConsumeAmount(tenantId?: number, enterpriseId?: string) {
- return request<
- ApiResponse<{ amount_of_today: string; amount_of_7days: string; amount_of_all: string }>
- >({
- url: `${API_PATH}/stat/consume/amount`,
- method: "get",
- params: { tenant_id: tenantId, enterprise_id: enterpriseId },
- });
- },
- statSummaryAmount(tenantId?: number, enterpriseId?: string, payeeType?: string) {
- return request<
- ApiResponse<{ amount_of_today: string; amount_of_7days: string; amount_of_all: string }>
- >({
- url: `${API_PATH}/stat/summary/amount`,
- method: "get",
- params: { tenant_id: tenantId, enterprise_id: enterpriseId, payee_type: payeeType },
- });
- },
- statF2fTradeAmount(tenantId?: number, enterpriseId?: string) {
- return request<
- ApiResponse<{ amount_of_today: string; amount_of_7days: string; amount_of_all: string }>
- >({
- url: `${API_PATH}/stat/f2f/amount`,
- method: "get",
- params: { tenant_id: tenantId, enterprise_id: enterpriseId },
- });
- },
- authorizeApply(data: { enterprise_id: string }) {
- return request<ApiResponse<{ sign_url: string; external_agreement_no: string }>>({
- url: `${API_PATH}/authorize/apply`,
- method: "post",
- data,
- });
- },
- // ========== 进件 ==========
- uploadImage(file: File, enterpriseId: string) {
- const fd = new FormData();
- fd.append("file", file);
- fd.append("enterprise_id", enterpriseId);
- return request<ApiResponse<{ image_id: string }>>({
- url: `${API_PATH}/onboard/upload`,
- method: "post",
- data: fd,
- headers: { "Content-Type": "multipart/form-data" },
- });
- },
- createOnboard(data: {
- enterprise_id: string;
- scene_directions: string;
- scene_image: string;
- sites?: string;
- }) {
- return request<ApiResponse<{ order_id: string; out_biz_no: string; status: string }>>({
- url: `${API_PATH}/onboard/create`,
- method: "post",
- data,
- });
- },
- queryOnboard(enterpriseId: string, orderId: string) {
- return request<ApiResponse<{ order_id: string; status: string }>>({
- url: `${API_PATH}/onboard/query`,
- method: "get",
- params: { enterprise_id: enterpriseId, order_id: orderId },
- });
- },
- cancelOnboard(data: { enterprise_id: string; order_id: string }) {
- return request<ApiResponse>({
- url: `${API_PATH}/onboard/cancel`,
- method: "post",
- data,
- });
- },
- // ========== 签约查询 ==========
- queryAgreement(enterpriseId: string, externalAgreementNo: string) {
- return request<ApiResponse<{ agreement_no: string; status: string }>>({
- url: `${API_PATH}/agreement/query`,
- method: "get",
- params: { enterprise_id: enterpriseId, external_agreement_no: externalAgreementNo },
- });
- },
- create(data: {
- enterprise_id: string;
- agreement_no?: string; // 安全发: 签约协议号
- account_type?: string;
- scene?: string;
- account_book_id?: string;
- remark?: string;
- }) {
- return request<ApiResponse<{ enterprise_id: string; account_book_id: string }>>({
- url: `${API_PATH}`,
- method: "post",
- data,
- });
- },
- query(enterpriseId: string) {
- return request<ApiResponse<any[]>>({
- url: `${API_PATH}/query/${enterpriseId}`,
- method: "get",
- });
- },
- deposit(data: {
- enterprise_id: string;
- account_book_id: string;
- amount: number;
- out_biz_no?: string;
- remark?: string;
- }) {
- return request<ApiResponse<{ url: string }>>({
- url: `${API_PATH}/deposit`,
- method: "post",
- data,
- });
- },
- transfer(data: {
- enterprise_id: string;
- account_book_id?: string;
- out_biz_no?: string;
- amount: number;
- order_title?: string;
- remark?: string;
- payee_info: {
- identity_type: string;
- name: string;
- identity: string;
- bankcard_ext_info?: {
- account_type: string;
- inst_name?: string;
- inst_province?: string;
- inst_city?: string;
- inst_branch_name?: string;
- bank_code?: string;
- };
- };
- employee_id?: string;
- priority?: string;
- ext_info?: Record<string, any>;
- }) {
- return request<ApiResponse<{ status: string; order_id?: string; pay_fund_order_id?: string }>>({
- url: `${API_PATH}/transfer`,
- method: "post",
- data,
- });
- },
- transferDetail(outBizNo: string) {
- return request<ApiResponse<TransferOutSchema>>({
- url: `${API_PATH}/transfer/${outBizNo}`,
- method: "get",
- });
- },
- transferList(params: {
- page_no?: number;
- page_size?: number;
- out_biz_no?: string;
- status?: string;
- tenant_id?: number;
- enterprise_id?: string;
- }) {
- return request<ApiResponse<TransferListResp>>({
- url: `${API_PATH}/transfer`,
- method: "get",
- params,
- });
- },
- consumeList(params: {
- page_no?: number;
- page_size?: number;
- tenant_id?: number;
- enterprise_id?: string;
- employee_id?: string;
- consume_type?: string;
- status?: string;
- start_time?: string;
- end_time?: string;
- }) {
- return request<ApiResponse<PageResult<ConsumeVO[]>>>({
- url: `${API_PATH}/consume-list`,
- method: "get",
- params,
- });
- },
- consumeDetail(params: {
- pay_no: string;
- enterprise_id?: string;
- ant_shop_id?: string;
- query_options?: string[];
- }) {
- return request<ApiResponse<any>>({
- url: `${API_PATH}/consume-detail`,
- method: "get",
- params,
- });
- },
- exportTransferReport(params: {
- start_time: string;
- end_time: string;
- enterprise_id?: string;
- }) {
- return request({
- url: `${API_PATH}/transfer/export`,
- method: "get",
- params,
- responseType: "blob",
- });
- },
- downloadReceipt(params: {
- enterprise_id: string;
- order_no: string;
- }) {
- return request<ApiResponse<ReceiptQueryOutSchema>>({
- url: `${API_PATH}/receipt/download`,
- method: "get",
- params,
- });
- },
- queryReceipt(params: {
- enterprise_id: string;
- file_id: string;
- }) {
- return request<ApiResponse<ReceiptQueryOutSchema>>({
- url: `${API_PATH}/receipt/${params.enterprise_id}/${params.file_id}`,
- method: "get",
- });
- },
- withdraw(data: {
- enterprise_id: string;
- account_book_id: string;
- amount: number;
- remark?: string;
- }) {
- return request<ApiResponse>({
- url: `${API_PATH}/withdraw`,
- method: "post",
- data,
- });
- },
- };
- export interface ReceiptQueryOutSchema {
- file_id: string;
- status: string;
- download_url?: string;
- error_message?: string;
- }
- export interface TransferOutSchema {
- out_biz_no?: string;
- enterprise_id?: string;
- account_book_id?: string;
- amount?: string;
- order_title?: string;
- payee_info?: {
- identity_type: string;
- name: string;
- identity: string;
- bankcard_ext_info?: any;
- };
- status?: string;
- order_id?: string;
- pay_fund_order_id?: string;
- /** @deprecated 兼容旧字段 */
- order_no?: string;
- /** @deprecated 兼容旧字段 */
- fund_order_id?: string;
- created_time?: string;
- updated_time?: string;
- }
- export interface TransferListResp {
- total: number;
- items: TransferOutSchema[];
- }
- export interface ConsumeVO {
- id: number;
- tenant_id: number;
- enterprise_id: string;
- employee_id: string;
- pay_no: string;
- account_id: string;
- consume_type: string;
- consume_amount: string;
- gmt_biz_create: string;
- gmt_recieve_pay: string;
- peer_pay_amount: string;
- status: string;
- expense_scene_code: string;
- expense_type: string;
- created_time: string;
- updated_time: string;
- }
- export interface ConsumeDetailSchema {
- pay_no?: string;
- enterprise_id?: string;
- amount?: string;
- status?: string;
- created_time?: string;
- pay_type?: string;
- payee_info?: any;
- refund_info?: any;
- order_info?: any;
- ticket_info?: any;
- }
- export default AccountAPI;
|