<template>
  <div class="flexOne">
    <div class="enrollTotalSearch">
      <ul>
        <li>
          <span>
            <em>{{ $t("scen.sc_cp") }}</em>
            <el-select class="w135" v-model="msg.OutBranchId" filterable :placeholder="$t('pub.pleaseSel')">
              <el-option :label="$t('pub.unlimitedSel')" :value="-1"></el-option>
              <el-option v-for="item in companyList" :label="item.BName" :value="item.Id" :key="item.Id"></el-option>
            </el-select>
          </span>
        </li>
        <li>
          <span>
            <em>{{ $t("advmanager.v_line") }}</em>
            <el-select class="w135" v-model="msg.LineId" filterable :placeholder="$t('pub.pleaseSel')">
              <el-option :label="$t('pub.unlimitedSel')" :value="-1"></el-option>
              <el-option v-for="item in LineList" :label="item.LineName" :value="item.LineID" :key="item.LineID">
              </el-option>
            </el-select>
          </span>
        </li>
        <li>
          <span>
            <em>{{ $t("Operation.Op_baomingCompany") }}</em>
            <el-select class="w135" v-model="msg.BranchId" filterable :placeholder="$t('pub.pleaseSel')" @change="
                (getDepartmentMsg.RB_Branch_Id = msg.BranchId),
                  (msg.RB_Department_Id = ''),
                  (msg.CreateBy = ''),
                  getDepartment()
              ">
              <el-option :label="$t('pub.unlimitedSel')" :value="-1"></el-option>
              <el-option v-for="item in companyList" :label="item.BName" :value="item.Id" :key="item.Id"></el-option>
            </el-select>
          </span>
        </li>
        <li>
          <span>
            <em>{{ $t("fnc.bmxuanze") }}</em>
            <el-select class="w135" filterable v-model="msg.RB_Department_Id" @change="
                (employeeMsg.DepartmentId = msg.RB_Department_Id),
                  getEmployee(),
                  (msg.CreateBy = '')
              ">
              <el-option :value="0" :label="$t('pub.unlimitedSel')"></el-option>
              <el-option v-for="item in DepartmentList" :label="item.DepartmentName" :value="item.DepartmentID"
                :key="item.DepartmentID">
              </el-option>
            </el-select>
          </span>
        </li>
        <li>
          <span>
            <em>{{ $t("Operation.Op_peopleChoice") }}</em>
          </span>
          <el-select class="w135" v-model="msg.CreateBy" filterable :placeholder="$t('pub.pleaseSel')">
            <el-option :label="$t('pub.unlimitedSel')" value="-1"></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("hotel.order_Number") }}</em>
          </span>
          <el-input class="w135" v-model="msg.tempOrderId" @keyup.native="checkInteger(msg, 'tempOrderId')"
            maxlength="10"></el-input>
        </li>
        <li>
          <span>
            <em>{{ $t("hotel.hotel_OrderStates") }}</em>
          </span>
          <el-select class="w135" v-model="msg.OrderState" filterable :placeholder="$t('pub.pleaseSel')">
            <el-option :label="$t('pub.unlimitedSel')" value="-1"></el-option>
            <el-option v-for="item in ddztList" :label="item.Name" :value="item.Id" :key="item.Id"></el-option>
          </el-select>
        </li>
        <li>
          <span><em>{{ $t("fnc.bmriqi") }}</em>
            <el-date-picker v-model="msg.CStartDate" @change="dataDui()" class="w135" value-format="yyyy-MM-dd"
              type="date"></el-date-picker>
            -
            <el-date-picker v-model="msg.CEndDate" @change="dataDui()" class="w135" value-format="yyyy-MM-dd"
              type="date"></el-date-picker>
          </span>
        </li>
        <li>
          <span><em>{{ $t("scen.sc_ftTime") }}</em>
            <el-date-picker v-model="msg.QStartDate" class="w135" value-format="yyyy-MM-dd" type="date">
            </el-date-picker>
            -
            <el-date-picker v-model="msg.QEndDate" class="w135" value-format="yyyy-MM-dd" type="date"></el-date-picker>
          </span>
        </li>
        <li>
          <input type="button" class="hollowFixedBtn" :value="$t('pub.searchBtn')" @click="
              resetPageIndex();
              getList();
            " />
        </li>
      </ul>
    </div>
    <!-- 统计版块 -->
    <div class="groupTourOrder_count">
      <el-row :gutter="20">
        <el-col :span="5" class="groupTourOrder_count_col">
          <div class="groupTourOrder_count_item">
            <div>
              <i class="iconfont icon-qian groupTourOrder_count_green"></i>
              <span>{{ $t("Operation.Op_salesTotal") }}</span>
            </div>
            <p>
              <span>{{ $t("Operation.Op_yingPay") }}:{{
                  countData.PreferPrice !=null ?countData.PreferPrice:'0'
                }};</span>
              <span>{{ $t("Operation.Op_yiShou") }}:{{ countData.Income!=null ?countData.Income:'0' }};</span>
              <span :class="{
                  color_red_order:
                    countData.DueinMoney !== countData.PreferPrice,
                }">{{ $t("Operation.Op_weiShou") }}:{{
                  countData.DueinMoney !=null ?countData.DueinMoney:'0'
                }};</span>
              <span>应收小费:
                {{countData.PreferTipAmount}}
              </span>
              <span>实收小费:
                {{countData.CompensationMoney}}
              </span>
              <span>{{ $t("fnc.ztjine") }}:{{ countData.ZaiTu!=null ?countData.ZaiTu:'0' }};</span>
            </p>
          </div>
        </el-col>
        <el-col :span="5" class="groupTourOrder_count_col">
          <div class="groupTourOrder_count_item">
            <div class="groupTourOrder_count_blue">
              <i class="iconfont icon-baomingrenshu"></i>
              <span>{{ $t("fnc.zcbmrenshu") }}</span>
              <span>{{ countData.NormalGuestNum !=null ? countData.NormalGuestNum:'0' }}</span>
            </div>
            <p>
              <span>{{ $t("Airticket.Air_EconomyClass") }}:{{
                  countData.NormalYSeatNum !=null?countData.NormalYSeatNum:'0'
                }};</span>
              <span>{{ $t("Airticket.Air_businessClass") }}:{{
                  countData.NormalESeatNum !=null ?countData.NormalESeatNum:'0'
                }};</span>
              <span>{{ $t("Airticket.Air_firstClass") }}:{{
                  countData.NormalFSeatNum!=null ? countData.NormalFSeatNum:'0'
                }};</span>
            </p>
            <div class="groupTourOrder_count_blue">
              <i class="iconfont icon-baomingrenshu"></i>
              <span>{{ $t("salesModule.AirNum") }}</span>
            </div>
            <p>
              <span class="color_red_order">{{ $t("op.Zong") }}: {{ countData.YSeat!=null ? countData.YSeat:'0' }}({{
                  $t("Airticket.Air_EconomyClass")
                }})+{{ countData.CSeat !=null? countData.CSeat:'0' }}({{
                  $t("Airticket.Air_businessClass")
                }})+{{ countData.FSeat!=null?countData.FSeat:'0' }}({{ $t("Airticket.Air_firstClass") }})
                ;</span>
              <span class="color_red_order">{{ $t("op.Sheng") }}:
                {{ countData.YSeat - countData.SurplusYSeat }}({{
                  $t("Airticket.Air_EconomyClass")
                }})+{{ countData.CSeat - countData.SurplusCSeat }}({{
                  $t("Airticket.Air_businessClass")
                }})+{{ countData.FSeat - countData.SurplusFSeat }}({{
                  $t("Airticket.Air_firstClass")
                }}) ;</span>
            </p>
          </div>
        </el-col>
        <el-col :span="5" class="groupTourOrder_count_col">
          <div class="groupTourOrder_count_item">
            <div class="groupTourOrder_count_yellow">
              <i class="iconfont icon-baomingrenshu"></i>
              <span>{{ $t("fnc.qxrenshu") }}</span>
              <span>{{ countData.CancelGuestNum !=null ?countData.CancelGuestNum:'0' }}</span>
            </div>
            <p>
              <span>{{ $t("Airticket.Air_EconomyClass") }}:{{
                  countData.CancelYSeatNum !=null ?countData.CancelYSeatNum:'0'
                }};</span>
              <span>{{ $t("Airticket.Air_businessClass") }}:{{
                  countData.CancelESeatNum !=null ?countData.CancelESeatNum:'0'
                }};</span>
              <span>{{ $t("Airticket.Air_firstClass") }}:{{
                  countData.CancelFSeatNum!=null?countData.CancelFSeatNum:'0'
                }};</span>
            </p>
          </div>
        </el-col>
        <el-col :span="4" class="groupTourOrder_count_col">
          <div class="groupTourOrder_count_item">
            <div>
              <i class="iconfont icon-tongji1 groupTourOrder_count_gray"></i>
              <span>{{ $t("fnc.qtxtongji") }}</span>
            </div>
            <p>
              <span>{{ $t("fnc.nbbaoming") }}:{{ countData.InteriorNum !=null ? countData.InteriorNum:'0' }};</span>
              <span>{{ $t("fnc.B2BWAP") }}:{{ countData.B2BNum!=null?countData.B2BNum:'0' }};</span>
            </p>
          </div>
        </el-col>
        <el-col :span="5" class="groupTourOrder_count_col">
          <div class="groupTourOrder_count_item">
            <div>
              <i class="iconfont icon-tongji1 groupTourOrder_count_gray"></i>
              <span>{{ $t("fnc.cwdjshuoming") }}</span>
            </div>
            <p>
              <span class="groupTourOrderByTuan_ico">
                <i style="background-color: #0000ff"></i>
                <span>{{ $t("fnc.yidadan") }}</span>
              </span>
              <span class="groupTourOrderByTuan_ico">
                <i style="background-color: #008000"></i>
                <span>{{ $t("fnc.ptcnyshenhe") }}</span>
              </span>
              <span class="groupTourOrderByTuan_ico">
                <i style="background-color: #ff0000"></i>
                <span>{{ $t("fnc.yhcnyshenhe") }}</span>
              </span>
              <span>应收小费:
                {{countData.PreferTipAmount}}
              </span>
              <span>实收小费:
                {{countData.CompensationMoney}}
              </span>
              <span class="groupTourOrderByTuan_ico">
                <i style="background-color: #000000"></i>
                <span>{{ $t("fnc.ytongguo") }}</span>
              </span>
            </p>
          </div>
        </el-col>
      </el-row>
    </div>
    <!-- 表格 -->
    <div style="clear: both; width: 100%; height: 20px"></div>
    <table class="enrollTotalSearchTable" border="0" cellspacing="0" cellpadding="0" v-loading="loading">
      <tr>
        <th width="80">{{ $t("fnc.danhao") }}&{{ $t("visa.v_tuanhao") }}</th>
        <th width="70">{{ $t("advmanager.v_type") }}</th>
        <th width="180">
          {{ $t("advmanager.v_xilie") }}&{{ $t("advmanager.v_line") }}
        </th>
        <th width="50">{{ $t("admin.admin_personNumber") }}</th>
        <th width="80">{{ $t("fnc.danjia") }}</th>
        <th width="80">{{ $t("fnc.cjdanjia") }}</th>

        <th width="80">{{ $t("fnc.yszonge") }}</th>
        <th width="80">{{ $t("fnc.shishou") }}</th>

        <th width="70">{{ $t("fnc.youhui") }}</th>
        <th width="80">{{ $t("salesModule.HappinessPassbook") }}</th>
        <th width="80">应收小费</th>
        <th width="70">实收{{ $t("fnc.xiaofei") }}</th>
        <th width="70">{{ $t("fnc.tuikuan") }}</th>
        <th width="70">{{ $t("fnc.ptshuijin") }}</th>
        <th width="80">{{ $t("Operation.Op_platZaitu") }}</th>
        <th width="80">{{ $t("Operation.Op_daishou") }}</th>
        <th width="60">{{ $t("admin.admin_status") }}</th>
        <th width="60">{{ $t("fnc.khxinxi") }}</th>
        <th v-if="isEditOrderCreate == 1" width="130">
          {{ $t("system.table_operation") }}
        </th>
      </tr>
      <tr>
        <td v-show="OrderList.length == 0" :colspan="isEditOrderCreate == 1 ? 19 : 18" align="center">
          {{ $t("system.content_noData") }}
        </td>
      </tr>
      <tbody v-for="(item, index) in OrderList" :key="index">
        <tr>
          <td rowspan="2">
            <p v-if="item.isChargeLossOrders == 1" style="color: red">
              {{ $t("fnc.sun") }}
            </p>
            <p class="fbold over_ellipsis" style="width: 100%; cursor: pointer; text-decoration: underline"
              :title="item.orderId" @click="
                goUrlX('团报名清单', 'RegistrationList', item.tcid, item.tcnum)
              ">
              {{ item.orderId }}
              <el-tooltip class="item" effect="dark" content="通过小程序确认单报名" placement="top" v-show="item.orderForm == 4">
                <i class="iconfont icon-xiaochengxu" style="
                    font-size: 22px;
                    color: red;
                    text-decoration: none;
                    display: inline-block;
                  "></i></el-tooltip>
              <el-tooltip class="item" effect="dark" content="通过B2B确认单报名" placement="top" v-show="item.isFormB2B == 1">
                <i class="iconfont icon-tiaozheng" style="font-size: 22px; color: #297bef"></i></el-tooltip>

                <label
              style="display:inline-block;margin:5px 0 0 5px;font-size:12px;color: red;">
                <!-- {{item.PriceTeamTypeName}} -->
                {{item.teamType == 1?'小包团':''}}
              </label>

            </p>

            <p class="fz12 over_ellipsis" style="width: 100%; text-decoration: underline; cursor: pointer"
              title="点击跳转到团控列表" @click="goToTravelList(item)">
              {{ item.tcnum }}
            </p>
            <p class="fz12 over_ellipsis" style="width: 100%">
              {{ item.createBy
              }}<span v-if="item.leaveStr != ''" style="color: red">({{ item.leaveStr }})</span>
            </p>
            <p class="fz12 over_ellipsis">
              {{ $t("restaurant.res_oderTime") }}:{{ item.createDate }}
            </p>
            <p class="fz12 over_ellipsis" style="width: 100%">
              {{
                item.commissionSPeopleName == "无"
                  ? ""
                  : item.commissionSPeopleName
              }}
            </p>
            <p v-if="item.commissionMoney" style="color: red">
              {{ $t("salesModule.Commission") }}:{{ item.commissionMoney }}
            </p>
            <p v-else-if="item.commissionMoney" style="color: red">
              {{ $t("salesModule.Commission") }}:{{
                item.latestCommissionMoney
              }}
            </p>
            <div>
              <div style="color: green" v-if="
                  item.commissionMoney == '' || item.commissionMoney == '-1'
                ">
                <p v-if="item.extraRewardMoney > 0">
                  {{ $t("salesModule.EWJLJE") }}:{{ item.extraRewardMoney }}
                </p>
                <p v-if="item.extraDeductMoney > 0">
                  {{ $t("salesModule.EWKCJE") }}:{{ item.extraDeductMoney }}
                </p>
              </div>
              <div style="color: red" v-else>
                <p v-if="item.extraRewardMoney > 0">
                  {{ $t("salesModule.EWJLJE") }}:{{ item.extraRewardMoney }}
                </p>
                <p v-if="item.extraDeductMoney > 0">
                  {{ $t("salesModule.EWKCJE") }}:{{ item.extraDeductMoney }}
                </p>
              </div>
              <div style="color: red">
                <p v-if="item.unionExtraMoney != 0">
                  {{ $t("salesModule.LYEWFY") }}:{{ item.unionExtraMoney }}
                </p>
              </div>
            </div>
            <div v-if="item.orderTypeName === '单团'" style="color: red; cursor: pointer"
              @click="seeBJD(item.quotationUrl)">
              查看报价单
            </div>
          </td>
          <td>
            <p class="fz12 over_ellipsis" style="width: 100%">
              {{ item.orderTypeName }}
            </p>
          </td>
          <td class="fz12">
            <p style="
                max-width: 160px;
                display: block;
                text-decoration: underline;
                cursor: pointer;
              " title="点击跳转到报名清单" class="over_ellipsis" :title="item.lineName" @click="
                goUrlX('团报名清单', 'RegistrationList', item.tcid, item.tcnum)
              ">
              <span>{{ item.lineName }}</span>
            </p>
            <p style="
                max-width: 160px;
                display: block;
                text-decoration: underline;
                cursor: pointer;
              " title="点击跳转到报名清单" class="over_ellipsis" :title="item.ltName" @click="
                goUrlX('团报名清单', 'RegistrationList', item.tcid, item.tcnum)
              ">
              {{ item.ltName }}
            </p>
          </td>
          <td>
            {{ item.guestNum }}
            <span v-if="item.refuseVisaNum > 0" style="color: red">
              ({{ $t("salesModule.RefuseQ") }} {{ item.refuseVisaNum
              }}{{ $t("sm.person") }})
            </span>
          </td>
          <td style="color: #ff9c00">{{ item.tC_Price }}</td>
          <td style="color: #ff9c00">¥{{ item.unit_Price }}</td>

          <td>
            <p style="color: #ff9c00">¥{{ item.preferPrice }}</p>
          </td>

          <td>
            <span v-if="item.dueInMoney == 0">{{ item.income }}</span>
            <span v-if="item.dueInMoney != 0" style="color: #e95252">{{
              item.income
            }}</span>
          </td>

          <!-- 优惠 -->
          <td>
            <el-popover style="padding: 0" width="600" trigger="click">
              <div class="personNolayer">
                <table border="0" cellspacing="1" cellpadding="1">
                  <tr>
                    <th>{{ $t("active.cl_couponName") }}</th>
                    <th>{{ $t("active.cl_couponType") }}</th>
                    <th>{{ $t("active.cl_dkjezk") }}</th>
                    <th>{{ $t("active.cl_sytiaojian") }}</th>
                    <th>{{ $t("active.cl_huoqufangshi") }}</th>
                    <th>{{ $t("active.cl_hqriqi") }}</th>
                  </tr>
                  <tr v-if="item.couponAllotList.length > 0" v-for="(item2, index2) in item.couponAllotList"
                    :key="index2">
                    <td>{{ item2.couponsName }}</td>
                    <td>
                      <span v-if="item2.couponsType == 1">{{
                        $t("active.cl_dyquan")
                      }}</span>
                      <span v-if="item2.couponsType == 2">{{
                        $t("active.cl_zkquan")
                      }}</span>
                    </td>
                    <td>{{ item2.denomination }}</td>
                    <td>
                      {{ $t("active.cl_man") }}{{ item2.useCondition
                      }}{{ $t("active.cl_keyong") }}
                    </td>
                    <td>
                      <span v-if="item2.accessType == 1">{{
                        $t("active.cl_choujiang")
                      }}</span>
                      <span v-else></span>
                    </td>
                    <td>{{ item2.acessDate }}</td>
                  </tr>
                  <tr v-if="item.couponAllotList.length == 0">
                    <td colspan="6" align="center">
                      {{ $t("system.content_noData") }}
                    </td>
                  </tr>
                </table>
              </div>
              <span style="
                  cursor: pointer;
                  color: #e95252;
                  text-decoration: underline;
                " slot="reference">{{ item.discountMoney }}</span>
            </el-popover>
          </td>
          <td>
            <el-popover v-if="item.customerId || item.customerId == 0" style="padding: 0" width="600" trigger="click">
              <div class="personNolayer">
                <table border="0" cellspacing="1" cellpadding="1">
                  <tr>
                    <th>{{ $t("fnc.jine") }}</th>
                    <th>{{ $t("salesModule.Type") }}</th>
                    <th>{{ $t("system.label_info") }}</th>
                    <th>
                      {{ $t("adm.adm_time") }}(<span @click="goUrlHappy(item)" style="cursor: pointer" colspan="4"
                        align="center">{{ $t("salesModule.LookMore") }}</span>)
                    </th>
                  </tr>
                  <tr v-for="(item2, index2) in redBagList" :key="index2">
                    <td>{{ item2.Money }}</td>
                    <td>
                      {{ item2.Type == 1 ? "收入" : "折扣" }}
                    </td>
                    <td>{{ item2.Description }}</td>
                    <td>{{ item2.UpdateTime }}</td>
                  </tr>
                  <tr v-if="redBagList.length == 0">
                    <td colspan="4" align="center">
                      {{ $t("system.content_noData") }}
                    </td>
                  </tr>
                  <tr>
                    <!-- <td @click="goUrlHappy(item)" style="cursor: pointer;" colspan="4" align="center">查看更多</td> -->
                  </tr>
                </table>
              </div>
              <span @click="getRedBag(item)" style="
                  cursor: pointer;
                  color: #e95252;
                  padding: 0 15px;
                  text-decoration: underline;
                " slot="reference">{{ item.redEnvelopeMoney }}</span>
            </el-popover>
            <span v-else style="
                cursor: pointer;
                color: #e95252;
                text-decoration: underline;
              ">{{ item.redEnvelopeMoney }}</span>
          </td>
          <td style="color: #ff9c00">¥{{ item.preferTipAmount?item.preferTipAmount:'0.00' }}</td>
          <td v-if="item.tipMoney">{{ item.tipMoney }}</td>
          <td v-else>0.00</td>
          <td>{{ item.refund }}</td>
          <td>{{ item.platformTax }}</td>
          <td>{{ item.zaiTuMoney }}</td>
          <td>
            <span :class="{ color_red_order: item.dueInMoney !== item.preferPrice }">{{ item.dueInMoney }}</span>
          </td>
          <td v-if="item.isChargeLossOrders == 1" class="fz12" style="color: #e95252">
            {{ $t("fnc.shousun") }}
          </td>
          <td v-else class="fz12" :style="item.orderState === 3 ? 'color: #e95252;' : ''">
            {{ item.statsstr }}
          </td>
          <td>
            <p class="over_ellipsis" style="width: 150px" :title="item.contactName">
              {{ item.contactName }}
            </p>
            <p>{{ item.contactMobile }}</p>
            <p v-if="item.industryCategory !== ''" style="color: green">
              {{ $t("salesModule.HYLB") }}:{{ item.industryCategory }}
            </p>
          </td>
          <td v-if="isEditOrderCreate == 1">
            <button class="normalBtn" @click="getSalerInfo(item)">
              {{ $t("salesModule.UpdateYWY") }}
            </button>
          </td>
        </tr>
        <tr>
          <td colspan="8" class="groupTourOrder_remarks" style="height: 20px">
            <div>
              <div>
                <span>{{ $t("hotel.hotel_remark") }}:</span>
                <p>
                  <span
                    v-if="item.clientSource == 1 && item.brandName != ''">{{ item.brandName }}{{ $t("fnc.dingdan") }}
                    {{ item.platformOrder }};</span>{{ item.remarks }}
                </p>
              </div>
              <div>
                <span>{{ item.remarksName }}&ensp;{{ item.rematksTime }}</span>
                <el-popover width="600" placement="bottom-end" trigger="click">
                  <div class="groupTourOrder_remarks_popover">
                    <div>{{ $t("fnc.lsbeizhu") }}</div>
                    <p v-if="item.remarksList.length !== 0" v-for="(item2, index2) in item.remarksList" :key="index2">
                      <span>{{ item2.remarks }}</span>
                      <span>
                        {{ item2.createByName }}
                        <span style="color: #666666">{{
                          item2.createDate
                        }}</span>
                      </span>
                    </p>
                    <span v-if="item.remarksList.length === 0">{{
                      $t("system.content_noData")
                    }}</span>
                  </div>
                  <el-button slot="reference" icon="iconfont icon-gengduo" style="
                      padding: 0px;
                      border: none;
                      background-color: transparent;
                    " class="groupTourOrder_remarks_btn">
                  </el-button>
                </el-popover>
              </div>
            </div>
            <div v-if="item.unionRemark" style="font-size: 12px;">
              <span style="color: red;">联运备注:</span>
              <span style="color: red;">{{ item.unionRemark }}</span>
            </div>
          </td>
          <td :colspan="isEditOrderCreate == 1 ? 10 : 9" class="groupTourOrder_tickets"
            style="height: 20px; cursor: pointer" @click="goUrlSFD('SalesFinancialDetail', '销售财务单据', item)">
            <div>
              <div style="white-space: nowrap">
                {{ $t("fnc.skdanju") }}:<span v-if="item.financeList.length === 0"
                  style="cursor: default">{{ $t("system.content_noData") }}</span>
                <span v-for="(item2, index2) in item.financeList" :key="index2">
                  <span v-if="item2.colorState === 1" class="groupTourOrder_tickets_blue">
                    《{{ item2.frID }}》
                  </span>

                  <span v-else-if="item2.colorState === 2" class="groupTourOrder_tickets_green">
                    《{{ item2.frID }}》</span>

                  <span v-else-if="item2.colorState === 3" class="groupTourOrder_tickets_red">《{{ item2.frID }}》
                  </span>
                  <span v-else-if="item2.colorState === 4" class="groupTourOrder_tickets_black">《{{ item2.frID }}》
                  </span>
                </span>
              </div>
            </div>
            <div>
              <div style="white-space: nowrap">
                {{ $t("fnc.fkdanju") }}:<span v-if="item.financeList.length === 0"
                  style="cursor: default">{{ $t("system.content_noData") }}</span>
                <span v-for="(item2, index2) in item.refundFinanceList" :key="index2">
                  <span v-if="item2.colorState === 1" class="groupTourOrder_tickets_blue">《{{ item2.frID }}》</span>
                  <span v-else-if="item2.colorState === 2"
                    class="groupTourOrder_tickets_green">《{{ item2.frID }}》</span>
                  <span v-else-if="item2.colorState === 3" class="groupTourOrder_tickets_red">《{{ item2.frID }}》</span>
                  <span v-else-if="item2.colorState === 4"
                    class="groupTourOrder_tickets_black">《{{ item2.frID }}》</span>
                </span>
              </div>
            </div>
          </td>
        </tr>
      </tbody>
    </table>
    <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 class="combottomDiv" v-if="showChangeSales" style="height: 200px">
      <updateSalesMan @closeUpdiv="closeSalseDiv" @getList="getList" :subInfo="subInfo"></updateSalesMan>
    </div>
  </div>
