completepage: 🍻 债务追踪和部分bug修复
This commit is contained in:
parent
e4d81d0357
commit
fe5a9c10e1
|
@ -0,0 +1,22 @@
|
||||||
|
import { http } from '@/api/service/request';
|
||||||
|
import type { BaseResult, ResultTable } from '@/api/service/types';
|
||||||
|
|
||||||
|
/** 债务追踪---获取债务追踪列表 */
|
||||||
|
export const fetchGetUserDebtTrackingList = (data: any) => {
|
||||||
|
return http.request<BaseResult<ResultTable>>('get', `debtTracking/noManage/getUserDebtTrackingList/${data.currentPage}/${data.pageSize}`, { params: data });
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 债务追踪---添加债务追踪 */
|
||||||
|
export const fetchAddUserDebtTracking = (data: any) => {
|
||||||
|
return http.request<BaseResult<object>>('post', 'debtTracking/noManage/addUserDebtTracking', { data });
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 债务追踪---更新债务追踪 */
|
||||||
|
export const fetchUpdateUserDebtTracking = (data: any) => {
|
||||||
|
return http.request<BaseResult<object>>('put', 'debtTracking/noManage/updateUserDebtTracking', { data });
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 债务追踪---删除债务追踪 */
|
||||||
|
export const fetchDeleteUserDebtTracking = (data: any) => {
|
||||||
|
return http.request<BaseResult<object>>('delete', 'debtTracking/noManage/deleteUserDebtTracking', { data });
|
||||||
|
};
|
|
@ -1,5 +1,5 @@
|
||||||
export default [
|
export default [
|
||||||
// 财务管理
|
// financial管理
|
||||||
{
|
{
|
||||||
path: '/financial-user',
|
path: '/financial-user',
|
||||||
name: 'FinancialUser',
|
name: 'FinancialUser',
|
||||||
|
@ -32,7 +32,7 @@ export default [
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
// 预算和储值
|
// budget和savingGoal
|
||||||
{
|
{
|
||||||
path: '/budget-saving-user',
|
path: '/budget-saving-user',
|
||||||
name: 'BudgetSavingsUser',
|
name: 'BudgetSavingsUser',
|
||||||
|
@ -65,36 +65,37 @@ export default [
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
// // 账务管理
|
// Debt管理
|
||||||
// {
|
{
|
||||||
// path: '/debtManagement',
|
path: '/debt-user',
|
||||||
// name: 'DebtManagement',
|
name: 'DebtManagementUser',
|
||||||
// redirect: '/debtManagement/debtRepaymentPlan',
|
redirect: '/debt-user/debt-tracking',
|
||||||
// meta: {
|
meta: {
|
||||||
// icon: 'arcticons:debtcalc',
|
icon: 'arcticons:debtcalc',
|
||||||
// title: 'debtManagement',
|
title: 'debtManagement',
|
||||||
// },
|
rank: 1,
|
||||||
// children: [
|
},
|
||||||
// // 债务还款计划
|
children: [
|
||||||
// {
|
// 债务还款计划
|
||||||
// path: '/debtManagement/debtRepaymentPlan',
|
{
|
||||||
// name: 'debtRepaymentPlan',
|
path: '/debt-user/debt-repayment-plan',
|
||||||
// component: () => import('@/views/financial/debtRepaymentPlan/index.vue'),
|
name: 'debtRepaymentPlanUser',
|
||||||
// meta: {
|
component: () => import('@/views/financial-user/debt/debt-repayment-plan/index.vue'),
|
||||||
// icon: 'stash:plan-light',
|
meta: {
|
||||||
// title: 'debtRepaymentPlan',
|
icon: 'stash:plan-light',
|
||||||
// },
|
title: 'debtRepaymentPlan',
|
||||||
// },
|
},
|
||||||
// // 债务追踪
|
},
|
||||||
// {
|
// 债务追踪
|
||||||
// path: '/debtManagement/debtTracking',
|
{
|
||||||
// name: 'debtTracking',
|
path: '/debt-user/debt-tracking',
|
||||||
// component: () => import('@/views/financial/debtTracking/index.vue'),
|
name: 'debtTrackingUser',
|
||||||
// meta: {
|
component: () => import('@/views/financial-user/debt/debt-tracking/index.vue'),
|
||||||
// icon: 'ic:outline-spatial-tracking',
|
meta: {
|
||||||
// title: 'debtTracking',
|
icon: 'ic:outline-spatial-tracking',
|
||||||
// },
|
title: 'debtTracking',
|
||||||
// },
|
},
|
||||||
// ],
|
},
|
||||||
// },
|
],
|
||||||
|
},
|
||||||
] satisfies Array<RouteConfigsTable>;
|
] satisfies Array<RouteConfigsTable>;
|
||||||
|
|
|
@ -0,0 +1,80 @@
|
||||||
|
import { defineStore } from 'pinia';
|
||||||
|
import { pageSizes } from '@/enums/baseConstant';
|
||||||
|
import { storeMessage } from '@/utils/message';
|
||||||
|
import { storePagination } from '@/store/useStorePagination';
|
||||||
|
import {
|
||||||
|
fetchAddUserDebtTracking,
|
||||||
|
fetchDeleteUserDebtTracking,
|
||||||
|
fetchGetUserDebtTrackingList,
|
||||||
|
fetchUpdateUserDebtTracking,
|
||||||
|
} from '@/api/v1/financialUser/debtTrackingUser';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 债务追踪 Store
|
||||||
|
*/
|
||||||
|
export const useDebtTrackingUserStore = defineStore('debtTrackingUserStore', {
|
||||||
|
state() {
|
||||||
|
return {
|
||||||
|
// 债务追踪列表
|
||||||
|
datalist: [],
|
||||||
|
// 查询表单
|
||||||
|
form: {
|
||||||
|
// 债务人姓名
|
||||||
|
debtorName: undefined,
|
||||||
|
// 债务金额
|
||||||
|
debtAmount: undefined,
|
||||||
|
// 债务类型
|
||||||
|
debtType: undefined,
|
||||||
|
// 债务状态
|
||||||
|
debtStatus: undefined,
|
||||||
|
// 还款截止日期
|
||||||
|
dueDate: undefined,
|
||||||
|
},
|
||||||
|
// 分页查询结果
|
||||||
|
pagination: {
|
||||||
|
currentPage: 1,
|
||||||
|
pageSize: 30,
|
||||||
|
total: 1,
|
||||||
|
pageSizes,
|
||||||
|
},
|
||||||
|
// 加载
|
||||||
|
loading: false,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
getters: {},
|
||||||
|
actions: {
|
||||||
|
/** 获取债务追踪 */
|
||||||
|
async getDebtTrackingList() {
|
||||||
|
// 整理请求参数
|
||||||
|
const data = { ...this.pagination, ...this.form };
|
||||||
|
delete data.pageSizes;
|
||||||
|
delete data.total;
|
||||||
|
delete data.background;
|
||||||
|
|
||||||
|
// 获取债务追踪列表
|
||||||
|
const result = await fetchGetUserDebtTrackingList(data);
|
||||||
|
|
||||||
|
// 公共页面函数hook
|
||||||
|
const pagination = storePagination.bind(this);
|
||||||
|
return pagination(result);
|
||||||
|
},
|
||||||
|
|
||||||
|
/** 添加债务追踪 */
|
||||||
|
async addDebtTracking(data: any) {
|
||||||
|
const result = await fetchAddUserDebtTracking(data);
|
||||||
|
return storeMessage(result);
|
||||||
|
},
|
||||||
|
|
||||||
|
/** 修改债务追踪 */
|
||||||
|
async updateDebtTracking(data: any) {
|
||||||
|
const result = await fetchUpdateUserDebtTracking(data);
|
||||||
|
return storeMessage(result);
|
||||||
|
},
|
||||||
|
|
||||||
|
/** 删除债务追踪 */
|
||||||
|
async deleteDebtTracking(data: any) {
|
||||||
|
const result = await fetchDeleteUserDebtTracking(data);
|
||||||
|
return storeMessage(result);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
|
@ -26,7 +26,6 @@ export function onAdd() {
|
||||||
width: '30%',
|
width: '30%',
|
||||||
props: {
|
props: {
|
||||||
formInline: {
|
formInline: {
|
||||||
userId: undefined,
|
|
||||||
statusType: undefined,
|
statusType: undefined,
|
||||||
savingGoalName: undefined,
|
savingGoalName: undefined,
|
||||||
amount: undefined,
|
amount: undefined,
|
||||||
|
@ -62,7 +61,6 @@ export function onUpdate(row: any) {
|
||||||
width: '30%',
|
width: '30%',
|
||||||
props: {
|
props: {
|
||||||
formInline: {
|
formInline: {
|
||||||
userId: row.userId,
|
|
||||||
statusType: row.statusType,
|
statusType: row.statusType,
|
||||||
savingGoalName: row.savingGoalName,
|
savingGoalName: row.savingGoalName,
|
||||||
amount: row.amount,
|
amount: row.amount,
|
||||||
|
|
|
@ -1,17 +1,14 @@
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { onMounted, ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import { FormInstance } from 'element-plus';
|
import { FormInstance } from 'element-plus';
|
||||||
import { rules } from '@/views/financial/debt/debt-tracking/utils/columns';
|
import { rules } from '@/views/financial-user/debt/debt-tracking/utils/columns';
|
||||||
import { FormProps } from '@/views/financial/debt/debt-tracking/utils/types';
|
import { FormProps } from '@/views/financial-user/debt/debt-tracking/utils/types';
|
||||||
import { $t } from '@/plugins/i18n';
|
import { $t } from '@/plugins/i18n';
|
||||||
import { debtTracking, debtType } from '@/enums/bill/debtTracking';
|
import { debtTracking, debtType } from '@/enums/bill/debtTracking';
|
||||||
import LoadingSvg from '@/assets/svg/loading.svg';
|
|
||||||
import { useAdminUserStore } from '@/store/system/adminUser';
|
import { useAdminUserStore } from '@/store/system/adminUser';
|
||||||
|
|
||||||
const props = withDefaults(defineProps<FormProps>(), {
|
const props = withDefaults(defineProps<FormProps>(), {
|
||||||
formInline: () => ({
|
formInline: () => ({
|
||||||
// 绑定的用户
|
|
||||||
userId: undefined,
|
|
||||||
// 债务人姓名
|
// 债务人姓名
|
||||||
debtorName: undefined,
|
debtorName: undefined,
|
||||||
// 债务金额
|
// 债务金额
|
||||||
|
@ -33,43 +30,11 @@ const userDataList = ref();
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
const adminUserStore = useAdminUserStore();
|
const adminUserStore = useAdminUserStore();
|
||||||
|
|
||||||
/** 搜索 */
|
|
||||||
const onSearchUserinfo = async (keyword: string) => {
|
|
||||||
loading.value = true;
|
|
||||||
userDataList.value = await adminUserStore.queryUser({ keyword });
|
|
||||||
loading.value = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
onSearchUserinfo();
|
|
||||||
});
|
|
||||||
|
|
||||||
defineExpose({ formRef });
|
defineExpose({ formRef });
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<el-form ref="formRef" :model="form" :rules="rules" label-width="auto">
|
<el-form ref="formRef" :model="form" :rules="rules" label-width="auto">
|
||||||
<!-- 绑定的用户 -->
|
|
||||||
<el-form-item :label="$t('user')" prop="userId">
|
|
||||||
<el-select
|
|
||||||
v-model="form.userId"
|
|
||||||
:loading="loading"
|
|
||||||
:placeholder="$t('user')"
|
|
||||||
:remote-method="onSearchUserinfo"
|
|
||||||
clearable
|
|
||||||
filterable
|
|
||||||
remote
|
|
||||||
remote-show-suffix
|
|
||||||
>
|
|
||||||
<el-option v-for="item in userDataList" :key="item.id" :label="item.username" :value="item.id" />
|
|
||||||
<template #loading>
|
|
||||||
<el-icon class="is-loading">
|
|
||||||
<LoadingSvg />
|
|
||||||
</el-icon>
|
|
||||||
</template>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
<!-- 债务人姓名 -->
|
<!-- 债务人姓名 -->
|
||||||
<el-form-item :label="$t('debtorName')" prop="debtorName">
|
<el-form-item :label="$t('debtorName')" prop="debtorName">
|
||||||
<el-input v-model="form.debtorName" :placeholder="$t('input') + $t('debtorName')" autocomplete="off" type="text" />
|
<el-input v-model="form.debtorName" :placeholder="$t('input') + $t('debtorName')" autocomplete="off" type="text" />
|
||||||
|
|
|
@ -1,21 +1,20 @@
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { onMounted, ref } from 'vue';
|
import { onMounted, ref } from 'vue';
|
||||||
import { columns } from '@/views/financial/debt/debt-tracking/utils/columns';
|
import { columns } from '@/views/financial-user/debt/debt-tracking/utils/columns';
|
||||||
import PureTableBar from '@/components/TableBar/src/bar';
|
import PureTableBar from '@/components/TableBar/src/bar';
|
||||||
import AddFill from '@iconify-icons/ri/add-circle-line';
|
import AddFill from '@iconify-icons/ri/add-circle-line';
|
||||||
import PureTable from '@pureadmin/table';
|
import PureTable from '@pureadmin/table';
|
||||||
import { deleteIds, onAdd, onDelete, onDeleteBatch, onSearch, onUpdate } from '@/views/financial/debt/debt-tracking/utils/hooks';
|
import { deleteIds, onAdd, onDelete, onDeleteBatch, onSearch, onUpdate } from '@/views/financial-user/debt/debt-tracking/utils/hooks';
|
||||||
import Delete from '@iconify-icons/ep/delete';
|
import Delete from '@iconify-icons/ep/delete';
|
||||||
import EditPen from '@iconify-icons/ep/edit-pen';
|
import EditPen from '@iconify-icons/ep/edit-pen';
|
||||||
import Refresh from '@iconify-icons/ep/refresh';
|
import Refresh from '@iconify-icons/ep/refresh';
|
||||||
import { $t } from '@/plugins/i18n';
|
import { $t } from '@/plugins/i18n';
|
||||||
import { useDebtTrackingStore } from '@/store/financial/debtTracking';
|
|
||||||
import { useRenderIcon } from '@/components/CommonIcon/src/hooks';
|
import { useRenderIcon } from '@/components/CommonIcon/src/hooks';
|
||||||
import { FormInstance } from 'element-plus';
|
import { FormInstance } from 'element-plus';
|
||||||
import { selectUserinfo } from '@/components/Table/Userinfo/columns';
|
import { selectUserinfo } from '@/components/Table/Userinfo/columns';
|
||||||
import LoadingSvg from '@/assets/svg/loading.svg';
|
|
||||||
import { useAdminUserStore } from '@/store/system/adminUser';
|
import { useAdminUserStore } from '@/store/system/adminUser';
|
||||||
import { debtTracking, debtType } from '@/enums/bill/debtTracking';
|
import { debtTracking, debtType } from '@/enums/bill/debtTracking';
|
||||||
|
import { useDebtTrackingUserStore } from '@/store/financialUser/debtTrackingUser';
|
||||||
|
|
||||||
const tableRef = ref();
|
const tableRef = ref();
|
||||||
const formRef = ref();
|
const formRef = ref();
|
||||||
|
@ -24,17 +23,17 @@ const userDataList = ref();
|
||||||
// 搜索用户加载
|
// 搜索用户加载
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
const adminUserStore = useAdminUserStore();
|
const adminUserStore = useAdminUserStore();
|
||||||
const debtTrackingStore = useDebtTrackingStore();
|
const debtTrackingUserStore = useDebtTrackingUserStore();
|
||||||
|
|
||||||
/** 当前页改变时 */
|
/** 当前页改变时 */
|
||||||
const onCurrentPageChange = async (value: number) => {
|
const onCurrentPageChange = async (value: number) => {
|
||||||
debtTrackingStore.pagination.currentPage = value;
|
debtTrackingUserStore.pagination.currentPage = value;
|
||||||
await onSearch();
|
await onSearch();
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 当分页发生变化 */
|
/** 当分页发生变化 */
|
||||||
const onPageSizeChange = async (value: number) => {
|
const onPageSizeChange = async (value: number) => {
|
||||||
debtTrackingStore.pagination.pageSize = value;
|
debtTrackingUserStore.pagination.pageSize = value;
|
||||||
await onSearch();
|
await onSearch();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -50,13 +49,6 @@ const resetForm = async (formEl: FormInstance | undefined) => {
|
||||||
await onSearch();
|
await onSearch();
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 搜索 */
|
|
||||||
const onSearchUserinfo = async (keyword: string) => {
|
|
||||||
loading.value = true;
|
|
||||||
userDataList.value = await adminUserStore.queryUser({ keyword });
|
|
||||||
loading.value = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
onSearch();
|
onSearch();
|
||||||
});
|
});
|
||||||
|
@ -64,49 +56,35 @@ onMounted(() => {
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="main">
|
<div class="main">
|
||||||
<el-form ref="formRef" :inline="true" :model="debtTrackingStore.form" class="search-form bg-bg_color w-[99/100] pl-8 pt-[12px] overflow-auto">
|
<el-form ref="formRef" :inline="true" :model="debtTrackingUserStore.form" class="search-form bg-bg_color w-[99/100] pl-8 pt-[12px] overflow-auto">
|
||||||
<!-- 绑定的用户 -->
|
|
||||||
<el-form-item :label="$t('user')" prop="userId">
|
|
||||||
<el-select
|
|
||||||
v-model="debtTrackingStore.form.userId"
|
|
||||||
:loading="loading"
|
|
||||||
:placeholder="$t('user')"
|
|
||||||
:remote-method="onSearchUserinfo"
|
|
||||||
class="!w-[180px]"
|
|
||||||
clearable
|
|
||||||
filterable
|
|
||||||
remote
|
|
||||||
remote-show-suffix
|
|
||||||
>
|
|
||||||
<el-option v-for="item in userDataList" :key="item.id" :label="item.username" :value="item.id" />
|
|
||||||
<template #loading>
|
|
||||||
<el-icon class="is-loading">
|
|
||||||
<LoadingSvg />
|
|
||||||
</el-icon>
|
|
||||||
</template>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
<!-- 债务人姓名 -->
|
<!-- 债务人姓名 -->
|
||||||
<el-form-item :label="$t('debtorName')" prop="debtorName">
|
<el-form-item :label="$t('debtorName')" prop="debtorName">
|
||||||
<el-input v-model="debtTrackingStore.form.debtorName" :placeholder="`${$t('input')}${$t('debtorName')}`" class="!w-[180px]" clearable />
|
<el-input v-model="debtTrackingUserStore.form.debtorName" :placeholder="`${$t('input')}${$t('debtorName')}`" class="!w-[180px]" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<!-- 债务金额 -->
|
<!-- 债务金额 -->
|
||||||
<el-form-item :label="$t('debtAmount')" prop="debtAmount">
|
<el-form-item :label="$t('debtAmount')" prop="debtAmount">
|
||||||
<el-input v-model="debtTrackingStore.form.debtAmount" :placeholder="`${$t('input')}${$t('debtAmount')}`" class="!w-[180px]" clearable />
|
<el-input v-model="debtTrackingUserStore.form.debtAmount" :placeholder="`${$t('input')}${$t('debtAmount')}`" class="!w-[180px]" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<!-- 债务类型 -->
|
<!-- 债务类型 -->
|
||||||
<el-form-item :label="$t('debtType')" prop="debtType">
|
<el-form-item :label="$t('debtType')" prop="debtType">
|
||||||
<el-select v-model="debtTrackingStore.form.debtType" :placeholder="$t('debtType')" class="!w-[180px]" clearable filterable remote remote-show-suffix>
|
<el-select v-model="debtTrackingUserStore.form.debtType" :placeholder="$t('debtType')" class="!w-[180px]" clearable filterable remote remote-show-suffix>
|
||||||
<el-option v-for="item in debtType" :key="item.value" :label="item.label" :value="item.value" />
|
<el-option v-for="item in debtType" :key="item.value" :label="item.label" :value="item.value" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<!-- 债务状态 -->
|
<!-- 债务状态 -->
|
||||||
<el-form-item :label="$t('debtStatus')" prop="debtStatus">
|
<el-form-item :label="$t('debtStatus')" prop="debtStatus">
|
||||||
<el-select v-model="debtTrackingStore.form.debtStatus" :placeholder="$t('debtStatus')" class="!w-[180px]" clearable filterable remote remote-show-suffix>
|
<el-select
|
||||||
|
v-model="debtTrackingUserStore.form.debtStatus"
|
||||||
|
:placeholder="$t('debtStatus')"
|
||||||
|
class="!w-[180px]"
|
||||||
|
clearable
|
||||||
|
filterable
|
||||||
|
remote
|
||||||
|
remote-show-suffix
|
||||||
|
>
|
||||||
<el-option v-for="item in debtTracking" :key="item.value" :label="item.label" :value="item.value" />
|
<el-option v-for="item in debtTracking" :key="item.value" :label="item.label" :value="item.value" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
@ -114,19 +92,22 @@ onMounted(() => {
|
||||||
<!-- 还款截止日期 -->
|
<!-- 还款截止日期 -->
|
||||||
<el-form-item :label="$t('dueDate')" prop="dueDate">
|
<el-form-item :label="$t('dueDate')" prop="dueDate">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="debtTrackingStore.form.dueDate"
|
v-model="debtTrackingUserStore.form.dueDate"
|
||||||
:end-placeholder="$t('endTime')"
|
:end-placeholder="$t('endTime')"
|
||||||
|
:placeholder="$t('dueDate')"
|
||||||
:start-placeholder="$t('startTime')"
|
:start-placeholder="$t('startTime')"
|
||||||
class="!w-[210px]"
|
class="!w-[210px]"
|
||||||
time-format="YYYY-MM-DD"
|
time-format="YYYY-MM-DD"
|
||||||
type="daterange"
|
type="date"
|
||||||
value-format="YYYY-MM-DD"
|
value-format="YYYY-MM-DD"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<!-- 搜索和重置 -->
|
<!-- 搜索和重置 -->
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button :icon="useRenderIcon('ri:search-line')" :loading="debtTrackingStore.loading" type="primary" @click="onSearch"> {{ $t('search') }} </el-button>
|
<el-button :icon="useRenderIcon('ri:search-line')" :loading="debtTrackingUserStore.loading" type="primary" @click="onSearch">
|
||||||
|
{{ $t('search') }}
|
||||||
|
</el-button>
|
||||||
<el-button :icon="useRenderIcon(Refresh)" @click="resetForm(formRef)"> {{ $t('buttons.reset') }}</el-button>
|
<el-button :icon="useRenderIcon(Refresh)" @click="resetForm(formRef)"> {{ $t('buttons.reset') }}</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
@ -146,10 +127,10 @@ onMounted(() => {
|
||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
:adaptiveConfig="{ offsetBottom: 96 }"
|
:adaptiveConfig="{ offsetBottom: 96 }"
|
||||||
:columns="dynamicColumns"
|
:columns="dynamicColumns"
|
||||||
:data="debtTrackingStore.datalist"
|
:data="debtTrackingUserStore.datalist"
|
||||||
:header-cell-style="{ background: 'var(--el-fill-color-light)', color: 'var(--el-text-color-primary)' }"
|
:header-cell-style="{ background: 'var(--el-fill-color-light)', color: 'var(--el-text-color-primary)' }"
|
||||||
:loading="debtTrackingStore.loading"
|
:loading="debtTrackingUserStore.loading"
|
||||||
:pagination="debtTrackingStore.pagination"
|
:pagination="debtTrackingUserStore.pagination"
|
||||||
:size="size"
|
:size="size"
|
||||||
adaptive
|
adaptive
|
||||||
align-whole="center"
|
align-whole="center"
|
||||||
|
|
|
@ -41,17 +41,11 @@ export const columns: TableColumnList = [
|
||||||
},
|
},
|
||||||
{ label: $t('table.updateTime'), prop: 'updateTime', sortable: true, width: 160 },
|
{ label: $t('table.updateTime'), prop: 'updateTime', sortable: true, width: 160 },
|
||||||
{ label: $t('table.createTime'), prop: 'createTime', 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' },
|
{ label: $t('table.operation'), fixed: 'right', width: 210, slot: 'operation' },
|
||||||
];
|
];
|
||||||
|
|
||||||
// 添加规则
|
// 添加规则
|
||||||
export const rules = reactive<FormRules>({
|
export const rules = reactive<FormRules>({
|
||||||
// 绑定的用户
|
|
||||||
userId: [{ required: true, message: `${$t('input')}${$t('userId')}`, trigger: 'blur' }],
|
|
||||||
// 债务人姓名
|
// 债务人姓名
|
||||||
debtorName: [{ required: true, message: `${$t('input')}${$t('debtorName')}`, trigger: 'blur' }],
|
debtorName: [{ required: true, message: `${$t('input')}${$t('debtorName')}`, trigger: 'blur' }],
|
||||||
// 债务金额
|
// 债务金额
|
||||||
|
|
|
@ -1,22 +1,22 @@
|
||||||
import { addDialog } from '@/components/BaseDialog/index';
|
import { addDialog } from '@/components/BaseDialog/index';
|
||||||
import DebtTrackingDialog from '@/views/financial/debt/debt-tracking/debt-tracking-dialog.vue';
|
import DebtTrackingDialog from '@/views/financial-user/debt/debt-tracking/debt-tracking-dialog.vue';
|
||||||
import { useDebtTrackingStore } from '@/store/financial/debtTracking';
|
|
||||||
import { h, ref } from 'vue';
|
import { h, ref } from 'vue';
|
||||||
import { message, messageBox } from '@/utils/message';
|
import { message, messageBox } from '@/utils/message';
|
||||||
import type { FormItemProps } from '@/views/financial/debt/debt-tracking/utils/types';
|
import type { FormItemProps } from '@/views/financial-user/debt/debt-tracking/utils/types';
|
||||||
import { $t } from '@/plugins/i18n';
|
import { $t } from '@/plugins/i18n';
|
||||||
import DeleteBatchDialog from '@/components/Table/DeleteBatchDialog.vue';
|
import DeleteBatchDialog from '@/components/Table/DeleteBatchDialog.vue';
|
||||||
|
import { useDebtTrackingUserStore } from '@/store/financialUser/debtTrackingUser';
|
||||||
|
|
||||||
export const formRef = ref();
|
export const formRef = ref();
|
||||||
// 删除ids
|
// 删除ids
|
||||||
export const deleteIds = ref([]);
|
export const deleteIds = ref([]);
|
||||||
const debtTrackingStore = useDebtTrackingStore();
|
const debtTrackingUserStore = useDebtTrackingUserStore();
|
||||||
|
|
||||||
/** 搜索初始化债务追踪 */
|
/** 搜索初始化债务追踪 */
|
||||||
export async function onSearch() {
|
export async function onSearch() {
|
||||||
debtTrackingStore.loading = true;
|
debtTrackingUserStore.loading = true;
|
||||||
await debtTrackingStore.getDebtTrackingList();
|
await debtTrackingUserStore.getDebtTrackingList();
|
||||||
debtTrackingStore.loading = false;
|
debtTrackingUserStore.loading = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 添加债务追踪 */
|
/** 添加债务追踪 */
|
||||||
|
@ -26,7 +26,6 @@ export function onAdd() {
|
||||||
width: '30%',
|
width: '30%',
|
||||||
props: {
|
props: {
|
||||||
formInline: {
|
formInline: {
|
||||||
userId: undefined,
|
|
||||||
debtorName: undefined,
|
debtorName: undefined,
|
||||||
debtAmount: undefined,
|
debtAmount: undefined,
|
||||||
debtType: undefined,
|
debtType: undefined,
|
||||||
|
@ -43,7 +42,7 @@ export function onAdd() {
|
||||||
formRef.value.formRef.validate(async (valid: any) => {
|
formRef.value.formRef.validate(async (valid: any) => {
|
||||||
if (!valid) return;
|
if (!valid) return;
|
||||||
|
|
||||||
const result = await debtTrackingStore.addDebtTracking(form);
|
const result = await debtTrackingUserStore.addDebtTracking(form);
|
||||||
if (!result) return;
|
if (!result) return;
|
||||||
done();
|
done();
|
||||||
await onSearch();
|
await onSearch();
|
||||||
|
@ -59,7 +58,6 @@ export function onUpdate(row: any) {
|
||||||
width: '30%',
|
width: '30%',
|
||||||
props: {
|
props: {
|
||||||
formInline: {
|
formInline: {
|
||||||
userId: row.userId,
|
|
||||||
debtorName: row.debtorName,
|
debtorName: row.debtorName,
|
||||||
debtAmount: row.debtAmount,
|
debtAmount: row.debtAmount,
|
||||||
debtType: row.debtType,
|
debtType: row.debtType,
|
||||||
|
@ -76,7 +74,7 @@ export function onUpdate(row: any) {
|
||||||
formRef.value.formRef.validate(async (valid: any) => {
|
formRef.value.formRef.validate(async (valid: any) => {
|
||||||
if (!valid) return;
|
if (!valid) return;
|
||||||
|
|
||||||
const result = await debtTrackingStore.updateDebtTracking({ ...form, id: row.id });
|
const result = await debtTrackingUserStore.updateDebtTracking({ ...form, id: row.id });
|
||||||
if (!result) return;
|
if (!result) return;
|
||||||
done();
|
done();
|
||||||
await onSearch();
|
await onSearch();
|
||||||
|
@ -99,7 +97,7 @@ export const onDelete = async (row: any) => {
|
||||||
if (!result) return;
|
if (!result) return;
|
||||||
|
|
||||||
// 删除数据
|
// 删除数据
|
||||||
await debtTrackingStore.deleteDebtTracking([id]);
|
await debtTrackingUserStore.deleteDebtTracking([id]);
|
||||||
await onSearch();
|
await onSearch();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -123,7 +121,7 @@ export const onDeleteBatch = async () => {
|
||||||
const text = options.props.formInline.confirmText.toLowerCase();
|
const text = options.props.formInline.confirmText.toLowerCase();
|
||||||
if (text === 'yes' || text === 'y') {
|
if (text === 'yes' || text === 'y') {
|
||||||
// 删除数据
|
// 删除数据
|
||||||
await debtTrackingStore.deleteDebtTracking(ids);
|
await debtTrackingUserStore.deleteDebtTracking(ids);
|
||||||
await onSearch();
|
await onSearch();
|
||||||
|
|
||||||
done();
|
done();
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
// 添加或者修改表单元素
|
// 添加或者修改表单元素
|
||||||
export interface FormItemProps {
|
export interface FormItemProps {
|
||||||
// 绑定的用户
|
|
||||||
userId: number;
|
|
||||||
// 债务人姓名
|
// 债务人姓名
|
||||||
debtorName: string;
|
debtorName: string;
|
||||||
// 债务金额
|
// 债务金额
|
||||||
|
|
|
@ -116,10 +116,11 @@ onMounted(() => {
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="debtTrackingStore.form.dueDate"
|
v-model="debtTrackingStore.form.dueDate"
|
||||||
:end-placeholder="$t('endTime')"
|
:end-placeholder="$t('endTime')"
|
||||||
|
:placeholder="$t('dueDate')"
|
||||||
:start-placeholder="$t('startTime')"
|
:start-placeholder="$t('startTime')"
|
||||||
class="!w-[210px]"
|
class="!w-[210px]"
|
||||||
time-format="YYYY-MM-DD"
|
time-format="YYYY-MM-DD"
|
||||||
type="daterange"
|
type="date"
|
||||||
value-format="YYYY-MM-DD"
|
value-format="YYYY-MM-DD"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
Loading…
Reference in New Issue