<style scoped>
  .row {
  display: flex;
}

.row-c {
  display: flex;
  align-items: center;
}

.column {
  display: flex;
  flex-direction: column;
}

.column-jac {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.column-ac {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.wrap {
  flex-wrap: wrap;
}

.justify-sb {
  justify-content: space-between;
}

.justify-c {
  justify-content: center;
}

.justify-e {
  justify-content: flex-end;
  align-items: flex-end;
}

.flex-g {
  flex-grow: 1;
}

.flex-s {
  flex-shrink: 0;
}

.align-c {
  align-items: center;
}

.cblack {
  color: black;
}

.cf {
  color: #ffffff;
}

.c9e {
  color: #9e9e9e;
}

.c20C997 {
  color: #20c997;
}

.c02C854 {
  color: #02c854;
}

.cff9800 {
  color: #ff9800;
}

.cF1416C {
  color: #f1416c;
}

.cF57A98 {
  color: #f57a98;
}

.c04C8C8 {
  color: #04c8c8;
}

.c059FF6 {
  color: #059ff6;
}

.c3FC4FF {
  color: #3fc4ff;
}

.fz10 {
  font-size: 10px;
}

.fz11 {
  font-size: 11px;
}

.fz12 {
  font-size: 12px;
}

.fz13 {
  font-size: 13px;
}

.fz14 {
  font-size: 14px;
}

.fz15 {
  font-size: 15px;
}

.fz16 {
  font-size: 16px;
}

.fz17 {
  font-size: 17px;
}

.fz18 {
  font-size: 18px;
}

.fbold {
  font-weight: bold;
}

.ml {
  margin-left: 10px;
}

.mr {
  margin-right: 10px;
}

.mt {
  margin-top: 10px;
}

.mt20 {
  margin-top: 20px;
}

.mb {
  margin-bottom: 5px;
}

.mb20 {
  margin-bottom: 20px;
}

.mx {
  margin-left: 10px;
  margin-right: 10px;
}

.mx5 {
  margin-left: 5px;
  margin-right: 5px;
}

.mb5 {
  margin-bottom: 5px;
}

.py {
  padding: 15px 0;
}

.py5 {
  padding: 5px 0;
}

.px5 {
  padding: 0 5px;
}

.px15 {
  padding: 0 15px;
}

.pa15 {
  padding: 15px;
}

.py20 {
  padding: 20px 0;
}

.pb5 {
  padding: 0 0 5px 0;
}

.pa {
  padding: 10px 20px;
}

.pa20 {
  padding: 20px;
}

.pt20 {
  padding: 20px 0;
}

.borderD {
  border-bottom: 1px dashed #dddddd;
}

.bgf {
  background: #ffffff;
}

.bgf5 {
  background: #f5f5f5;
}

.bgE8F5E9 {
  background: #e8f5e9;
}

.bgD9F3FF {
  background: #d9f3ff;
}

.bgFAEAED {
  background: #faeaed;
}

.bj {
  background: #ffffff;
}

.bjFFF3E0 {
  background: #FFF3E0;
}

.radius5 {
  border-radius: 5px;
}

.cursor-pointer {
  cursor: pointer;
}

.relative {
  position: relative;
}

.absolute {
  position: absolute;
}

.left0 {
  left: 0;
}

.right0 {
  right: 0;
}

.top0 {
  top: 0;
}

.bottom0 {
  bottom: 0;
}

.left20 {
  left: 20px;
}

.right20 {
  right: 20px;
}
.rightF20 {
  right: -20px;
}

.top20 {
  top: 20px;
}

.bottom20 {
  bottom: 20px;
}

.text-center {
  text-align: center;
}

.orderType {
  padding: 3px 15px;
  border-radius: 3px;
  background: #f57a98;
  margin-right: 15px;
}

.orderType.active {
  background: #4dd0e1;
}

.orderType.activeNo {
  background: #E95252;
}

.copy {
  display: inline-block;
  padding: 3px 15px;
  border-radius: 3px;
  margin-left: 20px;
}

.copy:hover {
  background: #f5f5f5;
}

.see-rec div {
  padding: 1px 5px;
  border-radius: 3px;
}

.see {
  border: 1px solid #04c8c8;
}

.seeLK {
  border: 1px solid #059ff6;
}

.see:hover {
  background-color: rgba(4, 200, 200, 0.1);
}

.rec {
  border: 1px solid #04c8c8;
  background-color: rgba(4, 200, 200, 1);
}

.rec:hover {
  border: 1px solid rgba(4, 200, 200, 0.9);
  background-color: rgba(4, 200, 200, 0.9);
}

.cancel:hover {
  background-color: #f3dce2;
}

.confirm:hover {
  background-color: #dcedc8;
}

.change:hover {
  background-color: #d7e9f3;
}

.change1:hover {
  background-color: #dcedc8;
}

.orderop {
  text-align: center;
}

.orderop div {
  display: flex;
  justify-content: center;
  padding: 0 10px;
  margin: 5px 0;
}

.RoomList div {
  border-bottom: 1px solid #e7e7e7;
}

.RoomList div:last-child {
  border: 0;
}

.el-table {
  font-size: 13px;
}

.shezhifrom {
  position: relative;
}

.shebox {
  position: absolute;
  top: 0;
  left: -100px;
  display: none;
}

.shezhifrom:hover .shebox {
  display: block;
}

.flexOne-form-bj h3 {
  font-size: 18px;
  color: black;
  padding: 0 0 20px 0;
  font-weight: 400;
}

.flexOne-type {
  display: flex;
  align-items: center;
  padding: 0 0 20px 0;
}

.flexOne-type b {
  font-size: 13px;
  width: 100px;
  flex-shrink: 0;
}

.flexOne-type div {
  display: flex;
}

.flexOne-description {
  padding: 15px 15px;
  border-radius: 5px;
  background: #E1F5FE;
  margin-bottom: 20px;
}

.flexOne-description b {
  font-size: 14px;
}

.flexOne-description p {
  font-size: 12px;
  color: #4C5759;
  padding: 10px 0 0 0;
}

.flexOne-infor-box b {
  font-size: 13px;
}

.infor-list {
  display: flex;
  flex-direction: column;
}

.list-title {
  padding: 20px 0;
  border-bottom: 1px dashed #eeeeee;
  color: #7E8299;
  font-size: 13px;
}

.list-title,
.list-centent {
  display: flex;
  flex-wrap: wrap;
  margin-top: 20px;
}

.infor-list li {
  width: 25%;
}

.list-centent li {
  width: 33.33%;
}

.list-centent.active li {
  width: 25%;
}
  .page_MyCustomer ._mc_addbox {
    height: 52px;
    width: 100%;
    margin-top: 20px;
  }

  .page_MyCustomer ._mc_addbox>li {
    float: left;
    width: 116px;
    font-size: 14px;
    height: 52px;
    color: #666;
    text-align: center;
    line-height: 52px;
    background: #E9E9E9;
    cursor: pointer;
  }

  .page_MyCustomer ._mc_addbox>li.active {
    background: #fff;
    color: #333;
  }

  .page_MyCustomer ._mc_addbox .divActive {
    margin: -3px auto;
    width: 26px;
    height: 3px;
    background: #E95252;
  }

  .page_MyCustomer ._mc_edit {
    overflow: auto;
    display: none;
    position: absolute;
    z-index: 50;
    bottom: 0;
    left: 0;
    border-top: 3px solid #38425d;
    background-color: #f9f9f9;
    padding: 10px;
    width: 100%;
    min-width: 1146px;
  }

  .page_MyCustomer .edHeight {
    display: block;
    height: 191px;
  }

  .page_MyCustomer ._mc_list {
    overflow-x: auto;
    background: #fff;
    padding-top: 20px;
    padding-left: 15px;
  }

  .page_MyCustomer ._scrollbar::-webkit-scrollbar {
    width: 4px;
    height: 8px;
  }

  .page_MyCustomer ._scrollbar::-webkit-scrollbar-thumb {
    border-radius: 4px;
    -webkit-box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.2);
    background: #c9c9c9;
  }

  .page_MyCustomer ._scrollbar::-webkit-scrollbar-track {
    -webkit-box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    background: #EDEDED;
  }

  .page_MyCustomer ._mc_edit ._tit {
    padding-left: 10px;
    border-left: 3px solid #E95252;
    font-size: 16px;
    font-family: 'PingFangSc-Fine';
    color: #000000
  }

  .page_MyCustomer ._mc_edit ._info_box ul._form li {
    float: left;
  }

  .page_MyCustomer ._check_list {
    padding-left: 120px;
    margin-bottom: 20px;
  }

  .page_MyCustomer ._check_box .el-form-item {
    margin-bottom: 0
  }

  .page_MyCustomer ._info_box .el-form-item__label {
    font-size: 12px;
    color: #666;
  }

  ._remark textarea {
    resize: none;
    width: 646px;
    height: 100px
  }

  .page_MyCustomer .avatar {
    width: 148px;
    height: 148px;
    display: block;
  }

  .page_MyCustomerSearch {
    width: 100%;
    min-height: auto;
    overflow: hidden;
    padding: 0 0 20px 0;
  }

  .page_MyCustomerSearch li {
    float: left;
    font-size: 12px;
    color: #666;
    margin: 20px 0 0px 0;
  }

  .page_MyCustomerSearch li>span {
    display: inline-block;
  }

  .page_MyCustomerSearch li span>em {
    display: inline-block;
    min-width: 60px;
    text-align: right;
    font-style: normal;
    margin: 0 12px 0 0;
  }

  .page_MyCustomerSearch li:last-child {
    float: right;
  }

  .VisaProductTable {
    width: 100%;
    font-size: 14px;
    color: #333;
    border-collapse: collapse;
  }

  .VisaProductTable tr th {
    background: #E6E6E6;
    height: 30px;
    font-size: 12px;
    text-align: left;
    text-indent: 5px !important;
  }

  .VisaProductTable tr {
    background: #fff;
    text-align: left;
    border: 1px solid #cccccc;
  }

  .VisaProductTable tr td {
    height: 60px;
    padding-left: 5px;
    border: 1px solid #cccccc;
    font-size: 14px;
    color: #333;
  }

  .VisaProductTable tr td>img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    float: left;
    margin-right: 5px;
  }

  .VisaProductTable tr td .tuanqian {
    vertical-align: middle;
    font-weight: 400;
    display: table-cell;
    text-align: center;
    width: 44px;
    font-size: 12px;
    height: 19px;
    color: #FFFFFF;
    background: #2AAEF2;
  }

  .VisaProductTable tr td .geqian {
    vertical-align: middle;
    font-weight: 400;
    display: table-cell;
    text-align: center;
    width: 44px;
    font-size: 12px;
    height: 19px;
    color: #FFFFFF;
    background: #FF9000;
  }

  .VisaProductTable tr td .totalPrice {
    color: #FF9000;
    font-weight: bold;
  }

  .page_MyCustomer ._edHeight {
    height: 340px;
  }

  .dateClass {
    width: 171px !important;
  }

  .surplusNum {
    color: #E95252 !important;
  }

  .peopleNum {
    color: rgba(51, 51, 51, 1);
    line-height: 24px;
  }

  .income {
    color: #47BF8C;
    font-weight: bold;
  }

  .VisaProductTable tr td .VO_createName {
    vertical-align: middle;
    display: table-cell;
    text-align: left;
    padding-left: 3px;
    height: 21px;
  }

  .groupTourOrderIcon button {
    width: 28px;
    height: 28px;
    border-radius: 4px;
  }

  .groupTourOrderIcon .el-button--primary {
    padding: 5px;
    margin: 0;
    font-size: 14px !important;
  }

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

  .visaproduct {
    height: 34px;
    background: rgba(212, 212, 212, 1);
    border: 1px solid rgba(210, 210, 210, 1);
    border-radius: 4px;
  }

  .visaproduct span {
    height: 34px;
    font-size: 14px;
    font-weight: bold;
    color: rgba(51, 51, 51, 1);
    display: table-cell !important;
    vertical-align: middle;
    text-align: center;
    padding: 0px 15px;
  }

  .VO-remarkTitle {
    display: inline-block;
    float: left;
    width: 36px;
    white-space: nowrap;
    font-size: 14px;
  }

  .VO-remarkCon {
    float: left;
    display: inline-block;
    width: 94%;
    font-size: 14px;
  }

  .VO-redType {
    color: red;
  }

  .groupTourOrder_tickets_red {
    color: #ff0000;
    text-decoration: underline;
  }

  .groupTourOrder_tickets_blue {
    color: #0000ff;
    text-decoration: underline;
  }

  .groupTourOrder_tickets_green {
    color: #008000;
    text-decoration: underline;
  }

  .groupTourOrder_tickets_black {
    color: #000000;
    text-decoration: underline;
  }

  .color_red {
    color: #e95252 !important;
  }

  .groupTourOrder_remarks {
    border-bottom: 1px solid #333333;
  }

