This commit is contained in:
dzc committed 2025-07-05 14:28:06 +08:00
commit 5d08db01ef
2 files changed
+62 -91

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="申请用户" />
@@ -14,39 +13,46 @@
<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 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>
<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_walletRechargeInvoice_export'"
@exportExcel="exportExcel" class="ml10 mr20" style="float: right"
@queryTable="getDataList" />
<right-toolbar
v-model:showSearch="showSearch"
:export="'wallet_walletRechargeInvoice_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="50" />
<el-table-column prop="code" min-width="100" label="发票编号" />
@@ -75,8 +81,11 @@
</el-table-column>
<el-table-column prop="stampPicUrl" min-width="120" label="发票图片">
<template #default="{ row }">
<preview-image :src="row.stampPicUrl" download
:downloadName="`${row.code}-${row.deptOrUser}-${row.payeeDept}-发票-${row.updateTime}`" />
<preview-image
:src="row.stampPicUrl"
download
:downloadName="`${row.code}-${row.deptOrUser}-${row.payeeDept}-发票-${row.updateTime}`"
/>
</template>
</el-table-column>
<el-table-column prop="remark" label="备注" show-overflow-tooltip />
@@ -96,32 +105,44 @@
</div>
</template>
</el-table-column>
<el-table-column label="操作" width="300" fixed="right">
<el-table-column label="操作" min-width="200" fixed="right">
<template #default="{ row }">
<div class="flex">
<el-button v-auth="'wallet_walletRechargeApply_print'" icon="printer" text type="primary"
:disabled="loading" @click="previewInvoice(row)">
查看发票
</el-button>
<!-- row.isCheckUser && -->
<el-button v-if="row.processStatus == '1'" type="primary" link icon="VideoPlay"
:disabled="loading" @click="deal(row)">
开始处理
</el-button>
<el-button icon="delete" text type="primary" v-auth="'wallet_walletRechargeInvoice_del'"
@click="handleDelete([row.id])">
删除
</el-button>
</div>
<el-button
v-auth="'wallet_walletRechargeApply_print'"
icon="printer"
text
type="primary"
:disabled="loading"
@click="previewInvoice(row)"
>
查看发票
</el-button>
<el-button
v-if="row.isCheckUser && row.processStatus == '1'"
type="primary"
link
icon="VideoPlay"
:disabled="loading"
@click="deal(row)"
>
开始处理
</el-button>
<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)" />
@@ -64,14 +64,14 @@
<td class="border border-gray-600 px-2 w-1/6 h-[0.75cm]">收款单位<br />(盖章)</td>
<td class="border border-gray-600 px-2 text-left w-1/6 h-[0.75cm] text-sm text-blue-800">
<!-- <input type="text" v-model="receiptData.payeeDept" class="w-full h-full bg-transparent" /> -->
<!-- <img
<img
v-if="receiptData.stampPicUrl"
class="w-[2.5cm] h-[2.5cm] absolute -top-2 left-[140px]"
:class="{ stamping: isStamping }"
draggable="false"
style="-webkit-user-drag: none; user-select: none; pointer-events: none"
oncontextmenu="return false"
src="/@/assets/receiptStamp.png"
/> -->
/>
</td>
<td class="border border-gray-600 px-2 w-1/6 h-[0.75cm]">开票人<br />(签名)</td>
<td class="border border-gray-600 px-2 text-left w-1/6 h-[0.75cm] text-sm text-blue-800">
@@ -100,15 +100,6 @@
<template #footer>
<el-button @click="handleClose" :disabled="loading">关闭</el-button>
<!-- <el-button
v-if="!receiptData.picUrl"
v-auth="'wallet_walletRechargeApply_receiptStamp'"
type="primary"
@click="stampReceipt"
:disabled="loading"
>
盖章
</el-button> -->
<el-button
v-if="receiptData.processStatus == '2' || receiptData.processStatus == '3'"
v-auth="'wallet_walletRechargeApply_back'"
@@ -161,7 +152,6 @@ const visible = ref(false)
const loading = ref(false)
const receiptRef = ref<HTMLElement | null>(null)
const deptOrUserInput = ref<HTMLInputElement | null>(null)
const isStamping = ref(false) // 盖章动画开关
const receiptData = ref<ReceiptData>({
id: "",
itemJson: "", // 款项json
@@ -194,7 +184,6 @@ const openDialog = (data: ReceiptData, id: string) => {
visible.value = true
receiptData.value = data
receiptData.value.id = id
isStamping.value = false
timer = setTimeout(() => {
deptOrUserInput.value?.focus()
}, 50)
@@ -233,7 +222,6 @@ const genImage = async (): Promise<Blob | void | null> => {
pixelRatio: 6,
})
.catch((error) => {
isStamping.value = false
return useMessage().error("图片生成错误")
})
return blob
@@ -256,23 +244,6 @@ const uploadImage = async (blob: Blob): Promise<string | void> => {
useMessage().error(data.msg || "上传失败")
}
// 盖章并上传发票图片并保存
// const stampReceipt = () => {
// loading.value = true
// isStamping.value = true
// timer = setTimeout(async () => {
// const blob = await genImage()
// if (blob) {
// const url = await uploadImage(blob)
// if (url) {
// receiptData.value.picUrl = url
// await saveReceipt()
// }
// }
// }, 1030)
// }
// 保存发票
const saveReceipt = async (): Promise<void> => {
try {
@@ -354,25 +325,4 @@ defineExpose({
outline: none;
}
}
.stamping {
animation: stamp-in 1s;
}
@keyframes stamp-in {
0% {
transform: translateY(-100px) scale(2);
opacity: 0.2;
}
60% {
transform: translateY(-10px) scale(1.5);
opacity: 1;
}
100% {
transform: translateY(0) scale(1);
opacity: 1;
}
}
</style>