<style>
  @import "../../../assets/css/newTravelManager.css";

  .CostNewPrice .el-form-item__content,
  .CostNewPrice .el-form-item__label {
    line-height: 30px;
  }

  .CostNewPrice .CP_halfWi {
    width: 45%;
  }

  .CostNewPrice .QuotationFirstDiv1 {
    padding-top: 30px;
  }

  .CostNewPrice .CP_ComTitle2 {
    color: #106BAF;
    font-weight: bold;
    background-color: #D1EEEE;
    white-space: nowrap;
  }

  .CostNewTable {
    border-collapse: collapse;
  }

  .CostNewTable td {
    height: 40px;
    border: 1px solid #106BAF !important;
    border-collapse: collapse;
    padding: 0 3px;
  }

  .CostNewTable .el-input .el-input__inner {
    height: 25px !important;
    border: none;
    border-bottom: 1px solid #606266;
    padding-left: 5px !important;
  }


  .CP_ComTitle {
    color: #106BAF;
  }

  .w70 {
    width: 70px !important;
  }

  .CostcomCenter {
    text-align: center;
  }

  .txtRightCost {
    text-align: right;
    padding-right: 10px;
  }

  .CostNewPrice .el-form-item {
    margin-bottom: 0 !important;
  }

  .offer_select-tag {
    background-color: #409eff !important;
    color: white !important;
    border-color: #409eff !important;
  }

