保存发票触发刷新

This commit is contained in:
weiwei committed 2025-06-26 09:33:22 +08:00
1 parent 900f3aa1ca
commit 8a5ab393cc
2 files changed
+45 -24

No files matched your search

@@ -1,8 +1,7 @@
<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="申请用户" />
@@ -11,30 +10,38 @@
<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-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="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="发票编号" />
@@ -67,29 +74,38 @@
<!-- <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)" />
<!-- 发票预览 -->
<print-dialog ref="printDialogRef" />
<print-dialog ref="printDialogRef" @refresh="getDataList(false)" />
</div>
</template>
@@ -116,6 +116,8 @@ import { displayPrice } from "/@/utils/formatMoney"
import printJS from "print-js"
import { bindInvoice } from "/@/api/wallet/wallet-recharge-invoice"
const emit = defineEmits(["refresh"])
interface ReceiptData {
itemJson: string
code: string
@@ -220,7 +222,10 @@ const saveReceipt = async () => {
applyId: applyId.value,
})
saveProgress.value = 100
if (code == 0) return useMessage().success("保存成功")
if (code == 0) {
emit("refresh")
return useMessage().success("保存成功")
}
useMessage().error(data.msg || "保存失败")
}
} catch (err) {