</template>

<script>
  import Treeselect from "@riophae/vue-treeselect";
  import updateSalesMan from "../../commonPage/updateSalesMan.vue";
  import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  export default {
    components: {
      Treeselect,
      updateSalesMan,
    },
    data() {
      return {
        //修改订单业务员权限
        isEditOrderCreate: 0,
        redBagList: [],
        normalizer(node) {
          return {
            id: node.DepartmentId,
            label: node.DepartmentName,
            children: node.ChildList,
          };
        },
        defaultImg: 'this.src="' + require("../../../assets/img/litheader.png") + '"',
        currentPage: 1,
        total: 0,
        loading: false,
        companyList: [],
        msg: {
          OutBranchId: -1,
          BranchId: -1,
          LineId: -1,
          LineIdStr: "", //线路字符串
          RB_Department_Id: "",
          CreateBy: "-1",
          OrderState: "-1",
          CStartDate: "",
          CEndDate: "",
          pageIndex: 1,
          pageSize: 10,
          tempOrderId: "",
          SellFormEmp: 0,
          QStartDate: "", //发团日期-开始
          QEndDate: "", //发团日期-结束
        },
        getDepartmentMsg: {
          // 部门
          RB_Group_Id: "",
          RB_Branch_Id: "",
          Status: 0,
          ParentId: -1,
          Tier: 0,
        },
        employeeMsg: {
          RB_Group_id: "0",
          RB_Branch_id: "-1",
          departmentId: "0",
          IsLeave: "-1",
        },
        isOwn: false,
        OrderList: [],
        LineList: [],
        LineTeamList: [],
        DepartmentList: [],
        EmployeeList: [],
        ddztList: [],
        countData: {
          // 总报名人数
          TotalGuestNum: 0,
          TotalYSeatNum: 0,
          TotalESeatNum: 0,
          TotalFSeatNum: 0,
          // 正常报名人数
          NormalGuestNum: 0,
          NormalYSeatNum: 0,
          NormalESeatNum: 0,
          NormalFSeatNum: 0,
          // 取消人数
          CancelGuestNum: 0,
          CancelYSeatNum: 0,
          CancelESeatNum: 0,
          CancelFSeatNum: 0,
          // 其他统计项
          Income: 0,
          Commission: 0,
          DueinMoney: 0,
          PreferPrice: 0,
          InteriorNum: 0,
          B2BNum: 0,
        },
        showChangeSales: false,
        //订单编号及业务员信息
        subInfo: {
          CreateBy: "",
          OrderId: 0,
        },
        userId: 0,
      };
    },
    methods: {
      //跳转到团控列表
      goToTravelList(item) {
        if (item.teamType == 1) {
          this.goUrlX('团控列表', 'TravelControlListSale', item.tcid, item.tcnum);
        } else {
          this.goUrlX('团控列表', 'TravelControlList', item.tcid, item.tcnum);
        }
      },
      goUrlHappy(item) {
        this.$router.push({
          name: "HappyPassbook",
          query: {
            CustomerId: item.customerId,
            blank: "y",
          },
        });
      },
      getRedBag(item) {
        let msg = {
          CustomerId: item.customerId,
          pageIndex: 1,
          pageSize: 4,
        };
        if (item.customerId) {
          this.apipost(
            "customer_post_GetC_BigRedEnvelopeInfoList",
            msg,
            (res) => {
              if (res.data.resultCode == 1) {
                this.redBagList = res.data.data.pageData;
              } else {}
            },
            (err) => {}
          );
        } else {
          this.redBagList = [];
        }
      },
      goUrlSFD: function (path, name, item) {
        let obj = JSON.parse(JSON.stringify(item));
        obj.oP_Remarks = "";
        obj.remarksList = [];
        obj.refundFinanceList = [];
        obj.remarks = [];
        obj.ltName = [];
        obj.lineName = [];
        obj.financeList = [];
        obj.guestList = [];
        obj.description = [];
        this.$router.push({
          name: path,
          query: {
            blank: "y",
            tab: name,
            item: JSON.stringify(obj),
          },
        });
      },
      getCompanyList() {
        let userInfo = this.getLocalStorage();
        let RB_Group_id = userInfo.RB_Group_id;
        let msg = {
          Status: 0,
          is_show: 0,
          RB_Group_Id: RB_Group_id,
        };
        this.apipost(
          "admin_get_BranchGetList",
          msg,
          (res) => {
            if (res.data.resultCode == 1) {
              this.companyList = res.data.data;
            }
          },
          (err) => {}
        );
      },
      // 结束日期不能大于开始日期
      dataDui() {
        if (this.msg.CStartDate > this.msg.CEndDate && this.msg.CEndDate !== "") {
          this.$message.error("结束日期不能大于开始日期");
          this.msg.CEndDate = "";
        }
      },
      goUrl(name, path, id, tcmun) {
        this.$router.push({
          name: path,
          query: {
            id: id,
            tcmun: tcmun,
            blank: "y",
            tab: name,
          },
        });
      },
      // 获取统计数据
      getCount: function () {
        this.apipost(
          "sellorder_post_OP_GetOrderListStatistics",
          this.msg,
          (res) => {
            if (res.data.resultCode == 1) {
              this.countData = res.data.data;
            } else {
              this.$message.error("数据获取失败!");
            }
          },
          (err) => {}
        );
      },
      goUrlX(name, path, id, tcmun) {
        this.$router.push({
          name: path,
          query: {
            id: id,
            tcmun: tcmun,
            blank: "y",
            tab: name,
          },
        });
      },
      linkageEmployeeMsg(node, instanceId) {
        this.employeeMsg.departmentId = node.DepartmentId;
        this.msg.CreateBy = "-1";
        this.getEmployee();
      },
      getDdztList() {
        this.apipost(
          "sellorder_post_GetSellOrderStatusEnumList", {},
          (res) => {
            if (res.data.resultCode == 1) {
              this.ddztList = res.data.data;
            }
          },
          (err) => {}
        );
      },
      getLineList() {
        this.apipost("line_post_GetList", {}, (res) => {
          if (res.data.resultCode == 1) {
            this.LineList = res.data.data;
            var lineIdStr = "";
            this.LineList.forEach((lineItem) => {
              lineIdStr += lineItem.LineID + ",";
            });
            this.msg.LineIdStr = lineIdStr.substring(
              0,
              lineIdStr.lastIndexOf(",")
            );
          } else {
            this.$message.error(res.data.message);
          }
        });
      },
      getList() {
        this.loading = true;
        this.apipost(
          "sellorder_post_OP_GetOrderList",
          this.msg,
          (res) => {
            this.loading = false;
            if (res.data.resultCode == 1) {
              this.total = res.data.data.count;
              this.OrderList = res.data.data.pageData;
            } else {
              this.$message.error(res.data.message);
            }
          },
          (err) => {}
        );
        this.getCount();
      },
      handleCurrentChange(val) {
        this.msg.pageIndex = val;
        this.getList();
      },
      resetPageIndex() {
        this.msg.pageIndex = 1;
        this.currentPage = 1;
      },
      //点击修改业务员
      getSalerInfo(item) {
        this.subInfo.CreateBy = item.createBy;
        this.subInfo.OrderId = item.orderId;
        this.showChangeSales = true;
      },
      //关闭修改业务员
      closeSalseDiv() {
        this.showChangeSales = false;
      },
      getDepartment() {
        //部门
        this.apipost(
          "admin_get_DepartmentGetList",
          this.getDepartmentMsg,
          (res) => {
            if (res.data.resultCode == 1) {
              this.DepartmentList = res.data.data;
            }
          },
          (err) => {}
        );
      },
      getEmployee() {
        //员工
        this.apipost(
          "admin_get_EmployeeGetList",
          this.employeeMsg,
          (res) => {
            if (res.data.resultCode == 1) {
              this.EmployeeList = res.data.data;
            }
          },
          (err) => {}
        );
      },
      //获取修改业务员权限
      GetEditOrderCreateByAuth() {
        var actionCode = this.$AuthCode.EditOrderCreateBy;
        this.CheckUserAuth(actionCode, (res) => {
          if (res.data.resultCode == 1 && res.data.data == 1) {
            this.isEditOrderCreate = 1;
          }
        });
      },
      // 查看报价单
      seeBJD(url) {
        window.open(url, "_blank");
        return;
      },
    },
    mounted() {
      this.GetEditOrderCreateByAuth();
      let userInfo = this.getLocalStorage();
      this.userId = userInfo.EmployeeId;
      this.getCompanyList();
      this.getEmployee();
      this.getLineList();
      this.getDepartment();
      this.getDdztList();
      let nowDay = this.FormartDate(new Date());

      if (this.$route.query.id) {
        this.msg.tempOrderId = this.$route.query.id;
      }
      if (this.msg.CStartDate === "" && this.msg.CEndDate === "") {
        this.msg.CStartDate = nowDay;
        this.msg.CEndDate = nowDay;
      }
      if (userInfo.EmployeeId == 5 || userInfo.EmployeeId == 1) {
        this.msg.OutBranchId = -1;
      } else {
        this.msg.OutBranchId = this.getLocalStorage().RB_Branch_id;
      }
      this.getList();
    },
  };

