optimize: ♻️ 重构代码
This commit is contained in:
parent
757eb0aab1
commit
d159231fd5
|
@ -1,5 +1,5 @@
|
|||
# 平台本地运行端口号
|
||||
VITE_PORT=3000
|
||||
VITE_PORT=7000
|
||||
|
||||
# 预发布环境路由历史模式(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:6060
|
||||
VITE_APP_URL=http://localhost:7070
|
||||
|
||||
# mock地址
|
||||
VITE_MOCK_BASE_API=/mock
|
||||
|
@ -22,13 +22,5 @@ VITE_BASE_API_RETRY=5
|
|||
# 失败重试时间
|
||||
VITE_BASE_API_RETRY_DELAY=3000
|
||||
|
||||
# 是否在打包时使用cdn替换本地库 替换 true 不替换 false
|
||||
VITE_CDN=false
|
||||
|
||||
# 是否启用gzip压缩或brotli压缩(分两种情况,删除原始文件和不删除原始文件)
|
||||
# 压缩时不删除原始文件的配置:gzip、brotli、both(同时开启 gzip 与 brotli 压缩)、none(不开启压缩,默认)
|
||||
# 压缩时删除原始文件的配置:gzip-clear、brotli-clear、both-clear(同时开启 gzip 与 brotli 压缩)、none(不开启压缩,默认)
|
||||
VITE_COMPRESSION="none"
|
||||
|
||||
# 开发环境读取配置文件路径
|
||||
VITE_PUBLIC_PATH=/
|
||||
|
|
|
@ -7,9 +7,6 @@ VITE_ROUTER_HISTORY="hash"
|
|||
# 基础请求路径
|
||||
VITE_BASE_API=/admin
|
||||
|
||||
# 跨域代理地址
|
||||
VITE_APP_URL=http://localhost:8000
|
||||
|
||||
# mock地址
|
||||
VITE_MOCK_BASE_API=/mock
|
||||
|
||||
|
@ -23,12 +20,12 @@ VITE_BASE_API_RETRY=5
|
|||
VITE_BASE_API_RETRY_DELAY=3000
|
||||
|
||||
# 是否在打包时使用cdn替换本地库 替换 true 不替换 false
|
||||
VITE_CDN=true
|
||||
VITE_CDN=false
|
||||
|
||||
# 是否启用gzip压缩或brotli压缩(分两种情况,删除原始文件和不删除原始文件)
|
||||
# 压缩时不删除原始文件的配置:gzip、brotli、both(同时开启 gzip 与 brotli 压缩)、none(不开启压缩,默认)
|
||||
# 压缩时删除原始文件的配置:gzip-clear、brotli-clear、both-clear(同时开启 gzip 与 brotli 压缩)、none(不开启压缩,默认)
|
||||
VITE_COMPRESSION="none"
|
||||
VITE_COMPRESSION="gzip"
|
||||
|
||||
# 开发环境读取配置文件路径
|
||||
VITE_PUBLIC_PATH=/
|
||||
|
|
|
@ -16,7 +16,7 @@ server {
|
|||
|
||||
# 后端跨域请求
|
||||
location ~/admin/ {
|
||||
proxy_pass http://172.17.0.1:8000;
|
||||
proxy_pass http://172.17.0.1:7070;
|
||||
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;
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
import { http } from '@/api/service/request';
|
||||
import type { BaseResult, ResultTable } from '@/api/service/types';
|
||||
|
||||
/** 债务回收管理表---获取债务回收管理表列表 */
|
||||
export const fetchGetDebtCollectionManagementList = (data: any) => {
|
||||
return http.request<BaseResult<ResultTable>>('get', `debtCollectionManagement/getDebtCollectionManagementList/${data.currentPage}/${data.pageSize}`, {
|
||||
params: data,
|
||||
});
|
||||
};
|
||||
|
||||
/** 债务回收管理表---添加债务回收管理表 */
|
||||
export const fetchAddDebtCollectionManagement = (data: any) => {
|
||||
return http.request<BaseResult<object>>('post', 'debtCollectionManagement/addDebtCollectionManagement', { data });
|
||||
};
|
||||
|
||||
/** 债务回收管理表---更新债务回收管理表 */
|
||||
export const fetchUpdateDebtCollectionManagement = (data: any) => {
|
||||
return http.request<BaseResult<object>>('put', 'debtCollectionManagement/updateDebtCollectionManagement', { data });
|
||||
};
|
||||
|
||||
/** 债务回收管理表---删除债务回收管理表 */
|
||||
export const fetchDeleteDebtCollectionManagement = (data: any) => {
|
||||
return http.request<BaseResult<object>>('delete', 'debtCollectionManagement/deleteDebtCollectionManagement', { data });
|
||||
};
|
|
@ -3,25 +3,25 @@ import type { BaseResult, ResultTable } from '@/api/service/types';
|
|||
|
||||
/** 分类信息---获取分类信息列表 */
|
||||
export const fetchGetCategoryUserList = (data: any) => {
|
||||
return http.request<BaseResult<ResultTable>>('get', `categoryUser/noManage/getCategoryUserList/${data.currentPage}/${data.pageSize}`, { params: data });
|
||||
return http.request<BaseResult<ResultTable>>('get', `category/noManage/getCategoryUserList/${data.currentPage}/${data.pageSize}`, { params: data });
|
||||
};
|
||||
|
||||
/** 分类信息---查询当前用户下所有的分类 */
|
||||
export const fetchGetCategoryUserAllList = () => {
|
||||
return http.request<BaseResult<object>>('get', 'categoryUser/noManage/getCategoryUserAllList');
|
||||
return http.request<BaseResult<object>>('get', 'category/noManage/getCategoryUserAllList');
|
||||
};
|
||||
|
||||
/** 分类信息---添加分类信息 */
|
||||
export const fetchAddCategoryUser = (data: any) => {
|
||||
return http.request<BaseResult<object>>('post', 'categoryUser/noManage/addCategoryUser', { data });
|
||||
return http.request<BaseResult<object>>('post', 'category/noManage/addCategoryUser', { data });
|
||||
};
|
||||
|
||||
/** 分类信息---更新分类信息 */
|
||||
export const fetchUpdateCategoryUser = (data: any) => {
|
||||
return http.request<BaseResult<object>>('put', 'categoryUser/noManage/updateCategoryUser', { data });
|
||||
return http.request<BaseResult<object>>('put', 'category/noManage/updateCategoryUser', { data });
|
||||
};
|
||||
|
||||
/** 分类信息---删除分类信息 */
|
||||
export const fetchDeleteCategoryUser = (data: any) => {
|
||||
return http.request<BaseResult<object>>('delete', 'categoryUser/noManage/deleteCategoryUser', { data });
|
||||
return http.request<BaseResult<object>>('delete', 'category/noManage/deleteCategoryUser', { data });
|
||||
};
|
|
@ -1,5 +1,5 @@
|
|||
<script lang="ts" setup>
|
||||
import { onAdd } from '@/views/financial/bill/utils/hooks';
|
||||
import { onAdd } from '@/views/financial-user/bill-user/utils/hooks';
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
|
@ -1,82 +1,98 @@
|
|||
export default {
|
||||
path: '/financial',
|
||||
name: 'Financial',
|
||||
redirect: '/financial/bill',
|
||||
meta: {
|
||||
icon: 'mdi:finance',
|
||||
title: 'financialmanagement',
|
||||
rank: 37,
|
||||
export default [
|
||||
// 财务管理
|
||||
{
|
||||
path: '/financial',
|
||||
name: 'Financial',
|
||||
redirect: '/financial/bill-user',
|
||||
meta: {
|
||||
icon: 'mdi:finance',
|
||||
title: 'financialmanagement',
|
||||
},
|
||||
children: [
|
||||
// 账单查询
|
||||
{
|
||||
path: '/financial/bill-user',
|
||||
name: 'Bill',
|
||||
component: () => import('@/views/financial-user/bill-user/index.vue'),
|
||||
meta: {
|
||||
icon: 'grommet-icons:money',
|
||||
title: 'billManagement',
|
||||
},
|
||||
},
|
||||
// 用户分类
|
||||
{
|
||||
path: '/financial/category-user',
|
||||
name: 'CategoryUser',
|
||||
component: () => import('@/views/financial-user/category-user/index.vue'),
|
||||
meta: {
|
||||
icon: 'iconamoon:category',
|
||||
title: 'categoryUserManagement',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
children: [
|
||||
// 账单查询
|
||||
{
|
||||
path: '/financial/bill',
|
||||
name: 'Bill',
|
||||
component: () => import('@/views/financial/bill/index.vue'),
|
||||
meta: {
|
||||
icon: 'grommet-icons:money',
|
||||
title: 'billManagement',
|
||||
},
|
||||
},
|
||||
// 用户分类
|
||||
{
|
||||
path: '/financial/categoryUser',
|
||||
name: 'CategoryUser',
|
||||
component: () => import('@/views/financial/categoryUser/index.vue'),
|
||||
meta: {
|
||||
icon: 'iconamoon:category',
|
||||
title: 'categoryUserManagement',
|
||||
},
|
||||
},
|
||||
// 预算分类
|
||||
{
|
||||
path: '/financial/budgetCategory',
|
||||
name: 'budgetCategory',
|
||||
component: () => import('@/views/financial/budgetCategory/index.vue'),
|
||||
meta: {
|
||||
icon: 'iconamoon:category',
|
||||
title: 'budgetCategory',
|
||||
},
|
||||
},
|
||||
// 债务还款计划
|
||||
{
|
||||
path: '/financial/debtRepaymentPlan',
|
||||
name: 'debtRepaymentPlan',
|
||||
component: () => import('@/views/financial/debtRepaymentPlan/index.vue'),
|
||||
meta: {
|
||||
icon: 'iconamoon:category',
|
||||
title: 'debtRepaymentPlan',
|
||||
},
|
||||
},
|
||||
// 债务回收管理
|
||||
{
|
||||
path: '/financial/debtCollectionManagement',
|
||||
name: 'debtRepaymentPlan',
|
||||
component: () => import('@/views/financial/debtCollectionManagement/index.vue'),
|
||||
meta: {
|
||||
icon: 'iconamoon:category',
|
||||
title: 'debtCollectionManagement',
|
||||
},
|
||||
},
|
||||
// 债务追踪
|
||||
{
|
||||
path: '/financial/debtTracking',
|
||||
name: 'debtTracking',
|
||||
component: () => import('@/views/financial/debtTracking/index.vue'),
|
||||
meta: {
|
||||
icon: 'iconamoon:category',
|
||||
title: 'debtTracking',
|
||||
},
|
||||
},
|
||||
// 预算储值
|
||||
{
|
||||
path: '/financial/savingGoal',
|
||||
name: 'savingGoal',
|
||||
component: () => import('@/views/financial/savingGoal/index.vue'),
|
||||
meta: {
|
||||
icon: 'iconamoon:category',
|
||||
title: 'savingGoal',
|
||||
},
|
||||
},
|
||||
],
|
||||
} satisfies RouteConfigsTable;
|
||||
// // 预算和储值
|
||||
// {
|
||||
// path: '/budgetSavings',
|
||||
// name: 'BudgetSavings',
|
||||
// redirect: '/budgetSavings/budgetCategory',
|
||||
// meta: {
|
||||
// icon: 'arcticons:budgetbakers-wallet',
|
||||
// title: 'budgetSavings',
|
||||
// },
|
||||
// children: [
|
||||
// // 预算分类
|
||||
// {
|
||||
// path: '/budgetSavings/budgetCategory',
|
||||
// name: 'budgetCategory',
|
||||
// component: () => import('@/views/financial/budgetCategory/index.vue'),
|
||||
// meta: {
|
||||
// icon: 'simple-icons:actualbudget',
|
||||
// title: 'budgetCategory',
|
||||
// },
|
||||
// },
|
||||
// // 预算储值
|
||||
// {
|
||||
// path: '/budgetSavings/savingGoal',
|
||||
// name: 'savingGoal',
|
||||
// component: () => import('@/views/financial/savingGoal/index.vue'),
|
||||
// meta: {
|
||||
// icon: 'fluent:savings-16-regular',
|
||||
// title: 'savingGoal',
|
||||
// },
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
// // 账务管理
|
||||
// {
|
||||
// path: '/debtManagement',
|
||||
// name: 'DebtManagement',
|
||||
// redirect: '/debtManagement/debtRepaymentPlan',
|
||||
// meta: {
|
||||
// icon: 'arcticons:debtcalc',
|
||||
// title: 'debtManagement',
|
||||
// },
|
||||
// children: [
|
||||
// // 债务还款计划
|
||||
// {
|
||||
// path: '/debtManagement/debtRepaymentPlan',
|
||||
// name: 'debtRepaymentPlan',
|
||||
// component: () => import('@/views/financial/debtRepaymentPlan/index.vue'),
|
||||
// meta: {
|
||||
// icon: 'stash:plan-light',
|
||||
// title: 'debtRepaymentPlan',
|
||||
// },
|
||||
// },
|
||||
// // 债务追踪
|
||||
// {
|
||||
// path: '/debtManagement/debtTracking',
|
||||
// name: 'debtTracking',
|
||||
// component: () => import('@/views/financial/debtTracking/index.vue'),
|
||||
// meta: {
|
||||
// icon: 'ic:outline-spatial-tracking',
|
||||
// title: 'debtTracking',
|
||||
// },
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
] satisfies Array<RouteConfigsTable>;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
const Layout = () => import('@/layout/index.vue');
|
||||
|
||||
export default [
|
||||
// 登录
|
||||
{
|
||||
path: '/login',
|
||||
name: 'Login',
|
||||
|
@ -27,6 +28,7 @@ export default [
|
|||
},
|
||||
],
|
||||
},
|
||||
// 账号设置
|
||||
{
|
||||
path: '/account-settings',
|
||||
name: 'AccountSettings',
|
||||
|
@ -37,6 +39,7 @@ export default [
|
|||
rank: 103,
|
||||
},
|
||||
},
|
||||
// 消息详情
|
||||
{
|
||||
path: '/message-detail',
|
||||
name: 'MessageDetail',
|
||||
|
|
|
@ -1,80 +0,0 @@
|
|||
import { defineStore } from 'pinia';
|
||||
import {
|
||||
fetchAddDebtCollectionManagement,
|
||||
fetchDeleteDebtCollectionManagement,
|
||||
fetchGetDebtCollectionManagementList,
|
||||
fetchUpdateDebtCollectionManagement,
|
||||
} from '@/api/v1/financial/debtCollectionManagement';
|
||||
import { pageSizes } from '@/enums/baseConstant';
|
||||
import { storeMessage } from '@/utils/message';
|
||||
import { storePagination } from '@/store/useStorePagination';
|
||||
|
||||
/**
|
||||
* 债务回收管理表 Store
|
||||
*/
|
||||
export const useDebtCollectionManagementStore = defineStore('debtCollectionManagementStore', {
|
||||
state() {
|
||||
return {
|
||||
// 债务回收管理表列表
|
||||
datalist: [],
|
||||
// 查询表单
|
||||
form: {
|
||||
// 债务ID
|
||||
debtId: undefined,
|
||||
// 回收日期
|
||||
recoveryDate: undefined,
|
||||
// 回收金额
|
||||
recoveryAmount: undefined,
|
||||
// 回收方式
|
||||
recoveryMethod: undefined,
|
||||
// 备注
|
||||
notes: undefined,
|
||||
},
|
||||
// 分页查询结果
|
||||
pagination: {
|
||||
currentPage: 1,
|
||||
pageSize: 30,
|
||||
total: 1,
|
||||
pageSizes,
|
||||
},
|
||||
// 加载
|
||||
loading: false,
|
||||
};
|
||||
},
|
||||
getters: {},
|
||||
actions: {
|
||||
/** 获取债务回收管理表 */
|
||||
async getDebtCollectionManagementList() {
|
||||
// 整理请求参数
|
||||
const data = { ...this.pagination, ...this.form };
|
||||
delete data.pageSizes;
|
||||
delete data.total;
|
||||
delete data.background;
|
||||
|
||||
// 获取债务回收管理表列表
|
||||
const result = await fetchGetDebtCollectionManagementList(data);
|
||||
|
||||
// 公共页面函数hook
|
||||
const pagination = storePagination.bind(this);
|
||||
return pagination(result);
|
||||
},
|
||||
|
||||
/** 添加债务回收管理表 */
|
||||
async addDebtCollectionManagement(data: any) {
|
||||
const result = await fetchAddDebtCollectionManagement(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
|
||||
/** 修改债务回收管理表 */
|
||||
async updateDebtCollectionManagement(data: any) {
|
||||
const result = await fetchUpdateDebtCollectionManagement(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
|
||||
/** 删除债务回收管理表 */
|
||||
async deleteDebtCollectionManagement(data: any) {
|
||||
const result = await fetchDeleteDebtCollectionManagement(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
},
|
||||
});
|
|
@ -1,5 +1,5 @@
|
|||
import { defineStore } from 'pinia';
|
||||
import { fetchAddBill, fetchDeleteBill, fetchGetBillList, fetchUpdateBill } from '@/api/v1/financial/bill';
|
||||
import { fetchAddBill, fetchDeleteBill, fetchGetBillList, fetchUpdateBill } from '@/api/v1/financialUser/billUser';
|
||||
import { pageSizes } from '@/enums/baseConstant';
|
||||
import { storeMessage } from '@/utils/message';
|
||||
import { storePagination } from '@/store/useStorePagination';
|
|
@ -5,7 +5,7 @@ import {
|
|||
fetchGetCategoryUserAllList,
|
||||
fetchGetCategoryUserList,
|
||||
fetchUpdateCategoryUser,
|
||||
} from '@/api/v1/financial/categoryUser';
|
||||
} from '@/api/v1/financialUser/categoryUser';
|
||||
import { pageSizes } from '@/enums/baseConstant';
|
||||
import { storeMessage } from '@/utils/message';
|
||||
import { storePagination } from '@/store/useStorePagination';
|
|
@ -1,13 +1,13 @@
|
|||
<script lang="ts" setup>
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { FormInstance } from 'element-plus';
|
||||
import { rules } from '@/views/financial/bill/utils/columns';
|
||||
import { FormProps } from '@/views/financial/bill/utils/types';
|
||||
import { rules } from '@/views/financial-user/bill-user/utils/columns';
|
||||
import { FormProps } from '@/views/financial-user/bill-user/utils/types';
|
||||
import { $t } from '@/plugins/i18n';
|
||||
import { incomeOrExpend } from '@/enums/baseConstant';
|
||||
import { useBillStore } from '@/store/financial/bill';
|
||||
import { onSearch } from '@/views/financial/bill/utils/hooks';
|
||||
import { useCategoryUserStore } from '@/store/financial/categoryUser';
|
||||
import { useBillStore } from '@/store/financialUser/billUser';
|
||||
import { onSearch } from '@/views/financial-user/bill-user/utils/hooks';
|
||||
import { useCategoryUserStore } from '@/store/financialUser/categoryUser';
|
||||
|
||||
const props = withDefaults(defineProps<FormProps>(), {
|
||||
formInline: () => ({
|
|
@ -1,15 +1,15 @@
|
|||
<script lang="ts" setup>
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { columns } from '@/views/financial/bill/utils/columns';
|
||||
import { columns } from '@/views/financial-user/bill-user/utils/columns';
|
||||
import PureTableBar from '@/components/TableBar/src/bar';
|
||||
import AddFill from '@iconify-icons/ri/add-circle-line';
|
||||
import PureTable from '@pureadmin/table';
|
||||
import { deleteIds, onAdd, onDelete, onDeleteBatch, onSearch, onUpdate } from '@/views/financial/bill/utils/hooks';
|
||||
import { deleteIds, onAdd, onDelete, onDeleteBatch, onSearch, onUpdate } from '@/views/financial-user/bill-user/utils/hooks';
|
||||
import Delete from '@iconify-icons/ep/delete';
|
||||
import EditPen from '@iconify-icons/ep/edit-pen';
|
||||
import Refresh from '@iconify-icons/ep/refresh';
|
||||
import { $t } from '@/plugins/i18n';
|
||||
import { useBillStore } from '@/store/financial/bill';
|
||||
import { useBillStore } from '@/store/financialUser/billUser';
|
||||
import { useRenderIcon } from '@/components/CommonIcon/src/hooks';
|
||||
import { FormInstance } from 'element-plus';
|
||||
import { incomeOrExpend } from '@/enums/baseConstant';
|
|
@ -1,9 +1,9 @@
|
|||
import { addDialog, closeDialog } from '@/components/BaseDialog/index';
|
||||
import BillDialog from '@/views/financial/bill/bill-dialog.vue';
|
||||
import { useBillStore } from '@/store/financial/bill';
|
||||
import BillDialog from '@/views/financial-user/bill-user/bill-dialog.vue';
|
||||
import { useBillStore } from '@/store/financialUser/billUser';
|
||||
import { h, ref } from 'vue';
|
||||
import { message, messageBox } from '@/utils/message';
|
||||
import type { FormItemProps } from '@/views/financial/bill/utils/types';
|
||||
import type { FormItemProps } from '@/views/financial-user/bill-user/utils/types';
|
||||
import { $t } from '@/plugins/i18n';
|
||||
import DeleteBatchDialog from '@/components/Table/DeleteBatchDialog.vue';
|
||||
import dayjs from 'dayjs';
|
|
@ -1,8 +1,8 @@
|
|||
<script lang="ts" setup>
|
||||
import { ref } from 'vue';
|
||||
import { FormInstance } from 'element-plus';
|
||||
import { rules } from '@/views/financial/categoryUser/utils/columns';
|
||||
import { FormProps } from '@/views/financial/categoryUser/utils/types';
|
||||
import { rules } from '@/views/financial-user/category-user/utils/columns';
|
||||
import { FormProps } from '@/views/financial-user/category-user/utils/types';
|
||||
import { $t } from '@/plugins/i18n';
|
||||
|
||||
const props = withDefaults(defineProps<FormProps>(), {
|
|
@ -1,15 +1,15 @@
|
|||
<script lang="ts" setup>
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { columns } from '@/views/financial/categoryUser/utils/columns';
|
||||
import { columns } from '@/views/financial-user/category-user/utils/columns';
|
||||
import PureTableBar from '@/components/TableBar/src/bar';
|
||||
import AddFill from '@iconify-icons/ri/add-circle-line';
|
||||
import PureTable from '@pureadmin/table';
|
||||
import { deleteIds, onAdd, onDelete, onDeleteBatch, onSearch, onUpdate } from '@/views/financial/categoryUser/utils/hooks';
|
||||
import { deleteIds, onAdd, onDelete, onDeleteBatch, onSearch, onUpdate } from '@/views/financial-user/category-user/utils/hooks';
|
||||
import Delete from '@iconify-icons/ep/delete';
|
||||
import EditPen from '@iconify-icons/ep/edit-pen';
|
||||
import Refresh from '@iconify-icons/ep/refresh';
|
||||
import { $t } from '@/plugins/i18n';
|
||||
import { useCategoryUserStore } from '@/store/financial/categoryUser';
|
||||
import { useCategoryUserStore } from '@/store/financialUser/categoryUser';
|
||||
import { useRenderIcon } from '@/components/CommonIcon/src/hooks';
|
||||
import { FormInstance } from 'element-plus';
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
import { addDialog } from '@/components/BaseDialog/index';
|
||||
import CategoryUserDialog from '@/views/financial/categoryUser/category-user-dialog.vue';
|
||||
import { useCategoryUserStore } from '@/store/financial/categoryUser';
|
||||
import CategoryUserDialog from '@/views/financial-user/category-user/category-user-dialog.vue';
|
||||
import { useCategoryUserStore } from '@/store/financialUser/categoryUser';
|
||||
import { h, ref } from 'vue';
|
||||
import { message, messageBox } from '@/utils/message';
|
||||
import type { FormItemProps } from '@/views/financial/categoryUser/utils/types';
|
||||
import type { FormItemProps } from '@/views/financial-user/category-user/utils/types';
|
||||
import { $t } from '@/plugins/i18n';
|
||||
import DeleteBatchDialog from '@/components/Table/DeleteBatchDialog.vue';
|
||||
|
||||
|
@ -22,7 +22,7 @@ export async function onSearch() {
|
|||
/** 添加分类信息 */
|
||||
export function onAdd() {
|
||||
addDialog({
|
||||
title: `${$t('addNew')}${$t('categoryUser')}`,
|
||||
title: `${$t('addNew')}${$t('category-user')}`,
|
||||
width: '30%',
|
||||
props: {
|
||||
formInline: {
|
||||
|
@ -50,7 +50,7 @@ export function onAdd() {
|
|||
/** 更新分类信息 */
|
||||
export function onUpdate(row: any) {
|
||||
addDialog({
|
||||
title: `${$t('modify')}${$t('categoryUser')}`,
|
||||
title: `${$t('modify')}${$t('category-user')}`,
|
||||
width: '30%',
|
||||
props: {
|
||||
formInline: {
|
|
@ -1,9 +1,8 @@
|
|||
<script lang="ts" setup>
|
||||
import { ref } from 'vue';
|
||||
import { FormInstance } from 'element-plus';
|
||||
import { rules } from '@/views/financial/budgetCategory/utils/columns';
|
||||
import { FormProps } from '@/views/financial/budgetCategory/utils/types';
|
||||
import { frameSureOptions } from '@/enums';
|
||||
import { rules } from '@/views/financial/budget-category/utils/columns';
|
||||
import { FormProps } from '@/views/financial/budget-category/utils/types';
|
||||
import { $t } from '@/plugins/i18n';
|
||||
|
||||
const props = withDefaults(defineProps<FormProps>(), {
|
||||
|
@ -35,37 +34,32 @@ defineExpose({ formRef });
|
|||
<el-form ref="formRef" :model="form" :rules="rules" label-width="auto">
|
||||
<!-- 父级id -->
|
||||
<el-form-item :label="$t('parentId')" prop="parentId">
|
||||
<el-input v-model="form.parentId" autocomplete="off" type="text" :placeholder="$t('input') + $t('parentId')" />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 绑定的用户id -->
|
||||
<el-form-item :label="$t('userId')" prop="userId">
|
||||
<el-input v-model="form.userId" autocomplete="off" type="text" :placeholder="$t('input') + $t('userId')" />
|
||||
<el-input v-model="form.parentId" :placeholder="$t('input') + $t('parentId')" autocomplete="off" type="text" />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 分类名称 -->
|
||||
<el-form-item :label="$t('categoryName')" prop="categoryName">
|
||||
<el-input v-model="form.categoryName" autocomplete="off" type="text" :placeholder="$t('input') + $t('categoryName')" />
|
||||
<el-input v-model="form.categoryName" :placeholder="$t('input') + $t('categoryName')" autocomplete="off" type="text" />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 预算名称 -->
|
||||
<el-form-item :label="$t('budgetName')" prop="budgetName">
|
||||
<el-input v-model="form.budgetName" autocomplete="off" type="text" :placeholder="$t('input') + $t('budgetName')" />
|
||||
<el-input v-model="form.budgetName" :placeholder="$t('input') + $t('budgetName')" autocomplete="off" type="text" />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 完成状态 -->
|
||||
<el-form-item :label="$t('statusType')" prop="statusType">
|
||||
<el-input v-model="form.statusType" autocomplete="off" type="text" :placeholder="$t('input') + $t('statusType')" />
|
||||
<el-input v-model="form.statusType" :placeholder="$t('input') + $t('statusType')" autocomplete="off" type="text" />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 预算金额 -->
|
||||
<el-form-item :label="$t('amount')" prop="amount">
|
||||
<el-input v-model="form.amount" autocomplete="off" type="text" :placeholder="$t('input') + $t('amount')" />
|
||||
<el-input v-model="form.amount" :placeholder="$t('input') + $t('amount')" autocomplete="off" type="text" />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 预算周期 -->
|
||||
<el-form-item :label="$t('period')" prop="period">
|
||||
<el-input v-model="form.period" autocomplete="off" type="text" :placeholder="$t('input') + $t('period')" />
|
||||
<el-input v-model="form.period" :placeholder="$t('input') + $t('period')" autocomplete="off" type="text" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
|
@ -1,10 +1,10 @@
|
|||
<script lang="ts" setup>
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { columns } from '@/views/financial/budgetCategory/utils/columns';
|
||||
import { columns } from '@/views/financial/budget-category/utils/columns';
|
||||
import PureTableBar from '@/components/TableBar/src/bar';
|
||||
import AddFill from '@iconify-icons/ri/add-circle-line';
|
||||
import PureTable from '@pureadmin/table';
|
||||
import { deleteIds, onAdd, onDelete, onDeleteBatch, onSearch, onUpdate } from '@/views/financial/budgetCategory/utils/hooks';
|
||||
import { deleteIds, onAdd, onDelete, onDeleteBatch, onSearch, onUpdate } from '@/views/financial/budget-category/utils/hooks';
|
||||
import Delete from '@iconify-icons/ep/delete';
|
||||
import EditPen from '@iconify-icons/ep/edit-pen';
|
||||
import Refresh from '@iconify-icons/ep/refresh';
|
||||
|
@ -50,14 +50,9 @@ onMounted(() => {
|
|||
<template>
|
||||
<div class="main">
|
||||
<el-form ref="formRef" :inline="true" :model="budgetCategoryStore.form" class="search-form bg-bg_color w-[99/100] pl-8 pt-[12px] overflow-auto">
|
||||
<!-- 父级id -->
|
||||
<el-form-item :label="$t('parentId')" prop="parentId">
|
||||
<el-input v-model="budgetCategoryStore.form.parentId" :placeholder="`${$t('input')}${$t('parentId')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 绑定的用户id -->
|
||||
<el-form-item :label="$t('userId')" prop="userId">
|
||||
<el-input v-model="budgetCategoryStore.form.userId" :placeholder="`${$t('input')}${$t('userId')}`" class="!w-[180px]" clearable />
|
||||
<el-form-item :label="$t('user')" prop="userId">
|
||||
<el-input v-model="budgetCategoryStore.form.userId" :placeholder="`${$t('input')}${$t('user')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 分类名称 -->
|
||||
|
@ -84,6 +79,8 @@ onMounted(() => {
|
|||
<el-form-item :label="$t('period')" prop="period">
|
||||
<el-input v-model="budgetCategoryStore.form.period" :placeholder="`${$t('input')}${$t('period')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 搜索和重置 -->
|
||||
<el-form-item>
|
||||
<el-button :icon="useRenderIcon('ri:search-line')" :loading="budgetCategoryStore.loading" type="primary" @click="onSearch"> {{ $t('search') }} </el-button>
|
||||
<el-button :icon="useRenderIcon(Refresh)" @click="resetForm(formRef)"> {{ $t('buttons.reset') }}</el-button>
|
||||
|
@ -108,6 +105,7 @@ onMounted(() => {
|
|||
:data="budgetCategoryStore.datalist"
|
||||
:header-cell-style="{ background: 'var(--el-fill-color-light)', color: 'var(--el-text-color-primary)' }"
|
||||
:loading="budgetCategoryStore.loading"
|
||||
:pagination="budgetCategoryStore.pagination"
|
||||
:size="size"
|
||||
adaptive
|
||||
align-whole="center"
|
||||
|
@ -116,7 +114,6 @@ onMounted(() => {
|
|||
row-key="id"
|
||||
showOverflowTooltip
|
||||
table-layout="auto"
|
||||
:pagination="budgetCategoryStore.pagination"
|
||||
@page-size-change="onPageSizeChange"
|
||||
@selection-change="onSelectionChange"
|
||||
@page-current-change="onCurrentPageChange"
|
|
@ -6,10 +6,8 @@ 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('parentId'), prop: 'parentId' },
|
||||
// 绑定的用户id
|
||||
{ label: $t('userId'), prop: 'userId' },
|
||||
{ label: $t('nickname'), prop: 'nickname' },
|
||||
// 分类名称
|
||||
{ label: $t('categoryName'), prop: 'categoryName' },
|
||||
// 预算名称
|
||||
|
@ -29,10 +27,6 @@ export const columns: TableColumnList = [
|
|||
|
||||
// 添加规则
|
||||
export const rules = reactive<FormRules>({
|
||||
// 父级id
|
||||
parentId: [{ required: true, message: `${$t('input')}${$t('parentId')}`, trigger: 'blur' }],
|
||||
// 绑定的用户id
|
||||
userId: [{ required: true, message: `${$t('input')}${$t('userId')}`, trigger: 'blur' }],
|
||||
// 分类名称
|
||||
categoryName: [{ required: true, message: `${$t('input')}${$t('categoryName')}`, trigger: 'blur' }],
|
||||
// 预算名称
|
|
@ -1,9 +1,9 @@
|
|||
import { addDialog } from '@/components/BaseDialog/index';
|
||||
import BudgetCategoryDialog from '@/views/financial/budgetCategory/budget-category-dialog.vue';
|
||||
import BudgetCategoryDialog from '@/views/financial/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/budgetCategory/utils/types';
|
||||
import type { FormItemProps } from '@/views/financial/budget-category/utils/types';
|
||||
import { $t } from '@/plugins/i18n';
|
||||
import DeleteBatchDialog from '@/components/Table/DeleteBatchDialog.vue';
|
||||
|
||||
|
@ -22,12 +22,11 @@ export async function onSearch() {
|
|||
/** 添加预算分类表 */
|
||||
export function onAdd() {
|
||||
addDialog({
|
||||
title: `${$t('addNew')}${$t('budgetCategory')}`,
|
||||
title: `${$t('addNew')}${$t('budget-category')}`,
|
||||
width: '30%',
|
||||
props: {
|
||||
formInline: {
|
||||
parentId: undefined,
|
||||
userId: undefined,
|
||||
categoryName: undefined,
|
||||
budgetName: undefined,
|
||||
statusType: undefined,
|
||||
|
@ -56,12 +55,11 @@ export function onAdd() {
|
|||
/** 更新预算分类表 */
|
||||
export function onUpdate(row: any) {
|
||||
addDialog({
|
||||
title: `${$t('modify')}${$t('budgetCategory')}`,
|
||||
title: `${$t('modify')}${$t('budget-category')}`,
|
||||
width: '30%',
|
||||
props: {
|
||||
formInline: {
|
||||
parentId: row.parentId,
|
||||
userId: row.userId,
|
||||
categoryName: row.categoryName,
|
||||
budgetName: row.budgetName,
|
||||
statusType: row.statusType,
|
|
@ -1,8 +1,8 @@
|
|||
<script lang="ts" setup>
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { FormInstance } from 'element-plus';
|
||||
import { rules } from '@/views/configuration/category/utils/columns';
|
||||
import { FormProps } from '@/views/configuration/category/utils/types';
|
||||
import { rules } from '@/views/financial/category/utils/columns';
|
||||
import { FormProps } from '@/views/financial/category/utils/types';
|
||||
import { $t } from '@/plugins/i18n';
|
||||
import { usePublicHooks } from '@/views/hooks';
|
||||
import LoadingSvg from '@/assets/svg/loading.svg';
|
|
@ -1,10 +1,10 @@
|
|||
<script lang="ts" setup>
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { columns } from '@/views/configuration/category/utils/columns';
|
||||
import { columns } from '@/views/financial/category/utils/columns';
|
||||
import PureTableBar from '@/components/TableBar/src/bar';
|
||||
import AddFill from '@iconify-icons/ri/add-circle-line';
|
||||
import PureTable from '@pureadmin/table';
|
||||
import { deleteIds, onAdd, onDelete, onDeleteBatch, onSearch, onUpdate, onUpdateIsBuiltin } from '@/views/configuration/category/utils/hooks';
|
||||
import { deleteIds, onAdd, onDelete, onDeleteBatch, onSearch, onUpdate, onUpdateIsBuiltin } from '@/views/financial/category/utils/hooks';
|
||||
import Delete from '@iconify-icons/ep/delete';
|
||||
import EditPen from '@iconify-icons/ep/edit-pen';
|
||||
import Refresh from '@iconify-icons/ep/refresh';
|
|
@ -1,9 +1,9 @@
|
|||
import { addDialog } from '@/components/BaseDialog/index';
|
||||
import CategoryDialog from '@/views/configuration/category/category-dialog.vue';
|
||||
import CategoryDialog from '@/views/financial/category/category-dialog.vue';
|
||||
import { useCategoryStore } from '@/store/financial/category';
|
||||
import { h, ref } from 'vue';
|
||||
import { message, messageBox } from '@/utils/message';
|
||||
import type { FormItemProps } from '@/views/configuration/category/utils/types';
|
||||
import type { FormItemProps } from '@/views/financial/category/utils/types';
|
||||
import { $t } from '@/plugins/i18n';
|
||||
import DeleteBatchDialog from '@/components/Table/DeleteBatchDialog.vue';
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
<script lang="ts" setup>
|
||||
import { ref } from 'vue';
|
||||
import { FormInstance } from 'element-plus';
|
||||
import { rules } from '@/views/financial/debtRepaymentPlan/utils/columns';
|
||||
import { FormProps } from '@/views/financial/debtRepaymentPlan/utils/types';
|
||||
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';
|
||||
|
||||
const props = withDefaults(defineProps<FormProps>(), {
|
|
@ -1,10 +1,10 @@
|
|||
<script lang="ts" setup>
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { columns } from '@/views/financial/debtRepaymentPlan/utils/columns';
|
||||
import { columns } from '@/views/financial/debt-repayment-plan/utils/columns';
|
||||
import PureTableBar from '@/components/TableBar/src/bar';
|
||||
import AddFill from '@iconify-icons/ri/add-circle-line';
|
||||
import PureTable from '@pureadmin/table';
|
||||
import { deleteIds, onAdd, onDelete, onDeleteBatch, onSearch, onUpdate } from '@/views/financial/debtRepaymentPlan/utils/hooks';
|
||||
import { deleteIds, onAdd, onDelete, onDeleteBatch, onSearch, onUpdate } from '@/views/financial/debt-repayment-plan/utils/hooks';
|
||||
import Delete from '@iconify-icons/ep/delete';
|
||||
import EditPen from '@iconify-icons/ep/edit-pen';
|
||||
import Refresh from '@iconify-icons/ep/refresh';
|
|
@ -1,9 +1,9 @@
|
|||
import { addDialog } from '@/components/BaseDialog/index';
|
||||
import DebtRepaymentPlanDialog from '@/views/financial/debtRepaymentPlan/debt-repayment-plan-dialog.vue';
|
||||
import DebtRepaymentPlanDialog from '@/views/financial/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/debtRepaymentPlan/utils/types';
|
||||
import type { FormItemProps } from '@/views/financial/debt-repayment-plan/utils/types';
|
||||
import { $t } from '@/plugins/i18n';
|
||||
import DeleteBatchDialog from '@/components/Table/DeleteBatchDialog.vue';
|
||||
|
||||
|
@ -22,7 +22,7 @@ export async function onSearch() {
|
|||
/** 添加债务还款计划表 */
|
||||
export function onAdd() {
|
||||
addDialog({
|
||||
title: `${$t('addNew')}${$t('debtRepaymentPlan')}`,
|
||||
title: `${$t('addNew')}${$t('debt-repayment-plan')}`,
|
||||
width: '30%',
|
||||
props: {
|
||||
formInline: {
|
||||
|
@ -55,7 +55,7 @@ export function onAdd() {
|
|||
/** 更新债务还款计划表 */
|
||||
export function onUpdate(row: any) {
|
||||
addDialog({
|
||||
title: `${$t('modify')}${$t('debtRepaymentPlan')}`,
|
||||
title: `${$t('modify')}${$t('debt-repayment-plan')}`,
|
||||
width: '30%',
|
||||
props: {
|
||||
formInline: {
|
|
@ -1,9 +1,8 @@
|
|||
<script lang="ts" setup>
|
||||
import { ref } from 'vue';
|
||||
import { FormInstance } from 'element-plus';
|
||||
import { rules } from '@/views/financial/debtTracking/utils/columns';
|
||||
import { FormProps } from '@/views/financial/debtTracking/utils/types';
|
||||
import { frameSureOptions } from '@/enums';
|
||||
import { rules } from '@/views/financial/debt-tracking/utils/columns';
|
||||
import { FormProps } from '@/views/financial/debt-tracking/utils/types';
|
||||
import { $t } from '@/plugins/i18n';
|
||||
|
||||
const props = withDefaults(defineProps<FormProps>(), {
|
||||
|
@ -33,32 +32,32 @@ defineExpose({ formRef });
|
|||
<el-form ref="formRef" :model="form" :rules="rules" label-width="auto">
|
||||
<!-- 绑定的用户 -->
|
||||
<el-form-item :label="$t('userId')" prop="userId">
|
||||
<el-input v-model="form.userId" autocomplete="off" type="text" :placeholder="$t('input') + $t('userId')" />
|
||||
<el-input v-model="form.userId" :placeholder="$t('input') + $t('userId')" autocomplete="off" type="text" />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 债务人姓名 -->
|
||||
<el-form-item :label="$t('debtorName')" prop="debtorName">
|
||||
<el-input v-model="form.debtorName" autocomplete="off" type="text" :placeholder="$t('input') + $t('debtorName')" />
|
||||
<el-input v-model="form.debtorName" :placeholder="$t('input') + $t('debtorName')" autocomplete="off" type="text" />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 债务金额 -->
|
||||
<el-form-item :label="$t('debtAmount')" prop="debtAmount">
|
||||
<el-input v-model="form.debtAmount" autocomplete="off" type="text" :placeholder="$t('input') + $t('debtAmount')" />
|
||||
<el-input v-model="form.debtAmount" :placeholder="$t('input') + $t('debtAmount')" autocomplete="off" type="text" />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 债务类型 -->
|
||||
<el-form-item :label="$t('debtType')" prop="debtType">
|
||||
<el-input v-model="form.debtType" autocomplete="off" type="text" :placeholder="$t('input') + $t('debtType')" />
|
||||
<el-input v-model="form.debtType" :placeholder="$t('input') + $t('debtType')" autocomplete="off" type="text" />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 债务状态 -->
|
||||
<el-form-item :label="$t('debtStatus')" prop="debtStatus">
|
||||
<el-input v-model="form.debtStatus" autocomplete="off" type="text" :placeholder="$t('input') + $t('debtStatus')" />
|
||||
<el-input v-model="form.debtStatus" :placeholder="$t('input') + $t('debtStatus')" autocomplete="off" type="text" />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 还款截止日期 -->
|
||||
<el-form-item :label="$t('dueDate')" prop="dueDate">
|
||||
<el-input v-model="form.dueDate" autocomplete="off" type="text" :placeholder="$t('input') + $t('dueDate')" />
|
||||
<el-input v-model="form.dueDate" :placeholder="$t('input') + $t('dueDate')" autocomplete="off" type="text" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
|
@ -1,10 +1,10 @@
|
|||
<script lang="ts" setup>
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { columns } from '@/views/financial/debtTracking/utils/columns';
|
||||
import { columns } from '@/views/financial/debt-tracking/utils/columns';
|
||||
import PureTableBar from '@/components/TableBar/src/bar';
|
||||
import AddFill from '@iconify-icons/ri/add-circle-line';
|
||||
import PureTable from '@pureadmin/table';
|
||||
import { deleteIds, onAdd, onDelete, onDeleteBatch, onSearch, onUpdate } from '@/views/financial/debtTracking/utils/hooks';
|
||||
import { deleteIds, onAdd, onDelete, onDeleteBatch, onSearch, onUpdate } from '@/views/financial/debt-tracking/utils/hooks';
|
||||
import Delete from '@iconify-icons/ep/delete';
|
||||
import EditPen from '@iconify-icons/ep/edit-pen';
|
||||
import Refresh from '@iconify-icons/ep/refresh';
|
|
@ -1,9 +1,9 @@
|
|||
import { addDialog } from '@/components/BaseDialog/index';
|
||||
import DebtTrackingDialog from '@/views/financial/debtTracking/debt-tracking-dialog.vue';
|
||||
import DebtTrackingDialog from '@/views/financial/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/debtTracking/utils/types';
|
||||
import type { FormItemProps } from '@/views/financial/debt-tracking/utils/types';
|
||||
import { $t } from '@/plugins/i18n';
|
||||
import DeleteBatchDialog from '@/components/Table/DeleteBatchDialog.vue';
|
||||
|
||||
|
@ -22,7 +22,7 @@ export async function onSearch() {
|
|||
/** 添加债务追踪 */
|
||||
export function onAdd() {
|
||||
addDialog({
|
||||
title: `${$t('addNew')}${$t('debtTracking')}`,
|
||||
title: `${$t('addNew')}${$t('debt-tracking')}`,
|
||||
width: '30%',
|
||||
props: {
|
||||
formInline: {
|
||||
|
@ -55,7 +55,7 @@ export function onAdd() {
|
|||
/** 更新债务追踪 */
|
||||
export function onUpdate(row: any) {
|
||||
addDialog({
|
||||
title: `${$t('modify')}${$t('debtTracking')}`,
|
||||
title: `${$t('modify')}${$t('debt-tracking')}`,
|
||||
width: '30%',
|
||||
props: {
|
||||
formInline: {
|
|
@ -1,56 +0,0 @@
|
|||
<script lang="ts" setup>
|
||||
import { ref } from 'vue';
|
||||
import { FormInstance } from 'element-plus';
|
||||
import { rules } from '@/views/financial/debtCollectionManagement/utils/columns';
|
||||
import { FormProps } from '@/views/financial/debtCollectionManagement/utils/types';
|
||||
import { $t } from '@/plugins/i18n';
|
||||
|
||||
const props = withDefaults(defineProps<FormProps>(), {
|
||||
formInline: () => ({
|
||||
// 债务ID
|
||||
debtId: undefined,
|
||||
// 回收日期
|
||||
recoveryDate: undefined,
|
||||
// 回收金额
|
||||
recoveryAmount: undefined,
|
||||
// 回收方式
|
||||
recoveryMethod: undefined,
|
||||
// 备注
|
||||
notes: undefined,
|
||||
}),
|
||||
});
|
||||
|
||||
const formRef = ref<FormInstance>();
|
||||
const form = ref(props.formInline);
|
||||
|
||||
defineExpose({ formRef });
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<el-form ref="formRef" :model="form" :rules="rules" label-width="auto">
|
||||
<!-- 债务ID -->
|
||||
<el-form-item :label="$t('debtId')" prop="debtId">
|
||||
<el-input v-model="form.debtId" :placeholder="$t('input') + $t('debtId')" autocomplete="off" type="text" />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 回收日期 -->
|
||||
<el-form-item :label="$t('recoveryDate')" prop="recoveryDate">
|
||||
<el-input v-model="form.recoveryDate" :placeholder="$t('input') + $t('recoveryDate')" autocomplete="off" type="text" />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 回收金额 -->
|
||||
<el-form-item :label="$t('recoveryAmount')" prop="recoveryAmount">
|
||||
<el-input v-model="form.recoveryAmount" :placeholder="$t('input') + $t('recoveryAmount')" autocomplete="off" type="text" />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 回收方式 -->
|
||||
<el-form-item :label="$t('recoveryMethod')" prop="recoveryMethod">
|
||||
<el-input v-model="form.recoveryMethod" :placeholder="$t('input') + $t('recoveryMethod')" autocomplete="off" type="text" />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 备注 -->
|
||||
<el-form-item :label="$t('notes')" prop="notes">
|
||||
<el-input v-model="form.notes" :placeholder="$t('input') + $t('notes')" autocomplete="off" type="text" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
|
@ -1,130 +0,0 @@
|
|||
<script lang="ts" setup>
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { columns } from '@/views/financial/debtCollectionManagement/utils/columns';
|
||||
import PureTableBar from '@/components/TableBar/src/bar';
|
||||
import AddFill from '@iconify-icons/ri/add-circle-line';
|
||||
import PureTable from '@pureadmin/table';
|
||||
import { deleteIds, onAdd, onDelete, onDeleteBatch, onSearch, onUpdate } from '@/views/financial/debtCollectionManagement/utils/hooks';
|
||||
import Delete from '@iconify-icons/ep/delete';
|
||||
import EditPen from '@iconify-icons/ep/edit-pen';
|
||||
import Refresh from '@iconify-icons/ep/refresh';
|
||||
import { $t } from '@/plugins/i18n';
|
||||
import { useDebtCollectionManagementStore } from '@/store/financial/debtCollectionManagement';
|
||||
import { useRenderIcon } from '@/components/CommonIcon/src/hooks';
|
||||
import { FormInstance } from 'element-plus';
|
||||
|
||||
const tableRef = ref();
|
||||
const formRef = ref();
|
||||
const debtCollectionManagementStore = useDebtCollectionManagementStore();
|
||||
|
||||
/** 当前页改变时 */
|
||||
const onCurrentPageChange = async (value: number) => {
|
||||
debtCollectionManagementStore.pagination.currentPage = value;
|
||||
await onSearch();
|
||||
};
|
||||
|
||||
/** 当分页发生变化 */
|
||||
const onPageSizeChange = async (value: number) => {
|
||||
debtCollectionManagementStore.pagination.pageSize = value;
|
||||
await onSearch();
|
||||
};
|
||||
|
||||
/** 选择多行 */
|
||||
const onSelectionChange = (rows: Array<any>) => {
|
||||
deleteIds.value = rows.map((row: any) => row.id);
|
||||
};
|
||||
|
||||
/** 重置表单 */
|
||||
const resetForm = async (formEl: FormInstance | undefined) => {
|
||||
if (!formEl) return;
|
||||
formEl.resetFields();
|
||||
await onSearch();
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
onSearch();
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="main">
|
||||
<el-form ref="formRef" :inline="true" :model="debtCollectionManagementStore.form" class="search-form bg-bg_color w-[99/100] pl-8 pt-[12px] overflow-auto">
|
||||
<!-- 债务ID -->
|
||||
<el-form-item :label="$t('debtId')" prop="debtId">
|
||||
<el-input v-model="debtCollectionManagementStore.form.debtId" :placeholder="`${$t('input')}${$t('debtId')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 回收日期 -->
|
||||
<el-form-item :label="$t('recoveryDate')" prop="recoveryDate">
|
||||
<el-input v-model="debtCollectionManagementStore.form.recoveryDate" :placeholder="`${$t('input')}${$t('recoveryDate')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 回收金额 -->
|
||||
<el-form-item :label="$t('recoveryAmount')" prop="recoveryAmount">
|
||||
<el-input v-model="debtCollectionManagementStore.form.recoveryAmount" :placeholder="`${$t('input')}${$t('recoveryAmount')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 回收方式 -->
|
||||
<el-form-item :label="$t('recoveryMethod')" prop="recoveryMethod">
|
||||
<el-input v-model="debtCollectionManagementStore.form.recoveryMethod" :placeholder="`${$t('input')}${$t('recoveryMethod')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 备注 -->
|
||||
<el-form-item :label="$t('notes')" prop="notes">
|
||||
<el-input v-model="debtCollectionManagementStore.form.notes" :placeholder="`${$t('input')}${$t('notes')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button :icon="useRenderIcon('ri:search-line')" :loading="debtCollectionManagementStore.loading" type="primary" @click="onSearch">
|
||||
{{ $t('search') }}
|
||||
</el-button>
|
||||
<el-button :icon="useRenderIcon(Refresh)" @click="resetForm(formRef)"> {{ $t('buttons.reset') }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<PureTableBar :columns="columns" title="债务回收管理表" @fullscreen="tableRef.setAdaptive()" @refresh="onSearch">
|
||||
<template #buttons>
|
||||
<el-button :icon="useRenderIcon(AddFill)" type="primary" @click="onAdd"> {{ $t('addNew') }}</el-button>
|
||||
|
||||
<!-- 批量删除按钮 -->
|
||||
<el-button v-show="deleteIds.length > 0" :icon="useRenderIcon(Delete)" type="danger" @click="onDeleteBatch">
|
||||
{{ $t('delete_batches') }}
|
||||
</el-button>
|
||||
</template>
|
||||
|
||||
<template v-slot="{ size, dynamicColumns }">
|
||||
<pure-table
|
||||
ref="tableRef"
|
||||
:adaptiveConfig="{ offsetBottom: 96 }"
|
||||
:columns="dynamicColumns"
|
||||
:data="debtCollectionManagementStore.datalist"
|
||||
:header-cell-style="{ background: 'var(--el-fill-color-light)', color: 'var(--el-text-color-primary)' }"
|
||||
:loading="debtCollectionManagementStore.loading"
|
||||
:pagination="debtCollectionManagementStore.pagination"
|
||||
:size="size"
|
||||
adaptive
|
||||
align-whole="center"
|
||||
border
|
||||
highlight-current-row
|
||||
row-key="id"
|
||||
showOverflowTooltip
|
||||
table-layout="auto"
|
||||
@page-size-change="onPageSizeChange"
|
||||
@selection-change="onSelectionChange"
|
||||
@page-current-change="onCurrentPageChange"
|
||||
>
|
||||
<template #operation="{ row }">
|
||||
<el-button :icon="useRenderIcon(EditPen)" :size="size" class="reset-margin" link type="primary" @click="onUpdate(row)"> {{ $t('modify') }} </el-button>
|
||||
<el-button :icon="useRenderIcon(AddFill)" :size="size" class="reset-margin" link type="primary" @click="onAdd"> {{ $t('addNew') }} </el-button>
|
||||
<el-popconfirm :title="`${$t('delete')}?`" @confirm="onDelete(row)">
|
||||
<template #reference>
|
||||
<el-button :icon="useRenderIcon(Delete)" :size="size" class="reset-margin" link type="primary">
|
||||
{{ $t('delete') }}
|
||||
</el-button>
|
||||
</template>
|
||||
</el-popconfirm>
|
||||
</template>
|
||||
</pure-table>
|
||||
</template>
|
||||
</PureTableBar>
|
||||
</div>
|
||||
</template>
|
|
@ -1,36 +0,0 @@
|
|||
import { reactive } from 'vue';
|
||||
import { $t } from '@/plugins/i18n';
|
||||
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('debtId'), prop: 'debtId' },
|
||||
// 回收日期
|
||||
{ label: $t('recoveryDate'), prop: 'recoveryDate' },
|
||||
// 回收金额
|
||||
{ label: $t('recoveryAmount'), prop: 'recoveryAmount' },
|
||||
// 回收方式
|
||||
{ label: $t('recoveryMethod'), prop: 'recoveryMethod' },
|
||||
// 备注
|
||||
{ label: $t('notes'), prop: 'notes' },
|
||||
{ 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' },
|
||||
];
|
||||
|
||||
// 添加规则
|
||||
export const rules = reactive<FormRules>({
|
||||
// 债务ID
|
||||
debtId: [{ required: true, message: `${$t('input')}${$t('debtId')}`, trigger: 'blur' }],
|
||||
// 回收日期
|
||||
recoveryDate: [{ required: true, message: `${$t('input')}${$t('recoveryDate')}`, trigger: 'blur' }],
|
||||
// 回收金额
|
||||
recoveryAmount: [{ required: true, message: `${$t('input')}${$t('recoveryAmount')}`, trigger: 'blur' }],
|
||||
// 回收方式
|
||||
recoveryMethod: [{ required: true, message: `${$t('input')}${$t('recoveryMethod')}`, trigger: 'blur' }],
|
||||
// 备注
|
||||
notes: [{ required: true, message: `${$t('input')}${$t('notes')}`, trigger: 'blur' }],
|
||||
});
|
|
@ -1,132 +0,0 @@
|
|||
import { addDialog } from '@/components/BaseDialog/index';
|
||||
import DebtCollectionManagementDialog from '@/views/financial/debtCollectionManagement/debt-collection-management-dialog.vue';
|
||||
import { useDebtCollectionManagementStore } from '@/store/financial/debtCollectionManagement';
|
||||
import { h, ref } from 'vue';
|
||||
import { message, messageBox } from '@/utils/message';
|
||||
import type { FormItemProps } from '@/views/financial/debtCollectionManagement/utils/types';
|
||||
import { $t } from '@/plugins/i18n';
|
||||
import DeleteBatchDialog from '@/components/Table/DeleteBatchDialog.vue';
|
||||
|
||||
export const formRef = ref();
|
||||
// 删除ids
|
||||
export const deleteIds = ref([]);
|
||||
const debtCollectionManagementStore = useDebtCollectionManagementStore();
|
||||
|
||||
/** 搜索初始化债务回收管理表 */
|
||||
export async function onSearch() {
|
||||
debtCollectionManagementStore.loading = true;
|
||||
await debtCollectionManagementStore.getDebtCollectionManagementList();
|
||||
debtCollectionManagementStore.loading = false;
|
||||
}
|
||||
|
||||
/** 添加债务回收管理表 */
|
||||
export function onAdd() {
|
||||
addDialog({
|
||||
title: `${$t('addNew')}${$t('debtCollectionManagement')}`,
|
||||
width: '30%',
|
||||
props: {
|
||||
formInline: {
|
||||
debtId: undefined,
|
||||
recoveryDate: undefined,
|
||||
recoveryAmount: undefined,
|
||||
recoveryMethod: undefined,
|
||||
notes: undefined,
|
||||
},
|
||||
},
|
||||
draggable: true,
|
||||
fullscreenIcon: true,
|
||||
closeOnClickModal: false,
|
||||
contentRenderer: () => h(DebtCollectionManagementDialog, { 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 debtCollectionManagementStore.addDebtCollectionManagement(form);
|
||||
if (!result) return;
|
||||
done();
|
||||
await onSearch();
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/** 更新债务回收管理表 */
|
||||
export function onUpdate(row: any) {
|
||||
addDialog({
|
||||
title: `${$t('modify')}${$t('debtCollectionManagement')}`,
|
||||
width: '30%',
|
||||
props: {
|
||||
formInline: {
|
||||
debtId: row.debtId,
|
||||
recoveryDate: row.recoveryDate,
|
||||
recoveryAmount: row.recoveryAmount,
|
||||
recoveryMethod: row.recoveryMethod,
|
||||
notes: row.notes,
|
||||
},
|
||||
},
|
||||
draggable: true,
|
||||
fullscreenIcon: true,
|
||||
closeOnClickModal: false,
|
||||
contentRenderer: () => h(DebtCollectionManagementDialog, { 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 debtCollectionManagementStore.updateDebtCollectionManagement({ ...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 debtCollectionManagementStore.deleteDebtCollectionManagement([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 debtCollectionManagementStore.deleteDebtCollectionManagement(ids);
|
||||
await onSearch();
|
||||
|
||||
done();
|
||||
} else message($t('deleteBatchTip'), { type: 'warning' });
|
||||
});
|
||||
},
|
||||
});
|
||||
};
|
|
@ -1,18 +0,0 @@
|
|||
// 添加或者修改表单元素
|
||||
export interface FormItemProps {
|
||||
// 债务ID
|
||||
debtId: number;
|
||||
// 回收日期
|
||||
recoveryDate: any;
|
||||
// 回收金额
|
||||
recoveryAmount: any;
|
||||
// 回收方式
|
||||
recoveryMethod: string;
|
||||
// 备注
|
||||
notes: string;
|
||||
}
|
||||
|
||||
// 添加或修改表单Props
|
||||
export interface FormProps {
|
||||
formInline: FormItemProps;
|
||||
}
|
|
@ -1,10 +1,10 @@
|
|||
<script lang="ts" setup>
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { columns } from '@/views/financial/savingGoal/utils/columns';
|
||||
import { columns } from '@/views/financial/saving-goal/utils/columns';
|
||||
import PureTableBar from '@/components/TableBar/src/bar';
|
||||
import AddFill from '@iconify-icons/ri/add-circle-line';
|
||||
import PureTable from '@pureadmin/table';
|
||||
import { deleteIds, onAdd, onDelete, onDeleteBatch, onSearch, onUpdate } from '@/views/financial/savingGoal/utils/hooks';
|
||||
import { deleteIds, onAdd, onDelete, onDeleteBatch, onSearch, onUpdate } from '@/views/financial/saving-goal/utils/hooks';
|
||||
import Delete from '@iconify-icons/ep/delete';
|
||||
import EditPen from '@iconify-icons/ep/edit-pen';
|
||||
import Refresh from '@iconify-icons/ep/refresh';
|
|
@ -1,8 +1,8 @@
|
|||
<script lang="ts" setup>
|
||||
import { ref } from 'vue';
|
||||
import { FormInstance } from 'element-plus';
|
||||
import { rules } from '@/views/financial/savingGoal/utils/columns';
|
||||
import { FormProps } from '@/views/financial/savingGoal/utils/types';
|
||||
import { rules } from '@/views/financial/saving-goal/utils/columns';
|
||||
import { FormProps } from '@/views/financial/saving-goal/utils/types';
|
||||
import { $t } from '@/plugins/i18n';
|
||||
|
||||
const props = withDefaults(defineProps<FormProps>(), {
|
|
@ -1,9 +1,9 @@
|
|||
import { addDialog } from '@/components/BaseDialog/index';
|
||||
import SavingGoalDialog from '@/views/financial/savingGoal/saving-goal-dialog.vue';
|
||||
import SavingGoalDialog from '@/views/financial/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/savingGoal/utils/types';
|
||||
import type { FormItemProps } from '@/views/financial/saving-goal/utils/types';
|
||||
import { $t } from '@/plugins/i18n';
|
||||
import DeleteBatchDialog from '@/components/Table/DeleteBatchDialog.vue';
|
||||
|
||||
|
@ -22,7 +22,7 @@ export async function onSearch() {
|
|||
/** 添加用户储值 */
|
||||
export function onAdd() {
|
||||
addDialog({
|
||||
title: `${$t('addNew')}${$t('savingGoal')}`,
|
||||
title: `${$t('addNew')}${$t('saving-goal')}`,
|
||||
width: '30%',
|
||||
props: {
|
||||
formInline: {
|
||||
|
@ -54,7 +54,7 @@ export function onAdd() {
|
|||
/** 更新用户储值 */
|
||||
export function onUpdate(row: any) {
|
||||
addDialog({
|
||||
title: `${$t('modify')}${$t('savingGoal')}`,
|
||||
title: `${$t('modify')}${$t('saving-goal')}`,
|
||||
width: '30%',
|
||||
props: {
|
||||
formInline: {
|
Loading…
Reference in New Issue