</style>
<template>
  <div class="DirectQuotation clearfix" v-loading="loading">
    <div class="singlePrice DirectPriceCenter">
      <el-form>
        <div class="QuotationFirstDiv1">
          <table>
            <tr>
              <th>
                {{$t('objFill.v101.kaituants')}}
              </th>
              <th colspan="5" style="text-align:left;line-height:40px;">
                <p style="color:red;font-weight:bold;">
                  1.{{$t('objFill.v101.changuitdyshnp')}}&nbsp;&nbsp;
                  2.{{$t('objFill.v101.xiaobtcgbjd')}}&nbsp;&nbsp;
                  3.{{$t('objFill.v101.dangdybxyjp')}}
                </p>
              </th>
            </tr>
            <tr>
              <td width="80" class="txtRightCost">{{$t('objFill.v101.chutuanleix')}}</td>
              <td>
                <el-select class="multiple_input" v-model="postData.TeamType" @change="changeTeamType()"
                  style="width:100px;">
                  <el-option v-for='item in teamList' :key="item.ID" :label="item.Name" :value="item.ID">
                  </el-option>
                </el-select>
                <template v-if="postData.TeamType==0||postData.TeamType==1">
                  {{$t('objFill.tuanduilx')}}
                  <el-select class="multiple_input" v-model="postData.PriceTeamType" style="width:100px;">
                    <el-option :key="0" :label="$t('system.ph_choice')" :value="0">
                    </el-option>
                    <template v-for="item in TeamListArr">
                      <template v-if="postData.TeamType==0">
                        <el-option v-if="item.Id==1||item.Id==2||item.Id==9" :key="item.Id" :label="item.Name"
                          :value="item.Id">
                        </el-option>
                      </template>
                      <template v-if="postData.TeamType==1">
                        <el-option v-if="item.Id==2" :key="item.Id" :label="item.Name" :value="item.Id">
                        </el-option>
                      </template>
                    </template>
                  </el-select>
                </template>
                <template v-if="postData.TeamType==2">
                  &nbsp;&nbsp;&nbsp;&nbsp;
                  <el-tooltip content="勾选此项,团队报满后,自动生成新团期,新报价单。">
                    <el-checkbox v-model="postData.IsRoll" :true-label="1" :false-label="0">滚动发团</el-checkbox>
                  </el-tooltip>
                </template>
              </td>
              <td width="80" class="txtRightCost">{{$t('advmanager.v_line')}}</td>
              <td>
                <el-select style="width:100%" v-model="postData.LineId" :placeholder="$t('pub.pleaseSel')"
                  @change="changeLine()" filterable>
                  <el-option :label="$t('pub.unlimitedSel')" :value='0'></el-option>
                  <el-option v-for="item in getLineList" :label='item.LineName' :value='item.LineID' :key='item.LineID'>
                  </el-option>
                </el-select>
              </td>
              <td width="80" class="txtRightCost">{{$t('advmanager.v_xilie')}}</td>
              <td>
                <el-select style="width:100%;" v-model="postData.LineteamId" :placeholder="$t('pub.pleaseSel')"
                  filterable>
                  <el-option :label="$t('pub.unlimitedSel')" :value='0'></el-option>
                  <el-option v-for="item in LineTeamList" :label='item.LtName' :value='item.LtID' :key='item.LtID'>
                  </el-option>
                </el-select>
              </td>
            </tr>
            <tr>
              <td colspan="6" style="height:20px;">
              </td>
            </tr>
            <tr>
              <td width="80" class="txtRightCost">{{$t('scen.sc_cp')}}</td>
              <td>
                <el-select class="multiple_input" v-model="postData.OutBranchId" filterable style="width:265px;">
                  <el-option v-for='item in companyList' :key="item.id" :label="item.bName" :value="item.id">
                  </el-option>
                </el-select>
              </td>
              <td width="80" class="txtRightCost">{{$t('visa.v_xcdays')}}</td>
              <td>
                <el-input class="w240 LowNum" v-model="postData.DayNum"
                  @keyup.native="checkInteger(postData,'DayNum');createDayTripPrice()" maxlength="2">
                  <template slot="append">{{$t('hotel.hotel_day')}}</template>
                </el-input>
                <el-input class="w120 LowNum" v-model="postData.NightNum"
                  @keyup.native="checkInteger(postData,'NightNum')" maxlength="2">
                  <template slot="append">{{$t('Operation.Op_night')}}</template>
                </el-input>
              </td>
              <td width="80" class="txtRightCost">{{$t('fnc.khmingcheng')}}</td>
              <td>
                <el-input v-model="postData.CustomerName" type="text" :placeholder="$t('fnc.khmingcheng')"
                  maxlength="200">
                </el-input>
              </td>
            </tr>
            <tr>
              <td colspan="6" style="height:20px;">
              </td>
            </tr>
            <tr>
              <td width="80" class="txtRightCost">{{$t('sm.tuanduibiaoti')}}</td>
              <td colspan="3">
                <el-input v-model="postData.Title" type="textarea" :autosize="{minRows: 1, maxRows: 2 }" resize="none"
                  :placeholder="$t('objFill.v101.qingtxtdbti')" maxlength="200"></el-input>
              </td>
              <td width="80" class="txtRightCost">{{$t('hotel.hotel_StarDate')}}</td>
              <td>
                <el-date-picker type="dates" v-model="postData.OutDateTimeList" value-format="yyyy-MM-dd" placeholder
                  :disabled="rParams.TCID>0" @change="changeDate">
                </el-date-picker>
              </td>
            </tr>
            <tr>
              <td colspan="8" style="height:20px;">
              </td>
            </tr>
            <tr>
              <td width="80" class="txtRightCost">{{$t('hotel.hotel_choostDate')}}</td>
              <td colspan="5">
                <template v-if="postData.OutDateTimeList&&postData.OutDateTimeList.length>0">
                  <el-tag v-for="(item,oIndex) in postData.OutDateTimeList" :key="item" closable
                    style="margin-right:5px;cursor:pointer;" @close="handleClose(item,oIndex)"
                    :class="item==selectDate?'offer_select-tag': ''" @click="switchOffer(item)">
                    <el-tooltip class="item" effect="dark" content="点击切换日期" placement="top-start">
                      <font> {{item}}</font>
                    </el-tooltip>
                  </el-tag>
                </template>
              </td>
            </tr>
          </table>
        </div>
        <br />
        <CostNewPriceForm v-if="haveData" ref="CostNewPrice" :postConfig="postData" :offerSelectDate="selectDate"
          :AllCurrencyList="AllCurrencyList" @success="refreshPage">
        </CostNewPriceForm>
      </el-form>
    </div>
    <div class="btnFixedDiv" v-if="haveData">
      <div class="toTop">
        <i class="iconfont icon-huidaodingbu"></i>
      </div>
      <div class="DTSaveBtn" :class="{'disClick':!isSubmit}" @click="SaveData(2)">{{$t('fnc.tijiao')}}</div>
      <div class="DTSaveBtn" style="display:none;">{{$t('objFill.copy')}}</div>
      <div class="DTSaveBtn caogao" :class="{'disClick':!isSubmit}" @click="SaveData(1)">
        <span>{{$t('pub.saveBtn')}}</span>
        <span>{{$t('objFill.caogao')}}</span>
      </div>
    </div>
  </div>
