	<template>
    <div>
        <div class="content">
            <dataBreadcrumb :breads="breads"></dataBreadcrumb>
            <changeNav :navs="navs"></changeNav>
            <div class="set">
                <div class="flex-between">
                    <div>项目编号：{{ projectCode }}</div>
                    <div>项目名称：{{ projectName }}</div>
                </div>
                <div class="flex-between">
                    <div>开标时间：{{ openBidTime }}</div>
                    <div>项目状态：{{ projectStatus }}</div>
                </div>
                <div>
                    <el-form ref="ruleForm" :model="ruleForm" label-width="100px" class="demo-ruleForm">
                        <div class="flex-between">
                            <el-form-item label="解密时限" prop="decodeTime">
                                <el-input v-model="ruleForm.decodeTime" style="width: 250px" disabled></el-input>
                            </el-form-item>
                            <el-form-item label="签名时限" prop="signatureTime">
                                <el-input v-model="ruleForm.signatureTime" style="width: 250px" disabled></el-input>
                            </el-form-item>
                        </div>
                        <div>
                            <el-form-item label="开标人" prop="bidOpener">
                                <el-select v-model="bidOpener" placeholder="请选择" style="width: 250px" disabled>
                                    <el-option v-for="item in options" :key="item.id" :label="item.name" :value="item.id"> </el-option>
                                </el-select>
                            </el-form-item>
                        </div>
                        <div class="flex-between">
                            <!-- <el-form-item label="监标人" prop="supervisionerList">
				 <ul>
					 <li v-for="item in ruleForm.supervisionerList" :key="item.id" :label="item.name" :value="item.id"></li>
				 </ul>
              </el-form-item> -->
                            <el-form-item label="监标人" prop="supervisionerList">
                                <el-select v-model="ruleForm.supervisionerList" multiple style="width: 250px" disabled>
                                    <el-option v-for="(item, index) in options" :key="index" :label="item.name" :value="item.id">
                                    </el-option>
                                </el-select>
                            </el-form-item>
                            <el-form-item label="列席人员" prop="delegaterList">
                                <el-select v-model="ruleForm.delegaterList" multiple style="width: 250px" disabled>
                                    <el-option v-for="(item, index) in options" :key="index" :label="item.name" :value="item.id">
                                    </el-option>
                                </el-select>
                            </el-form-item>
                            <!--     <el-form-item label="序列人员" prop="delegaterList">
				<ul>
					 <li v-for="item in ruleForm.delegaterList" :key="item.id" :label="item.name" :value="item.id"></li>
				</ul>
              </el-form-item> -->
                        </div>
                    </el-form>
                    <div class="centerButton">
                        <el-button @click="cancle">返回</el-button>
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>
<script>
import { bidsettingInfo } from '@api/purchaser/bid';
import { timeInfo } from '@api/supply/bid';
import { opener, mamager } from '@api/common/list';
import dataTable from '@components/dataTable.vue';
import dataBreadcrumb from '@components/dataBreadcrumb.vue';
import changeNav from '@components/changeNav.vue';
export default {
    components: {
        dataTable,
        changeNav,
        dataBreadcrumb
    },
    data() {
        return {
            openBidTime: '',
            bidOpener: '',
            projectStatus: '',
            options: [],
            bidOpeners: [],
            ruleForm: {
                decodeTime: '',
                signatureTime: '',
                pereson: '选项2',
                bidOpener: '',
                supervisionerList: '',
                delegaterList: ''
            },
            navs: ['开标设置'],
            breads: ['招标管理', '招标项目管理', '工作台'],
            projectCode: '',
            projectName: ''
        };
    },
    created() {
        this.projectCode = localStorage.getItem('projectCode');
        this.projectName = localStorage.getItem('projectName');
        this.projectStatus = localStorage.getItem('projectStatus');
        this.getopener();
        this.getmamager();
        this.getbidsettingInfo();
        this.gettimeInfo();
    },
    methods: {
        cancle() {
            this.$router.go(-1);
        },
        // 获取公司人员列表
        async getopener() {
            let companyId = localStorage.getItem('companyId');
            const { data, code } = await opener(companyId);
            if (code === 200) {
                this.options = data;
                console.log(data);
            }
        },
        // 获取该项目下的项目经理
        async getmamager() {
            let projectId = localStorage.getItem('projectId');
            const { data, code } = await mamager(projectId);
            if (code === 200) {
                this.bidOpener = data;
            }
        },
        async gettimeInfo() {
            let projectId = localStorage.getItem('projectId');
            const { data, code } = await timeInfo(projectId);
            if (code === 200) {
                this.openBidTime = data.openBidTime;
            }
        },
        //设置查看
        async getbidsettingInfo() {
            let projectId = localStorage.getItem('projectId');
            const { data, code } = await bidsettingInfo(projectId);
            if (code === 200) {
                data.decodeTime = data.decodeTime + '分钟';
                data.signatureTime = data.signatureTime + '分钟';
                this.ruleForm = data;
                let list = [];
                let list1 = [];
                for (let item of data.supervisionerList) {
                    list.push(item.name);
                }
                for (let item of data.delegaterList) {
                    list1.push(item.name);
                }
                data.supervisionerList = list;
                data.delegaterList = list1;
            }
        }
    }
};
</script>

<style scoped>
.set {
    width: 50%;
    margin: 50px auto;
}

.set > div {
    margin-bottom: 50px;
}
</style>
