<template>
    <div class="full_page">
        <div class="top adfac">
            <div class="t_l adfac">
                <img src="@/assets/images/agent/arrow_left.png" @click="handleBack">
                <div class="spans">
                    <span>项目管理</span>
                    <span class="last">&nbsp;/&nbsp;{{ topname }}</span>
                </div>
            </div>
            <div class="t_r">
                <div class="steps adfacjc">
                    <div class="s_text adfac" :class="{'active':step<3}">
                        <div class="st_num">1</div>
                        <span>创建新项目</span>
                    </div>
                    <div class="s_line"></div>
                    <div class="s_text adfac" :class="{'active':step===2}">
                        <div class="st_num">2</div>
                        <span>添加团队及其成员</span>
                    </div>
                </div>
            </div>
        </div>
        <div class="content">
            <div class="form">
                <template v-if="step===1">
                    <el-form ref="programRef" :model="programForm" :rules="programRules" label-width="140px" style="width: 90%;margin: 0 auto;">
                        <div class="f_title">创建新项目</div>
                        <el-form-item label="企业名称" prop="enterpriseName">
                            <el-input v-model="programForm.enterpriseName" placeholder="请输入企业名称" />
                        </el-form-item>
                        <el-form-item label="统一社会信用代码" prop="creditCode">
                            <el-input v-model="programForm.creditCode" placeholder="请输入统一社会信用代码" />
                        </el-form-item>
                        <el-form-item label="所在地区" prop="area">
                            <el-select v-model="programForm.province" :placeholder="disabled ? '' : '省'" clearable style="width: 32%"
                                @change="(val) => {  regionChange(val, 'province'); }">
                                <el-option v-for="item in provinceOptions" :key="item.id" :label="item.name" :value="item.id">
                                </el-option>
                            </el-select>
                            <el-select v-model="programForm.city" :placeholder="disabled ? '' : '市'" clearable style="width: 32%;margin: 0 2%"
                                @change="(val) => {  regionChange(val, 'city'); }">
                                <el-option v-for="item in cityOptions" :key="item.id" :label="item.name" :value="item.id">
                                </el-option>
                            </el-select>
                            <el-select v-model="programForm.area" :placeholder="disabled ? '' : '区'" clearable style="width: 32%;"
                                @change="(val) => {  regionChange(val, 'area'); }">
                                <el-option v-for="item in areaOptions" :key="item.id" :label="item.name" :value="item.id">
                                </el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label="所在行业" prop="industryCode">
                            <el-select v-model="programForm.industryCode" placeholder="请选择所在行业" style="width: 100%;">
                                <el-option v-for="item in companyIndustry" :label="item.label" :value="item.value"></el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label="人员规模" prop="staffSizeCode">
                            <el-select v-model="programForm.staffSizeCode" placeholder="请选择人员规模" style="width: 100%;">
                                <el-option v-for="item in staffSize" :label="item.label" :value="item.value"></el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label="项目教练" prop="">
                            <div class="f_s adfacjb" @click="hangleSelectCoach" v-if="programForm.coachList.length===0">
                                <div class="fs_text" :class="{'active':coachs!=='请选择'}">{{ coachs }}</div>
                                <i class="el-icon-arrow-down" style="color: #C0C4CC;"></i>
                            </div>
                            <div class="f_s adfac" @click="hangleSelectCoach" v-else>
                                <p>{{ cocahNames }}</p>
                            </div>
                        </el-form-item>
                    </el-form>
                </template>
                <template v-else>
                    <el-form :model="programForm.team" :rules="rules" ref="teamDtoRef" label-width="130px">
                        <div class="f_title">添加团队</div>
                        <el-row style="width: 100%;">
                            <el-col :span="12">
                                <el-form-item label="团队名称" prop="teamName">
                                    <el-input v-model="programForm.team.teamName" clearable placeholder="请输入团队名称"></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="12">
                                <el-form-item label="工作任务" prop="workTasks">
                                    <el-input v-model="programForm.team.workTasks" clearable placeholder="请输入工作任务"></el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row style="width: 100%;">
                            <el-col :span="24">
                                <el-form-item label="团队介绍" prop="introduce">
                                    <el-input type="textarea" v-model="programForm.team.introduce" clearable placeholder="请输入团队介绍"></el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row style="width: 100%;">
                            <el-col :span="24">
                                <el-form-item label="团队项目情况" prop="projectSituation">
                                    <el-input type="textarea" v-model="programForm.team.projectSituation" clearable placeholder="请输入团队项目情况"></el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <div class="f_title" style="margin-top: 31px;">添加成员</div>
                        <el-row style="width: 100%;">
                            <el-col :span="24">
                                <el-form-item label="团队成员" prop="">
                                    <div class="f_type">
                                        <el-radio-group v-model="addType">
                                            <el-radio :label="1">批量导入</el-radio>
                                            <el-radio :label="2">手动录入</el-radio>
                                        </el-radio-group>
                                    </div>
                                    <template v-if="addType===1">
                                        <div class="f_pldr">
                                            <div class="fp_box">
                                                <div class="fpb_pre">
                                                    <div class="fpbp_btn" @click="handleDownloadExcel" v-hasPermi="['core:project:downloadExcel']">下载Excel示例文件</div>
                                                </div>
                                                <img src="@/assets/images/agent/arrow_right_two.png">
                                                <div class="fpb_pre sc">
                                                    <el-upload
                                                        :action="uploadUrl"
                                                        :headers="uploadHeaders"
                                                        :on-success="uploadFileSuccess"
                                                        :before-upload="beforeAvatarUpload"
                                                        :limit="1">
                                                        <div class="fpbp_btn" v-hasPermi="['core:project:uploadExcel']">上传Excel文件</div>
                                                    </el-upload> 
                                                </div>
                                            </div>
                                            <p>
                                                1、Excel文件后缀名为xls或者xlsx，文件中所含列数请勿超过20列<br>
                                                2、模版中用户姓名为必填，其他为选填，且不能对已有字段进行删除、修改<br>
                                                3、部门：上下级部门间用“/”符号隔开，且从最上级部门开始，例如“产品部门/设计”。若存在属于多个部门的情况，不同部门之间用 ; 隔开。
                                            </p>
                                        </div>
                                    </template>
                                    <template v-else-if="addType===2">
                                        <div class="f_sdlr">
                                            <div class="fs_item" v-for="(item,index) in programForm.team.users" :key="index">
                                                <el-form :model="programForm.team.users[index]" label-width="100px">
                                                    <el-row style="width: 100%;">
                                                        <el-col :span="8">
                                                            <el-form-item label="姓名" prop="realName">
                                                                <el-input v-model="programForm.team.users[index].realName" clearable placeholder="请输入"></el-input>
                                                            </el-form-item>
                                                        </el-col>
                                                        <el-col :span="8">
                                                            <el-form-item label="性别" prop="gender">
                                                                <el-select v-model="programForm.team.users[index].gender" placeholder="请选择" style="width: 100%;">
                                                                    <el-option label="男" :value="0"></el-option>
                                                                    <el-option label="女" :value="1"></el-option>
                                                                    <el-option label="保密" :value="2"></el-option>
                                                                </el-select>
                                                            </el-form-item>
                                                        </el-col>
                                                        <el-col :span="8">
                                                            <el-form-item label="出生日期" prop="birthdate">
                                                                <el-date-picker v-model="programForm.team.users[index].birthdate" type="date" placeholder="请选择" style="width: 100%;"></el-date-picker>
                                                            </el-form-item>
                                                        </el-col>
                                                    </el-row>
                                                    <el-row style="width: 100%;">
                                                        <el-col :span="8">
                                                            <el-form-item label="手机号码" prop="mobile">
                                                                <el-input type="number" v-model="programForm.team.users[index].mobile" clearable placeholder="请输入"></el-input>
                                                            </el-form-item>
                                                        </el-col>
                                                        <el-col :span="8">
                                                            <el-form-item label="所属部门" prop="dept">
                                                                <el-input v-model="programForm.team.users[index].dept" clearable placeholder="请输入"></el-input>
                                                            </el-form-item>
                                                        </el-col>
                                                        <el-col :span="8">
                                                            <el-form-item label="职位" prop="post">
                                                                <el-input v-model="programForm.team.users[index].post" clearable placeholder="请输入"></el-input>
                                                            </el-form-item>
                                                        </el-col>
                                                    </el-row>
                                                    <el-row style="width: 100%;">
                                                        <el-col :span="8">
                                                            <el-form-item label="分工" prop="divisionOfLabour">
                                                                <el-input v-model="programForm.team.users[index].divisionOfLabour" clearable placeholder="请输入"></el-input>
                                                            </el-form-item>
                                                        </el-col>
                                                        <el-col :span="8">
                                                            <el-form-item label="教育程度" prop="education">
                                                                <el-input v-model="programForm.team.users[index].education" clearable placeholder="请输入"></el-input>
                                                            </el-form-item>
                                                        </el-col>
                                                        <el-col :span="8">
                                                            <el-form-item label="级别" prop="level">
                                                                <el-input v-model="programForm.team.users[index].level" clearable placeholder="请输入"></el-input>
                                                            </el-form-item>
                                                        </el-col>
                                                    </el-row>
                                                    <el-row style="width: 100%;">
                                                        <el-col :span="8">
                                                            <el-form-item label="" prop="">
                                                                <div class="fs_add del" @click="handleDeleteItem(item,index)">x 删除</div>
                                                            </el-form-item>
                                                        </el-col>
                                                    </el-row>
                                                </el-form>
                                            </div>
                                            <div class="fs_add" @click="handleAddItem">+ 添加</div>
                                        </div>
                                    </template>
                                </el-form-item>
                            </el-col>
                        </el-row>
                    </el-form>
                </template>
            </div>
            <div class="btns">
                <el-button type="primary" @click="handleNext" v-if="step===1" style="margin-left: 20px;">下一步</el-button>
                <el-button type="primary" @click="handlePrevious" v-if="step===2" style="margin-left: 20px;">上一步</el-button>
                <el-button type="primary" @click="handleConfirm" v-if="step===2" style="margin-left: 20px;" v-hasPermi="['core:project:save']">确认</el-button>
                <el-button type="default" @click="handleCancel" style="margin-left: 20px;">取消</el-button>
            </div>
        
            <el-dialog width="790px" :visible.sync="coachShow" title="选择教练" @close="coachShow=false">
                <div class="ed_coach adf">
                    <div class="ec_l">
                        <el-input placeholder="请输入教练名搜索" suffix-icon="el-icon-search" v-model="coachName" style="width: 100%;" @keyup.enter.native="handleQueryCoach"></el-input>
                        <el-checkbox :indeterminate="isIndeterminate" v-model="checkAll" @change="handleCheckAllChange" style="margin-top: 65px;">全选</el-checkbox>
                        <div class="ecl_cbs">
                            <el-checkbox v-model="coach.checked" v-for="(coach,index) in coachList" :key="coach.id" @change="handleChangeCoach" style="margin-top: 24px;display: block;">{{ coach.realName }}</el-checkbox>
                        </div>
                    </div>
                    <div class="ec_r">
                        <div class="ecr_text">已选择（{{ coachSelecteds.length }}/<span>{{ coachList.length }}</span>）</div>
                        <div class="ecr_names">
                            <div class="en_pre adfacjc" v-for="(item,index) in coachSelecteds" :key="index">
                                <span>{{ item.realName }}</span>
                                <img src="@/assets/images/agent/delete_mini.png" @click="handleDeleteCoach(item,index)">
                            </div>
                        </div>
                    </div>
                </div>
                <div class="demo-drawer__footer" style="display: flex;justify-content: end;margin-top: 20px;">
                    <el-button :loading="buttonLoading" type="primary" @click="submitForm">确 认</el-button>
                    <el-button @click="cancel" style="margin-right: 5%;">取 消</el-button>
                </div>
            </el-dialog>
        </div>
    </div>
