<style>
  .webLogoDiv {
    width: 288px;
    height: 234px;
    border: 1px solid #ccc;
    cursor: pointer;
    position: relative;
  }

  .webLogoDiv .web_imgUrl {
    width: 100%;
    height: 100%;
  }

  .webLogoDiv .addIconDiv {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    background-color: transparent;
  }

  .webLogoDiv i {
    font-size: 50px;
    color: #d1d1d1;
    left: 42%;
    cursor: pointer;
    position: absolute;
    top: 42%;
  }

  .webLogoDiv .addIconDiv:hover {
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
  }

  .WebSite_Line {
    width: 100%;
    height: 1px;
    margin: 20px 0;
    border-bottom: 1px solid #eee;
  }

  .WebSite_font {
    margin: 0 0 20px 20px;
  }

  .WebSite_Box {
    position: relative;
    border-radius: 3px;
    background: #ffffff;
    border: 1px solid #ccc;
    margin-bottom: 20px;
    width: 100%;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
  }

  .WebSite_Header {
    font-size: 16px;
    padding: 10px;
    border-bottom: 1px solid #f4f4f4;
  }

  .WebSite_body {
    padding: 20px;
  }

  .todo-list {
    list-style: none;
  }

  .todo-list>li {
    position: relative;
    border: 1px solid #dcdcdc;
    border-radius: 2px;
    padding: 10px;
    background: #f4f4f4;
    margin-bottom: 2px;
  }

  .todo-list .handle {
    display: inline-block;
    cursor: move;
    margin: 0 5px;
  }

  .todo-list>li .WebSite_text {
    display: inline-block;
    margin-left: 5px;
    font-weight: bold;
    font-size: 14px;
  }

  .WebNav_link {
    color: #3c8dbc;
  }

  .WebSite_tools {
    position: absolute;
    top: 50%;
    right: 0;
    z-index: 2;
    margin-top: -20px;
    height: 40px;
    color: #666;
    display: block;
    line-height: 40px;
  }

  .WebSite_tools i {
    cursor: pointer;
  }

  .todo-list>li .WebSite_tools .del-btn {
    width: 40px;
    height: 40px;
    text-align: center;
    line-height: 40px;
    display: inline-block;
  }

  .Web_BtnDiv {
    position: absolute;
    right: 10px;
    top: 5px;
  }