</style>
<template>
  <div class="page_MyCustomer">
    <div style="display: flex;justify-content: space-between;align-items: center; margin-top: 20px;">
      <div style="display:inline-block;padding:0 6px;color: #333; text-align: center; line-height: 34px;font-size: 14px;  font-weight: bold; height:34px;background:rgba(212,212,212,1);border:1px solid rgba(210,210,210,1);border-radius:4px;">
        <span v-show="nameShow">{{visaProduct}}</span>
      </div>
      <div v-if="visaProduct.indexOf('日本')!=-1">
        <el-switch
          v-model="SwitchStatus"
          active-text="一键制单"
          inactive-text="一键完结"
          active-value="1"
          inactive-value="0" @change="handleClear">
        </el-switch>
      </div>
    </div>
    <div class="query-box" style="border:none">
      <ul>
        <li v-if="isShow==0">
          <span>
            <em>创建人</em>
            <el-select v-model='msg.EmId'>
              <el-option :label="$t('pub.unlimitedSel')" value="-1" key='-1'></el-option>
              <el-option v-for="item in EmployeeList" :label='item.EmName' :value='item.EmployeeId'
                :key='item.EmployeeId'>
              </el-option>
            </el-select>
          </span></li>
          <li>
            <span>
              <em>{{$t('objFill.orderid')}}</em>
              <el-input v-model='msg.OrderId'></el-input>
            </span></li>
        <li>
          <span>
            <em>订单状态</em>
            <el-select v-model='msg.VisaOrderStatus'>
              <el-option :label="$t('pub.unlimitedSel')" value="0" key='0'></el-option>
              <el-option label="正常" value="1" key='1'></el-option>
              <el-option label="取消" value="2" key='2'></el-option>
              <el-option label="待付款" value="3" key='3'></el-option>
            </el-select>
          </span></li>
          <li>
            <span>
              <em>完结状态</em>
              <el-select v-model='msg.IsFinish'>
                <el-option :label="$t('pub.unlimitedSel')" value="0" key='0'></el-option>
                <el-option label="已完结" value="1" key='1'></el-option>
                <el-option label="未完结" value="2" key='2'></el-option>
              </el-select>
            </span></li>
        <li><span><em>报入日期</em>
            <el-date-picker v-model='msg.StartTime' class='w135' value-format="yyyy-MM-dd" type="date"></el-date-picker>
            -
            <el-date-picker v-model='msg.EndTime' class='w135' value-format="yyyy-MM-dd" type="date"></el-date-picker>
          </span>
        </li>



        <li>
          <button class="hollowFixedBtn" @click="getList()">{{$t('pub.searchBtn')}}</button>
          <button class="hollowFixedBtn" @click="goUrlCb">查看成本</button>
          <el-button v-if="IsSupperOrderEdit" class="hollowFixedBtn"
          @click="SwitchStatus==0?setCompleted():setPrepareDocument()"
          :loading="CompletedLoading">{{SwitchStatus==0?'一键完结':'一键制单'}}</el-button>
        </li>
      </ul>
    </div>
    <div style="display: flex;justify-content: end;margin-bottom: 10px;">
      <p><span class="groupTourOrderByTuan_ico"><i style="background-color:#3FC4FF"></i><span>{{$t('fnc.yidadan')}}</span></span>
        <span class="groupTourOrderByTuan_ico"><i style="background-color:#F1416C"></i><span>{{$t('fnc.yhcnyshenhe')}}</span></span>
        <span class="groupTourOrderByTuan_ico"><i style="background-color:#ff9800"></i><span>{{$t('fnc.ytongguo')}}</span></span></p>
    </div>
    <div style="padding-bottom: 10px;">
      <span>应收总额:{{moneyFormat(PreferPrice)}}</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
      <span>实收:{{moneyFormat(IncomePrice)}}</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
      <span>优惠:{{moneyFormat(DiscountMoneyAll)}}</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
      <span>待收:<span
          :class="{color_red:(PreferPrice-IncomePrice-DiscountMoneyAll)!==0}">
          {{moneyFormat(PreferPrice-IncomePrice-DiscountMoneyAll)}}</span>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
      <span>成本:{{moneyFormat(CostMoney)}}</span>
      </div>
      <el-table v-loading='loading'
      ref="multipleTable"
      :data="dataList"
      tooltip-effect="dark"
      style="width: 100%"
      row-key="Id"
      @selection-change="handleSelectionChange"
     >
     <el-table-column
        type="selection"
        :selectable="selectable"
        :reserve-selection="true" v-if="IsSupperOrderEdit"/>
      </el-table-column>
      <el-table-column :label="IsSupperOrderEdit?'全选':''">
        <template slot-scope="scope">
          <table class="VisaProductTable" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <th width="11%">单号</th>
              <th width="6%">业务员</th>
              <th width="6%">公司</th>
              <th width="4%">{{$t('admin.admin_personNumber')}}</th>
              <th width="6%">出发日期</th>
              <th width="6%">报名日期</th>
              <th width="7%">应收总额</th>

              <th width="7%">实收</th>
              <th width="5%">退款</th>
              <th width="5%">平台税金</th>
              <th width="7%">成本</th>
              <th width="5%">优惠</th>
              <th width="5%">待收</th>
              <th width="5%">在途</th>
              <th width="5%">订单状态</th>
              <th width="5%">{{$t('admin.admin_status')}}</th>
              <th width="5%">完结状态</th>
              <th width="10%">{{$t('hotel.table_operat')}}</th>
            </tr>
            <tbody>
              <tr>
                <td>
                  <span class="fz16">{{scope.row.VisaTCNUM}}({{scope.row.Id}})</span>
                </td>
                <td><img v-if='!scope.row.CreatePhoto' src="../../assets/img/litheader.png" />
                  <img v-if='scope.row.CreatePhoto' :onerror="defaultImg" :src='scope.row.CreatePhoto' />
                  <span class="VO_createName">{{scope.row.CreateName}}</span></td>
                <td>{{scope.row.OutBranchName}}</td>
                <td class="fz16">
                  <span class="fz16">{{scope.row.PeopleNum}}</span>
                </td>
                <td>
                  <span class="fz16">{{scope.row.DepartDate}}</span>
                </td>
                <td>
                  <span class="fz16">{{scope.row.CreateTime}}</span>
                </td>
                <td>
                  <span class="totalPrice">¥{{moneyFormat(scope.row.TotalPrice)}}</span>
                </td>
                <td>
                  <span class="income">¥{{moneyFormat(scope.row.Income)}}</span>
                </td>
                <td>
                  <span>¥{{moneyFormat(scope.row.RefundMoney)}}</span>
                </td>
                <td>
                  <span>¥{{moneyFormat(scope.row.PlatformTax)}}</span>
                </td>
                <td>
                  <span>¥{{moneyFormat(scope.row.CostMoney)}}</span>
                </td>
                <td>
                  <span>¥{{moneyFormat(scope.row.DiscountMoney)}}</span>
                </td>
                <td>
                  <span>¥{{moneyFormat(scope.row.DueInMoney)}}</span>
                </td>
                <td>
                  <span>¥{{moneyFormat(scope.row.ZaiTu)}}</span>
                </td>
                <td>
                  <span v-if="scope.row.VisaOrderStatus==1">正常</span>
                  <span v-if="scope.row.VisaOrderStatus==2">取消</span>
                  <span v-if="scope.row.VisaOrderStatus==3">待付款</span>
                  <span class="fz12" v-if="scope.row.VisaOrderStatus==2">操作:{{scope.row.UpdateName}}</span>
                </td>
                <td>
                  <span>
                    <i v-if="scope.row.IsCommission==1" class="iconfont icon-yiqueren" style="color:#4BCA81;"></i>
                    <i v-else class="iconfont icon-yiquxiao" style="color:#E95252;"></i>
                    {{scope.row.IsCommission==1?"已提成":"未提成"}}
                  </span>
                </td>
                <td>
                  <span :class="{ cF1416C: scope.row.IsFinish == 0,c20C997: scope.row.IsFinish == 1 }">
                    <template v-if="scope.row.IsFinish==1">
                      {{scope.row.FinishName}} 完结/{{scope.row.FinishTime}}
                    </template>
                    <template v-else>
                      未完结
                    </template>
                  </span>
                </td>
                <td class="groupTourOrderIcon">

                  <!-- <el-tooltip effect="dark" content="签证详情" placement="top-start" v-if="scope.row.VisaPlanIdStr !=''">
                    <el-button type="primary" @click="goUrlVisaList(scope.row)" style='background:#00C6FF; border-color:#00C6FF'
                      icon="iconfont icon-sousuo"></el-button>
                  </el-tooltip> -->
                  <el-tooltip v-if="scope.row.Income<=0&&scope.row.VisaOrderStatus==1&&scope.row.UpdateStatus==1" class="item" effect="dark"
                    content="取消" placement="top-start">
                    <el-button type="primary" style='background:#E95252; border-color:#E95252;'
                      icon="iconfont icon-xingzhuangkaobei" @click='cancelOrder(scope.row)'></el-button>
                  </el-tooltip>

                  <!-- 订单拆分 -->
                  <!-- <el-tooltip v-if="scope.row.PeopleNum==scope.row.GuestList.length" class="item" effect="dark" content="订单拆分"
                    placement="top-start">
                    <el-button type="primary" style='background:#47BF8C; border-color:#47BF8C;' icon="el-icon-edit"
                      @click="goUrl2('OrderSplitting',scope.row.Id,'订单拆分')"></el-button>
                  </el-tooltip> -->
                  <!-- 修改金额 -->
                  <el-tooltip v-if="IsSupperOrderEdit&& scope.row.VisaType==1" class="item" effect="dark" content="修改金额"
                    placement="top-start">
                    <el-button type="primary" style='background:#E95252; border-color:#E95252;padding:5px' icon="el-icon-edit"
                      @click='Edit(scope.row,1)'></el-button>
                  </el-tooltip>
                  <!-- 完结 -->
                  <el-tooltip v-if="IsSupperOrderEdit&&scope.row.IsFinish!=1
                  &&scope.row.Income>0&&scope.row.DueInMoney==0" class="item" effect="dark" content="完结"
                    placement="top-start">
                    <el-button type="primary" style='background:#E95252; border-color:#E95252;padding:5px'
                     icon="el-icon-check"
                    @click='setCompleted(scope.row.Id,scope.row)' :loading="scope.row.loading"></el-button>
                  </el-tooltip>
                  <!-- 转移 -->
                  <el-tooltip v-if="IsSupperOrderEdit&&scope.row.IsCommission!=1" class="item" effect="dark" content="转移"
                    placement="top-start">
                    <el-button type="primary" style='background:#E95252; border-color:#E95252;padding:5px'
                     icon="el-icon-refresh"
                    @click='queryObj=scope.row,showTransferOrder=true'></el-button>
                  </el-tooltip>
                </td>
              </tr>

              <tr>
                <td colspan="18" class="RL_Order" style="height:40px;">
                  <span class="VO-remarkTitle">名单:</span>
                  <span class="VO-redType VO-remarkCon" v-if="scope.row.GuestList.length>0" style="cursor:pointer">
                    <span v-for="(childItem) in scope.row.GuestList" style="margin-right:10px;"
                      @click="goUrl2('VisapassengerList',scope.row.Id,'旅客名单')">{{childItem.userName}}</span>
                  </span>
                  <span class="VO-redType VO-remarkCon" v-else>
                    <span>暂无名单</span>
                  </span>
                </td>
              </tr>
              <tr>
                <td colspan="9" class="groupTourOrder_remarks" style="height: 40px;">
                  <div>
                    <div class="fz13">
                      <span v-if="scope.row.VisaFeeNum" class="mr cblack">签证人数:
                        <span :class="[scope.row.VisaFeeNum>scope.row.PeopleNum?'cF1416C':'c9e']">
                        {{scope.row.VisaFeeNum}}</span>
                      </span>
                      <span v-if="scope.row.PremiumNum" class="mr cblack">保险人数:
                        <span :class="[scope.row.PremiumNum>scope.row.PeopleNum?'cF1416C':'c9e']">
                        {{scope.row.PremiumNum}}</span>
                      </span>
                      <span v-if="scope.row.ExpressFeeNum" class="mr cblack">快递人数:
                        <span :class="[scope.row.ExpressFeeNum>scope.row.PeopleNum?'cF1416C':'c9e']">
                        {{scope.row.ExpressFeeNum}}</span>
                      </span>
                      <span v-if="scope.row.ServiceFeeNum" class="mr cblack">服务人数:
                        <span :class="[scope.row.ServiceFeeNum>scope.row.PeopleNum?'cF1416C':'c9e']">
                        {{scope.row.ServiceFeeNum}}</span>
                      </span>
                    </div>
                    <div>
                      <span class="VO-remarkTitle">备注:</span>
                      <span class="VO-redType VO-remarkCon">{{scope.row.Remark}}
                        <!--
                        <el-tooltip  class="item" effect="dark" :content="$t('salesModule.UpRemarks')"
                            placement="top-start">
                          <i class="el-icon-edit cursor-pointer c059FF6 mx" @click='Edit(scope.row)'></i>
                        </el-tooltip> -->
                      </span>

                    </div>
                  </div>
                </td>
                <td colspan="9" class="groupTourOrder_tickets2" style="height: 40px;">
                  <div>
                    <div class="row justify-sb wrap mr">
                      <div class="row relative" style="margin-top: 5px;">
                        <span style="white-space: nowrap;">收款单据:</span>
                        <span class="cursor-pointer radius5 mr mb px5" style="white-space: nowrap;"
                          :class="{'bgD9F3FF':x.Status==1,'bgFAEAED':x.Status==2,'bjFFF3E0':x.Status==3,
                          'c3FC4FF':x.Status==1,'cF1416C':x.Status==2,'cff9800':x.Status==3}" v-for="(x, i) in scope.row.FinanceList"
                            @click="goUrl2('FinancialDocumentsDetail',x.FrID,'财务单据')">{{ x.FrID }}</span>
                          <span v-if="scope.row.FinanceList&&scope.row.FinanceList.length == 0" class="c9e fz12 mr">
                            暂无
                        </span>
                        <div class="item right20 top0">
                          <el-tooltip v-if="scope.row.visaOrderStatus!=2" class="" effect="dark" content="制单"
                          placement="top">
                          <i class="el-icon-circle-plus cursor-pointer c059FF6"
                            @click="makeAdocument(scope.row, scope.$index, 1)"></i>
                        </el-tooltip>
                        </div>
                      </div>
                      <div class="row relative" style="margin-top: 5px;">
                        <span style="white-space: nowrap;">退款单据:</span>
                        <span class="cursor-pointer radius5 mr mb px5" style="white-space: nowrap;"
                          :class="{'bgD9F3FF':x.Status==1,'bgFAEAED':x.Status==2,'bjFFF3E0':x.Status==3,
                          'c3FC4FF':x.Status==1,'cF1416C':x.Status==2,'cff9800':x.Status==3}" v-for="(x, i) in scope.row.RefundFinanceList"
                            @click="goUrl2('FinancialDocumentsDetail',x.FrID,'财务单据')">{{ x.FrID }}</span>
                          <span v-if="scope.row.RefundFinanceList&&scope.row.RefundFinanceList.length == 0" class="c9e fz12 mr">
                            暂无
                        </span>
                        <div class="item right20 top0">
                          <el-tooltip v-if="scope.row.visaOrderStatus!=2" class="" effect="dark" content="制单"
                          placement="top">
                          <i class="el-icon-circle-plus cursor-pointer c059FF6"
                            @click="makeAdocument(scope.row, scope.$index, 2)"></i>
                        </el-tooltip>
                        </div>
                      </div>
                      <div class="row relative" style="margin-top: 5px;">
                        <span style="white-space: nowrap;">成本单据:</span>
                        <span class="cursor-pointer radius5 mr mb px5" style="white-space: nowrap;"
                          :class="{'bgD9F3FF':x.Status==1,'bgFAEAED':x.Status==2,'bjFFF3E0':x.Status==3,
                          'c3FC4FF':x.Status==1,'cF1416C':x.Status==2,'cff9800':x.Status==3}" v-for="(x, i) in scope.row.CostFinanceList"
                            @click="goUrl2('FinancialDocumentsDetail',x.FrID,'财务单据')">{{ x.FrID }} {{ x.Name?x.Name:'' }}</span>
                          <span v-if="scope.row.CostFinanceList&&scope.row.CostFinanceList.length == 0" class="c9e fz12 mr">
                            暂无
                        </span>
                        <div class="item right20 top0" v-if="scope.row.visaOrderStatus!=2">
                          <el-tooltip class="" effect="dark" content="制单"
                          placement="top">
                          <i class="el-icon-circle-plus cursor-pointer c059FF6"
                            @click="makeAdocument(scope.row, scope.$index, 3)"></i>
                        </el-tooltip>
                          <el-tooltip class="" effect="dark" content="冲抵" placement="top">
                            <i class="el-icon-circle-plus cursor-pointer c3FC4FF"
                              @click="isOffset(scope.row, scope.$index, 3)"></i>
                          </el-tooltip>
                        </div>
                      </div>

                      <!-- <span v-for="(item2,index2) in item.FinanceList" :key="index2"
                        style="margin-right:10px;cursor:pointer;">
                        <span v-if="item2.ColorState===1" class="groupTourOrder_tickets_blue"
                          @click="goUrl2('FinancialDocumentsDetail',item2.FrID,'财务单据')">{{item2.FrID}}</span>
                        <span v-else-if="item2.ColorState===2" class="groupTourOrder_tickets_green"
                          @click="goUrl2('FinancialDocumentsDetail',item2.FrID,'财务单据')">{{item2.FrID}}</span>
                        <span v-else-if="item2.ColorState===3" class="groupTourOrder_tickets_red"
                          @click="goUrl2('FinancialDocumentsDetail',item2.FrID,'财务单据')">{{item2.FrID}}</span>
                        <span v-else-if="item2.ColorState===4" class="groupTourOrder_tickets_black"
                          @click="goUrl2('FinancialDocumentsDetail',item2.FrID,'财务单据')">{{item2.FrID}}</span>
                      </span>
                      <span v-if="item.FinanceList.length===0" style="cursor: default;">{{$t('system.content_noData')}}</span> -->
                    </div>
                    <div>
                      <span style="white-space: nowrap;">{{$t('salesModule.Invoice')}}:</span>
                      <span v-for="(item2,index2) in scope.row.invoiceApplyList" :key="index2"
                        style="margin-right:10px;cursor:pointer;white-space: nowrap;">
                        <span v-if="item2.invoiceApplyState === 6" class="groupTourOrder_tickets_blue"
                          @click="goIisDetail(item2.id)">{{item2.id}}</span>
                        <span
                          v-else-if="item2.invoiceApplyState === 1 || item2.invoiceApplyState === 3 || item2.invoiceApplyState === 6"
                          class="groupTourOrder_tickets_green" @click="goIisDetail(item2.id)">{{item2.id}}</span>
                        <span v-else-if="item2.invoiceApplyState === 5 || item2.invoiceApplyState === 4 "
                          class="groupTourOrder_tickets_red" @click="goIisDetail(item2.id)">{{item2.id}}</span>
                        <span v-else-if="item2.invoiceApplyState === 2" class="groupTourOrder_tickets_black"
                          @click="goIisDetail(item2.id)">{{item2.id}}</span>
                      </span>
                      <span v-if="scope.row.InvoiceApplyList.length===0"
                        style="cursor: default;">{{$t('system.content_noData')}}</span>
                    </div>
                  </div>
                </td>
              </tr>
            </tbody>
          </table>
        </template>
      </el-table-column>
      </el-table>
    <el-pagination background @current-change="handleCurrentChange" :current-page.sync="currentPage" layout="total"
      :page-size="this.msg.pageSize" :total="total">
    </el-pagination>
    <el-dialog :title="title" :visible.sync="EditVisible" width="400px">
      <div v-if="title=='修改金额'">
        金额:<el-input style="width:300px" v-model="EditMsg.TotalPrice"></el-input>
      </div>
      <div v-if="title=='修改备注'">
        <el-input type="textarea" style="width:100%"  maxlength="500" v-model="EditMsg.Remark"></el-input>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button size="mini" @click="EditVisible = false">{{$t('pub.cancelBtn')}}</el-button>
        <el-button size="mini" type="danger" @click="PerferPrice">确 定</el-button>
      </span>
    </el-dialog>
    <offset :isShow="cdState" :obj="queryObj" @close="cdState=false"></offset>
    <TransferOrder v-if="showTransferOrder" :isShow="showTransferOrder" :obj="queryObj"
    @success="showTransferOrder=false,getList()"
    @close="showTransferOrder=false"></TransferOrder>
    <OneClickDocumentPreparation v-if="showDocumentPreparation" :visaProduct="visaProduct"
    :multipleSelection="multipleSelection"
    @close="showDocumentPreparation=false"
    @success="showDocumentPreparation=false,getList()"></OneClickDocumentPreparation>
  </div>
