<template>
    <div v-loading.fullscreen.lock="loading">
        <div class="hotelr-all">
            <div class="hotelr-head">
                <div class="hotelr-head-li">
                    <label>团组名称:</label>
                    <el-select style="width:220px" @change="delegationSelectChange" v-model="OpHotelReservationsData.diId" clearable filterable
                        placeholder="请选择">
                        <el-option v-for="item in delegationInfoList" :key="item.id" :label="item.teamName"
                            :value="item.id">
                        </el-option>
                    </el-select>
                </div>
                <div class="hotelr-info">
                    <div class="hotelr-info-li">
                        <label>团 号：</label>
                        <span>{{ delegationInfo.tourCode }}</span>
                    </div>
                    <div class="hotelr-info-li">
                        <label>客 户：</label>
                        <span>{{ delegationInfo.clientName }}</span>
                    </div>
                    <div class="hotelr-info-li">
                        <label>出访国家：</label>
                        <span>{{ delegationInfo.visitCountry|filter_city }}</span>
                    </div>
                    <div class="hotelr-info-li">
                        <label>起止日期：</label>
                        <span>{{ delegationInfo.visitStartDate|filter_time }}~{{delegationInfo.visitEndDate|filter_time}}</span>
                    </div>
                    <div class="hotelr-info-li">
                        <label>天数/人数：</label>
                        <span>{{ delegationInfo.visitDays }}/{{ delegationInfo.visitPNumber }}</span>
                    </div>
                </div>
            </div>
            <div class="hotelr-table">
                <el-table :data="tableDatas.slice((currentPage - 1) * pageSize, currentPage * pageSize)" border
                    style="width: 100%" v-loading="loading" element-loading-text="拼命加载中...">
                    <el-table-column type="index" label="序号" width="55">
                    </el-table-column>
                    <!-- <el-table-column prop="reservationsNo" label="预定号">
                    </el-table-column> -->
                    <el-table-column prop="hotelName" label="酒店名称" width="">
                    </el-table-column>
                    <el-table-column prop="checkInDate" label="入住日期" width="120">
                    </el-table-column>
                    <el-table-column prop="checkOutDate" label="退房日期" width="120">
                    </el-table-column>
                    <el-table-column prop="payMoney" label="付款金额" width="">
                        <template slot-scope="scope">
                            {{ scope.row.payMoney.toFixed(2) }} ({{ scope.row.payCurrency }})
                        </template>
                    </el-table-column>
                    <el-table-column prop="createUserName" label="操作人" width="90">
                    </el-table-column>
                    <el-table-column prop="createTime" label="操作时间" width="180">
                    </el-table-column>
                    <el-table-column prop="isAuditGMStr" label="是否审核" width="85">
                    </el-table-column>
                    <el-table-column prop="name" label="操 作" width="140">
                        <template slot-scope="scope">
                                <el-button type="primary" size="mini" icon="el-icon-edit"
                                    @click="PostHotelReservationsDetails(scope.$index, scope.row)"></el-button>
                                <el-button type="danger" size="mini" icon="el-icon-delete"
                                    @click="delinif(scope.$index, scope.row)"></el-button>
                           
                        </template>
                    </el-table-column>
                    <!-- <el-table-column prop="address" label="VOUCHER" width="100">
                        <template slot-scope="scope">
                            <i @click="DownloadVOUCHER(scope.$index, scope.row)">生成</i>
                        </template>
                    </el-table-column> -->
                </el-table>
                <div class="block">
                    <el-pagination align='center' @size-change="handleSizeChange" @current-change="handleCurrentChange"
                        :current-page="currentPage" :page-sizes="[3, 5, 7, 9]" :page-size="pageSize"
                        layout="total, sizes, prev, pager, next" :total="tableDatas.length">
                    </el-pagination>
                </div>
            </div>
            <div class="hotelr-form">
                <div class="form-head">
                    <div style="display: flex;align-items: center;">
                        <el-popover placement="right" trigger="hover">
                            <div>币种：{{bizhong}}&nbsp;&nbsp;&nbsp;汇率：{{fournum(huilv)}}</div>
                            <el-table :data="budgeting" border>
                                <el-table-column width="50" property="day" label="天数"></el-table-column>
                                <el-table-column width="100" property="date" label="日期"></el-table-column>
                                <el-table-column width="300" property="accon" label="酒店名称"></el-table-column>
                                <el-table-column width="300" property="itin" label="行程描述"></el-table-column>
                                <el-table-column width="110" property="sgr" label="单人间(SGR)"></el-table-column>
                                <el-table-column width="100" property="tbr" label="双人(TBR)"></el-table-column>
                                <el-table-column width="100" property="jS_ES" label="套间(JS_ES)"></el-table-column>
                                <el-table-column width="115" label="套房(SUITE)">
                                    <template slot-scope="scope">
                                        {{ townum(scope.row.suite) }}
                                    </template>
                                </el-table-column>
                            </el-table>
                            <el-button slot="reference">移上提示每天详细房价</el-button>
                        </el-popover>
                        <!-- 客户名单 -->
                        <el-popover
                        placement="bottom"
                        width="662"
                        trigger="hover">
                            <el-table max-height="600" border :data="rollcallarr">
                                <el-table-column width="100" property="date" label="姓名">
                                    <template slot-scope="scope">
                                        {{ scope.row.lastName}}{{scope.row.firstName}}
                                    </template>
                                </el-table-column>
                                <el-table-column width="200" property="lastName" label="拼音">
                                    <template slot-scope="scope">
                                        {{ pinyingxing(scope.row.lastName) }}/{{  pinyingxing(scope.row.firstName) }}
                                    </template>
                                </el-table-column>
                                <el-table-column width="50" property="sex" label="性别">
                                    <template slot-scope="scope">
                                        {{ scope.row.sex==0?'男':'女'}}
                                    </template>
                                </el-table-column>
                                <el-table-column width="110" property="birthDay" label="生日">
                                    <template slot-scope="scope">
                                        {{ fgarr(scope.row.birthDay) }}
                                    </template>
                                </el-table-column>
                                <el-table-column width="200" property="idCardNo" label="身份证号码">
                                    <template slot-scope="scope">
                                        {{ scope.row.idCardNo }}
                                    </template>
                                </el-table-column>
                            </el-table>
                            <el-button style="margin-left: 10px;" slot="reference">移上查看客户名单</el-button>
                            <!-- <span slot="reference" style="cursor: pointer;margin-left: 20px;">"移上查看客户名单"</span> -->
                        </el-popover>
                    </div>
                    <div class="form-head-btn">
                        <el-button type="primary" @click="DownloadVOUCHER">VOUCHER</el-button>
                        <el-button type="primary" @click="ConfirmWord">确认单</el-button>
                        <el-button type="primary" @click="BookingCost">预订成本</el-button>
                        <el-button type="primary" @click="AddToggle(1)">新增切换</el-button>
                        <el-button type="primary" @click="AddBtn('RequiredParameters')">保存设置</el-button>
                    </div>
                </div>
                <el-form :model="RequiredParameters" :rules="RequiredParametersRules"
                    ref="RequiredParameters" label-width="110px" class="demo-OpHotelReservationsData">
                    <div class="form-foundationone select-bz">
                        <div style="display: flex;flex-wrap: wrap;">
                            <el-form-item style="width:395px ;" label="客人类型" prop="TypeGuest">
                                <el-select size="medium" v-model="RequiredParameters.TypeGuest" placeholder="请选择客人类型">
                                    <el-option v-for="item in guestType" :key="item.id" :label="item.name" :value="item.id">
                                    </el-option>
                                </el-select>
                            </el-form-item>
                            <!-- <el-form-item style="width:395px ;" label="银行卡" prop="BankCards">
                                <el-select size="medium" value-key="value" v-model="RequiredParameters.BankCards"
                                    placeholder="银支付信用卡行卡" @change="budgetCurrencyChange"  >
                                    <el-option v-for="item in bankCard" :key="item.id" :label="item.name"
                                        :value="item.id">
                                    </el-option>
                                </el-select>
                            </el-form-item>
                            <el-form-item label="当前团组汇率" >
                                <span>{{ RequiredParameters.CurrentRate*1?RequiredParameters.CurrentRate.toFixed(4):RequiredParameters.CurrentRate}}</span>
                            </el-form-item> -->
                            <el-form-item style="width:395px ;" label="入住卷号码" prop="VoucherNumber">
                                <el-input size="medium" type="text"
                                    v-model="RequiredParameters.VoucherNumber"></el-input>
                            </el-form-item>
                            <el-form-item style="width:395px ;" label="预订网站" prop="BookingWeb">
                                <el-select size="medium" v-model="RequiredParameters.BookingWeb"
                                    placeholder="预订网站">
                                    <el-option v-for="item in bookingWebsite" :key="item.id" :label="item.name"
                                        :value="item.id">
                                    </el-option>
                                </el-select>
                            </el-form-item>
                            <!-- <el-form-item style="width:790px ;" label="预订号码" prop="ReservationNumber">
                                <el-input :rows="1" type="textarea" v-model="RequiredParameters.ReservationNumber"></el-input>
                            </el-form-item> -->
                            <el-form-item style="width:395px ;" label="酒店确定号码" prop="DetermineNumber">
                                <el-input size="medium" type="text"
                                    v-model="RequiredParameters.DetermineNumber"></el-input>
                            </el-form-item>
                            <el-form-item style="width:395px ;" label="所在地区" prop="AreaId">
                                <el-select size="medium" filterable @change="AreaIdchange" v-model="RequiredParameters.AreaId"
                                    placeholder="所在地区">
                                    <el-option v-for="item in countrys" :key="item.id" :label="item.country"
                                        :value="item.id">
                                        {{ item.cityname }}
                                    </el-option>
                                </el-select>
                                <!-- <el-input size="medium" type="text" v-model="RequiredParameters.AreaId"></el-input> -->
                            </el-form-item>
                            <el-form-item style="width:395px ;" label="所在城市" prop="LocationCity">
                                <el-input size="medium" type="text" v-model="RequiredParameters.LocationCity"></el-input>
                            </el-form-item>
                            <el-form-item style="width:395px ;" label="酒店名称" prop="HotelName">
                                <el-input size="medium" type="text" v-model="RequiredParameters.HotelName"></el-input>
                            </el-form-item>
                            <el-form-item style="width:395px ;" label="酒店电话" prop="HotelPhone">
                                <el-input size="medium" type="text" v-model="RequiredParameters.HotelPhone"></el-input>
                            </el-form-item>
                        </div>
                        <el-form-item label="酒店地址" prop="HotelAddress">
                            <el-input :rows="1" type="textarea" v-model="RequiredParameters.HotelAddress"></el-input>
                        </el-form-item>
                        <el-form-item label="客人姓名" prop="GuestName">
                            <el-select
                            size="medium"
                            style="width: 100%;"
                            v-model="RequiredParameters.GuestName"
                            multiple
                            filterable
                            allow-create
                            default-first-option
                            @change="selectchg"
                            placeholder="请选择人员">
                                <el-option
                                v-for="item in GuestNamelist"
                                :key="item.id"
                                :label="item.lastName+item.firstName"
                                :value="item.id">
                                </el-option>
                            </el-select>
                            <!-- <el-input :rows="1" type="textarea" v-model="RequiredParameters.GuestName"></el-input> -->
                        </el-form-item>
                        <div class="remcss" style="display: flex;flex-wrap: wrap;">
                            <el-form-item prop="OnTime" style="width:395px ;" label="入住时间" required>
                                <el-date-picker value-format="yyyy-MM-dd" @change="CalculateAmount" size="medium" type="date" placeholder="选择日期"
                                    v-model="RequiredParameters.OnTime" style="width: 100%;"></el-date-picker>
                            </el-form-item>
                            <el-form-item style="width:395px ;" label="离店时间" prop="OutTime">
                                <el-date-picker value-format="yyyy-MM-dd" @change="CalculateAmount" size="medium" type="date" placeholder="选择时间"
                                    v-model="RequiredParameters.OutTime" style="width: 100%;"></el-date-picker>
                            </el-form-item>
                            <el-form-item style="width:395px ;" label="入住类型" prop="TypeStay">
                                <el-select style="width: 100%;" size="medium" v-model="RequiredParameters.TypeStay"
                                    placeholder="请选择入住人类型">
                                    <el-option v-for="item in CheckType" :key="item.id" :label="item.name"
                                        :value="item.id">
                                    </el-option>
                                </el-select>
                            </el-form-item>
                        </div>
                        <el-form-item label="房间说明" prop="RoomExplain">
                            <el-input :rows="1" type="textarea" v-model="RequiredParameters.RoomExplain"></el-input>
                        </el-form-item>
                        <el-form-item label="备注">
                            <el-input :rows="3" type="textarea" v-model="RequiredParameters.Remark"></el-input>
                        </el-form-item>
                    </div>
                    <div class="form-foundationone">
                        <div class="Exchangerate-box">
                            <div v-for="(item,index) in currencyarrss" :key="index">
                                {{item.currencyCode}}:&nbsp;{{item.rate}}
                            </div>
                        </div>
                        <div style="display: flex;flex-wrap: wrap;">
                            <el-form-item  style="width:395px ;" label="酒店单间">
                                <el-input-number :controls="false" @change="CalculateAmount" style="width:50px ;" size="medium"
                                    v-model="TwoParameters.singleroomsNum"></el-input-number>
                                <span>间</span>
                                <el-input-number @change="CalculateAmount" class="fjprice" style="width:80px;" :precision="2" :controls="false" size="medium" v-model="TwoParameters.singleroomsPrice">
                                </el-input-number>
                                <span>单价</span>
                                <el-select size="medium" filterable @change="selectroomCurrency" v-model="TwoParameters.singleroomsCurrency"
                                    style="width: 80px;" placeholder="">
                                    <el-option v-for="item in currencyList" :key="item.currencyId" :label="item.currencyCode"
                                        :value="item.currencyId">
                                    </el-option>
                                </el-select>
                            </el-form-item>
                            <el-form-item style="width:395px ;" label="酒店双间">
                                <el-input-number :controls="false" @change="CalculateAmount" style="width:50px ;" size="medium"
                                    v-model="TwoParameters.doubleroomNum"></el-input-number>
                                <span>间</span>
                                <el-input-number @change="CalculateAmount" class="fjprice" style="width:80px;" :precision="2" size="medium" :controls="false" v-model="TwoParameters.doubleroomPrice">
                                </el-input-number>
                                <!-- <el-input style="width:80px ;" size="medium"
                                    v-model="TwoParameters.doubleroomPrice"></el-input> -->
                                <span>单价</span>
                                <el-select size="medium" filterable @change="selectroomCurrency" v-model="TwoParameters.doubleroomCurrency"
                                    style="width: 80px;" placeholder="">
                                    <el-option v-for="item in currencyList" :key="item.currencyId" :label="item.currencyCode"
                                        :value="item.currencyId">
                                    </el-option>
                                </el-select>
                            </el-form-item>
                            <el-form-item style="width:395px ;" label="酒店套房">
                                <el-input-number :controls="false" @change="CalculateAmount" style="width:50px ;" size="medium"
                                    v-model="TwoParameters.suiteNum"></el-input-number>
                                <span>间</span>
                                <el-input-number @change="CalculateAmount" class="fjprice" style="width:80px;" :precision="2" size="medium" :controls="false" v-model="TwoParameters.suitePrice">
                                </el-input-number>
                                <!-- <el-input style="width:80px ;" size="medium"
                                    v-model="TwoParameters.suitePrice"></el-input> -->
                                <span>单价</span>
                                <el-select size="medium" filterable @change="selectroomCurrency" v-model="TwoParameters.suiteCurrency"
                                    style="width: 80px;" placeholder="">
                                    <el-option v-for="item in currencyList" :key="item.currencyId" :label="item.currencyCode"
                                        :value="item.currencyId">
                                    </el-option>
                                </el-select>
                            </el-form-item>
                            <el-form-item style="width:395px ;" label="其他房型">
                                <el-input-number :controls="false" @change="CalculateAmount" style="width:50px ;" size="medium"
                                    v-model="TwoParameters.otherroomNum"></el-input-number>
                                <span>间</span>
                                <el-input-number @change="CalculateAmount" class="fjprice" style="width:80px;" :precision="2" size="medium" :controls="false" v-model="TwoParameters.otherroomPrice">
                                </el-input-number>
                                <!-- <el-input style="width:80px ;" size="medium"
                                    v-model="TwoParameters.otherroomPrice"></el-input> -->
                                <span>单价</span>
                                <el-select size="medium"  filterable @change="selectroomCurrency" v-model="TwoParameters.otherroomCurrency"
                                    style="width: 80px;" placeholder="">
                                    <el-option v-for="item in currencyList" :key="item.currencyId" :label="item.currencyCode"
                                        :value="item.currencyId">
                                    </el-option>
                                </el-select>
                            </el-form-item>
                            <el-form-item style="width:395px;" label="酒店房费">
                                <el-input-number class="fjprice" style="width: 50%;" :precision="2" size="medium" :controls="false" v-model="TwoParameters.amount"></el-input-number>
                                <!-- <el-input size="medium" type="text" v-model="TwoParameters.amount" style="width: 50%;" @change="bankCardPriceChange"></el-input> -->
                                <el-input disabled size="medium" type="text" v-model="TwoParameters.credit" style="width: 43%;"></el-input>
                            </el-form-item>
                            <el-form-item style="width:395px ;" label="房费地接代付">
                                <el-switch @change="Payforselection(roomtaxobj.priceType,roomtaxobj.isOppay)" v-model="roomtaxobj.isOppay"></el-switch>
                            </el-form-item>
                            <div style="width: 395px;">
                                <el-form-item label="支付方式:" label-width="110px">
                                    <el-select v-model="roomtaxobj.payDId" placeholder="支付方式"
                                        style="width: 100%;">
                                        <el-option v-for="item in payment" :key="item.id" :label="item.name "
                                            :value="item.id">
                                        </el-option>
                                    </el-select>
                                </el-form-item>
                            </div>
                            <div style="width: 395px;">
                                <el-form-item label="消费方式:" label-width="110px">
                                    <el-input placeholder="消费方式" v-model="roomtaxobj.consumptionPatterns">
                                    </el-input>
                                </el-form-item>
                            </div>
                            <div style="width: 395px;">
                                <el-form-item label="消费日期:" label-width="110px">
                                    <el-date-picker value-format="yyyy-MM-dd" v-model="roomtaxobj.consumptionDate" placeholder="消费日期"
                                        type="date" style="width: 100%;">
                                    </el-date-picker>
                                </el-form-item>
                            </div>
                            
                            <div v-if="roomtaxobj.payDId == 72" style="width: 395px;">
                                <el-form-item label="卡类型:" label-width="110px">
                                    <el-select v-model="roomtaxobj.ctdId" placeholder="卡类型"
                                        style="width: 100%;" @change="changecardtype">
                                        <el-option v-for="item in bankCard" :key="item.id" :label="item.name"
                                            :value="item.id">
                                        </el-option>
                                    </el-select>
                                </el-form-item>
                            </div>
                            <div v-if="roomtaxobj.payDId == 72" style="width: 395px;">
                                <el-form-item label="银行卡号:" label-width="110px">
                                    <el-input placeholder="银行卡号" v-model="roomtaxobj.bankNo"
                                        :disabled="true">
                                    </el-input>
                                </el-form-item>
                            </div>
                            <div v-if="roomtaxobj.payDId == 72" style="width: 395px;">
                                <el-form-item label="持卡人姓名:" label-width="110px">
                                    <el-input placeholder="持卡人姓名" v-model="roomtaxobj.cardholderName"
                                        :disabled="true">
                                    </el-input>
                                </el-form-item>
                            </div>
                            <div v-if="roomtaxobj.payDId == 73" style="width: 395px;">
                                <el-form-item label="公司银行账号:" label-width="110px">
                                    <el-input placeholder="公司银行账号" v-model="roomtaxobj.companyBankNo">
                                    </el-input>
                                </el-form-item>
                            </div>
                            <div v-if="roomtaxobj.payDId == 73" style="width: 395px;">
                                <el-form-item label="对方开户行:" label-width="110px">
                                    <el-input placeholder="对方开户行:" v-model="roomtaxobj.otherBankName">
                                    </el-input>
                                </el-form-item>
                            </div>
                            <div v-if="roomtaxobj.payDId == 73" style="width: 395px;">
                                <el-form-item label="对方银行卡号:" label-width="110px">
                                    <el-input placeholder="对方银行卡号" v-model="roomtaxobj.otherSideNo">
                                    </el-input>
                                </el-form-item>
                            </div>
                            <div v-if="roomtaxobj.payDId == 73" style="width: 395px;">
                                <el-form-item label="对方姓名:" label-width="110px">
                                    <el-input placeholder="对方姓名" v-model="roomtaxobj.otherSideName">
                                    </el-input>
                                </el-form-item>
                            </div>
                            <div v-if="roomtaxobj.payDId == 83||roomtaxobj.payDId == 1067||roomtaxobj.payDId == 1068" style="width: 395px;">
                                <el-form-item label="对方开户行:" label-width="110px">
                                    <el-input placeholder="对方开户行" v-model="roomtaxobj.otherBankName">
                                    </el-input>
                                </el-form-item>
                            </div>
                            <div v-if="roomtaxobj.payDId == 83||roomtaxobj.payDId == 1067||roomtaxobj.payDId == 1068" style="width: 395px;">
                                <el-form-item label="对方银行卡号:" label-width="110px">
                                    <el-input placeholder="对方银行卡号" v-model="roomtaxobj.otherSideNo">
                                    </el-input>
                                </el-form-item>
                            </div>
                            <div v-if="roomtaxobj.payDId == 83||roomtaxobj.payDId == 1067||roomtaxobj.payDId == 1068" style="width: 395px;">
                                <el-form-item label="对方姓名:" label-width="110px">
                                    <el-input placeholder="对方姓名" v-model="roomtaxobj.otherSideName">
                                    </el-input>
                                </el-form-item>
                            </div>
                            <div style="width: 395px;">
                                <el-form-item label="收款方:" label-width="110px">
                                    <el-input placeholder="收款方" v-model="roomtaxobj.payee">
                                    </el-input>
                                </el-form-item>
                            </div>
                            <div style="width: 395px;">
                                <el-form-item label="费用标识:" label-width="110px">
                                    <el-select v-model="roomtaxobj.orbitalPrivateTransfer" placeholder="费用标识"
                                        style="width: 100%;">
                                        <el-option key="-1" label="未选择" :value=-1>
                                        </el-option>
                                        <el-option key="0" label="公转" :value=0>
                                        </el-option>
                                        <el-option key="1" label="私转" :value=1>
                                        </el-option>
                                    </el-select>
                                </el-form-item>
                            </div>
                        </div>
                        
                        <div class="payment-detail" style="display: flex;flex-wrap: wrap;">
                            <el-form-item style="width:395px ;" label="城市税">
                                <el-input-number :controls="false" :precision="2" style="width:50% ;" size="medium"
                                    v-model="TwoParameters.CitytaxPrice" @change="AmountPayment"></el-input-number>
                                <el-select style="width:43% ;" size="medium"
                                    v-model="TwoParameters.CitytaxCurrency" placeholder="请选择" clearable filterable
                                    @change="AmountPayment">
                                    <el-option v-for="item in currencyList" :key="item.currencyId" :label="item.currencyCode"
                                        :value="item.currencyId">
                                    </el-option>
                                </el-select>
                            </el-form-item>
                            <el-form-item style="width:395px ;" label="城市税地接代付">
                                <el-switch @change="Payforselection(Citytaxobj.priceType,Citytaxobj.isOppay)" v-model="Citytaxobj.isOppay"></el-switch>
                            </el-form-item>
                            <div style="width: 395px;">
                                <el-form-item label="支付方式:" label-width="110px">
                                    <el-select v-model="Citytaxobj.payDId" placeholder="支付方式"
                                        style="width: 100%;">
                                        <el-option v-for="item in payment" :key="item.id" :label="item.name"
                                            :value="item.id">
                                        </el-option>
                                    </el-select>
                                </el-form-item>
                            </div>
                            <div style="width: 395px;">
                                <el-form-item label="消费方式:" label-width="110px">
                                    <el-input placeholder="消费方式" v-model="Citytaxobj.consumptionPatterns">
                                    </el-input>
                                </el-form-item>
                            </div>
                            <div style="width: 395px;">
                                <el-form-item label="消费日期:" label-width="110px">
                                    <el-date-picker value-format="yyyy-MM-dd" v-model="Citytaxobj.consumptionDate" placeholder="消费日期"
                                        type="date" style="width: 100%;">
                                    </el-date-picker>
                                </el-form-item>
                            </div>
                            <div v-if="Citytaxobj.payDId == 72" style="width: 395px;">
                                <el-form-item label="卡类型:" label-width="110px">
                                    <el-select v-model="Citytaxobj.ctdId" placeholder="卡类型"
                                        style="width: 100%;" @change="citychangecardtype">
                                        <el-option v-for="item in bankCard" :key="item.id" :label="item.name"
                                            :value="item.id">
                                        </el-option>
                                    </el-select>
                                </el-form-item>
                            </div>
                            <div v-if="Citytaxobj.payDId == 72" style="width: 395px;">
                                <el-form-item label="银行卡号:" label-width="110px">
                                    <el-input placeholder="银行卡号" v-model="Citytaxobj.bankNo"
                                        :disabled="true">
                                    </el-input>
                                </el-form-item>
                            </div>
                            <div v-if="Citytaxobj.payDId == 72" style="width: 395px;">
                                <el-form-item label="持卡人姓名:" label-width="110px">
                                    <el-input placeholder="持卡人姓名" v-model="Citytaxobj.cardholderName"
                                        :disabled="true">
                                    </el-input>
                                </el-form-item>
                            </div>
                            <div v-if="Citytaxobj.payDId == 73" style="width: 395px;">
                                <el-form-item label="公司银行账号:" label-width="110px">
                                    <el-input placeholder="公司银行账号" v-model="Citytaxobj.companyBankNo">
                                    </el-input>
                                </el-form-item>
                            </div>
                            <div v-if="Citytaxobj.payDId == 73" style="width: 395px;">
                                <el-form-item label="对方开户行:" label-width="110px">
                                    <el-input placeholder="对方开户行:" v-model="Citytaxobj.otherBankName">
                                    </el-input>
                                </el-form-item>
                            </div>
                            <div v-if="Citytaxobj.payDId == 73" style="width: 395px;">
                                <el-form-item label="对方银行卡号:" label-width="110px">
                                    <el-input placeholder="对方银行卡号" v-model="Citytaxobj.otherSideNo">
                                    </el-input>
                                </el-form-item>
                            </div>
                            <div v-if="Citytaxobj.payDId == 73" style="width: 395px;">
                                <el-form-item label="对方姓名:" label-width="110px">
                                    <el-input placeholder="对方姓名" v-model="Citytaxobj.otherSideName">
                                    </el-input>
                                </el-form-item>
                            </div>
                            <div v-if="Citytaxobj.payDId == 83||Citytaxobj.payDId == 1067||Citytaxobj.payDId == 1068" style="width: 395px;">
                                <el-form-item label="对方开户行:" label-width="110px">
                                    <el-input placeholder="对方开户行" v-model="Citytaxobj.otherBankName">
                                    </el-input>
                                </el-form-item>
                            </div>
                            <div v-if="Citytaxobj.payDId == 83||Citytaxobj.payDId == 1067||Citytaxobj.payDId == 1068" style="width: 395px;">
                                <el-form-item label="对方银行卡号:" label-width="110px">
                                    <el-input placeholder="对方银行卡号" v-model="Citytaxobj.otherSideNo">
                                    </el-input>
                                </el-form-item>
                            </div>
                            <div v-if="Citytaxobj.payDId == 83||Citytaxobj.payDId == 1067||Citytaxobj.payDId == 1068" style="width: 395px;">
                                <el-form-item label="对方姓名:" label-width="110px">
                                    <el-input placeholder="对方姓名" v-model="Citytaxobj.otherSideName">
                                    </el-input>
                                </el-form-item>
                            </div>
                            <div style="width: 395px;">
                                <el-form-item label="收款方:" label-width="110px">
                                    <el-input placeholder="收款方" v-model="Citytaxobj.payee">
                                    </el-input>
                                </el-form-item>
                            </div>
                            <div style="width: 395px;">
                                <el-form-item label="费用标识:" label-width="110px">
                                    <el-select v-model="Citytaxobj.orbitalPrivateTransfer" placeholder="费用标识"
                                        style="width: 100%;">
                                        <el-option key="-1" label="未选择" :value=-1>
                                        </el-option>
                                        <el-option key="0" label="公转" :value=0>
                                        </el-option>
                                        <el-option key="1" label="私转" :value=1>
                                        </el-option>
                                    </el-select>
                                </el-form-item>
                            </div>
                        </div>
                        <div class="payment-detail" style="display: flex;flex-wrap: wrap;">
                            <el-form-item style="width:395px ;" label="地税">
                                <el-input-number :controls="false" :precision="2" style="width:50% ;" size="medium"
                                    v-model="TwoParameters.RentPrice"
                                    @change="AmountPayment"></el-input-number>
                                <el-select style="width:43% ;" size="medium"
                                    v-model="TwoParameters.RentCurrency" placeholder="请选择" clearable
                                    filterable @change="AmountPayment">
                                    <el-option v-for="item in currencyList" :key="item.currencyId" :label="item.currencyCode"
                                        :value="item.currencyId">
                                    </el-option>
                                </el-select>
                            </el-form-item>
                            <el-form-item style="width:395px ;" label="地税地接代付">
                                <el-switch @change="Payforselection(landtaxobj.priceType,landtaxobj.isOppay)" v-model="landtaxobj.isOppay"></el-switch>
                            </el-form-item>
                            <div style="width: 395px;">
                                <el-form-item label="支付方式:" label-width="110px">
                                    <el-select v-model="landtaxobj.payDId" placeholder="支付方式"
                                        style="width: 100%;">
                                        <el-option v-for="item in payment" :key="item.id" :label="item.name"
                                            :value="item.id">
                                        </el-option>
                                    </el-select>
                                </el-form-item>
                            </div>
                            <div style="width: 395px;">
                                <el-form-item label="消费方式:" label-width="110px">
                                    <el-input placeholder="消费方式" v-model="landtaxobj.consumptionPatterns">
                                    </el-input>
                                </el-form-item>
                            </div>
                            <div style="width: 395px;">
                                <el-form-item label="消费日期:" label-width="110px">
                                    <el-date-picker value-format="yyyy-MM-dd" v-model="landtaxobj.consumptionDate" placeholder="消费日期"
                                        type="date" style="width: 100%;">
                                    </el-date-picker>
                                </el-form-item>
                            </div>
                            <div v-if="landtaxobj.payDId == 72" style="width: 395px;">
                                <el-form-item label="卡类型:" label-width="110px">
                                    <el-select v-model="landtaxobj.ctdId" placeholder="卡类型"
                                        style="width: 100%;" @change="landchangecardtype">
                                        <el-option v-for="item in bankCard" :key="item.id" :label="item.name"
                                            :value="item.id">
                                        </el-option>
                                    </el-select>
                                </el-form-item>
                            </div>
                            <div v-if="landtaxobj.payDId == 72" style="width: 395px;">
                                <el-form-item label="银行卡号:" label-width="110px">
                                    <el-input placeholder="银行卡号" v-model="landtaxobj.bankNo"
                                        :disabled="true">
                                    </el-input>
                                </el-form-item>
                            </div>
                            <div v-if="landtaxobj.payDId == 72" style="width: 395px;">
                                <el-form-item label="持卡人姓名:" label-width="110px">
                                    <el-input placeholder="持卡人姓名" v-model="landtaxobj.cardholderName"
                                        :disabled="true">
                                    </el-input>
                                </el-form-item>
                            </div>
                            <div v-if="landtaxobj.payDId == 73" style="width: 395px;">
                                <el-form-item label="公司银行账号:" label-width="110px">
                                    <el-input placeholder="公司银行账号" v-model="landtaxobj.companyBankNo">
                                    </el-input>
                                </el-form-item>
                            </div>
                            <div v-if="landtaxobj.payDId == 73" style="width: 395px;">
                                <el-form-item label="对方开户行:" label-width="110px">
                                    <el-input placeholder="对方开户行:" v-model="landtaxobj.otherBankName">
                                    </el-input>
                                </el-form-item>
                            </div>
                            <div v-if="landtaxobj.payDId == 73" style="width: 395px;">
                                <el-form-item label="对方银行卡号:" label-width="110px">
                                    <el-input placeholder="对方银行卡号" v-model="landtaxobj.otherSideNo">
                                    </el-input>
                                </el-form-item>
                            </div>
                            <div v-if="landtaxobj.payDId == 73" style="width: 395px;">
                                <el-form-item label="对方姓名:" label-width="110px">
                                    <el-input placeholder="对方姓名" v-model="landtaxobj.otherSideName">
                                    </el-input>
                                </el-form-item>
                            </div>
                            <div v-if="landtaxobj.payDId == 83||landtaxobj.payDId == 1067||landtaxobj.payDId == 1068" style="width: 395px;">
                                <el-form-item label="对方开户行:" label-width="110px">
                                    <el-input placeholder="对方开户行" v-model="landtaxobj.otherBankName">
                                    </el-input>
                                </el-form-item>
                            </div>
                            <div v-if="landtaxobj.payDId == 83||landtaxobj.payDId == 1067||landtaxobj.payDId == 1068" style="width: 395px;">
                                <el-form-item label="对方银行卡号:" label-width="110px">
                                    <el-input placeholder="对方银行卡号" v-model="landtaxobj.otherSideNo">
                                    </el-input>
                                </el-form-item>
                            </div>
                            <div v-if="landtaxobj.payDId == 83||landtaxobj.payDId == 1067||landtaxobj.payDId == 1068" style="width: 395px;">
                                <el-form-item label="对方姓名:" label-width="110px">
                                    <el-input placeholder="对方姓名" v-model="landtaxobj.otherSideName">
                                    </el-input>
                                </el-form-item>
                            </div>
                            <div style="width: 395px;">
                                <el-form-item label="收款方:" label-width="110px">
                                    <el-input placeholder="收款方" v-model="landtaxobj.payee">
                                    </el-input>
                                </el-form-item>
                            </div>
                            <div style="width: 395px;">
                                <el-form-item label="费用标识:" label-width="110px">
                                    <el-select v-model="landtaxobj.orbitalPrivateTransfer" placeholder="费用标识"
                                        style="width: 100%;">
                                        <el-option key="-1" label="未选择" :value=-1>
                                        </el-option>
                                        <el-option key="0" label="公转" :value=0>
                                        </el-option>
                                        <el-option key="1" label="私转" :value=1>
                                        </el-option>
                                    </el-select>
                                </el-form-item>
                            </div>
                        </div>
                        <div class="payment-detail" style="display: flex;flex-wrap: wrap;">
                            <el-form-item style="width:395px ;" label="酒店早餐">
                                <el-input-number :controls="false" :precision="2" style="width:50% ;" size="medium"
                                    v-model="TwoParameters.breakfastPrice"
                                    @change="AmountPayment"></el-input-number>
                                <el-select style="width:43% ;" size="medium"
                                    v-model="TwoParameters.breakfastCurrency" placeholder="请选择" clearable
                                    filterable @change="AmountPayment">
                                    <el-option v-for="item in currencyList" :key="item.currencyId" :label="item.currencyCode"
                                        :value="item.currencyId">
                                    </el-option>
                                </el-select>
                            </el-form-item>
                            <el-form-item style="width:395px ;" label="早餐地接代付">
                                <el-switch @change="Payforselection(Hotelbreakfastobj.priceType,Hotelbreakfastobj.isOppay)" v-model="Hotelbreakfastobj.isOppay"></el-switch>
                            </el-form-item>
                            <div style="width: 395px;">
                                <el-form-item label="支付方式:" label-width="110px">
                                    <el-select v-model="Hotelbreakfastobj.payDId" placeholder="支付方式"
                                        style="width: 100%;">
                                        <el-option v-for="item in payment" :key="item.id" :label="item.name"
                                            :value="item.id">
                                        </el-option>
                                    </el-select>
                                </el-form-item>
                            </div>
                            <div style="width: 395px;">
                                <el-form-item label="消费方式:" label-width="110px">
                                    <el-input placeholder="消费方式" v-model="Hotelbreakfastobj.consumptionPatterns">
                                    </el-input>
                                </el-form-item>
                            </div>
                            <div style="width: 395px;">
                                <el-form-item label="消费日期:" label-width="110px">
                                    <el-date-picker value-format="yyyy-MM-dd" v-model="Hotelbreakfastobj.consumptionDate" placeholder="消费日期"
                                        type="date" style="width: 100%;">
                                    </el-date-picker>
                                </el-form-item>
                            </div>
                            <div v-if="Hotelbreakfastobj.payDId == 72" style="width: 395px;">
                                <el-form-item label="卡类型:" label-width="110px">
                                    <el-select v-model="Hotelbreakfastobj.ctdId" placeholder="卡类型"
                                        style="width: 100%;" @change="Hotelchangecardtype">
                                        <el-option v-for="item in bankCard" :key="item.id" :label="item.name"
                                            :value="item.id">
                                        </el-option>
                                    </el-select>
                                </el-form-item>
                            </div>
                            <div v-if="Hotelbreakfastobj.payDId == 72" style="width: 395px;">
                                <el-form-item label="银行卡号:" label-width="110px">
                                    <el-input placeholder="银行卡号" v-model="Hotelbreakfastobj.bankNo"
                                        :disabled="true">
                                    </el-input>
                                </el-form-item>
                            </div>
                            <div v-if="Hotelbreakfastobj.payDId == 72" style="width: 395px;">
                                <el-form-item label="持卡人姓名:" label-width="110px">
                                    <el-input placeholder="持卡人姓名" v-model="Hotelbreakfastobj.cardholderName"
                                        :disabled="true">
                                    </el-input>
                                </el-form-item>
                            </div>
                            <div v-if="Hotelbreakfastobj.payDId == 73" style="width: 395px;">
                                <el-form-item label="公司银行账号:" label-width="110px">
                                    <el-input placeholder="公司银行账号" v-model="Hotelbreakfastobj.companyBankNo">
                                    </el-input>
                                </el-form-item>
                            </div>
                            <div v-if="Hotelbreakfastobj.payDId == 73" style="width: 395px;">
                                <el-form-item label="对方开户行:" label-width="110px">
                                    <el-input placeholder="对方开户行:" v-model="Hotelbreakfastobj.otherBankName">
                                    </el-input>
                                </el-form-item>
                            </div>
                            <div v-if="Hotelbreakfastobj.payDId == 73" style="width: 395px;">
                                <el-form-item label="对方银行卡号:" label-width="110px">
                                    <el-input placeholder="对方银行卡号" v-model="Hotelbreakfastobj.otherSideNo">
                                    </el-input>
                                </el-form-item>
                            </div>
                            <div v-if="Hotelbreakfastobj.payDId == 73" style="width: 395px;">
                                <el-form-item label="对方姓名:" label-width="110px">
                                    <el-input placeholder="对方姓名" v-model="Hotelbreakfastobj.otherSideName">
                                    </el-input>
                                </el-form-item>
                            </div>
                            <div v-if="Hotelbreakfastobj.payDId == 83||Hotelbreakfastobj.payDId == 1067||Hotelbreakfastobj.payDId == 1068" style="width: 395px;">
                                <el-form-item label="对方开户行:" label-width="110px">
                                    <el-input placeholder="对方开户行" v-model="Hotelbreakfastobj.otherBankName">
                                    </el-input>
                                </el-form-item>
                            </div>
                            <div v-if="Hotelbreakfastobj.payDId == 83||Hotelbreakfastobj.payDId == 1067||Hotelbreakfastobj.payDId == 1068" style="width: 395px;">
                                <el-form-item label="对方银行卡号:" label-width="110px">
                                    <el-input placeholder="对方银行卡号" v-model="Hotelbreakfastobj.otherSideNo">
                                    </el-input>
                                </el-form-item>
                            </div>
                            <div v-if="Hotelbreakfastobj.payDId == 83||Hotelbreakfastobj.payDId == 1067||Hotelbreakfastobj.payDId == 1068" style="width: 395px;">
                                <el-form-item label="对方姓名:" label-width="110px">
                                    <el-input placeholder="对方姓名" v-model="Hotelbreakfastobj.otherSideName">
                                    </el-input>
                                </el-form-item>
                            </div>
                            <div style="width: 395px;">
                                <el-form-item label="收款方:" label-width="110px">
                                    <el-input placeholder="收款方" v-model="Hotelbreakfastobj.payee">
                                    </el-input>
                                </el-form-item>
                            </div>
                            <div style="width: 395px;">
                                <el-form-item label="费用标识:" label-width="110px">
                                    <el-select v-model="Hotelbreakfastobj.orbitalPrivateTransfer" placeholder="费用标识"
                                        style="width: 100%;">
                                        <el-option key="-1" label="未选择" :value=-1>
                                        </el-option>
                                        <el-option key="0" label="公转" :value=0>
                                        </el-option>
                                        <el-option key="1" label="私转" :value=1>
                                        </el-option>
                                    </el-select>
                                </el-form-item>
                            </div>
                        </div>
                        <div class="payment-detail" style="display: flex;flex-wrap: wrap;">
                            <div style="width: 395px;">
                                <el-form-item label="付款金额:" label-width="110px">
                                    <el-input disabled placeholder="付款金额" v-model="Paymentinfor.paymentAmount"
                                        style="width: 52%;">
                                    </el-input>
                                    <el-select disabled v-model="Paymentinfor.paymentCurrency" style="width: 45%;"
                                        filterable>
                                        <el-option v-for="item in currencyList" :key="item.currencyId" :label="item.currencyCode"
                                        :value="item.currencyId">
                                        </el-option>
                                    </el-select>
                                </el-form-item>
                            </div>
                        </div>
                        <!-- <div v-if="Paymentinfor.paymentMethods == 72">
                            <div style="display: flex;flex-wrap: wrap;">
                            </div>
                        </div> -->
                        <!-- <div v-else-if="Paymentinfor.paymentMethods == 73">
                            <div style="display: flex;flex-wrap: wrap;">
                            </div>
                        </div> -->
                        <!-- <div v-else-if="Paymentinfor.paymentMethods == 83||Paymentinfor.paymentMethods == 1067||Paymentinfor.paymentMethods == 1068">
                            <div style="display: flex;flex-wrap: wrap;">
                            </div>
                        </div> -->
                        <!-- <div style="display:flex;flex-wrap: wrap;">
                        </div> -->
                        <div style="display: flex;">
                            <div style="width: 100%;">
                                <el-form-item label="备 注:" label-width="110px">
                                    <el-input type="textarea" :rows="5" placeholder="备注"
                                        v-model="Paymentinfor.remarks"></el-input>
                                </el-form-item>
                            </div>
                        </div>
                    </div>
                </el-form>
            </div>
        </div>
    </div>