</template>

<script setup name="">
    import Cookies from "js-cookie";
    import { ref, getCurrentInstance, onMounted } from 'vue'
    import { getCoachList,addCoachProgram,getCoachProgramInfo } from "@/api/agent/index";
    import { useRegion } from "@/mixins/region-module";
    const { proxy } = getCurrentInstance();
    const { companyIndustry, staffSize} = proxy.useDict("companyIndustry", "staffSize");
    const {
        provinceOptions,
        cityOptions,
        areaOptions,
        provincAreaDetailInfoList,
        regionChange
    } = useRegion();
    provincAreaDetailInfoList();
    const uploadUrl = `${window.SITE_CONFIG["apiURL"]}/sys/oss/uploadFile`
    const uploadHeaders = {token:Cookies.get("token")};
    
    const topname = ref('创建项目')
    const step = ref(1)
    const coachs = ref('请选择')
    const coachName = ref('')
    const coachShow = ref(false)
    const coachSelecteds = ref([])
    const coachList = ref([])
    const isIndeterminate = ref(false)
    const checkAll = ref(false)
    const cocahNames = ref('')

    const programForm = ref({
        enterpriseName: '',
        creditCode: '',
        areaCode: '',
        industryCode: '',
        staffSizeCode: '',
        province:'',
        city:'',
        area:'',
        areaCode:'',
        coachList:[],
        team:{
            id:'',
            teamName:'',
            workTasks:'',
            introduce:'',
            projectSituation:'',
            file:'',
            users:[]
        }
    });
    const programRules = ref({
        enterpriseName: [
            { required: true, message: '请输入企业名称', trigger: 'blur' }
        ],
        creditCode: [
            { required: true, message: '请输入统一社会信用代码', trigger: 'blur' }
        ],
        industryCode: [
            { required: true, message: '请选择所在行业', trigger: 'change' }
        ],
        staffSizeCode: [
            { required: true, message: '请选择人员规模', trigger: 'change' }
        ],
        area: [
            { required: true, message: '请选择所在地区', trigger: 'change' }
        ]
    });
    const addType = ref(1)
    const programRef = ref(null)
    const teamDtoRef = ref(null)
    const rules = ref({
        teamName: [
            { required: true, message: '请输入团队名称', trigger: 'blur' }
        ],
        workTasks: [
            { required: true, message: '请输入工作任务', trigger: 'blur' }
        ],
        introduce: [
            { required: true, message: '请输入团队介绍', trigger: 'blur' }
        ],
        projectSituation: [
            { required: true, message: '请输入团队项目情况', trigger: 'blur' }
        ]
    })

    const handleBack = () => {
        proxy.$router.back()
    }
    
    const uploadFileSuccess = e =>{
        programForm.value.team.file = e.data;
    }
    
    const beforeAvatarUpload = (e) => {
        let type = e.name.split('.')[e.name.split('.').length-1];
        let isExcel = e.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
        if(type.toLowerCase() !== 'xlsx' && type.toLowerCase() !== 'xls' && !isExcel){
            proxy?.$modal.msgError('请上传xlsx或xls格式的Excel文件！');
            return false;
        }
    }

    const handleAddItem = () => {
        programForm.value.team.users.push({
            id:'',
            realName:'',
            gender:'',
            birthdate:'',
            mobile:'',
            dept:'',
            post:'',
            divisionOfLabour:'',
            education:'',
            level:'',
        })
    }

    const handleDeleteItem = (item,index) => {
        programForm.value.team.users.splice(index,1)
    }

    const handleNext = () => {
        proxy.$refs.programRef.validate((valid) => {
            if (valid) {
                programForm.value.areaCode = `${programForm.value.province}-${programForm.value.city}-${programForm.value.area}`;
                if(programForm.value.coachList.length===0) return proxy.$message.warning('请至少选择一位教练');
                console.log(programForm.value,'programForm')
                step.value = 2;
                topname.value = '添加团队及其成员';
            } else {
                return false;
            }
        });
    }
    const handlePrevious = () => {
        step.value = 1;
        topname.value = '创建项目';
    }
    const handleConfirm = () => {
        proxy.$refs.teamDtoRef.validate((valid) => {
            if (valid) {
                addCoachProgram(programForm.value).then(res => {
                    if(res.code!==0) return proxy.$message.error(res.msg);
                    proxy.$message.success('创建成功，即将返回');
                    settimeout(()=>{proxy.$router.back();},1500)
                })
            } else {
                return false;
            }
        });
    }
    const handleCancel = () => {
        proxy.$router.back()
    }

    const hangleSelectCoach = () => {
        getCoachList({page:1,limit:-1,realName:coachName.value}).then(res => {
            if(res.code!==0) return proxy.$message.error(res.msg);
            coachList.value = res.data.list;
            coachList.value.forEach(item => {
                item.checked = false;
            })
            coachShow.value = true;
        })
    }
    const handleQueryCoach = () => {
        checkAll.value = false;
        isIndeterminate.value = false;
        coachSelecteds.value = [];
        hangleSelectCoach();
    }

    const submitForm = () => {
        if(coachSelecteds.value.length===0) return proxy.$message.warning('请至少选择一位教练')
        programForm.value.coachList = JSON.parse(JSON.stringify(coachSelecteds.value)).map(c=>{return {coachId:c.id,coachName:c.realName}});
        cocahNames.value = programForm.value.coachList.map(c=>c.coachName).join(';');
        checkAll.value = false;
        isIndeterminate.value = false;
        coachSelecteds.value = [];
        coachList.value = [];
        coachShow.value = false;
    }
    const cancel = () => {
        coachShow.value = false;
    }

    const handleCheckAllChange = (val) => {
        coachSelecteds.value = val ? JSON.parse(JSON.stringify(coachList.value)) : [];
        isIndeterminate.value = false;
        coachList.value.forEach(item => item.checked = val)
    }
    const handleChangeCoach = () => {
        let trues = coachList.value.filter(item => item.checked).length;
        if(trues>0&&trues<coachList.value.length) isIndeterminate.value = true;
        else isIndeterminate.value = false;
        if(trues===coachList.value.length) checkAll.value = true;
        else checkAll.value = false;

        coachSelecteds.value = coachList.value.filter(item => item.checked);
    }
    const handleDeleteCoach = (item,index) => {
        let i = coachList.value.findIndex(c => c.id === item.id);
        if(i>-1) coachList.value[i].checked = false;
        coachSelecteds.value.splice(index,1);

        let trues = coachList.value.filter(item => item.checked).length;
        if(trues>0&&trues<coachList.value.length) isIndeterminate.value = true;
        else isIndeterminate.value = false;
        if(trues===coachList.value.length) checkAll.value = true;
        else checkAll.value = false;
    }

    const handleDownloadExcel = () => {
        window.location.href = `${window.SITE_CONFIG["apiURL"]}/sys/user/download?token=${Cookies.get("token")}`;
    }

    onMounted(() => {
        let programId = proxy.$route.query.programId;
        if(programId){
            getCoachProgramInfo(programId).then(res=>{
                if(res.code!==0) return proxy.$message.error(res.msg);
                step.value = 2;
                programForm.value = {...programForm.value,...res.data};
                if(programForm.value.coachList===null) programForm.value.coachList = [];
                console.log(programForm.value,'programForm')
            })
        }
    })
