审批弹窗和审批状态显示
This commit is contained in:
1 parent
3a9bf58f62
commit
a1a2e90251
2 files changed
+38
-9
No files matched your search
@@ -59,6 +59,11 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="payeeUser" label="收款人" />
|
||||
<el-table-column prop="payeeDept" label="收款单位" />
|
||||
<el-table-column prop="processStatus" width="100" label="审核状态">
|
||||
<template #default="{ row }">
|
||||
<dict-tag :options="check_status" :value="row.processStatus" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="status" label="发票状态">
|
||||
<template #default="{ row }">
|
||||
<dict-tag :options="recharge_invoice_status" :value="row.status" />
|
||||
@@ -121,7 +126,8 @@ import { getObj } from "/@/api/wallet/wallet-recharge-invoice"
|
||||
const FormDialog = defineAsyncComponent(() => import("./form.vue"))
|
||||
const PrintDialog = defineAsyncComponent(() => import("./print-dialog.vue"))
|
||||
|
||||
const { recharge_invoice_status } = useDict("recharge_invoice_status")
|
||||
const { recharge_invoice_status, check_status } = useDict("recharge_invoice_status", "check_status")
|
||||
|
||||
// 定义变量内容
|
||||
const formDialogRef = ref()
|
||||
const uploadExcelRef = ref()
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<template>
|
||||
<el-dialog v-model="visible" title="预览" width="800px" :close-on-click-modal="false" draggable destroy-on-close>
|
||||
<dict-tag class="mb-2" :options="check_status" :value="receiptData.processStatus" />
|
||||
|
||||
<div v-loading="loading" id="receiptRef" ref="receiptRef" class="w-[17.5cm] h-[9.5cm] border border-gray-400 p-6 bg-[#EBE1C622]">
|
||||
<div class="text-center mx-auto w-[10cm] text-3xl font-bold">浦江县行政事业单位食堂统一收款收据</div>
|
||||
|
||||
@@ -117,9 +119,13 @@
|
||||
作废
|
||||
</el-button>
|
||||
<el-button type="primary" :disabled="loading" @click="applyStamp">申请审批</el-button>
|
||||
<el-button type="success" :disabled="loading" @click="stampApproval">盖章审批</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="warning" @click="handlePrint" :disabled="loading">打印</el-button>
|
||||
</template>
|
||||
|
||||
<!-- 审批抽屉 -->
|
||||
<process-drawer ref="processDrawerRef" @task-submit-event="taskSubmitEvent" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
@@ -132,8 +138,8 @@ import { formatDate } from "/@/utils/formatTime"
|
||||
import { displayPrice } from "/@/utils/formatMoney"
|
||||
import printJS from "print-js"
|
||||
import { bindInvoice, invoiceBack, getObj, apply } from "/@/api/wallet/wallet-recharge-invoice"
|
||||
|
||||
const emit = defineEmits(["refresh"])
|
||||
import ProcessDrawer from "/@/components/processDrawer/index.vue"
|
||||
import { useDict } from "/@/hooks/dict"
|
||||
|
||||
interface ReceiptData {
|
||||
id: string
|
||||
@@ -148,13 +154,18 @@ interface ReceiptData {
|
||||
totalPriceCnStr: string
|
||||
picUrl: string
|
||||
processStatus: string | null
|
||||
processId: string | null
|
||||
}
|
||||
|
||||
const emit = defineEmits(["refresh"])
|
||||
|
||||
const { check_status } = useDict("check_status")
|
||||
const visible = ref(false)
|
||||
const loading = ref(false)
|
||||
const receiptRef = ref<HTMLElement | null>(null)
|
||||
const deptOrUserInput = ref<HTMLInputElement | null>(null)
|
||||
let timer
|
||||
const receiptRef = ref<HTMLElement | null>(null)
|
||||
const processDrawerRef = ref()
|
||||
const deptOrUserInput = ref<HTMLInputElement | null>(null)
|
||||
const isStamping = ref(false) // 盖章动画开关
|
||||
const receiptData = ref<ReceiptData>({
|
||||
id: "",
|
||||
@@ -168,7 +179,8 @@ const receiptData = ref<ReceiptData>({
|
||||
payeeUser: "", // 开票人
|
||||
remark: "", // 备注
|
||||
picUrl: "", // 发票图片地址
|
||||
processStatus: "",
|
||||
processStatus: "", // 审批状态
|
||||
processId: "", // 流程实例id
|
||||
})
|
||||
const applyId = ref<string>()
|
||||
const receiptDataItems = computed(() => {
|
||||
@@ -311,9 +323,9 @@ const applyStamp = async () => {
|
||||
const picUrl = await uploadImage(blob)
|
||||
if (!picUrl) return useMessage().success("图片上传失败")
|
||||
|
||||
const { code } = await apply({ id: receiptData.value.id, picUrl })
|
||||
const { code, msg } = await apply({ id: receiptData.value.id, picUrl })
|
||||
if (code == 0) return useMessage().success("申请成功")
|
||||
useMessage().error("申请失败")
|
||||
useMessage().error(msg || "申请失败")
|
||||
} catch (error) {
|
||||
useMessage().error(error as string)
|
||||
} finally {
|
||||
@@ -321,6 +333,17 @@ const applyStamp = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 盖章执行审批
|
||||
const stampApproval = () => {
|
||||
if (!receiptData.value.processId) return useMessage().info("流程id不存在")
|
||||
processDrawerRef.value.openProcessDrawer(receiptData.value.processId)
|
||||
}
|
||||
|
||||
// 审批提交
|
||||
const taskSubmitEvent = () => {
|
||||
emit("refresh")
|
||||
}
|
||||
|
||||
// 打印
|
||||
const handlePrint = async () => {
|
||||
if (receiptRef.value) {
|
||||
|
||||
Reference in new issue
Block a user