Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
34ba93c9df
3 files changed
+150
-89
No files matched your search
@@ -1,5 +1,17 @@
|
|||||||
import request from "/@/utils/request"
|
import request from "/@/utils/request"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据申请id获取发票详情
|
||||||
|
* @param id 申请id
|
||||||
|
*/
|
||||||
|
export function invoiceBack(query: any) {
|
||||||
|
return request({
|
||||||
|
url: "/wallet/walletRechargeInvoice/back",
|
||||||
|
method: "get",
|
||||||
|
params: query,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据申请id获取发票详情
|
* 根据申请id获取发票详情
|
||||||
* @param id 申请id
|
* @param id 申请id
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="layout-padding">
|
<div class="layout-padding">
|
||||||
<div class="layout-padding-auto layout-padding-view">
|
<div class="layout-padding-auto layout-padding-view">
|
||||||
<el-form v-show="showSearch" ref="queryRef" :inline="true" :model="state.queryForm"
|
<el-form v-show="showSearch" ref="queryRef" :inline="true" :model="state.queryForm" @keyup.enter="getDataList">
|
||||||
@keyup.enter="getDataList">
|
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-form-item style="width: 300px" label="用户" prop="userIds">
|
<el-form-item style="width: 300px" label="用户" prop="userIds">
|
||||||
<select-user v-model="state.queryForm.userIds" placeholder="用户" />
|
<select-user v-model="state.queryForm.userIds" placeholder="用户" />
|
||||||
@@ -11,51 +10,60 @@
|
|||||||
<select-wallet-type v-model="state.queryForm.walletTypeId" placeholder="饭卡类型" clearable />
|
<select-wallet-type v-model="state.queryForm.walletTypeId" placeholder="饭卡类型" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item style="width: 200px" label="充值类型" prop="bizType">
|
<el-form-item style="width: 200px" label="充值类型" prop="bizType">
|
||||||
<dict-select v-model="state.queryForm.bizType" dict-code="wallet_biz_recharge"
|
<dict-select v-model="state.queryForm.bizType" dict-code="wallet_biz_recharge" placeholder="充值类型" />
|
||||||
placeholder="充值类型" />
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item style="width: 450px" label="创建时间" prop="createTimeList">
|
<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"
|
<el-date-picker v-model="state.queryForm.createTimeList" value-format="YYYY-MM-DD HH:mm:ss" type="datetimerange" />
|
||||||
type="datetimerange" />
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item style="width: 450px" label="审核时间" prop="processTimeList">
|
<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"
|
<el-date-picker v-model="state.queryForm.processTimeList" value-format="YYYY-MM-DD HH:mm:ss" type="datetimerange" />
|
||||||
type="datetimerange" />
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button icon="Search" type="primary" @click="getDataList">{{ $t("common.queryBtn")
|
<el-button icon="Search" type="primary" @click="getDataList">{{ $t("common.queryBtn") }}</el-button>
|
||||||
}}</el-button>
|
|
||||||
<el-button icon="Refresh" @click="resetQuery">{{ $t("common.resetBtn") }}</el-button>
|
<el-button icon="Refresh" @click="resetQuery">{{ $t("common.resetBtn") }}</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
<el-row>
|
<el-row>
|
||||||
<div class="mb8" style="width: 100%">
|
<div class="mb8" style="width: 100%">
|
||||||
<el-button v-if="false" icon="folder-add" type="primary" class="ml10" @click="uploadExcelRef.show()"
|
<el-button icon="folder-add" type="primary" class="ml10" @click="uploadExcelRef.show()" v-auth="'wallet_walletRechargeApply_add'">
|
||||||
v-auth="'wallet_walletRechargeApply_add'">
|
|
||||||
导 入(发票)
|
|
||||||
</el-button>
|
|
||||||
<el-button icon="folder-add" type="primary" class="ml10" @click="uploadExcelRef1.show()"
|
|
||||||
v-auth="'wallet_walletRechargeApply_add'">
|
|
||||||
导 入
|
导 入
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button v-if="false" plain :disabled="multiple" icon="Delete" type="primary"
|
<el-button
|
||||||
v-auth="'wallet_walletRechargeApply_del'" @click="handleDelete(selectObjs)">
|
v-if="false"
|
||||||
|
plain
|
||||||
|
:disabled="multiple"
|
||||||
|
icon="Delete"
|
||||||
|
type="primary"
|
||||||
|
v-auth="'wallet_walletRechargeApply_del'"
|
||||||
|
@click="handleDelete(selectObjs)"
|
||||||
|
>
|
||||||
删除
|
删除
|
||||||
</el-button>
|
</el-button>
|
||||||
<div class="flex justify-between items-center">
|
<div class="flex justify-between items-center">
|
||||||
<el-tabs class="flex-1" v-model="activeName" @tab-click="handleClickTabItem">
|
<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-tab-pane v-for="v in tabItems" :key="v.id" :label="v.label" :name="v.value" />
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
<right-toolbar v-model:showSearch="showSearch" :export="'wallet_walletRechargeApply_export'"
|
<right-toolbar
|
||||||
@exportExcel="exportExcel" class="ml10 mr20" style="float: right"
|
v-model:showSearch="showSearch"
|
||||||
@queryTable="getDataList" />
|
:export="'wallet_walletRechargeApply_export'"
|
||||||
|
@exportExcel="exportExcel"
|
||||||
|
class="ml10 mr20"
|
||||||
|
style="float: right"
|
||||||
|
@queryTable="getDataList"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-table :data="state.dataList" v-loading="state.loading" border :cell-style="tableStyle.cellStyle"
|
<el-table
|
||||||
:header-cell-style="tableStyle.headerCellStyle" @selection-change="selectionChangHandle"
|
:data="state.dataList"
|
||||||
@sort-change="sortChangeHandle">
|
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="selection" width="40" align="center" />
|
||||||
<el-table-column type="index" label="#" width="80" />
|
<el-table-column type="index" label="#" width="80" />
|
||||||
<el-table-column prop="username" label="申请人" />
|
<el-table-column prop="username" label="申请人" />
|
||||||
@@ -107,54 +115,86 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" v-auths="[
|
<el-table-column
|
||||||
'wallet_walletRechargeApply_view',
|
label="操作"
|
||||||
'wallet_walletRechargeApply_apply',
|
v-auths="[
|
||||||
'wallet_walletRechargeApply_edit',
|
'wallet_walletRechargeApply_view',
|
||||||
'wallet_walletRechargeApply_del',
|
'wallet_walletRechargeApply_apply',
|
||||||
'wallet_walletRechargeApply_check',
|
'wallet_walletRechargeApply_edit',
|
||||||
]" width="300" fixed="right">
|
'wallet_walletRechargeApply_del',
|
||||||
|
'wallet_walletRechargeApply_check',
|
||||||
|
]"
|
||||||
|
width="300"
|
||||||
|
fixed="right"
|
||||||
|
>
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-button v-if="row.importTime" icon="Document" text type="primary"
|
<el-button
|
||||||
v-auth="'wallet_walletRechargeApply_view'" @click="doInfo(row)">
|
v-if="row.importTime"
|
||||||
|
icon="Document"
|
||||||
|
text
|
||||||
|
type="primary"
|
||||||
|
v-auth="'wallet_walletRechargeApply_view'"
|
||||||
|
@click="doInfo(row)"
|
||||||
|
>
|
||||||
数据
|
数据
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button v-if="row.importTime && !row.processId" icon="Connection" text type="primary"
|
<el-button
|
||||||
v-auth="'wallet_walletRechargeApply_apply'" @click="doApply(row)">
|
v-if="row.importTime && !row.processId"
|
||||||
|
icon="Connection"
|
||||||
|
text
|
||||||
|
type="primary"
|
||||||
|
v-auth="'wallet_walletRechargeApply_apply'"
|
||||||
|
@click="doApply(row)"
|
||||||
|
>
|
||||||
申请
|
申请
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button v-if="!row.processId" icon="edit-pen" text type="primary"
|
<el-button
|
||||||
v-auth="'wallet_walletRechargeApply_edit'" @click="formDialogRef.openDialog(row.id)">
|
v-if="!row.processId"
|
||||||
|
icon="edit-pen"
|
||||||
|
text
|
||||||
|
type="primary"
|
||||||
|
v-auth="'wallet_walletRechargeApply_edit'"
|
||||||
|
@click="formDialogRef.openDialog(row.id)"
|
||||||
|
>
|
||||||
编辑
|
编辑
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button v-if="row.isCheckUser && row.processStatus == '1'" type="primary" size="small" link
|
<el-button
|
||||||
icon="VideoPlay" @click="deal(row)" v-auth="'wallet_walletRechargeApply_check'">
|
v-if="row.isCheckUser && row.processStatus == '1'"
|
||||||
|
type="primary"
|
||||||
|
size="small"
|
||||||
|
link
|
||||||
|
icon="VideoPlay"
|
||||||
|
@click="deal(row)"
|
||||||
|
v-auth="'wallet_walletRechargeApply_check'"
|
||||||
|
>
|
||||||
开始处理
|
开始处理
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
v-if="row.userId == userInfos?.user?.userId && [null, '1'].includes(row.processStatus)"
|
v-if="row.userId == userInfos?.user?.userId && [null, '1'].includes(row.processStatus)"
|
||||||
icon="delete" text type="primary" v-auth="'wallet_walletRechargeApply_del'"
|
icon="delete"
|
||||||
@click="handleDelete([row.id])">
|
text
|
||||||
|
type="primary"
|
||||||
|
v-auth="'wallet_walletRechargeApply_del'"
|
||||||
|
@click="handleDelete([row.id])"
|
||||||
|
>
|
||||||
删除
|
删除
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle"
|
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
|
||||||
v-bind="state.pagination" />
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 编辑、新增 -->
|
<!-- 编辑、新增 -->
|
||||||
<form-dialog ref="formDialogRef" @refresh="getDataList(false)" />
|
<form-dialog ref="formDialogRef" @refresh="getDataList(false)" />
|
||||||
|
|
||||||
<upload-excel ref="uploadExcelRef" title="充值导入" url="/wallet/wallet-recharge-apply/read-excel"
|
<upload-excel
|
||||||
temp-url="/admin/sys-file/local/file/wallet_recharge.xlsx" @refreshDataList="getDataList(false)" />
|
ref="uploadExcelRef"
|
||||||
|
title="充值导入"
|
||||||
<upload-excel ref="uploadExcelRef1" title="充值导入" url="/wallet/wallet-recharge-apply/read-excel"
|
url="/wallet/wallet-recharge-apply/read-excel"
|
||||||
temp-url="/admin/sys-file/local/file/wallet_recharge.xlsx" @refreshDataList="getDataList(false)" />
|
temp-url="/admin/sys-file/local/file/wallet_recharge.xlsx"
|
||||||
|
@refreshDataList="getDataList(false)"
|
||||||
<upload-excel1 ref="uploadExcelRef1" title="充值导入" url="/wallet/wallet-recharge-apply/read-excel"
|
/>
|
||||||
temp-url="/admin/sys-file/local/file/wallet_recharge.xlsx" @refreshDataList="getDataList(false)" />
|
|
||||||
|
|
||||||
<!-- 审批抽屉 -->
|
<!-- 审批抽屉 -->
|
||||||
<process-drawer ref="processDrawerRef" @task-submit-event="taskSubmitEvent" />
|
<process-drawer ref="processDrawerRef" @task-submit-event="taskSubmitEvent" />
|
||||||
@@ -170,12 +210,7 @@ import { ElLoading, ElMessage } from "element-plus"
|
|||||||
import ProcessDrawer from "/@/components/processDrawer/index.vue"
|
import ProcessDrawer from "/@/components/processDrawer/index.vue"
|
||||||
import { getDicts } from "/@/api/admin/dict"
|
import { getDicts } from "/@/api/admin/dict"
|
||||||
import { useUserInfo } from "/@/stores/userInfo"
|
import { useUserInfo } from "/@/stores/userInfo"
|
||||||
|
|
||||||
// ----------------------------------------------------------------
|
|
||||||
import UploadExcel1 from "/@/components/Upload/Excel.vue"
|
|
||||||
import { displayPrice } from "/@/utils/formatMoney"
|
import { displayPrice } from "/@/utils/formatMoney"
|
||||||
const uploadExcelRef1 = ref()
|
|
||||||
// ----------------------------------------------------------------
|
|
||||||
|
|
||||||
const { push } = useRouter()
|
const { push } = useRouter()
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,8 @@
|
|||||||
<div class="flex justify-between items-end mb-1">
|
<div class="flex justify-between items-end mb-1">
|
||||||
<div></div>
|
<div></div>
|
||||||
<div>
|
<div>
|
||||||
{{ formatDate(new Date(receiptData.time), "YYYY年 mm月 dd日") || " 年 月 日".replace(/ /g, " ") }}
|
{{ formatDate(new Date(receiptData.time), "YYYY年 mm月 dd日") || " 年 月 日".replace(/ /g, " ")
|
||||||
|
}}
|
||||||
</div>
|
</div>
|
||||||
<span>
|
<span>
|
||||||
<span>No. </span>
|
<span>No. </span>
|
||||||
@@ -19,12 +20,8 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td class="border border-gray-600 px-2 w-3/12 h-[0.75cm]">交款单位(或个人)</td>
|
<td class="border border-gray-600 px-2 w-3/12 h-[0.75cm]">交款单位(或个人)</td>
|
||||||
<td class="border border-gray-600 px-2 w-9/12 h-[0.75cm] text-sm text-blue-800" colspan="4">
|
<td class="border border-gray-600 px-2 w-9/12 h-[0.75cm] text-sm text-blue-800" colspan="4">
|
||||||
<input
|
<input type="text" v-model="receiptData.deptOrUser"
|
||||||
type="text"
|
class="caret-red-600 w-full h-full bg-transparent text-center" ref="deptOrUserInput" />
|
||||||
v-model="receiptData.deptOrUser"
|
|
||||||
class="caret-red-600 w-full h-full bg-transparent text-center"
|
|
||||||
ref="deptOrUserInput"
|
|
||||||
/>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -61,15 +58,10 @@
|
|||||||
<td class="border border-gray-600 px-2 w-1/6 h-[0.75cm]">收款单位<br />(盖章)</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">
|
<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" /> -->
|
<!-- <input type="text" v-model="receiptData.payeeDept" class="w-full h-full bg-transparent" /> -->
|
||||||
<img
|
<img v-if="receiptData.picUrl" class="w-[2.5cm] h-[2.5cm] absolute -top-2 left-[140px]"
|
||||||
v-if="receiptData.picUrl"
|
:class="{ stamping: isStamping }" draggable="false"
|
||||||
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"
|
style="-webkit-user-drag: none; user-select: none; pointer-events: none"
|
||||||
oncontextmenu="return false"
|
oncontextmenu="return false" src="/@/assets/receiptStamp.png" />
|
||||||
src="/@/assets/receiptStamp.png"
|
|
||||||
/>
|
|
||||||
</td>
|
</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 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">
|
<td class="border border-gray-600 px-2 text-left w-1/6 h-[0.75cm] text-sm text-blue-800">
|
||||||
@@ -79,16 +71,15 @@
|
|||||||
<td class="border border-gray-600 px-2 text-left align-text-top w-1/3 h-[0.75cm]">
|
<td class="border border-gray-600 px-2 text-left align-text-top w-1/3 h-[0.75cm]">
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<span class="whitespace-nowrap">备注:</span>
|
<span class="whitespace-nowrap">备注:</span>
|
||||||
<textarea
|
<textarea v-model="receiptData.remark"
|
||||||
v-model="receiptData.remark"
|
class="flex-1 text-sm text-blue-800 w-full h-full my-1 bg-transparent resize-none overflow-y-hidden" />
|
||||||
class="flex-1 text-sm text-blue-800 w-full h-full my-1 bg-transparent resize-none overflow-y-hidden"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<div class="flex items-center absolute bottom-0 top-0 right-0">
|
<div class="flex items-center absolute bottom-0 top-0 right-0">
|
||||||
<span class="text-gray-500 text-sm whitespace-nowrap" style="writing-mode: vertical-rl; letter-spacing: 0.2em">
|
<span class="text-gray-500 text-sm whitespace-nowrap"
|
||||||
|
style="writing-mode: vertical-rl; letter-spacing: 0.2em">
|
||||||
{{ "第一联 存根联".replace(/ /g, " ") }}
|
{{ "第一联 存根联".replace(/ /g, " ") }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -96,23 +87,20 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="h-6">
|
<div class="h-6">
|
||||||
<el-progress
|
<el-progress :percentage="progressPercent" v-if="progressPercent > 30" :stroke-width="6" status="success"
|
||||||
:percentage="progressPercent"
|
striped striped-flow :duration="20" />
|
||||||
v-if="progressPercent > 30"
|
|
||||||
:stroke-width="6"
|
|
||||||
status="success"
|
|
||||||
striped
|
|
||||||
striped-flow
|
|
||||||
:duration="20"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<el-button @click="handleClose" :disabled="loading">关闭</el-button>
|
<el-button @click="handleClose" :disabled="loading">关闭</el-button>
|
||||||
<el-button v-auth="'wallet_walletRechargeApply_receiptStamp'" type="primary" @click="stampReceipt" :disabled="loading">
|
<el-button v-if="!receiptData.picUrl" v-auth="'wallet_walletRechargeApply_receiptStamp'" type="primary"
|
||||||
|
@click="stampReceipt" :disabled="loading">
|
||||||
盖章
|
盖章
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button v-auth="'wallet_walletRechargeApply_receiptSave'" type="primary" @click="saveReceipt" :disabled="loading">保存</el-button>
|
<el-button v-if="receiptData.picUrl" v-auth="'wallet_walletRechargeApply_back'" type="primary"
|
||||||
|
@click="backInvoice" :disabled="loadingBack">作废</el-button>
|
||||||
|
<el-button v-auth="'wallet_walletRechargeApply_receiptSave'" type="primary" @click="saveReceipt"
|
||||||
|
:disabled="loading">保存</el-button>
|
||||||
<el-button v-if="receiptData.picUrl" type="primary" @click="handlePrint" :disabled="loading">打印</el-button>
|
<el-button v-if="receiptData.picUrl" type="primary" @click="handlePrint" :disabled="loading">打印</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
@@ -121,17 +109,17 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, computed } from "vue"
|
import { ref, computed } from "vue"
|
||||||
import * as htmlToImage from "html-to-image"
|
import * as htmlToImage from "html-to-image"
|
||||||
// import { toPng, toJpeg, toBlob, toPixelData, toSvg } from "html-to-image"
|
|
||||||
import { useMessage } from "/@/hooks/message"
|
import { useMessage } from "/@/hooks/message"
|
||||||
import request from "/@/utils/request"
|
import request from "/@/utils/request"
|
||||||
import { formatDate } from "/@/utils/formatTime"
|
import { formatDate } from "/@/utils/formatTime"
|
||||||
import { displayPrice } from "/@/utils/formatMoney"
|
import { displayPrice } from "/@/utils/formatMoney"
|
||||||
import printJS from "print-js"
|
import printJS from "print-js"
|
||||||
import { bindInvoice } from "/@/api/wallet/wallet-recharge-invoice"
|
import { bindInvoice, invoiceBack, getObj } from "/@/api/wallet/wallet-recharge-invoice"
|
||||||
|
|
||||||
const emit = defineEmits(["refresh"])
|
const emit = defineEmits(["refresh"])
|
||||||
|
|
||||||
interface ReceiptData {
|
interface ReceiptData {
|
||||||
|
id: string
|
||||||
itemJson: string
|
itemJson: string
|
||||||
code: string
|
code: string
|
||||||
time: string
|
time: string
|
||||||
@@ -146,11 +134,13 @@ interface ReceiptData {
|
|||||||
|
|
||||||
const visible = ref(false)
|
const visible = ref(false)
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
|
const loadingBack = ref(false)
|
||||||
const receiptRef = ref<HTMLElement | null>(null)
|
const receiptRef = ref<HTMLElement | null>(null)
|
||||||
const deptOrUserInput = ref<HTMLInputElement | null>(null)
|
const deptOrUserInput = ref<HTMLInputElement | null>(null)
|
||||||
let timer = null
|
let timer = null
|
||||||
const isStamping = ref(false) // 盖章动画开关
|
const isStamping = ref(false) // 盖章动画开关
|
||||||
const receiptData = ref<ReceiptData>({
|
const receiptData = ref<ReceiptData>({
|
||||||
|
id: "",
|
||||||
itemJson: "", // 款项json
|
itemJson: "", // 款项json
|
||||||
code: "", // 发票代码(七位数)
|
code: "", // 发票代码(七位数)
|
||||||
time: "", // 发票日期
|
time: "", // 发票日期
|
||||||
@@ -192,6 +182,27 @@ const handleClose = () => {
|
|||||||
timer = null
|
timer = null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 发票退回
|
||||||
|
const backInvoice = async () => {
|
||||||
|
if (!receiptData.value.picUrl) {
|
||||||
|
useMessage().error("请先盖章")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
loadingBack.value = true
|
||||||
|
try {
|
||||||
|
await invoiceBack({ id: receiptData.value.id })
|
||||||
|
const res = await getObj(receiptData.value.id)
|
||||||
|
receiptData.value = res.data
|
||||||
|
emit("refresh")
|
||||||
|
useMessage().success("作废成功")
|
||||||
|
} catch (error: any) {
|
||||||
|
console.error(error);
|
||||||
|
useMessage().error(error.msg)
|
||||||
|
} finally {
|
||||||
|
loadingBack.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 生成图片并上传
|
// 生成图片并上传
|
||||||
const genImageUpload = async (): Promise<string | void> => {
|
const genImageUpload = async (): Promise<string | void> => {
|
||||||
if (receiptRef.value) {
|
if (receiptRef.value) {
|
||||||
@@ -307,15 +318,18 @@ defineExpose({
|
|||||||
.stamping {
|
.stamping {
|
||||||
animation: stamp-in 1s;
|
animation: stamp-in 1s;
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes stamp-in {
|
@keyframes stamp-in {
|
||||||
0% {
|
0% {
|
||||||
transform: translateY(-100px) scale(2) rotate(0);
|
transform: translateY(-100px) scale(2) rotate(0);
|
||||||
opacity: 0.2;
|
opacity: 0.2;
|
||||||
}
|
}
|
||||||
|
|
||||||
60% {
|
60% {
|
||||||
transform: translateY(-10px) scale(1.5) rotate(0);
|
transform: translateY(-10px) scale(1.5) rotate(0);
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
100% {
|
100% {
|
||||||
transform: translateY(0) scale(1) rotate(0);
|
transform: translateY(0) scale(1) rotate(0);
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
|
|||||||
Reference in new issue
Block a user