diff --git a/src/api/wallet/wallet-recharge-invoice.ts b/src/api/wallet/wallet-recharge-invoice.ts index 0395a9a..885b86c 100644 --- a/src/api/wallet/wallet-recharge-invoice.ts +++ b/src/api/wallet/wallet-recharge-invoice.ts @@ -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", diff --git a/src/views/wallet/wallet-recharge-apply/form.vue b/src/views/wallet/wallet-recharge-apply/form.vue index 8a9722d..0ab2fdd 100644 --- a/src/views/wallet/wallet-recharge-apply/form.vue +++ b/src/views/wallet/wallet-recharge-apply/form.vue @@ -13,7 +13,7 @@ diff --git a/src/views/wallet/wallet-recharge-apply/print-dialog.vue b/src/views/wallet/wallet-recharge-apply/print-dialog.vue index 476e47a..bd2c993 100644 --- a/src/views/wallet/wallet-recharge-apply/print-dialog.vue +++ b/src/views/wallet/wallet-recharge-apply/print-dialog.vue @@ -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({ payeeUser: "", // 收款人 remark: "", // 备注 }) +const applyId = ref() 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 => { 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;