feat:校验申请的充值/扣款数据当前是否合法

This commit is contained in:
dzc committed 2026-03-31 16:25:48 +08:00
1 parent 79fd0110d6
commit 63844facaf
3 files changed
+126 -20

No files matched your search

@@ -162,7 +162,44 @@
temp-url="/admin/sys-file/local/file/wallet_recharge.xlsx" @refreshDataList="getDataList(false)" />
<!-- 审批抽屉 -->
<process-drawer ref="processDrawerRef" @task-submit-event="taskSubmitEvent" />
<process-drawer ref="processDrawerRef" :width="errorState.errorList?.length ? '55%' : '400px'"
:errorMessage="errorState.errorList?.length ? '当前还有错误信息,是否继续?' : ''" @task-submit-event="taskSubmitEvent">
<template #top>
<div v-if="errorState.errorList?.length" class="w-[100%]">
<div class="title">错误信息</div>
<el-table :data="errorState.errorList" v-loading="errorState.loading" border
:cell-style="tableStyle.cellStyle" :header-cell-style="tableStyle.headerCellStyle">
<el-table-column prop="username" width="150" label="用户" align="center" />
<el-table-column prop="userMobile" width="120" label="手机号" align="center" />
<el-table-column prop="bizType" width="120" label="充值类型" align="center">
<template #default="{ row }">
<dict-tag :options="wallet_biz_recharge" :value="row.bizType" />
</template>
</el-table-column>
<el-table-column prop="price" label="操作金额" align="center" min-width="120">
<template #default="{ row }">{{ displayPrice(row.price) }}</template>
</el-table-column>
<el-table-column prop="walletBlance" label="钱包余额" align="center" min-width="120">
<template #default="{ row }">{{ displayPrice(row.walletBlance) }}</template>
</el-table-column>
<el-table-column prop="afterPrice" label="操作后的金额" align="center" min-width="120">
<template #default="{ row }">
<span :class="row.afterPrice > 0 ? 'color-success' : 'color-danger'">
{{ displayPrice(row.afterPrice) }}
</span>
</template>
</el-table-column>
<el-table-column width="300" prop="errorMsg" label="错误信息" align="center">
<template #default="{ row }">
<el-tag type="danger" v-for="(item, index) in row.errorList" :key="index">
{{ item }}
</el-tag>
</template>
</el-table-column>
</el-table>
</div>
</template>
</process-drawer>
</div>
</template>
@@ -203,6 +240,11 @@ const activeName = ref()
const tabItems = ref<any>([{}])
const processDrawerRef = ref()
const errorState = reactive<any>({
errorList: [],
loading: false,
})
const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: {},
pageList: walletRechargeApplyApi.pageJoin,
@@ -309,8 +351,23 @@ const handleDelete = async (ids: string[]) => {
* 点击开始处理
* @param row
*/
const deal = (row: any) => {
const deal = async (row: any) => {
if (!row.processId) return useMessage().info("流程id不存在")
try {
errorState.loading = true
// 查询是否有错误
const { data }: any = await walletRechargeApplyApi.validateError({ applyId: row.id })
if (data && data.length) {
errorState.errorList = data
} else {
errorState.errorList = []
}
} catch (error) {
console.log("查询是否有错误error:", error);
errorState.errorList = []
} finally {
errorState.loading = false
}
processDrawerRef.value.openProcessDrawer(row)
}
@@ -321,6 +378,26 @@ const taskSubmitEvent = () => {
</script>
<style scoped lang="scss">
.title {
display: flex;
align-items: center;
color: #333;
line-height: 16px;
font-size: 16px;
font-weight: bold;
margin-bottom: 10px;
&::before {
content: "";
display: inline-block;
width: 4px;
height: 16px;
border-radius: 2px;
background-color: #ff4949;
margin-right: 5px;
}
}
.status {
display: flex;
align-items: center;