<template>
    <!-- 退料接收 -->
    <div class="app-container">
        <PageHeader
            v-if="isShowComponent !== 'Home'"
            :pageContent="pageContent"
            @goBack="goBack"
        />
        <component
            :is="isShowComponent"
            :isView="isView"
            :rejectId="rejectId"
            :rejectTaskId="rejectTaskId"
            @receiveView="receiveView"
            @receiveReturn="receiveReturn"
            @goBackPage="goBack"
        />
    </div>
</template>

<script>
import PageHeader from '@/components/pageHeader'
import Home from './component/home.vue'
import HandlePage from './component/handlePage.vue'
export default {
    components: {
        PageHeader,
        Home,
        HandlePage,
    },
    data() {
        return {
            isShowComponent: 'Home',
            pageContent: '',
            rejectId: '',
            rejectTaskId: '',
            isView: false,
        }
    },
    methods: {
        // 查看
        receiveView(id) {
            this.pageContent = '退料详情'
            this.rejectId = id
            this.isView = true
            this.isShowComponent = 'HandlePage'
        },
        // 退料操作
        receiveReturn(id, taskId) {
            this.rejectId = id
            this.rejectTaskId = taskId
            this.isView = false
            this.pageContent = '退料处理'
            this.isShowComponent = 'HandlePage'
        },
        goBack() {
            this.isShowComponent = 'Home'
        },
    },
}
</script>

<style>
</style>