- {{ formatDate(new Date(receiptData.time), "YYYY年 mm月 dd日") || " 年 月 日".replace(/ /g, " ")
- }}
+ {{ formatDate(new Date(receiptData.time), "YYYY年 mm月 dd日") || " 年 月 日".replace(/ /g, " ") }}
No.
@@ -21,9 +19,13 @@
| 交款单位(或个人) |
-
+
|
@@ -60,10 +62,14 @@
收款单位 (盖章) |
-
+ oncontextmenu="return false"
+ src="/@/assets/receiptStamp.png"
+ />
|
开票人 (签名) |
@@ -73,8 +79,11 @@
|
备注:
-
+
|
@@ -90,20 +99,48 @@
关闭
-
+
作废
- 申请审批
- 保存
- 打印
- 重新生成发票
+ 申请审批
+ 保存
+ 打印
+ 重新生成发票
@@ -116,10 +153,9 @@ import request from "/@/utils/request"
import { formatDate } from "/@/utils/formatTime"
import { displayPrice } from "/@/utils/formatMoney"
import printJS from "print-js"
-import * as WalletRechargeInvoiceApi from "/@/api/wallet/wallet-recharge-invoice"
+import * as WalletRechargeInvoiceApi from "/@/api/wallet/wallet-recharge-invoice"
import { useDict } from "/@/hooks/dict"
-
interface ReceiptData {
id: string
itemJson: string
@@ -202,20 +238,21 @@ const refreshInvoice = async () => {
visibleStampPic.value = false
// 申请审批
const blob = await genImage()
+ await new Promise((resolve) => setTimeout(resolve, 1000))
if (!blob) return useMessage().error("图片生成失败")
const picUrl = await uploadImage(blob)
if (!picUrl) return useMessage().error("图片上传失败")
const _data = {
id: receiptData.value.id,
- picUrl: picUrl
+ picUrl: picUrl,
}
await WalletRechargeInvoiceApi.refreshInvoice(_data)
useMessage().success("重新生成发票成功")
emit("refresh")
visible.value = false
} catch (err: any) {
- console.error(err);
+ console.error(err)
useMessage().error(err.msg)
} finally {
refreshLoading.value = false
@@ -251,7 +288,7 @@ const genImage = async (): Promise => {
pixelRatio: 6,
})
.catch((error) => {
- console.error(error);
+ console.error(error)
return useMessage().error("图片生成错误")
})
return blob
@@ -315,6 +352,7 @@ const applyStamp = async () => {
// 申请审批
const blob = await genImage()
if (!blob) return useMessage().error("图片生成失败")
+ await new Promise((resolve) => setTimeout(resolve, 1000))
const picUrl = await uploadImage(blob)
if (!picUrl) return useMessage().error("图片上传失败")