<template>
  <div>
    <div class="query-box" style="border-bottom: none;">
      <ul>
        <li>
          <span>
            <em>{{$t('fnc.khmingcheng')}}</em>
            <el-select v-model="msg.CustomerId" filterable :placeholder="$t('pub.pleaseSel')" clearable clear
              @clear="resetPageIndex()">
              <el-option :label="$t('pub.unlimitedSel')" :value='0'></el-option>
              <el-option v-for="item in queryCommonData.CustomerList" :label='item.CustomerName' :value='item.Id'
                :key='item.Id'>
              </el-option>
            </el-select>
          </span>
        </li>
        <li>
          <span>
            <em>团号</em>
            <el-input v-model='msg.TCNUM' maxlength="40" @keyup.native.enter="resetPageIndex()" clear
              @clear="resetPageIndex()" clearable></el-input>
          </span>
        </li>
        <li><span><em>{{$t('pub.date')}}</em>
            <el-date-picker v-model='msg.UseSTime' class='w135' value-format="yyyy-MM-dd" type="date"
              @change="resetPageIndex()" clearable @clear="resetPageIndex()"></el-date-picker>
            -
            <el-date-picker v-model='msg.UseETime' class='w135' value-format="yyyy-MM-dd" type="date"
              @change="resetPageIndex()" clearable @clear="resetPageIndex()"></el-date-picker>
          </span>
        </li>
        <li style="display:none;"><span><em>是否完结</em></span>
          <el-select v-model='msg.IsFinish'>
            <el-option label='全部' value='0' key='0'></el-option>
            <el-option label='是' value='1' key='1'></el-option>
          </el-select>
        </li>
        <li>
          <input type="button" class="normalBtn" :value="$t('pub.searchBtn')" @click="resetPageIndex()" />
        </li>
      </ul>
    </div>
    <!-- <div class="mt10 fz14 color333 busIconStyle">
      车辆状态&nbsp;&nbsp;&nbsp;确定:<span style="color:#4BCA81 ;">√</span>暂定:<span style="color: #ff6600;">O</span>未操作:<span
        style="color:#E95252 ;">X</span>
    </div> -->
    <div style="width: 100%;  overflow-x: auto;padding-bottom: 10px; margin-top: 10px; " class="ownScrollbarStyle"
      :style="{height: boxHeight + 'px'}">
      <OrderList :pagesTitle="Title" :OrderList="DataList" :loading="loading" @success="msg.pageIndex=1,GetList()">
      </OrderList>
    </div>
    <el-pagination background @current-change="handleCurrentChange" :current-page.sync="currentPage"
      layout="total,prev, pager, next, jumper" :page-size="msg.pageSize" :total="total"></el-pagination>
  </div>
</template>

<script>
  import OrderList from './BookAcar/components/JapanOrderDetailListNew';
  export default {
    data() {
      return {
        loading: false,
        currentPage: 1,
        total: 0,
        msg: {
          pageIndex: 1,
          pageSize: 10,
          CustomerId: 0,
          UseSTime: '',
          UseETime: '',
          IsFinish: "0",
          TCNUM: ""
        },
        Title: '印象车行-派车单统计',
        queryCommonData: {
          CustomerList: [],
        },
        DataList: [],
        boxHeight: 0,
      }
    },
    components: {
      OrderList
    },
    methods: {
      handleCurrentChange(val) {
        this.msg.pageIndex = val;
        this.getList();
      },
      resetPageIndex() {
        this.msg.pageIndex = 1;
        this.currentPage = 1;
        this.getList();
      },
      getList() {
        this.loading = true;
        this.apipost('JapanCar_get_GetJapanOrderCarDayList', this.msg, res => {
          this.loading = false;
          if (res.data.resultCode == 1) {
            this.total = res.data.data.count;
            this.DataList = res.data.data.pageData;
          } else {
            this.Error(res.data.message);
          }
        })
      },
      getCustomerList(CustomerKeyWord) {
        this.apipost('JapanCar_get_GetJapanCarCustomerList', {
          keyWord: CustomerKeyWord
        }, res => {
          this.loading = false;
          if (res.data.resultCode == 1) {
            this.queryCommonData.CustomerList = res.data.data;
          } else {
            this.Error(res.data.message);
          }
        })
      },
    },
    mounted() {
      let myDate = new Date();
      let nowDate =
        myDate.getFullYear() +
        "-" +
        parseInt(myDate.getMonth() + 1) +
        "-" +
        myDate.getDate();
      this.msg.UseSTime = nowDate;
      this.msg.UseETime = myDate.getFullYear() + "-" + parseInt(myDate.getMonth() + 2) + "-" + myDate.getDate();
      let width = window.innerWidth - 50;
      let height = window.innerHeight - 65 - 210;
      this.boxHeight = height;
      this.offsetwidth = width;
      this.getCustomerList();
      this.getList();
    },
  }

</script>
<style>
  .splitTrCss td {
    background: #eee !important;
  }

  .busIconStyle>span {
    margin-right: 20px;
    font-weight: bold;
  }

  .busStatisticsTalbe {
    background: #ccc;
  }

  .busStatisticsTalbe tr th {
    background: #E6E6E6;
    height: 40px;
    font-size: 12px;
    color: #333;
  }

  .busStatisticsTalbe tr {
    background: #fff;
    text-align: center;
    height: 40px;
  }

  .busStatisticsTalbe tr td {
    font-size: 12px;
  }

  .busStatisticsTalbe tr td .pDateStyle {
    border-bottom: 1px solid #ccc;
    min-height: 24px;
    line-height: 24px;
    margin-top: 0;
    box-sizing: content-box;
    padding: 0 10px;
  }

  .busStatisticsTalbe tr td .pDateStyle:last-child {
    border-bottom: none;
  }

  .busStatisticsTalbe tr td .link p:hover {
    text-decoration: underline;
    cursor: pointer;
  }

  .busStatisticsTalbe tr td .link span:hover {
    text-decoration: underline;
    cursor: pointer;
  }

  .busStatistics_tripDetails {
    padding: 0;
    box-shadow: 0px 1px 3px 0px #dedede;
    max-height: 400px;
    overflow-y: auto;
  }

  .busStatistics_tripDetails .popper__arrow::after {
    border-bottom-color: #ededed !important;
  }

  .busStatistics_tripDetails table {
    padding: 10px 0 0 20px;
    background-color: #ededed;
    border-collapse: collapse;
    border: 1px solid #d2d2d2;
    font-size: 12px;
  }

  .busStatistics_tripDetails table th {
    background-color: #ededed;
    padding: 5px;
  }

  .busStatistics_tripDetails table td {
    background-color: #ffffff;
    padding: 9px 15px;
    color: #333333;
    border: 1px solid #d2d2d2;
  }

  .busStatistics_tripDetails table td._d_name {
    background-color: #ededed;
  }

  .busStatistics_tripDetails table ._color_666 {
    color: #666666;
  }

  .busStatistics_tripDetails table tr._color_666 th {
    padding: 9px 15px;
  }

  .Bus_HotelPop {
    overflow: auto;
    max-height: 350px;
  }

</style>