<template>
    <div>
        <div class="content-head">
            <el-breadcrumb separator="/">
                <el-breadcrumb-item>招标管理 </el-breadcrumb-item>
                <el-breadcrumb-item>招标项目管理</el-breadcrumb-item>
                <el-breadcrumb-item>发布项目</el-breadcrumb-item>
            </el-breadcrumb>
            <h3>查看项目</h3>
            <h5>查看招标项目</h5>
        </div>
        <div class="othercontent">
            <!--  项目信息 -->
            <div class="message1">
                <messaage ref="message" :ruleForm="detail"></messaage>
            </div>
            <!-- 标的需求 -->
            <div class="demand">
                <demand ref="demand" :ruleForm="detail"></demand>
            </div>
            <!-- 招标时间设置 -->
            <div class="timeSet">
                <timeSet ref="timeSet" :ruleForm="detail"></timeSet>
            </div>
            <!-- 招标文件上传 -->
            <div class="fileUpload">
                <fileUpload ref="fileUpload" :ruleForm="detail"></fileUpload>
            </div>
        </div>
        <div class="centerButton">
            <el-button @click="back">返回</el-button>
        </div>
    </div>
</template>

<script>
import { projectdetail } from '@api/supply/bid';
import { getTime1 } from '@utils/time';
import messaage from './message.vue';
import demand from './demand.vue';
import timeSet from './timeSet.vue';
import fileUpload from './fileUpload.vue';
export default {
    components: {
        messaage,
        demand,
        timeSet,
        fileUpload
    },
    data() {
        return {
            activeIdx: 0,
            allForm: {},
            detail: {}
        };
    },
    created() {
        this.getenquiryProjectId();
    },
    methods: {
        back() {
            this.$router.go(-1);
        },
        // 获取详情
        async getenquiryProjectId() {
            let projectId = localStorage.getItem('projectId');
            const { data, code } = await projectdetail(projectId);
            if (code == 200) {
                data.endTime = getTime1(data.endTime);
                data.startTime = getTime1(data.startTime);
                data.createTime = data.createTime.substring(0, 10);
                data.bidBookInfoPO = data.bidBookInfoDO;
                data.earnestInfoPO = data.earnestInfoDO;
                let userInfo = JSON.parse(localStorage.getItem('userInfo'));
                data.purchaseAgent = userInfo.companyName;
                let bidBookPO = [];
                bidBookPO.push(data.bidBookPO);
                data.bidBookPO = bidBookPO;
                this.detail = data;
                console.log(data)
            }
        }
    }
};
</script>

<style scoped>
.steps {
    width: 800px;
    margin: 0 auto;
    padding: 30px 0;
}

.othercontent > div {
    background: #fff;
    margin-bottom: 30px;
}

.bid {
    margin-top: -20px;
}

.button {
    display: flex;
    justify-content: flex-end;
    padding-bottom: 20px;
    margin-right: 20px;
}
</style>
