<template>
  <div class="directorGoodsEdit">
    <div class="head-title">
      <span @click="CommonJump('CourseManagement')" class="blue point">商品列表</span>
      / 添加商品
    </div>
    <div style="background:#fff;margin-top:10px;padding:10px 20px 20px">
      <el-form class="app-batch" :model="addMsg" :rules="rules" ref="addMsg" label-width="180px">
        <el-tabs v-model="activeName">
          <el-tab-pane label="商品设置" name="first">
            <el-card shadow="never">
              <div slot="header" class="clearfix">
                <span>选择分类</span>
              </div>
              <el-row>
                <el-col :span="12">
                  <el-form-item label="上架版面" style="display:none;">
                    <el-radio-group v-model="addMsg.GoodsPageType" @change="getGoodType(addMsg.GoodsPageType)">
                      <el-radio v-for="(item,index) in My_cateList" :key="index" :label="item.Id">{{item.Name}}
                      </el-radio>
                    </el-radio-group>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="12">
                  <el-form-item label="商品分类">
                    <template v-if="
                        addMsg.CategoryList && addMsg.CategoryList.length > 0
                      ">
                      <el-tag type="warning" style="margin-right:10px;" @close="exitCheck(item, index)"
                        v-for="(item, index) in addMsg.CategoryList" :key="index+'1'" closable>{{ item.CategoryName }}
                      </el-tag>
                    </template>
                    <el-button type="primary" @click="
                        (flDig = true), (keepCategoryList = addMsg.CategoryList)
                      " style="margin:0 10px;" size="small">选择分类</el-button>
                    <span @click="CommonJump('addGoodsClass')" class="blue point">添加分类</span>
                  </el-form-item>
                </el-col>
              </el-row>
            </el-card>
            <el-card style="margin-top:20px" shadow="never">
              <div slot="header" class="clearfix">
                <span>基本信息</span>
              </div>
              <el-row>
                <el-col :span="12">
                  <el-form-item>
                    <label slot="label">课程编码
                      <el-tooltip class="item" effect="dark" content="只能从商城中获取商品信息，且基本信息与商城商品保持一致" placement="top">
                        <i class="el-icon-info"></i>
                      </el-tooltip>
                    </label>
                    <el-input v-model="addMsg.Id" type="number" min="1" size="small" placeholder="请输入内容"
                      class="input-with-select">
                      <el-button slot="append" @click="getcode()">获取</el-button>
                    </el-input>
                  </el-form-item>
                  <el-form-item label="课程名称" prop="Name">
                    <el-input v-model="addMsg.Name" size="small" placeholder="请输入内容" maxlength="100" show-word-limit>
                    </el-input>
                  </el-form-item>
                  <el-form-item label="课程副标题">
                    <el-input v-model="addMsg.SubName" size="small" placeholder="请输入内容" maxlength="100" show-word-limit>
                    </el-input>
                  </el-form-item>
                  <el-form-item label="供应商" prop="SupplierId">
                    <el-select class="w150" style="margin-right: 10px;" v-model="SupplierId" size="small"
                      placeholder="请选择">
                      <el-option v-for="item in options" :key="item.ID" :label="item.Name" :value="item.ID">
                      </el-option>
                    </el-select>
                  </el-form-item>

                  <el-form-item>
                    <label slot="label">课程封面图(单张)
                      <el-tooltip class="item" effect="dark" content="课程封面图" placement="top">
                        <i class="el-icon-info"></i>
                      </el-tooltip>
                    </label>
                    <div class="nav_Main">
                      <div class="nav_IconContent">
                        <div v-for="(item, index) in addMsg.CarouselImageList" :key="index+'2'"
                          style="margin-right: 20px; position: relative; ">
                          <div class="colapp-image" :style="{
                                  backgroundImage: 'url(' + item.Path + ')'
                                }"></div>
                          <el-button @click="ClearCarouse(index)" class="delBtn" type="danger" icon="el-icon-close"
                            circle></el-button>
                        </div>
                      </div>
                      <div @click="openChangeDig(1)" v-if="addMsg.CarouselImageList.length==0"
                        class="add-image-btn 2222">
                        + 添加图片
                      </div>
                    </div>
                  </el-form-item>
                  <el-form-item label="课程封面视频">
                    <el-input v-model="addMsg.VideoAddress" size="small" placeholder="请输入内容">
                      <el-button @click="changeState1 = true,videoType=1" slot="append">添加视频</el-button>
                    </el-input>
                    <a v-if="addMsg.VideoAddress != ''" class="blue noline" :href="addMsg.VideoAddress"
                      target="_blank">视频链接</a>
                  </el-form-item>
                  <el-form-item>
                    <label slot="label">自定义分享标题
                      <el-tooltip class="item" effect="dark" content="分享给好友时，作为商品名称" placement="top">
                        <i class="el-icon-info"></i>
                      </el-tooltip>
                    </label>
                    <el-input v-model="addMsg.CustomShareTitles" size="small" placeholder="请输入内容"
                      class="input-with-select"></el-input>
                    <p class="blue point" @click="imgDig = true">查看图例</p>
                  </el-form-item>
                  <el-form-item class="commonLabel discount">
                    <label slot="label">自定义分享封面图
                      <el-tooltip class="item" effect="dark" content="分享给好友时，作为分享图片" placement="top">
                        <i class="el-icon-info"></i>
                      </el-tooltip>
                    </label>
                    <el-tooltip class="item" effect="dark" content="建议尺寸420*336" placement="top">
                      <el-button @click="openChangeDig(2)" size="small">选择图片</el-button>
                    </el-tooltip>
                    <div class="app-gallery-item" style="position: relative;width: 100px;margin-top: 10px;border:none">
                      <img v-if="
                          !addMsg.CustomShareImage ||
                            addMsg.CustomShareImage == ''
                        " src="../../assets/img/default.png" style="width:80px;height:80px" alt="" />
                      <el-button @click="clearCustom" style="position: absolute;right: 6px;top: -10px;" v-if="
                          addMsg.CustomShareImage &&
                            addMsg.CustomShareImage != ''
                        " size="mini" type="danger" icon="el-icon-close" circle></el-button>
                      <img v-if="addMsg.CustomShareImage ||addMsg.CustomShareImage !=''" style="width:80px;height:80px"
                        :src="addMsg.CustomShareImage" alt="" />
                    </div>
                    <p style="margin-top:-15px" class="blue f12">
                      <span class="point" @click="imgDig = true">查看图例</span>
                    </p>
                  </el-form-item>
                  <el-form-item label="直播商品">
                    <el-switch v-model="addMsg.IsLiveGoods" active-color="#409EFF" :active-value="1"
                      :inactive-value="2">
                    </el-switch>
                  </el-form-item>
                  <el-form-item label="上架状态">
                    <el-switch v-model="addMsg.GoodsStatus" active-color="#409EFF" :active-value="1"
                      :inactive-value="2">
                    </el-switch>
                  </el-form-item>

                </el-col>
              </el-row>
            </el-card>
            <el-card style="margin-top:20px" shadow="never">
              <div slot="header" class="clearfix">
                <span>售价与讲师</span>
              </div>
              <el-row>
                <el-col :span="12">
                  <el-form-item>
                    <label slot="label">排序
                      <el-tooltip class="item" effect="dark" content="排序值越小排序越靠前" placement="top">
                        <i class="el-icon-info"></i>
                      </el-tooltip>
                    </label>
                    <el-input v-model="addMsg.Sort" type="number" min="1" size="small" placeholder="请输入内容"
                      class="input-with-select"></el-input>
                  </el-form-item>
                  <el-form-item label="售价" prop="SellingPrice">
                    <el-input v-model="addMsg.SellingPrice" type="number" min="1" size="small" placeholder="请输入内容"
                      class="input-with-select">
                      <el-button slot="append">元</el-button>
                    </el-input>
                  </el-form-item>
                  <el-form-item label="原价" prop="OriginalPrice">
                    <el-input v-model="addMsg.OriginalPrice" type="number" min="1" size="small" placeholder="请输入内容"
                      class="input-with-select">
                      <el-button slot="append">元</el-button>
                    </el-input>
                  </el-form-item>

                  <el-form-item label="成本价">
                    <el-input @change="getSuggestPrice" v-model="addMsg.CostPrice" type="number" min="1" size="small"
                      placeholder="请输入内容" class="input-with-select">
                      <el-button slot="append">元</el-button>
                    </el-input>
                    <span v-if="
                        SuggestPriceInfo.Status && SuggestPriceInfo.Status == 1
                      " class="cred" style="position: absolute;width: 400px;margin-left: 15px;">
                      建议零售价：￥{{ SuggestPriceInfo.MPrice }}
                    </span>
                  </el-form-item>
                  <!-- 判断是开启了粉象返佣 -->
                  <el-form-item label="返佣总金额" prop="Commission" v-if="FxState==1">
                    <el-input v-model="addMsg.Commission" @keyup.native="checkPrice(addMsg,'Commission')" size="small"
                      placeholder="请输入内容" class="input-with-select">
                      <el-button slot="append">元</el-button>
                    </el-input>
                  </el-form-item>
                  <el-form-item label="已售数量">
                    <el-input v-model="addMsg.SalesNum" type="number" min="1" size="small" placeholder="请输入内容"
                      class="input-with-select">
                      <el-button slot="append">件</el-button>
                    </el-input>
                  </el-form-item>
                  <el-form-item label="关联讲师">
                    <template v-if="addMsg.TeacherList.length>0">
                      <div>
                        <div class="Teacher_List" v-for="(item,index) in addMsg.TeacherList" :key="index">
                          <div class="Teacher_tou">
                            <img style="width:100%;height:100%;" :src="item.TeacherLogo" alt="" />
                          </div>
                          {{item.Name}}
                          <el-button @click="yichuTeacher(index)" class="edu_edlBtn" type="danger" icon="el-icon-close"
                            circle></el-button>
                        </div>
                      </div>
                      <!-- <el-tag v-for="(item,index) in addMsg.TeacherList" closable size="small"
                        @close="yichuTeacher(index)" style="margin-right:5px;" :key="index"> 
                        {{item.Name}}
                      </el-tag> -->
                    </template>
                    <el-button @click="choosejsDig=true" style="position:relative;top:-4px;" size="mini">选择教师
                    </el-button>
                  </el-form-item>
                  <el-form-item label="标签" size="small">
                    <el-tag :key="tag" size="small" v-for="tag in dynamicTags" closable :disable-transitions="false"
                      @close="handleClose(tag)">
                      {{tag}}
                    </el-tag>
                    <el-input class="input-new-tag" v-if="inputVisible" v-model="inputValue" ref="saveTagInput"
                      size="small" @keyup.enter.native="handleInputConfirm" @blur="handleInputConfirm">
                    </el-input>
                    <el-button v-else class="button-new-tag" size="small" @click="showInput">+ 标签</el-button>
                  </el-form-item>
                </el-col>
              </el-row>
            </el-card>
            <el-card style="margin-top:20px" shadow="never">
              <div slot="header" class="clearfix"
                style="display:flex;justify-content:space-between;align-items:center;">
                <span>课程信息</span>
                <el-button @click="courseDialog=true,isShowEditBtn=true" size="small">添加课程</el-button>
              </div>
              <el-row>
                <el-col :span="24">
                  <div class="courseInfo">
                    <div class="courseHeader">
                      <div style="width:100px;">章节排序</div>
                      <div style="width:120px;">章节排序名称</div>
                      <div style="width:300px;">名称</div>
                      <div>类型</div>
                      <div>试看</div>
                      <div style="width:100px;overflow:hidden">试看视频秒/word pdf页</div>
                      <div>缓存</div>
                      <div>附件</div>
                      <div>操作</div>
                    </div>
                    <div class="courseContent">
                      <draggable v-model="addMsg.CourseList" @end='allow'>
                        <div class="courseList" v-for="(subItem,index) in addMsg.CourseList" :key="index">
                          <div style="width:100px;">{{subItem.Sort}}</div>
                          <div style="width:120px;">{{subItem.SortName}}</div>
                          <div class="edu_fileName" style="width:300px;">
                            <el-tooltip class="item" effect="dark" :content="subItem.Name" placement="top">
                              <div style="padding:5px;">{{subItem.Name}}</div>
                            </el-tooltip>
                          </div>
                          <div>
                            <span v-if="subItem.Type==1">视频</span>
                            <span v-if="subItem.Type==2">WORD</span>
                            <span v-if="subItem.Type==3">PDF</span>
                            <span v-if="subItem.Type==4">PPT</span>
                          </div>
                          <div>
                            <span v-if="subItem.IsTrySee==1">可以</span>
                            <span v-if="subItem.IsTrySee==2">不可以</span>
                          </div>
                          <div style="width:100px">{{subItem.Number}}</div>
                          <div>
                            <span v-if="subItem.IsCache==1">可以</span>
                            <span v-if="subItem.IsCache==2">不可以</span>
                          </div>
                          <div class="courseFileDiv">
                            <div style="text-align:left;width:90px;display:flex;align-items:center;">
                              <div class="eduFileDiv">
                                <el-tooltip class="item" effect="dark" content="预览文件" placement="top">
                                  <img v-if="getFileType(subItem.FilePath)==1" @click="goUrlVideo(subItem.FilePath)"
                                    src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/z_video.png"
                                    alt="">
                                  <img v-if="getFileType(subItem.FilePath)==2"
                                    @click="showUpLoadFileT(subItem.FilePath)"
                                    src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/WORD.png" alt="">
                                  <img v-if="getFileType(subItem.FilePath)==3"
                                    @click="showUpLoadFileT(subItem.FilePath)"
                                    src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/pdf.png" alt="">
                                  <img v-if="getFileType(subItem.FilePath)==4"
                                    @click="showUpLoadFileT(subItem.FilePath)"
                                    src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/PPT.png" alt="">
                                </el-tooltip>
                              </div>
                              <div class="courseView" v-if="subItem.Type!=1&&subItem.IsImageOK==1">
                                <el-tooltip class="item" effect="dark" content="预览图片" placement="top">
                                  <img @click="getImgView(subItem)"
                                    src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/viewClass.png">
                                </el-tooltip>
                              </div>
                              <div class="courseScz" v-if="subItem.Type!=1&&subItem.IsImageOK==2">
                                <span style="font-size:12px;margin-left:5px;color:red;">图片生成中</span>
                              </div>
                            </div>
                          </div>
                          <div>
                            <img @click="updateCourse(subItem,index),isReplace=index,isShowEditBtn=false"
                              style="width:32px;height:32px" src="../../assets/img/userman/edit.png" alt="">
                            <img @click="deleteCourse(index)" style="width:32px;height:32px;margin:0 10px"
                              src="../../assets/img/userman/del.png" alt="">
                          </div>
                        </div>
                      </draggable>
                    </div>
                  </div>
                </el-col>
              </el-row>
            </el-card>
            <el-card style="margin-top:20px" shadow="never">
              <div slot="header" class="clearfix">
                <span>营销设置</span>
              </div>
              <el-row>
                <el-col :span="12">
                  <el-form-item label="积分赠送">
                    <el-tooltip class="item" effect="dark" placement="top"
                      style="position: absolute;left: -10px;top:12px">
                      <div slot="content">
                        用户购物赠送的积分,
                        如果不填写或填写0，则默认为不赠送积分<br />
                        如果为百分比则为按成交价格的比例计算积分<br />
                        如: 购买2件，设置10 积分, 不管成交价格是多少，
                        则购买后获得20积分<br />
                        如: 购买2件，设置10%积分, 成交价格2 * 200= 400，
                        则购买后获得 40 积分（400*10%)<br />
                      </div>
                      <i class="el-tooltip el-icon-info"></i>
                    </el-tooltip>
                    <el-input v-model="addMsg.IntegralPresent" style="width:100%;margin-left:15px" type="number" min="1"
                      size="small" placeholder="请输入内容" class="input-with-select">
                      <el-button slot="append">
                        分
                        <el-radio v-model="addMsg.IntegralPresentType" :label="2">固定值</el-radio>
                        <el-radio v-model="addMsg.IntegralPresentType" :label="1">百分比</el-radio>
                      </el-button>
                    </el-input>
                  </el-form-item>
                  <el-form-item label="积分抵扣">
                    <el-tooltip class="item" effect="dark" content="如果设置0，则不支持积分抵扣 如果带%则为按成交价格的比例计算抵扣多少元"
                      placement="top" style="position: absolute;left: -10px;top:12px">
                      <i class="el-tooltip el-icon-info"></i>
                    </el-tooltip>
                    <el-input v-model="addMsg.PointsDeduction" style="width:100%;margin-left:15px" type="number" min="1"
                      size="small" placeholder="请输入内容" class="input-with-select">
                      <template slot="prepend">最多抵扣</template>
                      <el-button slot="append">
                        元
                        <el-radio v-model="addMsg.PointsDeductionType" :label="2">固定值</el-radio>
                        <el-radio v-model="addMsg.PointsDeductionType" :label="1">百分比</el-radio>
                      </el-button>
                    </el-input>
                  </el-form-item>
                  <el-form-item label-width="200px" style="display:none;">
                    <el-checkbox v-model="addMsg.IsMultipleDeduction" :true-label="1" :false-label="2">允许多件抵扣
                    </el-checkbox>
                  </el-form-item>
                  <el-form-item label="广告词">
                    <el-input v-model="addMsg.Advertising" style="width:100%;margin-left:15px" type="textarea" :rows="3"
                      size="small" placeholder="请输入内容" class="input-with-select"></el-input>
                  </el-form-item>
                  <el-form-item label="标签类型">
                    <el-radio v-model="addMsg.MarketingLogo.iswords" :label="1">文字模式</el-radio>
                    <el-radio v-model="addMsg.MarketingLogo.iswords" :label="2">图片模式</el-radio>
                    <el-radio v-model="addMsg.MarketingLogo.iswords" :label="0">无模式</el-radio>
                  </el-form-item>
                  <el-form-item label="标签文字" v-if="addMsg.MarketingLogo.iswords==1">
                    <el-input v-model="addMsg.MarketingLogo.words" style="width:100%;margin-left:15px" size="small"
                      placeholder="请输入内容" class="input-with-select" maxlength='10' show-word-limit></el-input>
                  </el-form-item>
                  <el-form-item label="标签字体颜色" v-if="addMsg.MarketingLogo.iswords==1">
                    <el-color-picker style="width:100%;margin-left:15px" v-model="addMsg.MarketingLogo.wordsColor"
                      show-alpha :predefine="predefineColors">
                    </el-color-picker>
                  </el-form-item>
                  <el-form-item label="标签背景颜色" v-if="addMsg.MarketingLogo.iswords==1">
                    <el-color-picker style="width:100%;margin-left:15px" v-model="addMsg.MarketingLogo.wordsBack"
                      show-alpha :predefine="predefineColors">
                    </el-color-picker>
                  </el-form-item>
                  <el-form-item class="commonLabel discount" label="标签图片" v-if="addMsg.MarketingLogo.iswords==2">
                    <el-tooltip class="item" effect="dark" content="建议尺寸" placement="top">
                      <el-button @click="openChangeDig(4)" size="small">选择图片</el-button>
                    </el-tooltip>
                    <div class="app-gallery-item" style="position: relative;width: 100px;margin-top: 10px;border:none">
                      <img v-if="
                          !addMsg.MarketingLogo.ico ||
                            addMsg.MarketingLogo.ico == ''
                        " src="../../assets/img/default.png" style="width:80px;height:80px" alt="" />
                      <el-button @click="addMsg.MarketingLogo.ico = ''"
                        style="position: absolute;right: 6px;top: -10px;" v-if="
                          addMsg.MarketingLogo.ico &&
                            addMsg.MarketingLogo.ico != ''
                        " size="mini" type="danger" icon="el-icon-close" circle></el-button>
                      <img style="width:80px;height:80px" :src="addMsg.MarketingLogo.ico" alt="" />
                    </div>
                  </el-form-item>
                </el-col>
              </el-row>
            </el-card>
            <el-card style="margin-top:20px" shadow="never">
              <div slot="header" class="clearfix">
                <span>课程详情</span>
              </div>
              <el-row>
                <el-col :span="242">
                  <UE style="width:750px;" :defaultMsg="defaultMsg" :config="config" :IsMultiple="true" ref="ue"></UE>
                </el-col>
              </el-row>
            </el-card>
          </el-tab-pane>
          <el-tab-pane label="分销价设置" name="second">
            <el-form-item label="是否开启单独分销">
              <el-switch @change="HpChange" v-model="addMsg.SeparateDistribution" active-color="#409EFF"
                :active-value="1" :inactive-value="0">
              </el-switch>
            </el-form-item>
            <template v-if="addMsg.SeparateDistribution == 1">
              <el-form-item label="分销佣金类型">
                <el-radio v-model="addMsg.SeparateDistributionMoneyType" :label="2">固定金额</el-radio>
                <el-radio v-model="addMsg.SeparateDistributionMoneyType" :label="1">百分比</el-radio>
              </el-form-item>
              <el-form-item class="111">
                <div v-if="addMsg.SeparateDistributionType == 1" class="app-attr">
                  <div class="box">
                    <el-form-item label-width="90px" style="display:inline-block" label="批量设置">
                      <el-select style="width:130px" v-model="pusetVal" size="small">
                        <el-option v-for="(item, index) in butorInt" :label="`${index + 1}级分销`" :value="index + 1"
                          :key="index+'8'"></el-option>
                      </el-select>
                      <el-input style="width:150px;position:relative;top:5px" size="small" v-model="ptinput"
                        placeholder="请输入内容">
                        <el-button slot="append">
                          <span v-if="addMsg.SeparateDistributionMoneyType == 2">元</span>
                          <span v-if="addMsg.SeparateDistributionMoneyType == 1">%</span>
                        </el-button>
                      </el-input>
                      <el-button @click="PuSet" style="position:relative;" size="small" type="primary">设置</el-button>
                    </el-form-item>
                  </div>
                  <el-table ref="table" :data="GradeCommissionList" border style="width: 100%"
                    @selection-change="TbaleSelectionChange2">
                    <el-table-column type="selection" width="55">
                    </el-table-column>
                    <el-table-column width="100" label="等级名称">
                      <template slot-scope="scope">
                        <template v-for="(item2, index) in DropdownList">
                          <span :key="index+'9'" v-if="scope.row.DistributorGrade == item2.Id">{{ item2.Name }}</span>
                        </template>
                      </template>
                    </el-table-column>
                    <template v-for="(item, index) in butorIntList">
                      <el-table-column :key="index+'10'" :label="item.Name">
                        <template slot-scope="scope">
                          <span>
                            <el-input v-model="scope.row.OneCommission" v-if="index == 0" size="small">
                              <el-button slot="append">
                                <span v-if="
                                    addMsg.SeparateDistributionMoneyType == 2
                                  ">元</span>
                                <span v-if="
                                    addMsg.SeparateDistributionMoneyType == 1
                                  ">%</span>
                              </el-button>
                            </el-input>
                            <el-input v-model="scope.row.TwoCommission" v-if="index == 1" size="small">
                              <el-button slot="append">
                                <span v-if="
                                    addMsg.SeparateDistributionMoneyType == 2
                                  ">元</span>
                                <span v-if="
                                    addMsg.SeparateDistributionMoneyType == 1
                                  ">%</span>
                              </el-button>
                            </el-input>
                            <el-input v-model="scope.row.ThreeCommission" v-if="index == 2" size="small">
                              <el-button slot="append">
                                <span v-if="
                                    addMsg.SeparateDistributionMoneyType == 2
                                  ">元</span>
                                <span v-if="
                                    addMsg.SeparateDistributionMoneyType == 1
                                  ">%</span>
                              </el-button>
                            </el-input>
                          </span>
                        </template>
                      </el-table-column>
                    </template>
                  </el-table>
                </div>
              </el-form-item>
            </template>
            <template v-if="hpState==1">
              <table class="fen-table">
                <thead>
                  <tr>
                    <th>结算对象</th>
                    <th>结算成本(毛利)</th>
                    <th>预计返佣金额</th>
                  </tr>
                </thead>
                <tbody>
                  <tr v-for="(x, i) in shareSettings" :key="i">
                    <td>{{x.GradeName}}</td>
                    <td>{{x.cb}}（{{x.CommissionRatio}}%）</td>
                    <td>{{x.commission}}</td>
                  </tr>
                </tbody>
              </table>
              <div class="fen-sumg">
                <span style="margin-right:30px">直客卖价：{{addMsg.SellingPrice}}</span>
                <span style="margin-right:30px">成本：{{addMsg.CostPrice}}</span>
                <span style="margin-right:30px;color:red;">预计公司利润：{{companyCommission}}</span>
              </div>
            </template>
          </el-tab-pane>
          <el-tab-pane label="会员价设置" name="third">
            <el-form-item label="是否享受会员功能">
              <el-switch v-model="addMsg.EnjoyMember" active-color="#409EFF" :active-value="1" :inactive-value="0">
              </el-switch>
            </el-form-item>
            <el-form-item label="是否单独设置会员价">
              <el-switch v-model="addMsg.SeparateSetMember" active-color="#409EFF" :active-value="1"
                :inactive-value="0">
              </el-switch>
            </el-form-item>
            <el-form-item v-if="addMsg.SeparateSetMember == 1 && huiyList.length == 0" label="会员价设置">
              <el-button @click="CommonJump('setMember')" size="small" type="danger">如需设置请先添加会员</el-button>
            </el-form-item>
            <el-form-item v-if="addMsg.SeparateSetMember == 1
              " label="默认规格会员价设置">
              <template v-if="memberList1&&memberList1[0].GradePriceList.length>0">
                <div v-for="(item, index) in memberList1[0].GradePriceList" :key="index+'15'">
                  <el-input style="width:700px" placeholder="请输入内容" v-model="item.MemberPrice" size="small"
                    class="input-with-select">
                    <el-button slot="prepend">{{ item.MemberGrade }}级会员</el-button>
                    <el-button slot="append">元</el-button>
                  </el-input>
                </div>
              </template>
            </el-form-item>
          </el-tab-pane>
        </el-tabs>
      </el-form>
      <div class="bottom-div" style="margin-top:20px">
        <el-button size="small" type="primary" @click="Save('addMsg')">保存</el-button>
        <!-- <el-button size="small">预览</el-button> -->
      </div>
    </div>
    <!-- 选择分类 -->
    <el-dialog custom-class="app-add-cat" title="选择分类" :visible.sync="flDig" width="1100px">
      <el-row>
        <el-col :span="8" style="padding:0 10px;box-sizing:border-box">
          <h3 style="padding:15px 0">一级分类</h3>
          <div class="app-goods-cat-list active">
            <el-checkbox-group v-model="NewCategoryList" @change="handleCheckChange">
              <div v-for="(item, index) in fenleiData" :key="index+'19'" flex="dir:left box:first" class="cat-item">
                <el-checkbox :label="item.Id">
                  <span style="display: none;">{{ item.Name }}</span>
                </el-checkbox>
                <div flex="box:last cross:center">
                  <span>{{ item.Name }}</span>
                  <i v-if="item.ChildList.length > 0" @click="getChild2(item.ChildList)"
                    class="el-icon-arrow-right"></i>
                </div>
              </div>
            </el-checkbox-group>
          </div>
        </el-col>
        <el-col v-show="childList2.length > 0" :span="8" style="padding:0 10px;box-sizing:border-box">
          <h3 style="padding:15px 0">二级分类</h3>
          <div class="app-goods-cat-list active">
            <el-checkbox-group v-model="NewCategoryList" @change="handleCheckChange">
              <div v-for="(item, index) in childList2" :key="index+'20'" flex="dir:left box:first" class="cat-item">
                <el-checkbox :label="item.Id">
                  <span style="display: none;">{{ item.Name }}</span>
                </el-checkbox>
                <div flex="box:last cross:center">
                  <span>{{ item.Name }}</span>
                  <i v-if="item.ChildList.length > 0" @click="getChild3(item.ChildList)"
                    class="el-icon-arrow-right"></i>
                </div>
              </div>
            </el-checkbox-group>
          </div>
        </el-col>
        <el-col v-show="childList3.length > 0" :span="8" style="padding:0 10px;box-sizing:border-box">
          <h3 style="padding:15px 0">三级分类</h3>
          <div class="app-goods-cat-list active">
            <el-checkbox-group v-model="NewCategoryList" @change="handleCheckChange">
              <div v-for="(item, index) in childList3" :key="index+'21'" flex="dir:left box:first" class="cat-item">
                <el-checkbox :label="item.Id">
                  <span style="display: none;">{{ item.Name }}</span>
                </el-checkbox>
                <div flex="box:last cross:center">
                  <span>{{ item.Name }}</span>
                  <i class="el-icon-arrow-right"></i>
                </div>
              </div>
            </el-checkbox-group>
          </div>
        </el-col>
      </el-row>
      <div class="tag-box">
        <el-tag @close="exitCheck(item)" v-for="(item, index) in addMsg.CategoryList" :key="index+'22'" type="warning"
          closable style="margin-right:5px">{{ item.Name }}</el-tag>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button size="small" @click="
            (flDig = false),
              (addMsg.CategoryList = keepCategoryList),
              ExitCateList()
          ">取 消</el-button>
        <el-button @click="(flDig = false), getSuggestPrice()" size="small" type="primary">确 定</el-button>
      </span>
    </el-dialog>
    <!-- 查看图例 -->
    <el-dialog title="查看自定义分享图片图例" :visible.sync="imgDig" width="30%">
      <div class="center">
        <img style=" width: 310px;height: 360px;" src="../../assets/img/userman/app-share-name.png" alt="" />
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button @click="imgDig = false" size="small" type="primary">我知道了</el-button>
      </span>
    </el-dialog>
    <!-- 选择图片 -->
    <el-dialog title="选择图片" :visible.sync="changeState" width="1240px">
      <ChooseImg @SelectId="SelectId"></ChooseImg>
    </el-dialog>
    <!-- 选择视频 -->
    <el-dialog title="选择视频" :visible.sync="changeState1" width="1240px">
      <Choosevideo @Selectvideo="Selectvideo"></Choosevideo>
    </el-dialog>
    <!-- 选择其他文件 -->
    <el-dialog title="选择文件" :visible.sync="fileDialog" width="1240px">
      <ChooseFile @SelectFile="SelectFile"></ChooseFile>
    </el-dialog>

    <!-- 选择表单 -->
    <el-dialog title="选择表单" top="2%" :visible.sync="choosebdDig" width="30%">
      <div>
        <el-radio-group v-model="val1">
          <el-radio @change="YfSelect1" style="padding-bottom:10px" class="yfradio" :label="{ Name: '默认运费', Id: 0 }">
            默认表单
          </el-radio>
        </el-radio-group>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button size="small" @click="(choosebdDig = false), (addMsg.FormsId = keepFormsId)">取 消</el-button>
        <el-button size="small" @click="choosebdDig = false" type="primary">确 定</el-button>
      </span>
    </el-dialog>
    <!--区域-->
    <el-dialog custom-class="regionDig" title="区域" :visible.sync="dialogFormVisible" width="950px">
      <region_Choice @event1="change($event)" :List="AreaList" ref="child"></region_Choice>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" size="small" @click="Addto">确 定</el-button>
      </div>
    </el-dialog>
    <!-- 选择教师 -->
    <el-dialog title="选择教师" top="2%" :visible.sync="choosejsDig" width="30%">
      <div>
        <el-checkbox-group v-model="ckedTeacher">
          <el-checkbox v-for="(item,index) in teacherList" :label="item.ID" :key="index">
            <div class="teacherHead">
              <img :src="item.TeacherLogo" alt="" />
            </div>{{item.Name}}
          </el-checkbox>
        </el-checkbox-group>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button size="small" @click="choosejsDig = false">取 消</el-button>
        <el-button size="small" @click="getckedTeachArr" type="primary">确 定</el-button>
      </span>
    </el-dialog>
    <!-- 课程弹窗 -->
    <el-dialog :title="commonTitle" :visible.sync="courseDialog" width="500px">
      <el-form label-width="100px">
        <el-form-item label="名称">
          <el-input v-model="courseMsg.Name" size="small"></el-input>
        </el-form-item>
        <el-form-item label="类型">
          <el-select style="margin-right: 10px;" v-model="courseMsg.Type" @change="resetPath" size="small"
            placeholder="请选择">
            <el-option v-for="item in fileList" :key="item.Id" :label="item.Name" :value="item.Id">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="试看" size="small">
          <el-switch v-model="courseMsg.IsTrySee" active-color="#409EFF" :active-value="1" :inactive-value="2">
          </el-switch>
        </el-form-item>
        <el-form-item label="试看">
          <el-input v-model="courseMsg.Number" @keyup.native="checkInteger(courseMsg,'Number')" size="small">
            <template slot="append">
              <span v-if="courseMsg.Type==1">秒</span>
              <span v-else>页</span>
            </template>
          </el-input>
          <div style="color:red;">设置为0表示不限制试看</div>
        </el-form-item>
        <el-form-item label="缓存">
          <el-switch v-model="courseMsg.IsCache" active-color="#409EFF" :active-value="1" :inactive-value="2">
          </el-switch>
        </el-form-item>
        <el-form-item label="附件路径">
          <el-input v-model="courseMsg.FilePath" size="small" placeholder="请输入内容">
            <template v-if="courseMsg.Type==1">
              <el-button @click="changeState1 = true,videoType=2" slot="append">添加视频</el-button>
            </template>
            <template v-else>
              <el-button @click="fileDialog = true" slot="append">
                <span v-if="courseMsg.Type==2">添加WORD</span>
                <span v-if="courseMsg.Type==3">添加PDF</span>
                <span v-if="courseMsg.Type==4">添加PPT</span>
              </el-button>
            </template>
          </el-input>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button size="small" @click="courseDialog = false">取 消</el-button>
        <el-button size="small" @click="getCourseList" v-if="isShowEditBtn" type="primary">确 定</el-button>
        <el-button size="small" @click="resetCourse" v-else type="primary">确 定</el-button>
      </span>
    </el-dialog>
    <a id='groupTourOrder_DownLoad' target="_blank" style="display:none">1不要删除</a>
    <div class="videoDiv" v-show="videoDivState">
      <div style="text-align:right;padding-right:15px;cursor:pointer">
        <span @click="Setvideo" style="font-size:30px;color:#fff" class="iconfont icon-weibiaoti4"></span>
      </div>
      <video ref="myVideo" autoplay="autoplay" width="100%" height="90%" :src="thisVideoAddress" controls="controls">
        <source :src="thisVideoAddress" type="video/mp4">
        <source :src="thisVideoAddress" type="video/ogg">
      </video>
    </div>
    <el-image-viewer v-if="showViewer" :on-close="closeViewer" :url-list="images" />
  </div>
