<template>
    <div>
        <div class="content">
            <changeNav :navs="navs"></changeNav>
            <div class="message">
                <div>
                    <div>项目编号：{{ projectCode }}</div>
                    <div>项目名称：{{ projectName }}</div>
                </div>
                <div>
                    <div>日期：{{ date}}</div>
                    <div>中标金额：{{ detail.money }}元</div>
                </div>
                <div>
                    <div class="flex-item">
                        <div style="margin-right: 20px">附件：</div>
                        <ul v-if="detail.fileList">
                            <li v-for="(item, i) in detail.fileList" :key="i">
                                <a :href="item.fileUrl">{{ item.fileName }}</a>
                            </li>
                        </ul>
                        <div v-else>无</div>
                    </div>
                    <div>中标通知书编号：{{ detail.number }}</div>
                </div>
                <div class="flex-colunm notice">
                    <h1>您已中标，请及时与平台签署应收账款买断合同。</h1>
                    <h3>咨询电话：400-4567457</h3>
                    <el-button type="primary">查看详情</el-button>
                </div>
                <div class="centerButton">
                    <el-button @click="back">返回</el-button>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
import { winBookdetail } from '@api/supply/bid';
import changeNav from '@components/changeNav.vue';
export default {
    components: {

        changeNav
    },
    data() {
        return {
            projectCode: '',
            projectName: '',

            navs: ['中标通知书'],
            projectCode: '',
            projectName: '',
            detail: ''
        };
    },
    methods: {
        open(url) {
            window.open(url);
        },
        back() {
            this.$router.go(-1);
        },
        async getwinBookdetail() {
            let projectId = localStorage.getItem('projectId');
            const { data, code } = await winBookdetail(projectId);
            if (code == 200) {
                this.detail = data;
                this.date = data.winDate.substring(0,10)
                
            }
        }
    },
    created() {
        this.projectCode = localStorage.getItem('projectCode');
        this.projectName = localStorage.getItem('projectName');
        this.getwinBookdetail();
    }
};
</script>

	
<style scoped>
.content > h1 {
    text-align: center;
    margin-top: 20px;
    margin-bottom: 40px;
    font-weight: bold;
}
.content > .img {
    width: 600px;
    margin: 0 auto;
}
.enclosure {
    margin: 20px 0;
}
.message {
    width: 60%;
    margin: 0 auto;
}
.message > .centerButton{
	justify-content: center;
}
.message > div {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
}
/* .message > div > div:first-child {
    margin-right: 300px;
} */
.notice {
    width: 80%;
    border: 1px solid #000;
}
.notice {
    margin: 200px auto 30px;
    padding: 20px 0;
}
.notice > h3 {
    margin: 20px 0;
}
</style>