This commit is contained in:
weiwei committed 2025-06-25 12:47:56 +08:00
commit 4a399bc9b7
3 files changed
+23 -5

No files matched your search

+11
View File
@@ -12,6 +12,17 @@ export function getInvoice(query: any) {
})
}
/**
* 绑定发票
*/
export function bindInvoice(data: any) {
return request({
url: "/wallet/walletRechargeInvoice/bind-invoice",
method: "post",
data: data,
})
}
export function fetchList(query?: Object) {
return request({
url: "/wallet/walletRechargeInvoice/page",
@@ -13,7 +13,7 @@
<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']"
:hide-ids="[(roleCodes.includes('RETURN_CANTEEN') || auths(['wallet_walletRechargeApply_refund'])) ? '' : '3', auths(['wallet_walletRechargeApply_select_jz']) ? '' : '2']"
placeholder="请选择饭卡类型" />
</el-form-item>
</el-col>
@@ -104,7 +104,7 @@ import request from "/@/utils/request"
import { formatDate } from "/@/utils/formatTime"
import { displayPrice } from "/@/utils/formatMoney"
import printJS from "print-js"
import { putObj } from "/@/api/wallet/wallet-recharge-invoice"
import { bindInvoice } from "/@/api/wallet/wallet-recharge-invoice"
interface ReceiptData {
itemJson: string
@@ -134,6 +134,7 @@ const receiptData = ref<ReceiptData>({
payeeUser: "", // 收款人
remark: "", // 备注
})
const applyId = ref<any>()
const receiptDataItems = computed(() => {
try {
const itemJson = JSON.parse(receiptData.value.itemJson)
@@ -147,9 +148,10 @@ const receiptDataItems = computed(() => {
})
const totalPrice = computed(() => displayPrice(receiptData.value.totalPrice))
const openDialog = (data: ReceiptData) => {
const openDialog = (data: ReceiptData, id: any) => {
visible.value = true
receiptData.value = data
applyId.value = id
timer.value = setTimeout(() => deptOrUserInput.value?.focus(), 50)
}
@@ -167,7 +169,6 @@ const genImageUpload = async (): Promise<string | void> => {
backgroundColor: "#ffffff",
pixelRatio: 10,
})
if (blob) {
const formData = new FormData()
formData.append("file", blob, "receipt.png")
@@ -193,7 +194,12 @@ const saveReceipt = async () => {
loading.value = true
const url = await genImageUpload()
if (url) {
const { code, data } = await putObj({ url, deptOrUser: receiptData.value.deptOrUser })
const { code, data } = await bindInvoice({
...receiptData.value,
picUrl: url,
deptOrUser: receiptData.value.deptOrUser,
applyId: applyId.value,
})
if (code == 0) return useMessage().success("保存成功")
useMessage().error(data.msg || "保存失败")
}
@@ -231,6 +237,7 @@ defineExpose({
size: 210mm 297mm;
/* size: A4 landscape; */
}
input {
border: none;
box-shadow: none;