From 42662ccb26393aad3f72309ae17dcf86be511cf6 Mon Sep 17 00:00:00 2001 From: Bunny <1319900154@qq.com> Date: Sun, 17 Nov 2024 00:46:45 +0800 Subject: [PATCH] =?UTF-8?q?completepage:=20=F0=9F=8D=BB=20=E5=80=BA?= =?UTF-8?q?=E5=8A=A1=E8=BF=98=E6=AC=BE=E8=AE=A1=E5=88=92=E5=AE=8C=E6=88=90?= =?UTF-8?q?=E5=92=8C=E4=BF=AE=E5=A4=8D=E9=83=A8=E5=88=86=E7=BC=BA=E9=99=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../v1/financialUser/debtRepaymentPlanUser.ts | 24 +++++ .../financialUser/debtRepaymentPlanUser.ts | 82 ++++++++++++++++ .../debt-repayment-plan-dialog.vue | 33 +------ .../debt/debt-repayment-plan/index.vue | 96 ++++++++----------- .../debt-repayment-plan/utils/columns.tsx | 8 +- .../debt/debt-repayment-plan/utils/hooks.ts | 22 ++--- .../debt/debt-repayment-plan/utils/types.ts | 2 - .../debt/debt-tracking/index.vue | 1 - .../debt/debt-tracking/utils/columns.tsx | 2 +- .../account-bill/bill/utils/columns.tsx | 2 +- .../debt/debt-repayment-plan/index.vue | 28 +++--- .../debt-repayment-plan/utils/columns.tsx | 2 +- .../financial/debt/debt-tracking/index.vue | 1 - .../debt/debt-tracking/utils/columns.tsx | 2 +- 14 files changed, 176 insertions(+), 129 deletions(-) create mode 100644 src/api/v1/financialUser/debtRepaymentPlanUser.ts create mode 100644 src/store/financialUser/debtRepaymentPlanUser.ts diff --git a/src/api/v1/financialUser/debtRepaymentPlanUser.ts b/src/api/v1/financialUser/debtRepaymentPlanUser.ts new file mode 100644 index 0000000..0904152 --- /dev/null +++ b/src/api/v1/financialUser/debtRepaymentPlanUser.ts @@ -0,0 +1,24 @@ +import { http } from '@/api/service/request'; +import type { BaseResult, ResultTable } from '@/api/service/types'; + +/** 债务还款计划表---获取债务还款计划表列表 */ +export const fetchGetUserDebtRepaymentPlanList = (data: any) => { + return http.request>('get', `debtRepaymentPlan/noManage/getUserDebtRepaymentPlanList/${data.currentPage}/${data.pageSize}`, { + params: data, + }); +}; + +/** 债务还款计划表---添加债务还款计划表 */ +export const fetchAddUserDebtRepaymentPlan = (data: any) => { + return http.request>('post', 'debtRepaymentPlan/noManage/addUserDebtRepaymentPlan', { data }); +}; + +/** 债务还款计划表---更新债务还款计划表 */ +export const fetchUpdateUserDebtRepaymentPlan = (data: any) => { + return http.request>('put', 'debtRepaymentPlan/noManage/updateUserDebtRepaymentPlan', { data }); +}; + +/** 债务还款计划表---删除债务还款计划表 */ +export const fetchDeleteUserDebtRepaymentPlan = (data: any) => { + return http.request>('delete', 'debtRepaymentPlan/noManage/deleteUserDebtRepaymentPlan', { data }); +}; diff --git a/src/store/financialUser/debtRepaymentPlanUser.ts b/src/store/financialUser/debtRepaymentPlanUser.ts new file mode 100644 index 0000000..f28635d --- /dev/null +++ b/src/store/financialUser/debtRepaymentPlanUser.ts @@ -0,0 +1,82 @@ +import { defineStore } from 'pinia'; +import { pageSizes } from '@/enums/baseConstant'; +import { storeMessage } from '@/utils/message'; +import { storePagination } from '@/store/useStorePagination'; +import { + fetchAddUserDebtRepaymentPlan, + fetchDeleteUserDebtRepaymentPlan, + fetchGetUserDebtRepaymentPlanList, + fetchUpdateUserDebtRepaymentPlan, +} from '@/api/v1/financialUser/debtRepaymentPlanUser'; + +/** + * 债务还款计划表 Store + */ +export const useDebtRepaymentPlanUserStore = defineStore('debtRepaymentPlanUserStore', { + state() { + return { + // 债务还款计划表列表 + datalist: [], + // 查询表单 + form: { + // 债务ID + debtId: undefined, + // 债务金额 + installmentNumber: undefined, + // 每期应还金额 + installmentAmount: undefined, + // 还款截止日期 + dueDate: undefined, + // 已还金额 + paidAmount: undefined, + // 还款状态 + paymentStatus: undefined, + }, + // 分页查询结果 + pagination: { + currentPage: 1, + pageSize: 30, + total: 1, + pageSizes, + }, + // 加载 + loading: false, + }; + }, + getters: {}, + actions: { + /** 获取债务还款计划表 */ + async getDebtRepaymentPlanList() { + // 整理请求参数 + const data = { ...this.pagination, ...this.form }; + delete data.pageSizes; + delete data.total; + delete data.background; + + // 获取债务还款计划表列表 + const result = await fetchGetUserDebtRepaymentPlanList(data); + + // 公共页面函数hook + const pagination = storePagination.bind(this); + return pagination(result); + }, + + /** 添加债务还款计划表 */ + async addDebtRepaymentPlan(data: any) { + const result = await fetchAddUserDebtRepaymentPlan(data); + return storeMessage(result); + }, + + /** 修改债务还款计划表 */ + async updateDebtRepaymentPlan(data: any) { + const result = await fetchUpdateUserDebtRepaymentPlan(data); + return storeMessage(result); + }, + + /** 删除债务还款计划表 */ + async deleteDebtRepaymentPlan(data: any) { + const result = await fetchDeleteUserDebtRepaymentPlan(data); + return storeMessage(result); + }, + }, +}); diff --git a/src/views/financial-user/debt/debt-repayment-plan/debt-repayment-plan-dialog.vue b/src/views/financial-user/debt/debt-repayment-plan/debt-repayment-plan-dialog.vue index 004e59c..784a0a1 100644 --- a/src/views/financial-user/debt/debt-repayment-plan/debt-repayment-plan-dialog.vue +++ b/src/views/financial-user/debt/debt-repayment-plan/debt-repayment-plan-dialog.vue @@ -1,10 +1,9 @@