<style>
  .hotelmanagement .hotelResource {
    width: 100%;
    min-height: 500px;
    margin-top: 20px;
  }

  .hotelmanagement .resourceListMan {
    width: 215px;
    height: 330px;
    background-color: #fff;
    border: 1px dashed #ededed;
    border-radius: 4px;
    margin: 0 20px 20px 0;
    font-size: 12px;
    color: #333333;
    float: left;
  }

  .hotelmanagement .resourceListMan:hover {
    box-shadow: 0px 0px 20px rgba(191, 191, 191, 1);
    transition: all linear 0.5s;
  }

  .hotelmanagement .reTopInfo {
    width: 100%;
    height: 123px;
    position: relative;
  }

  .hotelmanagement .reTopInfo img {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
  }

  .hotelmanagement .resTypeList {
    position: absolute;
    top: 10px;
    left: 10px;
  }

  .hotelmanagement .resTypeList span {
    display: inline-block;
    padding: 1px 5px;
    border-radius: 10px;
    color: #fff;
    margin-right: 10px;
  }

  .hotelmanagement .L1 {
    background-color: #e95252;
  }

  .hotelmanagement .L2 {
    background-color: #47bf8c;
  }

  .hotelmanagement .L3 {
    background-color: #2aaef2;
  }

  .hotelmanagement .L4 {
    background-color: #9cf;
  }

  .hotelmanagement .L5 {
    background-color: #00c6ff;
    margin-top: 5px;
  }

  .hotelmanagement .starSu {
    position: absolute;
    bottom: 8px;
    right: 10px;
  }

  .hotelmanagement .sushe {
    background-color: #ffc800;
    display: inline-block;
    padding: 1px 5px;
    border-radius: 10px;
    color: #fff;
  }

  .hotelmanagement .hotelTitle {
    margin: 10px 16px 0 16px;
    font-size: 14px;
    color: #333333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .hotelmanagement .brandList {
    margin: 10px 16px;
  }

  .hotelmanagement .brandList i {
    position: relative;
    top: 2px;
  }

  .hotelmanagement .brand {
    float: left;
    width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .hotelmanagement .dayNum {
    float: right;
  }

  .hotelmanagement .Address {
    margin: 10px 10px 0px 16px;
    height: 17px;
    overflow: hidden;
  }

  .hotelmanagement .Address i {
    color: #bbbbbb;
  }

  .hotelmanagement .iconfont {
    margin-right: 5px;
    position: relative;
    top: 0px;
  }

  .hotelmanagement .icon-star1 {
    color: #ffc800;
  }

  .hotelmanagement .star i {
    margin-right: 3px;
    font-size: 12px;
  }

  .hotelmanagement .honor {
    color: #ff793e;
  }

  .hotelmanagement .dieline {
    color: #2aaef2;
    font-size: 14px;
    top: 1px !important;
  }

  .hotelmanagement .AddressInner {
    float: right;
    width: 160px;
    height: 18px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
  }

  .hotelmanagement .btnList {
    margin-top: 12px;
    text-align: center;
  }

  .hotelmanagement .hotelBtnMan {
    width: 50px;
    height: 28px;
    border-radius: 14px;
    color: #fff;
    cursor: pointer;
    background-color: #f76f6f;
  }

  .hotelmanagement .w150 .el-input {
    width: 150px;
  }

  .hotelmanagement .RemainingInventory {
    position: absolute;
    width: 60px;
    height: 60px;
    background-color: rgba(0, 0, 0, 0.35);
    border-radius: 50%;
    margin: auto;
    top: 30px;
    color: #fff;
    font-size: 16px;
    text-align: center;
    font-weight: bold;
    line-height: 60px;
    left: 50%;
    margin-left: -30px;
  }

  .hotelmanagement .delScien {
    position: absolute;
    right: 10px;
    top: 10px;
    display: none;
  }

  .hotelmanagement .delScien:hover {
    color: #f76f6f;
    cursor: pointer;
  }

  .hotelmanagement .resourceListMan:hover .delScien {
    display: block;
  }

  .hotelmanagement .comCursorUrl {
    cursor: pointer;
  }

  .editInfo {
    padding: 2px !important;
  }

  .list-item {
    margin: 20px 0;
  }

  .file-title {
    font-size: 16px;
    font-weight: bold;
  }

  .submit-box {
    display: flex;
    justify-content: center;
  }

  .hotelmanagement .comCursorUrl {
    cursor: pointer;
  }

  .editInfo {
    padding: 2px !important;
  }

  .list-item {
    margin: 20px 0;
  }

  .file-title {
    font-size: 16px;
    font-weight: bold;
  }

  .submit-box {
    display: flex;
    justify-content: center;
  }

  .yellow {
    color: orange !important;
  }

  .green {
    color: green !important;
  }

</style>
<template>
  <div class="flexOne hotelmanagement">
    <div class="query-box">
      <ul>
        <li>
          <span class="hotel_name">
            <em>{{ $t("hotel.hotel_name") }}</em>
            <el-input maxlength="50" @keyup.native.enter="resetPageIndex(), selectResource()" v-model="msg.Name">
            </el-input>
          </span>
        </li>
        <li>
          <span>
            <em>{{ $t("system.quety_area") }}</em>
            <el-select v-model="msg.QCountry" clearable class="w150" filterable :disabled="isDisableCountry"
              @change="getProvinceList(msg.QCountry, 1)" :placeholder="$t('hotel.hotel_country')">
              <el-option v-for="item in countryList" :key="item.ID" :label="item.Name" :value="item.ID"></el-option>
            </el-select>
            <el-select v-model="msg.QProvince" class="w150" filterable @change="getProvinceList(msg.QProvince, 2)"
              :placeholder="$t('hotel.hotel_province')">
              <el-option v-for="item in provinceList" :key="item.ID" :label="item.Name" :value="item.ID"></el-option>
            </el-select>
            <el-select v-model="msg.QCity" class="w150" filterable @change="getProvinceList(msg.QCity, 3)"
              :placeholder="$t('hotel.hotel_city')">
              <el-option v-for="item in cityList" :key="item.ID" :label="item.Name" :value="item.ID"></el-option>
            </el-select>
            <el-select v-model="msg.QDistrict" class="w150" filterable :placeholder="$t('hotel.hotel_area')">
              <el-option v-for="item in district" :key="item.ID" :label="item.Name" :value="item.ID"></el-option>
            </el-select>
          </span>
        </li>
        <li>
          <span>
            <em>{{ $t("hotel.hotel_status") }}</em>
            <el-select v-model="msg.Status" class="w210" :placeholder="$t('pub.unlimitedSel')">
              <el-option :label="$t('pub.unlimitedSel')" value="-1"></el-option>
              <el-option v-for="item in status" :key="item.value" :label="item.label" :value="item.value"></el-option>
            </el-select>
          </span>
        </li>
        <li>
          <span>
            <em>{{ $t("ground.jiudianleixing") }}</em>
            <el-select v-model="msg.HotelType" class="w210" :placeholder="$t('pub.unlimitedSel')">
              <el-option :label="$t('pub.unlimitedSel')" value="-1"></el-option>
              <el-option v-for="item in HotelTypeList" :key="item.ID" :label="item.Name" :value="item.ID"></el-option>
            </el-select>
          </span>
        </li>
        <li>
          <span>
            <em>{{ $t("Operation.Op_price") }}</em>
            <el-select v-model="msg.HotelPirceType" class="w210" :placeholder="$t('pub.unlimitedSel')">
              <el-option :label="$t('pub.unlimitedSel')" value="-1"></el-option>
              <el-option v-for="item in HotelPirceTypeList" :key="item.ID" :label="item.Name" :value="item.ID">
              </el-option>
            </el-select>
          </span>
        </li>
        <li>
          <span><em>{{ $t("visa.v_czuser") }}</em></span>
          <el-select class="w150" v-model="msg.UpdateBy" filterable :placeholder="$t('pub.pleaseSel')">
            <el-option :label="$t('pub.unlimitedSel')" :value="0"> </el-option>
            <el-option v-for="item in EmployeeList" :label="item.EmName" :value="item.EmployeeId"
              :key="item.EmployeeId"></el-option>
          </el-select>
        </li>
        <li>
          <span><em>{{$t('objFill.baojiaxinxi')}}</em></span>
          <el-select class="w150" v-model="msg.IsUpFile" filterable :placeholder="$t('pub.pleaseSel')">
            <el-option :label="$t('pub.unlimitedSel')" :value="0"> </el-option>
            <el-option :label="$t('objFill.yishangchuan')" :value="1"> </el-option>
            <el-option :label="$t('objFill.weishangchuan')" :value="2"> </el-option>
          </el-select>
        </li>
        <li>
          <span>
            <em>{{$t('objFill.shangchuanshijian')}}</em>
            <el-date-picker class="w150" type="date" v-model="msg.QFileStartDate" value-format="yyyy-MM-dd"
              format="yyyy-MM-dd" placeholder>
            </el-date-picker>
            <el-date-picker class="w150" type="date" v-model="msg.QFileEndDate" value-format="yyyy-MM-dd"
              format="yyyy-MM-dd" placeholder>
            </el-date-picker>
          </span>
        </li>
        <li>
          <button class="hollowFixedBtn" type="button" @click="resetPageIndex(), selectResource()">
            {{ $t("pub.searchBtn") }}
          </button>
          <button class="normalBtn" type="button" @click="goSubInfo('HotelInfo')">
            {{ $t("pub.addBtn") }}
          </button>
        </li>
      </ul>
    </div>
    <div class="hotelResource clearfix" v-loading="loading">
      <div class="resourceListMan" v-for="(item, index) in tableData" :key="index">
        <div class="reTopInfo" :class="{ comCursorUrl: item.URL }" @click="OpenNewUrl(item.URL)">
          <img v-if="!item.PicPath" src="../../assets/img/bg_c3@3x.png" />
          <img v-else :src="compressImg(item.PicPath, 'filt', 213, '')" :onerror="defaultImg" />
          <div class="resTypeList">
            <span v-for="(items, index) in item.OpenPlatformList" :key="index" :class="{
                L1: items.ID == 1,
                L2: items.ID == 2,
                L3: items.ID == 3,
                L4: items.ID == 4,
                L5: items.ID == 5,
              }">{{ items.Name }}</span>
          </div>
          <div class="delScien" @click.stop="isdelete(item.ID)">
            <i class="iconfont icon-xingzhuang"></i>
          </div>
          <div class="starSu">
            <div class="star" v-if="item.Star < 8">
              <i v-for="(items, index) in item.starArr" class="iconfont icon-star1" :key="index"></i>
            </div>
            <span v-if="item.Star == 8" class="sushe">{{
              $t("restaurant.res_homeFacility")
            }}</span>
            <span v-if="item.Star == 9" class="sushe">{{
              $t("restaurant.res_SpringHotel")
            }}</span>
          </div>
        </div>
        <el-tooltip class="item" effect="dark" :content="item.Name" placement="top-start" popper-class="max-w250">
          <div class="hotelTitle" :class="['','red','yellow','green','',][item.PriceDayStage]">{{ item.Name }}</div>
        </el-tooltip>
        <el-tooltip class="item" effect="dark" :content="item.HotelRealName" placement="top-start"
          popper-class="max-w250">
          <div class="hotelTitle fz12">
            {{ $t("ground.zhenshimingcheng") }}: {{ item.HotelRealName }}
          </div>
        </el-tooltip>
        <div class="Address">
          <div v-show="item.Address">
            <i class="iconfont icon-img_dz"></i>
            <el-tooltip class="item" effect="dark" :content="item.Address" placement="top-start">
              <div class="AddressInner">{{ item.Address }}</div>
            </el-tooltip>
          </div>
        </div>
        <el-tooltip class="item" effect="dark" :content="item.UpdateName + '' + item.UpdateTimeStr"
          placement="top-start">
          <div
            style=" padding-left: 15px; padding-top: 5px;   overflow: hidden;   text-overflow: ellipsis;  white-space: nowrap; ">
            <i style="top: 2px" class="iconfont icon-renyuanguanli"></i>
            <span v-if="item.UpdateName && item.UpdateName != ''">{{
              item.UpdateName
            }}</span>
            {{ item.UpdateTimeStr }}
          </div>
        </el-tooltip>
        <div class="btnList">
          <template v-if="userInfo.RB_Group_id==2">
            <button @click="goSubInfo('HotelInfo', item.ID)" class="hotelBtnMan">
              {{ $t("pub.updateMsg") }}
            </button>
            <button @click="goSubInfo('HotelInfoDetails', item.ID)" class="hotelBtnMan">
              {{$t('fnc.xiangqing')}}
            </button>
            <button @click="CopyHotel(item.ID)" class="hotelBtnMan" v-if="userInfo.RB_Group_id == QjGroupId()">
              {{$t('objFill.copy')}}
            </button>
            <button @click="goproduct('HotelProductManage', item)" class="hotelBtnMan"
              v-if="userInfo.RB_Group_id != QjGroupId()">
              {{$t('hotel.hotel_roomType')}}
            </button>
            <br />
            <button v-if="(IsHotelPriceStock==1)" style="width: 80px; margin-top: 10px"
              @click="goUrl('HotelProductManage2', item)" class="hotelBtnMan">
              {{ $t("ground.baojiayukucun") }}
            </button>
            <button v-if="(IsUpload_Hotel_Price==1)" style="width: 80px; margin-top: 10px"
              @click="downloadFile(item)" class="hotelBtnMan">
              {{$t('objFill.shangchuanbj')}}
            </button>
            <template v-if="item.MaxFileDate&&item.MaxFileDate!=''">
              <br /><span style="color:red">{{$t('objFill.zuijinscsij')}}:{{item.MaxFileDate}}</span>
            </template>
          </template>
          <template v-else>
            <button @click="goSubInfo('HotelInfo', item.ID)" class="hotelBtnMan" style="width:80px">
              {{ $t("pub.updateMsg") }}
            </button>
            <button @click="CopyHotel(item.ID)" class="hotelBtnMan" v-if="userInfo.RB_Group_id == QjGroupId()">
              {{$t('objFill.copy')}}
            </button>
            <button style="width: 110px; margin-top: 10px" @click="goUrl('HotelProductManage2', item)"
              class="hotelBtnMan">
              {{ $t("ground.baojiayukucun") }}
            </button>
          </template>
        </div>
      </div>
    </div>
    <el-pagination background @current-change="handleCurrentChange" :current-page.sync="msg.currentPage"
      :page-size="this.msg.pageSize" layout="total,prev, pager, next, jumper" :total="msg.total"></el-pagination>
    <el-dialog :title="$t('objFill.shangchuanbjd')" :visible.sync="showUpload">
      <div>
        <el-input style="margin-bottom: 20px" v-model="uploadTitle" :placeholder="$t('objFill.qdtbaojiabt')"></el-input>
        <el-upload ref="my-upload" class="upload-demo" :file-list="DownloadMaterialsFileList" :http-request="uploadTest"
          :on-remove="handleRemove" :limit="1" action="">
          <el-button :disabled="DownloadMaterialsFileList.length ? true : false" size="small" type="primary">
            {{$t('tips.dianjishanhcuan')}}
          </el-button>
        </el-upload>
        <div class="submit-box">
          <el-button type="primary" style="margin: 20px auto" @click="submitFile">{{$t('fnc.tijiao')}}</el-button>
        </div>
      </div>
    </el-dialog>
    <el-dialog :title="$t('objFill.chakanbaojia')" :visible.sync="showFilelist">
      <button style="width: 80px; margin-top: 10px" @click="uploadFile()" class="hotelBtnMan">
        {{$t('objFill.shangchuanbj')}}
      </button>
      <el-table :data="DmcFileStoreList" stripe style="width: 100%">
        <el-table-column fixed prop="Title" :label="$t('objFill.biaoti')">
        </el-table-column>
        <el-table-column prop="CreateByName" :label="$t('active.cl_addPp')" width="150">
        </el-table-column>
        <el-table-column prop="CreateTime" :label="$t('visa.v_creatDate')">
        </el-table-column>
        <el-table-column prop="DateStr" :label="$t('system.table_operation')" width="120">
          <template slot-scope="scope">
            <el-popconfirm @confirm="deleteFile(scope.row, scope.$index)" :title="$t('objFill.quedinscm')">
              <el-button slot="reference" class="editInfo" type="danger">{{$t('system.table_delete')}}</el-button>
            </el-popconfirm>
            <a :href="scope.row.Url" type="download">
              <el-button class="editInfo" type="primary">{{$t('objFill.xz')}}</el-button>
            </a>
          </template>
        </el-table-column>
      </el-table>
      <el-pagination background @current-change="handlePageChange" :current-page.sync="page.currentPage"
        layout="total,prev, pager, next, jumper" :page-size="page.pageSize" :total="page.total">
      </el-pagination>
    </el-dialog>
  </div>
