<style>
.investigationList td button{
  width: 30px;
  height: 30px;
  display: inline-block;
  color: white !important;
  border-radius: 50%;
  text-align: center;
  line-height: 30px;
  margin-right: 10px;
  cursor: pointer;
  outline: none;
  padding: 0;
}
.investigationList .el-button.is-circle{
  padding: 0;
}
</style>
<template>
  <div class="investigationList">
    <table class="singeRowTable" border="0" cellspacing="0" cellpadding="0" v-loading="loading">
      <tr>
        <th>{{$t('hotel.order_Number')}}</th>
        <th>{{$t('objFill.kerenname')}}</th>
        <th>{{$t('objFill.xiaosoumingchen')}}</th>
        <th>{{$t('fnc.khmingcheng')}}</th>
        <th>{{$t('objFill.fenshu')}}</th>
        <th>{{$t('system.table_operation')}}</th>
      </tr>
      <tr v-for="item in dataList">
         <td>{{OrderId}}</td>
         <td>{{item.GuestName}}</td>
         <td>{{item.EnterName}}</td>
         <td>{{item.CustomerName}}</td>
         <td>{{item.ScoreNum}}</td>
         <td>
            <el-tooltip class="item" effect="dark" :content="$t('objFill.tianxie')" placement="top">
              <el-button
                v-if="item.ID==0"
                type="primary"
                icon="iconfont icon-Edit"
                circle
                @click="chaKan(item)"
              ></el-button>
            </el-tooltip>
            <el-tooltip class="item" effect="dark" :content="$t('fnc.xiangqing')" placement="top">
              <el-button
                v-if="item.ID!==0"
                type="primary"
                icon="iconfont icon-sousuo"
                circle
                @click="openPage(item)"
              ></el-button>
            </el-tooltip>
         </td>
      </tr>
    </table>
    <div class="noDataNotice" v-if="dataList.length<1">
      <i class="iconfont icon-kong"></i>
      <p>{{$t("active.ld_noData")}}</p>
    </div>

    <a href="" id="blankLink" target="_blank" style="display:none">1</a>
  </div>
</template>
<script>

export default {

  data(){
    return{
      loading: false,
      dataList: [],
      DiaoChaShow: false,
      YouJiShow: false,
      showID: 0,
      dialogTitle: '',
      OrderId: '',
      TCIDL: ''
    }
  },mounted() {
    let TCID = this.$route.query.TCID,
      OrderID = this.$route.query.OrderId;
    this.OrderId = OrderID
    this.TCID = TCID
    this.getList(TCID, OrderID);
  },methods: {
    openPage: function (obj){
      let dom = document.querySelector("#blankLink");
      dom.href = "http://activity.oytour.com/html/invesDetails2.html" + '?ID=' + obj.ID + '&name=' + encodeURI(obj.GuestName) + '&MobilePhone=' + obj.CustomerPhone
      dom.click();
    },
    chaKan(item){
      let obj = JSON.stringify(item)
      this.$router.push({ name:'NewSurveyList',query:{"TCID": this.TCID, "OrderId": this.OrderId, obj: obj, blank: 'y'} })
    },
    getList: function (TCID, OrderID) {
      this.apipost('survey_post_GetTotalListAPP', {TCID: TCID, OrderID: OrderID}, res=>{
        if (res.data.resultCode === 1) {
          this.dataList = res.data.data.objAll;
        }
      }, null)
    }
  }
}
</script>
