<template>
    <!-- 结算申请-->
    <div class="app-container">
        <PageHeader
            v-if="isShowComponent !== 'ApplyHome'"
            :pageContent="pageContent"
            @goBack="goBack"
        />
        <component
            :is="isShowComponent" 
            :row="rowData"  
            @goDetail="goDetail" 
            @goBackPage="goBack"
        />
    </div>
</template>

<script>
import PageHeader from '@/components/pageHeader' 
import ApplyHome from './component/applyHome.vue' 
import ApplyDetail from './component/applyDetail.vue' 
export default {
    name: 'CostRecord',
    components: {
        PageHeader,
        ApplyHome,
        ApplyDetail
    },
    data() {
        return {
            isShowComponent: 'ApplyHome',
            pageContent: '', 
            rowData: null,
            isView: false,
        }
    },
    methods: { 
        // 退料编辑
        goDetail(rowData) {
            this.rowData = rowData;
            this.pageContent = '结算详情';
            this.isShowComponent = 'ApplyDetail';
        }, 
        goBack() {
            this.isShowComponent = 'ApplyHome'
        },
    },
}
</script>
