Merge remote-tracking branch 'origin/master'

This commit is contained in:
zjf committed 2025-07-03 18:19:00 +08:00
commit 593d714296
4 files changed
+45 -22

No files matched your search

+1
View File
@@ -140,6 +140,7 @@ const handleFileSuccess = (response: any) => {
* 提交表单,触发上传 * 提交表单,触发上传
*/ */
const submitFileForm = () => { const submitFileForm = () => {
state.upload.isUploading = true
uploadRef.value.submit() uploadRef.value.submit()
} }
@@ -3,19 +3,36 @@
<el-dialog :title="prop.title" v-model="state.upload.open" :close-on-click-modal="false" draggable> <el-dialog :title="prop.title" v-model="state.upload.open" :close-on-click-modal="false" draggable>
<el-form ref="dataFormRef" :model="form" :rules="dataRules" label-width="90px"> <el-form ref="dataFormRef" :model="form" :rules="dataRules" label-width="90px">
<el-form-item label="充值类型" prop="bizType" class="mb20"> <el-form-item label="充值类型" prop="bizType" class="mb20">
<dict-select v-model="form.bizType" dict-code="wallet_biz_recharge" :hide-ids="[ <dict-select
roleCodes.includes('RETURN_CANTEEN') || auths(['wallet_walletRechargeApply_refund']) ? '' : '3', v-model="form.bizType"
auths(['wallet_walletRechargeApply_select_jz']) ? '' : '2', dict-code="wallet_biz_recharge"
]" placeholder="请选择充值类型" /> :hide-ids="[
roleCodes.includes('RETURN_CANTEEN') || auths(['wallet_walletRechargeApply_refund']) ? '' : '3',
auths(['wallet_walletRechargeApply_select_jz']) ? '' : '2',
]"
placeholder="请选择充值类型"
/>
</el-form-item> </el-form-item>
<el-form-item v-if="form.bizType == '1'" label="发票" prop="invoiceId" class="mb20"> <el-form-item v-if="form.bizType == '1'" label="发票" prop="invoiceId" class="mb20">
<select-wallet-invoice v-model="form.invoiceId" /> <select-wallet-invoice v-model="form.invoiceId" />
</el-form-item> </el-form-item>
<el-upload v-else v-loading="state.upload.isUploading" ref="uploadRef" :limit="1" accept=".xlsx, .xls" <el-upload
:data="{ bizType: form.bizType }" :headers="headers" :action="baseURL + other.adaptationUrl(url)" v-else
:disabled="state.upload.isUploading" :on-progress="handleFileUploadProgress" v-loading="state.upload.isUploading"
:on-success="handleFileSuccess" :on-error="handleFileError" :auto-upload="false" drag> ref="uploadRef"
:limit="1"
accept=".xlsx, .xls"
:data="{ bizType: form.bizType }"
:headers="headers"
:action="baseURL + other.adaptationUrl(url)"
:disabled="state.upload.isUploading"
:on-progress="handleFileUploadProgress"
:on-success="handleFileSuccess"
:on-error="handleFileError"
:auto-upload="false"
drag
>
<i class="el-icon-upload"></i> <i class="el-icon-upload"></i>
<div class="el-upload__text"> <div class="el-upload__text">
{{ $t("excel.operationNotice") }} {{ $t("excel.operationNotice") }}
@@ -24,8 +41,13 @@
<template #tip> <template #tip>
<div class="el-upload__tip text-center"> <div class="el-upload__tip text-center">
<span>{{ $t("excel.fileFormat") }}</span> <span>{{ $t("excel.fileFormat") }}</span>
<el-link type="primary" :underline="false" style="font-size: 12px; vertical-align: baseline" <el-link
@click="downExcelTemp" v-if="tempUrl">{{ $t("excel.downloadTemplate") }} type="primary"
:underline="false"
style="font-size: 12px; vertical-align: baseline"
@click="downExcelTemp"
v-if="tempUrl"
>{{ $t("excel.downloadTemplate") }}
</el-link> </el-link>
</div> </div>
</template> </template>
@@ -41,8 +63,7 @@
</el-dialog> </el-dialog>
<!--校验失败错误数据--> <!--校验失败错误数据-->
<el-dialog :title="$t('excel.validationFailureData')" v-model="state.errorVisible" :close-on-click-modal="false" <el-dialog :title="$t('excel.validationFailureData')" v-model="state.errorVisible" :close-on-click-modal="false" draggable>
draggable>
<el-table :data="state.errorData"> <el-table :data="state.errorData">
<el-table-column property="lineNum" align="center" :label="$t('excel.lineNumbers')" width="100" /> <el-table-column property="lineNum" align="center" :label="$t('excel.lineNumbers')" width="100" />
<el-table-column property="errors" align="center" :label="$t('excel.misDescription')" show-overflow-tooltip> <el-table-column property="errors" align="center" :label="$t('excel.misDescription')" show-overflow-tooltip>
@@ -161,10 +182,11 @@ const handleFileSuccess = (response: any) => {
*/ */
const submitFileForm = async () => { const submitFileForm = async () => {
if (form.bizType != "1") { if (form.bizType != "1") {
state.upload.isUploading = true
uploadRef.value.submit() uploadRef.value.submit()
return return
} }
const valid = await dataFormRef.value.validate().catch(() => { }) const valid = await dataFormRef.value.validate().catch(() => {})
if (!valid) return if (!valid) return
try { try {
state.upload.isUploading = true state.upload.isUploading = true
@@ -173,7 +195,7 @@ const submitFileForm = async () => {
useMessage().success("导入成功充值") useMessage().success("导入成功充值")
emit?.("refreshDataList") emit?.("refreshDataList")
} catch (error: any) { } catch (error: any) {
console.error(error); console.error(error)
useMessage().error(error.msg || "新增充值数据错误") useMessage().error(error.msg || "新增充值数据错误")
} finally { } finally {
state.upload.isUploading = false state.upload.isUploading = false
@@ -78,7 +78,7 @@
icon="printer" icon="printer"
text text
type="primary" type="primary"
:loading="loading" :disabled="loading"
@click="previewInvoice(row)" @click="previewInvoice(row)"
> >
查看发票 查看发票
@@ -87,11 +87,11 @@
</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, "&nbsp;&nbsp;&nbsp;&nbsp;") }} {{ "第一联 存根联".replace(/ /g, "&nbsp;&nbsp;&nbsp;&nbsp;") }}
</span> </span>
</div> </div> -->
</div> </div>
</div> </div>
@@ -165,7 +165,7 @@ const loading = ref(false)
const loadingBack = 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
const isStamping = ref(false) // 盖章动画开关 const isStamping = ref(false) // 盖章动画开关
const receiptData = ref<ReceiptData>({ const receiptData = ref<ReceiptData>({
id: "", id: "",
@@ -210,7 +210,7 @@ const handleClose = () => {
timer = null timer = null
} }
// 发票退回 // 发票作废
const backInvoice = async () => { const backInvoice = async () => {
if (!receiptData.value.picUrl) { if (!receiptData.value.picUrl) {
useMessage().error("请先盖章") useMessage().error("请先盖章")
@@ -357,17 +357,17 @@ defineExpose({
@keyframes stamp-in { @keyframes stamp-in {
0% { 0% {
transform: translateY(-100px) scale(2) rotate(0); transform: translateY(-100px) scale(2);
opacity: 0.2; opacity: 0.2;
} }
60% { 60% {
transform: translateY(-10px) scale(1.5) rotate(0); transform: translateY(-10px) scale(1.5);
opacity: 1; opacity: 1;
} }
100% { 100% {
transform: translateY(0) scale(1) rotate(0); transform: translateY(0) scale(1);
opacity: 1; opacity: 1;
} }
} }