联调收入管理、修改多商户管理字段
This commit is contained in:
@@ -8,18 +8,20 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true" class="query-form">
|
<el-form ref="queryFormRef" :model="queryParams" :inline="true" class="query-form">
|
||||||
<el-form-item label="开始日期" prop="beginDate">
|
<el-form-item label="交易日期" style="width: 308px">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="queryParams.beginDate"
|
v-model="dateRangeOccurredAt"
|
||||||
type="date"
|
value-format="YYYY-MM-DD HH:mm:ss"
|
||||||
value-format="YYYY-MM-DD"
|
type="daterange"
|
||||||
placeholder="请选择开始日期"
|
range-separator="-"
|
||||||
clearable
|
start-placeholder="开始日期"
|
||||||
|
end-placeholder="结束日期"
|
||||||
|
:default-time="[new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 1, 1, 23, 59, 59)]"
|
||||||
></el-date-picker>
|
></el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="收入类型" prop="chargeType">
|
<el-form-item label="设备类型" prop="deviceType">
|
||||||
<el-select v-model="queryParams.chargeType" placeholder="全部类型" clearable>
|
<el-select v-model="queryParams.deviceType" placeholder="全部类型" clearable>
|
||||||
<el-option v-for="item in chargeTypeOptions" :key="item.value" :label="item.label" :value="item.value" />
|
<el-option v-for="item in deviceTypeOptions" :key="item.value" :label="item.label" :value="item.value" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
@@ -44,14 +46,14 @@
|
|||||||
|
|
||||||
<!-- data-full-height-table="false":表格按内容自适应高度,不跟随全局「全高表格」设置铺满整屏 -->
|
<!-- data-full-height-table="false":表格按内容自适应高度,不跟随全局「全高表格」设置铺满整屏 -->
|
||||||
<el-table v-loading="loading" border class="data-table" data-full-height-table="false" :data="incomeList">
|
<el-table v-loading="loading" border class="data-table" data-full-height-table="false" :data="incomeList">
|
||||||
<el-table-column label="交易日期" align="center" prop="incomeTime" min-width="180" show-overflow-tooltip />
|
<el-table-column label="交易日期" align="center" prop="occurredAt" min-width="180" show-overflow-tooltip />
|
||||||
<el-table-column label="商户" align="center" prop="merchantName" min-width="140" show-overflow-tooltip />
|
<el-table-column label="商户" align="center" prop="merchantName" min-width="140" show-overflow-tooltip />
|
||||||
<el-table-column label="房间" align="center" prop="roomNo" min-width="120" show-overflow-tooltip />
|
<el-table-column label="房间" align="center" prop="roomNo" min-width="120" show-overflow-tooltip />
|
||||||
<el-table-column label="设备编号" align="center" prop="deviceNo" min-width="140" show-overflow-tooltip />
|
<el-table-column label="设备编号" align="center" prop="deviceNo" min-width="140" show-overflow-tooltip />
|
||||||
<el-table-column label="充值类型" align="center" min-width="120">
|
<el-table-column label="设备类型" align="center" min-width="120">
|
||||||
<template #default="scope">{{ getChargeTypeLabel(scope.row.chargeType) }}</template>
|
<template #default="scope">{{ deviceTypeText(scope.row.deviceType) }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="金额" align="center" min-width="120">
|
<el-table-column label="充值金额(元)" align="center" min-width="120">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span class="amount-text">{{ formatAmount(scope.row.amount) }}</span>
|
<span class="amount-text">{{ formatAmount(scope.row.amount) }}</span>
|
||||||
</template>
|
</template>
|
||||||
@@ -70,66 +72,67 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup name="Income" lang="ts">
|
<script setup name="Income" lang="ts">
|
||||||
|
import { listIncome } from '@/api/income';
|
||||||
|
import type { IncomeRecordQuery, IncomeRecordVO } from '@/api/income/types';
|
||||||
import { useLoading } from '@/hooks/async/useLoading';
|
import { useLoading } from '@/hooks/async/useLoading';
|
||||||
|
import { useDateRangeQuery } from '@/hooks/form/useDateRangeQuery';
|
||||||
import { useSearchReset } from '@/hooks/form/useSearchReset';
|
import { useSearchReset } from '@/hooks/form/useSearchReset';
|
||||||
import { useSearchToggle } from '@/hooks/form/useSearchToggle';
|
import { useSearchToggle } from '@/hooks/form/useSearchToggle';
|
||||||
|
import { getDeviceTypeLabel, useDeviceTypeDict } from '../device/constants';
|
||||||
|
|
||||||
/** 收入明细流水(只读台账) */
|
const deviceTypeDict = useDeviceTypeDict();
|
||||||
interface IncomeVO {
|
|
||||||
/** 收入ID */
|
|
||||||
incomeId?: string;
|
|
||||||
/** 交易日期 */
|
|
||||||
incomeTime?: string;
|
|
||||||
/** 商户名称 */
|
|
||||||
merchantName?: string;
|
|
||||||
/** 房间号 */
|
|
||||||
roomNo?: string;
|
|
||||||
/** 设备编号 */
|
|
||||||
deviceNo?: string;
|
|
||||||
/** 充值类型(0电费 1水费) */
|
|
||||||
chargeType?: string;
|
|
||||||
/** 金额(元) */
|
|
||||||
amount?: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface IncomeQuery extends PageQuery {
|
/** 设备类型选项:优先后端字典 ur_device_type,字典未加载时用本地兜底 */
|
||||||
/** 开始日期(YYYY-MM-DD) */
|
const deviceTypeOptions = computed<DictDataOption[]>(() =>
|
||||||
beginDate?: string;
|
deviceTypeDict.value?.length
|
||||||
/** 收入类型(0电费 1水费) */
|
? deviceTypeDict.value
|
||||||
chargeType?: string;
|
: [
|
||||||
}
|
{ label: '电表', value: '0' },
|
||||||
|
{ label: '水表', value: '1' }
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
/** 收入类型选项:与设备类型取值保持一致(0电表/电费,1水表/水费) */
|
/** 金额展示:后端以字符串返回(如 "0.00"),单位已写在列名里,不带 ¥;无值时不展示 */
|
||||||
const chargeTypeOptions: DictDataOption[] = [
|
const formatAmount = (value?: string | number | null) => {
|
||||||
{ label: '电费', value: '0' },
|
if (value == null || value === '') return '';
|
||||||
{ label: '水费', value: '1' }
|
const amount = Number(value);
|
||||||
];
|
return Number.isNaN(amount)
|
||||||
|
? `${value}`
|
||||||
|
: amount.toLocaleString('zh-CN', { minimumFractionDigits: 2, maximumFractionDigits: 2 });
|
||||||
|
};
|
||||||
|
|
||||||
const getChargeTypeLabel = (value?: string) =>
|
/** 设备类型文案:无值时不展示(留空,不用占位符) */
|
||||||
chargeTypeOptions.find(item => item.value === String(value))?.label || (value ? String(value) : '—');
|
const deviceTypeText = (deviceType?: string | null) => {
|
||||||
|
if (deviceType == null || deviceType === '') return '';
|
||||||
|
return getDeviceTypeLabel(deviceTypeOptions.value, String(deviceType));
|
||||||
|
};
|
||||||
|
|
||||||
const formatAmount = (value?: number | null) =>
|
const incomeList = ref<IncomeRecordVO[]>([]);
|
||||||
value == null ? '—' : `¥${Number(value).toLocaleString('zh-CN', { minimumFractionDigits: 2, maximumFractionDigits: 2 })}`;
|
|
||||||
|
|
||||||
const incomeList = ref<IncomeVO[]>([]);
|
|
||||||
const total = ref(0);
|
const total = ref(0);
|
||||||
const queryFormRef = ref<ElFormInstance>();
|
const queryFormRef = ref<ElFormInstance>();
|
||||||
const { showSearch } = useSearchToggle();
|
const { showSearch } = useSearchToggle();
|
||||||
const { loading, withLoading } = useLoading(true);
|
const { loading, withLoading } = useLoading(true);
|
||||||
|
|
||||||
const queryParams = ref<IncomeQuery>({
|
const queryParams = ref<IncomeRecordQuery>({
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
beginDate: undefined,
|
deviceType: undefined
|
||||||
chargeType: undefined
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/** 交易日期区间 → queryParams.params.beginOccurredAt / endOccurredAt */
|
||||||
|
const {
|
||||||
|
dateRange: dateRangeOccurredAt,
|
||||||
|
applyDateRange: applyOccurredAtDateRange,
|
||||||
|
resetDateRange: resetOccurredAtDateRange
|
||||||
|
} = useDateRangeQuery('OccurredAt');
|
||||||
|
|
||||||
/** 查询收入明细列表 */
|
/** 查询收入明细列表 */
|
||||||
const getList = async () => {
|
const getList = async () => {
|
||||||
|
applyOccurredAtDateRange(queryParams.value);
|
||||||
await withLoading(async () => {
|
await withLoading(async () => {
|
||||||
// TODO: 收入接口就绪后替换为真实请求,例如 listIncome(queryParams.value) 取 res.data.rows / res.data.total
|
const res = await listIncome(queryParams.value);
|
||||||
incomeList.value = [];
|
incomeList.value = res.data?.rows ?? [];
|
||||||
total.value = 0;
|
total.value = res.data?.total ?? 0;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -145,6 +148,9 @@ const { resetQuery } = useSearchReset({
|
|||||||
pageNumKey: 'pageNum',
|
pageNumKey: 'pageNum',
|
||||||
pageSizeKey: 'pageSize',
|
pageSizeKey: 'pageSize',
|
||||||
initialPageSize: 10,
|
initialPageSize: 10,
|
||||||
|
resetExtras: () => {
|
||||||
|
resetOccurredAtDateRange();
|
||||||
|
},
|
||||||
afterReset: () => {
|
afterReset: () => {
|
||||||
handleQuery();
|
handleQuery();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,9 +64,9 @@
|
|||||||
<span>{{ scope.row.userCount }}</span>
|
<span>{{ scope.row.userCount }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="本月收入" align="center" min-width="130">
|
<el-table-column label="本月收入(元)" align="center" min-width="130">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span class="amount-text">{{ formatIncome(scope.row.monthIncome) }}</span>
|
<span class="amount-text">{{ scope.row.monthIncome }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="状态" align="center" min-width="100">
|
<el-table-column label="状态" align="center" min-width="100">
|
||||||
@@ -143,14 +143,14 @@ const getStatusClass = (status?: string | number | boolean | null) => {
|
|||||||
return value == null ? 'text-muted' : value === '0' ? 'status-text--success' : 'status-text--info';
|
return value == null ? 'text-muted' : value === '0' ? 'status-text--success' : 'status-text--info';
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 本月收入展示:空值占位,保留两位小数(后端以字符串返回,如 "0.00") */
|
/** 本月收入展示:空值占位,保留两位小数(后端以字符串返回,如 "0.00";单位已写在列名里,不再带 ¥) */
|
||||||
const formatIncome = (value?: string | number | null) => {
|
// const formatIncome = (value?: string | number | null) => {
|
||||||
if (value == null || value === '') return '—';
|
// if (value == null || value === '') return '—';
|
||||||
const amount = Number(value);
|
// const amount = Number(value);
|
||||||
return Number.isNaN(amount)
|
// return Number.isNaN(amount)
|
||||||
? `${value}`
|
// ? `${value}`
|
||||||
: `¥${amount.toLocaleString('zh-CN', { minimumFractionDigits: 2, maximumFractionDigits: 2 })}`;
|
// : amount.toLocaleString('zh-CN', { minimumFractionDigits: 2, maximumFractionDigits: 2 });
|
||||||
};
|
// };
|
||||||
|
|
||||||
const queryFormRef = ref<ElFormInstance>();
|
const queryFormRef = ref<ElFormInstance>();
|
||||||
|
|
||||||
|
|||||||
@@ -11,16 +11,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true" class="query-form">
|
<el-form ref="queryFormRef" :model="queryParams" :inline="true" class="query-form">
|
||||||
<el-form-item label="提现单号" prop="orderNo">
|
<el-form-item label="申请人" prop="applicantName">
|
||||||
<el-input v-model="queryParams.orderNo" placeholder="请输入提现单号" clearable @keyup.enter="handleQuery" />
|
<el-input v-model="queryParams.applicantName" placeholder="请输入申请人" clearable @keyup.enter="handleQuery" />
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="商户名称" prop="merchantName">
|
|
||||||
<el-input v-model="queryParams.merchantName" placeholder="请输入商户名称" clearable @keyup.enter="handleQuery" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="审核状态" prop="auditStatus">
|
|
||||||
<el-select v-model="queryParams.auditStatus" placeholder="请选择审核状态" clearable>
|
|
||||||
<el-option v-for="item in auditStatusOptions" :key="item.value" :label="item.label" :value="item.value" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="申请时间" style="width: 308px">
|
<el-form-item label="申请时间" style="width: 308px">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
@@ -47,12 +39,12 @@
|
|||||||
<div class="table-heading">
|
<div class="table-heading">
|
||||||
<span class="panel-kicker">Withdrawal Dataset</span>
|
<span class="panel-kicker">Withdrawal Dataset</span>
|
||||||
<h3>提现审核</h3>
|
<h3>提现审核</h3>
|
||||||
<p>共 {{ total }} 条记录,支持按商户、审核状态和申请时间筛选。</p>
|
<!-- <p>共 {{ total }} 条记录,支持按申请人、申请时间筛选。</p> -->
|
||||||
</div>
|
</div>
|
||||||
<div class="toolbar-actions">
|
<div class="toolbar-actions">
|
||||||
<!-- 提现模块的接口与菜单尚未建立,权限标识待后端约定后再补 v-hasPermi -->
|
<!-- 提现模块的接口与菜单尚未建立,权限标识待后端约定后再补 v-hasPermi -->
|
||||||
<el-button type="primary" plain icon="Check" :disabled="multiple" @click="notImplemented">批量审核</el-button>
|
<!-- <el-button type="primary" plain icon="Check" :disabled="multiple" @click="notImplemented">批量审核</el-button> -->
|
||||||
<el-button type="warning" plain icon="Download" @click="notImplemented">导出</el-button>
|
<!-- <el-button type="warning" plain icon="Download" @click="notImplemented">导出</el-button> -->
|
||||||
<right-toolbar v-model:show-search="showSearch" :search="false" @query-table="getList"></right-toolbar>
|
<right-toolbar v-model:show-search="showSearch" :search="false" @query-table="getList"></right-toolbar>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -60,33 +52,13 @@
|
|||||||
|
|
||||||
<el-table v-loading="loading" :data="withdrawalList" @selection-change="handleSelectionChange">
|
<el-table v-loading="loading" :data="withdrawalList" @selection-change="handleSelectionChange">
|
||||||
<el-table-column type="selection" width="50" align="center" />
|
<el-table-column type="selection" width="50" align="center" />
|
||||||
<el-table-column label="提现单号" prop="orderNo" align="center" min-width="180" show-overflow-tooltip />
|
<el-table-column label="申请编号" prop="orderNo" align="center" min-width="180" show-overflow-tooltip />
|
||||||
<el-table-column label="商户名称" prop="merchantName" align="center" min-width="140" show-overflow-tooltip />
|
<el-table-column label="申请时间" prop="applyTime" align="center" min-width="170" />
|
||||||
<el-table-column label="提现金额(元)" prop="amount" align="center" width="130" />
|
<el-table-column label="提现金额(元)" align="center" min-width="140">
|
||||||
<el-table-column label="手续费(元)" prop="fee" align="center" width="110" />
|
<template #default="scope">{{ formatAmount(scope.row.amount) }}</template>
|
||||||
<el-table-column label="到账金额(元)" prop="actualAmount" align="center" width="130" />
|
|
||||||
<el-table-column label="收款账户" prop="account" align="center" min-width="160" show-overflow-tooltip />
|
|
||||||
<el-table-column label="审核状态" prop="auditStatus" align="center" width="110">
|
|
||||||
<template #default="scope">
|
|
||||||
<dict-tag :options="auditStatusOptions" :value="scope.row.auditStatus" />
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="申请时间" prop="applyTime" align="center" width="170" />
|
|
||||||
<el-table-column label="审核时间" prop="auditTime" align="center" width="170" />
|
|
||||||
<el-table-column label="备注" prop="remark" align="center" min-width="140" show-overflow-tooltip />
|
|
||||||
<el-table-column label="操作" align="center" width="180" fixed="right">
|
|
||||||
<template #default="scope">
|
|
||||||
<el-tooltip content="详情" placement="top">
|
|
||||||
<el-button link type="primary" icon="View" @click="notImplemented"></el-button>
|
|
||||||
</el-tooltip>
|
|
||||||
<el-tooltip content="审核通过" placement="top">
|
|
||||||
<el-button link type="success" icon="Check" :disabled="scope.row.auditStatus !== '0'" @click="notImplemented"></el-button>
|
|
||||||
</el-tooltip>
|
|
||||||
<el-tooltip content="驳回" placement="top">
|
|
||||||
<el-button link type="danger" icon="Close" :disabled="scope.row.auditStatus !== '0'" @click="notImplemented"></el-button>
|
|
||||||
</el-tooltip>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column label="收款账户" prop="account" align="center" min-width="180" show-overflow-tooltip />
|
||||||
|
<el-table-column label="申请人" prop="applicantName" align="center" min-width="120" show-overflow-tooltip />
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<pagination
|
<pagination
|
||||||
@@ -116,6 +88,8 @@ interface WithdrawalVO {
|
|||||||
orderNo?: string;
|
orderNo?: string;
|
||||||
/** 商户名称 */
|
/** 商户名称 */
|
||||||
merchantName?: string;
|
merchantName?: string;
|
||||||
|
/** 申请人 */
|
||||||
|
applicantName?: string;
|
||||||
/** 提现金额(元) */
|
/** 提现金额(元) */
|
||||||
amount?: number;
|
amount?: number;
|
||||||
/** 手续费(元) */
|
/** 手续费(元) */
|
||||||
@@ -138,15 +112,18 @@ interface WithdrawalQuery extends PageQuery {
|
|||||||
orderNo?: string;
|
orderNo?: string;
|
||||||
merchantName?: string;
|
merchantName?: string;
|
||||||
auditStatus?: string;
|
auditStatus?: string;
|
||||||
|
/** 申请人 */
|
||||||
|
applicantName?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 审核状态字典后端尚未建立,先用本地兜底选项
|
/** 金额展示:保留两位小数,单位已写在列名里;无值时不展示 */
|
||||||
const auditStatusOptions: DictDataOption[] = [
|
const formatAmount = (value?: number | string | null) => {
|
||||||
{ label: '待审核', value: '0', elTagType: 'warning' },
|
if (value == null || value === '') return '';
|
||||||
{ label: '已通过', value: '1', elTagType: 'success' },
|
const amount = Number(value);
|
||||||
{ label: '已驳回', value: '2', elTagType: 'danger' },
|
return Number.isNaN(amount)
|
||||||
{ label: '已打款', value: '3', elTagType: 'primary' }
|
? `${value}`
|
||||||
];
|
: amount.toLocaleString('zh-CN', { minimumFractionDigits: 2, maximumFractionDigits: 2 });
|
||||||
|
};
|
||||||
|
|
||||||
const withdrawalList = ref<WithdrawalVO[]>([]);
|
const withdrawalList = ref<WithdrawalVO[]>([]);
|
||||||
const total = ref(0);
|
const total = ref(0);
|
||||||
@@ -165,7 +142,8 @@ const queryParams = ref<WithdrawalQuery>({
|
|||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
orderNo: '',
|
orderNo: '',
|
||||||
merchantName: '',
|
merchantName: '',
|
||||||
auditStatus: ''
|
auditStatus: '',
|
||||||
|
applicantName: ''
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 查询提现申请列表 */
|
/** 查询提现申请列表 */
|
||||||
|
|||||||
Reference in New Issue
Block a user