</template>
<script>
  import page from '../../utils/page';
  export default {
    data() {
      return {
        page: {
          currentPage: 1,
          pageSize: 10,
          total: 0
        },
        editInfo: {},
        uploadTitle: "",
        DownloadMaterialsFileList: [],
        showFilelist: false,
        showUpload: false,
        DmcFileStoreList: [],
        userInfo: {}, //登录用户信息
        IsHotelPriceStock: 0, //1-有获取酒店库存与报价添加修改权限
        countryList: "",
        provinceList: "",
        cityList: "",
        district: "",
        tableData: [],
        EmployeeList: [], //员工列表
        //酒店类型
        HotelTypeList: [],
        //酒店价格
        HotelPirceTypeList: [],
        status: [{
            value: "0",
            label: this.$t("pub.normalSel"),
          },
          {
            value: "1",
            label: this.$t("system.table_delete"),
          },
        ],
        defaultImg: 'this.src="' + require("../../assets/img/bg_z1@2x.png") + '"',
        loading: true,
        IsHotelPriceStock: 0, //1-有获取餐厅与报价添加修改权限
        IsUpload_Hotel_Price: 0, //1-可查看、上传酒店报价
        IsEditDmcSource: 0, //是否有新增修改权限
        msg: {
          pageIndex: 1,
          pageSize: 14,
          Name: "",
          QCountry: "",
          QProvince: "",
          QCity: "",
          Status: "0",
          HotelPirceType: "-1",
          HotelType: "-1",
          QDistrict: "",
          total: 0,
          currentPage: 1,
          ID: 0,
          UpdateBy: 0, //操作人
          ProductType: 1, //国际酒店
          QFileStartDate: "", //报价上传开始日期
          QFileEndDate: "", //报价上传结束日期
          IsUpFile: 0, //是否上传报价(1-已上传,2-未上传)
        },
        isDisableCountry: false, //是否禁用国家查询
      };
    },
    methods: {
      handlePageChange(val) {
        this.page.pageIndex = val;
        this.getFilelist();
      },
      uploadFile() {
        this.showUpload = true;
        this.uploadTitle = "";
        this.DownloadMaterialsFileList = []
      },
      downloadFile(hotel) {
        this.hotel = hotel;
        this.getFilelist();
        this.showFilelist = true;
      },
      handleRemove(file, fileList) {
        this.DownloadMaterialsFileList = fileList;
      },
      uploadTest(file) {
        let newArr = [];
        newArr.push(file.file);
        let path = "/Upload/DMC/Icon/";
        this.UploadSelfFileT(path, newArr, (x) => {
          let url = this.domainManager().ViittoFileUrl + x.data.FilePath;
          let Name = x.data.SourceFileName;
          this.DownloadMaterialsFileList.push({
            Url: url,
            Name: Name,
            name: Name,
          });
        });
      },
      submitFile() {
        if (!this.uploadTitle) {
          this.$message.error(this.$t('objFill.qdxbiaoti'));
          return;
        }
        if (!this.DownloadMaterialsFileList.length) {
          this.$message.error(this.$t('objFill.qscwenjian'));
          return;
        }
        this.apipost(
          "hotel_get_SetDMCFileStore", {
            Id: this.editInfo.Id || 0,
            Title: this.uploadTitle,
            ProcudtType: 1,
            ProductId: this.hotel.ID,
            FileInfoList: this.DownloadMaterialsFileList,
          },
          (res) => {
            this.showUpload = false;
            this.getFilelist();
          },
          (err) => {}
        );
      },
      deleteFile(file) {
        this.apipost(
          "hotel_get_RemoveDMCFileStore", {
            Id: file.Id,
          },
          (res) => {
            this.getFilelist();
          },
          (err) => {}
        );
      },
      editFile(file) {
        this.editInfo = file;
        this.showUpload = true;
        this.uploadTitle = file.Title;
        file.FileInfoList.forEach((item) => (item.name = item.Name));
        this.DownloadMaterialsFileList = file.FileInfoList;
      },
      getFilelist() {
        this.apipost(
          "hotel_get_GetDMCFileStoreList", {
            HotelId: this.hotel.ID,
            pageIndex: this.page.currentPage,
            pageSize: this.page.pageSize
          },
          (res) => {
            if (res.data.resultCode) {
              const {
                pageData,
                count
              } = res.data.data;
              pageData.forEach(item => item.Url = item.FileInfoList[0] ? item.FileInfoList[0].Url : '')
              this.DmcFileStoreList = pageData;
              this.page.total = count
            }
          },
          (err) => {}
        );
      },
      CopyHotel(Id) {
        var that = this;
        that.Confirm(that.$t('objFill.shifoufzcjd'), function () {
          var msg = {
            Id: Id,
          };
          that.apipost(
            "hotel_post_CopyHotelService",
            msg,
            (res) => {
              if (res.data.resultCode == 1) {
                that.Success(res.data.message);
                that.selectResource();
              } else {
                that.Error(res.data.message);
              }
            },
            null
          );
        });
      },
      handleCurrentChange(val) {
        this.msg.pageIndex = val;
        this.selectResource();
      },
      resetPageIndex() {
        this.msg.pageIndex = 1;
        this.msg.currentPage = 1;
      },
      isdelete(ID) {
        var that = this;
        that.Confirm(that.$t("tips.shifoushanchu"), function () {
          var msg = {
            hotelID: ID,
          };
          that.apipost(
            "hotel_post_Remove",
            msg,
            (res) => {
              if (res.data.resultCode == 1) {
                that.Success(res.data.message);
                that.selectResource();
              }
            },
            null
          );
        });
      },
      getProvinceList(ID, type) {
        //根据省份获取城市
        let msg = {
          Id: ID,
        };
        if (type == 1) {
          this.msg.QProvince = "";
          this.msg.QCity = "";
          this.msg.QDistrict = "";
        } else if (type == 2) {
          this.msg.QCity = "";
          this.msg.QDistrict = "";
        } else if (type == 3) {
          this.msg.QDistrict = "";
        }
        if (this.msg.Country !== "") {
          this.apipost(
            "dict_post_Destination_GetChildList",
            msg,
            (res) => {
              if (type == 1) {
                this.provinceList = res.data.data;
              } else if (type == 2) {
                this.cityList = res.data.data;
              } else if (type == 3) {
                this.district = res.data.data;
              }
            },
            (err) => {}
          );
        }
      },
      //获取国家
      getCountryList() {
        this.apipost(
          "dict_post_Destination_GetCountry", {},
          (res) => {
            this.countryList = res.data.data;
          },
          (err) => {}
        );
      },
      selectResource() {
        this.loading = true;
        if (this.msg.Status == "") {
          this.msg.Status = "-1";
        }
        this.apipost(
          "hotel_post_GetPageList",
          this.msg,
          (res) => {
            this.loading = false;
            if (res.data.resultCode == 1) {
              this.tableData = res.data.data.pageData;
              this.msg.total = res.data.data.count;
              let starArr;
              this.tableData.forEach((x) => {
                x.starArr = new Array(x.Star);
              });
            }
          },
          null
        );
      },
      //调整到产品列表
      goUrl(path, item) {
        this.$router.push({
          path: path,
          query: {
            id: item.ID,
            Country: item.Country,
            IsSelfBook: item.IsSelfBook,
            blank: "y",
            tab: this.$t('objFill.baojiaxiangqing'),
          },
        });
      },
      //调整到房型列表
      goproduct(path, item) {
        this.$router.push({
          path: path,
          query: {
            id: item.ID,
            Country: item.Country,
            IsSelfBook: item.IsSelfBook,
            blank: "y",
            tab: this.$t('objFill.fangxingbiao'),
          },
        });
      },
      goSubInfo(path, id) {
        this.$store.commit("pageConditionUpdate", this.msg);
        this.$router.push({
          path: path,
          query: {
            id: id,
            blank: "y",
          },
        });
      },
      //获取酒店类型列表
      GetHotelTypeList() {
        this.apipost(
          "dmc_post_Get_GetHotelType", {},
          (res) => {
            if (res.data.resultCode == 1) {
              this.HotelTypeList = res.data.data;
            }
          },
          (err) => {}
        );
      },
      GetHotelPirceTypeList() {
        this.apipost(
          "dmc_post_Get_GetHotelPriceType", {},
          (res) => {
            if (res.data.resultCode == 1) {
              this.HotelPirceTypeList = res.data.data;
            }
          },
          (err) => {}
        );
      },
 
      //根据当前员工所在部门获取该部门及子部门员工信息
      getEmployeeList() {
        let msg = {
          GroupId: this.userInfo.RB_Group_id,
          BranchId: "-1",
          DepartmentId: "-1",
          PostId: "-1",
          IsLeave: "0",
        };
        this.apipost(
          "admin_get_EmployeeGetList", {},
          (res) => {
            if (res.data.resultCode == 1) {
              this.EmployeeList = res.data.data;
            }
          },
          (err) => {}
        );
      },
      //获取酒店修改与报价添加修改权限
      GetHotelPirceStockAuth() {
        let isStock = "IsHotelPriceStock";
        let editDmcSource = "F_EditDmcSource";
        let isHotelPrice = "Upload_Hotel_Price"
        this.apipost('userauth_get_CheckUserAuthNewService', '', res => {
          if (res.data.resultCode == 1) {
            var tempData = res.data.data;
            if (tempData && tempData.length > 0) {
              if (tempData.includes(isStock)) {
                this.IsHotelPriceStock = 1;
              }
              if (tempData.includes(editDmcSource)) { //查看列表权限
                this.IsEditDmcSource = 1;
              }
              if (tempData.includes(isHotelPrice)) {
                this.IsUpload_Hotel_Price = 1;
              }
            }
          }

        });
      },
    },
    mounted() {
      this.userInfo = this.getLocalStorage();
      if (this.userInfo.EmployeeId == 2604 || this.userInfo.EmployeeId == 2739 || this.userInfo.EmployeeId == 2758 ||
        this.userInfo.EmployeeId == 2773 || this.userInfo.EmployeeId == 3038) {
        this.msg.QCountry = 651;
        this.isDisableCountry = true;
        this.getProvinceList(this.msg.QCountry, 1);
      }
      this.GetHotelPirceStockAuth();
    },
    created() {
      if (this.$route.query.hasOwnProperty("cache")) {
        if (this.$store.state.pageCondition != null) {
          this.msg = this.$store.state.pageCondition;
        }
      }
      if (this.$route.query.StatisticsSTime) {
        this.msg.StatisticsSTime = this.$route.query.StatisticsSTime;
      }
      if (this.$route.query.StatisticsETime) {
        this.msg.StatisticsETime = this.$route.query.StatisticsETime;
      }
      if (this.$route.query.type) {
        if (this.$route.query.type == 1) {
          this.msg.CreateBy = this.$route.query.EmployeeId;
        }
        if (this.$route.query.type == 2) {
          this.msg.UpdateBy = this.$route.query.EmployeeId;
        }
      }
      var id = this.$route.query.ID;
      if (id) {
        this.msg.ID = id;
      }
      this.getEmployeeList();
      this.getCountryList();
      this.GetHotelTypeList();
      this.GetHotelPirceTypeList();
      this.selectResource();
    },
  };

</script>