</template>
<script>
  import CostNewPriceForm from "../TravelNewQuotation/CostNewPriceForm";
  export default {
    components: {
      CostNewPriceForm: CostNewPriceForm,
    },
    computed: {
      //线路筛选
      getLineList() {
        var chooseLineList = [];
        //散拼
        if (this.postData.TeamType == 0 || this.postData.TeamType == 5) {
          chooseLineList = this.LineList.filter(qItem => qItem.LineDirection == 2);
        } //小包团
        else if (this.postData.TeamType == 1) {
          chooseLineList = this.LineList.filter(qItem => qItem.Is_PacketGroup == 1);
        }
        //当地游
        else if (this.postData.TeamType == 2) {
          chooseLineList = this.LineList.filter(qItem => qItem.LineDirection == 3);
        }
        return chooseLineList;
      },
    },
    data() {
      return {
        haveData: false,
        //基本配置
        postData: {
          BatchNum: "",
          TCID: 0,
          OfferId: 0,
          LineId: 0,
          LineteamId: 0,
          Title: "",
          DayNum: 0, //天数
          NightNum: 0, //晚数
          CustomerName: "", //客户名称
          TeamType: 0, //出团类型
          PriceTeamType: 0, //团队类型
          TravelState: 1, //团控状态(1-草稿,2-待审核,3-审核通过,4-审核拒绝,5已撤销)
          OutBranchId: "", //出团公司
          OutDateTimeList: [], //出发时间
          IsRoll: 0, //团期报满后是否自动生成新团期,新报价单
          SaleOfferPayType: "",
          OPId: "",
          AssistantList: [],
          dayCostPriceList: [], //行程报价
          OfferArray: []
        },
        isSubmit: true,
        LineList: [], //线路列表
        LineTeamList: [], //系列列表
        teamList: [], //团队类型列表
        TeamListArr: [], //团队子类型
        companyList: [], //出团公司列表
        AllCurrencyList: [], //币种列表
        loading: false,
        rParams: {
          OfferId: 0,
          TCID: 0,
          BatchNum: ""
        },
        selectDate: "", //选中的日期
      };
    },
    methods: {
      //切换日期
      switchOffer(item) {
        this.haveData = false;
        this.selectDate = item;
        this.haveData = true;
      },
      //日期选择
      changeDate() {
        var that = this;
        if (this.postData.OutDateTimeList && this.postData.OutDateTimeList.length > 0) {
          var rootObj = null;
          if (this.postData.OfferArray && this.postData.OfferArray.length > 0) {
            rootObj = this.postData.OfferArray[0]
          }
          this.postData.OutDateTimeList.forEach(subItem => {
            var tempObj = that.getOfferObj();
            tempObj.OutDateTime = subItem;
            var existsObj = that.postData.OfferArray.find((qitem) => {
              return qitem.OutDateTime == subItem
            })
            //第一个报价在添加日期的
            if (!existsObj) {
              if (rootObj) {
                tempObj = JSON.parse(JSON.stringify(rootObj));
                tempObj.DMCNum = "";
              }
              tempObj.OutDateTime = subItem;
              that.postData.OfferArray.push(tempObj);
            }
          });
          if (this.postData && this.postData.OfferArray && this.postData.OfferArray.length > 0) {
            if (this.postData.BatchNum == '') {
              that.switchOffer(this.postData.OfferArray[0].OutDateTime)
            } else {
              var lastItem = this.postData.OfferArray[this.postData.OfferArray.length - 1];
              that.switchOffer(lastItem.OutDateTime)
            }
          }
        }
      },
      //获取报价单对象
      getOfferObj() {
        var offerObj = {
          OfferPayType: 0, //报价单付款方式
          SaleOfferPayType: 0, //售价付款方式
          OutDateTime: "", //出发时间
          AssistantId: "", //助理OP[格式:1,2,3]
          OPId: "", //主OP
          DMCNum: "", //地接团号
          AssistantList: [], //助理OP数组
          CostCurrencyList: [],
          CostNumberList: [], //报价人数
          CurrencyNumberListExt: [], //币种和人数列表
          teamPrice: {
            QuotationId: 0, //主键编号
            TeamId: 0, //团期编号
            ConfigID: 0, //团队配置编号
            OfferId: 0, //报价编号
            B2BMemberPrice: 0, //同业会员价
            B2BPrice: 0, //同业价格
            B2CMemberPrice: 0, //直客会员价,
            B2CPrice: 0, //直客价格
            ChildNeedPrice: 0, //小孩占床价格,
            ChildNoNeedPrice: 0, //小孩不占床价格
            BabyPrice: 0, //婴儿价格
            BabyChargePrice: 0, //婴儿附加费
            OldManChargePrice: 0, //老人附加费
            VisaPrice: 0, //签证
            OtherPrice: 0, //杂费
            SingleRoomPrice: 0, //单房差
            SingleDMCPrice: 0, //单地接(成本)
            SingleDMCTCPrice: 0, //单地接团售价
            RebatePrice: 0, //同行返佣
            DiscountPrice: 0, //早鸟优惠
            IsSupportChildren: 1, //是否支持儿童出游(1-支持,2-不支持)
            SafeMoney: 0, //保险费
            PeopleNumber: 0, //人数
            AirticketMoney: 0, //机票费用
            BackVisaPrice: 0, //退签证费
            BackSafeMoney: 0, //退保险费
            ContractUrl: "", //合同地址
            PriceRemark: "", //定价备注
            ContractArray: [],
            TaxPrice: 0, //税金
            UnionPrice: 0, //联运价格
            NightPrice: 0, //过夜费
          }, //团队价格信息
          otherPrice: {
            CostId: 0, //主键编号
            ConfigID: 0, //配置编号
            OfferId: 0, //报价单编号
            InlandAirTicketCurrency: 0, //内陆段机位币种
            InlandAirTicketMoney: 0, //内陆段机位金额(每人)
            InlandShipTicketCurrency: 0, //内陆段船票币种
            InlandShipTicketMoney: 0, //内陆段船票金额(每人)
            InlandTrainTicketCurrency: 0, //内陆段火车币种
            InlandTrainTicketMoney: 0, //内陆段火车金额(每人)
            VisaMoney: 0, //签证费用(每人)
            SafeMoney: 0, //保险费用(每人)
            LeaderTripMoney: 0, //领队小费
            DriverGuideMoney: 0, //司机小费
            SalesCommissionMoney: 0, //销售提成
            OfficeCommissionMoney: 0, //作业处提成
            TripMoney: 0, //小费
            GuidePeopleMoney: 0, //导游人头费
            AirTicketMoeny: 0, //机票成本费用
            KBMoney: 0, //KB人头费
            AirTicketShareMoney: 0, //机票分摊费用
            TicketShareMoney: 0, //门票分摊费用,
            SingleRoomShareMoney: 0, //单房差分摊费用
            InlandTrafficShareMoney: 0, //内陆段交通分摊费用
            OtherShareMoney: 0, //杂费分摊费用
            OtherRemark: "", //其他价格备注
            VisaMoneyCurrencyId: 0, //签证费币种
            SafeMoneyCurrencyId: 0, //保险费币种
            LeaderTripMoneyCurrencyId: 0, //领队小费币种
            DriverGuideMoneyCurrencyId: 0, //司机小费币种
            LeaderGuideDriveZhuSu: 0, //领队导游住宿费
            GuideMoneyCurrencyId: 0, //导游小费币种
            GuideMoney: 0, //导游小费
            InternationalAirTicket: 0, //国际段机票
            InternationalAirTicketCurrency: 0, //国际段机票币种
            GuideComplement: 0, //导游回补
            TipComplement: 0, //小费回补
          }, //其他报价
        };
        return offerObj;
      },
      //删除日期
      handleClose(item, index) {
        var that = this;
        var tipMsg = "是否要删除【" + item + "】报价?";
        that.Confirm(tipMsg, function () {
          if (that.postData.BatchNum && that.postData.BatchNum != '') {
            var postMsg = {
              BatchNum: that.postData.BatchNum,
              Date: item
            }
            that.apipost(
              "travel_post_RemoveTravelOffer", postMsg,
              res => {
                if (res.data.resultCode == 1) {}
              });
            that.postData.OutDateTimeList.splice(index, 1);
          } else {
            that.postData.OutDateTimeList.splice(index, 1);
          }
          if (that.postData.OfferArray && that.postData.OfferArray.length > 0) {
            var sIndex = that.postData.OfferArray.findIndex(qitem => qitem.OutDateTime == item);
            that.postData.OfferArray.splice(sIndex, 1);
            if (that.postData.OfferArray && that.postData.OfferArray.length > 0) {
              var lastItem = that.postData.OfferArray[that.postData.OfferArray.length - 1];
              that.switchOffer(lastItem.OutDateTime)
            }
          }
        });
      },
      changeTeamType() {
        this.postData.LineId = 0;
        this.postData.LineteamId = 0;
        this.postData.PriceTeamType = '';
        if (this.postData.TeamType == 0) {
          this.postData.PriceTeamType = 1;
        }
      },
      //获取所有币种
      getAllCurrency() {
        this.apipost(
          "financeinfo_post_GetList", {},
          res => {
            if (res.data.resultCode == 1) {
              this.AllCurrencyList = res.data.data;
              this.AllCurrencyList.forEach(item => {
                if (item.ID == 3) {
                  //徐总说日元默认加0.002
                  item.CurrentRate = Number(item.CurrentRate) + Number(0.002);
                }
              });
            }
          });
      },
      //出团公司
      getCompanyList() {
        this.apipost(
          "sellorder_post_GetBranchList", {},
          res => {
            if (res.data.resultCode == 1) {
              this.companyList = res.data.data;
            }
          });
      },
      //线路切换
      changeLine() {
        this.getLineTeamList(this.postData.LineId, 1);
      },
      //获取系列列表
      getLineTeamList(lineId, isClear) {
        if (isClear && isClear == 1) {
          this.postData.LineteamId = 0;
        }
        let msg = {
          lineID: lineId,
          isTOOP: 1
        };
        this.apipost("team_post_GetList", msg, res => {
          if (res.data.resultCode == 1) {
            this.LineTeamList = res.data.data;
          }
        });
      },
      //获取团队类型
      getPriceTeamList() {
        this.apipost("travel_get_GetTravelPriceTeamTypeList", {}, res => {
          if (res.data.resultCode == 1) {
            this.TeamListArr = res.data.data;
          } else {
            this.Error(res.data.message);
          }
        }, err => {});
      },
      createDayTripPrice() {
        this.haveData = false;
        var tempArray = this.createDayTripPriceItem(this.postData.dayCostPriceList);
        this.postData.dayCostPriceList = JSON.parse(JSON.stringify(tempArray));
        this.haveData = true;
        this.$forceUpdate()
      },
      //生成行程报价
      createDayTripPriceItem(dayCostPriceList) {
        if (this.postData.DayNum > dayCostPriceList.length) {
          for (var i = dayCostPriceList.length; i < this.postData.DayNum; i++) {
            //去掉以前默认的交通
            var dayItem = {
              Id: 0, //主键编号
              OfferId: 0, //报价单编号
              ConfigId: 0, //配置编号
              Title: "", //行程大点
              DayNum: i + 1, //行程天数
              CurrencyId: 0, //币种
              HotelCostPrice: 0, //酒店报价
              BusCostPrice: 0, //车辆报价
              ScenicCostPrice: 0, //景点报价
              BreakfastCostPrice: 0, //早餐报价
              LunchCostPrice: 0, //午餐报价
              DinnerCostPrice: 0, //晚餐报价
              ContainDinnerType: 0, //含餐类型(1-含早餐,2-含晚餐,3-含早晚)
              PassFee: 0, //过路费
              HotelName: "", //酒店名称
              RebatePrice: 0, //回佣
              OtherPrice: 0, //其它费用(保险、司导杂费等)
              DinnerIds: "", //晚餐Id
              DinnerName: "", //晚餐名称
              LunchIds: "", //午餐编号
              LunchName: "", //午餐名称
              TicketIds: "", //景点编号
              ScenicList: [{
                TicketId: 0,
                TicketName: "",
                TicketCostPrice: 0
              }, {
                TicketId: 0,
                TicketName: "",
                TicketCostPrice: 0
              }, {
                TicketId: 0,
                TicketName: "",
                TicketCostPrice: 0
              }], //景点JSON数据
              TicketName: "", //景点名称
              OtherName: "", //其它杂支名称
              BreakfastName: "", //早餐名称
            };
            dayCostPriceList.push(dayItem);
          }
        } else {
          dayCostPriceList.length = this.postData.DayNum;
        }
        return dayCostPriceList
      },
      //保存数据
      SaveData(type) {
        this.postData.TravelState = type;
        // 线路必填
        if (!this.postData.LineId) {
          this.$message.error(this.$t('rule.qxzxuanlu'))
          return;
        }
        if (this.postData.OPId <= 0 || this.postData.OPId == '') {
          this.$message.error(this.$t('objFill.v101.qingshurzop'))
          return;
        }
        if (this.postData.OutDateTimeList.length < 1) {
          this.$message.error(this.$t('objFill.v101.qingxzcfrq'))
          return;
        }
        this.postData.AssistantId = "";
        var flag = false;
        if (this.postData.AssistantList && this.postData.AssistantList.length > 0) {
          this.postData.AssistantId = this.postData.AssistantList.join(',');
          this.postData.AssistantList.forEach(sItem => {
            if (sItem == this.postData.OPId && !flag) {
              flag = true;
            }
          });
        }
        if (flag) {
          this.Error(this.$t('objFill.v101.zhulopbnhzopcx'));
          return;
        }
        this.loading = true;
        this.apipost(
          "travel_post_SetPriceOfferInfo", this.postData,
          res => {
            this.loading = false;
            if (res.data.resultCode == 1) {
              this.Success(res.data.message);
              this.goUrl('newQuotation');
            } else {
              this.ErrorHtml(res.data.message);
            }
          });
      },
      goUrl(path) {
        this.$router.push({
          path: path,
          query: {

          }
        });
      },
      //刷新页面
      refreshPage() {
        this.getPostData();
      },
      getPostData() {
        let offerId = 0;
        if (this.$route.query.offerid) {
          offerId = this.$route.query.offerid;
        }
        let BatchNum = "";
        if (this.$route.query.BatchNum) {
          BatchNum = this.$route.query.BatchNum;
        }
        let msg = {
          offerId: offerId,
          TCID: 0,
          BatchNum: BatchNum
        };
        if (this.$route.query.TCID && this.$route.query.TCID > 0) {
          msg.TCID = this.$route.query.TCID
        }
        this.loading = true;
        this.apipost(
          "travel_get_PriceOfferInfo", msg,
          res => {
            console.log("travel_get_PriceOfferInfo", res);
            this.loading = false;
            if (res.data.resultCode == 1) {
              var tempData = res.data.data;

              if (tempData.LineId && tempData.LineId > 0) {
                this.postData.LineId = tempData.LineId;
              }
              if (tempData.LineteamId && tempData.LineteamId > 0) {
                this.postData.LineteamId = tempData.LineteamId;
              }
              if (tempData.Title && tempData.Title != '') {
                this.postData.Title = tempData.Title;
              }
              if (tempData.DayNum && tempData.DayNum > 0) {
                this.postData.DayNum = tempData.DayNum;
              }
              if (tempData.NightNum && tempData.NightNum > 0) {
                this.postData.NightNum = tempData.NightNum;
              }
              if (tempData.CustomerName) {
                this.postData.CustomerName = tempData.CustomerName;
              }
              if (tempData.OutDateTime) {
                this.postData.OutDateTime = tempData.OutDateTime;
              }
              if (tempData.OutDateTimeList) {
                this.postData.OutDateTimeList = tempData.OutDateTimeList;
              }
              if (tempData.OutBranchName && tempData.OutBranchName != '') {
                this.postData.OutBranchId = Number(tempData.OutBranchId);
              }
              if (tempData.IsRoll) {
                this.postData.IsRoll = tempData.IsRoll;
              }
              this.postData.TeamType = tempData.TeamType;
              this.postData.PriceTeamType = tempData.PriceTeamType;
              this.postData.TravelState = tempData.TravelState;
              this.LineList = tempData.LineList;
              if (tempData && tempData.OfferArray && tempData.OfferArray.length > 0) {
                this.postData.dayCostPriceList = tempData.OfferArray[0].dayCostPriceList;
                this.postData.OfferArray = tempData.OfferArray;
                this.postData.OPId = tempData.OfferArray[0].OPId;
                var tempA_Array = tempData.OfferArray[0].AssistantList;
                if (tempA_Array && tempA_Array.length > 0) {
                  tempA_Array.forEach(aItem => {
                    this.postData.AssistantList.push(aItem.Id);
                  })
                }
                this.switchOffer(tempData.OfferArray[0].OutDateTime);
              }
            } else {
              this.Error(res.data.message);
            }
          },
          err => {}
        );
      },
      //团队类型
      getTeamList() {
        this.apipost(
          "travel_GetTeamTypeEnumList", {},
          res => {
            if (res.data.resultCode == 1) {
              this.teamList = res.data.data;
            }
          });
      },
    },
    created() {
      if (this.$route.query.offerid && this.$route.query.offerid > 0) {
        this.postData.OfferId = this.$route.query.offerid;
        this.rParams.OfferId = this.$route.query.offerid
      }
      if (this.$route.query.BatchNum) {
        this.postData.BatchNum = this.$route.query.BatchNum;
        this.rParams.BatchNum = this.$route.query.BatchNum;
      }
      //从团控列表跳转信息
      if (this.$route.query.TCID && this.$route.query.TCID > 0) {
        this.postData.TCID = this.$route.query.TCID;
        this.rParams.TCID = this.$route.query.TCID;
      }
      //团控列表跳转参数结束
      this.getCompanyList();
      this.getTeamList();
      this.getLineTeamList();
      this.getAllCurrency();
      this.getPriceTeamList();
    },
    mounted() {
      this.getPostData();
    }
  };

</script>