|
@@ -3,9 +3,9 @@ import { computed, onMounted, ref } from "vue";
|
|
import { useRoute, useRouter } from "vue-router";
|
|
import { useRoute, useRouter } from "vue-router";
|
|
import RefundDetail from "./components/refund-detail/index.vue";
|
|
import RefundDetail from "./components/refund-detail/index.vue";
|
|
import { approval_process } from "./components/approval-process";
|
|
import { approval_process } from "./components/approval-process";
|
|
-import { useResponseHandle } from "/@/hooks";
|
|
|
|
import { httpStatus, httpDetail } from "/@/api/InvoiceSales/returnTicket";
|
|
import { httpStatus, httpDetail } from "/@/api/InvoiceSales/returnTicket";
|
|
-import CreateRefund from "./components/create-refund/index.vue";
|
|
|
|
|
|
+import CreateReturnTicket from "./components/create-return-ticket/index.vue";
|
|
|
|
+import { useAsync } from "/@/hooks";
|
|
|
|
|
|
const { query } = useRoute();
|
|
const { query } = useRoute();
|
|
const { push } = useRouter();
|
|
const { push } = useRouter();
|
|
@@ -15,62 +15,54 @@ const returnCode = computed(() => query.id);
|
|
|
|
|
|
const isCreate = computed(() => !returnCode.value);
|
|
const isCreate = computed(() => !returnCode.value);
|
|
|
|
|
|
-const refundDetail = ref<Record<string, string>>({});
|
|
|
|
|
|
+const { data, run, loading } = useAsync<Record<string, string>>({
|
|
|
|
+ initalData: {}
|
|
|
|
+});
|
|
|
|
+
|
|
|
|
+//退票详情
|
|
|
|
+const requesetReturnTicketDetail = () => {
|
|
|
|
+ run(httpDetail({ returnCode: returnCode.value }) as any);
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+const { run: retrunTicketStatusRun } = useAsync({
|
|
|
|
+ success: () => push("/InvoiceSales/returnTicket")
|
|
|
|
+});
|
|
|
|
|
|
-const responseHandle = useResponseHandle();
|
|
|
|
|
|
+//退票审核流程
|
|
|
|
+const requesetRetrunTicketStatus = otherParmas => {
|
|
|
|
+ retrunTicketStatusRun(
|
|
|
|
+ httpStatus({
|
|
|
|
+ returnCode: returnCode.value,
|
|
|
|
+ ...otherParmas
|
|
|
|
+ }) as any
|
|
|
|
+ );
|
|
|
|
+};
|
|
|
|
|
|
//映射当前审批流程
|
|
//映射当前审批流程
|
|
const currentProcess = computed(() => {
|
|
const currentProcess = computed(() => {
|
|
- const { status } = refundDetail.value;
|
|
|
|
|
|
+ const { status } = data.value;
|
|
return approval_process[status];
|
|
return approval_process[status];
|
|
});
|
|
});
|
|
|
|
|
|
-//退款详情
|
|
|
|
-async function requesetRefundDetail() {
|
|
|
|
- const { code, message, data } = await httpDetail({
|
|
|
|
- returnCode: returnCode.value
|
|
|
|
- });
|
|
|
|
-
|
|
|
|
- responseHandle({
|
|
|
|
- code,
|
|
|
|
- message,
|
|
|
|
- handler: () => (refundDetail.value = data)
|
|
|
|
- });
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-//退款审核
|
|
|
|
-async function requesetRetrunTicketStatus(otherParmas) {
|
|
|
|
- const { code, message } = await httpStatus({
|
|
|
|
- returnCode: returnCode.value,
|
|
|
|
- ...otherParmas
|
|
|
|
- });
|
|
|
|
-
|
|
|
|
- responseHandle({
|
|
|
|
- code,
|
|
|
|
- message,
|
|
|
|
- handler: () => push("/InvoiceSales/returnTicket")
|
|
|
|
- });
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
function initalData() {
|
|
function initalData() {
|
|
- if (isCreate.value) return;
|
|
|
|
- requesetRefundDetail();
|
|
|
|
|
|
+ !isCreate.value && requesetReturnTicketDetail();
|
|
}
|
|
}
|
|
|
|
|
|
onMounted(() => initalData());
|
|
onMounted(() => initalData());
|
|
</script>
|
|
</script>
|
|
<template>
|
|
<template>
|
|
- <div class="refund__content" bg-white>
|
|
|
|
|
|
+ <div class="return-ticket__content" bg-white>
|
|
<div v-if="isCreate">
|
|
<div v-if="isCreate">
|
|
- <CreateRefund />
|
|
|
|
|
|
+ <CreateReturnTicket />
|
|
</div>
|
|
</div>
|
|
|
|
+
|
|
<ElTabs v-else>
|
|
<ElTabs v-else>
|
|
<ElTabPane label="详情">
|
|
<ElTabPane label="详情">
|
|
<!-- 详情 -->
|
|
<!-- 详情 -->
|
|
<ElCollapse v-model="collapses">
|
|
<ElCollapse v-model="collapses">
|
|
<!-- 退票单详情 -->
|
|
<!-- 退票单详情 -->
|
|
<ElCollapseItem title="退票单详情" name="1">
|
|
<ElCollapseItem title="退票单详情" name="1">
|
|
- <RefundDetail :detail="refundDetail" />
|
|
|
|
|
|
+ <RefundDetail v-loading="loading" :detail="data" />
|
|
</ElCollapseItem>
|
|
</ElCollapseItem>
|
|
|
|
|
|
<!-- 审核 -->
|
|
<!-- 审核 -->
|
|
@@ -93,7 +85,7 @@ onMounted(() => initalData());
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
-.refund__content {
|
|
|
|
|
|
+.return-ticket__content {
|
|
padding: 20px !important;
|
|
padding: 20px !important;
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|