This commit is contained in:
weiwei committed 2025-06-25 21:42:11 +08:00
commit 900f3aa1ca
5 files changed
+113 -162

No files matched your search

+8
View File
@@ -1,5 +1,13 @@
import request from "/@/utils/request"
export function saveTopup(data?: Object) {
return request({
url: "/wallet/wallet-recharge-apply/save-topup",
method: "post",
data: data,
})
}
export function apply(query?: Object) {
return request({
url: "/wallet/wallet-recharge-apply/apply",
@@ -12,8 +12,8 @@
<el-col :span="24" class="mb20">
<el-form-item label="充值类型" prop="bizType">
<dict-select v-model="form.bizType" dict-code="wallet_biz_recharge"
:hide-ids="[(roleCodes.includes('RETURN_CANTEEN') || auths(['wallet_walletRechargeApply_refund'])) ? '' : '3', auths(['wallet_walletRechargeApply_select_jz']) ? '' : '2']"
<dict-select v-model="form.bizType" :disabled="form.invoiceId" dict-code="wallet_biz_recharge"
:hide-ids="[(roleCodes.includes('RETURN_CANTEEN') || auths(['wallet_walletRechargeApply_refund'])) ? '' : '3', auths(['wallet_walletRechargeApply_select_jz']) ? '' : '2', '1']"
placeholder="请选择饭卡类型" />
</el-form-item>
</el-col>
@@ -1,7 +1,8 @@
<template>
<div class="layout-padding">
<div class="layout-padding-auto layout-padding-view">
<el-form v-show="showSearch" ref="queryRef" :inline="true" :model="state.queryForm" @keyup.enter="getDataList">
<el-form v-show="showSearch" ref="queryRef" :inline="true" :model="state.queryForm"
@keyup.enter="getDataList">
<el-row>
<el-form-item style="width: 300px" label="用户" prop="userIds">
<select-user v-model="state.queryForm.userIds" placeholder="用户" />
@@ -10,60 +11,47 @@
<select-wallet-type v-model="state.queryForm.walletTypeId" placeholder="饭卡类型" clearable />
</el-form-item>
<el-form-item style="width: 200px" label="充值类型" prop="bizType">
<dict-select v-model="state.queryForm.bizType" dict-code="wallet_biz_recharge" placeholder="充值类型" />
<dict-select v-model="state.queryForm.bizType" dict-code="wallet_biz_recharge"
placeholder="充值类型" />
</el-form-item>
<el-form-item style="width: 450px" label="创建时间" prop="createTimeList">
<el-date-picker v-model="state.queryForm.createTimeList" value-format="YYYY-MM-DD HH:mm:ss" type="datetimerange" />
<el-date-picker v-model="state.queryForm.createTimeList" value-format="YYYY-MM-DD HH:mm:ss"
type="datetimerange" />
</el-form-item>
<el-form-item style="width: 450px" label="审核时间" prop="processTimeList">
<el-date-picker v-model="state.queryForm.processTimeList" value-format="YYYY-MM-DD HH:mm:ss" type="datetimerange" />
<el-date-picker v-model="state.queryForm.processTimeList" value-format="YYYY-MM-DD HH:mm:ss"
type="datetimerange" />
</el-form-item>
<el-form-item>
<el-button icon="Search" type="primary" @click="getDataList">{{ $t("common.queryBtn") }}</el-button>
<el-button icon="Search" type="primary" @click="getDataList">{{ $t("common.queryBtn")
}}</el-button>
<el-button icon="Refresh" @click="resetQuery">{{ $t("common.resetBtn") }}</el-button>
</el-form-item>
</el-row>
</el-form>
<el-row>
<div class="mb8" style="width: 100%">
<el-button icon="folder-add" type="primary" class="ml10" @click="uploadExcelRef.show()" v-auth="'wallet_walletRechargeApply_add'">
<el-button icon="folder-add" type="primary" class="ml10" @click="uploadExcelRef.show()"
v-auth="'wallet_walletRechargeApply_add'">
导 入
</el-button>
<el-button
v-if="false"
plain
:disabled="multiple"
icon="Delete"
type="primary"
v-auth="'wallet_walletRechargeApply_del'"
@click="handleDelete(selectObjs)"
>
<el-button v-if="false" plain :disabled="multiple" icon="Delete" type="primary"
v-auth="'wallet_walletRechargeApply_del'" @click="handleDelete(selectObjs)">
删除
</el-button>
<div class="flex justify-between items-center">
<el-tabs class="flex-1" v-model="activeName" @tab-click="handleClickTabItem">
<el-tab-pane v-for="v in tabItems" :key="v.id" :label="v.label" :name="v.value" />
</el-tabs>
<right-toolbar
v-model:showSearch="showSearch"
:export="'wallet_walletRechargeApply_export'"
@exportExcel="exportExcel"
class="ml10 mr20"
style="float: right"
@queryTable="getDataList"
/>
<right-toolbar v-model:showSearch="showSearch" :export="'wallet_walletRechargeApply_export'"
@exportExcel="exportExcel" class="ml10 mr20" style="float: right"
@queryTable="getDataList" />
</div>
</div>
</el-row>
<el-table
:data="state.dataList"
v-loading="state.loading"
border
:cell-style="tableStyle.cellStyle"
:header-cell-style="tableStyle.headerCellStyle"
@selection-change="selectionChangHandle"
@sort-change="sortChangeHandle"
>
<el-table :data="state.dataList" v-loading="state.loading" border :cell-style="tableStyle.cellStyle"
:header-cell-style="tableStyle.headerCellStyle" @selection-change="selectionChangHandle"
@sort-change="sortChangeHandle">
<el-table-column type="selection" width="40" align="center" />
<el-table-column type="index" label="#" width="80" />
<el-table-column prop="username" label="申请人" />
@@ -110,86 +98,48 @@
</div>
</template>
</el-table-column>
<el-table-column
label="操作"
v-auths="[
'wallet_walletRechargeApply_view',
'wallet_walletRechargeApply_apply',
'wallet_walletRechargeApply_edit',
'wallet_walletRechargeApply_del',
'wallet_walletRechargeApply_check',
]"
width="300"
fixed="right"
>
<el-table-column label="操作" v-auths="[
'wallet_walletRechargeApply_view',
'wallet_walletRechargeApply_apply',
'wallet_walletRechargeApply_edit',
'wallet_walletRechargeApply_del',
'wallet_walletRechargeApply_check',
]" width="300" fixed="right">
<template #default="{ row }">
<el-button
v-if="row.importTime"
icon="Document"
text
type="primary"
v-auth="'wallet_walletRechargeApply_view'"
@click="doInfo(row)"
>
<el-button v-if="row.importTime" icon="Document" text type="primary"
v-auth="'wallet_walletRechargeApply_view'" @click="doInfo(row)">
数据
</el-button>
<el-button
v-if="row.importTime && !row.processId"
icon="Connection"
text
type="primary"
v-auth="'wallet_walletRechargeApply_apply'"
@click="doApply(row)"
>
<el-button v-if="row.importTime && !row.processId" icon="Connection" text type="primary"
v-auth="'wallet_walletRechargeApply_apply'" @click="doApply(row)">
申请
</el-button>
<el-button
v-if="!row.processId"
icon="edit-pen"
text
type="primary"
v-auth="'wallet_walletRechargeApply_edit'"
@click="formDialogRef.openDialog(row.id)"
>
<el-button v-if="!row.processId" icon="edit-pen" text type="primary"
v-auth="'wallet_walletRechargeApply_edit'" @click="formDialogRef.openDialog(row.id)">
编辑
</el-button>
<el-button
v-if="row.isCheckUser && row.processStatus == '1'"
type="primary"
size="small"
link
icon="VideoPlay"
@click="deal(row)"
v-auth="'wallet_walletRechargeApply_check'"
>
<el-button v-if="row.isCheckUser && row.processStatus == '1'" type="primary" size="small" link
icon="VideoPlay" @click="deal(row)" v-auth="'wallet_walletRechargeApply_check'">
开始处理
</el-button>
<el-button
v-if="row.userId == userInfos?.user?.userId && [null, '1'].includes(row.processStatus)"
icon="delete"
text
type="primary"
v-auth="'wallet_walletRechargeApply_del'"
@click="handleDelete([row.id])"
>
icon="delete" text type="primary" v-auth="'wallet_walletRechargeApply_del'"
@click="handleDelete([row.id])">
删除
</el-button>
</template>
</el-table-column>
</el-table>
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle"
v-bind="state.pagination" />
</div>
<!-- 编辑、新增 -->
<form-dialog ref="formDialogRef" @refresh="getDataList(false)" />
<upload-excel
ref="uploadExcelRef"
title="充值导入"
url="/wallet/wallet-recharge-apply/read-excel"
temp-url="/admin/sys-file/local/file/wallet_recharge.xlsx"
@refreshDataList="getDataList(false)"
/>
<upload-excel ref="uploadExcelRef" title="充值导入" url="/wallet/wallet-recharge-apply/read-excel"
temp-url="/admin/sys-file/local/file/wallet_recharge.xlsx" @refreshDataList="getDataList(false)" />
<!-- 审批抽屉 -->
<process-drawer ref="processDrawerRef" @task-submit-event="taskSubmitEvent" />
@@ -3,35 +3,19 @@
<el-dialog :title="prop.title" v-model="state.upload.open" :close-on-click-modal="false" draggable>
<el-form ref="dataFormRef" :model="form" :rules="dataRules" label-width="90px">
<el-form-item label="充值类型" prop="bizType" class="mb20">
<dict-select
v-model="form.bizType"
dict-code="wallet_biz_recharge"
:hide-ids="[
roleCodes.includes('RETURN_CANTEEN') || auths(['wallet_walletRechargeApply_refund']) ? '' : '3',
auths(['wallet_walletRechargeApply_select_jz']) ? '' : '2',
]"
placeholder="请选择充值类型"
/>
<dict-select v-model="form.bizType" dict-code="wallet_biz_recharge" :hide-ids="[
roleCodes.includes('RETURN_CANTEEN') || auths(['wallet_walletRechargeApply_refund']) ? '' : '3',
auths(['wallet_walletRechargeApply_select_jz']) ? '' : '2',
]" placeholder="请选择充值类型" />
</el-form-item>
<el-form-item v-if="form.bizType == '1'" label="发票" prop="invoiceId" class="mb20">
<select-wallet-invoice v-model="form.invoiceId" />
</el-form-item>
<el-upload
v-else
v-loading="state.upload.isUploading"
ref="uploadRef"
:limit="1"
accept=".xlsx, .xls"
:headers="headers"
:action="baseURL + other.adaptationUrl(url)"
:disabled="state.upload.isUploading"
:on-progress="handleFileUploadProgress"
:on-success="handleFileSuccess"
:on-error="handleFileError"
:auto-upload="false"
drag
>
<el-upload v-else v-loading="state.upload.isUploading" ref="uploadRef" :limit="1" accept=".xlsx, .xls"
:data="{ bizType: form.bizType }" :headers="headers" :action="baseURL + other.adaptationUrl(url)"
:disabled="state.upload.isUploading" :on-progress="handleFileUploadProgress"
:on-success="handleFileSuccess" :on-error="handleFileError" :auto-upload="false" drag>
<i class="el-icon-upload"></i>
<div class="el-upload__text">
{{ $t("excel.operationNotice") }}
@@ -40,13 +24,8 @@
<template #tip>
<div class="el-upload__tip text-center">
<span>{{ $t("excel.fileFormat") }}</span>
<el-link
type="primary"
:underline="false"
style="font-size: 12px; vertical-align: baseline"
@click="downExcelTemp"
v-if="tempUrl"
>{{ $t("excel.downloadTemplate") }}
<el-link type="primary" :underline="false" style="font-size: 12px; vertical-align: baseline"
@click="downExcelTemp" v-if="tempUrl">{{ $t("excel.downloadTemplate") }}
</el-link>
</div>
</template>
@@ -62,7 +41,8 @@
</el-dialog>
<!--校验失败错误数据-->
<el-dialog :title="$t('excel.validationFailureData')" v-model="state.errorVisible" :close-on-click-modal="false" draggable>
<el-dialog :title="$t('excel.validationFailureData')" v-model="state.errorVisible" :close-on-click-modal="false"
draggable>
<el-table :data="state.errorData">
<el-table-column property="lineNum" align="center" :label="$t('excel.lineNumbers')" width="100" />
<el-table-column property="errors" align="center" :label="$t('excel.misDescription')" show-overflow-tooltip>
@@ -80,6 +60,7 @@ import { useUserInfo } from "/@/stores/userInfo"
import other from "/@/utils/other"
import { Session } from "/@/utils/storage"
import { auths } from "/@/utils/authFunction"
import * as walletRechargeApplyApi from "/@/api/wallet/wallet-recharge-apply"
const {
userInfos: { roleCodes },
@@ -183,9 +164,20 @@ const submitFileForm = async () => {
uploadRef.value.submit()
return
}
const valid = await dataFormRef.value.validate().catch(() => {})
const valid = await dataFormRef.value.validate().catch(() => { })
if (!valid) return
try {
state.upload.isUploading = true
await walletRechargeApplyApi.saveTopup({ ...form })
state.upload.open = false
useMessage().success("导入成功充值")
emit?.("refreshDataList")
} catch (error: any) {
console.error(error);
useMessage().error(error.msg || "新增充值数据错误")
} finally {
state.upload.isUploading = false
}
}
/**
@@ -1,30 +1,40 @@
<template>
<div class="layout-padding">
<div class="layout-padding-auto layout-padding-view">
<el-form v-show="showSearch" ref="queryRef" :inline="true" :model="state.queryForm"
@keyup.enter="getDataList">
<el-row>
<el-form-item style="width: 300px" label="申请用户" prop="userIds">
<select-user v-model="state.queryForm.userIds" placeholder="申请用户" />
</el-form-item>
<el-form-item style="width: 300px" label="发票状态" prop="userIds">
<dict-select v-model="state.queryForm.status" dict-code="recharge_invoice_status" />
</el-form-item>
<el-form-item style="width: 450px" label="创建时间" prop="createTimeList">
<el-date-picker v-model="state.queryForm.createTimeList" value-format="YYYY-MM-DD HH:mm:ss"
type="datetimerange" />
</el-form-item>
<el-form-item>
<el-button icon="Search" type="primary" @click="getDataList">{{ $t("common.queryBtn")
}}</el-button>
<el-button icon="Refresh" @click="resetQuery">{{ $t("common.resetBtn") }}</el-button>
</el-form-item>
</el-row>
</el-form>
<el-row>
<div class="mb8" style="width: 100%">
<el-button icon="folder-add" type="primary" class="ml10" @click="uploadExcelRef.show()" v-auth="'wallet_walletRechargeApply_add'">
<el-button icon="folder-add" type="primary" class="ml10" @click="uploadExcelRef.show()"
v-auth="'wallet_walletRechargeApply_add'">
导 入
</el-button>
<right-toolbar
v-model:showSearch="showSearch"
:export="'wallet_walletRechargeInvoice_export'"
@exportExcel="exportExcel"
class="ml10 mr20"
style="float: right"
@queryTable="getDataList"
></right-toolbar>
<right-toolbar v-model:showSearch="showSearch" :export="'wallet_walletRechargeInvoice_export'"
@exportExcel="exportExcel" class="ml10 mr20" style="float: right"
@queryTable="getDataList"></right-toolbar>
</div>
</el-row>
<el-table
:data="state.dataList"
v-loading="state.loading"
border
:cell-style="tableStyle.cellStyle"
:header-cell-style="tableStyle.headerCellStyle"
@selection-change="selectionChangHandle"
@sort-change="sortChangeHandle"
>
<el-table :data="state.dataList" v-loading="state.loading" border :cell-style="tableStyle.cellStyle"
:header-cell-style="tableStyle.headerCellStyle" @selection-change="selectionChangHandle"
@sort-change="sortChangeHandle">
<el-table-column type="selection" width="40" align="center" />
<el-table-column type="index" label="#" width="40" />
<el-table-column prop="code" label="发票编号" />
@@ -57,32 +67,23 @@
<!-- <el-button icon="edit-pen" text type="primary" v-auth="'wallet_walletRechargeInvoice_edit'"
@click="formDialogRef.openDialog(scope.row.id)">编辑</el-button> -->
<!-- v-if="['1'].includes(row.processStatus)" -->
<el-button
v-auth="'wallet_walletRechargeApply_print'"
icon="printer"
text
type="primary"
:loading="getReceiptDataLoading"
@click="previewInvoice(row)"
>
<el-button v-auth="'wallet_walletRechargeApply_print'" icon="printer" text type="primary"
:loading="getReceiptDataLoading" @click="previewInvoice(row)">
打印发票
</el-button>
<el-button icon="delete" text type="primary" v-auth="'wallet_walletRechargeInvoice_del'" @click="handleDelete([row.id])">
<el-button icon="delete" text type="primary" v-auth="'wallet_walletRechargeInvoice_del'"
@click="handleDelete([row.id])">
删除
</el-button>
</template>
</el-table-column>
</el-table>
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle"
v-bind="state.pagination" />
</div>
<upload-excel
ref="uploadExcelRef"
title="导入"
url="/wallet/wallet-recharge-apply/read-topup-excel"
temp-url="/admin/sys-file/local/file/wallet_recharge.xlsx"
@refreshDataList="getDataList(false)"
/>
<upload-excel ref="uploadExcelRef" title="导入" url="/wallet/wallet-recharge-apply/read-topup-excel"
temp-url="/admin/sys-file/local/file/wallet_recharge.xlsx" @refreshDataList="getDataList(false)" />
<!-- 编辑、新增 -->
<form-dialog ref="formDialogRef" @refresh="getDataList(false)" />