<script setup lang="ts">
import NewPayment from "./component/new-payment/index.vue";
import InitiateAudit from "./component/Initiate-audit/index.vue";
import BusinessAudit from "./component/business-audit/index.vue";
import FinancialAudit from "./component/financial-audit/index.vue";
import PaymentReceipt from "./component/payment-receipt/index.vue";
import { httpStatus } from "/@/api/purchase/orderPay";
import { useResponseHandle } from "/@/hooks";

const responseHandle = useResponseHandle();

//更改付款订单状态
async function requestStatusChange(
  status: string,
  otherParam: Record<string, string> = {}
) {
  const { code, message } = await httpStatus({
    status,
    ...otherParam
  });

  responseHandle({
    code,
    message,
    handler: () => {
      //todo:回到采购付款订单列表
    }
  });
}
</script>

<template>
  <div class="pay__content" bg-white>
    <NewPayment />
    <InitiateAudit @change-status="requestStatusChange" />
    <BusinessAudit @change-status="requestStatusChange" />
    <FinancialAudit @change-status="requestStatusChange" />
    <PaymentReceipt @change-status="requestStatusChange" />
  </div>
</template>

<style lang="scss">
.pay__content {
  padding: 30px !important;
}
</style>