</template>
<script>
import { el } from '@fullcalendar/core/internal-common';
import { set } from 'vue';
import {debounce} from '../../store/statice'
import { pinyin } from 'pinyin-pro';
export default {
    data() {
        return {
            userId:0,
            cTable:0,
            pageId:0,
            tableData: [],
            tableDatas: [],
            currentPage: 1, // 当前页码
            pageSize: 5,// 每页的数据条数
            gridData: [],
            uploadURL: "http://132.232.92.186:8888/api/Groups/UploadHotel",
            projectName: "",
            uploadFiles: [],//上传的文件列表
            DelfileName: "",
            headers: {
                Authorization: JSON.parse(localStorage.getItem('userinif')).token,
            },
            loading:false,
            modifieds:0,//能否修改
            Rate: '1',
            loading: false,
            isAuditGM: 0,
            delegationInfoList: [],
            delegationInfo: {},
            guestType: [],//客人类型
            currencyList: [],//币种下拉框
            bankCard: [],//卡类型下拉框
            payment: [],//支付方式下拉框
            bookingWebsite: [],//预订网站
            CheckType: [],
            CardCurrency: '',
            currencySingle: { id: 836, name: 'CNY', remark: '人民币' },
            inifid:0,
            // staydays:1,//入住天数i'an'ting
            GuestNamelist:[],//客人名单
            GuestNameval:[],
            //必填参数
            RequiredParameters:{
                TypeGuest:'',//客人类型
                BankCards:'',//银行卡
                CurrentRate:'',//当前团组汇率
                VoucherNumber:'',//入住卷号码
                BookingWeb:'',//预订网站
                ReservationNumber:'',//预订号码
                DetermineNumber:'',//酒店确定号码
                AreaId:'',//所在地区
                LocationCity:'',//所在城市
                HotelName:'',//酒店名称
                HotelPhone:'',//酒店电话
                HotelAddress:'',//酒店地址
                GuestName:'',//客人姓名
                OnTime:'',//入住时间
                OutTime:'',//离店时间
                TypeStay:'',//入住类型
                RoomExplain:'',//房间说明
                Remark:'',//备注
            },
            //二阶段参数
            TwoParameters:{
                singleroomsNum:0,//单间数
                singleroomsPrice:0,//酒店单间单价
                singleroomsCurrency:'',//单间单价币种
                doubleroomNum:0,//双间数
                doubleroomPrice:0,//酒店双间单价
                doubleroomCurrency:'',//双间单价币种
                suiteNum:0,//套房间数
                suitePrice:0,//酒店套房单价
                suiteCurrency:'',//套房单价币种
                otherroomNum:0,//其他数
                otherroomPrice:0,//酒店其他单价
                otherroomCurrency:'',//其他单价币种
                amount:0,//信用卡金额
                credit:'',//信用卡
                breakfastPrice:0,//酒店早餐价格
                breakfastCurrency:'',//酒店早餐单价币种
                resource:false,//酒店早餐是否为地接代付
                RentPrice:0,//地税价格
                RentCurrency:'',//地税单价币种
                CitytaxPrice:0,//城市税价格
                CitytaxCurrency:'',//城市税单价币种
            },
            //付款信息
            Paymentinfor:{
                paymentMethods:0,//支付方式
                consumptionPatterns:'',//消费方式
                purchaseDate:'',//消费日期
                paymentAmount:0,//付款金额
                paymentCurrency:0,//付款币种
                beneficiary:'',//收款方
                expenseid:0,//费用标识
                remarks:'',//备 注
                //刷卡
                cardtype:'',//卡类型:
                cardnumber:'',//银行卡号
                cardname:'',//持卡人姓名
                //转账
                transferbanknumber:'',//公司银行账号
                transferbank:'',//对方开户行
                transfercardnumber:'',//对方银行卡号
                transfername:'',//对方姓名
                //汇款
                remittancebank:'',//对方开户行
                remittancecardnumber:'',//对方银行卡号
                remittancename:'',//对方姓名
            },
            countrys:[],
            OpHotelReservationsData: {
                diId: 0,
            },
            //必填验证
            RequiredParametersRules: {
                TypeGuest: [
                    { required: true, message: '请选择客人类型', trigger: ['blur', 'change'] }
                ],
                BankCards: [
                    { required: true, message: '请选择银行卡', trigger: ['blur', 'change'] }
                ],
                VoucherNumber: [
                    { required: true, message: '请输入入住卷号码', trigger: ['blur', 'change'] }
                ],
                BookingWeb: [
                    { required: true, message: '请选择预订网站', trigger: ['blur', 'change'] }
                ],
                ReservationNumber: [
                    { required: true, message: '请输入预订号码', trigger: ['blur', 'change'] }
                ],
                DetermineNumber: [
                    { required: true, message: '请输入酒店确定号码', trigger: ['blur', 'change'] }
                ],
                AreaId: [
                    { required: true, message: '选择所在地区', trigger: ['blur', 'change'] }
                ],
                LocationCity: [
                    { required: true, message: '请输入所在城市', trigger: ['blur', 'change'] }
                ],
                
                HotelName: [
                    { required: true, message: '请输入酒店名称', trigger: ['blur', 'change'] }
                ],
                HotelPhone: [
                    { required: true, message: '请输入酒店电话', trigger: ['blur', 'change'] }
                ],
                HotelAddress: [
                    { required: true, message: '请输入酒店地址', trigger: ['blur', 'change'] }
                ],
                GuestName: [
                    { required: true, message: '请输入客人姓名', trigger: ['blur'] }
                ],
                OnTime: [
                    { required: true, message: '请选择入住时间', trigger: ['blur', 'change'] }
                ],
                OutTime: [
                    { required: true, message: '请选择离店时间', trigger: ['blur', 'change'] }
                ],
                TypeStay: [
                    { required: true, message: '请选择入住类型', trigger: ['blur', 'change'] }
                ],
                RoomExplain: [
                    { required: true, message: '请输入房间说明', trigger: ['blur', 'change'] }
                ],
                Remark: [
                    { required: true, message: '请输入备注', trigger: ['blur', 'change'] }
                ],
            },
            budgeting:[],
            bizhong:'',
            huilv:0,
             //房费
             roomtaxobj:{
                id:0,
                diId:0,
                hrId:0,
                priceType:1,
                price:0,
                currency:0,
                rate:0,
                isOppay:0,
                payDId:0,
                consumptionPatterns:'',
                consumptionDate:'',
                ctdId:0,
                bankNo:'',
                cardholderName:'',
                companyBankNo:'',
                otherBankName:'',
                otherSideNo:'',
                otherSideName:'',
                payee:'',
                orbitalPrivateTransfer:0,
            },
            //城市税
            Citytaxobj:{
                id:0,
                diId:0,
                hrId:0,
                priceType:4,
                price:0,
                currency:0,
                rate:0,
                isOppay:0,
                payDId:0,
                consumptionPatterns:'',
                consumptionDate:'',
                ctdId:0,
                bankNo:'',
                cardholderName:'',
                companyBankNo:'',
                otherBankName:'',
                otherSideNo:'',
                otherSideName:'',
                payee:'',
                orbitalPrivateTransfer:0,
            },
            //地税
            landtaxobj:{
                id:0,
                diId:0,
                hrId:0,
                priceType:3,
                price:0,
                currency:0,
                rate:0,
                isOppay:0,
                payDId:0,
                consumptionPatterns:'',
                consumptionDate:'',
                ctdId:0,
                bankNo:'',
                cardholderName:'',
                companyBankNo:'',
                otherBankName:'',
                otherSideNo:'',
                otherSideName:'',
                payee:'',
                orbitalPrivateTransfer:0,
            },
            //酒店早餐
            Hotelbreakfastobj:{
                id:0,
                diId:0,
                hrId:0,
                priceType:2,
                price:0,
                currency:0,
                rate:0,
                isOppay:0,
                payDId:0,
                consumptionPatterns:'',
                consumptionDate:'',
                ctdId:0,
                bankNo:'',
                cardholderName:'',
                companyBankNo:'',
                otherBankName:'',
                otherSideNo:'',
                otherSideName:'',
                payee:'',
                orbitalPrivateTransfer:0,
            },
            currencyarrs:[],
            currencyarrss:[],
            rollcallarr:[],
        }
    },
    methods: {
        //拼音
        pinyingxing(val){
            return pinyin(val, { toneType: 'none' }).toUpperCase();
        },
        //fenge
        fgarr(val){
            val=val+""
            return val.split(' ')[0]
        },
        //保留两位小数
        townum(val){
            return val.toFixed(2)
        },
        //保留4位小数
        fournum(val){
            return val.toFixed(4)
        },
        //获取成本提示
        getcostbudgeting(){
            this.budgeting=[];
            var url = "/api/Groups/PostGroupCostModulePrompt"
            var that = this
            this.$axios({
                method: 'post',
                url: url,
                headers: {
                    Authorization: 'Bearer ' + this.token
                },
                data: {
                    userId: that.userId,
                    diId: that.OpHotelReservationsData.diId,
                    cTable:that.cTable,
                }
            }).then(function (res) {
                if (res.data.code == 200) {
                    that.budgeting=res.data.data.modulePromptInfos[0].data;
                    that.bizhong=res.data.data.modulePromptInfos[0].currencyCode;
                    that.huilv=res.data.data.modulePromptInfos[0].rate;
                } else {
                    // that.$message.error(res.data.msg);
                }
            })
        },
        //每页条数改变时触发 选择一页显示多少行
        handleSizeChange(val) {
            this.currentPage = 1;
            this.pageSize = val;
        },
        //当前页改变时触发 跳转其他页
        handleCurrentChange(val) {
            this.currentPage = val;
        },
        AreaIdchange(val){
            var obj = {}
            obj = this.countrys.find(function (i) {
                return i.id === val;
            });
            this.RequiredParameters.LocationCity=obj.city;
        },
        //获取客户名单info
        PostTourClientListByDiId(val) {
            this.rollcallarr=[];
            var that = this
            var url = "/api/Groups/PostTourClientListByDiId"
            this.$axios({
                method: 'post',
                url: url,
                headers: {
                    Authorization: 'Bearer ' + that.token
                },
                data: {
                    portType:1,
                    diid: val?val:that.OpHotelReservationsData.diId,
                    pageId:104,
                    userId:233
                }
            }).then(function (res) {
                if (res.data.code == 200) {
                    that.rollcallarr=res.data.data;
                } else {
                    that.$message.error(res.data.msg);
                }
            })
        },
        //获取ctable
        PostPageLinkCTable() {
            var url = "/api/Business/PostPageLinkCTable"
            var that = this
            this.$axios({
                method: 'post',
                url: url,
                headers: {
                    Authorization: 'Bearer ' + this.token
                },
                data: {
                    pageId:that.pageId
                }
            }).then(function (res) {
                if (res.data.code == 200) {
                    that.cTable=res.data.data.cTable;
                    that.PostGroupListByCTableAndUserId();
                    
                }else{
                    that.$message({
                        message:"获取cTable失败",
                        duration:3000,
                        type:"error"
                    });
                }
            }).catch(function (error) {
                that.$message.error("获取cTable失败");
            });
        },
        //获取团组
        PostGroupListByCTableAndUserId() {
            var url = "/api/Business/PostGroupListByCTableAndUserId"
            var that = this
            this.$axios({
                method: 'post',
                url: url,
                headers: {
                    Authorization: 'Bearer ' + this.token
                },
                data: {
                    portType: 1,
                    pageIndex: 1,
                    pageSize:99999,
                    userId: that.userId,
                    cTable:that.cTable
                }
            }).then(function (res) {
                if (res.data.code == 200) {
                    if(res.data.data.length==0){
                        that.OpHotelReservationsData.diId='无团组权限！'
                        that.$message({
                            message:"无任何团组权限，请联系管理员添加团组！",
                            duration:5000,
                            type:"warning"
                        });
                    }
                    if(that.OpHotelReservationsData.diId==0){
                        that.OpHotelReservationsData.diId=res.data.data[0].id
                    }
                    that.delegationInfoList = res.data.data;
                    for(var x=0;x<res.data.data.length;x++){
                        if(that.OpHotelReservationsData.diId==res.data.data[x].id){
                            that.delegationInfo=res.data.data[x]
                        }
                    }
                    setTimeout(function() {
                        that.getcostbudgeting()
                    }, 100);
                    that.PostHotelReservationsItemsByDiId()
                    setTimeout(function() {
                        that.PostTourClientListByDiId();
                    }, 200);
                    // that.PostHotelReservationsBasicsDataInit()
                    // that.delegationInfo=
                }
            }).catch(function (error) {
                that.$message.error("获取团组失败");
            });
        },
        //获取酒店表格
        PostHotelReservationsItemsByDiId() {
            this.loading=true;
            var url = "/api/Groups/PostHotelReservationsItemsByDiId"
            var that = this
            that.tableDatas=[];
            this.$axios({
                method: 'post',
                url: url,
                headers: {
                    Authorization: 'Bearer ' + this.token
                },
                data: {
                    portType:1,
                    userId:that.userId,
                    pageId:that.pageId,
                    diId:that.OpHotelReservationsData.diId
                }
            }).then(function (res) {
                if (res.data.code == 200) {
                    setTimeout(function () {
                        that.PostHotelReservationsBasicsDataInit()
                    },500)
                    that.tableDatas=res.data.data;
                }
            }).catch(function (error) {
                that.loading=false;
                that.$message.error("获取酒店表格失败");
            });
        },
        //选择客人姓名
        selectchg(){
            console.log(this.RequiredParameters.GuestName)
        },
        //酒店预订 基础数据
        PostHotelReservationsBasicsDataInit() {
            this.GuestNamelist=[];
            var url = "/api/Groups/PostHotelReservationsBasicsDataInit"
            var that = this
            this.$axios({
                method: 'post',
                url: url,
                headers: {
                    Authorization: 'Bearer ' + this.token
                },
                data: {
                    portType:1,
                    userId:that.userId,
                    pageId:that.pageId,
                    diId:that.OpHotelReservationsData.diId
                }
            }).then(function (res) {
                if (res.data.code == 200) {
                    let countryss=[];
                    for (let i = 0; i < res.data.data.countrys.length; i++) {
                        res.data.data.countrys[i]['cityname'] = res.data.data.countrys[i].country + '-' + res.data.data.countrys[i].city;
                        countryss.push(res.data.data.countrys[i]);
                    }
                    that.countrys=countryss;
                    that.GuestNamelist=res.data.data.guestName;
                    that.guestType=res.data.data.guestType;
                    if(that.guestType){
                        that.RequiredParameters.TypeGuest=that.guestType[0].id;//客人类型
                    }
                    that.RequiredParameters.VoucherNumber=res.data.data.checkVolumeNo;
                    that.bankCard=res.data.data.bankCard;
                    if(that.bankCard){
                        that.RequiredParameters.BankCards=that.bankCard[0].id;//银行卡
                        that.roomtaxobj.ctdId=that.bankCard[0].id;
                        that.Citytaxobj.ctdId=that.bankCard[0].id;
                        that.landtaxobj.ctdId=that.bankCard[0].id;
                        that.Hotelbreakfastobj.ctdId=that.bankCard[0].id;
                        that.changecardtype(that.roomtaxobj.ctdId);
                        that.citychangecardtype(that.Citytaxobj.ctdId);
                        that.landchangecardtype(that.landtaxobj.ctdId);
                        that.Hotelchangecardtype(that.Hotelbreakfastobj.ctdId);
                        that.TwoParameters.credit='币种'+'('+that.bankCard[0].currency+')';//银行卡
                    }
                    that.bookingWebsite=res.data.data.bookingWebsite;
                    if(that.bookingWebsite){
                        that.RequiredParameters.BookingWeb=that.bookingWebsite[0].id;//预订网站
                    }
                    that.CheckType=res.data.data.checkPerson;
                    if(that.CheckType){
                        that.RequiredParameters.TypeStay=that.CheckType[0].id;//预订网站
                    }
                    that.currencyList = res.data.data.currencyList//币种下拉框
                    let ass=that.currencyList.find(ass=>{
                        return ass.currencyCode==that.bankCard[0].currency
                    })
                    if(ass){
                        for(var i=0;i<that.currencyList.length;i++){
                            if(that.bankCard[0].currency==that.currencyList[i].currencyCode){
                                that.RequiredParameters.CurrentRate=that.currencyList[i].rate;//当前团组汇率
                                that.TwoParameters.singleroomsCurrency=that.currencyList[i].currencyId;
                                that.TwoParameters.doubleroomCurrency=that.currencyList[i].currencyId;
                                that.TwoParameters.suiteCurrency=that.currencyList[i].currencyId;
                                that.TwoParameters.otherroomCurrency=that.currencyList[i].currencyId;
                                that.TwoParameters.breakfastCurrency=that.currencyList[i].currencyId;
                                that.TwoParameters.RentCurrency=that.currencyList[i].currencyId;
                                that.TwoParameters.CitytaxCurrency=that.currencyList[i].currencyId;
                                that.Paymentinfor.paymentCurrency=that.currencyList[i].currencyId;
                            }  
                        }
                    }else{
                        that.RequiredParameters.CurrentRate='当前团组未设置此币种汇率！';//当前团组汇率
                    }
                    that.payment = res.data.data.payment//支付方式下拉框
                    if(that.payment){
                        that.roomtaxobj.payDId=that.payment[0].id;//支付方式
                        that.Citytaxobj.payDId=that.payment[0].id;//城市税支付方式
                        that.landtaxobj.payDId=that.payment[0].id;//地税支付方式
                        that.Hotelbreakfastobj.payDId=that.payment[0].id;//酒店早餐支付方式
                    }
                    that.loading=false;
                }
            }).catch(function (error) {
                that.loading=false;
                that.$message.error("获取基础数据失败");
            });
        },
        //银行卡值改变
        budgetCurrencyChange(val) {
            var CScurrency='';
            this.roomtaxobj.ctdId=val
            this.Citytaxobj.ctdId=val
            this.landtaxobj.ctdId=val
            this.Hotelbreakfastobj.ctdId=val
            this.changecardtype(val);
            this.landchangecardtype(val);
            this.Hotelchangecardtype(val);
            this.citychangecardtype(val);        
            for(var i=0;i<this.bankCard.length;i++){
                if(val==this.bankCard[i].id){
                    CScurrency=this.bankCard[i].currency
                    this.TwoParameters.credit='币种'+'('+this.bankCard[i].currency+')'
                }
            }
            let ass=this.currencyList.find(ass=>{
                return ass.currencyCode==CScurrency
            })
            if(ass){
                for(var i=0;i<this.currencyList.length;i++){
                    if(CScurrency==this.currencyList[i].currencyCode){
                        this.RequiredParameters.CurrentRate=this.currencyList[i].rate;//当前团组汇率
                        this.TwoParameters.singleroomsCurrency=this.currencyList[i].currencyId;
                        this.TwoParameters.doubleroomCurrency=this.currencyList[i].currencyId;
                        this.TwoParameters.suiteCurrency=this.currencyList[i].currencyId;
                        this.TwoParameters.otherroomCurrency=this.currencyList[i].currencyId;
                        this.TwoParameters.breakfastCurrency=this.currencyList[i].currencyId;
                        this.TwoParameters.RentCurrency=this.currencyList[i].currencyId;
                        this.TwoParameters.CitytaxCurrency=this.currencyList[i].currencyId;
                        this.Paymentinfor.paymentCurrency=this.currencyList[i].currencyId;
                    }
                }
            }else{
                this.RequiredParameters.CurrentRate='当前团组未设置此币种汇率！';//当前团组汇率
                this.TwoParameters.singleroomsCurrency='暂无';
                this.TwoParameters.doubleroomCurrency='暂无';
                this.TwoParameters.suiteCurrency='暂无';
                this.TwoParameters.otherroomCurrency='暂无';
                this.TwoParameters.breakfastCurrency='暂无';
                this.TwoParameters.RentCurrency='暂无';
                this.TwoParameters.CitytaxCurrency='暂无';
                this.Paymentinfor.paymentCurrency='暂无';
            }
            this.CalculateAmount()
        },
        //地税卡类型切换
        landchangecardtype(val){
            for(var i=0;i<this.bankCard.length;i++){
                if(val==this.bankCard[i].id){
                    this.landtaxobj.bankNo=this.bankCard[i].remark;
                    this.landtaxobj.cardholderName=this.bankCard[i].cardholder;
                }
            }
        },
        //酒店早餐卡类型切换
        Hotelchangecardtype(val){
            for(var i=0;i<this.bankCard.length;i++){
                if(val==this.bankCard[i].id){
                    this.Hotelbreakfastobj.bankNo=this.bankCard[i].remark;
                    this.Hotelbreakfastobj.cardholderName=this.bankCard[i].cardholder;
                }
            }
        },
        //城市税卡类型切换
        citychangecardtype(val){
            for(var i=0;i<this.bankCard.length;i++){
                if(val==this.bankCard[i].id){
                    this.Citytaxobj.bankNo=this.bankCard[i].remark;
                    this.Citytaxobj.cardholderName=this.bankCard[i].cardholder;
                }
            }
        },
        //卡切换
        changecardtype(val){
            for(var i=0;i<this.bankCard.length;i++){
                if(val==this.bankCard[i].id){
                    this.roomtaxobj.bankNo=this.bankCard[i].remark;
                    this.roomtaxobj.cardholderName=this.bankCard[i].cardholder;
                }
            }
        },
        //详情
        PostHotelReservationsDetails(index,row) {
            this.modifieds=row.isAuditGM;
            this.inifid=row.id;
            var url = "/api/Groups/PostHotelReservationsDetails"
            var that = this
            this.$axios({
                method: 'post',
                url: url,
                headers: {
                    Authorization: 'Bearer ' + this.token
                },
                data: {
                    portType:1,
                    userId:that.userId,
                    pageId:that.pageId,
                    diId:that.OpHotelReservationsData.diId,
                    id:row.id
                }
            }).then(function (res) {
                if (res.data.code == 200) {
                    //必填参数
                    that.RequiredParameters.TypeGuest=res.data.data.gtId;//客人类型
                    that.RequiredParameters.BankCards=res.data.data.ctdId;//银行卡
                    // for(let l=0;l<that.bankCard.length;l++){
                    //     if(that.bankCard[l].id==that.RequiredParameters.BankCards){
                    //         that.TwoParameters.credit=that.bankCard[l].name+'('+that.bankCard[l].currency+')'
                    //         for(let f=0;f<that.currencyList.length;f++){
                    //             if(that.bankCard[l].currency==that.currencyList[f].currencyCode){
                    //                 that.RequiredParameters.CurrentRate=that.currencyList[f].rate
                                    
                    //             }
                    //         }
                    //     }
                    // }
                    that.RequiredParameters.VoucherNumber=res.data.data.checkNumber;//入住卷号码
                    that.RequiredParameters.BookingWeb=res.data.data.reservationsWebsite;//预订网站
                    that.RequiredParameters.ReservationNumber=res.data.data.reservationsNo;//预订号码
                    that.RequiredParameters.DetermineNumber=res.data.data.determineNo;//酒店确定号码
                    that.RequiredParameters.AreaId=res.data.data.areaId;//所在城市
                    that.RequiredParameters.LocationCity=res.data.data.city;//所在城市
                    that.RequiredParameters.HotelName=res.data.data.hotelName;//酒店名称
                    that.RequiredParameters.HotelPhone=res.data.data.hotelTel;//酒店电话
                    that.RequiredParameters.HotelAddress=res.data.data.hotelAddress;//酒店地址
                    that.RequiredParameters.GuestName=(res.data.data.guestName.split(",")).map(Number);//客人姓名
                    that.RequiredParameters.OnTime=new Date(res.data.data.checkInDate);//入住时间
                    that.RequiredParameters.OutTime=new Date(res.data.data.checkOutDate);//离店时间
                    that.RequiredParameters.TypeStay=res.data.data.checkType==0?'':res.data.data.checkType;//入住类型
                    that.RequiredParameters.RoomExplain=res.data.data.roomExplanation;//房间说明
                    that.RequiredParameters.Remark=res.data.data.hotelRemark;//备注
                    //二阶段参数
                    that.TwoParameters.singleroomsNum=res.data.data.singleRoomCount//单间数
                    that.TwoParameters.singleroomsPrice=res.data.data.singleRoomPrice//酒店单间单价
                    that.TwoParameters.doubleroomNum=res.data.data.doubleRoomCount//双间数
                    that.TwoParameters.doubleroomPrice=res.data.data.doubleRoomPrice//酒店双间单价
                    that.TwoParameters.suiteNum=res.data.data.suiteRoomCount//套房间数
                    that.TwoParameters.suitePrice=res.data.data.suiteRoomPrice//酒店套房单价
                    that.TwoParameters.otherroomNum=res.data.data.otherRoomCount//其他数
                    that.TwoParameters.otherroomPrice=res.data.data.otherRoomPrice//酒店其他单价
                    
                    
                    
                    //付款信息
                    that.Paymentinfor.paymentMethods=res.data.data.payDId//支付方式
                    that.Paymentinfor.consumptionPatterns=res.data.data.consumptionPatterns//消费方式
                    that.Paymentinfor.purchaseDate=res.data.data.consumptionDate//消费日期
                    // that.$set(that.Paymentinfor,'purchaseDate',res.data.data.consumptionDate)//消费日期
                    // console.log(that.Paymentinfor.purchaseDate)
                    that.Paymentinfor.paymentAmount=res.data.data.payMoney.toFixed(2)//付款金额
                    that.Paymentinfor.paymentCurrency=res.data.data.paymentCurrency//付款币种
                    //刷卡
                    that.Paymentinfor.cardtype=res.data.data.ctdId//卡类型
                    that.Paymentinfor.cardnumber=res.data.data.bankNo//银行卡号
                    that.Paymentinfor.cardname=res.data.data.cardholderName//持卡人姓名
                    //转账
                    that.Paymentinfor.transferbank=res.data.data.otherBankName//对方开户行
                    that.Paymentinfor.transfercardnumber=res.data.data.otherSideNo//对方银行卡号
                    that.Paymentinfor.transfername=res.data.data.otherSideName//对方姓名
                    //汇款
                    that.Paymentinfor.remittancebank=res.data.data.otherBankName//对方开户行
                    that.Paymentinfor.remittancecardnumber=res.data.data.otherSideNo//对方银行卡号
                    that.Paymentinfor.remittancename=res.data.data.otherSideName//对方姓名


                    that.Paymentinfor.beneficiary=res.data.data.payee//收款方
                    that.Paymentinfor.expenseid=res.data.data.orbitalPrivateTransfer//费用标识
                    that.Paymentinfor.remarks=res.data.data.ccpRemark//备 注
                    //之前代码未改
                    for (let x = 0; x < res.data.data.contents.length; x++) {
                        if(res.data.data.contents[x].priceType==1){
                            that.roomtaxobj=res.data.data.contents[x];
                            that.roomtaxobj.isOppay=that.roomtaxobj.isOppay==0?false:true;
                            that.TwoParameters.amount= that.roomtaxobj.price//信用卡金额
                            that.TwoParameters.singleroomsCurrency=that.roomtaxobj.currency
                            that.TwoParameters.doubleroomCurrency=that.roomtaxobj.currency
                            that.TwoParameters.suiteCurrency=that.roomtaxobj.currency
                            that.TwoParameters.otherroomCurrency=that.roomtaxobj.currency
                            for(var i=0;i<that.currencyList.length;i++){
                                if(that.roomtaxobj.currency==that.currencyList[i].currencyId){
                                    that.RequiredParameters.CurrentRate=that.currencyList[i].rate
                                    that.TwoParameters.credit='币种'+'('+that.currencyList[i].currencyCode+')'
                                }
                            }
                        }
                        if(res.data.data.contents[x].priceType==2){
                            that.Hotelbreakfastobj=res.data.data.contents[x];
                            that.Hotelbreakfastobj.isOppay=that.Hotelbreakfastobj.isOppay==0?false:true;
                            that.TwoParameters.breakfastPrice=that.Hotelbreakfastobj.price//酒店早餐价格
                            that.TwoParameters.breakfastCurrency=that.Hotelbreakfastobj.currency//酒店早餐单价币种
                        }
                        if(res.data.data.contents[x].priceType==3){
                            that.landtaxobj=res.data.data.contents[x];
                            that.landtaxobj.isOppay=that.landtaxobj.isOppay==0?false:true;
                            that.TwoParameters.RentPrice=that.landtaxobj.price//地税价格
                            that.TwoParameters.RentCurrency=that.landtaxobj.currency//地税单价币种
                        }
                        if(res.data.data.contents[x].priceType==4){
                            that.Citytaxobj=res.data.data.contents[x];
                            that.Citytaxobj.isOppay=that.Citytaxobj.isOppay==0?false:true;
                            that.TwoParameters.CitytaxPrice=that.Citytaxobj.price//城市税价格
                            that.TwoParameters.CitytaxCurrency=that.Citytaxobj.currency//城市税单价币种
                        }
                    }

                    // that.budgetCurrencyChange(that.RequiredParameters.BankCards)
                    // that.CalculateAmount();
                    // that.AmountPayment();
                }
            }).catch(function (error) {
                that.$message.error("获取详情失败");
            });
        },
        //房费币种选择
        selectroomCurrency(val){
            this.TwoParameters.singleroomsCurrency=val;
            this.TwoParameters.doubleroomCurrency=val;
            this.TwoParameters.suiteCurrency=val;
            this.TwoParameters.otherroomCurrency=val;
            for(var i=0;i<this.currencyList.length;i++){
                if(val==this.currencyList[i].currencyId){
                    // CScurrency=this.bankCard[i].currency
                    this.RequiredParameters.CurrentRate=this.currencyList[i].rate
                    this.TwoParameters.credit='币种'+'('+this.currencyList[i].currencyCode+')'
                }
            }
            this.CalculateAmount()
        }, 
        //转换日期
        transferdate(val){
            var today = new Date(val);
            var DD = String(today.getDate()).padStart(2, '0'); // 获取日
            var MM = String(today.getMonth() + 1).padStart(2, '0'); //获取月份，1 月为 0
            var yyyy = today.getFullYear(); // 获取年
            return yyyy+'-'+MM+'-'+DD
        },
        //新增修改api
        PostHotelReservationsAddOrEdit() {
            var guestNametext='';
            for(let a=0;a<this.RequiredParameters.GuestName.length;a++){
                guestNametext += this.RequiredParameters.GuestName[a]+','
            }
            //未修改前代码,房费参数赋值
            this.roomtaxobj.price=this.TwoParameters.amount;
            this.roomtaxobj.currency=this.TwoParameters.otherroomCurrency;
            this.roomtaxobj.isOppay=this.roomtaxobj.isOppay==false?0:1;
            for(let b=0;b<this.currencyList.length;b++){
                if(this.roomtaxobj.currency==this.currencyList[b].currencyId){
                    this.roomtaxobj.rate=this.currencyList[b].rate
                }
            }
            //未修改前代码,城市税参数赋值
            this.Citytaxobj.price=this.TwoParameters.CitytaxPrice;
            this.Citytaxobj.currency=this.TwoParameters.CitytaxCurrency;
            this.Citytaxobj.isOppay=this.Citytaxobj.isOppay==false?0:1;
            for(let b=0;b<this.currencyList.length;b++){
                if(this.Citytaxobj.currency==this.currencyList[b].currencyId){
                    this.Citytaxobj.rate=this.currencyList[b].rate
                }
            }
            //未修改前代码,地税参数赋值
            this.landtaxobj.price=this.TwoParameters.RentPrice;
            this.landtaxobj.currency=this.TwoParameters.RentCurrency;
            this.landtaxobj.isOppay=this.landtaxobj.isOppay==false?0:1;
            for(let b=0;b<this.currencyList.length;b++){
                if(this.landtaxobj.currency==this.currencyList[b].currencyId){
                    this.landtaxobj.rate=this.currencyList[b].rate
                }
            }
            //未修改前代码,酒店早餐参数赋值
            this.Hotelbreakfastobj.price=this.TwoParameters.breakfastPrice;
            this.Hotelbreakfastobj.currency=this.TwoParameters.breakfastCurrency;
            this.Hotelbreakfastobj.isOppay=this.Hotelbreakfastobj.isOppay==false?0:1;
            for(let b=0;b<this.currencyList.length;b++){
                if(this.Hotelbreakfastobj.currency==this.currencyList[b].currencyId){
                    this.Hotelbreakfastobj.rate=this.currencyList[b].rate
                }
            }
            if(this.roomtaxobj.payDId!=72){
                this.roomtaxobj.ctdId=0;
                this.roomtaxobj.bankNo='';
                this.roomtaxobj.cardholderName='';
            }
            if(this.Citytaxobj.payDId!=72){
                this.Citytaxobj.ctdId=0;
                this.Citytaxobj.bankNo='';
                this.Citytaxobj.cardholderName='';
            }
            if(this.landtaxobj.payDId!=72){
                this.landtaxobj.ctdId=0;
                this.landtaxobj.bankNo='';
                this.landtaxobj.cardholderName='';
            }
            if(this.Hotelbreakfastobj.payDId!=72){
                this.Hotelbreakfastobj.ctdId=0;
                this.Hotelbreakfastobj.bankNo='';
                this.Hotelbreakfastobj.cardholderName='';
            }
            if(this.roomtaxobj.price>0){
                if (this.roomtaxobj.consumptionDate==""||this.roomtaxobj.consumptionDate==null) {
                    return this.$message.error("酒店房费有消费金额，请检查消费日期是否填写");
                }
            }
            if(this.Citytaxobj.price>0){
                if (this.Citytaxobj.consumptionDate==""||this.Citytaxobj.consumptionDate==null) {
                    return this.$message.error("城市税有消费金额，请检查消费日期是否填写");
                }
            }
            if(this.landtaxobj.price>0){
                if (this.landtaxobj.consumptionDate==""||this.landtaxobj.consumptionDate==null) {
                    return this.$message.error("地税有消费金额，请检查消费日期是否填写");
                }
            }
            if(this.Hotelbreakfastobj.price>0){
                if (this.Hotelbreakfastobj.consumptionDate==""||this.Hotelbreakfastobj.consumptionDate==null) {
                    return this.$message.error("酒店早餐有消费金额，请检查消费日期是否填写");
                }
            }
            this.loading=true;
            var url = "/api/Groups/PostHotelReservationsAddOrEdit"
            var that = this
            this.$axios({
                method: 'post',
                url: url,
                headers: {
                    Authorization: 'Bearer ' + this.token
                },
                data: {
                    portType:1,
                    userId:that.userId,//用户Id
                    pageId:that.pageId,//页面Id
                    id:that.inifid,//Id
                    diId:that.OpHotelReservationsData.diId,//团组Id
                    gtId:that.RequiredParameters.TypeGuest,//客人类型 Id 
                    ctdId:that.RequiredParameters.BankCards,//信用卡类型 
                    checkNumber:that.RequiredParameters.VoucherNumber,//入住卷号
                    reservationsWebsite:that.RequiredParameters.BookingWeb,//预订网站
                    reservationsNo:that.RequiredParameters.ReservationNumber,//预订号码
                    determineNo:that.RequiredParameters.DetermineNumber,//酒店确定号码
                    areaId:that.RequiredParameters.AreaId,//城市
                    city:that.RequiredParameters.LocationCity,//城市
                    hotelName:that.RequiredParameters.HotelName,//酒店名称
                    hotelTel:that.RequiredParameters.HotelPhone,//酒店电话
                    hotelAddress:that.RequiredParameters.HotelAddress,//酒店地址
                    guestName:guestNametext.substring(0, guestNametext.length - 1),//客户名称
                    checkInDate:that.transferdate(that.RequiredParameters.OnTime),//入住时间
                    checkOutDate:that.transferdate(that.RequiredParameters.OutTime),//离店时间
                    checkType:that.RequiredParameters.TypeStay,//房间入住人类型
                    roomExplanation:that.RequiredParameters.RoomExplain,//房间说明
                    hotelRemark:that.RequiredParameters.Remark,//酒店备注
                    singleRoomPrice:that.TwoParameters.singleroomsPrice,//单间价格
                    singleRoomCount:that.TwoParameters.singleroomsNum,//单间数量
                    doubleRoomPrice:that.TwoParameters.doubleroomPrice,//双间价格
                    doubleRoomCount:that.TwoParameters.doubleroomNum,//双间数量
                    suiteRoomPrice:that.TwoParameters.suitePrice,//套房价格
                    suiteRoomCount:that.TwoParameters.suiteNum,//套房数量
                    otherRoomPrice:that.TwoParameters.otherroomPrice,//其他房间价格
                    otherRoomCount:that.TwoParameters.otherroomNum,//其他房间数量
                    cardPrice:that.Paymentinfor.paymentAmount,//付款金额
                    cardPriceCurrency:that.Paymentinfor.paymentCurrency,//付款币种
                    contents:[
                        that.roomtaxobj,
                        that.Citytaxobj,
                        that.landtaxobj,
                        that.Hotelbreakfastobj
                    ],
                }
            }).then(function (res) {
                if (res.data.code == 200) {
                    that.$message({
                        type: 'success',
                        message: res.data.msg,
                        duration:'3000'
                    });
                    that.PostHotelReservationsItemsByDiId()
                    setTimeout(() => {
                        that.AddToggle();
                        that.loading=false;
                    }, 500);
                }else{
                    that.$message.error(res.data.msg);
                    that.loading=false;
                }
            }).catch(function (error) {
                that.$message.error("新增或修改失败");
                that.loading=false;
            });
        },
        //代付选中
        Payforselection(val,val2){
            if(val==1){
                if(val2==true){
                    this.roomtaxobj.payDId=73;
                }else{
                    this.roomtaxobj.payDId=72;
                }
            }
            if(val==2){
                if(val2==true){
                    this.Hotelbreakfastobj.payDId=73;
                }else{
                    this.Hotelbreakfastobj.payDId=72;
                }
            }
            if(val==3){
                if(val2==true){
                    this.landtaxobj.payDId=73;
                }else{
                    this.landtaxobj.payDId=72;
                }
            }
            if(val==4){
                if(val2==true){
                    this.Citytaxobj.payDId=73;
                }else{
                    this.Citytaxobj.payDId=72;
                }
            }
        },
        //保存
        AddBtn:debounce(function(RequiredParameters) {
            if(this.RequiredParameters.CurrentRate=="当前团组未设置此币种汇率！"){
                this.$alert('当前团组未设置此币种汇率，请前往设置！', '警告', {
                    confirmButtonText: '确定',
                    callback: action => {
                        this.$message({
                        type: 'info',
                        message: `action: ${ action }`
                        });
                    }
                });
                return
            }
            // console.log(this.Paymentinfor.purchaseDate)
            this.CalculateAmount()
            this.$refs[RequiredParameters].validate((valid) => {
                if (valid) {
                    if(this.inifid==0){
                        if(this.modifieds==1){
                            this.$message.error("已被审核，无法修改此条数据");
                        }else{
                            this.PostHotelReservationsAddOrEdit();
                        }
                    }else{
                        if(this.modifieds==1){
                            this.$message.error("已被审核，无法修改此条数据");
                        }else{
                            this.PostHotelReservationsAddOrEdit();
                        }
                    }
                } else {
                    this.$message({
                        showClose: true,
                        message: '请填写完红框内的信息！',
                        type: 'error',
                        duration:'3000'
                    });
                    return false;
                }
            });

        },1000,true),
        //预定成本
        BookingCost(){
            var url = "/api/Groups/PostHotelReservationsPredictedCostFileDownload"
            var that = this
            this.$axios({
                method: 'post',
                url: url,
                headers: {
                    Authorization: 'Bearer ' + that.token
                },
                data: { 
                    portType: 1 ,
                    userId: that.userId ,
                    pageId: that.pageId ,
                    diId: that.OpHotelReservationsData.diId ,
                }
            }).then(function (res) {
                if (res.data.code == 200) {
                    window.location.href = res.data.data
                } else {
                    that.$message.error(res.data.msg);
                }
            }).catch(function (error) {
                that.$message.error("接口错误，请联系信息部！");
            });
        },
        //删除
        delinif(index,row){
            if(row.isAuditGM!=1){
                this.$confirm('此操作将删除此条数据，是否确认', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning'
                }).then(() => {
                    var url = "/api/Groups/PostHotelReservationsDel"
                    var that = this
                    this.$axios({
                        method: 'post',
                        url: url,
                        headers: {
                            Authorization: 'Bearer ' + this.token
                        },
                        data: {
                            portType:1,
                            userId:that.userId,
                            pageId:that.pageId,
                            id:row.id,
                            diId:that.OpHotelReservationsData.diId
                        }
                    }).then(function (res) {
                        if (res.data.code == 200) {
                            that.$message({
                                type: 'success',
                                message: '删除成功!'
                            });
                            that.PostHotelReservationsItemsByDiId()
                        }
                    }).catch(function (error) {
                        that.$message.error("删除失败");
                    });
                }).catch(() => {

                });
            }else{
                this.$message.error("已被审核，无法删除此条数据");
            }
            
        },
        //新增切换
        AddToggle(val){
            this.modifieds=0;
            this.inifid=0;
            //必填参数
            this.RequiredParameters={
                TypeGuest:'',//客人类型
                BankCards:'',//银行卡
                CurrentRate:'',//当前团组汇率
                VoucherNumber:'',//入住卷号码
                BookingWeb:'',//预订网站
                ReservationNumber:'',//预订号码
                DetermineNumber:'',//酒店确定号码
                AreaId:'',//所在地区
                LocationCity:'',//所在城市
                HotelName:'',//酒店名称
                HotelPhone:'',//酒店电话
                HotelAddress:'',//酒店地址
                GuestName:'',//客人姓名
                OnTime:'',//入住时间
                OutTime:'',//离店时间
                TypeStay:'',//入住类型
                RoomExplain:'',//房间说明
                Remark:'',//备注
            },
            //二阶段参数
            this.TwoParameters={
                singleroomsNum:0,//单间数
                singleroomsPrice:0,//酒店单间单价
                singleroomsCurrency:'',//单间单价币种
                doubleroomNum:0,//双间数
                doubleroomPrice:0,//酒店双间单价
                doubleroomCurrency:'',//双间单价币种
                suiteNum:0,//套房间数
                suitePrice:0,//酒店套房单价
                suiteCurrency:'',//套房单价币种
                otherroomNum:0,//其他数
                otherroomPrice:0,//酒店其他单价
                otherroomCurrency:'',//其他单价币种
                amount:0,//信用卡金额
                credit:'',//信用卡
                breakfastPrice:0,//酒店早餐价格
                breakfastCurrency:'',//酒店早餐单价币种
                resource:false,//酒店早餐是否为地接代付
                RentPrice:0,//地税价格
                RentCurrency:'',//地税单价币种
                CitytaxPrice:0,//城市税价格
                CitytaxCurrency:'',//城市税单价币种
            },
            //付款信息
            this.Paymentinfor={
                paymentMethods:0,//支付方式
                consumptionPatterns:'',//消费方式
                purchaseDate:'',//消费日期
                paymentAmount:0,//付款金额
                paymentCurrency:0,//付款币种
                beneficiary:'',//收款方
                expenseid:-1,//费用标识
                remarks:'',//备 注
                //刷卡
                cardtype:'',//卡类型:
                cardnumber:'',//银行卡号
                cardname:'',//持卡人姓名
                //转账
                transferbanknumber:'',//公司银行账号
                transferbank:'',//对方开户行
                transfercardnumber:'',//对方银行卡号
                transfername:'',//对方姓名
                //汇款
                remittancebank:'',//对方开户行
                remittancecardnumber:'',//对方银行卡号
                remittancename:'',//对方姓名
            }
            //房费
            this.roomtaxobj={
                id:0,
                diId:0,
                hrId:0,
                priceType:1,
                price:0,
                currency:0,
                rate:0,
                isOppay:0,
                payDId:0,
                consumptionPatterns:'',
                consumptionDate:'',
                ctdId:0,
                bankNo:'',
                cardholderName:'',
                companyBankNo:'',
                otherBankName:'',
                otherSideNo:'',
                otherSideName:'',
                payee:'',
                orbitalPrivateTransfer:0,
            }
            //城市税
            this.Citytaxobj={
                id:0,
                diId:0,
                hrId:0,
                priceType:4,
                price:0,
                currency:0,
                rate:0,
                isOppay:0,
                payDId:0,
                consumptionPatterns:'',
                consumptionDate:'',
                ctdId:0,
                bankNo:'',
                cardholderName:'',
                companyBankNo:'',
                otherBankName:'',
                otherSideNo:'',
                otherSideName:'',
                payee:'',
                orbitalPrivateTransfer:0,
            }
            //地税
            this.landtaxobj={
                id:0,
                diId:0,
                hrId:0,
                priceType:3,
                price:0,
                currency:0,
                rate:0,
                isOppay:0,
                payDId:0,
                consumptionPatterns:'',
                consumptionDate:'',
                ctdId:0,
                bankNo:'',
                cardholderName:'',
                companyBankNo:'',
                otherBankName:'',
                otherSideNo:'',
                otherSideName:'',
                payee:'',
                orbitalPrivateTransfer:0,
            }
            //酒店早餐
            this.Hotelbreakfastobj={
                id:0,
                diId:0,
                hrId:0,
                priceType:2,
                price:0,
                currency:0,
                rate:0,
                isOppay:0,
                payDId:0,
                consumptionPatterns:'',
                consumptionDate:'',
                ctdId:0,
                bankNo:'',
                cardholderName:'',
                companyBankNo:'',
                otherBankName:'',
                otherSideNo:'',
                otherSideName:'',
                payee:'',
                orbitalPrivateTransfer:0,
            }

            if (this.$refs.RequiredParameters){
                this.$nextTick(() => {
                    this.$refs['RequiredParameters'].clearValidate();
                })
            }
            if(val==1){
                this.PostHotelReservationsBasicsDataInit();
            }
        },
        //计算日期
        CalculateTade(){
            var times=' 00:00:00'
            if(this.RequiredParameters.OutTime!=''&&this.RequiredParameters.OnTime!=''){
                if(this.RequiredParameters.OnTime>=this.RequiredParameters.OutTime){
                    this.$confirm('离店日期不能小于入住日期', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning'
                    }).then(() => {
                        this.RequiredParameters.OutTime="";
                    }).catch(() => {
                    });
                    return
                }
                var post=new Date(this.transferdate(this.RequiredParameters.OutTime)+times);
                var prior=new Date(this.transferdate(this.RequiredParameters.OnTime)+times);
                return (post-prior)/(1*24*60*60*1000)
            }else{
                return 1
            }
        },
        //计算信用卡金额
        CalculateAmount(){
            var compute=0
            compute=((this.TwoParameters.singleroomsNum*this.TwoParameters.singleroomsPrice)+(this.TwoParameters.doubleroomNum*this.TwoParameters.doubleroomPrice)+(this.TwoParameters.suiteNum*this.TwoParameters.suitePrice)+(this.TwoParameters.otherroomNum*this.TwoParameters.otherroomPrice))*this.CalculateTade()
            this.TwoParameters.amount=compute
            this.AmountPayment()
        },
        //付款金额
        AmountPayment(){
            if(this.TwoParameters.suiteCurrency!=this.TwoParameters.RentCurrency||this.TwoParameters.suiteCurrency!=this.TwoParameters.CitytaxCurrency||this.TwoParameters.suiteCurrency!=this.TwoParameters.breakfastCurrency){
                this.Paymentinfor.paymentCurrency=836;
                var dishui=0;
                var chengshishui=0;
                var zaocan=0;
                if(this.TwoParameters.suiteCurrency!=this.TwoParameters.RentCurrency){
                    for(let i =0;i<this.currencyList.length;i++){
                        if(this.TwoParameters.RentCurrency==this.currencyList[i].currencyId){
                            dishui=this.TwoParameters.RentPrice*this.currencyList[i].rate
                        }
                    }
                }else{
                    dishui=this.TwoParameters.RentPrice*this.RequiredParameters.CurrentRate
                }

                if(this.TwoParameters.suiteCurrency!=this.TwoParameters.CitytaxCurrency){
                    for(let i =0;i<this.currencyList.length;i++){
                        if(this.TwoParameters.CitytaxCurrency==this.currencyList[i].currencyId){
                            chengshishui=this.TwoParameters.CitytaxPrice*this.currencyList[i].rate
                        }
                    }
                }else{
                    chengshishui=this.TwoParameters.CitytaxPrice*this.RequiredParameters.CurrentRate
                }
                
                if(this.TwoParameters.suiteCurrency!=this.TwoParameters.breakfastCurrency){
                    for(let i =0;i<this.currencyList.length;i++){
                        if(this.TwoParameters.breakfastCurrency==this.currencyList[i].currencyId){
                            zaocan=this.TwoParameters.breakfastPrice*this.currencyList[i].rate
                        }
                    }
                }else{
                    zaocan=this.TwoParameters.breakfastPrice*this.RequiredParameters.CurrentRate
                }
                // console.log(dishui,chengshishui,zaocan)
                this.Paymentinfor.paymentAmount=(dishui+chengshishui+zaocan+(this.TwoParameters.amount*this.RequiredParameters.CurrentRate)).toFixed(2)
            }else{
                this.Paymentinfor.paymentCurrency=this.TwoParameters.RentCurrency
                this.Paymentinfor.paymentAmount=(this.TwoParameters.RentPrice+this.TwoParameters.CitytaxPrice+this.TwoParameters.breakfastPrice+this.TwoParameters.amount).toFixed(2)
            }
        },
        //切换团组
        delegationSelectChange(val) {
            var that = this
            this.delegationInfo=[];
            this.PostGroupListByCTableAndUserId();
            this.AddToggle();
            this.getcostbudgeting();
            // setTimeout(function () {
            //     that.PostTourClientListByDiId(val);
            // },500)
            
        },
        
       
        DownloadVOUCHER(index,row) {
            var url = "/api/Groups/PostHotelReservationsCreateVoucherBatchNew"
            var that = this
            this.$axios({
                method: 'post',
                url: url,
                headers: {
                    Authorization: 'Bearer ' + that.token
                },
                data: { 
                    portType: 1 ,
                    userId: that.userId ,
                    pageId: that.pageId ,
                    diId: that.OpHotelReservationsData.diId ,
                    id: 0
                }
            }).then(function (res) {
                if (res.data.code == 200) {
                    window.location.href = res.data.data
                } else {
                    that.$message.error(res.data.msg);
                }
            }).catch(function (error) {
                that.$message.error("网络错误，请稍后重试");
            });
        },
        ConfirmWord() {
            var url = "/api/Groups/PostHotelReservationsConfirmationSlip" 
            var that = this
            this.$axios({
                method: 'post',
                url: url,
                headers: {
                    Authorization: 'Bearer ' + that.token
                },
                data: { 
                    portType: 1 ,
                    userId: that.userId ,
                    pageId: that.pageId ,
                    diId: that.OpHotelReservationsData.diId ,
                }
            }).then(function (res) {
                if (res.data.code == 200) {
                    window.location.href = res.data.data
                } else {
                    that.$message.error(res.data.msg);
                }
            }).catch(function (error) {
                that.$message.error("网络错误，请稍后重试");
            });
        },
       
    },
    filters:{
        filter_city(value){
            if(value){
                return value.replaceAll('|','、')
            }
        },
        filter_time(value){
            if(value){
                return value.split(" ")[0]
            }
        }
    },
    watch:{
        CalculateTade:function(a,b){
            // console.log(a,b)
        },
        'TwoParameters.singleroomsCurrency': {
            handler (val) {
                this.currencyarrss=[];
                this.currencyarrs[0]=val;
                var arr=Array.from(new Set(this.currencyarrs));
                console.log(arr);
                for(let i=0;i<this.currencyList.length;i++){
                    for(let j=0;j<arr.length;j++){
                        if(arr[j]==this.currencyList[i].currencyId){
                            this.currencyarrss.push(this.currencyList[i])
                        }
                    }
                }
                this.currencyarrss=Array.from(new Set(this.currencyarrss));
            }
        },
        'TwoParameters.breakfastCurrency': {
            handler (val) {
                this.currencyarrss=[];
                this.currencyarrs[1]=val;
                var arr=Array.from(new Set(this.currencyarrs));
                console.log(arr);
                for(let i=0;i<this.currencyList.length;i++){
                    for(let j=0;j<arr.length;j++){
                        if(arr[j]==this.currencyList[i].currencyId){
                            this.currencyarrss.push(this.currencyList[i])
                        }
                    }
                }
                this.currencyarrss=Array.from(new Set(this.currencyarrss));
            }
        },
        'TwoParameters.RentCurrency': {
            handler (val) {
                this.currencyarrss=[];
                this.currencyarrs[2]=val;
                var arr=Array.from(new Set(this.currencyarrs));
                console.log(arr);
                for(let i=0;i<this.currencyList.length;i++){
                    for(let j=0;j<arr.length;j++){
                        if(arr[j]==this.currencyList[i].currencyId){
                            this.currencyarrss.push(this.currencyList[i])
                        }
                    }
                }
                this.currencyarrss=Array.from(new Set(this.currencyarrss));
            }
        },
        'TwoParameters.CitytaxCurrency': {
            handler (val) {
                this.currencyarrss=[];
                this.currencyarrs[3]=val;
                var arr=Array.from(new Set(this.currencyarrs));
                console.log(arr);
                for(let i=0;i<this.currencyList.length;i++){
                    for(let j=0;j<arr.length;j++){
                        if(arr[j]==this.currencyList[i].currencyId){
                            this.currencyarrss.push(this.currencyList[i])
                        }
                    }
                }
                this.currencyarrss=Array.from(new Set(this.currencyarrss));
            }
        },

    },
    mounted() {
        this.token = JSON.parse(localStorage.getItem('userinif')).token;
        this.pageId=Number(localStorage.getItem('indexs').split('-')[1]);//页面id
        this.userId = JSON.parse(localStorage.getItem('userinif')).userInfo.userId;
        this.PostPageLinkCTable();
        // this.PostHotelReservationsItemsByDiId()
        // this.HotelReservationsInitialize();
        //this.AirTicketResList()
    }
}
</script>
<style>
.hotelr-all {
    background-color: #fff;
    padding: 10px;
    box-shadow: 0 0 5px #0005;
    border-radius: 10px;
    height: 100%;
    min-height: 830px;
}
.hotelr-all .block {
    margin-top: 10px;
}
.hotelr-head-li label {
    color: #606266;
    font-size: 15px;
    font-weight: 600;
    
}

