<template>
    <div>
        <div class="identity_seller_pc_1"><!--使用此组件，请复制此div-->
            <div class="container">
                <div class="container-bg">
                    <div class="row">
                        <div class="col-lg-12 orgcenter-info">
                            <div class="row">
                                <div class="col-lg-6 col-md-6 col-sm-12">
                                    <div class="orgcenter-info-header clearfix">
                                        <span class="sp1">
                                            <a href="">
                                                <img v-if="" src="../../theme-chalk/src/images/head001.png" alt="">
                                            </a>
                                        </span>
                                        <span class="sp2">
                           <span class="spp1">{{userinfo.unitName}}</span>
                           <span class="spp2">企业认证</span>
                                            <!--<span class="spp3"><i>最近登录：</i>2020-08-01 12:20:20</span>-->
                        </span>
                                    </div>
                                </div>
                                <div class="col-lg-3 col-md-3 col-sm-6">
                                    <div class="orgcenter-info-data">
                                        <ul>
                                            <li><span>已报课程(个)：</span>{{countlist.courseNum?countlist.courseNum:0}}个</li>
                                        </ul>
                                    </div>
                                </div>
                                <div class="col-lg-3 col-md-3 col-sm-6">
                                    <div class="orgcenter-info-data">
                                        <ul>
                                            <li><span>完成培训人次：</span>{{countlist.finishedNum?countlist.finishedNum:0}}
                                            </li>
                                        </ul>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-lg-3 col-md-4 col-sm-5 percenter-left-padding">
                            <div class="percenter-left">
                                <div class="percenter-left-nav">
                                    <ul>
                                        <li><span><a href="">培训数据</a></span>
                                            <ul class="second-ul">
                                                <!--<li v-bind:class="{'on':sitemenu===1}" v-on:click="sitemenu=1"><a href="javascript:;">学习平台</a></li>-->
                                                <li v-bind:class="{'on':sitemenu===2}" v-on:click="sitemenu=2"><a
                                                        href="javascript:;">已选培训计划</a></li>
                                                <!--<li v-bind:class="{'on':sitemenu===3}" v-on:click="sitemenu=3"><a href="javascript:;">已选课程</a></li>-->
                                            </ul>
                                        </li>
                                        <li><span><a href="">学员数据</a></span>
                                            <ul class="second-ul">
                                                <li v-bind:class="{'on':sitemenu===7}" v-on:click="sitemenu=7">
                                                    <a href="javascript:;">学员管理</a></li>
                                                <li v-bind:class="{'on':sitemenu===6}" v-on:click="sitemenu=6">
                                                    <a href="javascript:;">学时查询</a>
                                                </li>
                                            </ul>
                                        </li>
                                        <li v-on:click="sitemenu=4"><span><a href="javascript:;">交易中心</a></span></li>
                                        <li v-on:click="sitemenu=5"><span><a href="javascript:;">账户设置</a></span></li>
                                    </ul>
                                </div>
                            </div>
                        </div>
                        <div class="col-lg-9 col-md-8 col-sm-7 percenter-right-padding">
                            <div class="percenter-right">
                                <div class="percenter-right-data-huantu clearfix" v-if="sitemenu==0">
                                    <div class="percenter-right-data-huantu-part">
                                        <span class="sp1" id="huantu8"></span>
                                        <span class="sp2"><i>{{countlist.learningNum?countlist.learningNum:0}}</i></span>
                                        <span class="sp3">在学人数</span>
                                    </div>
                                    <div class="percenter-right-data-huantu-part">
                                        <span class="sp1" id="huantu9"></span>
                                        <span class="sp2"><i>{{countlist.totalNum?countlist.totalNum:0}}</i></span>
                                        <span class="sp3">累计报名人次</span>
                                    </div>
                                    <div class="percenter-right-data-huantu-part">
                                        <span class="sp1" id="huantu10"></span>
                                        <span class="sp2"><i>{{countlist.totalNum?countlist.totalNum:0}}</i></span>
                                        <span class="sp3">已报计划(个)</span>
                                    </div>
                                </div>
                                <!--功能模块：两个btn：学时查询、报名查询-->
                                <div class="orgcenter-btn" v-if="sitemenu==0">
                                    <a v-on:click="sitemenu=6" href="javascript:;" class="orgcenter-a1">学时查询</a>
                                    <a v-on:click="sitemenu=7" href="javascript:;" class="orgcenter-a2">报名查询</a>
                                </div>
                                <!--功能模块：近期公告-->
                                <div class="percenter-right-notice" v-if="sitemenu==0">
                                    <div class="percenter-right-title">
                                        <span>近期公告</span>
                                    </div>
                                    <ul class="percenter-right-notice-ul clearfix">
                                        <li v-for="(notice,index) in noticelist" :key="index"
                                            v-bind:class="{'hot':notice.posid==1}"
                                            @click.prevent="goDetails(notice.articleId)">
                                            <a href="javascript:;" @click.prevent="goDetails(notice.articleId)">{{notice.title}}</a>
                                            <span>{{notice.newsPubDate}}</span>
                                        </li>
                                        <!--<li><a href="">安徽省应急管理厅关于试行安全生产培训的通知</a><span>2020-08-01</span></li>-->
                                        <!--<li class="hot"><a href="">安徽省应急管理厅关于试行安全生产培训的通知</a><span>2020-08-01</span></li>-->
                                        <!--<li><a href="">安徽省应急管理厅关于试行安全生产培训的通知</a><span>2020-08-01</span></li>-->
                                        <!--<li><a href="">安徽省应急管理厅关于试行安全生产培训的通知</a><span>2020-08-01</span></li>-->
                                        <!--<li><a href="">安徽省应急管理厅关于试行安全生产培训的通知</a><span>2020-08-01</span></li>-->
                                        <!--<li><a href="">安徽省应急管理厅关于试行安全生产培训的通知</a><span>2020-08-01</span></li>-->
                                        <!--<li><a href="">安徽省应急管理厅关于试行安全生产培训的通知</a><span>2020-08-01</span></li>-->
                                    </ul>
                                </div>
                                <!--功能模块：已选培训计划-->
                                <div class="percenter-right-myplan" v-if="sitemenu==2">
                                    <div class="percenter-right-title">
                                        <span>已选培训计划</span>
                                    </div>
                                    <!--<div class="percenter-right-myplan-filtrate clearfix">-->
                                    <!--<select name="" id="" class="width1">-->
                                    <!--<option value="">2020年度</option>-->
                                    <!--<option value="">2019年度</option>-->
                                    <!--</select>-->
                                    <!--<select name="" id="" class="width2">-->
                                    <!--<option value="">近三个月</option>-->
                                    <!--<option value="">全部</option>-->
                                    <!--</select>-->
                                    <!--<select name="" id="" class="width1">-->
                                    <!--<option value="">三岗培训</option>-->
                                    <!--<option value="">全部培训</option>-->
                                    <!--</select>-->
                                    <!--<select name="" id="" v-model="finished" class="width1">-->
                                    <!--<option value="">选择完成状态</option>-->
                                    <!--<option value="0">未完成</option>-->
                                    <!--<option value="1">已完成</option>-->
                                    <!--</select>-->
                                    <!--<button v-on:click="prolist">搜索</button>-->
                                    <!--</div>-->
                                    <table class="myplan-table" v-for="(item,index) in prolist" :key="index">
                                        <tr class="tb-border">
                                            <td class="tb-center tb-orangetext tb-boldtext" style="width: 15%;">培训计划名称
                                            </td>
                                            <td colspan="5" class="tb-title">{{item.tcName}}<span></span></td>
                                        </tr>
                                        <tr>
                                            <td class="tb-center tb-orangetext">项目名称</td>
                                            <td colspan="2" class="tb-graytext">{{item.proName}}</td>
                                            <td class="tb-center tb-orangetext">学时</td>
                                            <td colspan="2" class="tb-bluetext">{{item.studylength}}</td>
                                        </tr>
                                        <tr>
                                            <td class="tb-center tb-orangetext">培训人</td>
                                            <td colspan="2" class="tb-graytext">{{item.custName}}</td>
                                            <td class="tb-center tb-orangetext">是否完成</td>
                                            <td colspan="2" v-if="item.finished==0" class="tb-redtext">未完成</td>
                                            <td colspan="2" v-if="item.finished==1" class="tb-redtext">已完成</td>
                                        </tr>
                                        <tr>
                                            <td class="tb-center tb-orangetext">所获证书</td>
                                            <td colspan="5" v-if="item.certName" class="tb-graytext tb-zhengshu">
                                                {{item.certName}}（{{item.certNo}}）<span>
                                                <!--<a href="">下载证书</a>-->
                                            </span></td>
                                            <td colspan="5" v-if="!item.certName" class="tb-graytext tb-zhengshu">
                                                暂无证书<span>
                                                <!--<a href="">下载证书</a>-->
                                            </span></td>
                                        </tr>
                                    </table>
                                    <div class="tp-page">
                                        <el-pagination
                                                background
                                                layout="total, sizes, prev, pager, next, jumper"
                                                :page-sizes="[10, 15, 20, 25]"
                                                @current-change="proChange"
                                                @prev-click="proprevClick"
                                                @next-click="pronextClick"
                                                @size-change="prosizeChange"
                                                :total="pronum">
                                        </el-pagination>
                                    </div>
                                </div>
                                <div class="percenter-right-course" v-if="sitemenu==6">
                                    <div class="percenter-right-title">
                                        <span>证书学时</span>
                                    </div>

                                    <div class="common-table">
                                        <table>
                                            <thead>
                                            <td>证书名称</td>
                                            <td>证书编号</td>
                                            <td>所属项目</td>
                                            <td>学员名称</td>
                                            <td>学员手机</td>
                                            <td>学员身份证</td>
                                            <td width="50px">学时</td>
                                            <td width="50px">年度</td>
                                            <td>获取时间</td>
                                            </thead>
                                            <tr v-for="(item,index) in courselist" :key="index">
                                                <td class="blacktext">{{item.certName}}</td>
                                                <td>{{item.certNo}}</td>
                                                <td>{{item.programName}}</td>
                                                <td>{{item.custName}}</td>
                                                <td>{{item.phone}}</td>
                                                <td>{{item.idcarNo}}</td>
                                                <td>{{item.studylength}}</td>
                                                <td>{{item.year}}</td>
                                                <td class="bluetext">{{item.genDate}}</td>

                                            </tr>
                                        </table>
                                        <div class="tp-page">
                                            <el-pagination
                                                    background
                                                    layout="total, sizes, prev, pager, next, jumper"
                                                    :page-sizes="[10, 15, 20, 25]"
                                                    @current-change="courseChange"
                                                    @prev-click="courseprevClick"
                                                    @next-click="coursenextClick"
                                                    @size-change="coursesizeChange"
                                                    :total="coursenum">
                                            </el-pagination>
                                        </div>
                                    </div>
                                </div>
                                <div class="percenter-right-course" v-if="sitemenu==7">
                                    <div class="percenter-right-title">
                                        <span>学员管理</span>
                                    </div>

                                    <div class="common-table">
                                        <table>
                                            <thead>
                                            <td>姓名</td>
                                            <td>用户昵称</td>
                                            <td>手机号</td>
                                            <td>邮箱</td>
                                            <td>性别</td>
                                            <td>身份证号码</td>
                                            </thead>
                                            <tr v-for="(item,index) in stulist" :key="index">
                                                <td class="blacktext">{{item.custName}}</td>
                                                <td>{{item.shortName}}</td>
                                                <td>{{item.phone}}</td>
                                                <td>{{item.email}}</td>
                                                <td>{{item.sexDesc}}</td>
                                                <td>{{item.idcarNo}}</td>
                                            </tr>
                                        </table>
                                        <div class="tp-page">
                                            <el-pagination
                                                    background
                                                    layout="total, sizes, prev, pager, next, jumper"
                                                    :page-sizes="[10, 15, 20, 25]"
                                                    @current-change="stuChange"
                                                    @prev-click="stuprevClick"
                                                    @next-click="stunextClick"
                                                    @size-change="stusizeChange"
                                                    :total="stunum">
                                            </el-pagination>
                                        </div>
                                    </div>
                                </div>
                                <div class="percenter-right-course" v-if="sitemenu==3">
                                    <div class="percenter-right-title">
                                        <span>已选课程</span>
                                    </div>
                                    <div class="percenter-right-myplan-filtrate clearfix">
                                        <select name="" id="" class="width1">
                                            <option value="">2020年度</option>
                                            <option value="">2019年度</option>
                                        </select>
                                        <select name="" id="" class="width2">
                                            <option value="">近三个月</option>
                                            <option value="">全部</option>
                                        </select>
                                        <select name="" id="" class="width1">
                                            <option value="">三岗培训</option>
                                            <option value="">全部培训</option>
                                        </select>
                                        <select name="" id="" class="width1">
                                            <option value="">选择完成状态</option>
                                            <option value="">未完成</option>
                                        </select>
                                        <button>搜索</button>
                                    </div>
                                    <div class="common-table">
                                        <table>
                                            <thead>
                                            <td>证书名称</td>
                                            <td width="110px">证书编号</td>
                                            <td>所属项目</td>
                                            <td width="90px">学员名称</td>
                                            <td>学员手机</td>
                                            <td>学员身份证</td>
                                            <td width="90px">学时</td>
                                            <td width="90px">年度</td>
                                            <td>获取时间</td>
                                            </thead>
                                            <tr v-for="(item,index) in courselist" :key="index">
                                                <td class="blacktext">{{item.certName}}</td>
                                                <td>{{item.certNo}}</td>
                                                <td>{{item.programName}}</td>
                                                <td>{{item.custName}}</td>
                                                <td>{{item.phone}}</td>
                                                <td>{{item.idcarNo}}</td>
                                                <td>{{item.studylength}}</td>
                                                <td>{{item.year}}</td>
                                                <td class="bluetext">{{item.genDate}}</td>

                                            </tr>

                                        </table>
                                        <div class="tp-page">
                                            <ul>
                                                <li class="li4"><a href="">首页</a></li>
                                                <li><a href="">上一页</a></li>
                                                <li class="li1 on"><a href="">1</a></li>
                                                <li class="li1"><a href="">2</a></li>
                                                <li class="li1"><a href="">3</a></li>
                                                <li class="li1"><a href="">4</a></li>
                                                <li class="li1"><a href="">5</a></li>
                                                <li class="li1"><a href="">6</a></li>
                                                <li><a href="">下一页</a></li>
                                                <li class="li4"><a href="">尾页</a></li>
                                                <li class="li2">跳转至<input type="text"></li>
                                                <li class="li3">共<span>12</span>门课程/共<span>6</span>页</li>
                                            </ul>
                                        </div>
                                    </div>
                                </div>
                                <div class="percenter-right-myplan" v-if="sitemenu==4"><!--功能模块：我的订单-->
                                    <div class="percenter-right-title">
                                        <span>我的订单</span>
                                    </div>
                                    <table class="myplan-table" v-for="(item,index) in orderlist" :key="index">
                                        <tr class="tb-border">
                                            <td class="tb-center tb-orangetext tb-boldtext" style="width: 15%;">订单名称
                                            </td>
                                            <td colspan="5" class="tb-title">{{item.orderName}}<span></span></td>
                                        </tr>
                                        <tr>
                                            <td class="tb-center tb-orangetext">订单编号</td>
                                            <td colspan="2" class="tb-graytext">{{item.orderNo}}</td>
                                            <td class="tb-center tb-orangetext">订单金额</td>
                                            <td colspan="2" class="tb-bluetext">￥{{item.price}}</td>
                                        </tr>
                                        <tr>
                                            <td class="tb-center tb-orangetext">订单时间</td>
                                            <td colspan="2" class="tb-graytext">{{item.createDate}}</td>
                                            <td class="tb-center tb-orangetext">支付时间</td>
                                            <td colspan="2" class="tb-redtext">{{item.payDate}}</td>
                                        </tr>
                                        <tr>
                                            <td class="tb-center tb-orangetext">订单备注</td>
                                            <td colspan="5" class="tb-graytext tb-zhengshu">订单人：{{item.custName}} <span> 手机号：{{item.phone}}</span>
                                            </td>
                                        </tr>
                                    </table>

                                    <div class="tp-page">
                                        <el-pagination
                                                background
                                                layout="total, sizes, prev, pager, next, jumper"
                                                :page-sizes="[10, 15, 20, 25]"
                                                @current-change="orderChange"
                                                @prev-click="prevClick"
                                                @next-click="nextClick"
                                                @size-change="ordersizeChange"
                                                :total="ordernum">
                                        </el-pagination>
                                    </div>
                                </div>
                                <div class="percenter-right-shop" v-if="sitemenu==5">
                                    <div class="percenter-right-title">
                                        <span>账户设置</span>
                                    </div>
                                    <el-form :model="userData" :rules="rules" ref="userData" label-width="100px"
                                             class="userData-info">
                                        <el-form-item label="单位名称" prop="unitName">
                                            <el-input v-model="userData.unitName"></el-input>
                                        </el-form-item>
                                        <el-form-item label="单位组织机构代码" prop="unitOrganization">
                                            <el-input v-model="userData.unitOrganization"></el-input>
                                        </el-form-item>
                                        <el-form-item label="单位联系人" prop="concatName">
                                            <el-input v-model="userData.concatName"></el-input>
                                        </el-form-item>
                                        <el-form-item label="联系电话" prop="unitPhone">
                                            <el-input v-model.number="userData.unitPhone"></el-input>
                                        </el-form-item>
                                        <el-form-item label="地址" prop="unitAddress">
                                            <el-input v-model="userData.unitAddress"></el-input>
                                        </el-form-item>
                                        <el-form-item label="简介" prop="unitInfo">
                                            <el-input type="textarea" v-model="userData.unitInfo"></el-input>
                                        </el-form-item>
                                        <!--<el-form-item label="头像" prop="imageUrl">-->
                                        <!--<el-upload-->
                                        <!--class="avatar-uploader"-->
                                        <!--:action="uploadurl"-->
                                        <!--:show-file-list="false"-->
                                        <!--:on-success="handleAvatarSuccess"-->
                                        <!--:before-upload="beforeAvatarUpload">-->
                                        <!--<img v-if="imageUrl" :src="imageUrl" class="avatar">-->
                                        <!--<i v-else class="el-icon-plus avatar-uploader-icon"></i>-->
                                        <!--</el-upload>-->
                                        <!--</el-form-item>-->
                                        <el-form-item>
                                            <el-button type="primary" @click="usersave('userData')">确认并保存</el-button>
                                            <el-button v-if="userData.unitStatus=='0' || !userData.unitStatus"
                                                       type="primary" @click="usersaveaudit('userData')">提交审核
                                            </el-button>
                                        </el-form-item>
                                    </el-form>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>