</template>
<script>
  import ChooseImg from "@/components/global/ChooseImg.vue";
  import Choosevideo from "@/components/global/Choosevideo.vue";
  import ChooseFile from "@/components/global/ChooseFile.vue";
  import region_Choice from "@/components/setup/view/regionChoice";
  import UE from "@/components/global/UE.vue";
  import draggable from "vuedraggable"
  import ElImageViewer from 'element-ui/packages/image/src/image-viewer'

  export default {
    components: {
      ChooseImg,
      Choosevideo,
      ChooseFile,
      region_Choice,
      UE,
      draggable,
      ElImageViewer
    },
    data() {
      return {
        ComTreeList: [],
        thisType: 0,
        tableData: [],
        SpecificationList: [],
        SpecificationPriceList: [],
        speciDigActive: -1,
        newSpecificationValueList: [],
        SpecificationValueList: [],
        speciList: [],
        choosebdDig: false,
        val2: "",
        defaultMsg: "",
        config: {
          initialFrameWidth: null,
          initialFrameHeight: 350
        },
        changeState1: false,
        changeState: false,
        imgDig: false,
        activeName: "first",
        flDig: false,
        addMsg: {
          Id: 0,
          GoodsPageType: 1, //上架版面
          CategoryList: [], //分类列表
          Name: "", //商品名称
          CarouselImageList: [], //轮播图
          VideoAddress: "", //视频地址	
          CustomShareTitles: "", // 分享标题	
          CustomShareImage: "", //分享图片	
          GoodsStatus: 0, //商品状态 1销售中 2下架
          IsLiveGoods: 2, //是否直播商品 1是 2否
          Sort: 0, //排序
          SellingPrice: 0, //销售价格
          OriginalPrice: 0, //原价
          CostPrice: 0, //成本价格
          IsAreaBuy: 2, //是否区域购买 1是 2否
          IntegralPresent: 0, //积分赠送
          IntegralPresentType: 2, //积分赠送类型
          PointsDeduction: 0, //积分抵扣
          PointsDeductionType: 2, //积分抵扣类型
          IsMultipleDeduction: 2, //是否可以多件累计抵扣 1是 2否
          GoodsDetails: "", //商品描述
          SeparateDistribution: 2, //分销
          SeparateDistributionType: 1,
          SeparateDistributionMoneyType: 2, //默认显示固定金额
          EnjoyMember: 1, //会员价
          SeparateSetMember: 0,
          SupplierId: '', //供应商id
          Commission: 0, // 返佣总金额 （粉象模式开启 才显示）
          AreaList: [], //区域列表	
          DistributionCommissionList: [], //分销佣金
          DistributionCommissionTreeList: [],
          MemberPriceList: [], //会员价格
          Advertising: '', //广告词
          SubName: '', //副标题
          MarketingLogo: { //图标
            iswords: 0,
            words: "",
            wordsColor: "",
            wordsBack: "",
            ico: ""
          },
          MemberPriceTreeList: [],
          TeacherList: [], //教师
          CourseList: [], //课程
          SalesNum: 0, //已售数量
          CourseLableList: [] //标签
        },
        predefineColors: [
          '#000000',
          '#FFFFFF',
          '#888888',
          '#FF4544',
        ],
        SupplierId: '',
        fenleiData: [],
        checkList: [],
        childList2: [],
        childList3: [],
        keepCategoryList: [],
        rules: {
          CategoryIdNew: [{
            required: true,
            message: "分类不能为空",
            trigger: "change"
          }],
          Name: [{
            required: true,
            message: "请输入商品名称",
            trigger: "blur"
          }],

          SellingPrice: [{
            required: true,
            message: "请输入商品售价",
            trigger: "blur"
          }],

          OriginalPrice: [{
            required: true,
            message: "请输入原价",
            trigger: "blur"
          }],
          Commission: [{
            required: true,
            message: "返佣总金额",
            trigger: "blur"
          }],
          CarNumber: [{
            required: true,
            message: "请输入车牌号",
            trigger: "blur"
          }],
          UseDay: [{
            required: true,
            message: "请输入使用天数",
            trigger: "blur"
          }],
          RideNum: [{
            required: true,
            message: "请输入乘坐人数",
            trigger: "blur"
          }],
          AdvanceDay: [{
            required: true,
            message: "请输入提前预定天数",
            trigger: "blur"
          }],
          LineName: [{
            required: true,
            message: "请输入线路名称",
            trigger: "blur"
          }]
        },
        imgType: 1,
        ruleList: [],
        val: {},
        val1: {},
        AreaList: [],
        skuList: [],
        GoodsId: "",
        butorInt: 0,
        butorIntList: [],
        DropdownList: [],
        DistributionCommissionTreeList: [],
        disList1: [{
          SpecificationSort: "",
          GradeCommissionList: []
        }],
        disList2: [],
        GradeCommissionList: [],
        ggpl: "",
        ggplList: [],
        valpl: "",
        pusetVal: "",
        pusetList: [],
        ptinput: "",

        fxVal: "",
        gradeVal: "",
        xxList: [],
        huiyList: [],
        memberList1: [{
          Id: 0,
          SpecificationSort: "",
          GradePriceList: []
        }],
        memberList2: [],
        memberinput: "",
        memberVal: "",
        memberCheck: [],
        imgListIndex1: 0,
        imgListIndex2: 0,
        NewCategoryList: [],
        hpState: 0,
        FxState: 0,
        SuggestPriceInfo: {},
        shareSettings: [],
        companyCommission: 0,
        options: [],
        giveDate: false,
        My_cateList: [],
        dialogFormVisible: false,

        choosejsDig: false, // 选择教师弹窗
        teacherList: [], //教师下拉数据
        ckedTeacher: [], //选中教师数组
        courseDialog: false,
        courseMsg: {
          Id: 0,
          Sort: 1,
          SortName: '', //章节排序名称
          Name: '', //名称
          Type: 1, //类型
          IsTrySee: 2, //试看 1可以 2不可以
          Number: 1, //试看 视频秒/word pdf页
          IsCache: 2, //缓存 1可以 2不可以
          FilePath: '', //附件路径
          PathType: 1, //文件存储类型 1腾讯云 2阿里云
          VideoImage: '', //视频图片地址
          VideoTime: '', //视频时长
        },
        fileList: [], //附件枚举
        videoType: 1,
        fileDialog: false, //选择文件弹窗
        isReplace: 0, //是否替换
        videoDivState: false, //视频预览
        thisVideoAddress: "",
        isShowEditBtn: true,

        showViewer: false,
        images: [],
        dynamicTags: [],
        inputVisible: false,
        inputValue: '',
        commonTitle: '新增课程',
      };
    },
    created() {
      if (this.$route.query.hpState) {
        this.hpState = this.$route.query.hpState;
      }
      if (this.$route.query.FxState) {
        this.FxState = this.$route.query.FxState;
      }
      this.gethuiyList();
      this.getRule();
      this.getSpeciList();
      this.getDistributor();
      this.getSupplierList()
      this.getCateList();
      this.getTeacherList();
      this.getFileList();
    },
    mounted() {
      this.$refs.ue.loadUe();
      if (this.$route.query.GoodsId) {
        this.GoodsId = this.$route.query.GoodsId;
        this.getData();
      } else {
        this.getTree();
      }
    },
    methods: {
      //关闭标签
      handleClose(tag) {
        this.dynamicTags.splice(this.dynamicTags.indexOf(tag), 1);
      },
      handleInputConfirm() {
        let inputValue = this.inputValue;
        if (inputValue) {
          this.dynamicTags.push(inputValue);
        }
        this.inputVisible = false;
        this.inputValue = '';
      },
      showInput() {
        this.inputVisible = true;
        this.$nextTick(_ => {
          this.$refs.saveTagInput.$refs.input.focus();
        });
      },
      //预览
      getImgView(item) {
        this.images = [];
        item.ImageList.forEach(x => {
          if (x.Path.indexOf('http') > -1) {
            x.Path = x.Path.replace('http:/', 'http://')
            this.images.push(x.Path);
          }
          if (x.Path.indexOf('https') > -1) {
            x.Path = x.Path.replace('https:/', 'https://')
            this.images.push(x.Path);
          }
        })
        this.showViewer = true;
      },
      closeViewer() {
        this.showViewer = false;
      },
      initShareSettings() {
        let arr = [];
        this.addMsg.CategoryList.forEach(item => {
          item.Name = item.CategoryName;
          arr.push(item.CategoryId);
        });
        let CategoryIds = arr.join(",");
        this.apipost(
          "/api/user/GetHpDistributorGoodsInfo", {
            CategoryIds: CategoryIds,
            CostPrice: "10"
          },
          res => {
            if (res.data.resultCode == 1) {
              this.shareSettings = res.data.data.RatioList || []
              this.calcCommission(0)
            }
          }
        );
      },
      calcCommission(t) {
        if (t == 0) {
          let maxratio = 0
          let minratio = 100
          if (this.shareSettings.length > 0) {
            this.shareSettings.forEach(x => {
              if (x.CommissionRatio > maxratio) {
                maxratio = x.CommissionRatio
              }
            })
          }
          if (this.shareSettings.length > 0) {
            this.shareSettings.forEach(x => {
              x.cb = parseFloat(this.addMsg.CostPrice) / (1.00 - (parseFloat(x.CommissionRatio) / 100.00))
              x.commission = (this.addMsg.SellingPrice - x.cb).toFixed(2)
              x.cb = x.cb.toFixed(2)
              if (x.CommissionRatio < minratio) {
                this.companyCommission = (this.addMsg.SellingPrice - (parseFloat(x.commission) + parseFloat(this
                  .addMsg.CostPrice))).toFixed(2)
                minratio = x.CommissionRatio
              }
            })
          }
        }
      },
      HpChange() {
        if (this.FxState == 1) {
          this.Error("已开启粉象分销，请在粉象分销里面配置！");
          this.addMsg.SeparateDistribution = 0;
        } else if (this.hpState == 1) {
          this.Error("已开启和平分销，请在和平分销里面配置！");
          this.addMsg.SeparateDistribution = 0;
        }
      },
      //
      HySet() {
        this.memberList2.forEach(item => {
          this.memberCheck.forEach(check => {
            if (item.Id == check.Id) {
              item.GradePriceList.forEach(list1 => {
                if (list1.MemberGrade == this.memberVal) {
                  list1.MemberPrice = this.memberinput;
                }
              });
            }
          });
        });
      },
      TbaleSelectionChange4(val) {
        this.memberCheck = val;
      },
      gethuiyList() {
        let msg = {
          Grade: 0,
          Name: "",
          Enabled: 1
        };
        this.apipost("/api/user/GetMemberGradeList", msg, res => {
          this.loading = false;
          if (res.data.resultCode == 1) {
            let pageData = res.data.data;
            this.huiyList = pageData;
            this.huiyList.forEach(item => {
              let obj = {
                Name: item.Name,
                MemberGrade: item.Grade,
                MemberPrice: 0
              };
              this.memberList1[0].GradePriceList.push(obj);
            });
          }
        });
      },
      TbaleSelectionChange3(val) {
        this.xxList = val;
      },

      PuSet() {
        this.GradeCommissionList.forEach(item => {
          this.pusetList.forEach(list => {
            if (item.DistributorGrade == list.DistributorGrade) {
              if (this.pusetVal == 1) {
                item.OneCommission = this.ptinput;
              }
              if (this.pusetVal == 2) {
                item.TwoCommission = this.ptinput;
              }
              if (this.pusetVal == 3) {
                item.ThreeCommission = this.ptinput;
              }
            }
          });
        });
      },
      TbaleSelectionChange2(val) {
        this.pusetList = val;
      },
      Save(formName) {
        this.$refs[formName].validate(valid => {
          if (valid) {
            let content = this.$refs.ue.getUEContent();
            this.addMsg.GoodsDetails = content;
            if (this.addMsg.CategoryList.length == 0) {
              this.Error('请选择商品分类');
              return false
            }

            if (this.addMsg.SeparateDistributionType == 1) {
              this.disList1 = [{
                  SpecificationSort: "",
                  GradeCommissionList: this.GradeCommissionList
                }],
                this.addMsg.DistributionCommissionList = this.disList1;
            }
            if (this.addMsg.SeparateSetMember == 1) {
              this.addMsg.MemberPriceList = this.memberList1;
              this.addMsg.MemberPriceTreeList = this.memberList1;
            }
            let mall_userInfo = JSON.parse(localStorage.mall_userInfo)
            if (mall_userInfo.TenantId == 1 && mall_userInfo.MallBaseId == 1 && this.SupplierId == '') {
              this.Error("请选择供应商!");
              return
            } else {
              this.addMsg.SupplierId = this.SupplierId != '' ? this.SupplierId : 0;
            }

            if (this.addMsg.PresentFXGrade == '') { //没选择的时候默认为0
              this.addMsg.PresentFXGrade = 0
            }
            this.addMsg.CourseLableList = this.dynamicTags

            //标签的判断和处理
            if (this.addMsg.MarketingLogo.iswords == 0) {
              this.addMsg.MarketingLogo = {
                iswords: 0,
                words: "",
                wordsColor: "",
                wordsBack: "",
                ico: ""
              }
            } else if (this.addMsg.MarketingLogo.iswords == 1) {
              this.addMsg.MarketingLogo.ico = ''
            } else if (this.addMsg.MarketingLogo.iswords == 2) {
              this.addMsg.MarketingLogo.words = '';
              this.addMsg.MarketingLogo.wordsColor = '';
              this.addMsg.MarketingLogo.wordsBack = '';
            }
            this.addMsg.MarketingLogo = JSON.stringify(this.addMsg.MarketingLogo)
            this.apipost("/api/Education/SetGoodsInfo", this.addMsg, res => {
              if (res.data.resultCode == 1) {
                this.Success(res.data.message);
                this.CommonJump("CourseManagement");
              } else {
                this.Error(res.data.message);
              }
            });
          } else {
            return false;
          }
        });
      },
      getSpeciList() {
        let msg = {
          pageIndex: 1,
          pageSize: 999,
          Name: "",
          Id: 0,
          Content: ""
        };
        this.apipost("/api/product/GetProductSpecificationPageList", msg, res => {
          if (res.data.resultCode == 1) {
            let pageData = res.data.data.pageData;
            this.speciList = pageData;
            this.speciList.forEach(item => {
              item.NewSpecList = [];
              item.checkAll = false;
              item.SpecList.forEach(val => {
                let obj = {
                  Id: item.Id,
                  Name: val
                };
                item.NewSpecList.push(obj);
              });
            });
          }
        });
      },
      editQy() {
        this.dialogFormVisible = true;
        setTimeout(() => {
          this.$refs.child.Receive(this.AreaList);
        }, 1000);
      },
      Addto() {
        this.addMsg.AreaList = [];
        this.AreaList.forEach(item => {
          let obj = {
            Id: item.RegionId,
            AreaId: item.RegionId,
            AreaName: item.RegionName
          };
          this.addMsg.AreaList.push(obj);
        });
        this.dialogFormVisible = false;
      },
      addOf() {
        this.dialogFormVisible = true;
        this.AreaList = [];
        this.addMsg.AreaList = [];
        setTimeout(() => {
          this.$refs.child.Receive(this.AreaList);
        }, 1000);
      },
      change(data) {
        this.AreaList = data;
      },
      YfSelect1(val) {
        this.addMsg.FormsId = val.Id;
        this.addMsg.FormsName = val.Name;
      },


      clearCustom() {
        this.addMsg.CustomShareImage = "";
      },
      Selectvideo(val) {
        if (this.videoType == 1) {
          this.addMsg.VideoAddress = val.Path;
        } else {
          this.courseMsg.PathType = val.PathType;
          this.courseMsg.FilePath = val.Path;
          this.courseMsg.VideoImage = val.Image;
          this.courseMsg.VideoTime = val.VideoTime;
        }
        this.changeState1 = false;
      },
      //选择文件
      SelectFile(msg) {
        var type = msg.name.split('.')[1];
        if (this.courseMsg.Type == 2) {
          if (type != 'doc' && type != 'docx') {
            this.Error('请选择word文件');
          } else {
            this.courseMsg.FilePath = msg.url;
            this.courseMsg.PathType = msg.PathType;
          }
        }
        if (this.courseMsg.Type == 3) {
          if (type != 'pdf') {
            this.Error('请选择pdf文件');
          } else {
            this.courseMsg.FilePath = msg.url;
            this.courseMsg.PathType = msg.PathType;
          }
        }
        if (this.courseMsg.Type == 4) {
          if (type != 'ppt' && type != 'pptx') {
            this.Error('请选择ppt文件');
          } else {
            this.courseMsg.FilePath = msg.url;
            this.courseMsg.PathType = msg.PathType;
          }
        }
        this.fileDialog = false;
      },
      ClearCarouse(index) {
        this.addMsg.CarouselImageList.splice(index, 1);
      },

      openggImg(item, index, item2, index2) {
        this.changeState = true;
        this.imgType = 3;
        this.imgListIndex1 = index;
        this.imgListIndex2 = index2;
      },
      openChangeDig(val) {
        this.changeState = true;
        this.imgType = val;
      },
      //选择图片
      SelectId(msg) {
        let that = this;
        if (msg) {
          if (this.imgType == 1) {
            let obj = {
              Id: msg.selectId,
              Path: that.getIconLink(msg.url),
            };
            this.addMsg.CarouselImageList.push(obj);
          }
          if (this.imgType == 2) {
            this.addMsg.CustomShareImage = that.getIconLink(msg.url);
          }
          if (this.imgType == 3) {
            let imgListIndex1 = this.imgListIndex1;
            let imgListIndex2 = this.imgListIndex2;
            this.SpecificationList[imgListIndex1].SpecificationValueList[
              imgListIndex2
            ].Image = that.getIconLink(msg.url);
          }
          if (this.imgType == 4) {
            that.addMsg.MarketingLogo.ico = that.getIconLink(msg.url)
          }
        }
        this.changeState = false;
      },
      getChild3(ChildList) {
        this.childList3 = ChildList;
      },
      getChild2(ChildList) {
        this.childList2 = ChildList;
      },
      ExitCateList() {
        this.NewCategoryList = [];
        this.addMsg.CategoryList.forEach(item => {
          item.Name = item.CategoryName;
          this.NewCategoryList.push(item.CategoryId);
        });
      },
      handleCheckChange() {
        this.addMsg.CategoryList = [];
        this.NewCategoryList.forEach(list => {
          this.fenleiData.forEach(item => {
            if (list == item.Id) {
              item.CategoryId = item.Id;
              this.addMsg.CategoryList.push(item);
            }
            item.ChildList.forEach(item2 => {
              if (list == item2.Id) {
                item2.CategoryId = item2.Id;
                this.addMsg.CategoryList.push(item2);
              }
              item2.ChildList.forEach(item3 => {
                if (list == item3.Id) {
                  item3.CategoryId = item3.Id;
                  this.addMsg.CategoryList.push(item3);
                }
              });
            });
          });
        });
      },
      exitCheck(item, index) {
        this.addMsg.CategoryList.forEach((list, k) => {
          if (list.Id == item.Id) {
            this.addMsg.CategoryList.splice(k, 1);
          }
        });
        this.ExitCateList();
        this.getSuggestPrice();
      },
      getTree() {
        let msg1 = {
          Id: 0,
          Name: "",
          Tier: 0,
          ParentId: 0,
          Enabled: 1,
          IsShow: 0,
          CategoryPageType: this.addMsg.GoodsPageType
        };
        this.apipost("/api/product/GetProductCategoryTreeList", msg1, res => {
          if (res.data.resultCode == 1) {
            let pageData = res.data.data;
            this.fenleiData = pageData;
            this.fenleiData.forEach(item => {
              item.CategoryName = item.Name;
              item.ChildList.forEach(item2 => {
                item2.CategoryName = item2.Name;
                item2.ChildList.forEach(item3 => {
                  item3.CategoryName = item3.Name;
                });
              });
            });
          }
        });
      },
      getcode() { //编码获取详情
        this.GoodsId = this.addMsg.Id;
        this.getData()
      },
      getData() {
        this.apipost(
          "/api/Education/GetGoodsInfo", {
            GoodsId: this.GoodsId
          },
          res => {
            if (res.data.resultCode == 1) {
              this.addMsg = res.data.data;
              if (this.addMsg.SupplierId != 0) {
                this.SupplierId = this.addMsg.SupplierId;
              }
              if (!this.$route.query.GoodsId) {
                this.addMsg.Id = 0
              }

              this.initShareSettings();

              this.ComTreeList = this.addMsg.DistributionCommissionTreeList;

              if (this.addMsg.SeparateDistributionType == 1) {
                this.disList1 = this.addMsg.DistributionCommissionTreeList;
                if (this.addMsg.DistributionCommissionTreeList.length > 0) {
                  this.GradeCommissionList = this.addMsg.DistributionCommissionTreeList[0].GradeCommissionList;
                }
              }
              if (this.addMsg.MemberPriceTreeList.length > 0) {
                this.memberList1 = this.addMsg.MemberPriceTreeList;
              }
              this.thisType = 1;
              this.disList1 = [];
              let objNew = {
                SpecificationSort: "",
                GradeCommissionList: this.GradeCommissionList
              };
              this.disList1.push(objNew);
              if (this.addMsg.GoodsDetails && this.addMsg.GoodsDetails != "") {
                this.defaultMsg = this.addMsg.GoodsDetails;
              }
              this.NewCategoryList = [];
              this.addMsg.CategoryList.forEach(item => {
                item.Name = item.CategoryName;
                this.NewCategoryList.push(item.CategoryId);
              });
              if (this.hpState == 1) {
                this.addMsg.SeparateDistribution = 0;
              }
              if (this.addMsg.PresentFXGrade == 0) {
                this.addMsg.PresentFXGrade = ''
              }
              if (this.addMsg.CourseLableList && this.addMsg.CourseLableList.length > 0) {
                this.dynamicTags = this.addMsg.CourseLableList
              }
              if (this.addMsg.TeacherList.length > 0) {
                this.addMsg.TeacherList.forEach(x => {
                  this.ckedTeacher.push(x.TeacherId);
                })
              }
              if (!this.addMsg.MarketingLogo || this.addMsg.MarketingLogo == null) {

                this.addMsg.MarketingLogo = {
                  iswords: 0,
                  words: "",
                  wordsColor: "",
                  wordsBack: "",
                  ico: ""
                }
              } else {
                // var tempObj = this.addMsg.MarketingLogo.substring(1, this.addMsg.MarketingLogo.length-1);
                // var reg=/\\|\//g;
                // var cc = "'"+tempObj.replace(reg,"")+"'";
                // var bb = eval("("+cc+")");
                // var kk = JSON.parse(bb);
                // this.addMsg.MarketingLogo=kk;
                this.addMsg.MarketingLogo = JSON.parse(this.addMsg.MarketingLogo);
              }
              this.getSuggestPrice();
              this.getFXDGradeList2();
              this.getTree();
            } else {
              this.Error(res.data.message);
            }
          }
        );
      },
      getSuggestPrice() { //获取和平分销商品建议价格
        if (this.hpState == 1 && Number(this.addMsg.CostPrice) > 0) {
          let arr = [];
          this.addMsg.CategoryList.forEach(item => {
            item.Name = item.CategoryName;
            arr.push(item.CategoryId);
          });
          let CategoryIds = arr.join(",");
          let msg = {
            CategoryIds: CategoryIds,
            CostPrice: this.addMsg.CostPrice
          };
          this.apipost("/api/user/GetHpGoodsSuggestPrice", msg, res => {
            if (res.data.resultCode == 1) {
              this.SuggestPriceInfo = res.data.data;
            }
          });
        }
      },
      getRule() {
        let msg1 = {
          pageIndex: 1,
          pageSize: 999,
          RulesName: ""
        };
        this.apipost("/api/MallBase/GetLogisticsRulesPage", msg1, res => {
          if (res.data.resultCode == 1) {
            let pageData = res.data.data.pageData;
            this.ruleList = pageData;
          }
        });
      },

      getDistributor() {
        this.loading = true;
        this.apipost("/api/user/GetDistributorBasicsInfo", {}, res => {
          this.loading = false;
          if (res.data.resultCode == 1) {
            this.butorInt = res.data.data.DistributorTier;
            this.butorIntList = [];
            for (let i = 0; i < res.data.data.DistributorTier; i++) {
              let msg = {
                Name: i + 1 + "级分销"
              };
              this.butorIntList.push(msg);
            }
            this.GetDropdownList();
          }
        });
      },
      GetDropdownList() {
        let msg = {
          Id: 0,
          Grade: 0,
          Name: "",
          Enabled: 1
        };
        this.apipost("/api/user/GetDistributorGradeDropdownList", msg, res => {
          this.DropdownList = JSON.parse(JSON.stringify(res.data.data));
          let msg = {
            Grade: 0,
            GradeCommissionList: [],
            Name: "默认等级",
            SpecificationSort: "",
            Id: 0
          };
          this.DropdownList.unshift(msg);
          this.disList1.GradeCommissionList = [];
          this.disList1.SpecificationSort = "";
          this.DropdownList.forEach(item => {
            item.GradeCommissionList = [];
            item.SpecificationSort = "";
            for (let i = 0; i < this.butorInt; i++) {
              let obj = {
                DistributorGrade: item.Id,
                OneCommission: 0,
                TwoCommission: 0,
                ThreeCommission: 0
              };
              item.GradeCommissionList.push(obj);
            }
          });
          this.DropdownList = JSON.parse(JSON.stringify(this.DropdownList));
          if (
            !this.$route.query.GoodsId ||
            (this.addMsg.DistributionCommissionTreeList && this.addMsg.DistributionCommissionTreeList.length ==
              0) || this.thisType == 1
          ) {
            this.GradeCommissionList = [];
            this.DropdownList.forEach(item => {
              let obj2 = {
                DistributorGrade: item.Id,
                OneCommission: 0,
                TwoCommission: 0,
                ThreeCommission: 0,
                Name: item.Name
              };
              this.GradeCommissionList.push(obj2);
            });
            this.GradeCommissionList = JSON.parse(
              JSON.stringify(this.GradeCommissionList)
            );
            this.disList2 = [];
            if (this.$route.query.GoodsId) {
              if (this.addMsg.SeparateDistributionType == 1) {
                this.disList1 = this.addMsg.DistributionCommissionTreeList;
                if (this.addMsg.DistributionCommissionTreeList.length > 0) {
                  this.GradeCommissionList = this.addMsg.DistributionCommissionTreeList[0].GradeCommissionList;
                }
              }
            } else {
              this.disList1 = [];
              let objNew = {
                SpecificationSort: "",
                GradeCommissionList: this.GradeCommissionList
              };
              this.disList1.push(objNew);
            }
            this.skuList = [];
          }
        });
      },
      getSupplierList() {
        this.apipost("/api/Supplier/GetSupplierAllList", {}, res => {
          this.loading = false;
          if (res.data.resultCode == 1) {
            this.options = res.data.data;
          }
        });
      },
      getFXDGradeList2() { //获取粉象等级下拉列表
        this.apipost("/api/user/GetFXDistributorGradeList", {
          GradeName: ''
        }, res => {
          if (res.data.resultCode == 1) {

            if (res.data.data != null) {
              res.data.data.forEach(x => {
                if (x.Id == this.addMsg.PresentFXGrade) {
                  if (x.IsGuest == 3) {
                    this.giveDate = true;
                  } else {
                    this.giveDate = false;
                    this.addMsg.PresentFXMonth = 0;
                  }
                }
              })
            }
          }
        });

      },
      //获取上架版面下拉
      getCateList() {
        this.apipost("/api/Product/GoodsPageTypeEnumList", {}, res => {
          if (res.data.resultCode == 1) {
            this.My_cateList = res.data.data;
          } else {
            this.Error(res.data.message);
          }
        });
      },
      //选择上架版面
      getGoodType(num) {
        if (num != 0) {
          this.addMsg.CategoryList = [];
        }
        this.getTree()
      },
      //获取教师下拉数据
      getTeacherList() {
        this.apipost("/api/Education/GetTeacherList", {}, res => {
          if (res.data.resultCode == 1) {
            this.teacherList = res.data.data;
          } else {
            this.Error(res.data.message);
          }
        });
      },
      getckedTeachArr() {
        this.addMsg.TeacherList = [];
        this.ckedTeacher.forEach(x => {
          this.teacherList.forEach(y => {
            if (x == y.ID) {
              this.addMsg.TeacherList.push({
                TeacherId: y.ID,
                Name: y.Name,
                TeacherLogo: y.TeacherLogo
              })
            }
          })
        })
        this.choosejsDig = false;
      },
      //移除
      yichuTeacher(index) {
        this.ckedTeacher = [];
        this.addMsg.TeacherList.splice(index, 1);
        if (this.addMsg.TeacherList.length > 0) {
          this.addMsg.TeacherList.forEach(x => {
            this.ckedTeacher.push(x.TeacherId);
          })
        }
      },
      //获取附件枚举
      getFileList() {
        this.apipost("/api/Education/GetGoodsCourseTypeEnumList", {}, res => {
          if (res.data.resultCode == 1) {
            this.fileList = res.data.data;
          } else {
            this.Error(res.data.message);
          }
        });
      },
      //点击确定追加课程
      getCourseList() {
        var CouLength = this.addMsg.CourseList.length;
        this.courseMsg.Sort = CouLength + 1;
        this.courseMsg.SortName = '第' + this.getNumParse(this.courseMsg.Sort) + '章';
        this.addMsg.CourseList.push(this.courseMsg);
        this.courseDialog = false;
        var obj = {
          Id: 0,
          Sort: 1,
          SortName: '', //章节排序名称
          Name: '', //名称
          Type: 1, //类型
          IsTrySee: 1, //试看 1可以 2不可以
          Number: 1, //试看 视频秒/word pdf页
          IsCache: 1, //缓存 1可以 2不可以
          FilePath: '', //附件路径
          PathType: 1, //文件存储
          VideoImage: '',
          VideoTime: ''
        }
        this.courseMsg = JSON.parse(JSON.stringify(obj));
      },
      //数字转中文
      getNumParse(num) {
        let changeNum = ['零', '一', '二', '三', '四', '五', '六', '七', '八', '九'];
        let unit = ["", "十", "百", "千", "万"];
        num = parseInt(num);
        let getWan = (temp) => {
          let strArr = temp.toString().split("").reverse();
          let newNum = "";
          for (var i = 0; i < strArr.length; i++) {
            newNum = (i == 0 && strArr[i] == 0 ? "" : (i > 0 && strArr[i] == 0 && strArr[i - 1] == 0 ? "" : changeNum[
              strArr[i]] + (strArr[i] == 0 ? unit[0] : unit[i]))) + newNum;
          }
          return newNum;
        }
        let overWan = Math.floor(num / 10000);
        let noWan = num % 10000;
        if (noWan.toString().length < 4) {
          noWan = "0" + noWan;
        }
        return overWan ? getWan(overWan) + "万" + getWan(noWan) : getWan(num);
      },
      //拖动完成
      allow(evt) {
        this.addMsg.CourseList.forEach((x, index) => {
          x.Sort = index + 1;
          x.SortName = '第' + this.getNumParse(x.Sort) + '章';
        })
        this.$forceUpdate();
      },
      //获取文件类型
      getFileType(file) {
        var num = 0;
        var index = file.lastIndexOf('.');
        var str = file.substring(index + 1, file.length);
        if (str == 'mp4' || str == 'AVI' || str == 'WMV') {
          num = 1;
        }
        if (str == 'doc' || str == 'docx') {
          num = 2;
        }
        if (str == 'pdf') {
          num = 3;
        }
        if (str == 'ppt') {
          num = 4;
        }
        return num;
      },
      //修改课件
      updateCourse(subItem, index) {
        this.commonTitle = '修改课程';
        this.isReplace = index;
        this.courseDialog = true;
        this.courseMsg.Id = subItem.Id;
        this.courseMsg.Sort = subItem.Sort;
        this.courseMsg.SortName = subItem.SortName;
        this.courseMsg.Name = subItem.Name;
        this.courseMsg.Type = subItem.Type;
        this.courseMsg.IsTrySee = subItem.IsTrySee;
        this.courseMsg.Number = subItem.Number;
        this.courseMsg.IsCache = subItem.IsCache;
        this.courseMsg.FilePath = subItem.FilePath;
        this.courseMsg.PathType = subItem.PathType;
        this.courseMsg.VideoImage = subItem.VideoImage;
        this.courseMsg.VideoTime = subItem.VideoTime;
      },
      //删除课件
      deleteCourse(index) {
        this.addMsg.CourseList.splice(index, 1);
        this.allow();
      },
      //修改课程
      resetCourse() {
        this.addMsg.CourseList.splice(this.isReplace, 1, this.courseMsg);
        this.courseDialog = false;
        var obj = {
          Id: 0,
          Sort: 1,
          SortName: '', //章节排序名称
          Name: '', //名称
          Type: 1, //类型
          IsTrySee: 1, //试看 1可以 2不可以
          Number: 1, //试看 视频秒/word pdf页
          IsCache: 1, //缓存 1可以 2不可以
          FilePath: '', //附件路径
          PathType: 1, //文件存储
          VideoImage: '',
          VideoTime: ''
        }
        this.courseMsg = JSON.parse(JSON.stringify(obj));
      },
      deleteUploadFile(i) { // 删除上传文件
        this.saveMsg.splice(i, 1);
      },
      showUpLoadFileT(Url) { // 预览上传文件
        if (Url.substring(Url.lastIndexOf('.') + 1, Url.length).toUpperCase() == 'PDF') {
          this.previewPDF(Url)
        } else {
          window.open("https://view.officeapps.live.com/op/view.aspx?src=" + Url)
        }
      },
      //预览视频
      goUrlVideo(path) {
        let that = this;
        that.videoDivState = true;
        that.thisVideoAddress = path;
        let myVideo = this.$refs.myVideo;
        myVideo.play();
      },
      Setvideo() {
        this.videoDivState = false;
        let myVideo = this.$refs.myVideo;
        myVideo.pause();
      },
      //重置
      resetPath() {
        this.courseMsg.FilePath = '';
      }
    }
  };

