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

+9
View File
@@ -78,3 +78,12 @@ export function putObj(obj?: Object) {
data: obj,
})
}
// 校验申请的充值/扣款数据当前是否合法
export function validateError(params: any) {
return request({
url: "/wallet/wallet-recharge-apply/validate-error",
method: "get",
params: params,
})
}
+38 -18
View File
@@ -1,30 +1,31 @@
<template>
<!-- 流程审批抽屉 -->
<el-drawer v-model="processDrawerVisible" direction="rtl" size="400px">
<el-drawer v-model="processDrawerVisible" direction="rtl" :size="width">
<template #header>
<h3>{{ curAssignTask?.processName }}</h3>
</template>
<template #default>
<div class="w-full h-full" v-loading="loading">
<el-card class="box-card">
<form-render ref="formRenderRef" :form-list="currentOpenFlowForm" />
</el-card>
<flow-node-format
:disableSelect="true"
:formData="formValue"
:task-id="curAssignTask.taskId"
:processInstanceId="curAssignTask.processInstanceId"
:flow-id="curAssignTask.flowId"
ref="flowNodeFormatRef"
class="mt-4"
/>
<div class="w-full flex flex-col justify-center gap-[10px]">
<slot name="top"></slot>
<div class="min-w-[350px] h-full" v-loading="loading">
<el-card class="box-card">
<form-render ref="formRenderRef" :form-list="currentOpenFlowForm" />
</el-card>
<flow-node-format :disableSelect="true" :formData="formValue" :task-id="curAssignTask.taskId"
:processInstanceId="curAssignTask.processInstanceId" :flow-id="curAssignTask.flowId"
ref="flowNodeFormatRef" class="mt-4" />
</div>
</div>
</template>
<template #footer>
<div style="flex: auto">
<el-button size="large" type="danger" icon="Close" @click="refuseTask" :disabled="loading">拒绝</el-button>
<el-button size="large" type="primary" icon="Check" @click="submitTask" :disabled="loading">提交</el-button>
<el-button size="large" type="info" icon="Share" @click="transferTask" :disabled="loading">转办</el-button>
<el-button size="large" type="danger" icon="Close" @click="refuseTask"
:disabled="loading">拒绝</el-button>
<el-button size="large" type="primary" icon="Check" @click="submitTask"
:disabled="loading">提交</el-button>
<el-button size="large" type="info" icon="Share" @click="transferTask"
:disabled="loading">转办</el-button>
</div>
</template>
</el-drawer>
@@ -47,9 +48,21 @@ import AgreeHandle from "./agree.vue"
import RefuseHandle from "./refuse.vue"
import TransferHandle from "./transfer.vue"
import { queryAssignTaskOne, queryTask } from "/@/api/flow/task"
import { useMessage } from "/@/hooks/message";
const emit = defineEmits(["taskSubmitEvent"])
const props = defineProps({
width: {
type: String,
default: "400px",
},
errorMessage: {
type: String,
default: "",
},
})
const processDrawerVisible = ref<boolean>(false)
const curAssignTask = ref<any>({})
const currentOpenFlowForm = ref<FlowFormItem[]>([])
@@ -85,7 +98,14 @@ const openProcessDrawer = async (row: any) => {
}
// 提交任务
const submitTask = () => {
const submitTask = async () => {
if (props.errorMessage) {
try {
await useMessage().delConfirm(props.errorMessage)
} finally {
//
}
}
agreeHandler.value.handle(curAssignTask.value, currentOpenFlowForm.value)
}
// 拒绝任务
@@ -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;