diff --git a/src/views/wallet/wallet-recharge-invoice/index.vue b/src/views/wallet/wallet-recharge-invoice/index.vue index 4368223..9ace996 100644 --- a/src/views/wallet/wallet-recharge-invoice/index.vue +++ b/src/views/wallet/wallet-recharge-invoice/index.vue @@ -12,8 +12,10 @@ + + + - {{ $t("common.queryBtn") }} {{ $t("common.queryBtn") }} {{ $t("common.resetBtn") }} @@ -24,14 +26,19 @@ 导 入 - +
+ + + + +
- + - + - - + + + + @@ -121,6 +154,8 @@ import { displayPrice } from "/@/utils/formatMoney" import { parseTime } from "/@/utils/formatTime" import { useDict } from "/@/hooks/dict" import { getObj } from "/@/api/wallet/wallet-recharge-invoice" +import ProcessDrawer from "/@/components/processDrawer/index.vue" +import { getDicts } from "/@/api/admin/dict" // 引入组件 const FormDialog = defineAsyncComponent(() => import("./form.vue")) @@ -133,10 +168,13 @@ const formDialogRef = ref() const uploadExcelRef = ref() // 搜索变量 const queryRef = ref() +const processDrawerRef = ref() const showSearch = ref(true) // 多选变量 const selectObjs = ref([]) as any const multiple = ref(true) +const activeName = ref() +const tabItems = ref([{}]) const state: BasicTableProps = reactive({ queryForm: {}, @@ -152,6 +190,7 @@ const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, do const resetQuery = () => { // 清空搜索条件 queryRef.value?.resetFields() + state.queryForm.processStatus = "" // 清空多选 selectObjs.value = [] getDataList() @@ -168,6 +207,19 @@ const selectionChangHandle = (objs: { id: string }[]) => { multiple.value = !objs.length } +onMounted(async () => { + const { data } = await getDicts("check_status") + data.unshift({ label: "全部", value: null }) + data.push({ label: "未提交", value: 99 }) + tabItems.value = data +}) + +// tab点击切换 +const handleClickTabItem = (e: any) => { + state.queryForm.processStatus = tabItems.value[e.index].value + getDataList() +} + // 删除操作 const handleDelete = async (ids: string[]) => { try { @@ -199,4 +251,15 @@ const previewInvoice = async (row: any) => { loading.value = false } } + +// 执行审批 +const deal = (row: any) => { + if (!row.processId) return useMessage().info("流程id不存在") + processDrawerRef.value.openProcessDrawer(row) +} + +// 审批提交 +const taskSubmitEvent = () => { + getDataList() +} diff --git a/src/views/wallet/wallet-recharge-invoice/print-dialog.vue b/src/views/wallet/wallet-recharge-invoice/print-dialog.vue index c6e955c..b89846b 100644 --- a/src/views/wallet/wallet-recharge-invoice/print-dialog.vue +++ b/src/views/wallet/wallet-recharge-invoice/print-dialog.vue @@ -64,7 +64,6 @@ 申请审批 - 盖章审批 保存 - 打印 + 打印 - - - @@ -138,7 +133,6 @@ 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" -import ProcessDrawer from "/@/components/processDrawer/index.vue" import { useDict } from "/@/hooks/dict" interface ReceiptData { @@ -153,8 +147,8 @@ interface ReceiptData { remark: string totalPriceCnStr: string picUrl: string + stampPicUrl: string processStatus: string | null - processId: string | null } const emit = defineEmits(["refresh"]) @@ -164,7 +158,6 @@ let timer const visible = ref(false) const loading = ref(false) const receiptRef = ref(null) -const processDrawerRef = ref() const deptOrUserInput = ref(null) const isStamping = ref(false) // 盖章动画开关 const receiptData = ref({ @@ -179,8 +172,8 @@ const receiptData = ref({ payeeUser: "", // 开票人 remark: "", // 备注 picUrl: "", // 发票图片地址 + stampPicUrl: "", // 盖过章的发票图片地址 processStatus: "", // 审批状态 - processId: "", // 流程实例id }) const receiptDataItems = computed(() => { try { @@ -212,10 +205,6 @@ const handleClose = () => { // 发票作废 const backInvoice = async () => { - if (!receiptData.value.picUrl) { - useMessage().error("请先盖章") - return - } loading.value = true try { await invoiceBack({ id: receiptData.value.id }) @@ -317,7 +306,11 @@ const applyStamp = async () => { if (!picUrl) return useMessage().success("图片上传失败") const { code, msg } = await apply({ id: receiptData.value.id, picUrl }) - if (code == 0) return useMessage().success("申请成功") + if (code == 0) { + useMessage().success("申请成功") + emit("refresh") + return + } useMessage().error(msg || "申请失败") } catch (error) { useMessage().error(error as string) @@ -326,17 +319,6 @@ const applyStamp = async () => { } } -// 执行审批 -const stampApproval = () => { - if (!receiptData.value.processId) return useMessage().info("流程id不存在") - processDrawerRef.value.openProcessDrawer(receiptData.value) -} - -// 审批提交 -const taskSubmitEvent = () => { - emit("refresh") -} - // 打印 const handlePrint = async () => { if (receiptRef.value) {