From a647bfea44a5f0b60ff6107c755c1521b6ff79f5 Mon Sep 17 00:00:00 2001 From: Bunny <1319900154@qq.com> Date: Wed, 13 Nov 2024 17:28:19 +0800 Subject: [PATCH] =?UTF-8?q?completepage:=20=F0=9F=8D=BB=20=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E7=AB=AF=E9=A2=84=E7=AE=97=E5=88=86=E7=B1=BB=E5=AE=8C?= =?UTF-8?q?=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/v1/financial/budgetCategory.ts | 5 + src/api/v1/financialUser/billUser.ts | 8 +- .../{baseConstant.ts => baseConstant.tsx} | 59 ++++++++++++ src/store/financial/budgetCategory.ts | 8 ++ .../bill-user/utils/columns.tsx | 4 +- .../budget-category-dialog.vue | 82 +++++++++++++++- src/views/financial/budget-category/index.vue | 93 +++++++++++++++++-- .../utils/{columns.ts => columns.tsx} | 36 +++++-- .../financial/budget-category/utils/hooks.ts | 25 +++-- .../financial/budget-category/utils/types.ts | 4 +- .../debt-repayment-plan-dialog.vue | 37 +++++++- .../financial/debt-repayment-plan/index.vue | 5 - .../debt-repayment-plan/utils/columns.ts | 6 +- .../debt-repayment-plan/utils/hooks.ts | 2 - .../debt-repayment-plan/utils/types.ts | 4 +- src/views/system/dept/index.vue | 17 +++- 16 files changed, 343 insertions(+), 52 deletions(-) rename src/enums/{baseConstant.ts => baseConstant.tsx} (60%) rename src/views/financial/budget-category/utils/{columns.ts => columns.tsx} (66%) 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(() => {