发票盖章修改
This commit is contained in:
1 parent
b1d0b6670d
commit
0032fcf663
2 files changed
+20
-8
No files matched your search
@@ -82,7 +82,7 @@
|
||||
:loading="getReceiptDataLoading"
|
||||
@click="previewInvoice(row)"
|
||||
>
|
||||
打印发票
|
||||
开发票
|
||||
</el-button>
|
||||
<el-button icon="delete" text type="primary" v-auth="'wallet_walletRechargeInvoice_del'" @click="handleDelete([row.id])">
|
||||
删除
|
||||
|
||||
@@ -62,6 +62,7 @@
|
||||
<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
|
||||
v-if="!printButtonDisabled"
|
||||
class="w-[2.5cm] h-[2.5cm] absolute -top-2 left-[140px]"
|
||||
:class="{ stamping: isStamping }"
|
||||
draggable="false"
|
||||
@@ -72,7 +73,8 @@
|
||||
</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">
|
||||
<input type="text" v-model="receiptData.payeeUser" class="w-full h-full bg-transparent" />
|
||||
<!-- <input type="text" v-model="receiptData.payeeUser" class="w-full h-full bg-transparent" /> -->
|
||||
{{ receiptData.payeeUser }}
|
||||
</td>
|
||||
<td class="border border-gray-600 px-2 text-left align-text-top w-1/3 h-[0.75cm]">
|
||||
<div class="flex">
|
||||
@@ -99,8 +101,10 @@
|
||||
|
||||
<template #footer>
|
||||
<el-button @click="handleClose">关闭</el-button>
|
||||
<el-button type="primary" @click="saveReceipt" :disabled="loading">保存</el-button>
|
||||
<el-button type="primary" @click="handlePrint" :disabled="loading">打印</el-button>
|
||||
<el-button v-auth="'wallet_walletRechargeApply_receiptSave'" type="primary" @click="saveReceipt" :disabled="loading">
|
||||
盖章保存
|
||||
</el-button>
|
||||
<el-button v-if="!printButtonDisabled" type="primary" @click="handlePrint" :disabled="loading || printButtonDisabled">打印</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
@@ -128,6 +132,7 @@ interface ReceiptData {
|
||||
payeeUser: string
|
||||
remark: string
|
||||
totalPriceCnStr: string
|
||||
picUrl: string
|
||||
}
|
||||
|
||||
const visible = ref(false)
|
||||
@@ -136,6 +141,7 @@ const receiptRef = ref<HTMLElement | null>(null)
|
||||
const deptOrUserInput = ref<HTMLInputElement | null>(null)
|
||||
const timer = ref<any>(null)
|
||||
const isStamping = ref(false)
|
||||
const printButtonDisabled = ref(false)
|
||||
const receiptData = ref<ReceiptData>({
|
||||
itemJson: "", // 款项json
|
||||
code: "", // 发票代码(七位数)
|
||||
@@ -146,6 +152,7 @@ const receiptData = ref<ReceiptData>({
|
||||
payeeDept: "", // 收款单位
|
||||
payeeUser: "", // 收款人
|
||||
remark: "", // 备注
|
||||
picUrl: "", // 发票图片地址
|
||||
})
|
||||
const applyId = ref<any>()
|
||||
const saveProgress = ref(0)
|
||||
@@ -163,12 +170,14 @@ const receiptDataItems = computed(() => {
|
||||
const totalPrice = computed(() => displayPrice(receiptData.value.totalPrice))
|
||||
|
||||
const openDialog = (data: ReceiptData, id: any) => {
|
||||
if (!data.picUrl) {
|
||||
printButtonDisabled.value = true
|
||||
}
|
||||
visible.value = true
|
||||
receiptData.value = data
|
||||
applyId.value = id
|
||||
isStamping.value = false
|
||||
setTimeout(() => {
|
||||
isStamping.value = true
|
||||
deptOrUserInput.value?.focus()
|
||||
}, 50)
|
||||
}
|
||||
@@ -213,6 +222,7 @@ const genImageUpload = async (): Promise<string | void> => {
|
||||
const saveReceipt = async () => {
|
||||
try {
|
||||
loading.value = true
|
||||
isStamping.value = false
|
||||
const url = await genImageUpload()
|
||||
if (url) {
|
||||
const { code, data } = await bindInvoice({
|
||||
@@ -223,6 +233,8 @@ const saveReceipt = async () => {
|
||||
})
|
||||
saveProgress.value = 100
|
||||
if (code == 0) {
|
||||
isStamping.value = true
|
||||
printButtonDisabled.value = false
|
||||
emit("refresh")
|
||||
return useMessage().success("保存成功")
|
||||
}
|
||||
@@ -274,11 +286,11 @@ defineExpose({
|
||||
}
|
||||
@keyframes stamp-in {
|
||||
0% {
|
||||
transform: translateY(80px) scale(1.5) rotate(0);
|
||||
transform: translateY(80px) scale(2.5) rotate(0);
|
||||
opacity: 0.2;
|
||||
}
|
||||
80% {
|
||||
transform: translateY(10px) scale(1.4) rotate(0);
|
||||
60% {
|
||||
transform: translateY(10px) scale(2) rotate(0);
|
||||
opacity: 1;
|
||||
}
|
||||
100% {
|
||||
|
||||
Reference in new issue
Block a user