From 2a8aca1642f66e2fd950fed50dc369e4951eb173 Mon Sep 17 00:00:00 2001 From: Bunny <1319900154@qq.com> Date: Fri, 15 Nov 2024 18:03:56 +0800 Subject: [PATCH] =?UTF-8?q?completepage:=20=F0=9F=8D=BB=20=E5=80=BA?= =?UTF-8?q?=E5=8A=A1=E8=AE=A1=E5=88=92=E5=92=8C=E8=BF=98=E6=AC=BE=E8=AE=A1?= =?UTF-8?q?=E5=88=92=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 4 +- docker/nginx.conf | 2 +- src/enums/bill/debtTracking.tsx | 151 ++++++++++++++++++ src/enums/bill/savingGoal.tsx | 1 + src/store/financial/debtRepaymentPlan.ts | 2 + src/utils/date.ts | 5 + src/views/financial/bill/bill-dialog.vue | 3 +- src/views/financial/bill/index.vue | 1 + src/views/financial/bill/utils/columns.tsx | 20 ++- src/views/financial/budget-category/index.vue | 7 +- .../budget-category/utils/columns.tsx | 4 +- .../financial/category/utils/columns.tsx | 4 +- .../debt-repayment-plan-dialog.vue | 38 +++-- .../financial/debt-repayment-plan/index.vue | 71 +++++++- .../utils/{columns.ts => columns.tsx} | 62 +++++-- .../debt-repayment-plan/utils/hooks.ts | 2 +- .../debt-repayment-plan/utils/types.ts | 2 +- .../debt-tracking/debt-tracking-dialog.vue | 61 ++++++- src/views/financial/debt-tracking/index.vue | 70 +++++++- .../utils/{columns.ts => columns.tsx} | 37 ++++- .../financial/debt-tracking/utils/hooks.ts | 2 +- src/views/financial/saving-goal/index.vue | 6 +- .../saving-goal/saving-goal-dialog.vue | 2 +- 23 files changed, 489 insertions(+), 68 deletions(-) create mode 100644 src/enums/bill/debtTracking.tsx rename src/views/financial/debt-repayment-plan/utils/{columns.ts => columns.tsx} (54%) rename src/views/financial/debt-tracking/utils/{columns.ts => columns.tsx} (68%) diff --git a/.env.development b/.env.development index bd0cc3d..c61e5b8 100644 --- a/.env.development +++ b/.env.development @@ -1,5 +1,5 @@ # 平台本地运行端口号 -VITE_PORT=7700 +VITE_PORT=1010 # 预发布环境路由历史模式(Hash模式传"hash"、HTML5模式传"h5"、Hash模式带base参数传"hash,base参数"、HTML5模式带base参数传"h5,base参数") VITE_ROUTER_HISTORY="hash" @@ -8,7 +8,7 @@ VITE_ROUTER_HISTORY="hash" VITE_BASE_API=/api # 跨域代理地址 -VITE_APP_URL=http://localhost:7070 +VITE_APP_URL=http://localhost:1000 # mock地址 VITE_MOCK_BASE_API=/mock diff --git a/docker/nginx.conf b/docker/nginx.conf index 951a0e5..7eb103a 100644 --- a/docker/nginx.conf +++ b/docker/nginx.conf @@ -16,7 +16,7 @@ server { # 后端跨域请求 location ~/admin/ { - proxy_pass http://172.17.0.1:7070; + proxy_pass http://172.17.0.1:1000; proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; diff --git a/src/enums/bill/debtTracking.tsx b/src/enums/bill/debtTracking.tsx new file mode 100644 index 0000000..bd8a502 --- /dev/null +++ b/src/enums/bill/debtTracking.tsx @@ -0,0 +1,151 @@ +import { $t } from '@/plugins/i18n'; +import { ElTag } from 'element-plus'; + +export const debtType = [ + // 信用卡债务 + { + value: 'CreditCardDebt', + label: $t('creditCardDebt'), + el: () => ( + + {$t('creditCardDebt')} + + ), + }, + // 贷款债务 + { + value: 'LoanDebt', + label: $t('loanDebt'), + el: () => ( + + {$t('loanDebt')} + + ), + }, + // 抵押债务 + { + value: 'MortgageDebt', + label: $t('mortgageDebt'), + el: () => ( + + {$t('mortgageDebt')} + + ), + }, + // 学生贷款 + { + value: 'StudentLoans', + label: $t('studentLoans'), + el: () => ( + + {$t('studentLoans')} + + ), + }, + // 医疗债务 + { + value: 'MedicalDebt', + label: $t('medicalDebt'), + el: () => ( + + {$t('medicalDebt')} + + ), + }, + // 透支债务 + { + value: 'OverdraftDebt', + label: $t('overdraftDebt'), + el: () => ( + + {$t('overdraftDebt')} + + ), + }, + // 私人借款 + { + value: 'PrivateBorrowing', + label: $t('privateBorrowing'), + el: () => ( + + {$t('privateBorrowing')} + + ), + }, + // 其他债务 + { + value: 'OtherDebts', + label: $t('otherDebts'), + el: () => ( + + {$t('otherDebts')} + + ), + }, +]; + +export const debtTracking = [ + { + value: 'InProgress', + label: $t('inProgress'), + el: () => ( + + {$t('inProgress')} + + ), + }, + { + value: 'Uncompleted', + label: $t('uncompleted'), + el: () => ( + + {$t('uncompleted')} + + ), + }, + { + value: 'Completed', + label: $t('completed'), + el: () => ( + + {$t('completed')} + + ), + }, + { + value: 'NotStarted', + label: $t('notStarted'), + el: () => ( + + {$t('notStarted')} + + ), + }, + { + value: 'OverSpending', + label: $t('overSpending'), + el: () => ( + + {$t('overSpending')} + + ), + }, + { + value: 'Pause', + label: $t('pause'), + el: () => ( + + {$t('pause')} + + ), + }, + { + value: 'Cancel', + label: $t('cancel'), + el: () => ( + + {$t('cancel')} + + ), + }, +]; diff --git a/src/enums/bill/savingGoal.tsx b/src/enums/bill/savingGoal.tsx index f6605ee..5bfe515 100644 --- a/src/enums/bill/savingGoal.tsx +++ b/src/enums/bill/savingGoal.tsx @@ -1,4 +1,5 @@ import { $t } from '@/plugins/i18n'; +import { ElTag } from 'element-plus'; export const savingGoal = [ { diff --git a/src/store/financial/debtRepaymentPlan.ts b/src/store/financial/debtRepaymentPlan.ts index 8de4d52..59b3356 100644 --- a/src/store/financial/debtRepaymentPlan.ts +++ b/src/store/financial/debtRepaymentPlan.ts @@ -19,6 +19,8 @@ export const useDebtRepaymentPlanStore = defineStore('debtRepaymentPlanStore', { datalist: [], // 查询表单 form: { + // 用户Id + userId: undefined, // 债务ID debtId: undefined, // 债务金额 diff --git a/src/utils/date.ts b/src/utils/date.ts index e34768e..4417828 100644 --- a/src/utils/date.ts +++ b/src/utils/date.ts @@ -14,3 +14,8 @@ export const getDefaultDateRange = (start = 1, end = 7) => { return [dayjs(startDate).format('YYYY-MM-DD'), dayjs(endDate).format('YYYY-MM-DD')]; }; + +/** 格式化日期 */ +export const dateformat = (date: any) => { + return dayjs(date).format('YYYY-MM-DD HH:mm:ss'); +}; diff --git a/src/views/financial/bill/bill-dialog.vue b/src/views/financial/bill/bill-dialog.vue index eb16aa9..89431c6 100644 --- a/src/views/financial/bill/bill-dialog.vue +++ b/src/views/financial/bill/bill-dialog.vue @@ -102,7 +102,8 @@ defineExpose({ formRef }); diff --git a/src/views/financial/bill/index.vue b/src/views/financial/bill/index.vue index 647e89a..e5666c9 100644 --- a/src/views/financial/bill/index.vue +++ b/src/views/financial/bill/index.vue @@ -108,6 +108,7 @@ onMounted(() => { v-model="billStore.form.date" :end-placeholder="$t('endDate')" :start-placeholder="$t('startDate')" + class="!w-[210px]" clearable type="daterange" value-format="YYYY-MM-DD" diff --git a/src/views/financial/bill/utils/columns.tsx b/src/views/financial/bill/utils/columns.tsx index d6f9604..329828c 100644 --- a/src/views/financial/bill/utils/columns.tsx +++ b/src/views/financial/bill/utils/columns.tsx @@ -33,14 +33,26 @@ export const columns: TableColumnList = [ return {categoryName}; }, }, - // 交易日期 - { label: $t('transactionDate'), prop: 'transactionDate', width: 160 }, // 描述 { label: $t('description'), prop: 'description' }, - // 用户名 - { label: $t('username'), prop: 'username', slot: 'username', width: 130 }, + // 交易日期 + { + label: $t('transactionDate'), + prop: 'transactionDate', + width: 190, + sortable: true, + formatter({ transactionDate }) { + return ( + + {transactionDate} + + ); + }, + }, { label: $t('table.updateTime'), prop: 'updateTime', sortable: true, width: 160 }, { label: $t('table.createTime'), prop: 'createTime', sortable: true, width: 160 }, + // 用户名 + { label: $t('username'), prop: 'username', slot: 'username', width: 130 }, { label: $t('table.createUser'), prop: 'createUser', slot: 'createUser', width: 130 }, { label: $t('table.updateUser'), prop: 'updateUser', slot: 'updateUser', width: 130 }, { label: $t('table.operation'), fixed: 'right', width: 210, slot: 'operation' }, diff --git a/src/views/financial/budget-category/index.vue b/src/views/financial/budget-category/index.vue index be5cd47..f903a48 100644 --- a/src/views/financial/budget-category/index.vue +++ b/src/views/financial/budget-category/index.vue @@ -128,9 +128,10 @@ onMounted(() => { v-model="budgetCategoryStore.form.period" :end-placeholder="$t('endTime')" :start-placeholder="$t('startTime')" - time-format="YYYY-MM-DD HH:mm:ss" - type="datetimerange" - value-format="YYYY-MM-DD HH:mm:ss" + class="!w-[210px]" + time-format="YYYY-MM-DD" + type="daterange" + value-format="YYYY-MM-DD" /> diff --git a/src/views/financial/budget-category/utils/columns.tsx b/src/views/financial/budget-category/utils/columns.tsx index 06bc052..189e41e 100644 --- a/src/views/financial/budget-category/utils/columns.tsx +++ b/src/views/financial/budget-category/utils/columns.tsx @@ -8,8 +8,6 @@ export const columns: TableColumnList = [ { type: 'index', index: (index: number) => index + 1, label: '序号', width: 60 }, // 分类名称 { label: $t('categoryName'), prop: 'categoryName' }, - // 绑定的用户id - { label: $t('username'), prop: 'username', slot: 'username' }, // 预算名称 { label: $t('budgetName'), prop: 'budgetName' }, // 完成状态 @@ -42,6 +40,8 @@ export const columns: TableColumnList = [ }, { label: $t('table.updateTime'), prop: 'updateTime', sortable: true, width: 160 }, { label: $t('table.createTime'), prop: 'createTime', sortable: true, width: 160 }, + // 绑定的用户id + { label: $t('username'), prop: 'username', slot: 'username', width: 130 }, { label: $t('table.createUser'), prop: 'createUser', slot: 'createUser', width: 130 }, { label: $t('table.updateUser'), prop: 'updateUser', slot: 'updateUser', width: 130 }, { label: $t('table.operation'), fixed: 'right', width: 210, slot: 'operation' }, diff --git a/src/views/financial/category/utils/columns.tsx b/src/views/financial/category/utils/columns.tsx index 604a86a..8cfe857 100644 --- a/src/views/financial/category/utils/columns.tsx +++ b/src/views/financial/category/utils/columns.tsx @@ -6,14 +6,14 @@ import type { FormRules } from 'element-plus'; export const columns: TableColumnList = [ { type: 'selection', align: 'left' }, { type: 'index', index: (index: number) => index + 1, label: '序号', width: 60 }, - // 绑定的用户id - { label: $t('username'), prop: 'username', slot: 'username' }, // 分类名称 { label: $t('categoryName'), prop: 'categoryName', slot: 'categoryName' }, // 是否内置字段 { label: $t('isBuiltin'), prop: 'isBuiltin', slot: 'isBuiltin' }, { label: $t('table.updateTime'), prop: 'updateTime', sortable: true, width: 160 }, { label: $t('table.createTime'), prop: 'createTime', sortable: true, width: 160 }, + // 绑定的用户id + { label: $t('username'), prop: 'username', slot: 'username', width: 130 }, { label: $t('table.createUser'), prop: 'createUser', slot: 'createUser', width: 130 }, { label: $t('table.updateUser'), prop: 'updateUser', slot: 'updateUser', width: 130 }, { label: $t('table.operation'), fixed: 'right', width: 160, slot: 'operation' }, diff --git a/src/views/financial/debt-repayment-plan/debt-repayment-plan-dialog.vue b/src/views/financial/debt-repayment-plan/debt-repayment-plan-dialog.vue index bb5087d..d23b5f9 100644 --- a/src/views/financial/debt-repayment-plan/debt-repayment-plan-dialog.vue +++ b/src/views/financial/debt-repayment-plan/debt-repayment-plan-dialog.vue @@ -5,6 +5,8 @@ import { rules } from '@/views/financial/debt-repayment-plan/utils/columns'; import { FormProps } from '@/views/financial/debt-repayment-plan/utils/types'; import { $t } from '@/plugins/i18n'; import LoadingSvg from '@/assets/svg/loading.svg'; +import { debtTracking } from '@/enums/bill/debtTracking'; +import { useAdminUserStore } from '@/store/system/adminUser'; const props = withDefaults(defineProps(), { formInline: () => ({ @@ -23,12 +25,11 @@ const props = withDefaults(defineProps(), { const formRef = ref(); const form = ref(props.formInline); -// 用户是否停用样式 -const { switchStyle } = usePublicHooks(); // 用户信息列表 const userDataList = ref(); // 搜索用户加载 const loading = ref(false); +const adminUserStore = useAdminUserStore(); /** 搜索 */ const onSearchUserinfo = async (keyword: string) => { @@ -42,11 +43,6 @@ defineExpose({ formRef }); diff --git a/src/views/financial/debt-repayment-plan/index.vue b/src/views/financial/debt-repayment-plan/index.vue index 4b08952..957b030 100644 --- a/src/views/financial/debt-repayment-plan/index.vue +++ b/src/views/financial/debt-repayment-plan/index.vue @@ -13,9 +13,17 @@ import { useDebtRepaymentPlanStore } from '@/store/financial/debtRepaymentPlan'; import { useRenderIcon } from '@/components/CommonIcon/src/hooks'; import { FormInstance } from 'element-plus'; import { selectUserinfo } from '@/components/Table/Userinfo/columns'; +import LoadingSvg from '@/assets/svg/loading.svg'; +import { useAdminUserStore } from '@/store/system/adminUser'; +import { debtTracking } from '@/enums/bill/debtTracking'; const tableRef = ref(); const formRef = ref(); +// 用户信息列表 +const userDataList = ref(); +// 搜索用户加载 +const loading = ref(false); +const adminUserStore = useAdminUserStore(); const debtRepaymentPlanStore = useDebtRepaymentPlanStore(); /** 当前页改变时 */ @@ -42,6 +50,13 @@ const resetForm = async (formEl: FormInstance | undefined) => { await onSearch(); }; +/** 搜索 */ +const onSearchUserinfo = async (keyword: string) => { + loading.value = true; + userDataList.value = await adminUserStore.queryUser({ keyword }); + loading.value = false; +}; + onMounted(() => { onSearch(); }); @@ -50,6 +65,28 @@ onMounted(() => {