</script>

<style scoped lang="scss">
    :v-deep .el-dialog__wrapper{
        background: rgba(0,0,0,.3) !important;
    }
    ::v-deep .el-dialog__title{
        font-weight: bold !important;
    }
    ::v-deep .el-dialog{
        margin-top: 15vh !important;
    }

    .full_page{
        background: #FAFAFA;
        .top{
            width: 100%;
            height: 64px;
            background: #FFFFFF;
            border-bottom: 1px solid #F3F4F6;
            .t_l{
                width: 310px;
                img{
                    width: 36px;
                    height: 36px;
                    margin-left: 16px;
                    cursor: pointer;
                }
                .spans{
                    display: flex;
                    align-items: center;
                    margin-left: 23px;
                    span{
                        font-family: PingFangSC, PingFang SC;
                        font-weight: 400;
                        font-size: 14px;
                        color: #6B7280;
                        line-height: 14px;
                        &.last{
                            color: #111111;
                        }
                    }
                }
            }
            .t_r{
                width: calc(100% - 310px);
                .steps{
                    .s_text{
                        .st_num{
                            width: 24px;
                            height: 24px;
                            border-radius: 50%;
                            background: #DDE0E6;
                            font-family: PingFang-SC, PingFang-SC;
                            font-weight: bold;
                            font-size: 14px;
                            color: #FFFFFF;
                            line-height: 24px;
                            text-align: center;
                        }
                        span{
                            margin-left: 10px;
                            font-family: PingFangSC, PingFang SC;
                            font-weight: 400;
                            font-size: 14px;
                            color: #6B7280;
                            line-height: 14px;
                        }
                        &.active{
                            .st_num{
                                background: #761E6A;
                            }
                            span{
                                color: #761E6A;
                            }
                        }
                    }
                    .s_line{
                        width: 496px;
                        height: 1px;
                        border: 1px solid #E5E7EB;
                        margin: 0 21px;
                    }
                }
            }
        }

        .content{
            width: calc(100% - 24px);
            height: calc(100vh - 88px);
            margin: 12px;
            background: #FFFFFF;
            border-radius: 6px 6px 0px 0px;
            border: 1px solid #F3F4F6;
            position: relative;
            .form{
                width: 100%;
                height: calc(100% - 81px);
                overflow-y: auto;
                padding: 20px;
                box-sizing: border-box;
            }
            .btns{
                width: 100%;
                height: 80px;
                border-top: 1px solid #E5E7EB;
                display: flex;
                align-items: center;
                position: absolute;
                left: 0;
                bottom: 0;
            }
        }

        .f_title{
            font-family: PingFangSC, PingFang SC;
            font-weight: 600;
            font-size: 16px;
            color: #0D162A;
            line-height: 16px;
            margin-bottom: 20px;
        }

        .f_pldr{
            margin-top: 20px;
            .fp_box{
                display: flex;
                width: 526px;
                height: 125px;
                border-radius: 4px;
                border: 1px solid #EDEEF0;
                position: relative;
                .fpb_pre{
                    width: calc(50% - 1px);
                    height: 100%;
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    .fpbp_btn{
                        width: 140px;
                        height: 36px;
                        border-radius: 6px;
                        border: 1px solid #E5E7EB;
                        font-family: PingFangSC, PingFang SC;
                        font-weight: 400;
                        font-size: 12px;
                        color: #761E6A;
                        line-height: 32px;
                        text-align: center;
                        cursor: pointer;
                    }
                    &.sc{
                        border-left: 1px solid #EDEEF0;
                        .fpbp_btn{
                            background: #761E6A;
                            border: 1px solid #761E6A;
                            color: #FFFFFF;
                        }
                    }
                }
                img{
                    width: 50px;
                    height: 20px;
                    position: absolute;
                    left: 50%;
                    margin-left: -25px;
                    top: 50%;
                    margin-top: -10px;
                }
            }
            p{
                margin-top: 11px;
                font-family: PingFangSC, PingFang SC;
                font-weight: 400;
                font-size: 12px;
                color: #C1C7D2;
                line-height: 20px;
                text-align: justify;
            }
        }

        .f_sdlr{
            padding-top: 10px;

            .fs_add{
                width: 80px;
                height: 32px;
                background: #761E6A;
                border-radius: 6px;
                font-family: PingFangSC, PingFang SC;
                font-weight: 400;
                font-size: 14px;
                color: #FFFFFF;
                line-height: 32px;
                text-align: center;
                margin-top: 20px;
                cursor: pointer;
                &.del{
                    background: rgb(212, 96, 96);
                    margin: 0;
                    margin-top: 5px;
                }
            }
        }

        .f_s{
            width: 100%;
            height: 42px;
            border-radius: 6px;
            border: 1px solid #dcdfe6;
            padding: 11px 11px 11px 16px;
            box-sizing: border-box;
            cursor: pointer;
            .fs_text{
                font-family: PingFangSC, PingFang SC;
                font-weight: 400;
                font-size: 14px;
                color: #C0C4CC;
                line-height: 20px;
                &.active{
                    color: #606266;
                }
            }
        }

        .ed_coach{
            .ec_l{
                width: calc(50% - 1px);
                height: 100%;
                padding-right: 30px;
                box-sizing: border-box;
                border-right: 1px solid #ECEEF5;
                .ecl_cbs{
                    width: 100%;
                    // height: calc(100% - 143px);
                    max-height: 376px;
                    overflow-y: auto;
                }
            }
            .ec_r{
                width: 50%;
                padding-left: 30px;
                box-sizing: border-box;
                .ecr_text{
                    font-family: PingFang-SC, PingFang-SC;
                    font-weight: bold;
                    font-size: 16px;
                    color: #252525;
                    line-height: 22px;
                    span{
                        color: #B9B9B9;
                    }
                }
                .ecr_names{
                    margin-left: -16px;
                    overflow: hidden;
                    .en_pre{
                        float: left;
                        padding: 10px;
                        background: #F9FAFB;
                        border-radius: 6px;
                        margin: 19px 0 0 16px;
                        span{
                            font-family: PingFangSC, PingFang SC;
                            font-weight: 400;
                            font-size: 14px;
                            color: #252525;
                            line-height: 14px;
                        }
                        img{
                            width: 16px;
                            height: 16px;
                            margin-left: 10px;
                            cursor: pointer;
                        }
                    }
                }
            }
        }
    }

    ::v-deep .el-form-item{
        margin-bottom: 20px !important;
    }
</style>