<template>
    <div>
        <div class="content">
            <dataBreadcrumb :breads="breads"></dataBreadcrumb>
            <changeNav :navs="navs"></changeNav>
            <div class="message flex-between">
                <div>项目编号：{{ projectCode }}</div>
                <div>项目名称：{{ projectName }}</div>
            </div>
            <dataTable :table-data="tableData" :columns="columns"> </dataTable>
            <div class="centerButton">
                <el-button @click="back">返回</el-button>
            </div>
        </div>
    </div>
</template>

<script>
import { reviewInfomation } from '@api/purchaser/bid';
import dataTable from '@components/nopageTable.vue';
import changeNav from '@components/changeNav.vue';
import dataBreadcrumb from '@components/dataBreadcrumb.vue';
export default {
    components: {
        dataTable,
        dataBreadcrumb,
        changeNav
    },
    data() {
        return {
            projectCode: '',
            projectName: '',
            projectId: 2,
            breads: ['招投管理', '招标项目管理 ', '工作台'],
            navs: ['投标信息查看'],
            tableData: [],
            columns: [
                {
                    label: '单位名称',
                    prop: 'companyName'
                },
                 {
                    label: '联系人',
                    prop: 'contactsName'
                },
                {
                    label: '手机',
                    prop: 'phone'
                },
                {
                    label: '邮箱',
                    prop: 'email'
                },
                {
                    label: '报名时间',
                    prop: 'createTime',
                    sortable: true
                },
                {
                    label: '是否买断账期',
                    prop: 'isPayment'
                },
                {
                    label: '是否下载标书',
                    prop: 'downloadId'
                },
                {
                    label: '是否投标',
                    prop: 'bidBookId'
                },
                {
                    slot: 'operate'
                }
            ] // 操作列
        };
    },
    created() {
        this.getreviewInfomation();
        this.projectCode = localStorage.getItem('projectCode');
        this.projectName = localStorage.getItem('projectName');
    },
    methods: {
      back() {
            this.$router.go(-1);
        },
        examine() {
            this.$router.push('/admin/bid/bidingDetail');
        },
        async getreviewInfomation() {
            try {
                let projectId = localStorage.getItem('projectId');
                const { data, code } = await reviewInfomation(projectId);
                if (code === 200) {
                    for (let item of data) {
                        if (item.isPayment) {
                            item.isPayment = '是';
                        } else {
                            item.isPayment = '否';
                        }
                        if (item.downloadId) {
                            item.downloadId = '是';
                        } else {
                            item.downloadId = '否';
                        }
                        if (item.bidBookId) {
                            item.bidBookId = '是';
                        } else {
                            item.bidBookId = '否';
                        }
                    }
                    this.tableData = data;
                }
            } catch (e) {
                console.log(e);
            }
        }
    }
};
</script>

<style scoped>
.message {
    width: 50%;
    margin: 50px 0 20px 50px;
}
</style>
