<template>
    <!-- 领料审批主页面 -->
    <div class="app-container">
        <PageHeader
            v-if="isShowComponent !== 'Home'"
            :pageContent="pageContent"
            @goBack="goBack"
        />
        <component
            :is="isShowComponent"
            :isView="isView"
            :auditingTaskId="auditingTaskId"
            @pickingView="pickingView"
            @pickingAuditing="pickingAuditing"
            @goBackPage="goBack"
        />
    </div>
</template>

<script>
import PageHeader from '@/components/pageHeader'
// import Home from './component/home.vue'
import Home from './component/home1.vue'
// import AuditingPage from './component/auditingPage.vue'
import AuditingPage from './component/auditingPage1.vue'
export default {
    components: {
        PageHeader,
        Home,
        AuditingPage,
    },
    data() {
        return {
            isShowComponent: 'Home',
            pageContent: '',
            auditingTaskId: '',
            isView: false,
        }
    },
    methods: {
        /* 审核按钮 */
        pickingAuditing(taskId) {
            this.auditingTaskId = taskId
            this.isView = false
            this.pageContent = '领料任务审批'
            this.isShowComponent = 'AuditingPage'
        },
        /* 查看按钮 */
        pickingView(taskId) {
            this.auditingTaskId = taskId
            this.isView = true
            this.pageContent = '领料审批详情'
            this.isShowComponent = 'AuditingPage'
        },
        goBack() {
            this.isShowComponent = 'Home'
        },
    },
}
</script>