</template>
<script>
  import offset from '../public/offset.vue';
  import TransferOrder from './components/TransferOrder.vue';
  import OneClickDocumentPreparation from './components/OneClickDocumentPreparation.vue';
  export default {
    components: { offset,TransferOrder,OneClickDocumentPreparation },
    data() {
      return {
        ids: '',
        showDocumentPreparation: false,
        SwitchStatus:0,//0 完结 1制单
        title: '',
        showTransferOrder: false,
        queryObj:null,
        cdState: false,
        IsSupperOrderEdit: false, //获取总经理副总经理超级修改权限
        defaultImg: 'this.src="' + require("../../assets/img/litheader.png") + '"',
        nameShow: true,
        msg: {
          pageIndex: 1,
          pageSize: 999,
          StartTime: '',
          EndTime: '',
          Pid: '',
          EmId: '-1',
          VisaOrderStatus: "0",
          OrderId: '',
          IsFinish: '0'
        },
        dataList: [],
        EmployeeList: [],
        loading: true,
        visaProduct: "",
        total: 0,
        currentPage: 1,
        isShow: 0,
        PreferPrice: 0,
        IncomePrice: 0,
        CostMoney: 0,
        DiscountMoneyAll: 0,
        EmployeeId: 0,
        EditVisible: false,
        EditMsg: {
          TotalPrice: 0,
          PeopleNum: 0
        },
        cbId: 0,
        CompletedLoading: false,
        multipleSelection: [],
      }
    },
    methods: {
      handleClear(){
        this.$refs.multipleTable.clearSelection()
      },
      selectable(row, index){
        if(this.SwitchStatus==0){
          if (this.dataList[index].IsFinish!=1&&this.dataList[index].Income>0&&this.dataList[index].DueInMoney==0) {
              return true;
          } else {
            return false;
          }
        }else{
          if(this.dataList[index].FinanceList&&this.dataList[index].FinanceList.length > 0&&this.dataList[index].VisaOrderStatus==1){
            return true
          }else{
            return false
          }
        }
    },
    handleSelectionChange(val) {
      this.multipleSelection = JSON.parse(JSON.stringify(val))
    },
    // 一键制单
    setPrepareDocument(id){
      let ids = ''
      if(id>0){
        ids = id
      }
      if(this.multipleSelection&&this.multipleSelection.length>0){
        ids = this.multipleSelection.map(x=>{ return x.Id})
      }
      if(ids == ''||(ids&&ids.length==0)) {
        this.$message.error('请勾选需要制单的数据')
        return
      }
      this.showDocumentPreparation = true
    },
    // 一键完结
    setCompleted(id,row){
      let ids = ''
      let arrId
      if(id>0){
        ids = id
      }
      if(this.multipleSelection&&this.multipleSelection.length>0){
        ids = this.multipleSelection.map(x=>{ return x.Id})
      }
      if(ids == ''||(ids&&ids.length==0)) {
        this.$message.error('请勾选需要完结的数据')
        return
      }
      this.$confirm('是否确认完结?', this.$t('tips.tips'), {
        confirmButtonText: this.$t('pub.sureBtn'),
        cancelButtonText: this.$t('pub.cancelBtn'),
        type: 'warning'
      }).then(() => {
        if(id>0){
          row.loading = true
        }else{
          this.CompletedLoading = true
        }
        this.apipost('dmc_post_SetVisaOrderFinish', {
          VisaOrderIds: ids&&ids.length>0?ids.join(','):ids
        }, res => {
          if (res.data.resultCode == 1) {
            if(id>0){
              row.loading = false
            }else{
              this.CompletedLoading = false
            }
            for (let i = 0; i < this.dataList.length; i++) {
              this.$refs.multipleTable.toggleRowSelection(
                this.dataList[i],
                false
              );
            }
            this.multipleSelection = []
            this.$message.success(this.$t('tips.czchenggong'));
            this.getList()
          } else {
            if(id>0){
              row.loading = false
            }else{
              this.CompletedLoading = false
            }
            this.$message.error(res.data.message);
          }
        }, err => {})
      }).catch(() => {
        this.$message.info(`${this.$t('OrderList.orderStatus.cancel')}!`);
      });
    },

      isOffset(row, index, num){
        this.makeAdocument(row, index, num,'Offset')
      },
      // 制作单据
    makeAdocument(row, index, num, Offset) {
      if((num==2||num==3)&&row.Income+row.ZaiTu<=0){
        this.Info('请先制收款单据,再制成本或退款单据!')
        return
      }
      if(Offset){
        this.cdState = true
      }
      let type = 0
      if(num==3){
        type = 2
      }else{
        type = num
      }
      let TCIDARR = [];
      if (row.tcid) {
        TCIDARR.push(row.tcid)
      }

      let orderObj = {
        OrderID: row.Id,
        OrderSource: 10,
        Obj: {},
        SourceID: row.VisaId,
        TCIDList: TCIDARR,
        ReFinanceId2: num,
        MatchFrId:0
      }
      let query = {};
      query = {
          path: 'SaleOrderModule',
          companyID: row.OutBranchId,
          visaType: true,
          blank: 'y',
          orderObj: JSON.stringify(orderObj),
          Type: type,
      }
      if(num==2){
        query.searchTitle='签证退款'
      }
      else if(num ==3 && this.cdState == false){
        query.portTypeId= 2;
      }
      this.queryObj = query
      if(!Offset){
        this.$router.push({
          name: "ChoiceAddFinancialDocuments",
          query
        });
      }
    },

      goIisDetail: function (id) { // 跳转发票详情页面
        this.$router.push({
          name: 'invoicesManagerDetail',
          query: {
            id: id,
            noDetail: 1,
            InvoiceApplyType: 2,
            blank: "y",
          }
        });
      },
      PerferPrice() {
        if(this.title == '修改金额'){
          this.apipost('dmc_get_visa_SetVisaOrderPrice', this.EditMsg, res => {
            if (res.data.resultCode == 1) {
              this.EditVisible = false;
              this.Success(res.data.message)
              this.getList();
            } else {
              this.Error(res.data.message)
            }
          }, err => {})
        }else{
          this.apipost('dmc_get_visa_SetVisaOrder', this.EditMsg, res => {
            if (res.data.resultCode == 1) {
              this.EditVisible = false;
              this.Success(res.data.message)
              this.getList();
            } else {
              this.Error(res.data.message)
            }
          }, err => {})
        }

      },
      Edit(item,type) {
        if(type==1){
          this.title = '修改金额'
          this.EditMsg.OrderId = item.Id;
          this.EditMsg.TotalPrice = item.TotalPrice;
          this.EditMsg.PeopleNum = item.PeopleNum?item.PeopleNum:0
        }else{
          this.title = '修改备注'
          this.EditMsg = {
            Id: item.Id,
            Remark: item.Remark,
            VisaId: item.VisaId,
            Name: item.Name,
            PeopleNum: item.PeopleNum,
            EnterCountryTime: item.EnterCountryTime,
            LeaveCountryTime: item.LeaveCountryTime,
            DepartAirport: item.DepartAirport,
            GetBackAirport: item.GetBackAirport,
            EnterCountryPort: item.EnterCountryPort,
            LeaveCountryPort: item.LeaveCountryPort,
            EnterCountryFlight: item.EnterCountryFlight,
            LeaveCountryFlight: item.LeaveCountryFlight,
            VisaPlanId: item.VisaPlanId,
            DepartDate: item.DepartDate
          }
        }
        this.EditVisible = true;
      },
      goUrlCb(item) {
        this.$router.push({
          name: 'saleOrderSettlement',
          query: {
            "id": this.cbId,
            "seeDes": true,
            blank: 'y',
            tab: '签证详情'
          }
        })

      },
      goUrlVisaList(obj) {
        if (obj.VisaPlanIdStr == "" || obj.VisaPlanIdStr == null) {
          this.$router.push({
            name: 'visaList2',
            query: {
              "visaPlanId": obj.VisaPlanId,
              blank: 'y',
              tab: '签证详情'
            }
          })

        } else {
          this.$router.push({
            name: 'visaList2',
            query: {
              "VisaPlanIdStr": obj.VisaPlanIdStr,
              blank: 'y',
              tab: '签证详情'
            }
          })
        }

      },
      goUrl2(path, id, name) {
        this.$router.push({
          name: path,
          query: {
            id: id,
            blank: 'y',
            tab: name
          }
        });
      },
      cancelOrder(obj) {
        this.$confirm('是否取消?', this.$t('tips.tips'), {
          confirmButtonText: this.$t('pub.sureBtn'),
          cancelButtonText: this.$t('pub.cancelBtn'),
          type: 'warning'
        }).then(() => {
          this.apipost('dmc_post_visa_SetOrderCancel', {
            OrderId: obj.Id
          }, res => {
            if (res.data.resultCode == 1) {
              this.$message.success('取消成功!');
              this.getList()
            } else {
              this.$message.error(res.data.message);
            }
          }, err => {})
        }).catch(() => {
          this.$message.info(`${this.$t('OrderList.orderStatus.cancel')}!`);
        });
      },
      getList() { // 获取列表数据
        this.apipost('dmc_get_visa_GetVisaOrderList', this.msg, res => {
          this.PreferPrice = 0;
          this.IncomePrice = 0;
          this.CostMoney = 0;
          this.DiscountMoneyAll = 0;
          if (res.data.resultCode == 0) {
            this.loading = false;
            this.dataList = []
          } else {
            let arrList = function(list){
              list.forEach(x => {
                x.loading = false
              });
            }
            arrList(res.data.data.pageData)
            this.dataList = res.data.data.pageData;
            this.total = res.data.data.count;
            this.loading = false;
            this.dataList.forEach(x => {
              if (x.VisaOrderStatus != 2) {
                this.PreferPrice += x.TotalPrice;
                this.DiscountMoneyAll += x.DiscountMoney;
                this.IncomePrice += (x.Income + x.PlatformTax - x.RefundMoney);
                this.CostMoney += x.CostMoney;
              }
            })
          }
        }, err => {})
      },
      getEmployeeList() { // 获取人
        this.apipost('admin_get_GetEmployeeByUserDepartmentId', {}, res => {
          if (res.data.resultCode == 1) {
            this.EmployeeList = res.data.data;
          } else {
            this.$message.error(res.data.message)
          }
        }, err => {})
      },
      handleCurrentChange(val) {
        this.msg.pageIndex = val;
        this.getList();
      },
      // 获取总经理副总经理超级修改权限
      GetSupperOrderEditAuth() {
        var actionCode = this.$AuthCode.SupperOrderEdit;
        this.CheckUserAuth(actionCode, res => {
          if (res.data.resultCode == 1 && res.data.data == 1) {
            this.IsSupperOrderEdit = true;
          }
        });
      },
    },
    mounted() {
      let userInfo = this.getLocalStorage()
      let ActionMenuCode = userInfo.ActionMenuCode;
      // 判断是否销售
      if (ActionMenuCode.indexOf('isEditAmount') != -1) {
        this.IsSupperOrderEdit = true
      }
      this.GetSupperOrderEditAuth();
      let userinfo = this.getLocalStorage();
      this.EmployeeId = userinfo.EmployeeId;
      if (this.$route.query.name !== undefined) {
        this.visaProduct = this.$route.query.name + "(" + this.$route.query.sendDate + ")"
        this.nameShow = true
      } else {
        this.nameShow = false
      }
      if (this.$route.query.OrderId) {
        this.msg.OrderId = this.$route.query.OrderId;
      }
      this.msg.Pid = this.$route.query.id;
      this.cbId = this.$route.query.id;

      this.msg.EmId = this.$route.query.EmId === undefined ? '-1' : this.$route.query.EmId
      this.isShow = this.$route.query.isShow === undefined ? '0' : this.$route.query.isShow
      this.getList()
      this.getEmployeeList();
    }
  }

</script>