diff --git a/src/layout/components/lay-bill/index.vue b/src/layout/components/lay-bill/index.vue
index 7ac0c3c..eb7e383 100644
--- a/src/layout/components/lay-bill/index.vue
+++ b/src/layout/components/lay-bill/index.vue
@@ -1,5 +1,5 @@
diff --git a/src/router/modules/bill.ts b/src/router/modules/bill.ts
index a77b265..cc01b2a 100644
--- a/src/router/modules/bill.ts
+++ b/src/router/modules/bill.ts
@@ -6,14 +6,14 @@ export default [
redirect: '/financial/bill-user',
meta: {
icon: 'mdi:finance',
- title: 'financialmanagement',
+ title: 'financialManagement',
},
children: [
// 账单查询
{
path: '/financial/bill-user',
name: 'Bill',
- component: () => import('@/views/financial-user/bill-user/index.vue'),
+ component: () => import('@/views/financial-user/account-bill/bill/index.vue'),
meta: {
icon: 'grommet-icons:money',
title: 'billManagement',
@@ -21,9 +21,9 @@ export default [
},
// 用户分类
{
- path: '/financial/category-user',
+ path: '/financial/category',
name: 'CategoryUser',
- component: () => import('@/views/financial-user/category-user/index.vue'),
+ component: () => import('@/views/financial-user/account-bill/category/index.vue'),
meta: {
icon: 'iconamoon:category',
title: 'categoryUserManagement',
diff --git a/src/utils/message.ts b/src/utils/message.ts
index fa55e76..12ea15a 100644
--- a/src/utils/message.ts
+++ b/src/utils/message.ts
@@ -83,7 +83,7 @@ export const storeMessage = (result: BaseResult) => {
if (result.code !== 200) {
return false;
}
- message(result.message, { type: 'success' });
+ message(result.message, { type: 'success', duration: 3666 });
return true;
};
diff --git a/src/views/financial-user/bill-user/bill-dialog.vue b/src/views/financial-user/account-bill/bill/bill-dialog.vue
similarity index 92%
rename from src/views/financial-user/bill-user/bill-dialog.vue
rename to src/views/financial-user/account-bill/bill/bill-dialog.vue
index 260c12c..0b6b460 100644
--- a/src/views/financial-user/bill-user/bill-dialog.vue
+++ b/src/views/financial-user/account-bill/bill/bill-dialog.vue
@@ -1,12 +1,12 @@
+
+
+
+
+
+
+
+ {{ data.categoryName }}
+ ({{ data.children.length }})
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/financial/budget-saving/budget-category/index.vue b/src/views/financial/budget-saving/budget-category/index.vue
new file mode 100644
index 0000000..d7fd657
--- /dev/null
+++ b/src/views/financial/budget-saving/budget-category/index.vue
@@ -0,0 +1,223 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ $t('search') }}
+ {{ $t('buttons.reset') }}
+
+
+
+
+
+ {{ $t('addNew') }}
+
+
+
+ {{ $t('delete_batches') }}
+
+
+
+
+
+
+
+
+
+
+
+ {{ row.username }}
+
+
+
+
+
+ {{ row.createUsername }}
+
+
+
+
+
+ {{ row.updateUsername }}
+
+
+
+
+ {{ $t('modify') }}
+
+ {{ $t('addNew') }}
+
+
+
+
+ {{ $t('delete') }}
+
+
+
+
+
+
+
+
+
diff --git a/src/views/financial/budget-saving/budget-category/utils/columns.tsx b/src/views/financial/budget-saving/budget-category/utils/columns.tsx
new file mode 100644
index 0000000..189e41e
--- /dev/null
+++ b/src/views/financial/budget-saving/budget-category/utils/columns.tsx
@@ -0,0 +1,64 @@
+import { reactive } from 'vue';
+import { $t } from '@/plugins/i18n';
+import { ElText, type FormRules } from 'element-plus';
+
+// 表格列
+export const columns: TableColumnList = [
+ { type: 'selection', align: 'left' },
+ { type: 'index', index: (index: number) => index + 1, label: '序号', width: 60 },
+ // 分类名称
+ { label: $t('categoryName'), prop: 'categoryName' },
+ // 预算名称
+ { label: $t('budgetName'), prop: 'budgetName' },
+ // 完成状态
+ { label: $t('statusType'), prop: 'statusType', slot: 'statusType', width: 100 },
+ // 预算金额
+ {
+ label: $t('amount'),
+ prop: 'amount',
+ width: 150,
+ formatter({ amount }) {
+ return (
+
+ {amount}¥
+
+ );
+ },
+ },
+ // 预算周期
+ {
+ label: $t('period'),
+ prop: 'period',
+ formatter({ startPeriod, endPeriod }) {
+ return (
+
+ {startPeriod} ~ {endPeriod}
+
+ );
+ },
+ width: 360,
+ },
+ { 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' },
+];
+
+// 添加规则
+export const rules = reactive({
+ // 绑定的用户
+ userId: [{ required: true, message: `${$t('input')}${$t('userId')}`, trigger: 'blur' }],
+ // 分类名称
+ categoryName: [{ required: true, message: `${$t('input')}${$t('categoryName')}`, trigger: 'blur' }],
+ // 预算名称
+ budgetName: [{ required: true, message: `${$t('input')}${$t('budgetName')}`, trigger: 'blur' }],
+ // 完成状态
+ statusType: [{ required: true, message: `${$t('input')}${$t('statusType')}`, trigger: 'blur' }],
+ // 预算金额
+ amount: [{ required: true, message: `${$t('input')}${$t('amount')}`, trigger: 'blur' }],
+ // 预算周期
+ period: [{ required: true, message: `${$t('input')}${$t('period')}`, trigger: 'blur' }],
+});
diff --git a/src/views/financial/budget-saving/budget-category/utils/hooks.ts b/src/views/financial/budget-saving/budget-category/utils/hooks.ts
new file mode 100644
index 0000000..ebaea4d
--- /dev/null
+++ b/src/views/financial/budget-saving/budget-category/utils/hooks.ts
@@ -0,0 +1,147 @@
+import { addDialog } from '@/components/BaseDialog/index';
+import BudgetCategoryDialog from '@/views/financial/budget-saving/budget-category/budget-category-dialog.vue';
+import { useBudgetCategoryStore } from '@/store/financial/budgetCategory';
+import { h, ref } from 'vue';
+import { message, messageBox } from '@/utils/message';
+import type { FormItemProps } from '@/views/financial/budget-saving/budget-category/utils/types';
+import { $t } from '@/plugins/i18n';
+import DeleteBatchDialog from '@/components/Table/DeleteBatchDialog.vue';
+
+export const formRef = ref();
+// 删除ids
+export const deleteIds = ref([]);
+const budgetCategoryStore = useBudgetCategoryStore();
+
+/** 搜索初始化预算分类表 */
+export async function onSearch() {
+ budgetCategoryStore.loading = true;
+ await budgetCategoryStore.getBudgetCategoryList();
+ budgetCategoryStore.loading = false;
+}
+
+/** 添加预算分类表 */
+export function onAdd(parentId: string = '0') {
+ addDialog({
+ title: `${$t('addNew')}${$t('budgetCategory')}`,
+ width: '30%',
+ props: {
+ formInline: {
+ parentId,
+ categoryName: undefined,
+ budgetName: undefined,
+ statusType: undefined,
+ amount: undefined,
+ period: undefined,
+ startPeriod: undefined,
+ endPeriod: undefined,
+ },
+ },
+ draggable: true,
+ fullscreenIcon: true,
+ closeOnClickModal: false,
+ contentRenderer: () => h(BudgetCategoryDialog, { ref: formRef }),
+ beforeSure: (done, { options }) => {
+ const form = options.props.formInline as FormItemProps;
+ formRef.value.formRef.validate(async (valid: any) => {
+ if (!valid) return;
+
+ // 格式化开始时间和结束时间
+ form.startPeriod = form.period[0];
+ form.endPeriod = form.period[1];
+
+ const result = await budgetCategoryStore.addBudgetCategory(form);
+ if (!result) return;
+ done();
+ await onSearch();
+ });
+ },
+ });
+}
+
+/** 更新预算分类表 */
+export function onUpdate(row: any) {
+ addDialog({
+ title: `${$t('modify')}${$t('budgetCategory')}`,
+ width: '30%',
+ props: {
+ formInline: {
+ parentId: row.parentId ? row.parentId : '0',
+ userId: row.userId,
+ categoryName: row.categoryName,
+ budgetName: row.budgetName,
+ statusType: row.statusType,
+ amount: row.amount,
+ period: [row.startPeriod, row.endPeriod],
+ startPeriod: row.startPeriod,
+ endPeriod: row.endPeriod,
+ },
+ },
+ draggable: true,
+ fullscreenIcon: true,
+ closeOnClickModal: false,
+ contentRenderer: () => h(BudgetCategoryDialog, { ref: formRef }),
+ beforeSure: (done, { options }) => {
+ const form = options.props.formInline as FormItemProps;
+ formRef.value.formRef.validate(async (valid: any) => {
+ if (!valid) return;
+
+ // 格式化开始时间和结束时间
+ form.startPeriod = form.period[0];
+ form.endPeriod = form.period[1];
+
+ const result = await budgetCategoryStore.updateBudgetCategory({ ...form, id: row.id });
+ if (!result) return;
+ done();
+ await onSearch();
+ });
+ },
+ });
+}
+
+/** 删除预算分类表 */
+export const onDelete = async (row: any) => {
+ const id = row.id;
+
+ // 是否确认删除
+ const result = await messageBox({
+ title: $t('confirmDelete'),
+ showMessage: false,
+ confirmMessage: undefined,
+ cancelMessage: $t('cancel_delete'),
+ });
+ if (!result) return;
+
+ // 删除数据
+ await budgetCategoryStore.deleteBudgetCategory([id]);
+ await onSearch();
+};
+
+/** 批量删除 */
+export const onDeleteBatch = async () => {
+ const ids = deleteIds.value;
+ const formDeletedBatchRef = ref();
+
+ addDialog({
+ title: $t('deleteBatchTip'),
+ width: '30%',
+ props: { formInline: { confirmText: '' } },
+ draggable: true,
+ fullscreenIcon: true,
+ closeOnClickModal: false,
+ contentRenderer: () => h(DeleteBatchDialog, { ref: formDeletedBatchRef }),
+ beforeSure: (done, { options }) => {
+ formDeletedBatchRef.value.formDeletedBatchRef.validate(async (valid: any) => {
+ if (!valid) return;
+
+ const text = options.props.formInline.confirmText.toLowerCase();
+ if (text === 'yes' || text === 'y') {
+ // 删除数据
+ await budgetCategoryStore.deleteBudgetCategory(ids);
+ await onSearch();
+
+ done();
+ } else message($t('deleteBatchTip'), { type: 'warning' });
+ });
+ },
+ });
+};
diff --git a/src/views/financial/budget-saving/budget-category/utils/types.ts b/src/views/financial/budget-saving/budget-category/utils/types.ts
new file mode 100644
index 0000000..b9a48ac
--- /dev/null
+++ b/src/views/financial/budget-saving/budget-category/utils/types.ts
@@ -0,0 +1,24 @@
+// 添加或者修改表单元素
+export interface FormItemProps {
+ // 父级id
+ parentId: number;
+ // 绑定的用户id
+ userId: string;
+ // 分类名称
+ categoryName: string;
+ // 预算名称
+ budgetName: string;
+ // 完成状态
+ statusType: string;
+ // 预算金额
+ amount: any;
+ // 预算周期
+ period: string[];
+ startPeriod: string;
+ endPeriod: string;
+}
+
+// 添加或修改表单Props
+export interface FormProps {
+ formInline: FormItemProps;
+}
diff --git a/src/views/financial/budget-saving/saving-goal/index.vue b/src/views/financial/budget-saving/saving-goal/index.vue
new file mode 100644
index 0000000..7fde39a
--- /dev/null
+++ b/src/views/financial/budget-saving/saving-goal/index.vue
@@ -0,0 +1,198 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ $t('search') }}
+ {{ $t('buttons.reset') }}
+
+
+
+
+
+ {{ $t('addNew') }}
+
+
+
+ {{ $t('delete_batches') }}
+
+
+
+
+
+
+
+
+
+
+
+ {{ row.username }}
+
+
+
+
+
+ {{ row.createUsername }}
+
+
+
+
+
+ {{ row.updateUsername }}
+
+
+
+
+ {{ $t('modify') }}
+
+
+
+ {{ $t('delete') }}
+
+
+
+
+
+
+
+
+
diff --git a/src/views/financial/budget-saving/saving-goal/saving-goal-dialog.vue b/src/views/financial/budget-saving/saving-goal/saving-goal-dialog.vue
new file mode 100644
index 0000000..feb1ebd
--- /dev/null
+++ b/src/views/financial/budget-saving/saving-goal/saving-goal-dialog.vue
@@ -0,0 +1,100 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/financial/budget-saving/saving-goal/utils/columns.tsx b/src/views/financial/budget-saving/saving-goal/utils/columns.tsx
new file mode 100644
index 0000000..dc011d3
--- /dev/null
+++ b/src/views/financial/budget-saving/saving-goal/utils/columns.tsx
@@ -0,0 +1,61 @@
+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 },
+ // 完成状态
+ { label: $t('statusType'), prop: 'statusType', slot: 'statusType' },
+ // 储值目标名称
+ { label: $t('savingGoalName'), prop: 'savingGoalName' },
+ // 预算金额
+ {
+ label: $t('amount'),
+ prop: 'amount',
+ width: 150,
+ formatter({ amount }) {
+ return (
+
+ {amount}¥
+
+ );
+ },
+ },
+ // 目标时长
+ {
+ 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 },
+ // 绑定的用户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' },
+];
+
+// 添加规则
+export const rules = reactive({
+ // 绑定的用户id
+ userId: [{ required: true, message: `${$t('input')}${$t('userId')}`, trigger: 'blur' }],
+ // 完成状态
+ statusType: [{ required: true, message: `${$t('input')}${$t('statusType')}`, trigger: 'blur' }],
+ // 储值目标名称
+ savingGoalName: [{ required: true, message: `${$t('input')}${$t('savingGoalName')}`, trigger: 'blur' }],
+ // 目标金额
+ amount: [{ required: true, message: `${$t('input')}${$t('amount')}`, trigger: 'blur' }],
+ // 目标时长
+ duration: [{ required: true, message: `${$t('input')}${$t('duration')}`, trigger: 'blur' }],
+});
diff --git a/src/views/financial/budget-saving/saving-goal/utils/hooks.ts b/src/views/financial/budget-saving/saving-goal/utils/hooks.ts
new file mode 100644
index 0000000..29233de
--- /dev/null
+++ b/src/views/financial/budget-saving/saving-goal/utils/hooks.ts
@@ -0,0 +1,140 @@
+import { addDialog } from '@/components/BaseDialog/index';
+import SavingGoalDialog from '@/views/financial/budget-saving/saving-goal/saving-goal-dialog.vue';
+import { useSavingGoalStore } from '@/store/financial/savingGoal';
+import { h, ref } from 'vue';
+import { message, messageBox } from '@/utils/message';
+import type { FormItemProps } from '@/views/financial/budget-saving/saving-goal/utils/types';
+import { $t } from '@/plugins/i18n';
+import DeleteBatchDialog from '@/components/Table/DeleteBatchDialog.vue';
+
+export const formRef = ref();
+// 删除ids
+export const deleteIds = ref([]);
+const savingGoalStore = useSavingGoalStore();
+
+/** 搜索初始化用户储值 */
+export async function onSearch() {
+ savingGoalStore.loading = true;
+ await savingGoalStore.getSavingGoalList();
+ savingGoalStore.loading = false;
+}
+
+/** 添加用户储值 */
+export function onAdd() {
+ addDialog({
+ title: `${$t('addNew')}${$t('savingGoal')}`,
+ width: '30%',
+ props: {
+ formInline: {
+ userId: undefined,
+ statusType: undefined,
+ savingGoalName: undefined,
+ amount: undefined,
+ duration: undefined,
+ },
+ },
+ draggable: true,
+ fullscreenIcon: true,
+ closeOnClickModal: false,
+ contentRenderer: () => h(SavingGoalDialog, { ref: formRef }),
+ beforeSure: (done, { options }) => {
+ const form = options.props.formInline as FormItemProps;
+ 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();
+ await onSearch();
+ });
+ },
+ });
+}
+
+/** 更新用户储值 */
+export function onUpdate(row: any) {
+ addDialog({
+ title: `${$t('modify')}${$t('savingGoal')}`,
+ width: '30%',
+ props: {
+ formInline: {
+ userId: row.userId,
+ statusType: row.statusType,
+ savingGoalName: row.savingGoalName,
+ amount: row.amount,
+ duration: [row.startDuration, row.endDuration],
+ },
+ },
+ draggable: true,
+ fullscreenIcon: true,
+ closeOnClickModal: false,
+ contentRenderer: () => h(SavingGoalDialog, { ref: formRef }),
+ beforeSure: (done, { options }) => {
+ const form = options.props.formInline as FormItemProps;
+ 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();
+ await onSearch();
+ });
+ },
+ });
+}
+
+/** 删除用户储值 */
+export const onDelete = async (row: any) => {
+ const id = row.id;
+
+ // 是否确认删除
+ const result = await messageBox({
+ title: $t('confirmDelete'),
+ showMessage: false,
+ confirmMessage: undefined,
+ cancelMessage: $t('cancel_delete'),
+ });
+ if (!result) return;
+
+ // 删除数据
+ await savingGoalStore.deleteSavingGoal([id]);
+ await onSearch();
+};
+
+/** 批量删除 */
+export const onDeleteBatch = async () => {
+ const ids = deleteIds.value;
+ const formDeletedBatchRef = ref();
+
+ addDialog({
+ title: $t('deleteBatchTip'),
+ width: '30%',
+ props: { formInline: { confirmText: '' } },
+ draggable: true,
+ fullscreenIcon: true,
+ closeOnClickModal: false,
+ contentRenderer: () => h(DeleteBatchDialog, { ref: formDeletedBatchRef }),
+ beforeSure: (done, { options }) => {
+ formDeletedBatchRef.value.formDeletedBatchRef.validate(async (valid: any) => {
+ if (!valid) return;
+
+ const text = options.props.formInline.confirmText.toLowerCase();
+ if (text === 'yes' || text === 'y') {
+ // 删除数据
+ await savingGoalStore.deleteSavingGoal(ids);
+ await onSearch();
+
+ done();
+ } else message($t('deleteBatchTip'), { type: 'warning' });
+ });
+ },
+ });
+};
diff --git a/src/views/financial/budget-saving/saving-goal/utils/types.ts b/src/views/financial/budget-saving/saving-goal/utils/types.ts
new file mode 100644
index 0000000..cfda985
--- /dev/null
+++ b/src/views/financial/budget-saving/saving-goal/utils/types.ts
@@ -0,0 +1,22 @@
+// 添加或者修改表单元素
+export interface FormItemProps {
+ // 绑定的用户id
+ userId: number;
+ // 完成状态
+ statusType: string;
+ // 储值目标名称
+ savingGoalName: string;
+ // 目标金额
+ amount: any;
+ // 目标时长
+ duration: string;
+ // 开始目标时长
+ startDuration: string;
+ // 结束目标时长
+ endDuration: string;
+}
+
+// 添加或修改表单Props
+export interface FormProps {
+ formInline: FormItemProps;
+}
diff --git a/src/views/financial/debt/debt-repayment-plan/debt-repayment-plan-dialog.vue b/src/views/financial/debt/debt-repayment-plan/debt-repayment-plan-dialog.vue
new file mode 100644
index 0000000..004e59c
--- /dev/null
+++ b/src/views/financial/debt/debt-repayment-plan/debt-repayment-plan-dialog.vue
@@ -0,0 +1,102 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/financial/debt/debt-repayment-plan/index.vue b/src/views/financial/debt/debt-repayment-plan/index.vue
new file mode 100644
index 0000000..f4e3e56
--- /dev/null
+++ b/src/views/financial/debt/debt-repayment-plan/index.vue
@@ -0,0 +1,210 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ $t('search') }}
+
+ {{ $t('buttons.reset') }}
+
+
+
+
+
+ {{ $t('addNew') }}
+
+
+
+ {{ $t('delete_batches') }}
+
+
+
+
+
+
+
+
+
+
+
+ {{ row.username }}
+
+
+
+
+
+ {{ row.createUsername }}
+
+
+
+
+
+ {{ row.updateUsername }}
+
+
+
+
+ {{ $t('modify') }}
+ {{ $t('addNew') }}
+
+
+
+ {{ $t('delete') }}
+
+
+
+
+
+
+
+
+
diff --git a/src/views/financial/debt/debt-repayment-plan/utils/columns.tsx b/src/views/financial/debt/debt-repayment-plan/utils/columns.tsx
new file mode 100644
index 0000000..a968f5a
--- /dev/null
+++ b/src/views/financial/debt/debt-repayment-plan/utils/columns.tsx
@@ -0,0 +1,84 @@
+import { reactive } from 'vue';
+import { $t } from '@/plugins/i18n';
+import { ElText, type FormRules } from 'element-plus';
+
+// 表格列
+export const columns: TableColumnList = [
+ { type: 'selection', align: 'left' },
+ { type: 'index', index: (index: number) => index + 1, label: '序号', width: 60 },
+ // 债务金额
+ {
+ label: $t('installmentNumber'),
+ prop: 'installmentNumber',
+ formatter({ installmentNumber }) {
+ return (
+
+ {installmentNumber}¥
+
+ );
+ },
+ },
+ // 每期应还金额
+ {
+ label: $t('installmentAmount'),
+ prop: 'installmentAmount',
+ formatter({ installmentAmount }) {
+ return (
+
+ {installmentAmount}¥
+
+ );
+ },
+ },
+ // 已还金额
+ {
+ label: $t('paidAmount'),
+ prop: 'paidAmount',
+ formatter({ paidAmount }) {
+ return (
+
+ {paidAmount}¥
+
+ );
+ },
+ },
+ // 还款状态
+ { label: $t('paymentStatus'), prop: 'paymentStatus', slot: 'paymentStatus' },
+ // 还款截止日期
+ {
+ label: $t('dueDate'),
+ prop: 'dueDate',
+ sortable: true,
+ formatter({ dueDate }) {
+ return (
+
+ {dueDate}
+
+ );
+ },
+ width: 190,
+ },
+ { 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' },
+];
+
+// 添加规则
+export const rules = reactive({
+ // 绑定的用户
+ userId: [{ required: true, message: `${$t('input')}${$t('userId')}`, trigger: 'blur' }],
+ // 债务金额
+ installmentNumber: [{ required: true, message: `${$t('input')}${$t('installmentNumber')}`, trigger: 'blur' }],
+ // 每期应还金额
+ installmentAmount: [{ required: true, message: `${$t('input')}${$t('installmentAmount')}`, trigger: 'blur' }],
+ // 还款截止日期
+ dueDate: [{ required: true, message: `${$t('input')}${$t('dueDate')}`, trigger: 'blur' }],
+ // 已还金额
+ paidAmount: [{ required: true, message: `${$t('input')}${$t('paidAmount')}`, trigger: 'blur' }],
+ // 还款状态
+ paymentStatus: [{ required: true, message: `${$t('input')}${$t('paymentStatus')}`, trigger: 'blur' }],
+});
diff --git a/src/views/financial/debt/debt-repayment-plan/utils/hooks.ts b/src/views/financial/debt/debt-repayment-plan/utils/hooks.ts
new file mode 100644
index 0000000..46265e8
--- /dev/null
+++ b/src/views/financial/debt/debt-repayment-plan/utils/hooks.ts
@@ -0,0 +1,132 @@
+import { addDialog } from '@/components/BaseDialog/index';
+import DebtRepaymentPlanDialog from '@/views/financial/debt/debt-repayment-plan/debt-repayment-plan-dialog.vue';
+import { useDebtRepaymentPlanStore } from '@/store/financial/debtRepaymentPlan';
+import { h, ref } from 'vue';
+import { message, messageBox } from '@/utils/message';
+import type { FormItemProps } from '@/views/financial/debt/debt-repayment-plan/utils/types';
+import { $t } from '@/plugins/i18n';
+import DeleteBatchDialog from '@/components/Table/DeleteBatchDialog.vue';
+
+export const formRef = ref();
+// 删除ids
+export const deleteIds = ref([]);
+const debtRepaymentPlanStore = useDebtRepaymentPlanStore();
+
+/** 搜索初始化债务还款计划表 */
+export async function onSearch() {
+ debtRepaymentPlanStore.loading = true;
+ await debtRepaymentPlanStore.getDebtRepaymentPlanList();
+ debtRepaymentPlanStore.loading = false;
+}
+
+/** 添加债务还款计划表 */
+export function onAdd() {
+ addDialog({
+ title: `${$t('addNew')}${$t('debtRepaymentPlan')}`,
+ width: '30%',
+ props: {
+ formInline: {
+ installmentNumber: undefined,
+ installmentAmount: undefined,
+ dueDate: undefined,
+ paidAmount: undefined,
+ paymentStatus: undefined,
+ },
+ },
+ draggable: true,
+ fullscreenIcon: true,
+ closeOnClickModal: false,
+ contentRenderer: () => h(DebtRepaymentPlanDialog, { ref: formRef }),
+ beforeSure: (done, { options }) => {
+ const form = options.props.formInline as FormItemProps;
+ formRef.value.formRef.validate(async (valid: any) => {
+ if (!valid) return;
+
+ const result = await debtRepaymentPlanStore.addDebtRepaymentPlan(form);
+ if (!result) return;
+ done();
+ await onSearch();
+ });
+ },
+ });
+}
+
+/** 更新债务还款计划表 */
+export function onUpdate(row: any) {
+ addDialog({
+ title: `${$t('modify')}${$t('debtRepaymentPlan')}`,
+ width: '30%',
+ props: {
+ formInline: {
+ installmentNumber: row.installmentNumber,
+ installmentAmount: row.installmentAmount,
+ dueDate: row.dueDate,
+ paidAmount: row.paidAmount,
+ paymentStatus: row.paymentStatus,
+ },
+ },
+ draggable: true,
+ fullscreenIcon: true,
+ closeOnClickModal: false,
+ contentRenderer: () => h(DebtRepaymentPlanDialog, { ref: formRef }),
+ beforeSure: (done, { options }) => {
+ const form = options.props.formInline as FormItemProps;
+ formRef.value.formRef.validate(async (valid: any) => {
+ if (!valid) return;
+
+ const result = await debtRepaymentPlanStore.updateDebtRepaymentPlan({ ...form, id: row.id });
+ if (!result) return;
+ done();
+ await onSearch();
+ });
+ },
+ });
+}
+
+/** 删除债务还款计划表 */
+export const onDelete = async (row: any) => {
+ const id = row.id;
+
+ // 是否确认删除
+ const result = await messageBox({
+ title: $t('confirmDelete'),
+ showMessage: false,
+ confirmMessage: undefined,
+ cancelMessage: $t('cancel_delete'),
+ });
+ if (!result) return;
+
+ // 删除数据
+ await debtRepaymentPlanStore.deleteDebtRepaymentPlan([id]);
+ await onSearch();
+};
+
+/** 批量删除 */
+export const onDeleteBatch = async () => {
+ const ids = deleteIds.value;
+ const formDeletedBatchRef = ref();
+
+ addDialog({
+ title: $t('deleteBatchTip'),
+ width: '30%',
+ props: { formInline: { confirmText: '' } },
+ draggable: true,
+ fullscreenIcon: true,
+ closeOnClickModal: false,
+ contentRenderer: () => h(DeleteBatchDialog, { ref: formDeletedBatchRef }),
+ beforeSure: (done, { options }) => {
+ formDeletedBatchRef.value.formDeletedBatchRef.validate(async (valid: any) => {
+ if (!valid) return;
+
+ const text = options.props.formInline.confirmText.toLowerCase();
+ if (text === 'yes' || text === 'y') {
+ // 删除数据
+ await debtRepaymentPlanStore.deleteDebtRepaymentPlan(ids);
+ await onSearch();
+
+ done();
+ } else message($t('deleteBatchTip'), { type: 'warning' });
+ });
+ },
+ });
+};
diff --git a/src/views/financial/debt/debt-repayment-plan/utils/types.ts b/src/views/financial/debt/debt-repayment-plan/utils/types.ts
new file mode 100644
index 0000000..5c64d27
--- /dev/null
+++ b/src/views/financial/debt/debt-repayment-plan/utils/types.ts
@@ -0,0 +1,20 @@
+// 添加或者修改表单元素
+export interface FormItemProps {
+ // 绑定的用户id
+ userId: string;
+ // 债务金额
+ installmentNumber: any;
+ // 每期应还金额
+ installmentAmount: any;
+ // 还款截止日期
+ dueDate: any;
+ // 已还金额
+ paidAmount: any;
+ // 还款状态
+ paymentStatus: string;
+}
+
+// 添加或修改表单Props
+export interface FormProps {
+ formInline: FormItemProps;
+}
diff --git a/src/views/financial/debt/debt-tracking/debt-tracking-dialog.vue b/src/views/financial/debt/debt-tracking/debt-tracking-dialog.vue
new file mode 100644
index 0000000..07dfc87
--- /dev/null
+++ b/src/views/financial/debt/debt-tracking/debt-tracking-dialog.vue
@@ -0,0 +1,110 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/financial/debt/debt-tracking/index.vue b/src/views/financial/debt/debt-tracking/index.vue
new file mode 100644
index 0000000..2dd8983
--- /dev/null
+++ b/src/views/financial/debt/debt-tracking/index.vue
@@ -0,0 +1,206 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ $t('search') }}
+ {{ $t('buttons.reset') }}
+
+
+
+
+
+ {{ $t('addNew') }}
+
+
+
+ {{ $t('delete_batches') }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ row.createUsername }}
+
+
+
+
+
+ {{ row.username }}
+
+
+
+
+
+ {{ row.updateUsername }}
+
+
+
+
+ {{ $t('modify') }}
+ {{ $t('addNew') }}
+
+
+
+ {{ $t('delete') }}
+
+
+
+
+
+
+
+
+
diff --git a/src/views/financial/debt/debt-tracking/utils/columns.tsx b/src/views/financial/debt/debt-tracking/utils/columns.tsx
new file mode 100644
index 0000000..01bee03
--- /dev/null
+++ b/src/views/financial/debt/debt-tracking/utils/columns.tsx
@@ -0,0 +1,65 @@
+import { reactive } from 'vue';
+import { $t } from '@/plugins/i18n';
+import { ElText, type FormRules } from 'element-plus';
+
+// 表格列
+export const columns: TableColumnList = [
+ { type: 'selection', align: 'left' },
+ { type: 'index', index: (index: number) => index + 1, label: '序号', width: 60 },
+ // 债务人姓名
+ { label: $t('debtorName'), prop: 'debtorName' },
+ // 债务金额
+ {
+ label: $t('debtAmount'),
+ prop: 'debtAmount',
+ formatter({ debtAmount }) {
+ return (
+
+ {debtAmount}¥
+
+ );
+ },
+ width: 150,
+ },
+ // 债务类型
+ { label: $t('debtType'), prop: 'debtType', slot: 'debtType', width: 130 },
+ // 债务状态
+ { label: $t('debtStatus'), prop: 'debtStatus', slot: 'debtStatus', width: 130 },
+ // 还款截止日期
+ {
+ label: $t('dueDate'),
+ prop: 'dueDate',
+ formatter({ dueDate }) {
+ return (
+
+ {dueDate}
+
+ );
+ },
+ width: 190,
+ sortable: true,
+ },
+ { 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' },
+];
+
+// 添加规则
+export const rules = reactive({
+ // 绑定的用户
+ userId: [{ required: true, message: `${$t('input')}${$t('userId')}`, trigger: 'blur' }],
+ // 债务人姓名
+ debtorName: [{ required: true, message: `${$t('input')}${$t('debtorName')}`, trigger: 'blur' }],
+ // 债务金额
+ debtAmount: [{ required: true, message: `${$t('input')}${$t('debtAmount')}`, trigger: 'blur' }],
+ // 债务类型
+ debtType: [{ required: true, message: `${$t('input')}${$t('debtType')}`, trigger: 'blur' }],
+ // 债务状态
+ debtStatus: [{ required: true, message: `${$t('input')}${$t('debtStatus')}`, trigger: 'blur' }],
+ // 还款截止日期
+ dueDate: [{ required: true, message: `${$t('input')}${$t('dueDate')}`, trigger: 'blur' }],
+});
diff --git a/src/views/financial/debt/debt-tracking/utils/hooks.ts b/src/views/financial/debt/debt-tracking/utils/hooks.ts
new file mode 100644
index 0000000..9841fe4
--- /dev/null
+++ b/src/views/financial/debt/debt-tracking/utils/hooks.ts
@@ -0,0 +1,134 @@
+import { addDialog } from '@/components/BaseDialog/index';
+import DebtTrackingDialog from '@/views/financial/debt/debt-tracking/debt-tracking-dialog.vue';
+import { useDebtTrackingStore } from '@/store/financial/debtTracking';
+import { h, ref } from 'vue';
+import { message, messageBox } from '@/utils/message';
+import type { FormItemProps } from '@/views/financial/debt/debt-tracking/utils/types';
+import { $t } from '@/plugins/i18n';
+import DeleteBatchDialog from '@/components/Table/DeleteBatchDialog.vue';
+
+export const formRef = ref();
+// 删除ids
+export const deleteIds = ref([]);
+const debtTrackingStore = useDebtTrackingStore();
+
+/** 搜索初始化债务追踪 */
+export async function onSearch() {
+ debtTrackingStore.loading = true;
+ await debtTrackingStore.getDebtTrackingList();
+ debtTrackingStore.loading = false;
+}
+
+/** 添加债务追踪 */
+export function onAdd() {
+ addDialog({
+ title: `${$t('addNew')}${$t('debtTracking')}`,
+ width: '30%',
+ props: {
+ formInline: {
+ userId: undefined,
+ debtorName: undefined,
+ debtAmount: undefined,
+ debtType: undefined,
+ debtStatus: undefined,
+ dueDate: undefined,
+ },
+ },
+ draggable: true,
+ fullscreenIcon: true,
+ closeOnClickModal: false,
+ contentRenderer: () => h(DebtTrackingDialog, { ref: formRef }),
+ beforeSure: (done, { options }) => {
+ const form = options.props.formInline as FormItemProps;
+ formRef.value.formRef.validate(async (valid: any) => {
+ if (!valid) return;
+
+ const result = await debtTrackingStore.addDebtTracking(form);
+ if (!result) return;
+ done();
+ await onSearch();
+ });
+ },
+ });
+}
+
+/** 更新债务追踪 */
+export function onUpdate(row: any) {
+ addDialog({
+ title: `${$t('modify')}${$t('debtTracking')}`,
+ width: '30%',
+ props: {
+ formInline: {
+ userId: row.userId,
+ debtorName: row.debtorName,
+ debtAmount: row.debtAmount,
+ debtType: row.debtType,
+ debtStatus: row.debtStatus,
+ dueDate: row.dueDate,
+ },
+ },
+ draggable: true,
+ fullscreenIcon: true,
+ closeOnClickModal: false,
+ contentRenderer: () => h(DebtTrackingDialog, { ref: formRef }),
+ beforeSure: (done, { options }) => {
+ const form = options.props.formInline as FormItemProps;
+ formRef.value.formRef.validate(async (valid: any) => {
+ if (!valid) return;
+
+ const result = await debtTrackingStore.updateDebtTracking({ ...form, id: row.id });
+ if (!result) return;
+ done();
+ await onSearch();
+ });
+ },
+ });
+}
+
+/** 删除债务追踪 */
+export const onDelete = async (row: any) => {
+ const id = row.id;
+
+ // 是否确认删除
+ const result = await messageBox({
+ title: $t('confirmDelete'),
+ showMessage: false,
+ confirmMessage: undefined,
+ cancelMessage: $t('cancel_delete'),
+ });
+ if (!result) return;
+
+ // 删除数据
+ await debtTrackingStore.deleteDebtTracking([id]);
+ await onSearch();
+};
+
+/** 批量删除 */
+export const onDeleteBatch = async () => {
+ const ids = deleteIds.value;
+ const formDeletedBatchRef = ref();
+
+ addDialog({
+ title: $t('deleteBatchTip'),
+ width: '30%',
+ props: { formInline: { confirmText: '' } },
+ draggable: true,
+ fullscreenIcon: true,
+ closeOnClickModal: false,
+ contentRenderer: () => h(DeleteBatchDialog, { ref: formDeletedBatchRef }),
+ beforeSure: (done, { options }) => {
+ formDeletedBatchRef.value.formDeletedBatchRef.validate(async (valid: any) => {
+ if (!valid) return;
+
+ const text = options.props.formInline.confirmText.toLowerCase();
+ if (text === 'yes' || text === 'y') {
+ // 删除数据
+ await debtTrackingStore.deleteDebtTracking(ids);
+ await onSearch();
+
+ done();
+ } else message($t('deleteBatchTip'), { type: 'warning' });
+ });
+ },
+ });
+};
diff --git a/src/views/financial/debt/debt-tracking/utils/types.ts b/src/views/financial/debt/debt-tracking/utils/types.ts
new file mode 100644
index 0000000..0790c84
--- /dev/null
+++ b/src/views/financial/debt/debt-tracking/utils/types.ts
@@ -0,0 +1,20 @@
+// 添加或者修改表单元素
+export interface FormItemProps {
+ // 绑定的用户
+ userId: number;
+ // 债务人姓名
+ debtorName: string;
+ // 债务金额
+ debtAmount: any;
+ // 债务类型
+ debtType: string;
+ // 债务状态
+ debtStatus: string;
+ // 还款截止日期
+ dueDate: any;
+}
+
+// 添加或修改表单Props
+export interface FormProps {
+ formInline: FormItemProps;
+}
diff --git a/src/views/system/menu/index.vue b/src/views/system/menu/index.vue
index 58083e3..299f1fd 100644
--- a/src/views/system/menu/index.vue
+++ b/src/views/system/menu/index.vue
@@ -137,7 +137,7 @@ onMounted(() => {
-
+
diff --git a/src/views/system/menu/utils/hooks.tsx b/src/views/system/menu/utils/hooks.tsx
index a61ae81..c562f58 100644
--- a/src/views/system/menu/utils/hooks.tsx
+++ b/src/views/system/menu/utils/hooks.tsx
@@ -201,6 +201,7 @@ export const onChangeMenuRank = async (row: any) => {
if (!confirm) return;
await routerStore.updateMenuByIdWithRank(data);
+ await onSearch();
};
/**