diff --git a/src/api/v1/financial/budgetCategory.ts b/src/api/v1/financial/budgetCategory.ts index cd6dbff..d4bece2 100644 --- a/src/api/v1/financial/budgetCategory.ts +++ b/src/api/v1/financial/budgetCategory.ts @@ -6,6 +6,11 @@ export const fetchGetBudgetCategoryList = (data: any) => { return http.request>('get', `budgetCategory/getBudgetCategoryList/${data.currentPage}/${data.pageSize}`, { params: data }); }; +/** 预算分类表---添加预算分类表 */ +export const fetchGetAllParentList = () => { + return http.request>('get', 'budgetCategory/noManage/getAllParentList'); +}; + /** 预算分类表---添加预算分类表 */ export const fetchAddBudgetCategory = (data: any) => { return http.request>('post', 'budgetCategory/addBudgetCategory', { data }); diff --git a/src/api/v1/financialUser/billUser.ts b/src/api/v1/financialUser/billUser.ts index 96ead02..2099bdc 100644 --- a/src/api/v1/financialUser/billUser.ts +++ b/src/api/v1/financialUser/billUser.ts @@ -5,20 +5,20 @@ import type { BaseResult, ResultTable } from '@/api/service/types'; export const fetchGetBillList = (data: any) => { // 删除这个请求参数 delete data.date; - return http.request>('get', `bill/noManage/getBillList/${data.currentPage}/${data.pageSize}`, { params: data }); + return http.request>('get', `bill/noManage/getUserBillList/${data.currentPage}/${data.pageSize}`, { params: data }); }; /** 账单信息---添加账单信息 */ export const fetchAddBill = (data: any) => { - return http.request>('post', 'bill/noManage/addBill', { data }); + return http.request>('post', 'bill/noManage/addUserBill', { data }); }; /** 账单信息---更新账单信息 */ export const fetchUpdateBill = (data: any) => { - return http.request>('put', 'bill/noManage/updateBill', { data }); + return http.request>('put', 'bill/noManage/updateUserBill', { data }); }; /** 账单信息---删除账单信息 */ export const fetchDeleteBill = (data: any) => { - return http.request>('delete', 'bill/noManage/deleteBill', { data }); + return http.request>('delete', 'bill/noManage/deleteUserBill', { data }); }; diff --git a/src/enums/baseConstant.ts b/src/enums/baseConstant.tsx similarity index 60% rename from src/enums/baseConstant.ts rename to src/enums/baseConstant.tsx index 91558e7..95edddd 100644 --- a/src/enums/baseConstant.ts +++ b/src/enums/baseConstant.tsx @@ -1,5 +1,6 @@ import { computed } from 'vue'; import { $t } from '@/plugins/i18n'; +import { ElTag } from 'element-plus'; /** 是否默认 */ export const isDefaultOptions = [ @@ -44,6 +45,64 @@ export const incomeOrExpend = [ { value: -1, label: $t('expend') }, ]; +// 预算状态类型 +export const budgetStateType = [ + { + value: 'InProgress', + label: $t('inProgress'), + el: ( + + {$t('inProgress')} + + ), + }, + { + value: 'Completed', + label: $t('completed'), + el: ( + + {$t('completed')} + + ), + }, + { + value: 'OverSpending', + label: $t('overSpending'), + el: ( + + {$t('overSpending')} + + ), + }, + { + value: 'NotStarted', + label: $t('notStarted'), + el: ( + + {$t('notStarted')} + + ), + }, + { + value: 'Pause', + label: $t('pause'), + el: ( + + {$t('pause')} + + ), + }, + { + value: 'Cancel', + label: $t('cancel'), + el: ( + + {$t('cancel')} + + ), + }, +]; + /** 分页默认数组个数 */ export const pageSizes: number[] = [15, 30, 50, 100, 150]; export const tableSelectButtonClass = computed(() => ['!h-[20px]', 'reset-margin', '!text-gray-500', 'dark:!text-white', 'dark:hover:!text-primary']); diff --git a/src/store/financial/budgetCategory.ts b/src/store/financial/budgetCategory.ts index 93e7fc4..22231df 100644 --- a/src/store/financial/budgetCategory.ts +++ b/src/store/financial/budgetCategory.ts @@ -28,6 +28,10 @@ export const useBudgetCategoryStore = defineStore('budgetCategoryStore', { amount: undefined, // 预算周期 period: undefined, + // 开始预算时间 + startPeriod: undefined, + // 结束预算时间 + endPeriod: undefined, }, // 分页查询结果 pagination: { @@ -44,6 +48,10 @@ export const useBudgetCategoryStore = defineStore('budgetCategoryStore', { actions: { /** 获取预算分类表 */ async getBudgetCategoryList() { + if (this.form.period) { + this.form.startPeriod = this.form.period[0]; + this.form.endPeriod = this.form.period[1]; + } // 整理请求参数 const data = { ...this.pagination, ...this.form }; delete data.pageSizes; diff --git a/src/views/financial-user/bill-user/utils/columns.tsx b/src/views/financial-user/bill-user/utils/columns.tsx index b9c647b..61afba7 100644 --- a/src/views/financial-user/bill-user/utils/columns.tsx +++ b/src/views/financial-user/bill-user/utils/columns.tsx @@ -14,11 +14,11 @@ export const columns: TableColumnList = [ formatter({ type, amount }) { return type === -1 ? ( - - {amount} + - {amount}¥ ) : ( - + {amount} + + {amount}¥ ); }, diff --git a/src/views/financial/budget-category/budget-category-dialog.vue b/src/views/financial/budget-category/budget-category-dialog.vue index b0c8dc3..5eabbb8 100644 --- a/src/views/financial/budget-category/budget-category-dialog.vue +++ b/src/views/financial/budget-category/budget-category-dialog.vue @@ -1,9 +1,13 @@ @@ -34,7 +64,40 @@ defineExpose({ formRef }); - + + + + + + + + + + + @@ -49,17 +112,26 @@ defineExpose({ formRef }); - + + + - + - + diff --git a/src/views/financial/budget-category/index.vue b/src/views/financial/budget-category/index.vue index 6bf9b78..a39536f 100644 --- a/src/views/financial/budget-category/index.vue +++ b/src/views/financial/budget-category/index.vue @@ -1,5 +1,5 @@ @@ -35,6 +47,27 @@ defineExpose({ formRef }); + + + + + + + + diff --git a/src/views/financial/debt-repayment-plan/index.vue b/src/views/financial/debt-repayment-plan/index.vue index 892ba48..50affe0 100644 --- a/src/views/financial/debt-repayment-plan/index.vue +++ b/src/views/financial/debt-repayment-plan/index.vue @@ -49,11 +49,6 @@ onMounted(() => {