</style>
<template>
  <div class="dianshangannualRatio" ref="barparent">
    <div class="query-box" style="border: 0;padding: 0;">
      <ul class="clearfix">
        <li class="hight_query">
            <span style="text-align: right;color: red;">导入Jalan 酒店基础数据,定时器会更新酒店的报价数据</span>
            <button class="normalBtn" @click="outerVisible=true">导入</button>
            
        </li>
    </ul>
    </div>
  <!--网站设定(网站设置)-->
  <div class="WebSiteConfig">
    <el-form label-width="130px">
      <el-tabs v-model="activeName" @tab-click="handleClick">
        <el-tab-pane label="基本設定" name="first">
          <el-row>
            <el-col :span="24">
              <el-card class="box-card">
                <div slot="header" class="clearfix">
                  <span>基本設定</span>
                </div>
                <el-col :span="12">
                  <el-form-item label="網站名稱" label-width="80px">
                    <el-input v-model="PostMsg.WebSiteName" maxlength="80"></el-input>
                  </el-form-item>
                  <el-form-item label="" label-width="80px">
                    <el-button type="primary" size="small" @click="saveData()">儲存修改</el-button>
                  </el-form-item>
                </el-col>
              </el-card>
            </el-col>
          </el-row>
        </el-tab-pane>
        <el-tab-pane label="前台顯示資訊" name="second">
          <el-row>
            <el-col :span="24">
              <el-card class="box-card">
                <div slot="header" class="clearfix">
                  <span>旅行社基本資料</span>
                </div>
                <el-row>
                <el-col :span="8">
                  <el-form-item label="旅行社名稱">
                    <el-input v-model="PostMsg.TAName" maxlength="80"></el-input>
                  </el-form-item>
                </el-col>
                <!-- <el-col :span="8">
                  <el-form-item label="代表人">
                    <el-input v-model="PostMsg.TABehalf" maxlength="20"></el-input>
                  </el-form-item>
                </el-col> -->
                <el-col :span="8">
                  <el-form-item label="旅行社业务经营许可证">
                    <el-input v-model="PostMsg.TAJiaoGuanCode" maxlength="30"></el-input>
                  </el-form-item>
                </el-col>
                </el-row>
                <!-- <el-col :span="8">
                  <el-form-item label="品保編號">
                    <el-input v-model="PostMsg.TAPingBaoCode" maxlength="30"></el-input>
                  </el-form-item>
                </el-col> -->
                <!-- <el-col :span="8">
                  <el-form-item label="統一編號">
                    <el-input v-model="PostMsg.TAUnifyCode" maxlength="30"></el-input>
                  </el-form-item>
                </el-col> -->
                <!-- <el-col :span="8">
                  <el-form-item label="旅行社類型">
                    <el-select v-model="PostMsg.TAType" style="width:100%">
                      <el-option v-for="item in travelAgencyType" :label="item.Name" :value="item.Id" :key="item.Id">
                      </el-option>
                    </el-select>
                  </el-form-item>
                </el-col> -->
                <el-col :span="8">
                  <el-form-item label="旅行社业务许可证">
                    <div>&nbsp;</div>
                    <div class="webLogoDiv" @click="commonType=4">
                      <el-upload :http-request="UploadImage" :multiple="true"
                        accept="image/jpeg,image/gif,image/png,image/bmp" :show-file-list="false" action="">
                        <img v-if="PostMsg.LicensePath" :src="PostMsg.LicensePath" class="web_imgUrl" alt="" />
                        <div class="addIconDiv">
                          <i class="web_addImg iconfont icon-img_haha"></i>
                        </div>
                      </el-upload>
                    </div>
                  </el-form-item>
                </el-col>
                <el-col :span="8">
                  <el-form-item label="企業LOGO">
                    <div>彩色(圖片尺寸:240x90)</div>
                    <div class="webLogoDiv" @click="commonType=1">
                      <el-upload :http-request="UploadImage" :multiple="true"
                        accept="image/jpeg,image/gif,image/png,image/bmp" :show-file-list="false" action="">
                        <img v-if="PostMsg.TALogo" :src="PostMsg.TALogo" class="web_imgUrl" alt="" />
                        <div class="addIconDiv">
                          <i class="web_addImg iconfont icon-img_haha"></i>
                        </div>
                      </el-upload>
                    </div>
                  </el-form-item>
                </el-col>
                <!-- <el-col :span="8">
                  <el-form-item label="企業LOGO">
                    <div>白色(圖片尺寸:240x90)</div>
                    <div class="webLogoDiv" @click="commonType=2" style="background-color:#ecf0f5">
                      <el-upload :http-request="UploadImage" :multiple="true"
                        accept="image/jpeg,image/gif,image/png,image/bmp" :show-file-list="false" action="">
                        <img v-if="PostMsg.TALogo2" :src="PostMsg.TALogo2" class="web_imgUrl" alt="" />
                        <div class="addIconDiv">
                          <i class="web_addImg iconfont icon-img_haha"></i>
                        </div>
                      </el-upload>
                    </div>
                  </el-form-item>
                </el-col> -->
                <el-col :span="8">
                  <el-form-item label="網站icon">
                    <div>(圖片尺寸:16x16)</div>
                    <div class="webLogoDiv" @click="commonType=3" style="width:100px;height:100px;">
                      <el-upload :http-request="UploadImage" :multiple="true"
                        accept="image/jpeg,image/gif,image/png,image/bmp" :show-file-list="false" action="">
                        <img v-if="PostMsg.TAIcon" :src="PostMsg.TAIcon" class="web_imgUrl" alt="" />
                        <div class="addIconDiv">
                          <i class="web_addImg iconfont icon-img_haha" style="left:25%;top:33%"></i>
                        </div>
                      </el-upload>
                    </div>
                  </el-form-item>
                </el-col>
                <el-col :span="24">
                  <div class="WebSite_Line"></div>
                  <div class="WebSite_font">總公司聯絡資訊</div>
                </el-col>
                <el-col :span="8">
                  <el-form-item label="電話">
                    <el-input v-model="PostMsg.TATel" maxlength="30"></el-input>
                  </el-form-item>
                </el-col>
                <!-- <el-col :span="8">
                  <el-form-item label="傳真">
                    <el-input v-model="PostMsg.TAFax" maxlength="30"></el-input>
                  </el-form-item>
                </el-col> -->
                <!-- <el-col :span="8">
                  <el-form-item label="聯絡人">
                    <el-input v-model="PostMsg.TALinkMan" maxlength="30"></el-input>
                  </el-form-item>
                </el-col> -->
                <el-col :span="8">
                  <el-form-item label="地址">
                    <el-input v-model="PostMsg.TAAddress" maxlength="200"></el-input>
                  </el-form-item>
                </el-col>
                <!-- <el-col :span="8">
                  <el-form-item label="服務信箱">
                    <el-input v-model="PostMsg.TAServiceMail" maxlength="50"></el-input>
                  </el-form-item>
                </el-col> -->
                <el-col :span="8">
                  <el-form-item label="服務時間">
                    <el-input v-model="PostMsg.TAServiceTime" maxlength="80"></el-input>
                  </el-form-item>
                </el-col>
                <el-col :span="24">
                  <div class="WebSite_Line"></div>
                  <div class="WebSite_font">網路社群</div>
                </el-col>
                <el-col :span="8">
                  <el-form-item label="Line行動條碼網址">
                    <el-input v-model="PostMsg.TALineUrl" maxlength="200"></el-input>
                  </el-form-item>
                </el-col>
                <el-col :span="8">
                  <el-form-item label="Facebook粉絲團網址" label-width="150px">
                    <el-input v-model="PostMsg.TAFaceBookUrl" maxlength="200"></el-input>
                  </el-form-item>
                </el-col>
                <el-col :span="24">
                  <div class="WebSite_Line"></div>
                  <div class="WebSite_font">其他顯示設定</div>
                </el-col>
                <el-col :span="8">
                  <el-form-item label="可售位顯示方式">
                    <el-select v-model="PostMsg.TASeatShowType" style="width:100%">
                      <el-option v-for="item in SaleSeatType" :label="item.Name" :value="item.Id" :key="item.Id">
                      </el-option>
                    </el-select>
                  </el-form-item>
                </el-col>
                <el-col :span="8">
                  <el-form-item label="不公開價格文字設定" label-width="140px">
                    <el-input v-model="PostMsg.TANoPublicPrice" maxlength="100"></el-input>
                  </el-form-item>
                </el-col>
                <el-col :span="8">
                  <el-form-item label="全站字體大小">
                    <el-select v-model="PostMsg.TAWordSize" style="width:100%">
                      <el-option v-for="item in TAWordSizeType" :label="item.Name" :value="item.Id" :key="item.Id">
                      </el-option>
                    </el-select>
                  </el-form-item>
                </el-col>
                <el-col :span="8">
                  <el-form-item label="备案号">
                    <el-input v-model="PostMsg.FilingNo" maxlength="100"></el-input>
                  </el-form-item>
                </el-col>
                <el-col :span="8">
                  <el-form-item label="是否启用邮件订阅">
                    <el-switch v-model="PostMsg.EnableEmail"></el-switch>
                  </el-form-item>
                </el-col>
                <el-col :span="8">
                  <el-form-item label="背景顏色">
                    <el-color-picker v-model="PostMsg.TABgColor"></el-color-picker>
                  </el-form-item>
                </el-col>
                <el-col :span="24">
                  <el-form-item label="訂購頁面價格標準內容(最多150字)">
                    <el-input type="textarea" v-model="PostMsg.TAOrderInfoDes" :rows="4"></el-input>
                  </el-form-item>
                </el-col>
                <el-col :span="24" style="margin-bottom:50px">
                  <el-form-item>
                    <el-button type="primary" size="small" @click="saveData()">儲存修改</el-button>
                  </el-form-item>
                </el-col>
              </el-card>
            </el-col>
          </el-row>
        </el-tab-pane>
        <el-tab-pane label="導航設定" name="third">
          <!-- <el-col :span="7" style="margin-right:40px;">
            <div class="WebSite_Box">
              <div class="WebSite_Header">
                網站選單設定
                <div class="Web_BtnDiv">
                  <el-button type="primary" size="small" @click="OpType=1,OperateDialog(-1)">新增選單</el-button>
                </div>
              </div>
              <div class="WebSite_body">
                <ul class="todo-list">
                  <li v-for="(headItem,headIndex) in PostMsg.HeaderNavList" :key="headIndex">
                    <span class="handle">
                      <i class="iconfont icon-diandiandian"></i>
                    </span>
                    <span class="WebSite_text">
                      <a class="WebNav_link" :href="headItem.NavUrl">{{headItem.NavTitle}}</a>
                    </span>
                    <div class="WebSite_tools">
                      <i class="iconfont icon-xiugai" @click="OpType=1,OperateDialog(headIndex)"></i>
                      <i class="iconfont icon-guanbi del-btn" @click="OpType=1,DeleteItem(headItem,headIndex)"></i>
                    </div>
                  </li>
                </ul>
              </div>
            </div>
          </el-col> -->
          <!-- <el-col :span="7" style="margin-right:40px;">
            <div class="WebSite_Box">
              <div class="WebSite_Header">
                刊尾選單設定
                <div class="Web_BtnDiv">
                  <el-button type="primary" size="small" @click="OpType=2,OperateDialog(-1)">新增選單</el-button>
                </div>
              </div>
              <div class="WebSite_body">
                <ul class="todo-list">
                  <li v-for="(footItem,footIndex) in PostMsg.FooterNavList" :key="footIndex">
                    <span class="handle">
                      <i class="iconfont icon-diandiandian"></i>
                    </span>
                    <span class="WebSite_text">
                      <a class="WebNav_link" :href="footItem.NavUrl">{{footItem.NavTitle}}</a>
                    </span>
                    <div class="WebSite_tools">
                      <i class="iconfont icon-xiugai" @click="OpType=2,OperateDialog(footIndex)"></i>
                      <i class="iconfont icon-guanbi del-btn" @click="OpType=2,DeleteItem(footItem,footIndex)"></i>
                    </div>
                  </li>
                </ul>
              </div>
            </div>
          </el-col>
          <el-col :span="7">
            <div class="WebSite_Box">
              <div class="WebSite_Header">
                <div>刊尾小圖設定</div>
                <div style="font-size:12px;">(圖片尺寸:40x40或60x40(前台顯示高度40px)</div>
                <div class="Web_BtnDiv">
                  <el-button type="primary" size="small" @click="OpType=3,OperateDialog(-1)">新增選單</el-button>
                </div>
              </div>
              <div class="WebSite_body">
                <ul class="todo-list">
                  <li v-for="(bottomItem,bottomIndex) in PostMsg.BottomNavList" :key="bottomIndex">
                    <span class="handle">
                      <i class="iconfont icon-diandiandian"></i>
                    </span>
                    <span class="WebSite_text">
                      <a class="WebNav_link" :href="bottomItem.NavUrl">{{bottomItem.NavTitle}}</a>
                    </span>
                    <div class="WebSite_tools">
                      <i class="iconfont icon-xiugai" @click="OpType=3,OperateDialog(bottomIndex)"></i>
                      <i class="iconfont icon-guanbi del-btn" @click="OpType=3,DeleteItem(bottomItem,bottomIndex)"></i>
                    </div>
                  </li>
                </ul>
              </div>
            </div>
          </el-col> -->
          <el-col :span="7" style="margin-right:40px;">
            <div class="WebSite_Box">
              <div class="WebSite_Header">
                <div>分公司資訊設定</div>
                <div class="Web_BtnDiv">
                  <el-button type="primary" size="small" @click="OpType=4,OperateDialog(-1)">新增選單</el-button>
                </div>
              </div>
              <div class="WebSite_body">
                <ul class="todo-list">
                  <li v-for="(branchItem,branchIndex) in PostMsg.WebSiteBranchConfigList" :key="branchIndex">
                    <span class="handle">
                      <i class="iconfont icon-diandiandian"></i>
                    </span>
                    <span class="WebSite_text">
                      <a class="WebNav_link">{{branchItem.BName}}</a>
                    </span>
                    <div class="WebSite_tools">
                      <i class="iconfont icon-xiugai" @click="OpType=4,OperateDialog(branchIndex)"></i>
                      <i class="iconfont icon-guanbi del-btn" @click="OpType=4,DeleteItem(branchItem,branchIndex)"></i>
                    </div>
                  </li>
                </ul>
              </div>
            </div>
          </el-col>
          <el-col :span="7">
            <div class="WebSite_Box">
              <div class="WebSite_Header">
                表單簽核職位設定
                <div class="Web_BtnDiv">
                  <el-button type="primary" size="small" @click="OpType=5,OperateDialog(-1)">新增選單</el-button>
                </div>
              </div>
              <div class="WebSite_body">
                <ul class="todo-list">
                  <li v-for="(positionItem,positionIndex) in PostMsg.PositionList" :key="positionIndex">
                    <span class="handle">
                      <i class="iconfont icon-diandiandian"></i>
                    </span>
                    <span class="WebSite_text">
                      <a class="WebNav_link">{{positionItem.Name}}</a>
                    </span>
                    <div class="WebSite_tools">
                      <i class="iconfont icon-xiugai" @click="OpType=5,OperateDialog(positionIndex)"></i>
                      <i class="iconfont icon-guanbi del-btn"
                        @click="OpType=5,DeleteItem(positionItem,positionIndex)"></i>
                    </div>
                  </li>
                </ul>
              </div>
            </div>
          </el-col>
          <el-col :span="24" style="text-align:right;padding-right:8%;margin-top:50px;">
            <el-button type="primary" size="small" @click="saveData()">儲存修改</el-button>
          </el-col>
        </el-tab-pane>
      </el-tabs>
    </el-form>
    <el-dialog :title="editTitle" :visible.sync="isShowDialog" width="500px">
      <el-form label-width="100px">
        <!-- 第一个 -->
        <template v-if="OpType==1">
          <el-form-item label="顯示文字">
            <el-input v-model="MenuObj.NavTitle" maxlength="50"></el-input>
          </el-form-item>
          <el-form-item label="連結">
            <el-input v-model="MenuObj.NavUrl" maxlength="50"></el-input>
          </el-form-item>
          <el-form-item label="連結">
            <el-select style="width:100%" v-model="MenuObj.IsNewOpen">
              <el-option label="是" :value="1" :key="1"></el-option>
              <el-option label="否" :value="0" :key="0"></el-option>
            </el-select>
          </el-form-item>
        </template>
        <!-- 第二个 -->
        <template v-if="OpType==2">
          <el-form-item label="顯示項目">
            <el-select style="width:100%" v-model="MenuObj.MenuId" @change="changeMenu(1)">
              <el-option label="请选择" :value="0" :key="0"></el-option>
              <el-option v-for="(homeItem,homeIndex) in HomePageList" :key="homeIndex+1" :label="homeItem.NavTitle"
                :value="homeItem.Id"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="開新分頁">
            <el-select style="width:100%" v-model="MenuObj.IsNewOpen">
              <el-option label="是" :value="1" :key="1"></el-option>
              <el-option label="否" :value="0" :key="0"></el-option>
            </el-select>
          </el-form-item>
        </template>
        <!-- 第三个 -->
        <template v-if="OpType==3">
          <el-form-item label="顯示項目">
            <el-select style="width:100%" v-model="MenuObj.MenuId" @change="changeMenu(2)">
              <el-option label="请选择" :value="0" :key="0"></el-option>
              <el-option v-for="(homeItem,homeIndex) in BottomTagPageList" :key="homeIndex+1" :label="homeItem.NavTitle"
                :value="homeItem.Id"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="連結">
            <el-input v-model="MenuObj.NavUrl" maxlength="50"></el-input>
          </el-form-item>
          <el-form-item label="預覽圖片">
            <img :src="MenuObj.Icon" alt="" style="height:80px;">
          </el-form-item>
        </template>
        <!-- 第四个 -->
        <template v-if="OpType==4">
          <el-form-item label="公司名稱">
            <el-input v-model="BranchObj.BName"></el-input>
          </el-form-item>
          <el-form-item label="電話">
            <el-input v-model="BranchObj.BTel"> </el-input>
          </el-form-item>
          <el-form-item label="地址">
            <el-input v-model="BranchObj.BAddress"></el-input>
          </el-form-item>
          <!-- <el-form-item label="傳真">
            <el-input v-model="BranchObj.BFax"></el-input>
          </el-form-item> -->
          <!-- <el-form-item label="旅行社類型">
            <el-select v-model="BranchObj.BType" style="width:100%">
              <el-option v-for="item in travelAgencyType" :label="item.Name" :value="item.Id" :key="item.Id">
              </el-option>
            </el-select>
          </el-form-item> -->
          <el-form-item label="協會證號">
            <el-input v-model="BranchObj.BXieHuiCode"></el-input>
          </el-form-item>
          <!-- <el-form-item label="統一編號">
            <el-input v-model="BranchObj.BUnifyCode"></el-input>
          </el-form-item> -->
        </template>
        <!-- 第五个 -->
        <template v-if="OpType==5">
          <el-form-item label="職位名稱">
            <el-input v-model="PositionObj.Name"></el-input>
          </el-form-item>
        </template>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="isShowDialog = false" size="small">取 消</el-button>
        <el-button type="danger" @click="saveSubData()" size="small">确 定</el-button>
      </span>
    </el-dialog>
  </div>
  <el-dialog custom-class='w700' title="导入" :visible.sync="outerVisible" center>
    <el-upload style="text-align: center;" drag class="upload-demo"
              :action="importFileUrl2"
              :on-success="handleAvatarSuccess"
              :before-upload="beforeAvatarUpload">
          <i class="el-icon-upload"></i>
          <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
          <!-- <div slot="tip" class="el-upload__tip">只能上传Excel文件</div> -->
        </el-upload>
    
  </el-dialog>
  </div>
</template>
<script>
  export default {
    data() {
      return {
        importFileUrl2: "",
        outerVisible: false,
        editTitle: "選單",
        //弹窗
        isShowDialog: false,
        //选项卡
        activeName: 'first',
        //上传图片类型
        commonType: 1,
        //旅行社类型
        travelAgencyType: [{
            Id: 1,
            Name: "甲種旅行社"
          },
          {
            Id: 2,
            Name: "乙種旅行社"
          },
          {
            Id: 3,
            Name: "綜合旅行社"
          },
        ],
        //可售位顯示方式
        SaleSeatType: [{
          Id: 1,
          Name: '顯示可售位 / 總位數'
        }, {
          Id: 2,
          Name: '只顯示可報名人數'
        }, {
          Id: 3,
          Name: '皆不顯示'
        }],
        //全站字體大小
        TAWordSizeType: [{
          Id: 1,
          Name: '小'
        }, {
          Id: 2,
          Name: '中'
        }, {
          Id: 3,
          Name: '大'
        }],
        PostMsg: {
          Id: 0, //编号
          WebSiteName: "", //网站名称
          TAName: "", //旅行社名称
          TABehalf: "", //代表人
          TAJiaoGuanCode: "", //交观证号
          TAPingBaoCode: "", //品保编号
          TAUnifyCode: "", //统一编号
          TAType: 1, //旅行社類型
          TALogo: "", //企业Logo(彩色)
          TALogo2: "", //企业Logo(黑白)
          TAIcon: "", //企业Icon
          TATel: "", //联系电话
          TAFax: "", //传真
          TALinkMan: "", //联系人
          TAAddress: "", //联系地址
          TAServiceMail: "", //服务邮箱
          TAServiceTime: "", //服务时间
          TALineUrl: "", //Line行動條碼網址
          TAFaceBookUrl: "", //FaceBook地址
          TASeatShowType: 1, //可售位顯示方式
          TANoPublicPrice: "", //不公開價格文字設定
          TAWordSize: 1, //全站字體大小
          EnableEmail: true,
          LicensePath: '',
          FilingNo: '',
          TABgColor: "", //背景颜色
          TAOrderInfoDes: "", //订购页面价格标准内容

          //網站選單設定
          HeaderNavList: [],
          //刊尾選單設定
          BottomNavList: [],
          //刊尾小圖設定
          FooterNavList: [],
          //分公司資訊設定
          WebSiteBranchConfigList: [],
          //表單簽核職位設定
          PositionList: []
        },
        //操作类型[1-網站選單設定,2-刊尾選單設定,3-刊尾小圖設定,4-分公司資訊設定,5-表單簽核職位設定]
        OpType: 0,
        OpIndex: 0, //选中的当前项
        //菜单对象
        MenuObj: {
          Id: 0, //编号
          Type: 0, //导航类型(1-顶部导航,2-底部导航,3-底部图标导航)
          Icon: "", //图标
          NavTitle: "", //导航名称
          NavUrl: "", //导航链接
          IsNewOpen: 0, //是否新开页面(1-是)
          MenuId: 0, //菜单编号
        },
        //分公司对象
        BranchObj: {
          Id: 0, //编号
          BName: "", //分公司名称
          BTel: "", //分公司电话
          BAddress: "", //分公司地址
          BFax: "", //分公司传真
          BType: 0, //分公司类型
          BXieHuiCode: "", //協會證號
          BUnifyCode: "", //統一編號
        },
        //职位对象
        PositionObj: {
          Id: 0, //编号
          Name: '', //职位名称
        },
        HomePageList: [], //首页菜单列表
        BottomTagPageList: [], //底部标签导航列表
      };
    },
    mounted() {
      let userInfo = this.getLocalStorage();
      this.importFileUrl2=this.domainManager().UploadFileUrl +
          "?cmd=dmc_post_LocalFileUpload&Type=16&fileType=1&fileLimit=10&EmployeeId="+userInfo.EmployeeId
          +'&RB_Group_id='+userInfo.RB_Group_id +'&KingdeeBId=0'
        ;
      this.getPageTypeList();
      this.getData();
    },
    methods: {
      //上传
      handleAvatarSuccess(res, file) {
            let that = this
          if (res.resultCode == 1) {
            this.Success(res.message);
            this.outerVisible = false;
            this.getData();
          }else{
            that.$confirm(res.message, '提示', {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning'
            }).then(() => {
                
            }).catch(() => {

            });
  
          }
        },
        beforeAvatarUpload(file) {
          return
        },
      //下拉选择
      changeMenu(type) {
        if (type == 1) {
          var chooseItem = this.HomePageList.find(member => {
            return member.Id === this.MenuObj.MenuId;
          });
          this.MenuObj.NavTitle = chooseItem.NavTitle;
          this.MenuObj.NavUrl = chooseItem.NavUrl;
        } else {
          var chooseBoottomItem = this.BottomTagPageList.find(member => {
            return member.Id === this.MenuObj.MenuId;
          });
          this.MenuObj.NavTitle = chooseBoottomItem.NavTitle;
          this.MenuObj.NavUrl = chooseBoottomItem.NavUrl;
          this.MenuObj.Icon = chooseBoottomItem.Icon;
        }
      },
      //获取导航下拉列表
      getPageTypeList() {
        this.apipost(
          "ws_get_GetNavConfigListByHome", {},
          res => {
            if (res.data.resultCode == 1) {
              var jsonData = res.data.data;
              if (jsonData && jsonData.length > 0) {
                jsonData.forEach(item => {
                  if (item.Type == 2) {
                    this.HomePageList = item.subList
                  }
                  if (item.Type == 3) {
                    this.BottomTagPageList = item.subList;
                  }
                });
              }
            } else {
              this.Error(res.data.message);
            }
          },
          err => {}
        );
      },
      //获取配置
      getData() {
        this.apipost(
          "ws_get_GetBasicConfig", {},
          res => {
            if (res.data.resultCode == 1) {
              var tempData = res.data.data;
              if (tempData) {
                if (tempData.Id) {
                  this.PostMsg.Id = tempData.Id;
                }
                if (tempData.WebSiteName) {
                  this.PostMsg.WebSiteName = tempData.WebSiteName;
                }
                if (tempData.TAName) {
                  this.PostMsg.TAName = tempData.TAName;
                }
                if (tempData.TABehalf) {
                  this.PostMsg.TABehalf = tempData.TABehalf;
                }
                if (tempData.TAJiaoGuanCode) {
                  this.PostMsg.TAJiaoGuanCode = tempData.TAJiaoGuanCode;
                }
                if (tempData.TAPingBaoCode) {
                  this.PostMsg.TAPingBaoCode = tempData.TAPingBaoCode;
                }
                if (tempData.TAUnifyCode) {
                  this.PostMsg.TAUnifyCode = tempData.TAUnifyCode;
                }
                if (tempData.TAType) {
                  this.PostMsg.TAType = tempData.TAType;
                }
                if (tempData.TALogo) {
                  this.PostMsg.TALogo = tempData.TALogo;
                }
                if (tempData.TALogo2) {
                  this.PostMsg.TALogo2 = tempData.TALogo2;
                }
                if (tempData.TAIcon) {
                  this.PostMsg.TAIcon = tempData.TAIcon;
                }
                if (tempData.TATel) {
                  this.PostMsg.TATel = tempData.TATel;
                }
                if (tempData.TAFax) {
                  this.PostMsg.TAFax = tempData.TAFax;
                }
                if (tempData.TALinkMan) {
                  this.PostMsg.TALinkMan = tempData.TALinkMan;
                }
                if (tempData.TAAddress) {
                  this.PostMsg.TAAddress = tempData.TAAddress;
                }
                if (tempData.TAServiceMail) {
                  this.PostMsg.TAServiceMail = tempData.TAServiceMail;
                }
                if (tempData.TAServiceTime) {
                  this.PostMsg.TAServiceTime = tempData.TAServiceTime;
                }
                if (tempData.TALineUrl) {
                  this.PostMsg.TALineUrl = tempData.TALineUrl;
                }
                if (tempData.TAFaceBookUrl) {
                  this.PostMsg.TAFaceBookUrl = tempData.TAFaceBookUrl;
                }
                if (tempData.TASeatShowType) {
                  this.PostMsg.TASeatShowType = tempData.TASeatShowType;
                }
                if (tempData.TANoPublicPrice) {
                  this.PostMsg.TANoPublicPrice = tempData.TANoPublicPrice;
                }
                if (tempData.TAWordSize) {
                  this.PostMsg.TAWordSize = tempData.TAWordSize;
                }
                if (tempData.TABgColor) {
                  this.PostMsg.TABgColor = tempData.TABgColor;
                }
                if (tempData.TAOrderInfoDes) {
                  this.PostMsg.TAOrderInfoDes = tempData.TAOrderInfoDes;
                }
                if (tempData.HeaderNavList) {
                  this.PostMsg.HeaderNavList = tempData.HeaderNavList;
                }
                if (tempData.BottomNavList) {
                  this.PostMsg.BottomNavList = tempData.BottomNavList;
                }
                if (tempData.FooterNavList) {
                  this.PostMsg.FooterNavList = tempData.FooterNavList;
                }
                if (tempData.WebSiteBranchConfigList) {
                  this.PostMsg.WebSiteBranchConfigList = tempData.WebSiteBranchConfigList;
                }
                if (tempData.PositionList) {
                  this.PostMsg.PositionList = tempData.PositionList;
                }
                this.PostMsg.EnableEmail = tempData.EnableEmail === 1;
                if (tempData.FilingNo) {
                  this.PostMsg.FilingNo = tempData.FilingNo;
                }
                if (tempData.LicensePath) {
                  this.PostMsg.LicensePath = tempData.LicensePath;
                }
              }
            } else {
              this.Error(res.data.message);
            }
          },
          err => {}
        );
      },
      //保存数据
      saveData() {
        let params = {...this.PostMsg}
        params.EnableEmail = params.EnableEmail ? 1 : 2
        this.apipost(
          "ws_post_SetBasicConfig", params,
          res => {
            if (res.data.resultCode == 1) {
              this.getData();
              this.Success(res.data.message);
            } else {
              this.Error(res.data.message);
            }
          },
          err => {}
        );
      },
      //选项卡切换
      handleClick(val) {

      },
      //上传图片
      UploadImage(file) {
        let newArr = [];
        newArr.push(file.file);
        let fileName = file.file.name;
        var path = "/Upload/WebSite/";
        this.UploadSelfFileT(path, newArr, x => {
          var str = x.data.FilePath;
          var imgUrl = this.domainManager().ViittoFileUrl + str;
          if (this.commonType == 1) {
            this.PostMsg.TALogo = imgUrl;
          } else if (this.commonType == 2) {
            this.PostMsg.TALogo2 = imgUrl;
          } else if(this.commonType == 3) {
            this.PostMsg.TAIcon = imgUrl;
          } else {
            this.PostMsg.LicensePath = imgUrl;
          }
        });
      },
      //操作项目
      OperateDialog(index) {
        this.clearMsg();
        this.isShowDialog = true;
        this.OpIndex = index;
        switch (this.OpType) {
          case 1:
            if (index != -1) {
              this.MenuObj = JSON.parse(JSON.stringify(this.PostMsg.HeaderNavList[index]));
            }
            break;
          case 2:
            if (index != -1) {
            
              this.MenuObj = JSON.parse(JSON.stringify(this.PostMsg.FooterNavList[index]));
            }
            break;
          case 3:
            if (index != -1) {
              this.MenuObj = JSON.parse(JSON.stringify(this.PostMsg.BottomNavList[index]));
            }
            break;
          case 4:
            if (index != -1) {
              this.BranchObj = JSON.parse(JSON.stringify(this.PostMsg.WebSiteBranchConfigList[index]));
            }
            break;
          case 5:
            if (index != -1) {
              this.PositionObj = JSON.parse(JSON.stringify(this.PostMsg.PositionList[index]));
            }
            break;
        }
      },
      //删除项目
      DeleteItem(item, index) {
        var that = this;
        that.Confirm("是否删除?", function () {
          var cmdStr = "";
          switch (that.OpType) {
            case 1:
              if (item.Id > 0) {
                cmdStr = "ws_post_RemoveNav";
              }
              that.PostMsg.HeaderNavList.splice(index, 1);
              break;
            case 2:
              if (item.Id > 0) {
                cmdStr = "ws_post_RemoveNav";
              }
              that.PostMsg.FooterNavList.splice(index, 1);
              break;
            case 3:
              if (item.Id > 0) {
                cmdStr = "ws_post_RemoveNav";
              }
              that.PostMsg.BottomNavList.splice(index, 1);
              break;
            case 4:
              if (item.Id > 0) {
                cmdStr = "ws_post_RemoveBranch";
              }
              that.PostMsg.WebSiteBranchConfigList.splice(index, 1);
              break;
            case 5:
              if (item.Id > 0) {
                cmdStr = "ws_post_RemovePosition";
              }
              that.PostMsg.PositionList.splice(index, 1);
              break;
          }
          if (item.Id > 0) {
            that.apipost(
              cmdStr, {
                Id: item.Id
              },
              res => {
                if (res.data.resultCode == 1) {
                  that.Success(res.data.message);
                  that.getData();
                } else {
                  that.Error(res.data.message);
                }
              },
              null
            );
          }
        });
      },
      //保存导航数据
      saveSubData() {
        switch (this.OpType) {
          case 1:
            if (this.OpIndex == -1) {
              this.PostMsg.HeaderNavList.push(JSON.parse(JSON.stringify(this.MenuObj)));
            } else {
              this.PostMsg.HeaderNavList[this.OpIndex] = JSON.parse(JSON.stringify(this.MenuObj));
            }
            break;
          case 2:
            if (this.OpIndex == -1) {
              this.PostMsg.FooterNavList.push(JSON.parse(JSON.stringify(this.MenuObj)));
            } else {
              this.PostMsg.FooterNavList[this.OpIndex] = JSON.parse(JSON.stringify(this.MenuObj));
            }
            break;
          case 3:
            if (this.OpIndex == -1) {
              this.PostMsg.BottomNavList.push(JSON.parse(JSON.stringify(this.MenuObj)));
            } else {
              this.PostMsg.BottomNavList[this.OpIndex] = JSON.parse(JSON.stringify(this.MenuObj));
            }
            break;
          case 4:
            if (this.OpIndex == -1) {
              this.PostMsg.WebSiteBranchConfigList.push(JSON.parse(JSON.stringify(this.BranchObj)));
            } else {
              this.PostMsg.WebSiteBranchConfigList[this.OpIndex] = JSON.parse(JSON.stringify(this.BranchObj));
            }
            break;
          case 5:
            if (this.OpIndex == -1) {
              this.PostMsg.PositionList.push(JSON.parse(JSON.stringify(this.PositionObj)));
            } else {
              this.PostMsg.PositionList[this.OpIndex] = JSON.parse(JSON.stringify(this.PositionObj));
            }
            break;
        }
        this.clearMsg();
        this.isShowDialog = false;
      },
      clearMsg() {
        this.MenuObj.Id = 0;
        this.MenuObj.Type = 0;
        this.MenuObj.Icon = "";
        this.MenuObj.NavTitle = "";
        this.MenuObj.NavUrl = "";
        this.MenuObj.IsNewOpen = 0;
        this.MenuObj.MenuId = 0;

        this.BranchObj.Id = 0;
        this.BranchObj.BName = "";
        this.BranchObj.BTel = "";
        this.BranchObj.BAddress = "";
        this.BranchObj.BFax = "";
        this.BranchObj.BType = 0;
        this.BranchObj.BXieHuiCode = "";
        this.BranchObj.BUnifyCode = "";

        this.PositionObj.Id = 0;
        this.PositionObj.Name = "";
      }
    }
  }

</script>