<!--<script>-->
<!--$('.identity_org_pc_1 .orgcenter-peixun-shenbao').slide({-->
<!--titCell: '.orgcenter-peixun-shenbao-hd ul li',-->
<!--mainCell: '.orgcenter-peixun-shenbao-bd',-->
<!--trigger: 'click'-->
<!--});-->
<!--</script>-->
<script type="text/babel">
  import formMixin from '../../../src/mixins/formMixin';
  import lenye_base from 'lenye_base';
  import echarts from 'echarts';
  import msg from '../../message';

  export default {
    name: 'ElAccountShop',
    mixins: [formMixin],
    components: {},
    data() {
      return {
        noticelist: [],
        prolist: [],
        pronum: 0,
        prorows: 10,
        propage: 1,
        finished: '',
        courselist: [],
        coursenum: 0,
        courserows: 10,
        coursepage: 1,
        orderlist: [],
        ordernum: 0,
        orderrows: 10,
        orderpage: 1,
        stulist: [],
        stunum: 0,
        sturows: 10,
        stupage: 1,
        //    站点数据
        siteData: '',
        //    用户数据
        userData: '',
        userinfo: '',
        userIden: '',
        countlist: [],
        sitemenu: 0, //侧边选中
        tab: 0, //tab切换
        rules: {
          unitName: [
            {required: true, message: '请输入名称', trigger: 'blur'}
          ],
          unitOrganization: [
            {required: true, message: '组织机构代码不能为空', trigger: 'blur'}
          ],
          unitPhone: [
            {required: true, message: '联系电话不能为空', trigger: 'blur'},
            {
              pattern: /^((0\d{2,3}-\d{7,8})|(1[358497]\d{9}))$/,
              message: '请输入合法手机号',
              trigger: 'blur'
            }
          ]
        }
      };
    },
    created() {
      this.siteData = lenye_base.site_data.getsiteData();
      console.log('站点', this.siteData);
      this.userData = lenye_base.user_data.getuserData();
      console.log('个人信息', this.userData);
    },
    mounted() {
      console.log('站点数据', this.siteData);
      this.getuserIden();
      this.getData();
      this.getcountdetail();
      if (this.userIden && !this.userIden.objId) {
        this.sitemenu = 5;
        this.getunitdetail();
      }
    },
    watch: {
      'sitemenu'(newvalue) {
        if (newvalue === 1) {
          // this.getprolist();
        } else if (newvalue === 2) {
          this.getprolist();
        } else if (newvalue === 7) {
          this.getstulist();
        } else if (newvalue === 4) {
          this.getorderlist();
        } else if (newvalue === 5) {
          this.getunitdetail();
        } else if (newvalue === 6) {
          this.getcourselist();
        }
      }
    },
    methods: {
      // 详情
      isDetection() {
        if (this.userIden && !this.userIden.objId) {
          msg.warning('请完善单位资料再操作');
          this.sitemenu = 5;
          this.getunitdetail();
          return true;
        } else {
          return false;
        }
      },
      goDetails(articleId) {
        window.open(`/infodetail?id=${articleId}`);
      },
      //    获取公告列表
      getData() {
        const that = this;
        lenye_base.httpPost(lenye_base.base_data.getapiUrl() + lenye_base.api_url.news.queryShowPage, lenye_base.base_data.getformatting({
          siteId: this.siteData.siteId,
          sorts: 'updateDate=0',
          catName: '近期公告',
          page: 1,
          rows: 8
        }), function(e) {
          // console.log('近期公告', e);
          that.noticelist = e.data;
        });
      },
      //    获取个人信息详情
      getcountdetail() {
        const that = this;
        lenye_base.httpPost(lenye_base.base_data.getapiUrl() + lenye_base.api_url.lucene.pageQuery, lenye_base.base_data.getformatting({
          indexName: 'unitcount',
          queryType: '1',
          queryParams: '{\'unitId\': \'' + this.userData.unitId + '\'}'
        }), function(e) {
          // console.log('统计', e);
          if (e.success === '1') {
            that.countlist = e.data;
          }
        });
        let huantu8 = echarts.init(document.getElementById('huantu8'));
        let huantu9 = echarts.init(document.getElementById('huantu9'));
        let huantu10 = echarts.init(document.getElementById('huantu10'));
        huantu8.setOption({
          backgroundColor: '#fff',
          title: {
            text: ``,
            subtext: '',
            left: 'center',
            top: 'center',//top待调整
            textStyle: {
              color: '#000',
              fontSize: 18
            },
            subtextStyle: {
              color: '#000',
              fontSize: 14,
              top: 'center'
            },
            itemGap: -4//主副标题间距
          },
          series: [{
            name: 'pie1',
            type: 'pie',
            clockWise: true,
            radius: ['46px', '50px'],
            itemStyle: {
              normal: {
                label: {
                  show: false
                },
                labelLine: {
                  show: false
                }
              }
            },
            hoverAnimation: false,
            data: [{
              value: 80,
              name: 'completed',
              itemStyle: {
                normal: {
                  borderWidth: 6,
                  borderColor: {
                    colorStops: [{
                      offset: 0,
                      color: '#6ff79c'// 0% 处的颜色
                    }, {
                      offset: 1,
                      color: '#e3ee38'// 100% 处的颜色
                    }]
                  },
                  color: { // 完成的圆环的颜色
                    colorStops: [{
                      offset: 0,
                      color: '#6ff79c'// 0% 处的颜色
                    }, {
                      offset: 1,
                      color: '#e3ee38' // 100% 处的颜色
                    }]
                  },
                  label: {
                    show: false
                  },
                  labelLine: {
                    show: false
                  }
                }
              }
            }, {
              name: 'gap',
              value: 100 - 80,
              itemStyle: {
                normal: {
                  label: {
                    show: false
                  },
                  labelLine: {
                    show: false
                  },
                  color: 'rgba(0, 0, 0, 0)',
                  borderColor: 'rgba(0, 0, 0, 0)',
                  borderWidth: 0
                }
              }
            }]
          }]
        });
        huantu9.setOption({
          backgroundColor: '#fff',
          title: {
            text: ``,
            subtext: '',
            left: 'center',
            top: 'center',//top待调整
            textStyle: {
              color: '#000',
              fontSize: 18
            },
            subtextStyle: {
              color: '#000',
              fontSize: 14,
              top: 'center'
            },
            itemGap: -4//主副标题间距
          },
          series: [{
            name: 'pie1',
            type: 'pie',
            clockWise: true,
            radius: ['46px', '50px'],
            itemStyle: {
              normal: {
                label: {
                  show: false
                },
                labelLine: {
                  show: false
                }
              }
            },
            hoverAnimation: false,
            data: [{
              value: 80,
              name: 'completed',
              itemStyle: {
                normal: {
                  borderWidth: 6,
                  borderColor: {
                    colorStops: [{
                      offset: 0,
                      color: '#0cf6fc'// 0% 处的颜色
                    }, {
                      offset: 1,
                      color: '#3d57ff'// 100% 处的颜色
                    }]
                  },
                  color: { // 完成的圆环的颜色
                    colorStops: [{
                      offset: 0,
                      color: '#0cf6fc'// 0% 处的颜色
                    }, {
                      offset: 1,
                      color: '#3d57ff' // 100% 处的颜色
                    }]
                  },
                  label: {
                    show: false
                  },
                  labelLine: {
                    show: false
                  }
                }
              }
            }, {
              name: 'gap',
              value: 100 - 80,
              itemStyle: {
                normal: {
                  label: {
                    show: false
                  },
                  labelLine: {
                    show: false
                  },
                  color: 'rgba(0, 0, 0, 0)',
                  borderColor: 'rgba(0, 0, 0, 0)',
                  borderWidth: 0
                }
              }
            }]
          }]
        });
        huantu10.setOption({
          backgroundColor: '#fff',
          title: {
            text: ``,
            subtext: '',
            left: 'center',
            top: 'center',//top待调整
            textStyle: {
              color: '#000',
              fontSize: 18
            },
            subtextStyle: {
              color: '#000',
              fontSize: 14,
              top: 'center'
            },
            itemGap: -4//主副标题间距
          },
          series: [{
            name: 'pie1',
            type: 'pie',
            clockWise: true,
            radius: ['46px', '50px'],
            itemStyle: {
              normal: {
                label: {
                  show: false
                },
                labelLine: {
                  show: false
                }
              }
            },
            hoverAnimation: false,
            data: [{
              value: 80,
              name: 'completed',
              itemStyle: {
                normal: {
                  borderWidth: 6,
                  borderColor: {
                    colorStops: [{
                      offset: 0,
                      color: '#cd36e9'// 0% 处的颜色
                    }, {
                      offset: 1,
                      color: '#32d8e4'// 100% 处的颜色
                    }]
                  },
                  color: { // 完成的圆环的颜色
                    colorStops: [{
                      offset: 0,
                      color: '#cd36e9'// 0% 处的颜色
                    }, {
                      offset: 1,
                      color: '#32d8e4' // 100% 处的颜色
                    }]
                  },
                  label: {
                    show: false
                  },
                  labelLine: {
                    show: false
                  }
                }
              }
            }, {
              name: 'gap',
              value: 100 - 80,
              itemStyle: {
                normal: {
                  label: {
                    show: false
                  },
                  labelLine: {
                    show: false
                  },
                  color: 'rgba(0, 0, 0, 0)',
                  borderColor: 'rgba(0, 0, 0, 0)',
                  borderWidth: 0
                }
              }
            }]
          }]
        });
      },
      //    判断用户身份
      getuserIden() {
        const that = this;
        lenye_base.httpPost(lenye_base.base_data.getapiUrl() + lenye_base.api_url.base.custUserIdentityqueryUserIdentities, lenye_base.base_data.getformatting({}), function(e) {
          // console.log('我的身份信息', e);
          if (e.success === '1') {
            that.userIden = e.data[0];
            that.getunitdetail(1);
          }
          ;
        });
      },
      //    获取单位信息详情
      getunitdetail(type) {
        const that = this;
        lenye_base.httpPost(lenye_base.base_data.getapiUrl() + lenye_base.api_url.base.custUserUnitqueryById, lenye_base.base_data.getformatting({
          unitId: this.userIden.objId
        }), function(e) {
          // console.log('单位信息', e);
          that.userData = e.data;
          if (type === 1) {
            that.userinfo = e.data;
          }
        });
      },
      //    获取培训计划
      getprolist() {
        if (this.isDetection()) {
          return;
        }
        const that = this;
        lenye_base.httpPost(lenye_base.base_data.getapiUrl() + lenye_base.api_url.lucene.pageQuery, lenye_base.base_data.getformatting({
          indexName: 'unitcustteachcontent',
          queryType: '1',
          rows: this.prorows,
          page: this.propage,
          sorts: 'signupDate=0',
          queryParams: '{\'unitId\': \'' + this.userData.unitId + '\'}'
        }), function(e) {
          // console.log('培训计划', e);
          that.prolist = e.data;
          that.pronum = e.totalCount;
        });
      },
      // 翻页：当前页数的显示条数改变触发
      prosizeChange(rows) {
        console.log(rows);
        this.prorows = rows;
        this.getprolist();
      },
      // 翻页：选中当前页
      proChange(page) {
        console.log(page);
        this.propage = page;
        this.getprolist();
      },
      // 翻页：上一页
      proprevClick(page) {
        console.log(page);
        this.propage = page;
        this.getprolist();
      },
      // 翻页：下一页
      pronextClick(page) {
        console.log(page);
        this.propage = page;
        this.getprolist();
      },
      //    获取学时
      getcourselist() {
        if (this.isDetection()) {
          return;
        }
        const that = this;
        lenye_base.httpPost(lenye_base.base_data.getapiUrl() + lenye_base.api_url.lucene.pageQuery, lenye_base.base_data.getformatting({
          //indexName: 'unitcustcourse', //课程学时
          indexName: 'unitcustcert', //证书学时
          queryType: '1',
          rows: this.courserows,
          page: this.coursepage,
          sorts: '',
          queryParams: '{\'unitId\': \'' + this.userData.unitId + '\'}'
        }), function(e) {
          // console.log('学时', e);
          that.courselist = e.data;
        });
      },
      // 翻页：当前页数的显示条数改变触发
      coursesizeChange(rows) {
        console.log(rows);
        this.courserows = rows;
        this.getcourselist();
      },
      // 翻页：选中当前页
      courseChange(page) {
        console.log(page);
        this.coursepage = page;
        this.getcourselist();
      },
      // 翻页：上一页
      courseprevClick(page) {
        console.log(page);
        this.coursepage = page;
        this.getcourselist();
      },
      // 翻页：下一页
      coursenextClick(page) {
        console.log(page);
        this.coursepage = page;
        this.getcourselist();
      },
        //    获取学员
        getstulist() {
            if (this.isDetection()) {
                return;
            }
            const that = this;
            lenye_base.httpPost(lenye_base.base_data.getapiUrl() + '/base-service/api2/custUserUnit/queryStudentList.do', lenye_base.base_data.getformatting({
                unitId: this.userData.unitId,
                rows: this.courserows,
                page: this.coursepage,
                sorts: ''
            }), function(e) {
                // console.log('学员', e);
                that.stulist = e.data;
            });
        },
        // 翻页：当前页数的显示条数改变触发
        stusizeChange(rows) {
            console.log(rows);
            this.sturows = rows;
            this.getstulist();
        },
        // 翻页：选中当前页
        stuChange(page) {
            console.log(page);
            this.stupage = page;
            this.getstulist();
        },
        // 翻页：上一页
        stuprevClick(page) {
            console.log(page);
            this.stupage = page;
            this.getstulist();
        },
        // 翻页：下一页
        stunextClick(page) {
            console.log(page);
            this.stupage = page;
            this.getstulist();
        },
      //    获取订单
      getorderlist() {
        if (this.isDetection()) {
          return;
        }
        const that = this;
        lenye_base.httpPost(lenye_base.base_data.getapiUrl() + lenye_base.api_url.lucene.pageQuery, lenye_base.base_data.getformatting({
          indexName: 'unitcustorderform',
          queryType: '1',
          rows: this.orderrows,
          page: this.orderpage,
          sorts: '',
          queryParams: '{\'unitId\': \'' + this.userData.unitId + '\'}'
        }), function(e) {
          // console.log('订单', e);
          that.orderlist = e.data;
          that.ordernum = e.totalCount;
        });
      },
      // 翻页：当前页数的显示条数改变触发
      ordersizeChange(rows) {
        console.log(rows);
        this.orderrows = rows;
        this.getorderlist();
      },
      // 翻页：选中当前页
      orderChange(page) {
        console.log(page);
        this.orderpage = page;
        this.getorderlist();
      },
      // 翻页：上一页
      prevClick(page) {
        console.log(page);
        this.orderpage = page;
        this.getorderlist();
      },
      // 翻页：下一页
      nextClick(page) {
        console.log(page);
        this.orderpage = page;
        this.getorderlist();
      },
      usersave() {
        const that = this;
        if (this.userIden && !this.userIden.objId) {
          lenye_base.httpPost(lenye_base.base_data.getapiUrl() + lenye_base.api_url.base.custUserUnitinsert, lenye_base.base_data.getformatting({
            custId: lenye_base.user_data.getuserData().custId,
            unitName: that.userData.unitName,
            concatName: that.userData.concatName,
            unitPhone: that.userData.unitPhone,
            unitAddress: that.userData.unitAddress,
            unitInfo: that.userData.unitInfo,
            // photo: that.imageUrl,
            unitOrganization: that.userData.unitOrganization
          }), function(e) {
            if (e.success === '1') {
              that.userData.unitId = e.data;
              that.$message({
                showClose: true,
                message: '保存成功',
                type: 'success'
              });
              window.reload()
              that.sitemenu = 0;
            } else {
              that.$message({
                showClose: true,
                message: e.message,
                type: 'warning'
              });
            }
          });
        } else {
          lenye_base.httpPost(lenye_base.base_data.getapiUrl() + lenye_base.api_url.base.custUserUnitupdate, lenye_base.base_data.getformatting({
            unitId: that.userData.unitId,
            unitName: that.userData.unitName,
            concatName: that.userData.concatName,
            unitPhone: that.userData.unitPhone,
            unitAddress: that.userData.unitAddress,
            unitInfo: that.userData.unitInfo,
            // photo: that.imageUrl,
            unitOrganization: that.userData.unitOrganization
          }), function(e) {
            if (e.success === '1') {
              that.$message({
                showClose: true,
                message: '保存成功',
                type: 'success'
              });
              window.reload()
              that.sitemenu = 0;
            } else {
              that.$message({
                showClose: true,
                message: e.message,
                type: 'warning'
              });
            }
          });
        }
        ;
      },
      usersaveaudit() {
        const that = this;
        lenye_base.httpPost(lenye_base.base_data.getapiUrl() + lenye_base.api_url.base.custUserUnitsubAudit, lenye_base.base_data.getformatting({
          unitId: that.userData.unitId
        }), function(e) {
          if (e.success === '1') {
            that.$message({
              showClose: true,
              message: '提交成功',
              type: 'success'
            });
          } else {
            that.$message({
              showClose: true,
              message: e.message,
              type: 'warning'
            });
          }
        });
      }
    }
  };
</script>
<style scoped>
</style>
