diff --git a/src/api/v1/financial/admin/savingGoal.ts b/src/api/v1/financial/admin/savingGoal.ts index aaab6ba..3e2fe99 100644 --- a/src/api/v1/financial/admin/savingGoal.ts +++ b/src/api/v1/financial/admin/savingGoal.ts @@ -3,6 +3,18 @@ import type { BaseResult, ResultTable } from '@/api/service/types'; /** 用户储值---获取用户储值列表 */ export const fetchGetSavingGoalList = (data: any) => { + data = { + userId: data.userId, + statusType: data.statusType, + savingGoalName: data.savingGoalName, + amount: data.amount, + amountDeposited: data.amountDeposited, + duration: data.duration, + startDuration: data.startDuration, + endDuration: data.endDuration, + pageSize: data.pageSize, + currentPage: data.currentPage, + }; return http.request>('get', `savingGoal/getSavingGoalList/${data.currentPage}/${data.pageSize}`, { params: data }); }; diff --git a/src/api/v1/financial/user/savingGoalUser.ts b/src/api/v1/financial/user/savingGoalUser.ts index 01ef2a9..15eed5a 100644 --- a/src/api/v1/financial/user/savingGoalUser.ts +++ b/src/api/v1/financial/user/savingGoalUser.ts @@ -3,7 +3,20 @@ import type { BaseResult, ResultTable } from '@/api/service/types'; /** 用户储值---获取用户储值列表 */ export const fetchGetUserSavingGoalList = (data: any) => { - return http.request>('get', `savingGoal/noManage/getUserSavingGoalList/${data.currentPage}/${data.pageSize}`, { params: data }); + data = { + statusType: data.statusType, + savingGoalName: data.savingGoalName, + amount: data.amount, + amountDeposited: data.amountDeposited, + duration: data.duration, + startDuration: data.startDuration, + endDuration: data.endDuration, + pageSize: data.pageSize, + currentPage: data.currentPage, + }; + return http.request>('get', `savingGoal/noManage/getUserSavingGoalList/${data.currentPage}/${data.pageSize}`, { + params: data, + }); }; /** 用户储值---添加用户储值 */ diff --git a/src/store/financial/savingGoal.ts b/src/store/financial/savingGoal.ts index c07cffa..82cfdbe 100644 --- a/src/store/financial/savingGoal.ts +++ b/src/store/financial/savingGoal.ts @@ -18,6 +18,7 @@ export const useSavingGoalStore = defineStore('savingGoalStore', { statusType: undefined, // 完成状态 savingGoalName: undefined, // 储值目标名称 amount: undefined, // 目标金额 + amountDeposited: undefined, // 已存入金额 duration: undefined, // 目标时长 startDuration: undefined, // 开始目标时长 endDuration: undefined, // 结束目标时长 @@ -44,10 +45,6 @@ export const useSavingGoalStore = defineStore('savingGoalStore', { // 整理请求参数 const data = { ...this.pagination, ...this.form }; - delete data.pageSizes; - delete data.total; - delete data.background; - delete data.duration; // 获取用户储值列表 const result = await fetchGetSavingGoalList(data); diff --git a/src/store/financialUser/savingGoalUser.ts b/src/store/financialUser/savingGoalUser.ts index 639a868..ec20c2a 100644 --- a/src/store/financialUser/savingGoalUser.ts +++ b/src/store/financialUser/savingGoalUser.ts @@ -24,6 +24,7 @@ export const useSavingGoalUserStore = defineStore('savingGoalUserStore', { statusType: undefined, // 完成状态 savingGoalName: undefined, // 储值目标名称 amount: undefined, // 目标金额 + amountDeposited: undefined, // 已存入金额 duration: getCurrentMouthDate(), // 目标时长 startDuration: undefined, // 开始目标时长 endDuration: undefined, // 结束目标时长 @@ -50,10 +51,6 @@ export const useSavingGoalUserStore = defineStore('savingGoalUserStore', { // 整理请求参数 const data = { ...this.pagination, ...this.form }; - delete data.pageSizes; - delete data.total; - delete data.background; - delete data.duration; // 获取用户储值列表 const result = await fetchGetUserSavingGoalList(data); @@ -65,12 +62,14 @@ export const useSavingGoalUserStore = defineStore('savingGoalUserStore', { /** 添加用户储值 */ async addSavingGoal(data: any) { + data.amountDeposited = Number(data.amountDeposited) + Number(data.addAmount); const result = await fetchAddUserSavingGoal(data); return storeMessage(result); }, /** 修改用户储值 */ async updateSavingGoal(data: any) { + data.amountDeposited = Number(data.amountDeposited) + Number(data.addAmount); const result = await fetchUpdateUserSavingGoal(data); return storeMessage(result); }, diff --git a/src/views/financial-user/budget-saving/saving-goal/index.vue b/src/views/financial-user/budget-saving/saving-goal/index.vue index d885ad6..a8418dc 100644 --- a/src/views/financial-user/budget-saving/saving-goal/index.vue +++ b/src/views/financial-user/budget-saving/saving-goal/index.vue @@ -64,7 +64,15 @@ onMounted(() => { - + @@ -79,6 +87,16 @@ onMounted(() => { + + + + + { - {{ $t('search') }} + + {{ $t('search') }} + {{ $t('buttons.reset') }} @@ -153,7 +173,9 @@ onMounted(() => {