<!--
 * @Author: Fly
 * @Date: 2025-12-10 16:44:11
 * @LastEditTime: 2025-12-26 10:20:43
 * @Description: 
-->
<template>
    <Drawer title="查看" :visible.sync="DrawerVisible" :showFooter="true" :skeleton="skeletonLoading"
        :wrapperClosable="true" :size="$drawerWidth(800)">
        <el-form ref="form" label-width="120px">
            <div class="form-headline">支付信息</div>
            <el-row class="form-content">
                <el-col :span="12">
                    <el-form-item label="订单号：">{{ PayVo.orderNo | TableItemEmpty }}</el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="支付方式：">{{ PayVo.payType | PayTypeFilter | TableItemEmpty }}</el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="用户手机号：">{{ PayVo.userMobile | TableItemEmpty }}</el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="支付金额：">{{ PayVo.payAmount | TableItemEmpty }}</el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="支付时间：">{{ PayVo.payTime | TableItemEmpty }}</el-form-item>
                </el-col>
            </el-row>
            <div class="form-headline">补贴信息</div>
            <el-row class="form-content">
                <el-col :span="12">
                    <el-form-item label="已补贴积分：">
                        {{ SubsidyQueueVo.subsidyPoints | TableItemEmpty }}
                        <template v-if="RefundVo">
                            （扣除积分 {{ RefundVo.pointReturn | TableItemEmpty }}）
                        </template>
                    </el-form-item>
                </el-col>

                <el-col :span="12">
                    <el-form-item label="已补贴金额：">
                        {{ SubsidyQueueVo.actualSubsidyAmount | TableItemEmpty }}
                        <template v-if="RefundVo">
                            （扣除余额 {{ RefundVo.balanceReturn | TableItemEmpty }}）
                        </template>
                    </el-form-item>
                </el-col>
            </el-row>
            <div class="form-headline">退款信息</div>
            <el-row class="form-content">
                <el-col :span="12">
                    <el-form-item label="退款状态：">{{ RefundVo && RefundVo.refundStatus | RefundStatusOptionFilter |
                        TableItemEmpty }}</el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="申请时间：">{{ RefundVo && RefundVo.refundApplyTime | TableItemEmpty }}
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="退款金额：">{{ RefundVo && RefundVo.refundAmount | TableItemEmpty }}</el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="退款时间：">{{ RefundVo && RefundVo.refundCompleteTime | TableItemEmpty
                    }}</el-form-item>
                </el-col>
            </el-row>
        </el-form>
        <template v-slot:footer>
            <el-button :size="ELsize" @click.stop="DrawerVisible = false">取消</el-button>
        </template>
    </Drawer>
</template>

<script>
// getBusinessDayBillInfoApi
import { getOnlineOrderInfoApi } from "@/api/OnlineOrder.js";
export default {
    name: '',
    data() {
        return {
            DrawerVisible: false,
            skeletonLoading: false,
            PayVo: {},
            RefundVo: null,
            SubsidyQueueVo: {}
        };
    },
    created() {
        // setTimeout(() => {
        //     this.openHandle({ "createBy": null, "createTime": "2025-12-09 10:55:26", "updateBy": null, "updateTime": "2025-12-09 11:25:26", "orderId": 23, "businessName": "中站药品专门店", "orderNo": "ZFDD251209000002", "payType": 0, "userMobile": "18839160015", "userName": "程", "payAmount": "20.00", "payTime": null, "actualSubsidyAmount": null, "refundTime": null, "refundAmount": null, "orderStatus": 100, "subsidyAmount": "0.00", "orderAmount": "20.00", "payStatus": 0, "transactionId": "P1998224934601895937", "userId": 15, "businessId": 21, "cancelType": 2, "cancelTime": "2025-12-09 11:25:26", "cancelReason": "支付超时取消", "refundStatus": 0, "sendPoint": "0.00", "expireTime": "2025-12-09 11:25:25", "lastEndTime": null, "end": false, "businessIncome": "0.00", "businessShouldSubsidy": "0.00", "subsidyStatus": null, "platformServiceFee": "0.00", "platformIncome": "0.00", "platformIncomeSettled": 0, "onlineRefundOrderVo": null, "orderType": 3, "subsidyQueueVo": null })
        // }, 100);
    },

    methods: {
        async openHandle(row) {
            this.DrawerVisible = true;
            const { orderId } = row || {};
            this.skeletonLoading = true;
            let V_ = null;
            console.log("row orderId= " , orderId)
            try {
                if (orderId) {
                    const { data } = await getOnlineOrderInfoApi(orderId);
                    V_ = data;
                }
            } catch { }

            const { onlineRefundOrderVo, subsidyQueueVo } = V_ || row || {};
            this.PayVo = V_ || row || {};
            this.SubsidyQueueVo = subsidyQueueVo || {};
            this.RefundVo = onlineRefundOrderVo || null;
            this.skeletonLoading = false;
        },

    },
};
</script>