<template>
    <div class="cost-all" v-loading="costloading" element-loading-text="拼命加载中" element-loading-spinner="el-icon-loading"
        element-loading-background="rgba(0, 0, 0, 0.8)">
        <div class="cost-box">
            <div class="cost-haed">
                <div class="ser-btn">
                    <div class="ser-btn-li Cost_topFlex" style="display: flex;">
                        <el-select v-model="diid" filterable placeholder="请选择" @change="groupChange">
                            <el-option v-for="item in options" :key="item.id" :label="item.groupName" :value="item.id">
                                <span v-if="item.isTrue == 'True'" style="color:green">{{ item.groupName }}</span>
                                <span v-else style="color:gray">{{ item.groupName }}</span>
                            </el-option>
                        </el-select>
                        <div style="line-height: 40px;width: 90px;text-align: right;padding-right: 12px;">
                            分段类型:
                        </div>
                        <el-select v-model="costTypevalue" placeholder="请选择" @change="costTypeSelect">
                            <el-option v-for="item in costType" :key="item.value" :label="item.label"
                                :value="item.value">
                            </el-option>
                        </el-select>
                    </div>
                    <div class="ser-btn-li">
                        <el-button type="primary">导入收款账单</el-button>
                        <el-button type="primary" @click="GetPriceCheckWord">生成收款账单</el-button>
                        <el-button type="primary" @click="GetClientWord">导出客户报表</el-button>
                        <el-button type="primary" @click="GetGroupCostExcel">导出成本</el-button>
                        <el-button type="primary" @click="save">保存设置</el-button>
                        <el-button type="primary">一键复制</el-button>
                        <el-button type="primary" @click="GroupIsShare">成本通知</el-button>
                    </div>
                </div>
                <div class="cost-input">
                    <el-form :inline="true" class="demo-form-inline" :model='AGroupCostParameter' ref="inputs"
                        :rules="rules">
                        <el-form-item label="税率:" prop="tax">
                            <el-input v-model="AGroupCostParameter.tax" placeholder="税率"></el-input>
                        </el-form-item>
                        <el-form-item label="货币:">
                            <el-select v-model="AGroupCostParameter.currency" placeholder="请选择">
                                <el-option v-for="item in currencyOption" :key="item.value" :label="item.label"
                                    :value="item.value">
                                </el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label="汇率:" prop="rate">
                            <el-input v-model="AGroupCostParameter.rate" placeholder="汇率"></el-input>
                        </el-form-item>
                    </el-form>
                    <div v-show="costTypevalue == 'A'">
                        <el-form :inline="true" class="demo-form-inline" :rules="HotelRules" ref="DHotel"
                            :model="costTypeHotelNumbers.filter(item => item.type == 'Default')[0]">
                            <el-form-item label="TBR:" prop="tbr">
                                <el-input
                                    v-model.number="costTypeHotelNumbers.filter(item => item.type == 'Default')[0].tbr"
                                    placeholder="TBR"><i slot="suffix"
                                        style="font-style:normal;margin-right: 10px;">间</i></el-input>
                            </el-form-item>
                            <el-form-item label="SGR:" prop="sgr">
                                <el-input
                                    v-model.number="costTypeHotelNumbers.filter(item => item.type == 'Default')[0].sgr"
                                    placeholder="SGR"><i slot="suffix"
                                        style="font-style:normal;margin-right: 10px;">间</i></el-input>
                            </el-form-item>
                            <el-form-item label="JS/ES:" prop="jses">
                                <el-input
                                    v-model.number="costTypeHotelNumbers.filter(item => item.type == 'Default')[0].jses"
                                    placeholder="JS/ES"><i slot="suffix"
                                        style="font-style:normal;margin-right: 10px;">间</i></el-input>
                            </el-form-item>
                            <el-form-item label="SUITE:" prop="suite">
                                <el-input
                                    v-model.number="costTypeHotelNumbers.filter(item => item.type == 'Default')[0].suite"
                                    placeholder="SUITE"><i slot="suffix"
                                        style="font-style:normal;margin-right: 10px;">间</i></el-input>
                            </el-form-item>
                        </el-form>
                    </div>
                    <div v-show="costTypevalue == 'B'" class="CostBShow">
                        <el-row>
                            <el-form ref="Asection" :inline="true" class="demo-form-inline" :rules="CostTimeRules"
                                :model="AGroupCostParameter">
                                <el-col :span="5">
                                    <div> <el-form-item label="第一段开始时间:" prop="costTypeStartTime">
                                            <el-date-picker v-model="AGroupCostParameter.costTypeStartTime" type="date"
                                                placeholder="第一段开始时间" format="yyyy 年 MM 月 dd 日"
                                                value-format="yyyy-MM-dd">
                                            </el-date-picker>
                                        </el-form-item>
                                    </div>
                                </el-col>
                                <el-col :span="4">
                                    <div> <el-form-item label="结束时间:" prop="costTypeendTime"><el-date-picker
                                                v-model="AGroupCostParameter.costTypeendTime" type="date"
                                                placeholder="结束时间" format="yyyy 年 MM 月 dd 日" value-format="yyyy-MM-dd">
                                            </el-date-picker>
                                        </el-form-item>
                                    </div>
                                </el-col>
                                <el-col :span="3">
                                    <div>
                                        <el-form-item label="人数:" prop="costTypenumber"><el-input placeholder="人数"
                                                v-model.number="AGroupCostParameter.costTypenumber" clearable>
                                            </el-input>
                                        </el-form-item>
                                    </div>
                                </el-col>
                            </el-form>
                            <el-form ref="AHotel" :inline="true" class="demo-form-inline" :rules="HotelRules"
                                :model="costTypeHotelNumbers.filter(item => item.type == 'A')[0]">
                                <el-col :span="3">
                                    <div><el-form-item label="TBR:" prop="tbr">
                                            <el-input
                                                v-model.number="costTypeHotelNumbers.filter(item => item.type == 'A')[0].tbr"
                                                placeholder="TBR"><i slot="suffix"
                                                    style="font-style:normal;margin-right: 10px;">间</i></el-input>
                                        </el-form-item></div>
                                </el-col>
                                <el-col :span="3">
                                    <div> <el-form-item label="SGR:" prop="sgr">
                                            <el-input
                                                v-model.number="costTypeHotelNumbers.filter(item => item.type == 'A')[0].sgr"
                                                placeholder="SGR"><i slot="suffix"
                                                    style="font-style:normal;margin-right: 10px;">间</i></el-input>
                                        </el-form-item></div>
                                </el-col>
                                <el-col :span="3">
                                    <div><el-form-item label="JS/ES:" prop="jses">
                                            <el-input
                                                v-model.number="costTypeHotelNumbers.filter(item => item.type == 'A')[0].jses"
                                                placeholder="JS/ES"><i slot="suffix"
                                                    style="font-style:normal;margin-right: 10px;">间</i></el-input>
                                        </el-form-item></div>
                                </el-col>
                                <el-col :span="3">
                                    <div><el-form-item label="SUITE:" prop="suite">
                                            <el-input
                                                v-model.number="costTypeHotelNumbers.filter(item => item.type == 'A')[0].suite"
                                                placeholder="SUITE"><i slot="suffix"
                                                    style="font-style:normal;margin-right: 10px;">间</i></el-input>
                                        </el-form-item></div>
                                </el-col>
                            </el-form>
                        </el-row>
                        <el-row>
                            <el-form ref="Bsection" :inline="true" class="demo-form-inline" :rules="CostTimeRules"
                                :model="BGroupCostParameter">
                                <el-col :span="5">
                                    <div> <el-form-item label="第二段开始时间:" prop="costTypeStartTime">
                                            <el-date-picker v-model="BGroupCostParameter.costTypeStartTime" type="date"
                                                placeholder="第二段开始时间" format="yyyy 年 MM 月 dd 日"
                                                value-format="yyyy-MM-dd">
                                            </el-date-picker>
                                        </el-form-item>
                                    </div>
                                </el-col>
                                <el-col :span="4">
                                    <div> <el-form-item label="结束时间:" prop="costTypeendTime"><el-date-picker
                                                v-model="BGroupCostParameter.costTypeendTime" type="date"
                                                placeholder="结束时间" format="yyyy 年 MM 月 dd 日" value-format="yyyy-MM-dd">
                                            </el-date-picker>
                                        </el-form-item>
                                    </div>
                                </el-col>
                                <el-col :span="3">
                                    <div>
                                        <el-form-item label="人数:" prop="costTypenumber"><el-input placeholder="人数"
                                                v-model.number="BGroupCostParameter.costTypenumber" clearable>
                                            </el-input>
                                        </el-form-item>
                                    </div>
                                </el-col>
                            </el-form>
                            <el-form ref="BHotel" :inline="true" class="demo-form-inline" :rules="HotelRules"
                                :model="costTypeHotelNumbers.filter(item => item.type == 'B')[0]">
                                <el-col :span="3">
                                    <div>
                                        <el-form-item label="TBR:" prop="tbr">
                                            <el-input
                                                v-model.number="costTypeHotelNumbers.filter(item => item.type == 'B')[0].tbr"
                                                placeholder="TBR"><i slot="suffix"
                                                    style="font-style:normal;margin-right: 10px;">间</i></el-input>
                                        </el-form-item>
                                    </div>
                                </el-col>
                                <el-col :span="3">
                                    <div> <el-form-item label="SGR:" prop="sgr">
                                            <el-input
                                                v-model.number="costTypeHotelNumbers.filter(item => item.type == 'B')[0].sgr"
                                                placeholder="SGR"><i slot="suffix"
                                                    style="font-style:normal;margin-right: 10px;">间</i></el-input>
                                        </el-form-item></div>
                                </el-col>
                                <el-col :span="3">
                                    <div><el-form-item label="JS/ES:" prop="jses">
                                            <el-input
                                                v-model.number="costTypeHotelNumbers.filter(item => item.type == 'B')[0].jses"
                                                placeholder="JS/ES"><i slot="suffix"
                                                    style="font-style:normal;margin-right: 10px;">间</i></el-input>
                                        </el-form-item></div>
                                </el-col>
                                <el-col :span="3">
                                    <div><el-form-item label="SUITE:" prop="suite">
                                            <el-input
                                                v-model.number="costTypeHotelNumbers.filter(item => item.type == 'B')[0].suite"
                                                placeholder="SUITE"><i slot="suffix"
                                                    style="font-style:normal;margin-right: 10px;">间</i></el-input>
                                        </el-form-item></div>
                                </el-col>
                            </el-form>
                        </el-row>

                    </div>
                </div>
                <div class="cost-info">
                    <div class="cost-info-li">
                        <label>团 号：</label>
                        <span>{{ grouptitleinfo.tourCode }}</span>
                    </div>
                    <div class="cost-info-li">
                        <label>客 户：</label>
                        <span>{{ grouptitleinfo.clientName }}</span>
                    </div>
                    <div class="cost-info-li">
                        <label>出访国家：</label>
                        <span>{{ grouptitleinfo.visitCountry }}</span>
                    </div>
                    <div class="cost-info-li">
                        <label>起止日期：</label>
                        <span>{{ grouptitleinfo.visitStartDate }} -
                            {{ grouptitleinfo.visitEndDate
                            }}</span>
                    </div>
                    <div class="cost-info-li">
                        <label>天数/人数：</label>
                        <span>{{ grouptitleinfo.visitDays }}天/{{ grouptitleinfo.visitPNumber }}人</span>
                    </div>
                </div>
            </div>
            <div style="color: #606266;font-size: 15px;font-weight: 600;">请选择要显示的项：</div>
            <el-checkbox-group class="form-ss"
                v-model="CheckBoxListSelect.filter(item => item.cbType == 'Top')[0].cbValues" @change="TopChange">
                <el-checkbox v-for="(  item, index  ) in    checkOptions  " :key="index" :title="item.tips"
                    :label="item.label" @change="(val) => { topcheckboxChange(val, item.label) }"></el-checkbox>
            </el-checkbox-group>
            <el-table :summary-method="getSummaries" show-summary show-overflow-tooltip :data="tableData" :border="true"
                size="small" row-class-name="row" cell-class-name="column" :highlight-current-row="true" :fit="true"
                :height="centerheight">
                <template v-for="(  item, index  ) in      tableLabel     ">
                    <el-table-column :key="index" :prop="item.prop"
                        :width="item.width == 150 ? columnWidth : item.width" :label="item.label"
                        v-if="CheckBoxListSelect.filter(item => item.cbType == 'Top')[0].cbValues.includes(item.label)">
                        <!-- eslint-disable-next-line -->
                        <template slot="header" slot-scope="scope">
                            <el-tooltip effect="dark" :content="item.describe" placement="top">
                                <div>
                                    <span class="rapAddress">{{ item.label }}</span>
                                    <span v-show="item.describe.indexOf('个人成本') != -1" style=" color:red">*</span>
                                </div>
                            </el-tooltip>
                        </template>
                        <template slot-scope="scope">
                            <div v-if="item.prop === 'sales'">
                                <el-input :ref="'el-input-' + index" v-model="scope.row[item.prop]" show-word-limit />
                            </div>
                            <div v-else-if="item.prop === 'day'">
                                <el-input :ref="'el-input-' + index" v-model="scope.row[item.prop]" type="number"
                                    min="0" @change="NumberSetTime(scope.row[item.prop], scope.$index)" />
                            </div>
                            <div v-else-if="item.prop === 'date'">
                                <span :title="scope.row[item.prop]">
                                    <!-- <el-input placeholder="请输入日期"
                                        v-model="scope.row[item.prop]"
                                        @change="dateChange(scope.row[item.prop], scope.$index)">
                                    </el-input> -->
                                    <el-date-picker v-model="scope.row[item.prop]" type="date" value-format="yyyy-MM-dd"
                                        placeholder="选择日期">
                                    </el-date-picker>
                                </span>
                                <div>
                                    {{ GetWeek(scope.row[item.prop]) }}
                                </div>
                            </div>
                            <div v-else-if="item.prop === 'sale'">
                                <el-row class="figures-btn">
                                    <el-button @click="handleEdit(scope.$index, scope.row, 1)" size="mini"
                                        type="primary">司兼导</el-button>
                                    <el-button @click="handleEdit(scope.$index, scope.row, 2)" size="mini"
                                        type="primary">导
                                        游</el-button>
                                    <el-button @click="handleEdit(scope.$index, scope.row, 3)" size="mini"
                                        type="primary">车数据</el-button>
                                    <el-button @click="handleEdit(scope.$index, scope.row, 4)" size="mini"
                                        type="primary">景
                                        点</el-button>
                                </el-row>
                            </div>
                            <div v-else-if="item.width == 200">
                                <el-input type="textarea" :rows="5" placeholder="请输入内容" v-model="scope.row[item.prop]">
                                </el-input>
                            </div>
                            <span v-else :title="scope.row[item.prop]"><el-input placeholder="请输入内容"
                                    v-model="scope.row[item.prop]">
                                </el-input></span>
                        </template>
                    </el-table-column>
                </template>
                <el-table-column label="操作" :width="200">
                    <!-- eslint-disable-next-line -->
                    <template slot-scope="scope">
                        <el-button size="mini" @click="insertRow(scope.$index, scope.row, 'UP')" type="primary">插入行
                            ↑</el-button>
                        <br />
                        <el-button style="margin: 10px;" size="mini"
                            @click="handleDelete(scope.$index, scope.row, tableData)" type="danger">删除<i
                                class="el-icon-delete"></i></el-button>
                        <br />
                        <el-button size="mini" @click="insertRow(scope.$index, scope.row, 'DOWN')" type="primary">插入行
                            ↓</el-button>

                    </template>
                </el-table-column>
            </el-table>
            <div style="text-align: center;padding: 10px 0;"><el-button @click="addStrip" type="primary">添 加 <i
                        class="el-icon-plus"></i></el-button></div>
            <div class="sheet-box">
                <div class="sheet-li">
                    <div style="color: #606266;font-size: 15px;font-weight: 600;">请选择要显示的项：</div>
                    <el-checkbox-group v-model="CheckBoxListSelect.filter(item => item.cbType == 'Left')[0].cbValues">
                        <el-checkbox v-for="(      item, index      ) in       sheetoneOptions      " :key="index"
                            :label="item"></el-checkbox>
                    </el-checkbox-group>
                    <div style="display: flex;">
                        <div :style="{ 'width': costTypevalue == 'A' ? '100%' : '49%' }">
                            <div class="biaoge" style="width: 200px;margin-bottom:0px;margin-top: 20px;"
                                v-if="CheckBoxListSelect.filter(item => item.cbType == 'Left')[0].cbValues.includes('签证') && visaCountryInfoArr.length > 0">

                                <el-table :data="visaCountryInfoArr" border style="width: 100%">
                                    <el-table-column prop="visaCountry" label="签证国家">
                                    </el-table-column>
                                    <el-table-column prop="visaPrice" label="签证费用">
                                    </el-table-column>
                                </el-table>

                            </div>
                            <div v-for="(      sheetitem, index      ) in       sheetDatal      " :key="index">
                                <div class="biaoge" :class="{ 'biaogeKz': costTypevalue == 'B' }"
                                    v-if="CheckBoxListSelect.filter(item => item.cbType == 'Left')[0].cbValues.includes(sheetitem.label)">
                                    <el-table :data="[{ a: 1 }]" border style="width: 100%">
                                        <el-table-column
                                            v-for="(      itemsheetone, index      ) in       sheetitem.childList      "
                                            :key="index" :prop="itemsheetone.prop" :label="itemsheetone.childLabel">
                                            <template slot-scope="scope">
                                                <div v-if="itemsheetone.prop.indexOf(sheetitem.EnLabel) != -1">
                                                    <div v-if="itemsheetone.isBind">
                                                        <span>{{ AGroupCostParameter[itemsheetone.prop] }}</span>
                                                    </div>
                                                    <div v-else>
                                                        <!-- <el-input v-model="AGroupCostParameter[itemsheetone.prop]"
                                                            show-word-limit /> -->
                                                        <el-input-number
                                                            v-model="AGroupCostParameter[itemsheetone.prop]"
                                                            @change="handleChange" :min="0" size="small"
                                                            :controls="false"></el-input-number>
                                                    </div>
                                                </div>
                                                <div v-else-if="itemsheetone.prop === 'ZCB'">
                                                    {{ calculateZCB(sheetitem.EnLabel) }}
                                                </div>
                                                <div v-else-if="itemsheetone.prop === 'DRBJ'">
                                                    {{ calculateDRBJ(sheetitem.EnLabel) }}
                                                </div>
                                                <div v-else-if="itemsheetone.prop === 'ZBJ'">
                                                    {{ calculateZBJ(sheetitem.EnLabel) }}
                                                </div>
                                                <div v-else-if="itemsheetone.prop === 'DRLR'">
                                                    {{ calculateDRLR(sheetitem.EnLabel) }}
                                                </div>
                                                <div v-else-if="itemsheetone.prop === 'ZLR'">
                                                    {{ calculateZLR(sheetitem.EnLabel) }}
                                                </div>
                                                <!-- 绑定对象属性的值 -->
                                            </template>
                                        </el-table-column>
                                    </el-table>
                                </div>
                            </div>
                        </div>
                        <div style="width: 2%;" v-show="costTypevalue != 'A'"></div>
                        <div style="width: 49%;" v-show="costTypevalue != 'A'">

                            <div class="biaoge"
                                style="width: 200px;margin-bottom:0px;margin-top: 20px;visibility: hidden;"
                                v-if="CheckBoxListSelect.filter(item => item.cbType == 'Left')[0].cbValues.includes('签证') && visaCountryInfoArr.length > 0">

                                <el-table :data="visaCountryInfoArr" border style="width: 100%">
                                    <el-table-column prop="visaCountry" label="签证国家">
                                    </el-table-column>
                                    <el-table-column prop="visaPrice" label="签证费用">
                                    </el-table-column>
                                </el-table>

                            </div>
                            <div v-for="(      sheetitem, index      ) in       sheetDatal      " :key="index">
                                <div class="biaogeB"
                                    v-if="CheckBoxListSelect.filter(item => item.cbType == 'Left')[0].cbValues.includes(sheetitem.label)">
                                    <el-table :data="[{ a: 1 }]" border style="width: 100%"
                                        :class="{ 'hiddenElement': (sheetitem.EnLabel == 'visa' || sheetitem.EnLabel == 'bx') ? true : false }">
                                        <el-table-column
                                            v-for="(      itemsheetone, index      ) in       sheetitem.childList      "
                                            :key="index" :prop="itemsheetone.prop" :label="itemsheetone.childLabel">
                                            <template slot-scope="scope">
                                                <div v-if="itemsheetone.prop.indexOf(sheetitem.EnLabel) != -1">
                                                    <div v-if="itemsheetone.isBind">
                                                        <span>{{ BGroupCostParameter[itemsheetone.prop] }}</span>
                                                    </div>
                                                    <div v-else>
                                                        <!-- <el-input v-model="BGroupCostParameter[itemsheetone.prop]"
                                                            show-word-limit /> -->
                                                        <el-input-number
                                                            v-model="BGroupCostParameter[itemsheetone.prop]"
                                                            @change="handleChange" :min="0" size="small"
                                                            :controls="false"></el-input-number>
                                                    </div>
                                                </div>
                                                <div v-else-if="itemsheetone.prop === 'ZCB'">
                                                    {{ BcalculateZCB(sheetitem.EnLabel) }}
                                                </div>
                                                <div v-else-if="itemsheetone.prop === 'DRBJ'">
                                                    {{ BcalculateDRBJ(sheetitem.EnLabel) }}
                                                </div>
                                                <div v-else-if="itemsheetone.prop === 'ZBJ'">
                                                    {{ BcalculateZBJ(sheetitem.EnLabel) }}
                                                </div>
                                                <div v-else-if="itemsheetone.prop === 'DRLR'">
                                                    {{ BcalculateDRLR(sheetitem.EnLabel) }}
                                                </div>
                                                <div v-else-if="itemsheetone.prop === 'ZLR'">
                                                    {{ BcalculateZLR(sheetitem.EnLabel) }}
                                                </div>
                                                <!-- 绑定对象属性的值 -->
                                            </template>
                                        </el-table-column>
                                    </el-table>
                                </div>
                            </div>
                        </div>
                    </div>

                </div>
            </div>
            <div class="cabin-box">
                <div class="cabin-li">
                    <div style="color: #606266;font-size: 15px;font-weight: 600;">请选择要显示的项：</div>
                    <el-checkbox-group v-model="CheckBoxListSelect.filter(item => item.cbType == 'Right')[0].cbValues">
                        <el-checkbox v-for="(      item, index      ) in       cabinoneOptions      " :key="index"
                            :label="item"></el-checkbox>
                    </el-checkbox-group>
                    <div style="display: flex;">
                        <div :style="{ 'width': costTypevalue == 'A' ? '100%' : '49%' }">
                            <div v-for="(      cabinitem, index      ) in       cabinDatal      " :key="index">
                                <div class="biaoge"
                                    v-if="CheckBoxListSelect.filter(item => item.cbType == 'Right')[0].cbValues.includes(cabinitem.label)">
                                    <div style="    color: rgb(96, 98, 102);font-size: 15px;font-weight: 600;">{{
        cabinitem.label }}
                                    </div>
                                    <el-table :data="cabinitem.sheetInfo" border style="width: 100%">
                                        <el-table-column
                                            v-for="(      itemcabinone, index      ) in       cabinitem.childList      "
                                            :key="index" :prop="itemcabinone.prop" :label="itemcabinone.childLabel">
                                            <template slot-scope="scope">
                                                <div v-if="itemcabinone.prop === 'toll'">
                                                    <el-input :ref="'el-input-' + index"
                                                        v-model="scope.row[itemcabinone.prop]" show-word-limit
                                                        disabled />
                                                </div>
                                                <span
                                                    v-else-if="itemcabinone.prop === 'costPerson' || itemcabinone.prop === 'singleQuote'"
                                                    :title="scope.row[itemcabinone.prop]">{{
        scope.row[itemcabinone.prop]
    }}</span>
                                                <span v-else-if="itemcabinone.prop === 'totalCost'"
                                                    :title="scope.row[itemcabinone.prop]">{{
        (scope.row['toll'] * scope.row['costPerson']).toFixed(2)
    }}</span>
                                                <span v-else-if="itemcabinone.prop === 'totalQuote'"
                                                    :title="scope.row[itemcabinone.prop]">{{
        (scope.row['toll'] * scope.row['singleQuote']).toFixed(2)
    }}</span>
                                                <span v-else-if="itemcabinone.prop === 'singleProfit'"
                                                    :title="scope.row[itemcabinone.prop]">{{
        ((scope.row['singleQuote'] - scope.row['costPerson'])).toFixed(2)
    }}</span>
                                                <span v-else-if="itemcabinone.prop === 'totalProfit'"
                                                    :title="scope.row[itemcabinone.prop]">{{
        ((scope.row['singleQuote'] - scope.row['costPerson']) *
            scope.row['toll']).toFixed(2)
    }}</span>
                                                <span v-else :title="scope.row[itemcabinone.prop]">{{
        scope.row[itemcabinone.prop]
    }}</span>

                                            </template>
                                        </el-table-column>
                                    </el-table>
                                </div>
                            </div>
                        </div>
                        <div style="width: 2%;" v-show="costTypevalue != 'A'"></div>
                        <div style="width: 49%;" v-show="costTypevalue != 'A'">
                            <div v-for="(      cabinitem, index      ) in       BcabinDatal      " :key="index">
                                <div class="biaogeB"
                                    v-if="CheckBoxListSelect.filter(item => item.cbType == 'Right')[0].cbValues.includes(cabinitem.label)">
                                    <div style="    color: rgb(96, 98, 102);font-size: 15px;font-weight: 600;">{{
        cabinitem.label }}
                                    </div>
                                    <el-table :data="cabinitem.sheetInfo" border style="width: 100%">
                                        <el-table-column
                                            v-for="(      itemcabinone, index      ) in       cabinitem.childList      "
                                            :key="index" :prop="itemcabinone.prop" :label="itemcabinone.childLabel">
                                            <template slot-scope="scope">
                                                <div v-if="itemcabinone.prop === 'toll'">
                                                    <el-input :ref="'el-input-' + index"
                                                        v-model="scope.row[itemcabinone.prop]" show-word-limit
                                                        disabled />
                                                </div>
                                                <span
                                                    v-else-if="itemcabinone.prop === 'costPerson' || itemcabinone.prop === 'singleQuote'"
                                                    :title="scope.row[itemcabinone.prop]">{{
        scope.row[itemcabinone.prop]
    }}</span>
                                                <span v-else-if="itemcabinone.prop === 'totalCost'"
                                                    :title="scope.row[itemcabinone.prop]">{{
        (scope.row['toll'] * scope.row['costPerson']).toFixed(2)
    }}</span>
                                                <span v-else-if="itemcabinone.prop === 'totalQuote'"
                                                    :title="scope.row[itemcabinone.prop]">{{
        (scope.row['toll'] * scope.row['singleQuote']).toFixed(2)
    }}</span>
                                                <span v-else-if="itemcabinone.prop === 'singleProfit'"
                                                    :title="scope.row[itemcabinone.prop]">{{
        (scope.row['singleQuote'] - scope.row['costPerson']).toFixed(2)
    }}</span>
                                                <span v-else-if="itemcabinone.prop === 'totalProfit'"
                                                    :title="scope.row[itemcabinone.prop]">{{
                                                    ((scope.row['singleQuote'] - scope.row['costPerson']) *
                                                    scope.row['toll']).toFixed(2)
                                                    }}</span>
                                                <span v-else :title="scope.row[itemcabinone.prop]">{{
                                                    scope.row[itemcabinone.prop]
                                                    }}</span>

                                            </template>
                                        </el-table-column>
                                    </el-table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <el-dialog :title="DialogTitle" :visible.sync="outerVisible" :width="'60%'" :close-on-click-modal="false">
            <div>
                <div style="display: flex;">
                    <div style="width: 30%;">
                        <el-input v-model="dialogSearchInput" placeholder="请输入城市名称"></el-input>
                    </div>
                    <div style="width: 2%;"></div>
                    <!-- <div><el-button type="primary" @click="dialogSearchMethon">搜索</el-button></div> -->
                </div>
                <br />
                <el-table ref="singleTable" border @current-change="SelChange"
                    :data="filterdialogSearchInput.slice((currentPage - 1) * pageSize, currentPage * pageSize)"
                    highlight-current-row style="width: 100%">
                    <el-table-column v-for="       item, index       in       SeldialogColumn      " :key="index"
                        :prop="item.prop" :label="item.title">
                        <template slot-scope="scope">
                            <div>
                                {{ scope.row[item.prop] }}
                            </div>
                        </template>
                    </el-table-column>
                </el-table>
                <div class="block">
                    <el-pagination align='center' @current-change="handleCurrentChange" :current-page="currentPage"
                        :page-sizes="[5, 10]" :page-size="pageSize" layout="total, sizes, prev, pager, next"
                        @size-change="handleSizeChange" :total="filterdialogSearchInput.length">
                    </el-pagination>
                </div>
            </div>
            <!-- <el-dialog width="30%" title="内层 Dialog" :visible.sync="innerVisible" append-to-body>
            </el-dialog> -->

            <!-- <div slot="footer" class="dialog-footer">
                <el-button @click="outerVisible = false">取 消</el-button>
                <el-button type="primary" @click="innerVisible = true">打开内层 Dialog</el-button>
            </div> -->

            <div slot="footer" class="dialog-footer">
                <el-button @click="outerVisible = false">取 消</el-button>
                <el-button type="primary" @click="outerVisible = false">确定</el-button>
            </div>
        </el-dialog>
    </div>
