<template>
  <el-dialog custom-class='PingFangSC' :title="$t('objFill.v101.commissonBill.dindangjtx')"
  :visible.sync="outerVisibleNot" center
      :before-close="closeChangeMachie" width="1100px">
      <div v-if="ChangeThePriceObj.ChangeThePriceData.length>0"
        style="margin-bottom: 25px;">
        <p style="color: red;font-size: 16px;">
          {{$t('objFill.v101.commissonBill.gaijiatx')}}:
          <span>{{$t('objFill.v101.commissonBill.yigongyou')}} <span class="c059FF6 fz16"
            style="padding: 0 10px;cursor: pointer;font-weight: bold;display: inline-block;"
            @click="ckChangePrice({},1)">
            {{msg.total2}}
          </span>
             {{$t('objFill.v101.commissonBill.tiaozwpsj')}}
             <span class="c059FF6 fz16"
             style="margin-left: 10px;margin-right: 10px;cursor: pointer;font-weight: bold;" @click="ckChangePrice({},1)">{{$t('objFill.shengqgaijjiaj')}}</span>
             {{$t('objFill.v101.commissonBill.ba')}}
            </span>
        </p>
        <p style="font-size: 18px;font-weight: bold;background: #d1d1d1;padding: 5px 10px;margin-top: 5px;">{{$t('objFill.v101.commissonBill.dindangjlb')}}

        </p>
        <el-table
      border
      ref="multipleTable"
      :data="ChangeThePriceObj.ChangeThePriceData"
      style="width: 100%"
      :default-sort="{ prop: 'null', order: 'null' }"
      :sort-by="[
        'Money',
        'Income',
        'PreferTipAmount',
        'PlatformTax',
        'Refund',
        'CostMoney',
        'OrderProfit',
        'DueInMoney'
      ]"
    >
      <el-table-column
        width="200"
        prop="CreateTimeStr"
        :label="$t('objFill.v101.commissonBill.dindanid')"
        show-overflow-tooltip
        fixed="left"
      >
        <template slot-scope="scope">
          <div>
            <p
              class="cursor-pointer c059FF6 fz18 row-c"
              @click="goDetails(scope.row)"
            >
              <el-tag style="margin-right: 5px;" size="mini">{{
                scope.row.OrderTypeName
              }}</el-tag>
              <span>{{ scope.row.OrderId }}</span>
            </p>
            <p>{{ scope.row.CreateTimeStr }}</p>
          </div>
        </template>
      </el-table-column>
      <el-table-column
        width="200"
        prop="CreateTimeStr"
        :label="$t('visa.v_tuanhao')"
        show-overflow-tooltip
        fixed="left"
      >
        <template slot-scope="scope">
          <div>
            <p
              class=" fz14"
              :class="{ 'cursor-pointer c059FF6': scope.row.OrderType == 2 }"
              @click="scope.row.OrderType == 2 ? goTuanDetails(scope.row) : ''"
            >
              {{ scope.row.TCNUM }}
            </p>
            <p>{{$t('hotel.hotel_StarDate')}}:{{ scope.row.StartDate }}</p>
            <p v-if="scope.row.OrderType == 2 && scope.row.Status >= 0">
              {{
                scope.row.Status == 1
                  ? $t('objFill.weijietuan')
                  : scope.row.Status == 2
                  ? $t('objFill.yijietuan')
                  : scope.row.Status == 5
                  ? $t('objFill.daijietuansh')
                  : ""
              }}{{ scope.row.Status == 2 ? scope.row.OutGroupAuditDate : "" }}
            </p>
          </div>
        </template>
      </el-table-column>
      <el-table-column :label="$t('objFill.keren')" show-overflow-tooltip>
        <template slot-scope="scope">
          <span>
            {{ scope.row.GuestName }}
          </span>
        </template>
      </el-table-column>
      <el-table-column prop="SaleName" :label="$t('visaT.sale')"> </el-table-column>
      <el-table-column prop="LureEmpName" :label="$t('objFill.yingliu')"> </el-table-column>
      <el-table-column :label="$t('MarketingActi.commName')" show-overflow-tooltip>
        <template slot-scope="scope">
          <div
            style="max-width: 100px;overflow: hidden;text-overflow: ellipsis"
          >
            {{ scope.row.Name }}
          </div>
        </template>
      </el-table-column>
      <el-table-column :label="$t('objFill.shangpingxq')" show-overflow-tooltip>
        <template slot-scope="scope">
          <div
            style="max-width: 100px;overflow: hidden;text-overflow: ellipsis"
          >
            {{ scope.row.Description }}
          </div>
        </template>
      </el-table-column>
      <el-table-column
        sortable
        prop="Money"
        :label="$t('fnc.a_zongjine')"
        min-width="100"
        show-overflow-tooltip
      >
        <template slot-scope="scope">
          {{ scope.row.Money }}&ensp;({{ scope.row.CurrencyName }})
        </template>
      </el-table-column>

      <el-table-column sortable prop="Income" :label="$t('fnc.shishou')"> </el-table-column>
      <el-table-column
        sortable
        prop="PlatformTax"
        :label="$t('fnc.shouxufei')"
        min-width="100"
      >
      </el-table-column>
      <el-table-column sortable prop="Refund" :label="$t('fnc.tuikuan')"> </el-table-column>
      <!-- <el-table-column sortable prop="CostMoney" :label="$t('hotel.hotel_cost')" >
    </el-table-column> -->
      <el-table-column sortable prop="DueInMoney" :label="$t('op.Tocollected')">
        <template slot-scope="scope">
          <span :class="{ red: scope.row.DueInMoney > 0 }">{{
            scope.row.DueInMoney
          }}</span>
        </template>
      </el-table-column>
      <el-table-column
        sortable
        prop="OrderProfit"
        :label="$t('objFill.yuqilirun')"
        min-width="110"
      >
        <template slot-scope="scope">
          <span :class="{ red: scope.row.OrderProfit > 0 }">{{
            scope.row.OrderProfit
          }}</span>
        </template>
      </el-table-column>
      <el-table-column sortable prop="DiscountsMoney" :label="$t('fnc.youhui')">
      </el-table-column>
      <el-table-column
        prop="Money"
        :label="$t('objFill.shengqingje')"
        min-width="100"
        show-overflow-tooltip
      >
        <template slot-scope="scope">
          <span> {{ scope.row.ApplyForMoney }}</span>
        </template>
      </el-table-column>
      <el-table-column
        prop="ApplyForReason"
        :label="$t('salesModule.ApplyReason')"
        min-width="100"
        show-overflow-tooltip
      >
        <template slot-scope="scope">
          {{ scope.row.ApplyForReason }}
        </template>
      </el-table-column>
      <el-table-column
        prop="ApplyForState"
        :label="$t('objFill.gaijiazhuangtai')"
        show-overflow-tooltip
        min-width="110"
      >
        <template slot-scope="scope">
          <span
            >
            <template v-if="scope.row.OrderChangePriceId==0">
              {{$t('objFill.daishenhe')}}
            </template>
            <template v-if="scope.row.ApplyForState==1">
              {{$t('objFill.v101.commissonBill.daizgsh')}}
            </template>
            <template v-else-if="scope.row.ApplyForState==2">
              {{$t('objFill.v101.commissonBill.zhugshtg')}}
            </template>
            <template v-else-if="scope.row.ApplyForState==3">
              {{$t('objFill.shenhetongguo')}}
            </template>
            <template v-else-if="scope.row.ApplyForState==4">
              {{$t('visa.v_jujue')}}
            </template>
          </span>
        </template>
      </el-table-column>
      <el-table-column :label="$t('system.table_operation')" show-overflow-tooltip
        fixed="right">
        <template slot-scope="scope">
          <p
              class="c059FF6 fz14"
              style="cursor: pointer;font-weight: bold;"
              @click="ckChangePrice(scope.row,1)"
            >
              {{$t('objFill.shengqgaijjia')}}
            </p>
        </template>
        </el-table-column>
    </el-table>
      </div>
      <div v-if="ChangeThePriceObj.ExamineThePriceData.length>0">
        <p style="color: red;font-size: 16px;">
           {{$t('objFill.v101.commissonBill.shenghets')}}:
          <span>{{$t('objFill.v101.commissonBill.yigongyou')}} <span class="c059FF6 fz16"
            style="padding: 0 10px;cursor: pointer;font-weight: bold;display: inline-block;"
            @click="ckChangePrice({},2)">
            {{msg.total}}
          </span>
              {{$t('objFill.v101.commissonBill.tiaogjsqdsh')}}
             <span class="c059FF6 fz16"
             style="margin-left: 10px;margin-right: 10px;cursor: pointer;font-weight: bold;" @click="ckChangePrice({},2)">{{$t('fnc.shenhe')}}</span>
             {{$t('objFill.v101.commissonBill.ba')}}
            </span>
        </p>
        <p style="font-size: 18px;font-weight: bold;background: #d1d1d1;padding: 5px 10px;margin-top: 5px;">{{$t('objFill.v101.commissonBill.shenhegjlb')}}

        </p>
        <el-table
      border
      ref="multipleTable"
      :data="ChangeThePriceObj.ExamineThePriceData"
      style="width: 100%"
      :default-sort="{ prop: 'null', order: 'null' }"
      :sort-by="[
        'Money',
        'Income',
        'PreferTipAmount',
        'PlatformTax',
        'Refund',
        'CostMoney',
        'OrderProfit',
        'DueInMoney'
      ]"
    >
      <el-table-column
        width="200"
        prop="CreateTimeStr"
        :label="$t('objFill.v101.commissonBill.dindanid')"
        show-overflow-tooltip
        fixed="left"
      >
        <template slot-scope="scope">
          <div>
            <p
              class="cursor-pointer c059FF6 fz18 row-c"
              @click="goDetails(scope.row)"
            >
              <el-tag style="margin-right: 5px;" size="mini">{{
                scope.row.OrderTypeName
              }}</el-tag>
              <span>{{ scope.row.OrderId }}</span>
            </p>
            <p>{{ scope.row.CreateTimeStr }}</p>
          </div>
        </template>
      </el-table-column>
      <el-table-column
        width="200"
        prop="CreateTimeStr"
        :label="$t('visa.v_tuanhao')"
        show-overflow-tooltip
        fixed="left"
      >
        <template slot-scope="scope">
          <div>
            <p
              class=" fz14"
              :class="{ 'cursor-pointer c059FF6': scope.row.OrderType == 2 }"
              @click="scope.row.OrderType == 2 ? goTuanDetails(scope.row) : ''"
            >
              {{ scope.row.TCNUM }}
            </p>
            <p>{{$t('hotel.hotel_StarDate')}}:{{ scope.row.StartDate }}</p>
            <p v-if="scope.row.OrderType == 2 && scope.row.Status >= 0">
              {{
                scope.row.Status == 1
                  ? $t('objFill.weijietuan')
                  : scope.row.Status == 2
                  ? $t('objFill.yijietuan')
                  : scope.row.Status == 5
                  ? $t('objFill.daijietuansh')
                  : ""
              }}{{ scope.row.Status == 2 ? scope.row.OutGroupAuditDate : "" }}
            </p>
          </div>
        </template>
      </el-table-column>
      <el-table-column :label="$t('objFill.keren')" show-overflow-tooltip>
        <template slot-scope="scope">
          <span>
            {{ scope.row.GuestName }}
          </span>
        </template>
      </el-table-column>
      <el-table-column prop="SaleName" :label="$t('visaT.sale')"> </el-table-column>
      <el-table-column prop="LureEmpName" :label="$t('objFill.yingliu')"> </el-table-column>
      <el-table-column :label="$t('MarketingActi.commName')" show-overflow-tooltip>
        <template slot-scope="scope">
          <div
            style="max-width: 100px;overflow: hidden;text-overflow: ellipsis"
          >
            {{ scope.row.Name }}
          </div>
        </template>
      </el-table-column>
      <el-table-column :label="$t('objFill.shangpingxq')" show-overflow-tooltip>
        <template slot-scope="scope">
          <div
            style="max-width: 100px;overflow: hidden;text-overflow: ellipsis"
          >
            {{ scope.row.Description }}
          </div>
        </template>
      </el-table-column>
      <el-table-column
        sortable
        prop="Money"
        :label="$t('fnc.a_zongjine')"
        min-width="100"
        show-overflow-tooltip
      >
        <template slot-scope="scope">
          {{ scope.row.Money }}&ensp;({{ scope.row.CurrencyName }})
        </template>
      </el-table-column>

      <el-table-column sortable prop="Income" :label="$t('fnc.shishou')"> </el-table-column>
      <el-table-column
        sortable
        prop="PlatformTax"
        :label="$t('fnc.shouxufei')"
        min-width="100"
      >
      </el-table-column>
      <el-table-column sortable prop="Refund" :label="$t('fnc.tuikuan')"> </el-table-column>
      <!-- <el-table-column sortable prop="CostMoney" :label="$t('hotel.hotel_cost')" >
    </el-table-column> -->
      <el-table-column sortable prop="DueInMoney" :label="$t('op.Tocollected')">
        <template slot-scope="scope">
          <span :class="{ red: scope.row.DueInMoney > 0 }">{{
            scope.row.DueInMoney
          }}</span>
        </template>
      </el-table-column>
      <el-table-column
        sortable
        prop="OrderProfit"
        :label="$t('objFill.yuqilirun')"
        min-width="110"
      >
        <template slot-scope="scope">
          <span :class="{ red: scope.row.OrderProfit > 0 }">{{
            scope.row.OrderProfit
          }}</span>
        </template>
      </el-table-column>
      <el-table-column sortable prop="DiscountsMoney" :label="$t('fnc.youhui')">
      </el-table-column>
      <el-table-column
        prop="Money"
        :label="$t('objFill.shengqingje')"
        min-width="100"
        show-overflow-tooltip
      >
        <template slot-scope="scope">
          <span> {{ scope.row.ApplyForMoney }}</span>
        </template>
      </el-table-column>
      <el-table-column
        prop="ApplyForReason"
        :label="$t('salesModule.ApplyReason')"
        min-width="100"
        show-overflow-tooltip
      >
        <template slot-scope="scope">
          {{ scope.row.ApplyForReason }}
        </template>
      </el-table-column>
      <el-table-column
        prop="ApplyForState"
        :label="$t('objFill.gaijiazhuangtai')"
        show-overflow-tooltip
        min-width="110"
      >
        <template slot-scope="scope">
          <span
            ><template v-if="scope.row.ApplyForState==1">

              <template v-if="scope.row.ApplyType=='2'">
                {{$t('objFill.v101.commissonBill.daiopsh')}}
              </template>
              <template v-else>
                {{$t('objFill.v101.commissonBill.daizgsh')}}
              </template>

            </template>
            <template v-else-if="scope.row.ApplyForState==2">

              <template v-if="scope.row.ApplyType=='2'">
                {{$t('objFill.v101.commissonBill.opshtg')}}
              </template>
              <template v-else>
                {{$t('objFill.v101.commissonBill.zgshtg')}}
              </template>

            </template>
            <template v-else-if="scope.row.ApplyForState==3">
              {{$t('objFill.shenhetongguo')}}
            </template>
            <template v-else-if="scope.row.ApplyForState==4">
              {{$t('visa.v_jujue')}}
            </template>
          </span>
        </template>
      </el-table-column>
      <el-table-column :label="$t('system.table_operation')" show-overflow-tooltip
      fixed="right">
        <template slot-scope="scope">
          <p
              class="c059FF6 fz14"
              style="cursor: pointer;font-weight: bold;"
              @click="ckChangePrice(scope.row,2)"
            >
              {{$t('fnc.shenhe')}}
            </p>
        </template>
        </el-table-column>
    </el-table>
      </div>
      <!--
      <el-pagination background
      v-if="ChangeThePriceObj.ExamineThePriceData.length>0"
      @current-change="handleCurrentChange"
      layout="total,prev, pager, next, jumper" :page-size="msg.pageSize" :total="msg.total">
      </el-pagination> -->
      <!-- <div v-if="ChangeThePriceData.length==0" style="padding: 40px 0;text-align: center;">
        {{$t('system.content_noData')}}
      </div> -->
  </el-dialog>
</template>

<script>
  export default {
    props:["ChangeThePriceObj","msg"],
    data() {
      return {
        outerVisibleNot: true
      }
    },
    watch: {

    },
    methods: {
      goDetails(row){

      },
      ckChangePrice(row,type){
        this.closeChangeMachie()
        let obj
        if(row.OrderId){
          obj = {
            OrderId: row.OrderId,
            OrderType: row.OrderType,
            DepartSTime: row.StartDate,
            DepartETime: row.StartDate,
            blank: "y"
          }
        }else{
          obj = {
            blank: "y"
          }
        }
        this.$router.push({
            name: type==1?'erpChangePricehOrder':'erpExaminePricehOrder',
            query: obj
          });
      },
      closeChangeMachie(done) {
        this.$emit('ChangeThePriceVisible')
      },
      handleCurrentChange(val) {
          this.$emit('GetList',val)
      },
    }
  }
</script>