</script>

<style>
  .personNolayer p {
    height: 28px;
    line-height: 28px;
    padding-left: 15px;
  }

  .personNolayer p>span {
    font-size: 12px;
    color: #333;
    margin-right: 25px;
  }

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

  .personNolayer table th {
    background-color: #ededed;
    height: 34px;
    text-indent: 15px;
  }

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

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

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

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

  .enrollTotalSearch::after {
    display: block;
    clear: both;
    content: "";
    visibility: hidden;
    height: 0;
  }

  .enrollTotalSearch li {
    float: left;
    font-size: 12px;
    height: 40px;
    color: #666;
    margin: 20px 10px 10px 0;
  }

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

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

  .enrollTotalSearch li:last-child {
    float: right;
    position: fixed;
    top: 36px;
    right: 20px;
    text-align: right;
    z-index: 50;
  }

  .enrollTotalSearchTable {
    width: 100%;
    font-size: 14px;
    color: #333;
    border-bottom: 1px solid #cccccc;
    border-right: 1px solid #cccccc;
  }

  .enrollTotalSearchTable tr {
    /* border-bottom: 2px solid #333; */
  }

  .enrollTotalSearchTable tr th {
    background: #bdbdbd;
    height: 30px;
    font-size: 12px;
    text-align: left;
    text-indent: 15px;
    border-top: 1px solid #cccccc;
    border-left: 1px solid #cccccc;
  }

  .enrollTotalSearchTable tr {
    background: #fff;
    text-align: left;
  }

  .enrollTotalSearchTable tr td {
    height: 50px;
    padding: 10px;
    border-top: 1px solid #cccccc;
    border-left: 1px solid #cccccc;
  }

  .enrollTotalSearchTable tr td>img {
    width: 32px;
    height: 32px;
    border-radius: 16px;
    vertical-align: middle;
    margin-right: 5px;
  }

  .enrollTotalSearchTable tr td p {
    line-height: 20px;
  }

  .groupTourOrder_count_green {
    color: #1bc594;
  }

  .groupTourOrder_count_blue {
    color: #4d7afd;
  }

  .groupTourOrder_count_yellow {
    color: #ff9c00;
  }

  .groupTourOrder_count_gray {
    color: #999999;
  }

  .groupTourOrder_count {
    margin: 0 0 20px 0;
    width: 100%;
    height: auto;
  }

  .groupTourOrder_count_col {
    height: 110px;
  }

  .groupTourOrder_count_item {
    font-weight: 400;
    padding: 10px;
    height: 100%;
    border: 1px solid #e6e6e6;
    background-color: #ffffff;
    color: #333333;
  }

  .groupTourOrder_count_item>div>i {
    font-size: 12px;
    vertical-align: bottom;
  }

  .groupTourOrder_count_item>div>span:nth-child(2) {
    font-size: 14px;
    vertical-align: bottom;
  }

  .groupTourOrder_count_item>div>span:nth-child(3) {
    font-weight: bold;
    font-size: 16px;
    vertical-align: bottom;
  }

  .groupTourOrder_count_item>p {
    font-size: 12px;
    line-height: 18px;
  }

  .groupTourOrder_count_item>p>span {
    margin: 0 5px 0 0;
    white-space: nowrap;
  }

  .groupTourOrder_more {
    margin: 0 -12px;
  }

  .groupTourOrder_more>div {
    width: 100%;
    height: 30px;
    line-height: 30px;
    text-align: center;
    font-size: 12px;
    color: #333333;
    background-color: #ffffff;
    cursor: pointer;
  }

  .groupTourOrder_more>div:hover {
    color: #297bef;
    background-color: #dcebff;
  }

  .groupTourOrder_remarks {
    font-size: 0px;
  }

  .groupTourOrder_remarks>div {}

  .groupTourOrder_remarks>div>div:nth-child(1) {
    float: left;
    display: flex;
    align-items: flex-start;
  }

  .groupTourOrder_remarks>div>div:nth-child(1)>span {
    line-height: 20px;
    font-size: 12px;
    color: #e95252;
    white-space: nowrap;
  }

  .groupTourOrder_remarks>div>div:nth-child(1)>p {
    line-height: 20px;
    font-size: 12px;
    color: #e95252;
  }

  .groupTourOrder_remarks>div>div:nth-child(2) {
    float: right;
    text-align: right;
    font-size: 12px;
    color: #e95252;
  }

  .groupTourOrder_remarks>div>div:nth-child(2)>i {
    font-size: 10px;
    cursor: pointer;
  }

  .groupTourOrder_remarks>div::after {
    display: block;
    clear: both;
    content: "";
    visibility: hidden;
    height: 0;
  }

  .groupTourOrder_remarks_btn {
    padding: 0px;
    width: 12px;
    height: 12px;
    border: none;
    background-color: transparent;
  }

  .groupTourOrder_remarks_btn>i {
    color: #e95252;
    font-size: 12px;
  }

  .groupTourOrder_remarks_popover>div {
    display: inline-block;
    font-size: 14px;
    color: #000000;
  }

  .groupTourOrder_remarks_popover>div::before {
    content: "";
    display: inline-block;
    margin: 0 5px 0 0;
    width: 2px;
    height: 12px;
    background-color: #e95252;
  }

  .groupTourOrder_remarks_popover>span {
    display: block;
    margin: 0 0 0 0;
    width: 100%;
    text-align: center;
    font-size: 12px;
    color: #000000;
  }

  .groupTourOrder_remarks_popover>p {
    margin: 5px 0 0 0;
    padding: 3px;
    width: 100%;
    max-height: 300px;
    overflow-y: auto;
    font-size: 12px;
    color: #000000;
  }

  .groupTourOrder_remarks_popover>p:nth-child(even) {
    background-color: #e6e6e6;
  }

  .groupTourOrder_remarks_popover>p>span:nth-child(1) {
    float: left;
  }

  .groupTourOrder_remarks_popover>p>span:nth-child(2) {
    margin: 0 10px 0 0;
    float: right;
  }

  .groupTourOrder_remarks_popover>p::after {
    display: block;
    clear: both;
    content: "";
    visibility: hidden;
    height: 0;
  }

  .groupTourOrder_tickets>div>span {
    margin: 0 5px 0 0;
    cursor: pointer;
  }

  .groupTourOrder_tickets_red {
    color: #ff0000;
    cursor: pointer;
    /* text-decoration: underline; */
  }

  .groupTourOrder_tickets_blue {
    color: #0000ff;
    /* text-decoration: underline; */
    cursor: pointer;
  }

  .groupTourOrder_tickets_green {
    color: #008000;
    cursor: pointer;
    /* text-decoration: underline; */
  }

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

  .groupTourOrderByTuan_ico {
    margin: 0 10px 0 0;
  }

  .groupTourOrderByTuan_ico>i {
    display: inline-block;
    margin: 0 2px 0 0;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    vertical-align: middle;
  }

  .groupTourOrderByTuan_ico>span {
    vertical-align: middle;
  }

  .color_red_order {
    color: #e95252 !important;
  }

</style>