</template>
<script>
import { C } from '@fullcalendar/core/internal-common';

export default {
    data() {
        return {
            costloading: true,
            outerVisible: false,
            innerVisible: false,
            //checkList: ['DAY', 'ITIN', 'VA', 'VF', 'VRD', 'T/G S', 'DATE'], //列表默认选中
            checkOptions: [
                { label: 'DAY', tips: '时间(DATE)' },
                { label: 'DATE', tips: '行程描述(ITINERARY)' },
                { label: 'ITIN', tips: '行程描述(ITINERARY)' },
                { label: 'VA', tips: '车服务区域(Vehicle Area)' },
                { label: 'VT', tips: '车型(VEHICLE TYPE)' },
                { label: 'VF', tips: '车费用(VEHICLE FEES)' },
                { label: 'VN', tips: '车数量(VEHICLE Number)' },
                { label: 'VRD', tips: '用车时间(VEHICLE RENTAL DURATION)' },
                { label: 'T/G S', tips: '导游工资(TOUR GUIDE SALARY)' },
                { label: 'T/G N', tips: '导游数量(TOUR GUIDE Number)' },
                { label: 'T/G WH', tips: '导游工作时间(导游工作时间)' },
                { label: 'T/G OF', tips: '导游超时费用(TOUR GUIDE OVERTIME FEES)' },
                { label: 'T/G M', tips: '导游餐补(TOUR GUIDE MEALS)' },
                { label: 'T/G A', tips: '导游房补(TOUR GUIDE ACCOMMODATION)' },
                { label: 'T/G TF', tips: '导游交通费(TOUR GUIDE TRANSPORATION FEES)' },
                { label: 'T/G EF', tips: '导游景点费(TOUR GUIDE ENTRANCE FEES)' },
                { label: 'C/F M', tips: '司机餐补(CHAUFFEUR MEALS)' },
                { label: 'C/F OF', tips: '司机超时费用(CHAUFFEUR OVERTIME FEES)' },
                { label: 'B', tips: '早餐(BREAKFAST) #个人成本' },
                { label: 'L', tips: '午餐(LUNCH) #个人成本' },
                { label: 'D', tips: '晚餐(DINNER) #个人成本' },
                { label: 'TBR', tips: '双人间(TWIN BED ROOM) #个人成本' },
                { label: 'SGR', tips: '单间(SINGLE ROOM) #个人成本' },
                { label: 'JS/ES', tips: '小套房/豪华套房(JUNIOR SUITE/EXECUTIVE SUITE) #个人成本' },
                { label: 'SUITE', tips: '套房(SUITE) #个人成本' },
                { label: 'ACCO N', tips: '住宿地名称(ACCOMMODATION NAME)' },
                { label: 'T/V', tips: '公务活动费用(T/V)' },
                { label: '1/L', tips: '公务活动费用(1/L)' },
                { label: 'I/F', tips: '公务翻译费用(INTERPRETER FEES)' },
                { label: 'EF', tips: '景点门票(ENTRANCE FEE) #个人成本' },
                { label: 'B/R/F', tips: '饮料零食水果(BEVERAGE/RRESHMENT/FRUIT)' },
                { label: 'TE', tips: '出行物资(TRAVELLLING ESSENTIALS) #个人成本' },
                { label: 'T/G T', tips: '导游小费(T/G TIPS) #个人成本' },
                { label: 'DRV T', tips: '司机小费(DRIVER TIPS #个人成本)' },
                { label: 'P/C', tips: '零用金(PETTY CASH) #个人成本' },
                { label: 'T/L F', tips: '领队费(TOUR LEADER FEES)' },
                { label: 'E/C T', tips: '会务费(EXPO/CONFERENCE TICKET)' }
            ],
            tableLabel: [
                { label: 'DAY', width: '90', prop: 'day', describe: '天数(DAY)' },
                { label: 'DATE', width: '180', prop: 'date', describe: '时间(DATE)' },
                { label: 'ITIN', width: '200', prop: 'itin', describe: '行程描述(ITINERARY)' },
                { label: 'VA', width: '85', prop: 'sale', describe: '车服务区域(Vehicle Area)' }, // ??????????????
                { label: 'VT', width: '200', prop: 'carType', describe: '车型(VEHICLE TYPE)' },
                { label: 'VF', width: '150', prop: 'carCost', describe: '车费用(VEHICLE FEES)' },
                { label: 'VN', width: '150', prop: 'carNumber', describe: '车数量(VEHICLE Number)' },
                { label: 'VRD', width: '150', prop: 'carTiming', describe: '用车时间(VEHICLE RENTAL DURATION)' },
                { label: 'T/G S', width: '150', prop: 'tgs', describe: '导游工资(TOUR GUIDE SALARY)' },
                { label: 'T/G N', width: '150', prop: 'tgn', describe: '导游数量(TOUR GUIDE Number' },
                { label: 'T/G WH', width: '150', prop: 'tgwh', describe: '导游工作时间(导游工作时间)' },
                { label: 'T/G OF', width: '150', prop: 'tgof', describe: '导游超时费用(TOUR GUIDE OVERTIME FEES)' },
                { label: 'T/G M', width: '150', prop: 'tgm', describe: '导游餐补(TOUR GUIDE MEALS)' },
                { label: 'T/G A', width: '150', prop: 'tga', describe: '导游房补(TOUR GUIDE ACCOMMODATION)' },
                { label: 'T/G TF', width: '150', prop: 'tgtf', describe: '导游交通费(TOUR GUIDE TRANSPORATION FEES)' },
                { label: 'T/G EF', width: '150', prop: 'tgef', describe: '导游景点费(TOUR GUIDE ENTRANCE FEES)' },
                { label: 'C/F M', width: '150', prop: 'cfm', describe: '司机餐补(CHAUFFEUR MEALS)' },
                { label: 'C/F OF', width: '150', prop: 'cfof', describe: '司机超时费用(CHAUFFEUR OVERTIME FEES)' },
                { label: 'B', width: '150', prop: 'b', describe: '早餐(BREAKFAST) #个人成本' },
                { label: 'L', width: '150', prop: 'l', describe: '午餐(LUNCH) #个人成本' },
                { label: 'D', width: '150', prop: 'd', describe: '晚餐(DINNER) #个人成本' },
                { label: 'TBR', width: '150', prop: 'tbr', describe: '双人间(TWIN BED ROOM) #个人成本' },
                { label: 'SGR', width: '150', prop: 'sgr', describe: '单间(SINGLE ROOM) #个人成本' },
                { label: 'JS/ES', width: '150', prop: 'jS_ES', describe: '小套房/豪华套房(JUNIOR SUITE/EXECUTIVE SUITE) #个人成本' },
                { label: 'SUITE', width: '150', prop: 'suite', describe: '套房(SUITE) #个人成本' },
                { label: 'ACCO N', width: '200', prop: 'accon', describe: '住宿地名称(ACCOMMODATION NAME)' },
                { label: 'T/V', width: '150', prop: 'tv', describe: '公务活动费用(T/V)' },
                { label: '1/L', width: '150', prop: 'iL', describe: '邀请函相关费用(1/L)' },
                { label: 'I/F', width: '150', prop: 'if', describe: '公务翻译费用(INTERPRETER FEES)' },
                { label: 'EF', width: '150', prop: 'ef', describe: '景点门票(ENTRANCE FEE) #个人成本' },
                { label: 'B/R/F', width: '150', prop: 'b_R_F', describe: '饮料零食水果(BEVERAGE/RRESHMENT/FRUIT)' },
                { label: 'TE', width: '150', prop: 'te', describe: '出行物资(TRAVELLLING ESSENTIALS) #个人成本' },
                { label: 'T/G T', width: '150', prop: 'tgTips', describe: '导游小费(T/G TIPS) #个人成本' },
                { label: 'DRV T', width: '150', prop: 'drvTips', describe: '司机小费(DRIVER TIPS #个人成本)' },
                { label: 'P/C', width: '150', prop: 'pc', describe: '零用金(PETTY CASH) #个人成本' },
                { label: 'T/L F', width: '150', prop: 'tlf', describe: '领队费(TOUR LEADER FEES)' },
                { label: 'E/C T', width: '150', prop: 'ect', describe: '会务费(EXPO/CONFERENCE TICKET)' }
            ],
            statisticsArr: [
                { label: 'DAY', total: '', individual: '' },
                { label: 'DATE', total: '', individual: '' },
                { label: 'ITIN', total: '', individual: '' },
                { label: 'VA', total: '', individual: '' },
                { label: 'VT', total: '', individual: '' },
                { label: 'VF', total: '车费', individual: '车费人均' },
                { label: 'VN', total: '', individual: '' },
                { label: 'VRD', total: '', individual: '' },
                { label: 'T/G S', total: '导游工资', individual: '导游工资人均' },
                { label: 'T/G N', total: '', individual: '' },
                { label: 'T/G WH', total: '', individual: '' },
                { label: 'T/G OF', total: '', individual: '' },
                { label: 'T/G M', total: '', individual: '' },
                { label: 'T/G A', total: '', individual: '' },
                { label: 'T/G TF', total: '', individual: '' }

            ],
            tableData: [], //列表数据
            options: [],
            diid: '',
            currencyOption: [{
                value: 'CNY',
                label: 'CNY'
            }, {
                value: 'CAD',
                label: 'CAD'
            }, {
                value: 'EGP',
                label: 'EGP'
            }, {
                value: 'EUR',
                label: 'EUR'
            }, {
                value: 'USD',
                label: 'USD'
            }],
            currencyValueL: 'CNY',
            formInline: {
                user: '',
                region: ''
            },
            //sheetoneList: ['签证', '机票', '核酸检测',],
            sheetoneOptions: ['签证', '保险', '机票', '火车票', '船票', '核酸检测', '酒店TBR', '酒店SGR', '酒店JSES', '酒店SUITE', '地接', '公务', '零用金'],
            sheetDatal: [
                {
                    label: '签证',
                    EnLabel: 'visa',
                    childList: [
                        {
                            childLabel: '签证单人成本(CNY)',
                            prop: 'visaCB'
                        },
                        {
                            childLabel: '人数',
                            prop: 'visaRS'
                        },
                        {
                            childLabel: '签证系数',
                            prop: 'visaXS'
                        },
                        {
                            childLabel: '签证总成本(CNY)',
                            prop: 'ZCB'
                        },
                        {
                            childLabel: '签证单人报价(CNY)',
                            prop: 'DRBJ'  // 系数 * 单价
                        },
                        {
                            childLabel: '签证总报价(CNY)',
                            prop: 'ZBJ'  // 系数 * 单价 * 人数
                        },
                        {
                            childLabel: '签证单人利润(CNY)',
                            prop: 'DRLR' //系数 * 单价 - 单价
                        },
                        {
                            childLabel: '签证总利润(CNY)',
                            prop: 'ZLR'  //（系数 * 单价 - 单价） * 人数
                        },
                    ],

                },
                {
                    label: '保险',
                    EnLabel: 'bx',
                    childList: [
                        {
                            childLabel: '保险单人成本(CNY)',
                            prop: 'bxcb'
                        },
                        {
                            childLabel: '人数',
                            prop: 'bxrs'
                        },
                        {
                            childLabel: '保险系数',
                            prop: 'bxxs'
                        },
                        {
                            childLabel: '保险总成本(CNY)',
                            prop: 'ZCB'
                        },
                        {
                            childLabel: '保险单人报价(CNY)',
                            prop: 'DRBJ'
                        },
                        {
                            childLabel: '保险总报价(CNY)',
                            prop: 'ZBJ'
                        },
                        {
                            childLabel: '保险单人利润(CNY)',
                            prop: 'DRLR'
                        },
                        {
                            childLabel: '保险总利润(CNY)',
                            prop: 'ZLR'
                        },
                    ],

                },
                {
                    label: '火车票',
                    EnLabel: 'hcp',
                    childList: [
                        {
                            childLabel: '火车票单人成本(CNY)',
                            prop: 'hcpcb'
                        },
                        {
                            childLabel: '人数',
                            prop: 'hcprs'
                        },
                        {
                            childLabel: '火车票系数',
                            prop: 'hcpxs'
                        },
                        {
                            childLabel: '火车票总成本(CNY)',
                            prop: 'ZCB'
                        },
                        {
                            childLabel: '火车票单人报价(CNY)',
                            prop: 'DRBJ'
                        },
                        {
                            childLabel: '火车票总报价(CNY)',
                            prop: 'ZBJ'
                        },
                        {
                            childLabel: '火车票单人利润(CNY)',
                            prop: 'DRLR'
                        },
                        {
                            childLabel: '火车票总利润(CNY)',
                            prop: 'ZLR'
                        },
                    ],

                },
                {
                    label: '机票',
                    EnLabel: 'jjc',
                    childList: [
                        {
                            childLabel: '经济舱单人成本(CNY)',
                            prop: 'jjccb'
                        },
                        {
                            childLabel: '人数',
                            prop: 'jjcrs'
                        },
                        {
                            childLabel: '经济舱系数',
                            prop: 'jjcxs'
                        },
                        {
                            childLabel: '经济舱总成本(CNY)',
                            prop: 'ZCB'
                        },
                        {
                            childLabel: '经济舱单人报价(CNY)',
                            prop: 'DRBJ'
                        },
                        {
                            childLabel: '经济舱总报价(CNY)',
                            prop: 'ZBJ'
                        },
                        {
                            childLabel: '经济舱单人利润(CNY)',
                            prop: 'DRLR'
                        },
                        {
                            childLabel: '经济舱总利润(CNY)',
                            prop: 'ZLR'
                        },
                    ],

                },
                {
                    label: '机票',
                    EnLabel: 'gwc',
                    childList: [
                        {
                            childLabel: '公务舱单人成本(CNY)',
                            prop: 'gwccb'
                        },
                        {
                            childLabel: '人数',
                            prop: 'gwcrs'
                        },
                        {
                            childLabel: '公务舱系数',
                            prop: 'gwcxs'
                        },
                        {
                            childLabel: '公务舱总成本(CNY)',
                            prop: 'ZCB'
                        },
                        {
                            childLabel: '公务舱单人报价(CNY)',
                            prop: 'DRBJ'
                        },
                        {
                            childLabel: '公务舱总报价(CNY)',
                            prop: 'ZBJ'
                        },
                        {
                            childLabel: '公务舱单人利润(CNY)',
                            prop: 'DRLR'
                        },
                        {
                            childLabel: '公务舱总利润(CNY)',
                            prop: 'ZLR'
                        },
                    ],

                },
                {
                    label: '船票',
                    EnLabel: 'cp',
                    childList: [
                        {
                            childLabel: '船票单人成本(CNY)',
                            prop: 'cpcb'
                        },
                        {
                            childLabel: '人数',
                            prop: 'cprs'
                        },
                        {
                            childLabel: '船票系数',
                            prop: 'cpxs'
                        },
                        {
                            childLabel: '船票总成本(CNY)',
                            prop: 'ZCB'
                        },
                        {
                            childLabel: '船票单人报价(CNY)',
                            prop: 'DRBJ'
                        },
                        {
                            childLabel: '船票总报价(CNY)',
                            prop: 'ZBJ'
                        },
                        {
                            childLabel: '船票单人利润(CNY)',
                            prop: 'DRLR'
                        },
                        {
                            childLabel: '船票总利润(CNY)',
                            prop: 'ZLR'
                        },
                    ],

                },
                {
                    label: '核酸检测',
                    EnLabel: 'hs',
                    childList: [
                        {
                            childLabel: '核酸检测单人成本(CNY)',
                            prop: 'hscb'
                        },
                        {
                            childLabel: '人数',
                            prop: 'hsrs'
                        },
                        {
                            childLabel: '核酸检测系数',
                            prop: 'hsxs'
                        },
                        {
                            childLabel: '核酸检测总成本(CNY)',
                            prop: 'ZCB'
                        },
                        {
                            childLabel: '核酸检测单人报价(CNY)',
                            prop: 'DRBJ'
                        },
                        {
                            childLabel: '核酸检测总报价(CNY)',
                            prop: 'ZBJ'
                        },
                        {
                            childLabel: '核酸检测单人利润(CNY)',
                            prop: 'DRLR'
                        },
                        {
                            childLabel: '核酸检测总利润(CNY)',
                            prop: 'ZLR'
                        },
                    ],
                },
                //---
                {
                    label: '酒店TBR',
                    EnLabel: 'tbr',
                    childList: [
                        {
                            childLabel: '酒店TBR单人成本(CNY)',
                            prop: 'tbrcb',
                            isBind: true
                        },
                        {
                            childLabel: '人数',
                            prop: 'tbrNumber'
                        },
                        {
                            childLabel: '酒店TBR系数',
                            prop: 'tbrxs'
                        },
                        {
                            childLabel: '酒店TBR总成本(CNY)',
                            prop: 'ZCB'
                        },
                        {
                            childLabel: '酒店TBR单人报价(CNY)',
                            prop: 'DRBJ'
                        },
                        {
                            childLabel: '酒店TBR总报价(CNY)',
                            prop: 'ZBJ'
                        },
                        {
                            childLabel: '酒店TBR单人利润(CNY)',
                            prop: 'DRLR'
                        },
                        {
                            childLabel: '酒店TBR总利润(CNY)',
                            prop: 'ZLR'
                        },
                    ],
                },
                {
                    label: '酒店SGR',
                    EnLabel: 'sgr',
                    childList: [
                        {
                            childLabel: '酒店SGR单人成本(CNY)',
                            prop: 'sgrcb',
                            isBind: true
                        },
                        {
                            childLabel: '人数',
                            prop: 'sgrNumber'
                        },
                        {
                            childLabel: '酒店SGR系数',
                            prop: 'sgrxs'
                        },
                        {
                            childLabel: '酒店SGR总成本(CNY)',
                            prop: 'ZCB'
                        },
                        {
                            childLabel: '酒店SGR单人报价(CNY)',
                            prop: 'DRBJ'
                        },
                        {
                            childLabel: '酒店SGR总报价(CNY)',
                            prop: 'ZBJ'
                        },
                        {
                            childLabel: '酒店SGR单人利润(CNY)',
                            prop: 'DRLR'
                        },
                        {
                            childLabel: '酒店SGR总利润(CNY)',
                            prop: 'ZLR'
                        },
                    ],
                },
                {
                    label: '酒店JSES',
                    EnLabel: 'jses',
                    childList: [
                        {
                            childLabel: '酒店JSES单人成本(CNY)',
                            prop: 'jsescb',
                            isBind: true
                        },
                        {
                            childLabel: '人数',
                            prop: 'jsesNumber'
                        },
                        {
                            childLabel: '酒店JSES系数',
                            prop: 'jsesxs'
                        },
                        {
                            childLabel: '酒店JSES总成本(CNY)',
                            prop: 'ZCB'
                        },
                        {
                            childLabel: '酒店JSES单人报价(CNY)',
                            prop: 'DRBJ'
                        },
                        {
                            childLabel: '酒店JSES总报价(CNY)',
                            prop: 'ZBJ'
                        },
                        {
                            childLabel: '酒店JSES单人利润(CNY)',
                            prop: 'DRLR'
                        },
                        {
                            childLabel: '酒店JSES总利润(CNY)',
                            prop: 'ZLR'
                        },
                    ],
                },
                {
                    label: '酒店SUITE',
                    EnLabel: 'suite',
                    childList: [
                        {
                            childLabel: '酒店SUITE单人成本(CNY)',
                            prop: 'suitecb',
                            isBind: true
                        },
                        {
                            childLabel: '人数',
                            prop: 'suiteNumber'
                        },
                        {
                            childLabel: '酒店SUITE系数',
                            prop: 'suitexs'
                        },
                        {
                            childLabel: '酒店SUITE总成本(CNY)',
                            prop: 'ZCB'
                        },
                        {
                            childLabel: '酒店SUITE单人报价(CNY)',
                            prop: 'DRBJ'
                        },
                        {
                            childLabel: '酒店SUITE总报价(CNY)',
                            prop: 'ZBJ'
                        },
                        {
                            childLabel: '酒店SUITE单人利润(CNY)',
                            prop: 'DRLR'
                        },
                        {
                            childLabel: '酒店SUITE总利润(CNY)',
                            prop: 'ZLR'
                        },
                    ],
                },
                {
                    label: '地接',
                    EnLabel: 'dj',
                    childList: [
                        {
                            childLabel: '地接单人成本(CNY)',
                            prop: 'djcb',
                            isBind: true
                        },
                        {
                            childLabel: '人数',  //实体类无地接人数
                            prop: 'djrs'
                        },
                        {
                            childLabel: '地接系数',
                            prop: 'djxs'
                        },
                        {
                            childLabel: '地接总成本(CNY)',
                            prop: 'ZCB'
                        },
                        {
                            childLabel: '地接单人报价(CNY)',
                            prop: 'DRBJ'
                        },
                        {
                            childLabel: '地接总报价(CNY)',
                            prop: 'ZBJ'
                        },
                        {
                            childLabel: '地接单人利润(CNY)',
                            prop: 'DRLR'
                        },
                        {
                            childLabel: '地接总利润(CNY)',
                            prop: 'ZLR'
                        },
                    ],
                },
                {
                    label: '公务',
                    EnLabel: 'gw',
                    childList: [
                        {
                            childLabel: '公务单人成本(CNY)',
                            prop: 'gwcb',
                            isBind: true
                        },
                        {
                            childLabel: '人数',
                            prop: 'gwrs'
                        },
                        {
                            childLabel: '公务系数',
                            prop: 'gwxs'
                        },
                        {
                            childLabel: '公务总成本(CNY)',
                            prop: 'ZCB'
                        },
                        {
                            childLabel: '公务单人报价(CNY)',
                            prop: 'DRBJ'
                        },
                        {
                            childLabel: '公务总报价(CNY)',
                            prop: 'ZBJ'
                        },
                        {
                            childLabel: '公务单人利润(CNY)',
                            prop: 'DRLR'
                        },
                        {
                            childLabel: '公务总利润(CNY)',
                            prop: 'ZLR'
                        },
                    ],
                },
                {
                    label: '零用金',
                    EnLabel: 'lyj',
                    childList: [
                        {
                            childLabel: '零用金单人成本(CNY)',
                            prop: 'lyjcb',
                            isBind: true
                        },
                        {
                            childLabel: '人数',
                            prop: 'lyjrs'
                        },
                        {
                            childLabel: '零用金系数',
                            prop: 'lyjxs'
                        },
                        {
                            childLabel: '零用金总成本(CNY)',
                            prop: 'ZCB'
                        },
                        {
                            childLabel: '零用金单人报价(CNY)',
                            prop: 'DRBJ'
                        },
                        {
                            childLabel: '零用金总报价(CNY)',
                            prop: 'ZBJ'
                        },
                        {
                            childLabel: '零用金单人利润(CNY)',
                            prop: 'DRLR'
                        },
                        {
                            childLabel: '零用金总利润(CNY)',
                            prop: 'ZLR'
                        },
                    ],
                },

            ],
            //cabinoneList: ['经济舱 TBR', '经济舱 SGR', '核酸检测', '团组预算明细'],
            cabinoneOptions: ['经济舱 TBR', '经济舱 SGR', '公务舱 SGR', '公务舱 JS/ES', '公务舱 SUITE', '经济舱 SUITE'],
            cabinDatal: [
                {
                    label: '经济舱 TBR',
                    childList: [
                        {
                            childLabel: '单人成本(CNY)',
                            prop: 'costPerson'
                        },
                        {
                            childLabel: '人数',
                            prop: 'toll'
                        },
                        {
                            childLabel: '总成本(CNY)',
                            prop: 'totalCost'
                        },
                        {
                            childLabel: '单人报价(CNY)',
                            prop: 'singleQuote'
                        },
                        {
                            childLabel: '总报价(CNY)',
                            prop: 'totalQuote'
                        },
                        {
                            childLabel: '单人利润(CNY)',
                            prop: 'singleProfit'
                        },
                        {
                            childLabel: '总利润(CNY)',
                            prop: 'totalProfit'
                        },
                    ],
                    sheetInfo: [
                        {
                            costPerson: 1,
                            toll: 11,
                            totalCost: 137597.76,
                            singleQuote: 102203.71,
                            totalQuote: 35394.05,
                            singleProfit: 35394.05,
                            totalProfit: 35394.05
                        },
                    ]
                },
                {
                    label: '经济舱 SGR',
                    childList: [
                        {
                            childLabel: '单人成本(CNY)',
                            prop: 'costPerson'
                        },
                        {
                            childLabel: '人数',
                            prop: 'toll'
                        },
                        {
                            childLabel: '总成本(CNY)',
                            prop: 'totalCost'
                        },
                        {
                            childLabel: '单人报价(CNY)',
                            prop: 'singleQuote'
                        },
                        {
                            childLabel: '总报价(CNY)',
                            prop: 'totalQuote'
                        },
                        {
                            childLabel: '单人利润(CNY)',
                            prop: 'singleProfit'
                        },
                        {
                            childLabel: '总利润(CNY)',
                            prop: 'totalProfit'
                        },
                    ],
                    sheetInfo: [
                        {
                            costPerson: 1,
                            toll: 11,
                            totalCost: 137597.76,
                            singleQuote: 102203.71,
                            totalQuote: 35394.05,
                            singleProfit: 35394.05,
                            totalProfit: 35394.05
                        },
                    ]
                },
                {
                    label: '公务舱 SGR',
                    childList: [
                        {
                            childLabel: '单人成本(CNY)',
                            prop: 'costPerson'
                        },
                        {
                            childLabel: '人数',
                            prop: 'toll'
                        },
                        {
                            childLabel: '总成本(CNY)',
                            prop: 'totalCost'
                        },
                        {
                            childLabel: '单人报价(CNY)',
                            prop: 'singleQuote'
                        },
                        {
                            childLabel: '总报价(CNY)',
                            prop: 'totalQuote'
                        },
                        {
                            childLabel: '单人利润(CNY)',
                            prop: 'singleProfit'
                        },
                        {
                            childLabel: '总利润(CNY)',
                            prop: 'totalProfit'
                        },
                    ],
                    sheetInfo: [
                        {
                            costPerson: 1,
                            toll: 11,
                            totalCost: 137597.76,
                            singleQuote: 102203.71,
                            totalQuote: 35394.05,
                            singleProfit: 35394.05,
                            totalProfit: 35394.05
                        },
                    ]
                },
                {
                    label: '公务舱 JS/ES',
                    childList: [
                        {
                            childLabel: '单人成本(CNY)',
                            prop: 'costPerson'
                        },
                        {
                            childLabel: '人数',
                            prop: 'toll'
                        },
                        {
                            childLabel: '总成本(CNY)',
                            prop: 'totalCost'
                        },
                        {
                            childLabel: '单人报价(CNY)',
                            prop: 'singleQuote'
                        },
                        {
                            childLabel: '总报价(CNY)',
                            prop: 'totalQuote'
                        },
                        {
                            childLabel: '单人利润(CNY)',
                            prop: 'singleProfit'
                        },
                        {
                            childLabel: '总利润(CNY)',
                            prop: 'totalProfit'
                        },
                    ],
                    sheetInfo: [
                        {
                            costPerson: 1,
                            toll: 11,
                            totalCost: 137597.76,
                            singleQuote: 102203.71,
                            totalQuote: 35394.05,
                            singleProfit: 35394.05,
                            totalProfit: 35394.05
                        },
                    ]
                },
                {
                    label: '公务舱 SUITE',
                    childList: [
                        {
                            childLabel: '单人成本(CNY)',
                            prop: 'costPerson'
                        },
                        {
                            childLabel: '人数',
                            prop: 'toll'
                        },
                        {
                            childLabel: '总成本(CNY)',
                            prop: 'totalCost'
                        },
                        {
                            childLabel: '单人报价(CNY)',
                            prop: 'singleQuote'
                        },
                        {
                            childLabel: '总报价(CNY)',
                            prop: 'totalQuote'
                        },
                        {
                            childLabel: '单人利润(CNY)',
                            prop: 'singleProfit'
                        },
                        {
                            childLabel: '总利润(CNY)',
                            prop: 'totalProfit'
                        },
                    ],
                    sheetInfo: [
                        {
                            costPerson: 1,
                            toll: 11,
                            totalCost: 137597.76,
                            singleQuote: 102203.71,
                            totalQuote: 35394.05,
                            singleProfit: 35394.05,
                            totalProfit: 35394.05
                        },
                    ]
                }
                ,
                {
                    label: '经济舱 SUITE',
                    childList: [
                        {
                            childLabel: '单人成本(CNY)',
                            prop: 'costPerson'
                        },
                        {
                            childLabel: '人数',
                            prop: 'toll'
                        },
                        {
                            childLabel: '总成本(CNY)',
                            prop: 'totalCost'
                        },
                        {
                            childLabel: '单人报价(CNY)',
                            prop: 'singleQuote'
                        },
                        {
                            childLabel: '总报价(CNY)',
                            prop: 'totalQuote'
                        },
                        {
                            childLabel: '单人利润(CNY)',
                            prop: 'singleProfit'
                        },
                        {
                            childLabel: '总利润(CNY)',
                            prop: 'totalProfit'
                        },
                    ],
                    sheetInfo: [
                        {
                            costPerson: 1,
                            toll: 11,
                            totalCost: 137597.76,
                            singleQuote: 102203.71,
                            totalQuote: 35394.05,
                            singleProfit: 35394.05,
                            totalProfit: 35394.05
                        },
                    ]
                },
                {
                    label: '团组预算明细',
                    childList: [
                        {
                            childLabel: '团组成本(CNY)',
                            prop: 'groupCosts'
                        },
                        {
                            childLabel: '团组报价(CNY)',
                            prop: 'gtroupQuotes'
                        },
                        {
                            childLabel: '团组利润(CNY)',
                            prop: 'groupProfit'
                        }
                    ],
                    sheetInfo: [
                        {
                            groupCosts: 1,
                            gtroupQuotes: 11,
                            groupProfit: 137597.76,
                        },
                    ]
                }
            ],
            BcabinDatal: [
                {
                    label: '经济舱 TBR',
                    childList: [
                        {
                            childLabel: '单人成本(CNY)',
                            prop: 'costPerson'
                        },
                        {
                            childLabel: '人数',
                            prop: 'toll'
                        },
                        {
                            childLabel: '总成本(CNY)',
                            prop: 'totalCost'
                        },
                        {
                            childLabel: '单人报价(CNY)',
                            prop: 'singleQuote'
                        },
                        {
                            childLabel: '总报价(CNY)',
                            prop: 'totalQuote'
                        },
                        {
                            childLabel: '单人利润(CNY)',
                            prop: 'singleProfit'
                        },
                        {
                            childLabel: '总利润(CNY)',
                            prop: 'totalProfit'
                        },
                    ],
                    sheetInfo: [
                        {
                            costPerson: 0,
                            toll: 0,
                            totalCost: 137597.76,
                            singleQuote: 102203.71,
                            totalQuote: 35394.05,
                            singleProfit: 35394.05,
                            totalProfit: 35394.05
                        },
                    ]
                },
                {
                    label: '经济舱 SGR',
                    childList: [
                        {
                            childLabel: '单人成本(CNY)',
                            prop: 'costPerson'
                        },
                        {
                            childLabel: '人数',
                            prop: 'toll'
                        },
                        {
                            childLabel: '总成本(CNY)',
                            prop: 'totalCost'
                        },
                        {
                            childLabel: '单人报价(CNY)',
                            prop: 'singleQuote'
                        },
                        {
                            childLabel: '总报价(CNY)',
                            prop: 'totalQuote'
                        },
                        {
                            childLabel: '单人利润(CNY)',
                            prop: 'singleProfit'
                        },
                        {
                            childLabel: '总利润(CNY)',
                            prop: 'totalProfit'
                        },
                    ],
                    sheetInfo: [
                        {
                            costPerson: 1,
                            toll: 11,
                            totalCost: 137597.76,
                            singleQuote: 102203.71,
                            totalQuote: 35394.05,
                            singleProfit: 35394.05,
                            totalProfit: 35394.05
                        },
                    ]
                },
                {
                    label: '公务舱 SGR',
                    childList: [
                        {
                            childLabel: '单人成本(CNY)',
                            prop: 'costPerson'
                        },
                        {
                            childLabel: '人数',
                            prop: 'toll'
                        },
                        {
                            childLabel: '总成本(CNY)',
                            prop: 'totalCost'
                        },
                        {
                            childLabel: '单人报价(CNY)',
                            prop: 'singleQuote'
                        },
                        {
                            childLabel: '总报价(CNY)',
                            prop: 'totalQuote'
                        },
                        {
                            childLabel: '单人利润(CNY)',
                            prop: 'singleProfit'
                        },
                        {
                            childLabel: '总利润(CNY)',
                            prop: 'totalProfit'
                        },
                    ],
                    sheetInfo: [
                        {
                            costPerson: 1,
                            toll: 11,
                            totalCost: 137597.76,
                            singleQuote: 102203.71,
                            totalQuote: 35394.05,
                            singleProfit: 35394.05,
                            totalProfit: 35394.05
                        },
                    ]
                },
                {
                    label: '公务舱 JS/ES',
                    childList: [
                        {
                            childLabel: '单人成本(CNY)',
                            prop: 'costPerson'
                        },
                        {
                            childLabel: '人数',
                            prop: 'toll'
                        },
                        {
                            childLabel: '总成本(CNY)',
                            prop: 'totalCost'
                        },
                        {
                            childLabel: '单人报价(CNY)',
                            prop: 'singleQuote'
                        },
                        {
                            childLabel: '总报价(CNY)',
                            prop: 'totalQuote'
                        },
                        {
                            childLabel: '单人利润(CNY)',
                            prop: 'singleProfit'
                        },
                        {
                            childLabel: '总利润(CNY)',
                            prop: 'totalProfit'
                        },
                    ],
                    sheetInfo: [
                        {
                            costPerson: 1,
                            toll: 11,
                            totalCost: 137597.76,
                            singleQuote: 102203.71,
                            totalQuote: 35394.05,
                            singleProfit: 35394.05,
                            totalProfit: 35394.05
                        },
                    ]
                },
                {
                    label: '公务舱 SUITE',
                    childList: [
                        {
                            childLabel: '单人成本(CNY)',
                            prop: 'costPerson'
                        },
                        {
                            childLabel: '人数',
                            prop: 'toll'
                        },
                        {
                            childLabel: '总成本(CNY)',
                            prop: 'totalCost'
                        },
                        {
                            childLabel: '单人报价(CNY)',
                            prop: 'singleQuote'
                        },
                        {
                            childLabel: '总报价(CNY)',
                            prop: 'totalQuote'
                        },
                        {
                            childLabel: '单人利润(CNY)',
                            prop: 'singleProfit'
                        },
                        {
                            childLabel: '总利润(CNY)',
                            prop: 'totalProfit'
                        },
                    ],
                    sheetInfo: [
                        {
                            costPerson: 1,
                            toll: 11,
                            totalCost: 137597.76,
                            singleQuote: 102203.71,
                            totalQuote: 35394.05,
                            singleProfit: 35394.05,
                            totalProfit: 35394.05
                        },
                    ]
                }
                ,
                {
                    label: '经济舱 SUITE',
                    childList: [
                        {
                            childLabel: '单人成本(CNY)',
                            prop: 'costPerson'
                        },
                        {
                            childLabel: '人数',
                            prop: 'toll'
                        },
                        {
                            childLabel: '总成本(CNY)',
                            prop: 'totalCost'
                        },
                        {
                            childLabel: '单人报价(CNY)',
                            prop: 'singleQuote'
                        },
                        {
                            childLabel: '总报价(CNY)',
                            prop: 'totalQuote'
                        },
                        {
                            childLabel: '单人利润(CNY)',
                            prop: 'singleProfit'
                        },
                        {
                            childLabel: '总利润(CNY)',
                            prop: 'totalProfit'
                        },
                    ],
                    sheetInfo: [
                        {
                            costPerson: 1,
                            toll: 11,
                            totalCost: 137597.76,
                            singleQuote: 102203.71,
                            totalQuote: 35394.05,
                            singleProfit: 35394.05,
                            totalProfit: 35394.05
                        },
                    ]
                }
            ],
            costType: [
                {
                    value: 'A',
                    label: '单段模式'
                },
                {
                    value: 'B',
                    label: '双段模式'
                }
            ],
            userId: 0,
            token: '',
            costTypevalue: 'A',
            grouptitleinfo: {},
            costTypeHotelNumbers: [{
                "sgr": 0,
                "tbr": 0,
                "jses": 0,
                "suite": 0,
                "type": "Default",
                "diid": 0,
                id: 0,
            },
            {
                "sgr": 0,
                "tbr": 0,
                "jses": 0,
                "suite": 0,
                "type": "A",
                "diid": 0,
                id: 0,
            },
            {
                "sgr": 0,
                "tbr": 0,
                "jses": 0,
                "suite": 0,
                "type": "B",
                "diid": 0,
                id: 0,
            }],
            CheckBoxListSelect: [
                {
                    "diid": 0,
                    "cbType": "Top",
                    "cbValues": ['DAY', 'ITIN', 'VA', 'VF', 'VRD', 'T/G S', 'DATE'] //"string"
                },
                {
                    "diid": 0,
                    "cbType": "Left",
                    "cbValues": ['签证', '机票', '核酸检测',] //"string"
                },
                {
                    "diid": 0,
                    "cbType": "Right",
                    "cbValues": ['经济舱 TBR', '经济舱 SGR', '团组预算明细'] //"string"
                }
            ],
            AGroupCostParameter: {
                "id": 0,
                "diId": 0,
                "currency": "CNY",
                "rate": 0,
                "tax": 0,
                "ffys": 0,
                "hotelXS": 0,
                "jjccb": 0,
                "jjcxs": 0,
                "jjcrs": 0,
                "gwccb": 0,
                "gwcxs": 0,
                "gwcrs": 0,
                "hcpcb": 0,
                "hcpxs": 0,
                "hcprs": 0,
                "cpcb": 0,
                "cpxs": 0,
                "cprs": 0,
                "bxcb": 0,
                "bxxs": 0,
                "bxrs": 0,
                "hscb": 0,
                "hsxs": 0,
                "hsrs": 0,
                "visaCB": 0,
                "visaXS": 0,
                "visaRS": 0,
                "gwcb": 0,
                "gwxs": 0,
                "gwrs": 0,
                "djcb": 0,
                "djrs": 0,
                "djxs": 0,
                "sgrcb": 0,
                "sgrNumber": 0,
                "sgrxs": 0,
                "tbrcb": 0,
                "tbrNumber": 0,
                "tbrxs": 0,
                "jsescb": 0,
                "jsesNumber": 0,
                "jsesxs": 0,
                "suitecb": 0,
                "suiteNumber": 0,
                "suitexs": 0,
                "lyjcb": 0,
                "lyjxs": 0,
                "lyjrs": 0,
                "isShare": 0,
                "costType": "A",
                "costTypeStartTime": "",
                "costTypeendTime": "",
                "costTypenumber": 0
            },
            BGroupCostParameter: {
                "id": 0,
                "diId": 0,
                "currency": "",
                "rate": 0,
                "tax": 0,
                "ffys": 0,
                "hotelXS": 0,
                "jjccb": 0,
                "jjcxs": 0,
                "jjcrs": 0,
                "gwccb": 0,
                "gwcxs": 0,
                "gwcrs": 0,
                "hcpcb": 0,
                "hcpxs": 0,
                "hcprs": 0,
                "cpcb": 0,
                "cpxs": 0,
                "cprs": 0,
                "bxcb": 0,
                "bxxs": 0,
                "bxrs": 0,
                "hscb": 0,
                "hsxs": 0,
                "hsrs": 0,
                "visaCB": 0,
                "visaXS": 0,
                "visaRS": 0,
                "gwcb": 0,
                "gwxs": 0,
                "gwrs": 0,
                "djcb": 0,
                "djxs": 0,
                "djrs": 0,
                "sgrcb": 0,
                "sgrNumber": 0,
                "sgrxs": 0,
                "tbrcb": 0,
                "tbrNumber": 0,
                "tbrxs": 0,
                "jsescb": 0,
                "jsesNumber": 0,
                "jsesxs": 0,
                "suitecb": 0,
                "suiteNumber": 0,
                "suitexs": 0,
                "lyjcb": 0,
                "lyjxs": 0,
                "lyjrs": 0,
                "isShare": 0,
                "costType": "B",
                "costTypeStartTime": "",
                "costTypeendTime": "",
                "costTypenumber": 0
            },
            dialogColumn: [
                {
                    index: 1, data: [
                        { title: "国家", prop: "country" },
                        { title: "城市", prop: "city" },
                        { title: "服务类型", prop: "serviceType" },
                        { title: "用车类型", prop: "carType" },
                        { title: "用车报价", prop: "offer" },
                        { title: "车兼导费用", prop: "cgCost" },
                        { title: "用车时长", prop: "runingTime" },
                        { title: "车超时费用/时", prop: "overtimeFee" },
                        { title: "司兼导超时费/时", prop: "cgOvertimeFee" },
                        { title: "币种", prop: "currency" },
                        { title: "备注", prop: "remark" }
                    ]
                },
                {
                    index: 2, data: [
                        { title: "国家", prop: "country" },
                        { title: "城市", prop: "city" },
                        { title: "导游服务类型", prop: "serviceType" },
                        { title: "导游工资", prop: "price" },
                        { title: "翻译工资", prop: "translationPrice" },
                        { title: "超时费用", prop: "overtimeFee" },
                        { title: "币种", prop: "currency" },
                        { title: "备注", prop: "remark" }
                    ]
                },
                {
                    index: 3, data: [
                        { title: "国家", prop: "country" },
                        { title: "城市", prop: "city" },
                        { title: "车类型", prop: "carType" },
                        { title: "服务类型", prop: "serviceType" },
                        { title: "用车时间", prop: "when" },
                        { title: "工资", prop: "price" },
                        { title: "超时费用", prop: "overtimeFee" },
                        { title: "币种", prop: "currency" },
                        { title: "备注", prop: "remark" }
                    ]
                },
                {
                    index: 4, data: [
                        { title: "国家", prop: "country" },
                        { title: "城市", prop: "city" },
                        { title: "景点", prop: "scenicSpot" },
                        { title: "景点项目描述", prop: "scenicSpotDetail" },
                        { title: "景点价格", prop: "price" },
                        { title: "币种", prop: "currency" },
                        { title: "景点地址", prop: "address" }
                    ]
                }
                //  司兼导
                //  导游
                //  车数据
                //  景点
            ],
            dialogTableData: [],
            SeldialogColumn: [],
            DialogTitle: '',
            pageSize: 5,
            currentPage: 1,
            dialogSearchInput: '',
            selectRow: {},
            rowIndex: 0,
            sumTopPrice: [],
            DJLables: ['VF', 'T/G S', 'T/G OF', 'T/G M', 'T/G A', 'T/G TF', 'T/G EF', 'C/F M', 'C/F OF', 'B', 'L', 'D', 'EF', 'B/R/F', 'TE', 'T/G T', 'DRV T', 'T/L F'],
            GwLables: ['T/V', 'E/C T', 'I/F', '1/L'],
            OtherCostProperty: ['visaCB', 'hcpcb', 'cpcb', 'bxcb', 'hscb', 'djcb', 'gwcb', 'lyjcb'],
            OtherCostPropertyBJ: ['visa', 'hcp', 'cp', 'bx', 'hs', 'dj', 'gw', 'lyj'],
            peopleNumber: 1,
            centerheight: 700,
            defaultheight: 50,
            rules: {
                rate: [
                    { pattern: /^-?\d+\.?\d*$/, message: '请输入正确数据', trigger: 'blur', required: true, }
                ],
                tax: [
                    { pattern: /^-?\d+\.?\d*$/, message: '请输入正确数据', trigger: 'blur', required: true, }
                ],
            },
            HotelRules: {
                sgr: [
                    { type: 'number', min: 0, message: '请输入整数', trigger: 'blur', required: true, },
                ],
                tbr: [
                    { type: 'number', min: 0, message: '请输入整数', trigger: 'blur', required: true, },
                ],
                suite: [
                    { type: 'number', min: 0, message: '请输入整数', trigger: 'blur', required: true, },
                ],
                jses: [
                    { type: 'number', min: 0, message: '请输入整数', trigger: 'blur', required: true, },
                ],
            },
            CostTimeRules: {
                costTypeendTime: [
                    { message: '请输入结束时间', trigger: 'blur', required: true, },
                ],
                costTypenumber: [
                    { type: 'number', min: 0, message: '请输入整数', trigger: 'blur', required: true, },
                ],
                costTypeStartTime: [
                    { message: '请输入开始时间', trigger: 'blur', required: true, },
                ],
            },
            titleText: [],
            vehicleLables: ['VF', 'T/G OF', 'T/G S', 'T/G TF', 'C/F OF'],
            DJMeal: ['B', 'L', 'D'],
            SubsidizedMeals: ['T/G M', 'C/F M'],
            NightRepair: ['T/G A'],
            AttractionsTickets: ['T/G EF', 'EF'],
            MiscellaneousFees: ['B/R/F', 'TE', 'T/L F'],
            ATip: ['T/G T', 'DRV T'],
            visaCountryInfoArr: [],

        };
    },
    watch: {
        // 此处监听variable变量，当期有变化时执行
        // checkList(item1, item2) {
        //     // console.log(item1)
        //     // console.log(item2)
        //     // item1为新值，item2为旧值
        // },
        'tableData.length': {
            handler(newValue, oldValue) {
                if (newValue !== oldValue) {
                    if (this.tableData.length > 3) {
                        this.centerheight = 700;
                    } else {
                        this.centerheight = this.defaultheight + (this.tableData.length * 220);
                    }
                    console.log('高度' + this.centerheight);
                }
            }
        }

    },
    methods: {
        getSummaries(param) {
            var that = this;
            //console.log(param)
            const { columns, data } = param;
            const sums = [];
            const sums1 = [];
            const texts = [];
            var prices = [];
            var thisData = data;
            var ATime = { start: that.addOneDay(that.AGroupCostParameter.costTypeStartTime, 0), end: that.addOneDay(that.AGroupCostParameter.costTypeendTime, 0) };
            var BTime = { start: that.addOneDay(that.BGroupCostParameter.costTypeStartTime, 0), end: that.addOneDay(that.BGroupCostParameter.costTypeendTime, 0) };

            console.log('ATime,BTime', ATime, BTime);
            var data1 = [];
            var data2 = [];

            console.log('datas', data);

            if (that.costTypevalue == 'B') {
                for (var i = 0; i < thisData.length; i++) {
                    var forTime = thisData[i].date;
                    if (forTime == '' && i != 0) {
                        forTime = thisData[i - 1].date;
                    }
                    if (forTime >= ATime.start && forTime <= ATime.end) {
                        data1.push(thisData[i])
                    }
                    if (forTime >= BTime.start && forTime <= BTime.end) {
                        data2.push(thisData[i])
                    }
                }
                thisData = data1;
                if (isNaN(Number(that.AGroupCostParameter.costTypenumber)) || Number(that.AGroupCostParameter.costTypenumber) < 1) {
                    that.peopleNumber = 1;
                } else {
                    that.peopleNumber = Number(that.AGroupCostParameter.costTypenumber);
                }
            }
            console.log('3data', thisData, data1, data2);
            columns.forEach((column, index) => {
                if (index === 0) {
                    prices[index] = "总计:";
                    return;
                }
                if (column.label == 'DATE' || column.label == 'ITIN' || column.label == 'VT' || column.label == 'VN' || column.label == 'ACCO N' || column.label == 'VA' || column.label == 'VRD' || column.label == 'T/G N' || column.label == 'T/G WH' || column.label == '操作') {
                    prices[index] = "——";
                    return;
                }
                const values = thisData.map(item => Number(item[column.property]));
                if (!values.every(value => isNaN(value))) {
                    sums[index] = values.reduce((prev, curr) => {
                        const value = Number(curr);
                        if (!isNaN(value)) {
                            return prev + curr;
                        } else {
                            return prev;
                        }

                    }, 0);

                    if (column.label == 'SGR' || column.label == 'JS/ES' || column.label == 'SUITE' || column.label == 'TBR' || column.label == 'B' || column.label == 'L' || column.label == 'D' || column.label == 'EF' || column.label == 'TE' || column.label == 'T/G T' || column.label == 'P/C' || column.label == ' DRV T' || column.label == 'DRV T') {
                        prices[index] = '共' + (sums[index] * that.peopleNumber).toFixed(2) + ' ' + this.AGroupCostParameter.currency + '\r\n人均' + (sums[index]).toFixed(2) + " " + this.AGroupCostParameter.currency //sums[index] + '(' + this.AGroupCostParameter.currency + ')' + '  人均(' + sums[index] + ')';
                    } else {
                        prices[index] = '共' + sums[index].toFixed(2) + ' ' + this.AGroupCostParameter.currency + '\r\n人均' + (sums[index] / that.peopleNumber).toFixed(2) + " " + this.AGroupCostParameter.currency //sums[index] + '(' + this.AGroupCostParameter.currency + ')' + '  人均(' + sums[index] + ')';
                        sums[index] = parseFloat((sums[index] / that.peopleNumber).toFixed(2));
                    }

                } else {
                    prices[index] = 'N/A';
                }

                if (that.costTypevalue == 'B') {

                    const values1 = data2.map(item => Number(item[column.property]));
                    if (!values1.every(value => isNaN(value))) {
                        sums1[index] = values1.reduce((prev, curr) => {
                            const value = Number(curr);
                            if (!isNaN(value)) {
                                return prev + curr;
                            } else {
                                return prev;
                            }
                        }, 0);

                        if (column.label == 'SGR' || column.label == 'JS/ES' || column.label == 'SUITE' || column.label == 'TBR' || column.label == 'B' || column.label == 'L' || column.label == 'D' || column.label == 'EF' || column.label == 'TE' || column.label == 'T/G T' || column.label == 'P/C' || column.label == ' DRV T' || column.label == 'DRV T') {
                            prices[index] = 'A段费用' + prices[index] + '\r\nB段费用共' + (sums1[index] * that.BGroupCostParameter.costTypenumber).toFixed(2) + " " + this.AGroupCostParameter.currency + '\r\n人均' + sums1[index] + " " + this.AGroupCostParameter.currency //sums[index] + '(' + this.AGroupCostParameter.currency + ')' + '  人均(' + sums[index] + ')';
                        } else {
                            prices[index] = 'A段费用' + prices[index] + '\r\nB段费用共' + sums1[index].toFixed(2) + " " + this.AGroupCostParameter.currency + '\r\n人均' + (sums1[index] / that.BGroupCostParameter.costTypenumber).toFixed(2) + " " + this.AGroupCostParameter.currency //sums[index] + '(' + this.AGroupCostParameter.currency + ')' + '  人均(' + sums[index] + ')';
                            sums1[index] = ((sums1[index] / that.BGroupCostParameter.costTypenumber).toFixed(2));
                        }

                    } else {
                        prices[index] = 'A段费用' + prices[index] + '  B段费用' + 'N/A';
                    }
                }

                var fliterList = that.sumTopPrice.filter(function (x) {
                    return x.name == column.property;
                })

                if (fliterList.length == 0) {
                    that.sumTopPrice.push({ name: column.property, label: column.label, Aprice: sums[index], Bprice: sums1[index] == undefined ? 0 : sums1[index] });
                } else {
                    fliterList[0].Aprice = sums[index];
                    fliterList[0].Bprice = sums1[index] == undefined ? 0 : sums1[index];
                }

                var TextfliterList = texts.filter(function (x) {
                    return x.label == column.label;
                })

                var text = prices[index];
                if (TextfliterList.length == 0) {
                    texts.push({ label: column.label, text: text });
                } else {
                    TextfliterList.text = text;
                }
            });
            this.titleText = texts;
            console.log(that.sumTopPrice, 'sumTopPrice---------------');
            this.CalculatedPrice();
            //console.log(that.sumTopPrice, '------------');
            setTimeout(() => {
                this.setLastTitle(prices);
            }, 1000);

            return prices;
        },
        handleEdit(index, row, buttonIndex) {
            //console.log(index, row, buttonIndex);
            this.rowIndex = index; // 行的索引
            var api = '';
            switch (buttonIndex) {
                case 1:
                    api = 'GetCarGuides';
                    this.DialogTitle = '选择车导数据';
                    break;
                case 2:
                    api = 'GetGuidesInfo';
                    this.DialogTitle = '导游信息';
                    break;
                case 3:
                    api = 'GetCarInfo';
                    this.DialogTitle = '选择车数据';
                    break;
                case 4:
                    api = 'GetScenicSpotInfo';
                    this.DialogTitle = '景点信息';
                    break;
            }

            if (api == '') {
                this.$message.error('程序异常！');
                return;
            }


            var dataC = this.dialogColumn.filter(x => x.index == buttonIndex);
            if (dataC.length == 0) {
                this.SeldialogColumn = [];
            } else {
                this.SeldialogColumn = dataC[0].data;
            }

            var that = this;
            this.$axios.post('/api/Groups/' + api, {}, {
                headers: {
                    'Authorization': that.token,
                }
            }).then(resp => {
                console.log(resp.data.data, '------------------------------------');
                that.outerVisible = true;
                if (resp.data.code == 200) {
                    that.dialogTableData = resp.data.data;
                } else {
                    that.$message.error('获取数据失败！' + resp.data.msg);
                }
            })


        },
        handleDelete(index, row, rows) {
            console.log(index, row, rows);
            this.$confirm('此操作将删除该条信息, 是否继续?', '提示', {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
                type: 'warning'
            }).then(() => {
                this.$message({
                    message: '已删除',
                    type: 'success',
                    offset: 50
                });
                rows.splice(index, 1);
            }).catch(() => {
                this.$message({
                    type: 'info',
                    message: '已取消删除'
                });
            });
        },
        addStrip() {
            var souerLength = this.tableData.length - 1;
            var dataStr = "";
            var day = '-';
            if (souerLength >= 0) {
                dataStr = this.tableData[souerLength].date;
                dataStr = this.addOneDay(dataStr, 1);
                var getDay = this.tableData[souerLength].day;
                if (getDay) {
                    day = parseInt(getDay) + 1;
                }
            }

            this.tableData.push(
                {
                    "diid": this.diid,
                    "day": day,
                    "date": dataStr,
                    "itin": "",
                    "carType": "",
                    "carCost": 0,
                    "carNumber": 0,
                    "carTiming": 0,
                    "tgs": 0,
                    "tgwh": 0,
                    "tgn": 0,
                    "tgof": 0,
                    "tgm": 0,
                    "tga": 0,
                    "tgtf": 0,
                    "tgef": 0,
                    "cfs": 0,
                    "cfm": 0,
                    "cfof": 0,
                    "b": 0,
                    "l": 0,
                    "d": 0,
                    "tbr": 0,
                    "sgr": 0,
                    "jS_ES": 0,
                    "suite": 0,
                    "accon": "",
                    "tv": 0,
                    "iL": 0,
                    "if": 0,
                    "ef": 0,
                    "b_R_F": 0,
                    "te": 0,
                    "tgTips": 0,
                    "drvTips": 0,
                    "pc": 0,
                    "tlf": 0,
                    "ect": 0,
                    "id": 1,
                }
            )
        },
        loadData(id) {
            this.costloading = true;
            this.tableData = [];
            var that = this;
            this.$axios.post('/api/Groups/GroupCostInit', {
                Diid: id
            }, {
                headers: {
                    'Authorization': that.token,
                }
            }).then(resp => {
                console.log(resp.data.data, '------------------------------------');
                if (resp.data.code == 200) {
                    that.options = resp.data.data.groupList;
                    that.grouptitleinfo = resp.data.data.groupInfo.data;
                    that.diid = that.grouptitleinfo.id;

                    for (var i = 0; i < that.CheckBoxListSelect.length; i++) {
                        that.CheckBoxListSelect[i].diid = that.diid;
                    }

                    if (resp.data.data.groupChecks.length > 0) {
                        resp.data.data.groupChecks.forEach(item => {
                            for (var i = 0; i < that.CheckBoxListSelect.length; i++) {
                                if (item.cbType == that.CheckBoxListSelect[i].cbType) {
                                    that.CheckBoxListSelect[i].cbValues = item.cbValues.split(',');
                                    console.log(item.cbValues.split(','));
                                    break;
                                }
                                if (that.CheckBoxListSelect[i].diid == 0) {
                                    that.CheckBoxListSelect[i].diid = that.diid;
                                }
                            }
                        })
                    } else {
                        that.CheckBoxListSelect = [
                            {
                                "diid": that.diid,
                                "cbType": "Top",
                                "cbValues": ['DAY', 'ITIN', 'VA', 'VF', 'VRD', 'T/G S', 'DATE'] //"string"
                            },
                            {
                                "diid": that.diid,
                                "cbType": "Left",
                                "cbValues": ['签证', '机票', '核酸检测',] //"string"
                            },
                            {
                                "diid": that.diid,
                                "cbType": "Right",
                                "cbValues": ['经济舱 TBR', '经济舱 SGR', '团组预算明细'] //"string"
                            }
                        ]
                    }

                    that.grouptitleinfo.visitStartDate = that.grouptitleinfo.visitStartDate.split(' ')[0];
                    that.grouptitleinfo.visitEndDate = that.grouptitleinfo.visitEndDate.split(' ')[0];
                    that.peopleNumber = that.grouptitleinfo.visitPNumber > 0 ? that.grouptitleinfo.visitPNumber : 1;

                    if (resp.data.data.groupCost.length > 0) {
                        that.tableData = resp.data.data.groupCost;
                    } else {
                        that.tableData = [
                            {
                                "diid": that.diid,
                                "day": "-",
                                "date": "",
                                "itin": "",
                                "carType": "",
                                "carCost": 0,
                                "carNumber": 0,
                                "carTiming": 0,
                                "tgs": 0,
                                "tgwh": 0,
                                "tgn": 0,
                                "tgof": 0,
                                "tgm": 0,
                                "tga": 0,
                                "tgtf": 0,
                                "tgef": 0,
                                "cfs": 0,
                                "cfm": 0,
                                "cfof": 0,
                                "b": 0,
                                "l": 0,
                                "d": 0,
                                "tbr": 0,
                                "sgr": 0,
                                "jS_ES": 0,
                                "suite": 0,
                                "accon": "",
                                "tv": 0,
                                "iL": 0,
                                "if": 0,
                                "ef": 0,
                                "b_R_F": 0,
                                "te": 0,
                                "tgTips": 0,
                                "drvTips": 0,
                                "pc": 0,
                                "tlf": 0,
                                "ect": 0,
                                "id": 1,
                            }
                        ]
                    }

                    if (resp.data.data.groupCostParameter.length > 0) {
                        var acostvalue = resp.data.data.groupCostParameter.filter(x => x.costType == 'A')[0];
                        if (acostvalue != undefined) {
                            that.AGroupCostParameter = acostvalue;
                        } else {
                            that.AGroupCostParameter = {
                                "id": 0,
                                "diId": 0,
                                "currency": "CNY",
                                "rate": 0,
                                "tax": 0,
                                "ffys": 0,
                                "hotelXS": 0,
                                "jjccb": 0,
                                "jjcxs": 0,
                                "jjcrs": 0,
                                "gwccb": 0,
                                "gwcxs": 0,
                                "gwcrs": 0,
                                "hcpcb": 0,
                                "hcpxs": 0,
                                "hcprs": 0,
                                "cpcb": 0,
                                "cpxs": 0,
                                "cprs": 0,
                                "bxcb": 0,
                                "bxxs": 0,
                                "bxrs": 0,
                                "hscb": 0,
                                "hsxs": 0,
                                "hsrs": 0,
                                "visaCB": 0,
                                "visaXS": 0,
                                "visaRS": 0,
                                "gwcb": 0,
                                "gwxs": 0,
                                "gwrs": 0,
                                "djcb": 0,
                                "djrs": 0,
                                "djxs": 0,
                                "sgrcb": 0,
                                "sgrNumber": 0,
                                "sgrxs": 0,
                                "tbrcb": 0,
                                "tbrNumber": 0,
                                "tbrxs": 0,
                                "jsescb": 0,
                                "jsesNumber": 0,
                                "jsesxs": 0,
                                "suitecb": 0,
                                "suiteNumber": 0,
                                "suitexs": 0,
                                "lyjcb": 0,
                                "lyjxs": 0,
                                "lyjrs": 0,
                                "isShare": 0,
                                "costType": "A",
                                "costTypeStartTime": "",
                                "costTypeendTime": "",
                                "costTypenumber": 0
                            };
                        }
                        var bcostvalue = resp.data.data.groupCostParameter.filter(x => x.costType == 'B')[0];
                        if (bcostvalue != undefined) {
                            that.BGroupCostParameter = bcostvalue;
                        } else {
                            that.BGroupCostParameter = {
                                "id": 0,
                                "diId": 0,
                                "currency": "",
                                "rate": 0,
                                "tax": 0,
                                "ffys": 0,
                                "hotelXS": 0,
                                "jjccb": 0,
                                "jjcxs": 0,
                                "jjcrs": 0,
                                "gwccb": 0,
                                "gwcxs": 0,
                                "gwcrs": 0,
                                "hcpcb": 0,
                                "hcpxs": 0,
                                "hcprs": 0,
                                "cpcb": 0,
                                "cpxs": 0,
                                "cprs": 0,
                                "bxcb": 0,
                                "bxxs": 0,
                                "bxrs": 0,
                                "hscb": 0,
                                "hsxs": 0,
                                "hsrs": 0,
                                "visaCB": 0,
                                "visaXS": 0,
                                "visaRS": 0,
                                "gwcb": 0,
                                "gwxs": 0,
                                "gwrs": 0,
                                "djcb": 0,
                                "djxs": 0,
                                "djrs": 0,
                                "sgrcb": 0,
                                "sgrNumber": 0,
                                "sgrxs": 0,
                                "tbrcb": 0,
                                "tbrNumber": 0,
                                "tbrxs": 0,
                                "jsescb": 0,
                                "jsesNumber": 0,
                                "jsesxs": 0,
                                "suitecb": 0,
                                "suiteNumber": 0,
                                "suitexs": 0,
                                "lyjcb": 0,
                                "lyjxs": 0,
                                "lyjrs": 0,
                                "isShare": 0,
                                "costType": "B",
                                "costTypeStartTime": "",
                                "costTypeendTime": "",
                                "costTypenumber": 0
                            };
                        }

                        if (resp.data.data.groupCostParameter.length > 1) {
                            that.costTypevalue = "B";
                        } else {
                            that.costTypevalue = "A";
                        }

                        if (that.AGroupCostParameter.costTypeStartTime) {
                            that.AGroupCostParameter.costTypeStartTime = new Date(that.AGroupCostParameter.costTypeStartTime);
                        }
                        if (that.AGroupCostParameter.costTypeendTime) {
                            that.AGroupCostParameter.costTypeendTime = new Date(that.AGroupCostParameter.costTypeendTime);
                        }
                        if (that.BGroupCostParameter.costTypeStartTime) {
                            that.BGroupCostParameter.costTypeStartTime = new Date(that.BGroupCostParameter.costTypeStartTime);
                        }
                        if (that.BGroupCostParameter.costTypeendTime) {
                            that.BGroupCostParameter.costTypeendTime = new Date(that.BGroupCostParameter.costTypeendTime);
                        }

                    } else {
                        that.AGroupCostParameter = {
                            "id": 0,
                            "diId": 0,
                            "currency": "CNY",
                            "rate": 0,
                            "tax": 0,
                            "ffys": 0,
                            "hotelXS": 0,
                            "jjccb": 0,
                            "jjcxs": 0,
                            "jjcrs": 0,
                            "gwccb": 0,
                            "gwcxs": 0,
                            "gwcrs": 0,
                            "hcpcb": 0,
                            "hcpxs": 0,
                            "hcprs": 0,
                            "cpcb": 0,
                            "cpxs": 0,
                            "cprs": 0,
                            "bxcb": 0,
                            "bxxs": 0,
                            "bxrs": 0,
                            "hscb": 0,
                            "hsxs": 0,
                            "hsrs": 0,
                            "visaCB": 0,
                            "visaXS": 0,
                            "visaRS": 0,
                            "gwcb": 0,
                            "gwxs": 0,
                            "gwrs": 0,
                            "djcb": 0,
                            "djrs": 0,
                            "djxs": 0,
                            "sgrcb": 0,
                            "sgrNumber": 0,
                            "sgrxs": 0,
                            "tbrcb": 0,
                            "tbrNumber": 0,
                            "tbrxs": 0,
                            "jsescb": 0,
                            "jsesNumber": 0,
                            "jsesxs": 0,
                            "suitecb": 0,
                            "suiteNumber": 0,
                            "suitexs": 0,
                            "lyjcb": 0,
                            "lyjxs": 0,
                            "lyjrs": 0,
                            "isShare": 0,
                            "costType": "A",
                            "costTypeStartTime": "",
                            "costTypeendTime": "",
                            "costTypenumber": 0
                        };
                        that.BGroupCostParameter = {
                            "id": 0,
                            "diId": 0,
                            "currency": "",
                            "rate": 0,
                            "tax": 0,
                            "ffys": 0,
                            "hotelXS": 0,
                            "jjccb": 0,
                            "jjcxs": 0,
                            "jjcrs": 0,
                            "gwccb": 0,
                            "gwcxs": 0,
                            "gwcrs": 0,
                            "hcpcb": 0,
                            "hcpxs": 0,
                            "hcprs": 0,
                            "cpcb": 0,
                            "cpxs": 0,
                            "cprs": 0,
                            "bxcb": 0,
                            "bxxs": 0,
                            "bxrs": 0,
                            "hscb": 0,
                            "hsxs": 0,
                            "hsrs": 0,
                            "visaCB": 0,
                            "visaXS": 0,
                            "visaRS": 0,
                            "gwcb": 0,
                            "gwxs": 0,
                            "gwrs": 0,
                            "djcb": 0,
                            "djxs": 0,
                            "djrs": 0,
                            "sgrcb": 0,
                            "sgrNumber": 0,
                            "sgrxs": 0,
                            "tbrcb": 0,
                            "tbrNumber": 0,
                            "tbrxs": 0,
                            "jsescb": 0,
                            "jsesNumber": 0,
                            "jsesxs": 0,
                            "suitecb": 0,
                            "suiteNumber": 0,
                            "suitexs": 0,
                            "lyjcb": 0,
                            "lyjxs": 0,
                            "lyjrs": 0,
                            "isShare": 0,
                            "costType": "B",
                            "costTypeStartTime": "",
                            "costTypeendTime": "",
                            "costTypenumber": 0
                        };
                        that.AGroupCostParameter.diId = that.diid;
                        that.BGroupCostParameter.diId = that.diid;
                        that.costTypevalue = 'A';
                    }

                    let hotelNumber = resp.data.data.hotelNumber;
                    if (hotelNumber.length > 0) {
                        for (var i = 0; i < hotelNumber.length; i++) {
                            //替换costTypeHotelNumbers ;
                            Array.forEach(that.costTypeHotelNumbers, (item, index) => {
                                if (hotelNumber[i]['type'] == item.type) {
                                    that.$set(that.costTypeHotelNumbers, index, hotelNumber[i]);
                                }
                            })
                        }

                    } else {
                        that.costTypeHotelNumbers = [{
                            "sgr": 0,
                            "tbr": 0,
                            "jses": 0,
                            "suite": 0,
                            "type": "Default",
                            "diid": 0,
                            id: 0,
                        },
                        {
                            "sgr": 0,
                            "tbr": 0,
                            "jses": 0,
                            "suite": 0,
                            "type": "A",
                            "diid": 0,
                            id: 0,
                        },
                        {
                            "sgr": 0,
                            "tbr": 0,
                            "jses": 0,
                            "suite": 0,
                            "type": "B",
                            "diid": 0,
                            id: 0,
                        }]
                    }

                    if (resp.data.data.visaCountryInfoArr.length > 0) {
                        that.visaCountryInfoArr = resp.data.data.visaCountryInfoArr;
                    } else {
                        that.visaCountryInfoArr = [];
                    }

                }
                that.costloading = false;
            }).catch(err => {
                that.costloading = false;
                this.$message({
                    message: '网络异常！',
                    type: 'error'
                });
            })

        },
        groupChange() {
            this.clearFormVerify();
            this.loadData(this.diid);
        },
        save() {

            return new Promise(async (resolve, reject) => {
                var that = this;
                var Data = { diid: this.diid, userid: this.userId };
                var isTrue = await this.formVerify();
                if (isTrue) {
                    Data.checkBoxs = this.CheckBoxListSelect.map(x => {
                        return {
                            diid: x.diid,
                            cbType: x.cbType,
                            cbValues: x.cbValues.join(',')
                        };
                    });

                    Data.groupCosts = this.tableData;
                    Data.costTypeHotelNumbers = this.costTypeHotelNumbers.map(x => {
                        return {
                            id: x.id,
                            sgr: x.sgr,
                            tbr: x.tbr,
                            jses: x.jses,
                            suite: x.suite,
                            type: x.type,
                            diid: that.diid
                        };
                    });

                    this.AGroupCostParameter.diId = this.diid;
                    this.BGroupCostParameter.diId = this.diid;

                    var Aparam = Object.assign({}, this.AGroupCostParameter);
                    var Bparam = Object.assign({}, this.BGroupCostParameter);
                    if (that.AGroupCostParameter.costTypeStartTime) {
                        Aparam.costTypeStartTime = this.addOneDay(that.AGroupCostParameter.costTypeStartTime, 0);
                    }
                    if (that.AGroupCostParameter.costTypeendTime) {
                        Aparam.costTypeendTime = this.addOneDay(that.AGroupCostParameter.costTypeendTime, 0);
                    }
                    if (that.BGroupCostParameter.costTypeStartTime) {
                        Bparam.costTypeStartTime = this.addOneDay(that.BGroupCostParameter.costTypeStartTime, 0);
                    }
                    if (that.BGroupCostParameter.costTypeendTime) {
                        Bparam.costTypeendTime = this.addOneDay(that.BGroupCostParameter.costTypeendTime, 0);
                    }
                    if (this.costTypevalue == "A") {
                        Data.groupCostParameters = [Aparam];
                    } else {
                        Data.groupCostParameters = [Aparam, Bparam];
                    }

                    this.Dataformat();
                    console.log(Data, "save-------Data");

                    var that = this;
                    this.$axios.post('/api/Groups/SaveGroupCost', Data, {
                        headers: {
                            'Authorization': that.token,
                        }
                    }).then(resp => {
                        console.log(resp.data.data, '------------------------------------');
                        if (resp.data.code == 200) {
                            this.$message({
                                message: '保存成功！',
                                type: 'success'
                            });
                            resolve(true);
                        } else {
                            this.$message.error('保存失败！' + resp.data.msg);
                            resolve(false);
                        }
                    })

                } else {
                    this.$message.error('请输入完整！');
                }


            })


        },
        TopChange() {
        },
        calculateZCB(EnLabelParam) {
            if (EnLabelParam == undefined) {
                return 0.00;
            }

            var sum = 0.00;
            if (this.AGroupCostParameter[EnLabelParam + 'CB'] != undefined) {

                sum = (parseFloat(this.AGroupCostParameter[EnLabelParam + 'CB']) * parseInt(this.AGroupCostParameter[EnLabelParam + 'RS']));

            } else if (this.AGroupCostParameter[EnLabelParam + 'cb'] != undefined) {

                sum = (parseFloat(this.AGroupCostParameter[EnLabelParam + 'cb']) * parseInt(this.AGroupCostParameter[EnLabelParam + 'rs'] != undefined ? this.AGroupCostParameter[EnLabelParam + 'rs'] : this.AGroupCostParameter[EnLabelParam + 'Number']));
            }

            if (isNaN(sum)) {
                sum = 0.00;
            }
            return sum.toFixed(2);
        },
        calculateDRBJ(EnLabelParam) {
            if (EnLabelParam == undefined) {
                return 0.00;
            }

            var sum = 0.00;
            if (this.AGroupCostParameter[EnLabelParam + 'CB'] != undefined) {

                sum = (parseFloat(this.AGroupCostParameter[EnLabelParam + 'CB']) * parseFloat(this.AGroupCostParameter[EnLabelParam + 'XS']));

            } else if (this.AGroupCostParameter[EnLabelParam + 'cb'] != undefined) {

                sum = (parseFloat(this.AGroupCostParameter[EnLabelParam + 'cb']) * parseFloat(this.AGroupCostParameter[EnLabelParam + 'xs']));
            }

            if (isNaN(sum)) {
                sum = 0.00;
            }
            return sum.toFixed(2);
        },
        calculateZBJ(EnLabelParam) {
            if (EnLabelParam == undefined) {
                return 0.00;
            }

            var sum = 0.00;
            var drbj = this.calculateDRBJ(EnLabelParam);
            if (this.AGroupCostParameter[EnLabelParam + 'RS'] != undefined) {

                sum = drbj * parseInt(this.AGroupCostParameter[EnLabelParam + 'RS']);

            } else if (this.AGroupCostParameter[EnLabelParam + 'rs'] != undefined) {

                sum = drbj * parseInt(this.AGroupCostParameter[EnLabelParam + 'rs']);

            } else if (this.AGroupCostParameter[EnLabelParam + 'Number'] != undefined) {

                sum = drbj * parseInt(this.AGroupCostParameter[EnLabelParam + 'Number']);
            }

            if (isNaN(sum)) {
                sum = 0.00;
            }
            return sum.toFixed(2);
        },
        calculateDRLR(EnLabelParam) {
            if (EnLabelParam == undefined) {
                return 0.00;
            }

            var sum = 0.00;
            var drbj = this.calculateDRBJ(EnLabelParam);
            if (this.AGroupCostParameter[EnLabelParam + 'CB'] != undefined) {

                sum = (drbj - parseFloat(this.AGroupCostParameter[EnLabelParam + 'CB']));

            } else if (this.AGroupCostParameter[EnLabelParam + 'cb'] != undefined) {

                sum = (drbj - parseFloat(this.AGroupCostParameter[EnLabelParam + 'cb']));
            }

            if (isNaN(sum)) {
                sum = 0.00;
            }
            return sum.toFixed(2);
        },
        calculateZLR(EnLabelParam) {
            if (EnLabelParam == undefined) {
                return 0.00;
            }

            var sum = 0.00;
            var drlr = this.calculateDRLR(EnLabelParam);
            if (this.AGroupCostParameter[EnLabelParam + 'RS'] != undefined) {
                sum = drlr * parseInt(this.AGroupCostParameter[EnLabelParam + 'RS']);
            } else if (this.AGroupCostParameter[EnLabelParam + 'rs'] != undefined) {
                sum = drlr * parseInt(this.AGroupCostParameter[EnLabelParam + 'rs']);
            }

            if (isNaN(sum)) {
                sum = 0.00;
            }
            return sum.toFixed(2);
        },
        BcalculateZCB(EnLabelParam) {
            if (EnLabelParam == undefined) {
                return 0.00;
            }

            var sum = 0.00;
            if (this.BGroupCostParameter[EnLabelParam + 'CB'] != undefined) {

                sum = (parseFloat(this.BGroupCostParameter[EnLabelParam + 'CB']) * parseInt(this.BGroupCostParameter[EnLabelParam + 'RS']));

            } else if (this.BGroupCostParameter[EnLabelParam + 'cb'] != undefined) {

                sum = (parseFloat(this.BGroupCostParameter[EnLabelParam + 'cb']) * parseInt(this.BGroupCostParameter[EnLabelParam + 'rs'] != undefined ? this.BGroupCostParameter[EnLabelParam + 'rs'] : this.BGroupCostParameter[EnLabelParam + 'Number']));
            }

            if (isNaN(sum)) {
                sum = 0.00;
            }
            return sum.toFixed(2);;
        },
        BcalculateDRBJ(EnLabelParam) {
            if (EnLabelParam == undefined) {
                return 0.00;
            }

            var sum = 0.00;
            if (this.BGroupCostParameter[EnLabelParam + 'CB'] != undefined) {

                sum = (parseFloat(this.BGroupCostParameter[EnLabelParam + 'CB']) * parseFloat(this.BGroupCostParameter[EnLabelParam + 'XS']));

            } else if (this.BGroupCostParameter[EnLabelParam + 'cb'] != undefined) {

                sum = (parseFloat(this.BGroupCostParameter[EnLabelParam + 'cb']) * parseFloat(this.BGroupCostParameter[EnLabelParam + 'xs']));
            }

            if (isNaN(sum)) {
                sum = 0.00;
            }
            return sum.toFixed(2);;
        },
        BcalculateZBJ(EnLabelParam) {
            if (EnLabelParam == undefined) {
                return 0.00;
            }

            var sum = 0.00;
            var drbj = this.BcalculateDRBJ(EnLabelParam);
            if (this.BGroupCostParameter[EnLabelParam + 'RS'] != undefined) {

                sum = drbj * parseInt(this.BGroupCostParameter[EnLabelParam + 'RS']);

            } else if (this.BGroupCostParameter[EnLabelParam + 'rs'] != undefined) {

                sum = drbj * parseInt(this.BGroupCostParameter[EnLabelParam + 'rs']);

            } else if (this.BGroupCostParameter[EnLabelParam + 'Number'] != undefined) {

                sum = drbj * parseInt(this.BGroupCostParameter[EnLabelParam + 'Number']);
            }

            if (isNaN(sum)) {
                sum = 0.00;
            }
            return sum.toFixed(2);
        },
        BcalculateDRLR(EnLabelParam) {
            if (EnLabelParam == undefined) {
                return 0.00;
            }

            var sum = 0.00;
            var drbj = this.BcalculateDRBJ(EnLabelParam);
            if (this.BGroupCostParameter[EnLabelParam + 'CB'] != undefined) {

                sum = drbj - parseFloat(this.BGroupCostParameter[EnLabelParam + 'CB']);

            } else if (this.BGroupCostParameter[EnLabelParam + 'cb'] != undefined) {

                sum = drbj - parseFloat(this.BGroupCostParameter[EnLabelParam + 'cb']);
            }

            if (isNaN(sum)) {
                sum = 0.00;
            }
            return sum.toFixed(2);;
        },
        BcalculateZLR(EnLabelParam) {
            if (EnLabelParam == undefined) {
                return 0.00;
            }

            var sum = 0.00;
            var drlr = this.BcalculateDRLR(EnLabelParam);
            if (this.BGroupCostParameter[EnLabelParam + 'RS'] != undefined) {
                sum = drlr * parseInt(this.BGroupCostParameter[EnLabelParam + 'RS']);
            } else if (this.BGroupCostParameter[EnLabelParam + 'rs'] != undefined) {
                sum = drlr * parseInt(this.BGroupCostParameter[EnLabelParam + 'rs']);
            }

            if (isNaN(sum)) {
                sum = 0.00;
            }
            return sum.toFixed(2);;
        },
        handleCurrentChange(val) {
            this.currentPage = val;
        },
        SelChange(row, oldrow) {
            console.log(row, oldrow);
        },
        handleSizeChange(val) {
            this.currentPage = 1;
            this.pageSize = val;
        },
        CalculatedPrice() {

            let rate = Number(this.AGroupCostParameter.rate);
            let Djsum = 0;
            let BDjsum = 0;
            var that = this;
            this.DJLables.forEach(function (item) {
                that.sumTopPrice.forEach(function (item1) {
                    if (item == item1.label) {
                        var Aprice = Number(item1.Aprice);
                        if (!isNaN(Aprice)) {
                            Djsum += Aprice;
                        }

                        var Bprice = Number(item1.Bprice);
                        if (!isNaN(Bprice)) {
                            BDjsum += Bprice;
                        }
                    }
                })
            })
            Djsum = Number((Djsum * rate).toFixed(2));
            BDjsum = Number((BDjsum * rate).toFixed(2));

            let GWsum = 0;
            let BGWsum = 0;
            this.GwLables.forEach(function (item) {
                that.sumTopPrice.forEach(function (item1) {
                    if (item == item1.label) {
                        var Aprice = Number(item1.Aprice);
                        if (!isNaN(Aprice)) {
                            GWsum += Aprice;
                        }

                        var Bprice = Number(item1.Bprice);
                        if (!isNaN(Bprice)) {
                            BGWsum += Bprice;
                        }
                    }
                })
            })
            GWsum = Number((GWsum * rate).toFixed(2));
            BGWsum = Number((BGWsum * rate).toFixed(2));

            let LYJsum = 0;
            let BLYJsum = 0;
            var lyjList = that.sumTopPrice.filter((x) => {
                return x.label == 'P/C';
            })

            if (lyjList.length > 0) {
                LYJsum = lyjList[0].Aprice;
                BLYJsum = lyjList[0].Bprice;
            }
            LYJsum = isNaN(LYJsum) ? 0 : LYJsum;
            BLYJsum = isNaN(BLYJsum) ? 0 : BLYJsum;
            LYJsum = Number((LYJsum * rate).toFixed(2));
            BLYJsum = Number((BLYJsum * rate).toFixed(2));

            let SGRsum = 0;
            let BSGRsum = 0;
            var SGRList = that.sumTopPrice.filter((x) => {
                return x.label == 'SGR';
            })
            if (SGRList.length > 0) {
                SGRsum = SGRList[0].Aprice;
                BSGRsum = SGRList[0].Bprice;
            }
            SGRsum = isNaN(SGRsum) ? 0 : SGRsum;
            BSGRsum = isNaN(BSGRsum) ? 0 : BSGRsum;
            SGRsum = (SGRsum * rate).toFixed(2);
            BSGRsum = (BSGRsum * rate).toFixed(2);


            let TBRsum = 0;
            let BTBRsum = 0;
            var TBRList = that.sumTopPrice.filter((x) => {
                return x.label == 'TBR';
            })
            if (TBRList.length > 0) {
                TBRsum = TBRList[0].Aprice;
                BTBRsum = TBRList[0].Bprice;
            }
            TBRsum = isNaN(TBRsum) ? 0 : TBRsum;
            BTBRsum = isNaN(BTBRsum) ? 0 : BTBRsum;
            TBRsum = TBRsum * rate;
            BTBRsum = BTBRsum * rate;

            let JSESsum = 0;
            let BJSESsum = 0;
            var JSESList = that.sumTopPrice.filter((x) => {
                return x.label == 'JS/ES';
            })
            if (JSESList.length > 0) {
                JSESsum = JSESList[0].Aprice;
                BJSESsum = JSESList[0].Bprice;
            }
            JSESsum = isNaN(JSESsum) ? 0 : JSESsum;
            BJSESsum = isNaN(BJSESsum) ? 0 : BJSESsum;
            JSESsum = JSESsum * rate;
            BJSESsum = BJSESsum * rate;

            let SUITEsum = 0;
            let BSUITEsum = 0;
            var SUITEList = that.sumTopPrice.filter((x) => {
                return x.label == 'SUITE';
            })
            if (SUITEList.length > 0) {
                SUITEsum = SUITEList[0].Aprice;
                BSUITEsum = SUITEList[0].Bprice;
            }
            SUITEsum = isNaN(SUITEsum) ? 0 : SUITEsum;
            BSUITEsum = isNaN(BSUITEsum) ? 0 : BSUITEsum;
            SUITEsum = SUITEsum * rate;
            BSUITEsum = BSUITEsum * rate;

            // console.log(Djsum, GWsum, LYJsum, 'Djsum,GWsum,LYJsum');
            // console.log(SGRsum, TBRsum, JSESsum, SUITEsum, 'SGRsum,TBRsum,JSESsum,SUITEsum');

            var sgrfilter = this.costTypeHotelNumbers.filter(x => {
                return x.type == 'Default'
            })
            let Bsgrfilter = {};

            if (this.costTypevalue == 'B') {
                sgrfilter = this.costTypeHotelNumbers.filter(x => {
                    return x.type == 'A'
                })

                Bsgrfilter = this.costTypeHotelNumbers.filter(x => {
                    return x.type == 'B'
                })

                Bsgrfilter = Bsgrfilter[0];
            }

            sgrfilter = sgrfilter[0];

            let hotelRooms = {
                "SGR": sgrfilter.sgr,
                "TBR": sgrfilter.tbr,
                "JSES": sgrfilter.jses,
                "SUITE": sgrfilter.suite
            };

            let flights = {
                "经济舱": this.AGroupCostParameter.jjcrs,
                "公务舱": this.AGroupCostParameter.gwcrs
            };

            let result = {};
            for (let flight of ["经济舱", "公务舱"]) {
                if (flight === "经济舱") {
                    this.matchRooms(hotelRooms, flights, ["SGR", "TBR", "JSES", "SUITE"], flight, result);
                } else if (flight === "公务舱") {
                    this.matchRooms(hotelRooms, flights, ["SUITE", "JSES", "SGR", "TBR"], flight, result);
                }
            }

            if (this.costTypevalue == 'B') {

                let BhotelRooms = {
                    "SGR": Bsgrfilter.sgr,
                    "TBR": Bsgrfilter.tbr,
                    "JSES": Bsgrfilter.jses,
                    "SUITE": Bsgrfilter.suite
                };

                let Bflights = {
                    "经济舱": this.BGroupCostParameter.jjcrs,
                    "公务舱": this.BGroupCostParameter.gwcrs
                };

                let Bresult = {};
                for (let flight of ["经济舱", "公务舱"]) {
                    if (flight === "经济舱") {
                        this.matchRooms(BhotelRooms, Bflights, ["SGR", "TBR", "JSES", "SUITE"], flight, Bresult);
                    } else if (flight === "公务舱") {
                        this.matchRooms(BhotelRooms, Bflights, ["SUITE", "JSES", "SGR", "TBR"], flight, Bresult);
                    }
                }

                var BtxtJJCSGRRS = (Bresult.hasOwnProperty("经济舱SGR") ? Bresult["经济舱SGR"] : 0)
                var BlblGWCSGRRS = (Bresult.hasOwnProperty("公务舱SGR") ? Bresult["公务舱SGR"] : 0)
                var BtxtJJCTBRRS = (Bresult.hasOwnProperty("经济舱TBR") ? Bresult["经济舱TBR"] * 2 : 0)
                var BtxtGWCJSESRS = (Bresult.hasOwnProperty("公务舱JSES") ? Bresult["公务舱JSES"] : 0)
                var BJJCSUITERS = (Bresult.hasOwnProperty("经济舱SUITE") ? Bresult["经济舱SUITE"] : 0)
                var BtxtGWCSUITERS = (Bresult.hasOwnProperty("公务舱SUITE") ? Bresult["公务舱SUITE"] : 0)

                this.BcabinDatal[0].sheetInfo[0].toll = BtxtJJCTBRRS;
                this.BcabinDatal[1].sheetInfo[0].toll = BtxtJJCSGRRS;
                this.BcabinDatal[2].sheetInfo[0].toll = BlblGWCSGRRS;
                this.BcabinDatal[3].sheetInfo[0].toll = BtxtGWCJSESRS;
                this.BcabinDatal[4].sheetInfo[0].toll = BtxtGWCSUITERS;
                this.BcabinDatal[5].sheetInfo[0].toll = BJJCSUITERS;

                this.BGroupCostParameter.djcb = BDjsum;
                this.BGroupCostParameter.gwcb = BGWsum;
                this.BGroupCostParameter.lyjcb = BLYJsum;
                this.BGroupCostParameter.sgrcb = BSGRsum;
                this.BGroupCostParameter.tbrcb = BTBRsum;
                this.BGroupCostParameter.jsescb = BJSESsum;
                this.BGroupCostParameter.suitecb = BSUITEsum;

                var BleftSum = this.BOtherCost();
                let BJJCSGR = (BleftSum + Number(this.BGroupCostParameter.sgrcb) + Number(this.BGroupCostParameter.jjccb));
                let BJJCTBR = BleftSum + Number(this.BGroupCostParameter.tbrcb) + Number(this.BGroupCostParameter.jjccb);
                let BJJCSUITE = BleftSum + Number(this.BGroupCostParameter.suitecb) + Number(this.BGroupCostParameter.jjccb);
                let BGWCSUITE = BleftSum + Number(this.BGroupCostParameter.suitecb) + Number(this.BGroupCostParameter.gwccb);
                let BGWCSGR = BleftSum + Number(this.BGroupCostParameter.sgrcb) + Number(this.BGroupCostParameter.gwccb);
                let BGWCJSES = BleftSum + Number(this.BGroupCostParameter.jsescb) + Number(this.BGroupCostParameter.gwccb);

                BJJCSGR = BJJCSGR.toFixed(2);

                var BrightSum = 0;
                this.OtherCostPropertyBJ.forEach((x) => {
                    BrightSum += Number(that.BcalculateDRBJ(x));
                })


                let BJJCSGRDRBJ = BrightSum + Number(that.BcalculateDRBJ('jjc')) + Number(that.BcalculateDRBJ('sgr'));
                let BJJCTBRDRBJ = BrightSum + Number(that.BcalculateDRBJ('tbr')) + Number(that.BcalculateDRBJ('jjc'));
                let BJJCSUITEDRBJ = BrightSum + Number(that.BcalculateDRBJ('suite')) + Number(that.BcalculateDRBJ('jjc'));
                let BGWCSUITEDRBJ = BrightSum + Number(that.BcalculateDRBJ('suite')) + Number(that.BcalculateDRBJ('gwc'));
                let BGWCSGRDRBJ = BrightSum + Number(that.BcalculateDRBJ('sgr')) + Number(that.BcalculateDRBJ('gwc'));
                let BGWCJSESDRBJ = BrightSum + Number(that.BcalculateDRBJ('jses')) + Number(that.BcalculateDRBJ('gwc'));


                this.BcabinDatal[0].sheetInfo[0].costPerson = BJJCTBR;
                this.BcabinDatal[0].sheetInfo[0].singleQuote = BJJCTBRDRBJ;
                this.BcabinDatal[1].sheetInfo[0].costPerson = BJJCSGR;
                this.BcabinDatal[1].sheetInfo[0].singleQuote = BJJCSGRDRBJ;
                this.BcabinDatal[2].sheetInfo[0].costPerson = BGWCSGR;
                this.BcabinDatal[2].sheetInfo[0].singleQuote = BGWCSGRDRBJ;
                this.BcabinDatal[3].sheetInfo[0].costPerson = BGWCJSES;
                this.BcabinDatal[3].sheetInfo[0].singleQuote = BGWCJSESDRBJ;
                this.BcabinDatal[4].sheetInfo[0].costPerson = BGWCSUITE;
                this.BcabinDatal[4].sheetInfo[0].singleQuote = BGWCSUITEDRBJ;
                this.BcabinDatal[5].sheetInfo[0].costPerson = BJJCSUITE;
                this.BcabinDatal[5].sheetInfo[0].singleQuote = BJJCSUITEDRBJ;
            }

            var txtJJCSGRRS = (result.hasOwnProperty("经济舱SGR") ? result["经济舱SGR"] : 0)
            var lblGWCSGRRS = (result.hasOwnProperty("公务舱SGR") ? result["公务舱SGR"] : 0)
            var txtJJCTBRRS = (result.hasOwnProperty("经济舱TBR") ? result["经济舱TBR"] * 2 : 0)
            var txtGWCJSESRS = (result.hasOwnProperty("公务舱JSES") ? result["公务舱JSES"] : 0)
            var JJCSUITERS = (result.hasOwnProperty("经济舱SUITE") ? result["经济舱SUITE"] : 0)
            var txtGWCSUITERS = (result.hasOwnProperty("公务舱SUITE") ? result["公务舱SUITE"] : 0)

            this.cabinDatal[0].sheetInfo[0].toll = txtJJCTBRRS;
            this.cabinDatal[1].sheetInfo[0].toll = txtJJCSGRRS;
            this.cabinDatal[2].sheetInfo[0].toll = lblGWCSGRRS;
            this.cabinDatal[3].sheetInfo[0].toll = txtGWCJSESRS;
            this.cabinDatal[4].sheetInfo[0].toll = txtGWCSUITERS;
            this.cabinDatal[5].sheetInfo[0].toll = JJCSUITERS;

            this.AGroupCostParameter.djcb = Djsum;
            this.AGroupCostParameter.gwcb = GWsum;
            this.AGroupCostParameter.lyjcb = LYJsum;
            this.AGroupCostParameter.sgrcb = SGRsum;
            this.AGroupCostParameter.tbrcb = TBRsum;
            this.AGroupCostParameter.jsescb = JSESsum;
            this.AGroupCostParameter.suitecb = SUITEsum;

            var leftSum = this.OtherCost();
            let JJCSGR = (leftSum + Number(this.AGroupCostParameter.sgrcb) + Number(this.AGroupCostParameter.jjccb)).toFixed(2);
            let JJCTBR = (leftSum + Number(this.AGroupCostParameter.tbrcb) + Number(this.AGroupCostParameter.jjccb)).toFixed(2);
            let JJCSUITE = (leftSum + Number(this.AGroupCostParameter.suitecb) + Number(this.AGroupCostParameter.jjccb)).toFixed(2);
            let GWCSUITE = (leftSum + Number(this.AGroupCostParameter.suitecb) + Number(this.AGroupCostParameter.gwccb)).toFixed(2);
            let GWCSGR = (leftSum + Number(this.AGroupCostParameter.sgrcb) + Number(this.AGroupCostParameter.gwccb)).toFixed(2);
            let GWCJSES = (leftSum + Number(this.AGroupCostParameter.jsescb) + Number(this.AGroupCostParameter.gwccb)).toFixed(2);
            //console.log(JJCSGR, JJCTBR, JJCSUITE, GWCSUITE, GWCSGR, GWCJSES, '666--------------------------');

            var rightSum = 0;
            this.OtherCostPropertyBJ.forEach((x) => {
                rightSum += Number(that.calculateDRBJ(x));
            })

            let JJCSGRDRBJ = (rightSum + Number(that.calculateDRBJ('jjc')) + Number(that.calculateDRBJ('sgr'))).toFixed(2);
            let JJCTBRDRBJ = (rightSum + Number(that.calculateDRBJ('tbr')) + Number(that.calculateDRBJ('jjc'))).toFixed(2);
            let JJCSUITEDRBJ = (rightSum + Number(that.calculateDRBJ('suite')) + Number(that.calculateDRBJ('jjc'))).toFixed(2);
            let GWCSUITEDRBJ = (rightSum + Number(that.calculateDRBJ('suite')) + Number(that.calculateDRBJ('gwc'))).toFixed(2);
            let GWCSGRDRBJ = (rightSum + Number(that.calculateDRBJ('sgr')) + Number(that.calculateDRBJ('gwc'))).toFixed(2);
            let GWCJSESDRBJ = (rightSum + Number(that.calculateDRBJ('jses')) + Number(that.calculateDRBJ('gwc'))).toFixed(2);


            this.cabinDatal[0].sheetInfo[0].costPerson = JJCTBR;
            this.cabinDatal[0].sheetInfo[0].singleQuote = JJCTBRDRBJ;
            this.cabinDatal[1].sheetInfo[0].costPerson = JJCSGR;
            this.cabinDatal[1].sheetInfo[0].singleQuote = JJCSGRDRBJ;
            this.cabinDatal[2].sheetInfo[0].costPerson = GWCSGR;
            this.cabinDatal[2].sheetInfo[0].singleQuote = GWCSGRDRBJ;
            this.cabinDatal[3].sheetInfo[0].costPerson = GWCJSES;
            this.cabinDatal[3].sheetInfo[0].singleQuote = GWCJSESDRBJ;
            this.cabinDatal[4].sheetInfo[0].costPerson = GWCSUITE;
            this.cabinDatal[4].sheetInfo[0].singleQuote = GWCSUITEDRBJ;
            this.cabinDatal[5].sheetInfo[0].costPerson = JJCSUITE;
            this.cabinDatal[5].sheetInfo[0].singleQuote = JJCSUITEDRBJ;

            let groupCosts = 0;
            let gtroupQuotes = 0;
            for (var i = 0; i < this.cabinDatal.length; i++) {
                var forNumber = Number(this.cabinDatal[i].sheetInfo[0]['toll']);
                if (!isNaN(forNumber) && forNumber > 0) {
                    groupCosts += (Number(this.cabinDatal[i].sheetInfo[0]['costPerson']) * forNumber);
                    gtroupQuotes += (Number(this.cabinDatal[i].sheetInfo[0]['singleQuote']) * forNumber);
                }
            }

            if (this.costTypevalue == 'B') {
                for (var i = 0; i < this.BcabinDatal.length; i++) {
                    var forNumber = Number(this.BcabinDatal[i].sheetInfo[0]['toll']);
                    if (!isNaN(forNumber) && forNumber > 0) {
                        groupCosts += (Number(this.BcabinDatal[i].sheetInfo[0]['costPerson']) * forNumber);
                        gtroupQuotes += (Number(this.BcabinDatal[i].sheetInfo[0]['singleQuote']) * forNumber);
                    }
                }
            }

            let groupProfit = gtroupQuotes - groupCosts;

            var cabinDatalLast = this.cabinDatal.filter(function (x) {
                return x.label == '团组预算明细'
            })

            groupCosts = groupCosts.toFixed(2);
            gtroupQuotes = gtroupQuotes.toFixed(2);
            groupProfit = groupProfit.toFixed(2);

            cabinDatalLast[0].sheetInfo[0]['groupCosts'] = groupCosts;
            cabinDatalLast[0].sheetInfo[0]['gtroupQuotes'] = gtroupQuotes;
            cabinDatalLast[0].sheetInfo[0]['groupProfit'] = groupProfit;


            //costTypeHotelNumbers{
            //     "sgr": 0,
            //     "tbr": 0,
            //     "jses": 0,
            //     "suite": 0,
            //     "type": "Default",
            //     "diid": 0,
            //     id: 0,
            // }


            //console.log(groupCosts, gtroupQuotes, groupProfit, 'groupCosts, gtroupQuotes, groupProfit');

        },
        OtherCost() {
            // txtVisaCost.Text +txtHCPCB.Text + txtCPCB.Text
            // txtBXCB.Text +txtHSCB.Text) +lblDJDRCB.Text + lblGWDRCD.Text + lblLYJDRCB.Text
            var that = this;
            let sum = 0;
            this.OtherCostProperty.forEach((x) => {
                var param = that.AGroupCostParameter[x];
                if (param != undefined) {
                    sum += Number(param);
                }
            })
            return sum;
        },
        BOtherCost() {
            // txtVisaCost.Text +txtHCPCB.Text + txtCPCB.Text
            // txtBXCB.Text +txtHSCB.Text) +lblDJDRCB.Text + lblGWDRCD.Text + lblLYJDRCB.Text
            var that = this;
            let sum = 0;
            this.OtherCostProperty.forEach((x) => {
                var param;
                if (x == 'visaCB' || x == 'bxcb') {
                    param = that.AGroupCostParameter[x];
                } else {
                    param = that.BGroupCostParameter[x];
                }
                if (param != undefined) {
                    sum += Number(param);
                }
            })
            return sum;
        },
        matchRooms(hotelRooms, flights, roomTypes, flightType, result) {
            for (let roomType of roomTypes) {
                while (hotelRooms[roomType] > 0 && flights[flightType] > 0) {
                    hotelRooms[roomType]--;
                    flights[flightType]--;
                    if (roomType === "TBR") {
                        flights[flightType]--; //双人间在减少1
                    }
                    if (result.hasOwnProperty(flightType + roomType)) {
                        result[flightType + roomType]++;
                    } else {
                        result[flightType + roomType] = 1;
                    }
                }
            }
        },
        NumberSetTime(number, index) {
            console.log(number, index, this.grouptitleinfo.visitStartDate);
            number = parseInt(number);
            if (!isNaN(number)) {
                var time = this.addOneDay(this.grouptitleinfo.visitStartDate, number - 1)
                this.tableData[index].date = time;
            } else {
                this.tableData[index].date = '';
                this.tableData[index].day = '';
            }
        },
        addOneDay(dateString, number) {
            if (!dateString) {
                return "";
            }
            let date = new Date(dateString);
            date.setDate(date.getDate() + number);
            let year = date.getFullYear();
            let month = date.getMonth() + 1;
            let day = date.getDate();
            month = month < 10 ? '0' + month : month;
            day = day < 10 ? '0' + day : day;
            return `${year}-${month}-${day}`;
        },
        costTypeSelect(val) {
            console.log('costTypeSelect--------------------------------------------------------', val);
        },
        async formVerify() {
            return new Promise((resolve, reject) => {

                var forFormList = [];
                if (this.costTypevalue == 'A') {
                    forFormList = ['inputs', 'DHotel'];
                } else {
                    forFormList = ['inputs', 'AHotel', 'Asection', 'BHotel', 'Bsection'];
                }

                var that = this;
                for (var i = 0; i < forFormList.length; i++) {
                    that.$refs[forFormList[i]].validate((valid) => {
                        if (valid) {

                        } else {
                            resolve(valid);
                        }
                    });
                }
                resolve(true);
            })
        },
        clearFormVerify() {
            var forFormList = ['inputs', 'AHotel', 'Asection', 'BHotel', 'Bsection', 'DHotel'];
            this.$nextTick(() => {
                for (var i = 0; i < forFormList.length; i++) {
                    this.$refs[forFormList[i]].resetFields();
                }
            })
        },
        topcheckboxChange(val, label) {
            console.log(val, label, 'topcheckboxChangeval');
            var that = this;
            if (!val) {
                this.$confirm('此操作将清空整列数据, 是否继续?', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning'
                }).then(() => {

                    console.log('确定清空数据');
                    var fliterList = this.sumTopPrice.filter(x => x.label == label);
                    if (fliterList.length != 0) {
                        fliterList[0].Aprice = 0;
                        fliterList[0].Bprice = 0;
                    }

                    fliterList = that.tableLabel.filter(x => x.label == label);
                    if (fliterList.length != 0) {
                        var obj = {
                            "diid": that.diid,
                            "day": "-",
                            "date": "",
                            "itin": "",
                            "carType": "",
                            "carCost": 0,
                            "carNumber": 0,
                            "carTiming": 0,
                            "tgs": 0,
                            "tgwh": 0,
                            "tgn": 0,
                            "tgof": 0,
                            "tgm": 0,
                            "tga": 0,
                            "tgtf": 0,
                            "tgef": 0,
                            "cfs": 0,
                            "cfm": 0,
                            "cfof": 0,
                            "b": 0,
                            "l": 0,
                            "d": 0,
                            "tbr": 0,
                            "sgr": 0,
                            "jS_ES": 0,
                            "suite": 0,
                            "accon": "",
                            "tv": 0,
                            "iL": 0,
                            "if": 0,
                            "ef": 0,
                            "b_R_F": 0,
                            "te": 0,
                            "tgTips": 0,
                            "drvTips": 0,
                            "pc": 0,
                            "tlf": 0,
                            "ect": 0,
                            "id": 1,
                        };
                        var prop = fliterList[0].prop;
                        var initval = obj[prop];

                        for (var i = 0; i < that.tableData.length; i++) {
                            that.tableData[i][prop] = initval;
                        }
                        console.log(that.tableData, 'that.tableData数据');
                    }

                    this.$message({
                        message: '已清除！',
                        type: 'success',
                        offset: 50
                    });

                }).catch(() => {
                    this.$message({
                        type: 'info',
                        message: '已取消操作'
                    });

                    if (!that.CheckBoxListSelect.filter(item => item.cbType == 'Top')[0].cbValues.includes(label)) {
                        that.CheckBoxListSelect.filter(item => item.cbType == 'Top')[0].cbValues.push(label);
                    }

                });
            }

        },
        GroupIsShare() {
            this.$axios.post('/api/Groups/GroupIsShare', { diid: this.diid }, {
                headers: {
                    'Authorization': this.token,
                }
            }).then(resp => {
                console.log(resp.data.data, '------------------------------------');
                if (resp.data.code == 200) {
                    this.$message({
                        message: '操作成功！' + resp.data.msg,
                        type: 'success'
                    });
                } else {
                    this.$message.error('操作失败！' + resp.data.msg);
                }
            })
        },
        GetPriceCheckWord() {
            var that = this;

            var airs = [

            ];

            var sgrfilter = this.costTypeHotelNumbers.filter(x => {
                return x.type == 'Default'
            })
            let Bsgrfilter = {};

            if (this.costTypevalue == 'B') {
                sgrfilter = this.costTypeHotelNumbers.filter(x => {
                    return x.type == 'A'
                })

                Bsgrfilter = this.costTypeHotelNumbers.filter(x => {
                    return x.type == 'B'
                })

                Bsgrfilter = Bsgrfilter[0];
            }

            sgrfilter = sgrfilter[0];

            let hotelRooms = {
                "SGR": sgrfilter.sgr,
                "TBR": sgrfilter.tbr,
                "JSES": sgrfilter.jses,
                "SUITE": sgrfilter.suite
            };

            let flights = {
                "经济舱": this.AGroupCostParameter.jjcrs,
                "公务舱": this.AGroupCostParameter.gwcrs
            };

            let result = {};
            for (let flight of ["经济舱", "公务舱"]) {
                if (flight === "经济舱") {
                    this.matchRooms(hotelRooms, flights, ["SGR", "TBR", "JSES", "SUITE"], flight, result);
                } else if (flight === "公务舱") {
                    this.matchRooms(hotelRooms, flights, ["SUITE", "JSES", "SGR", "TBR"], flight, result);
                }
            }

            if (this.costTypevalue == 'B') {

                let BhotelRooms = {
                    "SGR": Bsgrfilter.sgr,
                    "TBR": Bsgrfilter.tbr,
                    "JSES": Bsgrfilter.jses,
                    "SUITE": Bsgrfilter.suite
                };

                let Bflights = {
                    "经济舱": this.BGroupCostParameter.jjcrs,
                    "公务舱": this.BGroupCostParameter.gwcrs
                };

                let Bresult = {};
                for (let flight of ["经济舱", "公务舱"]) {
                    if (flight === "经济舱") {
                        this.matchRooms(BhotelRooms, Bflights, ["SGR", "TBR", "JSES", "SUITE"], flight, Bresult);
                    } else if (flight === "公务舱") {
                        this.matchRooms(BhotelRooms, Bflights, ["SUITE", "JSES", "SGR", "TBR"], flight, Bresult);
                    }
                }

                var BtxtJJCSGRRS = (Bresult.hasOwnProperty("经济舱SGR") ? Bresult["经济舱SGR"] : 0)
                var BlblGWCSGRRS = (Bresult.hasOwnProperty("公务舱SGR") ? Bresult["公务舱SGR"] : 0)
                var BtxtJJCTBRRS = (Bresult.hasOwnProperty("经济舱TBR") ? Bresult["经济舱TBR"] * 2 : 0)
                var BtxtGWCJSESRS = (Bresult.hasOwnProperty("公务舱JSES") ? Bresult["公务舱JSES"] : 0)
                var BJJCSUITERS = (Bresult.hasOwnProperty("经济舱SUITE") ? Bresult["经济舱SUITE"] : 0)
                var BtxtGWCSUITERS = (Bresult.hasOwnProperty("公务舱SUITE") ? Bresult["公务舱SUITE"] : 0)

                var BrightSum = 0;
                this.OtherCostPropertyBJ.forEach((x) => {
                    BrightSum += Number(that.BcalculateDRBJ(x));
                })

                let BJJCSGRDRBJ = BrightSum + Number(that.BcalculateDRBJ('jjc')) + Number(that.BcalculateDRBJ('sgr'));
                let BJJCTBRDRBJ = BrightSum + Number(that.BcalculateDRBJ('tbr')) + Number(that.BcalculateDRBJ('jjc'));
                let BJJCSUITEDRBJ = BrightSum + Number(that.BcalculateDRBJ('suite')) + Number(that.BcalculateDRBJ('jjc'));
                let BGWCSUITEDRBJ = BrightSum + Number(that.BcalculateDRBJ('suite')) + Number(that.BcalculateDRBJ('gwc'));
                let BGWCSGRDRBJ = BrightSum + Number(that.BcalculateDRBJ('sgr')) + Number(that.BcalculateDRBJ('gwc'));
                let BGWCJSESDRBJ = BrightSum + Number(that.BcalculateDRBJ('jses')) + Number(that.BcalculateDRBJ('gwc'));

                airs.push({
                    "code": "JJCTBR",
                    "number": BtxtJJCTBRRS,
                    "price": BJJCTBRDRBJ,
                    "costType": "B"
                });

                airs.push({
                    "code": "JJCSGR",
                    "number": BtxtJJCSGRRS,
                    "price": BJJCSGRDRBJ,
                    "costType": "B"
                });

                airs.push({
                    "code": "GWCSGR",
                    "number": BlblGWCSGRRS,
                    "price": BGWCSGRDRBJ,
                    "costType": "B"
                });

                airs.push({
                    "code": "GWCJSES",
                    "number": BtxtGWCJSESRS,
                    "price": BGWCJSESDRBJ,
                    "costType": "B"
                });

                airs.push({
                    "code": "GWCSUITE",
                    "number": BtxtGWCSUITERS,
                    "price": BGWCSUITEDRBJ,
                    "costType": "B"
                });

                airs.push({
                    "code": "JJCSUITE",
                    "number": BJJCSUITERS,
                    "price": BJJCSUITEDRBJ,
                    "costType": "B"
                });

            }

            var txtJJCSGRRS = (result.hasOwnProperty("经济舱SGR") ? result["经济舱SGR"] : 0)
            var lblGWCSGRRS = (result.hasOwnProperty("公务舱SGR") ? result["公务舱SGR"] : 0)
            var txtJJCTBRRS = (result.hasOwnProperty("经济舱TBR") ? result["经济舱TBR"] * 2 : 0)
            var txtGWCJSESRS = (result.hasOwnProperty("公务舱JSES") ? result["公务舱JSES"] : 0)
            var JJCSUITERS = (result.hasOwnProperty("经济舱SUITE") ? result["经济舱SUITE"] : 0)
            var txtGWCSUITERS = (result.hasOwnProperty("公务舱SUITE") ? result["公务舱SUITE"] : 0)

            var rightSum = 0;
            this.OtherCostPropertyBJ.forEach((x) => {
                rightSum += Number(that.calculateDRBJ(x));
            })

            let JJCSGRDRBJ = (rightSum + Number(that.calculateDRBJ('jjc')) + Number(that.calculateDRBJ('sgr'))).toFixed(2);
            let JJCTBRDRBJ = (rightSum + Number(that.calculateDRBJ('tbr')) + Number(that.calculateDRBJ('jjc'))).toFixed(2);
            let JJCSUITEDRBJ = (rightSum + Number(that.calculateDRBJ('suite')) + Number(that.calculateDRBJ('jjc'))).toFixed(2);
            let GWCSUITEDRBJ = (rightSum + Number(that.calculateDRBJ('suite')) + Number(that.calculateDRBJ('gwc'))).toFixed(2);
            let GWCSGRDRBJ = (rightSum + Number(that.calculateDRBJ('sgr')) + Number(that.calculateDRBJ('gwc'))).toFixed(2);
            let GWCJSESDRBJ = (rightSum + Number(that.calculateDRBJ('jses')) + Number(that.calculateDRBJ('gwc'))).toFixed(2);

            airs.push({
                "code": "JJCTBR",
                "number": txtJJCTBRRS,
                "price": JJCTBRDRBJ,
                "costType": "A"
            });

            airs.push({
                "code": "JJCSGR",
                "number": txtJJCSGRRS,
                "price": JJCSGRDRBJ,
                "costType": "A"
            });

            airs.push({
                "code": "GWCSGR",
                "number": lblGWCSGRRS,
                "price": GWCSGRDRBJ,
                "costType": "A"
            });

            airs.push({
                "code": "GWCJSES",
                "number": txtGWCJSESRS,
                "price": GWCJSESDRBJ,
                "costType": "A"
            });

            airs.push({
                "code": "GWCSUITE",
                "number": txtGWCSUITERS,
                "price": GWCSUITEDRBJ,
                "costType": "A"
            });

            airs.push({
                "code": "JJCSUITE",
                "number": JJCSUITERS,
                "price": JJCSUITEDRBJ,
                "costType": "A"
            });


            var that = this;
            this.$axios.post('/api/Groups/ExportPriceCheckWordFile', { diid: this.diid, airs: airs }, {
                headers: {
                    'Authorization': this.token,
                }
            }).then(resp => {
                console.log(resp, '------------------------------------');
                try {
                    if (resp.data.code != 200) {
                        throw resp.data.msg;
                    }
                    var file = resp.data.data;
                    that.fileDownload(file.data, file.strFileName);
                } catch (error) {
                    this.$message.error('操作失败！' + error.message);
                }
            })


        },
        fileDownload(data, filename) {
            let blob = this.base64toBlob(data);
            let link = document.createElement('a');
            link.href = window.URL.createObjectURL(blob);
            link.download = filename;
            link.click();
        },
        base64toBlob(base64, type = 'application/octet-stream') {
            const bstr = atob(base64);
            let n = bstr.length;
            const u8arr = new Uint8Array(n);
            while (n--) {
                u8arr[n] = bstr.charCodeAt(n);
            }
            return new Blob([u8arr], { type });
        },
        async GetGroupCostExcel() {

            console.log(this.titleText, 'this.titleText');

            var isTrue = await this.save();
            if (!isTrue) {
                this.$message.error('请检查数据！');
                return;
            }

            var that = this;
            var group = this.options.filter(function (x) {
                return x.id == that.diid
            })

            if (group.length == 0) {
                this.$message.error('请选择团组！' + resp.data.msg);
                return;
            }

            var data = {
                diid: this.diid,
                costType: this.costTypevalue,
                title: {
                    groupNumber: Number(this.grouptitleinfo.visitPNumber),
                    teamName: group[0].groupName,
                    tax: this.AGroupCostParameter.tax,
                    currency: this.AGroupCostParameter.currency,
                    rate: this.AGroupCostParameter.rate
                },
                leftInfo: {

                },
                rightInfo: {

                },
                titleModel: {

                }
            };
            var leftObject = this.GetDomLeftValue();
            var rightObject = this.GetDomRightValue();
            data.leftInfo = leftObject;
            data.rightInfo = rightObject;
            data.titleModel = this.titleText;

            console.log(data);

            this.$axios.post('/api/Groups/ExportGroupCostExcelFile', data, {
                headers: {
                    'Authorization': this.token,
                }
            }).then(resp => {
                console.log(resp, '------------------------------------');
                if (resp.data.code == 200) {
                    var file = resp.data.data;
                    that.fileDownload(file.data, file.strFileName);
                } else {
                    that.$message.error('操作失败！' + resp.data.msg);
                }
            })


        },
        GetDomLeftValue() {
            var AllResult = [];
            var boxDoms = document.querySelectorAll(".sheet-box .biaoge");
            var titleClassName = 'el-table__header-wrapper';
            var bodyClassName = 'el-table__body-wrapper';
            var result = [];
            for (var i = 0; i < boxDoms.length; i++) {
                var chiBoxs = boxDoms[i].children[0].children;
                var info = {};
                info.index = i;
                for (var j = 0; j < chiBoxs.length; j++) {
                    if (chiBoxs[j].className.indexOf(titleClassName) != -1) {
                        info.title = chiBoxs[j].querySelectorAll('thead tr th')[0].innerText;
                    } else if (chiBoxs[j].className.indexOf(bodyClassName) != -1) {
                        var title = info.title;
                        if (title.indexOf('酒店') != -1 || title.indexOf('地接') != -1 || title.indexOf('公务单人') != -1 || title.indexOf('零用金') != -1) {
                            info.cb = chiBoxs[j].querySelectorAll('tbody tr td')[0].querySelector('span') ? chiBoxs[j].querySelectorAll('tbody tr td')[0].querySelector('span').innerText : '0';
                        } else {
                            info.cb = chiBoxs[j].querySelectorAll('tbody tr td')[0].querySelector('input') ? chiBoxs[j].querySelectorAll('tbody tr td')[0].querySelector('input').value : '0';
                        }
                        info.rs = chiBoxs[j].querySelectorAll('tbody tr td')[1].querySelector('input') ? chiBoxs[j].querySelectorAll('tbody tr td')[1].querySelector('input').value : '0';
                        info.xs = chiBoxs[j].querySelectorAll('tbody tr td')[2].querySelector('input') ? chiBoxs[j].querySelectorAll('tbody tr td')[2].querySelector('input').value : '0';
                    }
                }
                result.push(info)
            }
            AllResult.push({ type: "A", leftinfoNumber: result })

            if (this.costTypevalue == 'B') {
                var boxDoms = document.querySelectorAll(".sheet-box .biaogeB");
                var result = [];
                for (var i = 0; i < boxDoms.length; i++) {
                    var chiBoxs = boxDoms[i].children[0].children;
                    var info = {};
                    info.index = i;
                    for (var j = 0; j < chiBoxs.length; j++) {
                        if (chiBoxs[j].className.indexOf(titleClassName) != -1) {
                            info.title = chiBoxs[j].querySelectorAll('thead tr th')[0].innerText;
                        } else if (chiBoxs[j].className.indexOf(bodyClassName) != -1) {
                            var title = info.title;
                            if (title.indexOf('酒店') != -1 || title.indexOf('地接') != -1 || title.indexOf('公务单人') != -1 || title.indexOf('零用金') != -1) {
                                info.cb = chiBoxs[j].querySelectorAll('tbody tr td')[0].querySelector('span') ? chiBoxs[j].querySelectorAll('tbody tr td')[0].querySelector('span').innerText : '0';
                            } else {
                                info.cb = chiBoxs[j].querySelectorAll('tbody tr td')[0].querySelector('input') ? chiBoxs[j].querySelectorAll('tbody tr td')[0].querySelector('input').value : '0';
                            }
                            info.rs = chiBoxs[j].querySelectorAll('tbody tr td')[1].querySelector('input') ? chiBoxs[j].querySelectorAll('tbody tr td')[1].querySelector('input').value : '0';
                            info.xs = chiBoxs[j].querySelectorAll('tbody tr td')[2].querySelector('input') ? chiBoxs[j].querySelectorAll('tbody tr td')[2].querySelector('input').value : '0';
                        }
                    }
                    result.push(info)
                }
                AllResult.push({ type: "B", leftinfoNumber: result })
            }

            return AllResult;
        },
        GetDomRightValue() {
            var AllResult = [];
            var boxDoms = document.querySelectorAll(".cabin-li .biaoge");
            var titleClassName = 'el-table__header-wrapper';
            var bodyClassName = 'el-table__body-wrapper';
            var result = [];
            for (var i = 0; i < boxDoms.length - 1; i++) {
                var chiBoxs = boxDoms[i].children[1].children;
                var info = {};
                info.index = i;
                for (var j = 0; j < chiBoxs.length; j++) {
                    if (chiBoxs[j].className.indexOf(titleClassName) != -1) {
                        info.title = boxDoms[i].children[0].innerText + chiBoxs[j].querySelectorAll('thead tr th')[0].innerText;
                    } else if (chiBoxs[j].className.indexOf(bodyClassName) != -1) {
                        info.cb = chiBoxs[j].querySelectorAll('tbody tr td')[0].querySelector('span') ? chiBoxs[j].querySelectorAll('tbody tr td')[0].querySelector('span').innerText : '0';
                        info.rs = chiBoxs[j].querySelectorAll('tbody tr td')[1].querySelector('input') ? chiBoxs[j].querySelectorAll('tbody tr td')[1].querySelector('input').value : '0';
                        info.xs = chiBoxs[j].querySelectorAll('tbody tr td')[2].querySelector('span') ? chiBoxs[j].querySelectorAll('tbody tr td')[2].querySelector('span').innerText : '0';
                        info.bj = chiBoxs[j].querySelectorAll('tbody tr td')[3].querySelector('span') ? chiBoxs[j].querySelectorAll('tbody tr td')[3].querySelector('span').innerText : '0';
                    }
                }
                result.push(info)
            }

            AllResult.push({ type: "A", rightInfoNumber: result })

            if (this.costTypevalue == 'B') {
                var boxDoms = document.querySelectorAll(".cabin-li .biaogeB");
                var result = [];
                for (var i = 0; i < boxDoms.length; i++) {
                    var chiBoxs = boxDoms[i].children[1].children;
                    var info = {};
                    info.index = i;
                    for (var j = 0; j < chiBoxs.length; j++) {
                        if (chiBoxs[j].className.indexOf(titleClassName) != -1) {
                            info.title = boxDoms[i].children[0].innerText + chiBoxs[j].querySelectorAll('thead tr th')[0].innerText;
                        } else if (chiBoxs[j].className.indexOf(bodyClassName) != -1) {
                            info.cb = chiBoxs[j].querySelectorAll('tbody tr td')[0].querySelector('span') ? chiBoxs[j].querySelectorAll('tbody tr td')[0].querySelector('span').innerText : '0';
                            info.rs = chiBoxs[j].querySelectorAll('tbody tr td')[1].querySelector('input') ? chiBoxs[j].querySelectorAll('tbody tr td')[1].querySelector('input').value : '0';
                            info.xs = chiBoxs[j].querySelectorAll('tbody tr td')[2].querySelector('span') ? chiBoxs[j].querySelectorAll('tbody tr td')[2].querySelector('span').innerText : '0';
                            info.bj = chiBoxs[j].querySelectorAll('tbody tr td')[3].querySelector('span') ? chiBoxs[j].querySelectorAll('tbody tr td')[3].querySelector('span').innerText : '0';
                        }
                    }
                    result.push(info)
                }
                AllResult.push({ type: "B", rightInfoNumber: result })
            }



            return AllResult;
        },
        setLastTitle(list) {
            let summaryRow = document.querySelectorAll('.el-table__footer-wrapper .cell');
            for (var i = 0; i < summaryRow.length; i++) {
                let summaryRowOne = summaryRow[i];
                if (summaryRowOne.innerHTML == '总计:' || summaryRowOne.innerHTML == '——') {
                } else {
                    summaryRowOne.setAttribute('title', list[i]);
                }
            }

        },
        GetClientWord() {

            var that = this;
            var data = {
                "diid": this.diid,
                "costType": this.costTypevalue,
                "rate": this.AGroupCostParameter.rate,
                "carGuides1": "",
                "meal": "",
                "subsidizedMeals": "",
                "nightRepair": "",
                "attractionsTickets": "",
                "miscellaneousFees": "",
                "aTip": "",
                "tzZCost": "",
                "leftInfo": '',
            };

            var vehicleResult = this.GetDJLableBJ(this.vehicleLables);
            var DJMealResult = this.GetDJLableBJ(this.DJMeal);
            var SubsidizedMealsResult = this.GetDJLableBJ(this.SubsidizedMeals);
            var NightRepairResult = this.GetDJLableBJ(this.NightRepair);
            var AttractionsTicketsResult = this.GetDJLableBJ(this.AttractionsTickets);
            var DJMealResult = this.GetDJLableBJ(this.DJMeal);
            var ATipResult = this.GetDJLableBJ(this.ATipResult);
            data.leftInfo = this.GetDomLeftValue();
            // vehicleLables: ['VF', 'T/G OF', 'T/G S', 'T/G TF', 'C/F OF'],
            // DJMeal: ['B', 'L', 'D'],
            // SubsidizedMeals: ['T/G M', 'C/F M'],
            // NightRepair: ['T/G A'],
            // AttractionsTickets: ['T/G EF', 'EF'],
            // MiscellaneousFees: ['B/R/F', 'TE', 'T/L F'],
            // ATip: ['T/G T', 'DRV T'],


            if (this.costTypevalue === "B") {

                data.carGuides1 = "RMB A段费用 " + vehicleResult.sum + " B段费用 RMB" + vehicleResult.Bsum;
                data.meal = "RMB A段费用 " + DJMealResult.sum + " B段费用 RMB" + DJMealResult.Bsum;
                data.subsidizedMeals = "RMB A段费用 " + SubsidizedMealsResult.sum + " B段费用 RMB" + SubsidizedMealsResult.Bsum;
                data.nightRepair = "RMB A段费用 " + NightRepairResult.sum + " B段费用 RMB" + NightRepairResult.Bsum;
                data.attractionsTickets = "RMB A段费用 " + AttractionsTicketsResult.sum + " B段费用 RMB" + AttractionsTicketsResult.Bsum;
                data.miscellaneousFees = "RMB A段费用 " + DJMealResult.sum + " B段费用 RMB" + DJMealResult.Bsum;
                data.aTip = "RMB A段费用 " + ATipResult.sum + " B段费用 RMB" + ATipResult.Bsum;

            } else {
                data.carGuides1 = "RMB " + vehicleResult.sum;
                data.meal = "RMB " + DJMealResult.sum;
                data.subsidizedMeals = "RMB " + SubsidizedMealsResult.sum;
                data.nightRepair = "RMB " + NightRepairResult.sum;
                data.attractionsTickets = "RMB " + AttractionsTicketsResult.sum;
                data.miscellaneousFees = "RMB " + DJMealResult.sum;
                data.aTip = "RMB " + ATipResult.sum;
            }

            var cabinDatalLast = this.cabinDatal.filter(function (x) {
                return x.label == '团组预算明细'
            })

            data.tzZCost = cabinDatalLast[0].sheetInfo[0].gtroupQuotes;

            this.$axios.post('/api/Groups/ExportClientWordFile', data, {
                headers: {
                    'Authorization': this.token,
                }
            }).then(resp => {
                console.log(resp, '------------------------------------');
                if (resp.data.code == 200) {
                    var file = resp.data.data;
                    that.fileDownload(file.data, file.strFileName);
                } else {
                    that.$message.error('操作失败！' + resp.data.msg);
                }
            })

        },
        insertRow(index, rowParam, oper) {

            var that = this;
            var row = {
                "diid": this.diid,
                "day": rowParam.day,
                "date": "",
                "itin": "",
                "carType": "",
                "carCost": 0,
                "carNumber": 0,
                "carTiming": 0,
                "tgs": 0,
                "tgwh": 0,
                "tgn": 0,
                "tgof": 0,
                "tgm": 0,
                "tga": 0,
                "tgtf": 0,
                "tgef": 0,
                "cfs": 0,
                "cfm": 0,
                "cfof": 0,
                "b": 0,
                "l": 0,
                "d": 0,
                "tbr": 0,
                "sgr": 0,
                "jS_ES": 0,
                "suite": 0,
                "accon": "",
                "tv": 0,
                "iL": 0,
                "if": 0,
                "ef": 0,
                "b_R_F": 0,
                "te": 0,
                "tgTips": 0,
                "drvTips": 0,
                "pc": 0,
                "tlf": 0,
                "ect": 0,
                "id": 1,
            };

            if (oper == 'UP') {
                if (rowParam.date) {
                    row.date = this.addOneDay(rowParam.date, -1);
                }
                that.tableData.splice(index, 0, row)
            } else {
                if (rowParam.date) {
                    row.date = this.addOneDay(rowParam.date, 1);
                }
                that.tableData.splice(index + 1, 0, row)
            }

            console.log('that.tableData', that.tableData)
            var thisDay = 1;
            for (var i = 0; i < that.tableData.length; i++) {
                console.log("iiiiiiiiiiiiiiii", i, Number(that.tableData.day))
                if (Number(that.tableData[i].day) > 0) {
                    that.tableData[i].day = thisDay;
                    thisDay++;
                }
            }
        },
        Dataformat() {

            var that = this;
            var souer = {
                "diid": this.diid,
                "day": "-",
                "date": "",
                "itin": "",
                "carType": "",
                "carCost": 0,
                "carNumber": 0,
                "carTiming": 0,
                "tgs": 0,
                "tgwh": 0,
                "tgn": 0,
                "tgof": 0,
                "tgm": 0,
                "tga": 0,
                "tgtf": 0,
                "tgef": 0,
                "cfs": 0,
                "cfm": 0,
                "cfof": 0,
                "b": 0,
                "l": 0,
                "d": 0,
                "tbr": 0,
                "sgr": 0,
                "jS_ES": 0,
                "suite": 0,
                "accon": "",
                "tv": 0,
                "iL": 0,
                "if": 0,
                "ef": 0,
                "b_R_F": 0,
                "te": 0,
                "tgTips": 0,
                "drvTips": 0,
                "pc": 0,
                "tlf": 0,
                "ect": 0,
                "id": 1,
            };
            var numberList = [];
            for (var key in souer) {
                if (typeof souer[key] == 'number') {
                    numberList.push(key);
                }
            }

            console.log(numberList, "numberList!");
            console.log(that.tableData, "that.tableData!");
            for (var i = 0; i < that.tableData.length; i++) {
                that.tableData[i].day = that.tableData[i].day.toString();
                for (var j = 0; j < numberList.length; j++) {
                    if (that.tableData[i][numberList[j]] === "") {
                        console.log(i + "行数据异常!", numberList[j]);
                        that.tableData[i][numberList[j]] = 0;
                    }
                }
            }


        },
        dateChange(val, index) {
            const regex = /^[1-9]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/
            if (!regex.test(val)) {
                this.$message.error('日期格式不正确!应该为YYYY-MM-DD格式!');
                this.tableData[index].date = "";
            }

        },
        GetDJLableBJ(lableList) {
            var that = this;
            var result = { sum: 0, Bsum: 0 };
            if (typeof lableList != "object" || lableList['length'] == undefined) {
                return result
            }

            let Djsum = 0;
            let BDjsum = 0;
            for (var i = 0; i < lableList.length; i++) {
                that.sumTopPrice.forEach(function (item1) {
                    if (lableList[i] == item1.label) {
                        var Aprice = Number(item1.Aprice);
                        if (!isNaN(Aprice)) {
                            Djsum += Aprice;
                        }

                        var Bprice = Number(item1.Bprice);
                        if (!isNaN(Bprice)) {
                            BDjsum += Bprice;
                        }
                    }
                })
            }

            Djsum = Djsum * this.AGroupCostParameter.rate * this.AGroupCostParameter.djxs;
            BDjsum = BDjsum * this.AGroupCostParameter.rate * this.BGroupCostParameter.djxs;
            if (isNaN(Djsum)) {
                Djsum = 0;
            }

            if (isNaN(BDjsum)) {
                BDjsum = 0;
            }

            result.sum = Djsum.toFixed(2);
            result.Bsum = BDjsum.toFixed(2);

            return result;
        },
        handleChange(currentValue, oldValue) {
            console.log(currentValue, oldValue);
            if (currentValue == undefined) {

            }
        },
        GetWeek(date) {
            if (date) {
                try {
                    var myDate = new Date(date);
                    var myDay = myDate.getDay();//获取存储当前日期
                    var weekday = ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"];
                    return weekday[myDay];
                } catch (e) {
                    console.log("时间格式不正确！")
                    return "时间格式不正确!";
                }
            }
            return '';
        }

    },
    mounted() {
        this.token = JSON.parse(localStorage.getItem('userinif')).token;
        this.userId = JSON.parse(localStorage.getItem('userinif')).userInfo.userId
        this.loadData(-1);
    },
    computed: {
        defaultCostTypeHotelNumber() {
            const defaultItems = this.costTypeHotelNumbers.filter(item => item.type == 'Default');
            return defaultItems[0];
        },
        filterdialogSearchInput() {
            var that = this;
            return this.dialogTableData.filter(function (x) {
                return x.city.indexOf(that.dialogSearchInput) != -1 || x.country.indexOf(that.dialogSearchInput) != -1;
            })
        },
        columnWidth() {
            if (this.CheckBoxListSelect.filter(item => item.cbType == 'Top')[0].cbValues.length < 15) {
                return ''
            } else {
                return 75
            }
        }
    }
}
</script>
<style>
.cost-box {
    background-color: #fff;
    padding: 10px;
    box-shadow: 0 0 5px #0005;
    border-radius: 10px;
}