.hotelr-head {
    display: flex;
    justify-content: space-between;
}

.hotelr-info {
    display: flex;
    margin-top: 10px;
    
}

.hotelr-info-li {
    margin-right: 30px;
}

.hotelr-info-li label {
    color: #606266;
    font-size: 15px;
    font-weight: 600;
}

.hotelr-info-li span {
    color: #606266;
    font-size: 14px;
}

.hotelr-table {
    margin-top: 10px;
}

.form-head {
    display: flex;
    justify-content: space-between;
}

.hotelr-form {
    margin-top: 20px;
}
.fjprice.el-input-number.is-without-controls .el-input__inner {
    padding-left: 2px;
    padding-right: 2px;
}
.form-foundationone {
    margin-top: 10px;
    border-top: 2px solid #409EFF;
    padding-top: 10px;
}

.form-foundationone .el-form-item {
    margin-bottom: 12px;
}

.form-foundationone .el-form-item__error {
    top: 90%;
}

.select-bz .el-select {
    width: 100%;
}
.payment-detail{
    border-top: #0002 1px solid;
    padding-top: 10px;
}
.Exchangerate-box{
    display: flex;
    flex-wrap: wrap;
    padding: 0 40px;
    margin-bottom: 10px;
    font-size: 14px;
    color: red;
}
.Exchangerate-box div{
    width: 120px;
   
}
</style>