</script>
<style>
  .app-attr-group .close {
    position: absolute;
    top: -4px;
    right: -4px;
    font-size: 16px;
    cursor: pointer;
  }

  .directorGoodsEdit .el-image {
    position: relative;
    display: inline-block;
    overflow: hidden;
  }

  .directorGoodsEdit .pendSelect {
    width: 100px;
  }

  .directorGoodsEdit .el-table th>.cell {
    padding-left: 20px !important;
  }

  .directorGoodsEdit .app-attr .box {
    line-height: 64px;
    border-top: 1px solid #e8eaee;
    border-left: 1px solid #e8eaee;
    border-right: 1px solid #e8eaee;
    padding: 0 16px;
  }

  .speciDig .tpl-scrollbar .el-checkbox {
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    padding: 10px 0;
  }

  .speciDig .tpl-scrollbar {
    height: calc(440px - 44px - 10px);
  }

  .speciDig .tpl-box .tpl-head {
    padding: 0 20px;
    font-size: 15px;
    color: #909399;
    margin-bottom: 10px;
    line-height: 44px;
    background: #f5f7fa;
  }

  .speciDig .tpl-box {
    width: 300px;
    height: 440px;
  }

  .directorGoodsEdit .app-attr-group .attr-jt {
    background: #ffffff;
    width: 6px;
    height: 6px;
    border-top: 1px solid rgb(235, 238, 245);
    border-right: 1px solid #ebeef5;
    transform: rotate(-45deg);
    -o-transform: rotate(-45deg);
    -webkit-transform: rotate(-45deg);
    -moz-transform: rotate(-45deg);
    -ms-transform: rotate(-45deg);
    position: absolute;
    top: -5px;
  }

  .directorGoodsEdit .app-attr-group .img-box {
    position: relative;
    height: 100px;
    width: 100px;
    margin-top: 8px;
    border: 1px solid #ebeef5;
  }

  .directorGoodsEdit .close {
    position: absolute;
    top: -4px;
    right: -4px;
    font-size: 16px;
    cursor: pointer;
  }

  .directorGoodsEdit .attr-list {
    display: inline-block;
    margin-right: 10px;
    margin-bottom: 10px;
    position: relative;
    cursor: move;
  }

  .directorGoodsEdit .box-grow-0 {
    min-width: 0;
    -webkit-box-flex: 0;
    -webkit-flex-grow: 0;
    -ms-flex-positive: 0;
    flex-grow: 0;
    -webkit-flex-shrink: 0;
    -ms-flex-negative: 0;
    flex-shrink: 0;
  }

  .directorGoodsEdit .app-attr-group .del-img {
    height: 20px;
    width: 20px;
    cursor: pointer;
  }

  .directorGoodsEdit .app-attr-group .bg {
    height: 44px;
    padding: 0 10px;
    background: #f8f8f8;
  }

  .regionDig .regionChoice .item_b {
    margin-bottom: 10px;
  }

  .directorGoodsEdit .app-attr-group .bg {
    height: 44px;
    padding: 0 10px;
    background: #f8f8f8;
  }

  .directorGoodsEdit .app-attr-group {
    border: 1px solid #ebeef5;
    padding: 10px;
  }

  .directorGoodsEdit .delBtn {
    position: absolute;
    right: -8px;
    top: -8px;
    padding: 4px 4px !important;
  }

  .directorGoodsEdit .add-image-btn {
    width: 100px;
    height: 100px;
    line-height: 100px;
    color: #419efb;
    border: 1px solid #e2e2e2;
    cursor: pointer;
    text-align: center;
  }

  .directorGoodsEdit .colapp-image {
    background-size: cover;
    background-position: center center;
    width: 100px;
    height: 100px;
    border-radius: 0%;
  }

  .app-add-cat .el-checkbox-group {
    font-size: 14px !important;
  }

  .app-add-cat .el-checkbox {
    margin-right: 0;
  }

  .app-add-cat .el-dialog__body {
    padding: 10px 20px !important;
  }

  .app-add-cat .tag-box .tag-item {
    margin-right: 5px;
  }

  .app-add-cat .tag-box {
    margin: 20px 0;
  }

  .app-add-cat .app-goods-cat-list .active {
    background: #fafafa;
  }

  .app-add-cat .app-goods-cat-list .cat-item {
    cursor: pointer;
    padding: 5px 10px;
  }

  .app-add-cat .app-goods-cat-list {
    border: 1px solid #e8eaee;
    border-radius: 5px;
    margin-top: -5px;
    padding: 10px 0;
    overflow: scroll;
    height: 400px;
  }

  .directorGoodsEdit .bottom-div {
    border-top: 1px solid #e3e3e3;
    position: fixed;
    bottom: 0;
    background-color: #ffffff;
    z-index: 999;
    padding: 10px;
    width: 80%;
  }

  .directorGoodsEdit .fen-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    border: 1px solid #eee;
  }

  .directorGoodsEdit .fen-table td,
  .directorGoodsEdit .fen-table th {
    border: 1px solid #eee;
    padding: 10px 0;
    padding-left: 10px;
  }

  .directorGoodsEdit .fen-table td {
    font-size: 12px;
  }

  .directorGoodsEdit .fen-table th {
    background: #ddd;
    font-weight: 500;
  }

  .directorGoodsEdit .fen-sumg {
    margin: 20px 0;
    font-size: 12px;
  }

  @media (max-width:1920px) and (min-width:1300px) {
    .directorGoodsEdit .el-col-12 {
      width: 50%;
    }
  }

  @media (max-width:1910px) and (min-width:1200px) {
    .directorGoodsEdit .el-col-12 {
      width: 66.66667%;
    }
  }

  @media (max-width:1199px) and (min-width:200px) {
    .directorGoodsEdit .el-col-12 {
      width: 80%;
    }
  }

  .edui1_imagescale img {
    max-width: 100%;
  }

  .directorGoodsEdit .nav_Main {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .directorGoodsEdit .nav_IconContent {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .directorGoodsEdit .nav_IconContent div>div {
    display: inline-block;
  }

  .directorGoodsEdit .w90 {
    width: 90px !important;
  }

  .directorGoodsEdit .w130 {
    width: 130px !important;
  }

  .courseInfo {
    width: 100%;
    height: 100%;
    border: 1px solid #EBEEF5;
    border-bottom: 0;
  }

  .courseHeader {
    width: 100%;
    height: 60px;
    display: flex;
    padding-right: 4px;
  }

  .courseHeader>div {
    width: 12%;
    height: 100%;
    text-align: center;
    line-height: 60px;
    border-right: 1px solid #EBEEF5;
    border-bottom: 1px solid #EBEEF5;
  }

  .courseHeader>div:last-child {
    border-right: 0;
  }

  .courseContent {
    width: 100%;
    max-height: 500px;
    overflow-y: scroll;
  }

  .courseList {
    width: 100%;
    min-height: 40px;
    display: flex;
  }

  .courseList:hover {
    cursor: move;
  }

  .courseList>div {
    width: 12%;
    height: 100%;
    text-align: center;
    line-height: 48px;
    min-height: 50px;
    border-right: 1px solid #EBEEF5;
    border-bottom: 1px solid #EBEEF5;
  }

  .courseList>div:last-child {
    display: flex;
    justify-content: center;
    align-items: center;
    border-right: 0;
    cursor: default;
  }

  .courseFileDiv {
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: default;
    display: flex;
  }

  .eduFileDiv {
    width: 25px;
    height: 25px;
    cursor: pointer;
  }

  .eduFileDiv img {
    width: 100%;
    height: 100%;
  }

  .videoDiv {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999999;
    background: #000;
  }

  .courseView {
    width: 25px;
    height: 25px;
    margin-left: 10px;
    cursor: pointer;
  }

  .courseView img {
    width: 100%;
    height: 100%;
  }

  .directorGoodsEdit .input-new-tag {
    width: 90px;
    margin-left: 10px;
    vertical-align: bottom;
  }

  .directorGoodsEdit .el-tag+.el-tag {
    margin-left: 10px;
  }

  .teacherHead {
    width: 30px;
    height: 30px;
    display: inline-block;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    top: 10px;
    margin-right: 3px;
  }

  .directorGoodsEdit .teacherHead img {
    width: 100%;
    height: 100%;
  }

  .directorGoodsEdit .el-checkbox {
    margin-bottom: 10px;
  }

  .Teacher_List {
    padding: 2px 5px;
    position: relative;
    margin-right: 5px;
    border: 1px solid #d1d1d1;
    border-radius: 4px;
    display: flex;
    align-items: center;
    line-height: normal;
    font-size: 12px;
    float: left;
  }

  .Teacher_tou {
    width: 25px;
    height: 25px;
    overflow: hidden;
    margin-right: 3px;
    border-radius: 50%;
    display: inline-block;
  }

  .edu_edlBtn {
    position: absolute;
    right: -8px;
    top: -14px;
    padding: 1px 1px !important;
  }

  .edu_fileName {
    text-align: left !important;
    line-height: normal !important;
  }

  .edu_fileName>div {
    text-overflow: -o-ellipsis-lastline;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
  }

</style>