.cost-box .el-button+.el-button {
    margin-left: 0;
}

.fade-enter-active,
.fade-leave-active {
    transition: opacity 1;
}

.fade-enter,
.fade-leave-to {
    opacity: 0;
}

.cost-haed {
    margin-bottom: 10px;
}

.ser-btn {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.cost-info {
    display: flex;
}

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

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

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

.cost-box .el-checkbox-group {
    margin: 5px 0;
}

.form-ss .el-checkbox {
    width: 100px;
    margin: 5px 0;
}

.sheet-box {
    margin-top: 30px;
}

.cabin-box {
    margin-top: 30px;
}

.biaoge,
.biaogeB {
    margin-bottom: 30px;
}

.rapAddress {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.cost-box .cabin-box .cost-box .el-checkbox {
    margin-right: 20px;
}

.cost-box .el-table .cell {
    text-align: center;
}

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

.figures-btn .el-button--mini {
    width: 70px;
    margin: 2px 0;
    margin-left: 0;
}

.CostBShow .el-col-3 .el-form-item__content {
    width: 60%;
}

.CostBShow .el-form-item__content {
    width: 60%;
}

.CostBShow .el-date-editor--date {
    width: 100%;
}

.Cost_topFlex .el-select {
    width: 200px;
}

.hiddenElement {
    visibility: hidden;

}

.cost-all .el-table__footer-wrapper .cell {
    white-space: pre;

}

.cost-all .el-date-editor.el-input,
.el-date-editor.el-input__inner {
    width: 100%;
}

.biaogeB .el-table .el-input--small {
    width: 60%;
}

.biaogeKz .el-table .el-input--small {
    width: 60%;
}
</style>