diff --git a/.env.development b/.env.development
index b57434a..bd0cc3d 100644
--- a/.env.development
+++ b/.env.development
@@ -1,5 +1,5 @@
# 平台本地运行端口号
-VITE_PORT=7000
+VITE_PORT=7700
# 预发布环境路由历史模式(Hash模式传"hash"、HTML5模式传"h5"、Hash模式带base参数传"hash,base参数"、HTML5模式带base参数传"h5,base参数")
VITE_ROUTER_HISTORY="hash"
diff --git a/src/enums/baseConstant.tsx b/src/enums/baseConstant.tsx
index 95edddd..91558e7 100644
--- a/src/enums/baseConstant.tsx
+++ b/src/enums/baseConstant.tsx
@@ -1,6 +1,5 @@
import { computed } from 'vue';
import { $t } from '@/plugins/i18n';
-import { ElTag } from 'element-plus';
/** 是否默认 */
export const isDefaultOptions = [
@@ -45,64 +44,6 @@ 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/enums/bill/budget.tsx b/src/enums/bill/budget.tsx
new file mode 100644
index 0000000..06ea31a
--- /dev/null
+++ b/src/enums/bill/budget.tsx
@@ -0,0 +1,60 @@
+// 预算状态类型
+import { $t } from '@/plugins/i18n';
+import { ElTag } from 'element-plus';
+
+export const budget = [
+ {
+ 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')}
+
+ ),
+ },
+];
diff --git a/src/enums/bill/savingGoal.tsx b/src/enums/bill/savingGoal.tsx
new file mode 100644
index 0000000..f6605ee
--- /dev/null
+++ b/src/enums/bill/savingGoal.tsx
@@ -0,0 +1,58 @@
+import { $t } from '@/plugins/i18n';
+
+export const savingGoal = [
+ {
+ 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: 'Pause',
+ label: $t('pause'),
+ el: () => (
+
+ {$t('pause')}
+
+ ),
+ },
+ {
+ value: 'Cancel',
+ label: $t('cancel'),
+ el: () => (
+
+ {$t('cancel')}
+
+ ),
+ },
+];
diff --git a/src/store/financial/savingGoal.ts b/src/store/financial/savingGoal.ts
index 9a39f3b..16e909f 100644
--- a/src/store/financial/savingGoal.ts
+++ b/src/store/financial/savingGoal.ts
@@ -14,16 +14,13 @@ export const useSavingGoalStore = defineStore('savingGoalStore', {
datalist: [],
// 查询表单
form: {
- // 绑定的用户id
- userId: undefined,
- // 完成状态
- statusType: undefined,
- // 储值目标名称
- savingGoalName: undefined,
- // 目标金额
- amount: undefined,
- // 目标时长
- duration: undefined,
+ userId: undefined, // 绑定的用户id
+ statusType: undefined, // 完成状态
+ savingGoalName: undefined, // 储值目标名称
+ amount: undefined, // 目标金额
+ duration: undefined, // 目标时长
+ startDuration: undefined, // 开始目标时长
+ endDuration: undefined, // 结束目标时长
},
// 分页查询结果
pagination: {
@@ -40,6 +37,10 @@ export const useSavingGoalStore = defineStore('savingGoalStore', {
actions: {
/** 获取用户储值 */
async getSavingGoalList() {
+ if (this.form.duration) {
+ this.form.startDuration = this.form.duration[0];
+ this.form.endDuration = this.form.duration[1];
+ }
// 整理请求参数
const data = { ...this.pagination, ...this.form };
delete data.pageSizes;
diff --git a/src/views/financial/budget-category/budget-category-dialog.vue b/src/views/financial/budget-category/budget-category-dialog.vue
index aa86c6c..7ce117e 100644
--- a/src/views/financial/budget-category/budget-category-dialog.vue
+++ b/src/views/financial/budget-category/budget-category-dialog.vue
@@ -6,8 +6,8 @@ import { FormProps } from '@/views/financial/budget-category/utils/types';
import { $t } from '@/plugins/i18n';
import LoadingSvg from '@/assets/svg/loading.svg';
import { useAdminUserStore } from '@/store/system/adminUser';
-import { budgetStateType } from '@/enums/baseConstant';
import { fetchGetAllParentList } from '@/api/v1/financial/budgetCategory';
+import { budget } from '@/enums/bill/budget';
const props = withDefaults(defineProps(), {
formInline: () => ({
@@ -114,7 +114,7 @@ defineExpose({ formRef });
-
+
diff --git a/src/views/financial/budget-category/index.vue b/src/views/financial/budget-category/index.vue
index 385cb98..be5cd47 100644
--- a/src/views/financial/budget-category/index.vue
+++ b/src/views/financial/budget-category/index.vue
@@ -15,7 +15,7 @@ import { useRenderIcon } from '@/components/CommonIcon/src/hooks';
import { FormInstance } from 'element-plus';
import { useAdminUserStore } from '@/store/system/adminUser';
import LoadingSvg from '@/assets/svg/loading.svg';
-import { budgetStateType } from '@/enums/baseConstant';
+import { budget } from '@/enums/bill/budget';
import { handleTree } from '@pureadmin/utils';
const tableRef = ref();
@@ -113,7 +113,7 @@ onMounted(() => {
remote
remote-show-suffix
>
-
+
@@ -145,7 +145,7 @@ onMounted(() => {
:columns="columns"
:isExpandAll="true"
:tableRef="tableRef?.getTableRef()"
- title="预算分类"
+ :title="$t('budgetCategory')"
@fullscreen="tableRef.setAdaptive()"
@refresh="onSearch"
>
@@ -181,7 +181,7 @@ onMounted(() => {
@page-current-change="onCurrentPageChange"
>
-
+
diff --git a/src/views/financial/category/index.vue b/src/views/financial/category/index.vue
index f464253..18064c0 100644
--- a/src/views/financial/category/index.vue
+++ b/src/views/financial/category/index.vue
@@ -110,7 +110,7 @@ onMounted(() => {
-
+
{{ $t('addNew') }}
diff --git a/src/views/financial/debt-repayment-plan/index.vue b/src/views/financial/debt-repayment-plan/index.vue
index 50affe0..4b08952 100644
--- a/src/views/financial/debt-repayment-plan/index.vue
+++ b/src/views/financial/debt-repayment-plan/index.vue
@@ -12,6 +12,7 @@ import { $t } from '@/plugins/i18n';
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';
const tableRef = ref();
const formRef = ref();
@@ -81,7 +82,7 @@ onMounted(() => {
-
+
{{ $t('addNew') }}
@@ -112,6 +113,18 @@ onMounted(() => {
@selection-change="onSelectionChange"
@page-current-change="onCurrentPageChange"
>
+
+
+ {{ row.createUsername }}
+
+
+
+
+
+ {{ row.updateUsername }}
+
+
+
{{ $t('modify') }}
{{ $t('addNew') }}
diff --git a/src/views/financial/debt-repayment-plan/utils/columns.ts b/src/views/financial/debt-repayment-plan/utils/columns.ts
index f085dc6..6bc08d1 100644
--- a/src/views/financial/debt-repayment-plan/utils/columns.ts
+++ b/src/views/financial/debt-repayment-plan/utils/columns.ts
@@ -20,6 +20,8 @@ export const columns: TableColumnList = [
{ label: $t('paymentStatus'), prop: 'paymentStatus' },
{ label: $t('table.updateTime'), prop: 'updateTime', sortable: true, width: 160 },
{ label: $t('table.createTime'), prop: 'createTime', sortable: true, width: 160 },
+ { 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/debt-repayment-plan/utils/hooks.ts b/src/views/financial/debt-repayment-plan/utils/hooks.ts
index 76117d1..ac83d27 100644
--- a/src/views/financial/debt-repayment-plan/utils/hooks.ts
+++ b/src/views/financial/debt-repayment-plan/utils/hooks.ts
@@ -54,7 +54,7 @@ export function onAdd() {
/** 更新债务还款计划表 */
export function onUpdate(row: any) {
addDialog({
- title: `${$t('modify')}${$t('debt-repayment-plan')}`,
+ title: `${$t('modify')}${$t('debtRepaymentPlan')}`,
width: '30%',
props: {
formInline: {
diff --git a/src/views/financial/debt-tracking/index.vue b/src/views/financial/debt-tracking/index.vue
index 7f2ca25..181b45b 100644
--- a/src/views/financial/debt-tracking/index.vue
+++ b/src/views/financial/debt-tracking/index.vue
@@ -12,6 +12,7 @@ import { $t } from '@/plugins/i18n';
import { useDebtTrackingStore } from '@/store/financial/debtTracking';
import { useRenderIcon } from '@/components/CommonIcon/src/hooks';
import { FormInstance } from 'element-plus';
+import { selectUserinfo } from '@/components/Table/Userinfo/columns';
const tableRef = ref();
const formRef = ref();
@@ -84,7 +85,7 @@ onMounted(() => {
-
+
{{ $t('addNew') }}
@@ -115,6 +116,18 @@ onMounted(() => {
@selection-change="onSelectionChange"
@page-current-change="onCurrentPageChange"
>
+
+
+ {{ row.createUsername }}
+
+
+
+
+
+ {{ row.updateUsername }}
+
+
+
{{ $t('modify') }}
{{ $t('addNew') }}
diff --git a/src/views/financial/debt-tracking/utils/columns.ts b/src/views/financial/debt-tracking/utils/columns.ts
index a9d6d9e..c5c6500 100644
--- a/src/views/financial/debt-tracking/utils/columns.ts
+++ b/src/views/financial/debt-tracking/utils/columns.ts
@@ -20,6 +20,8 @@ export const columns: TableColumnList = [
{ label: $t('dueDate'), prop: 'dueDate' },
{ label: $t('table.updateTime'), prop: 'updateTime', sortable: true, width: 160 },
{ label: $t('table.createTime'), prop: 'createTime', sortable: true, width: 160 },
+ { 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/debt-tracking/utils/hooks.ts b/src/views/financial/debt-tracking/utils/hooks.ts
index 3c7b752..7a60a27 100644
--- a/src/views/financial/debt-tracking/utils/hooks.ts
+++ b/src/views/financial/debt-tracking/utils/hooks.ts
@@ -22,7 +22,7 @@ export async function onSearch() {
/** 添加债务追踪 */
export function onAdd() {
addDialog({
- title: `${$t('addNew')}${$t('debt-tracking')}`,
+ title: `${$t('addNew')}${$t('debtTracking')}`,
width: '30%',
props: {
formInline: {
diff --git a/src/views/financial/saving-goal/index.vue b/src/views/financial/saving-goal/index.vue
index 3518af7..d5b4a64 100644
--- a/src/views/financial/saving-goal/index.vue
+++ b/src/views/financial/saving-goal/index.vue
@@ -12,9 +12,19 @@ import { $t } from '@/plugins/i18n';
import { useSavingGoalStore } from '@/store/financial/savingGoal';
import { useRenderIcon } from '@/components/CommonIcon/src/hooks';
import { FormInstance } from 'element-plus';
+import { useAdminUserStore } from '@/store/system/adminUser';
+import LoadingSvg from '@/assets/svg/loading.svg';
+import { budget } from '@/enums/bill/budget';
+import { selectUserinfo } from '@/components/Table/Userinfo/columns';
+import { savingGoal } from '@/enums/bill/savingGoal';
const tableRef = ref();
const formRef = ref();
+// 用户信息列表
+const userDataList = ref();
+// 搜索用户加载
+const loading = ref(false);
+const adminUserStore = useAdminUserStore();
const savingGoalStore = useSavingGoalStore();
/** 当前页改变时 */
@@ -34,10 +44,20 @@ const onSelectionChange = (rows: Array) => {
deleteIds.value = rows.map((row: any) => row.id);
};
+/** 搜索 */
+const onSearchUserinfo = async (keyword: string) => {
+ loading.value = true;
+ userDataList.value = await adminUserStore.queryUser({ keyword });
+ loading.value = false;
+};
+
/** 重置表单 */
const resetForm = async (formEl: FormInstance | undefined) => {
if (!formEl) return;
formEl.resetFields();
+ savingGoalStore.form.duration = undefined;
+ savingGoalStore.form.startDuration = undefined;
+ savingGoalStore.form.endDuration = undefined;
await onSearch();
};
@@ -50,13 +70,32 @@ onMounted(() => {
-
-
+
+
+
+
+
+
+
+
+
-
+
+
+
@@ -71,15 +110,25 @@ onMounted(() => {
-
+
+
+
{{ $t('search') }}
{{ $t('buttons.reset') }}
-
+
{{ $t('addNew') }}
@@ -110,9 +159,30 @@ onMounted(() => {
@selection-change="onSelectionChange"
@page-current-change="onCurrentPageChange"
>
+
+
+
+
+
+
+ {{ row.username }}
+
+
+
+
+
+ {{ row.createUsername }}
+
+
+
+
+
+ {{ row.updateUsername }}
+
+
+
{{ $t('modify') }}
- {{ $t('addNew') }}
diff --git a/src/views/financial/saving-goal/saving-goal-dialog.vue b/src/views/financial/saving-goal/saving-goal-dialog.vue
index 3183f44..5321291 100644
--- a/src/views/financial/saving-goal/saving-goal-dialog.vue
+++ b/src/views/financial/saving-goal/saving-goal-dialog.vue
@@ -1,9 +1,12 @@
@@ -29,13 +48,31 @@ defineExpose({ formRef });
-
-
+
+
+
+
+
+
+
+
+
-
+
+
+
@@ -45,12 +82,19 @@ defineExpose({ formRef });
-
+
-
+
diff --git a/src/views/financial/saving-goal/utils/columns.ts b/src/views/financial/saving-goal/utils/columns.tsx
similarity index 58%
rename from src/views/financial/saving-goal/utils/columns.ts
rename to src/views/financial/saving-goal/utils/columns.tsx
index 828378c..dc011d3 100644
--- a/src/views/financial/saving-goal/utils/columns.ts
+++ b/src/views/financial/saving-goal/utils/columns.tsx
@@ -1,24 +1,49 @@
import { reactive } from 'vue';
import { $t } from '@/plugins/i18n';
import type { FormRules } from 'element-plus';
+import { ElText } from 'element-plus';
// 表格列
export const columns: TableColumnList = [
{ type: 'selection', align: 'left' },
{ type: 'index', index: (index: number) => index + 1, label: '序号', width: 60 },
- // 绑定的用户id
- { label: $t('userId'), prop: 'userId' },
// 完成状态
- { label: $t('statusType'), prop: 'statusType' },
+ { label: $t('statusType'), prop: 'statusType', slot: 'statusType' },
// 储值目标名称
{ label: $t('savingGoalName'), prop: 'savingGoalName' },
- // 目标金额
- { label: $t('amount'), prop: 'amount' },
+ // 预算金额
+ {
+ label: $t('amount'),
+ prop: 'amount',
+ width: 150,
+ formatter({ amount }) {
+ return (
+
+ {amount}¥
+
+ );
+ },
+ },
// 目标时长
- { label: $t('duration'), prop: 'duration' },
+ {
+ label: $t('duration'),
+ prop: 'duration',
+ formatter({ startDuration, endDuration }) {
+ return (
+
+ {startDuration} ~ {endDuration}
+
+ );
+ },
+ width: 360,
+ },
{ label: $t('table.updateTime'), prop: 'updateTime', sortable: true, width: 160 },
{ label: $t('table.createTime'), prop: 'createTime', sortable: true, width: 160 },
- { label: $t('table.operation'), fixed: 'right', width: 210, slot: 'operation' },
+ // 绑定的用户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/saving-goal/utils/hooks.ts b/src/views/financial/saving-goal/utils/hooks.ts
index 4c371b7..31879ef 100644
--- a/src/views/financial/saving-goal/utils/hooks.ts
+++ b/src/views/financial/saving-goal/utils/hooks.ts
@@ -22,7 +22,7 @@ export async function onSearch() {
/** 添加用户储值 */
export function onAdd() {
addDialog({
- title: `${$t('addNew')}${$t('saving-goal')}`,
+ title: `${$t('addNew')}${$t('savingGoal')}`,
width: '30%',
props: {
formInline: {
@@ -42,6 +42,10 @@ export function onAdd() {
formRef.value.formRef.validate(async (valid: any) => {
if (!valid) return;
+ // 格式化开始时间和结束时间
+ form.startDuration = form.duration[0];
+ form.endDuration = form.duration[1];
+
const result = await savingGoalStore.addSavingGoal(form);
if (!result) return;
done();
@@ -54,7 +58,7 @@ export function onAdd() {
/** 更新用户储值 */
export function onUpdate(row: any) {
addDialog({
- title: `${$t('modify')}${$t('saving-goal')}`,
+ title: `${$t('modify')}${$t('savingGoal')}`,
width: '30%',
props: {
formInline: {
@@ -62,7 +66,7 @@ export function onUpdate(row: any) {
statusType: row.statusType,
savingGoalName: row.savingGoalName,
amount: row.amount,
- duration: row.duration,
+ duration: [row.startDuration, row.endDuration],
},
},
draggable: true,
@@ -74,6 +78,10 @@ export function onUpdate(row: any) {
formRef.value.formRef.validate(async (valid: any) => {
if (!valid) return;
+ // 格式化开始时间和结束时间
+ form.startDuration = form.duration[0];
+ form.endDuration = form.duration[1];
+
const result = await savingGoalStore.updateSavingGoal({ ...form, id: row.id });
if (!result) return;
done();
diff --git a/src/views/financial/saving-goal/utils/types.ts b/src/views/financial/saving-goal/utils/types.ts
index 173ce4b..cfda985 100644
--- a/src/views/financial/saving-goal/utils/types.ts
+++ b/src/views/financial/saving-goal/utils/types.ts
@@ -10,6 +10,10 @@ export interface FormItemProps {
amount: any;
// 目标时长
duration: string;
+ // 开始目标时长
+ startDuration: string;
+ // 结束目标时长
+ endDuration: string;
}
// 添加或修改表单Props