<template>
    <el-dialog
        custom-class="ba-operate-dialog"
        :model-value="showDialog"
        @close="showDialog=false"
        title="售后记录"
    >
        <el-table :data="tableData">
            <el-table-column prop="aftersaleTypeName" label="售后类型"></el-table-column>
            <el-table-column prop="isReturnName" label="是否退货"></el-table-column>
            <el-table-column prop="aftersaleStatusName" label="售后状态"></el-table-column>
            <el-table-column prop="aftersaleReason" label="售后原因"></el-table-column>
        </el-table>

    </el-dialog>
</template>

<script setup lang="ts">


import {nextTick, ref, toRaw} from "vue";
import request from "/@/api/request";
import {member, order} from "/@/api/controllerUrls";

let props = defineProps({
    data: {
        type: Object,
        default: {}
    }
})

let tableData = ref([])

function getData(row: any) {
    request.index(order, {id: row.orderId,serialNumber:row.serialNumber}, 'aftersale/index').then(res => {
        tableData.value = res.data
    })
}


let showDialog = ref(false)

function openDialog(value: any) {
    showDialog.value = true
    nextTick(() => {
        getData(value)
    })
}

defineExpose({
    openDialog,
})

</script>

<style scoped>

</style>
