123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452 |
- <template>
- <div v-loading.fullscreen.lock="fullscreenLoading">
- <div class="statistically-all">
- <div class="yeardate">
- <el-date-picker
- value-format="yyyy-MM-dd"
- @change="yearchange"
- style="width:200px;"
- v-model="year"
- type="year"
- placeholder="选择年">
- </el-date-picker>
- </div>
- <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
- <el-tab-pane label="营业额、成本支出、毛利润" name="first">
- <div class="canvas-box">
- <div id="statisticallyone" style="width: 100%;height:400px;"></div>
- <div id="grossmargins" style="width: 100%;height:400px;"></div>
- <div id="grossmargin" style="width: 100%;height:400px;"></div>
- </div>
- </el-tab-pane>
- <el-tab-pane label="团组预算/实际成本" name="fourth">
- <div class="Search-yscb">
- <div class="Search-yscb-ul">
- <label>团组名称:</label>
- <el-input
- size="small "
- placeholder="请输入内容"
- v-model="input"
- clearable>
- </el-input>
- <el-button @click="StatisticsGroupCost" size="small " type="primary">查询</el-button>
- </div>
- </div>
- <div class="fourth-table">
- <el-table
- :data="fourthData"
- border
- style="width: 100%">
- <el-table-column
- prop="rowNumber"
- label="序号"
- width="50">
- </el-table-column>
- <el-table-column
- prop="groupName"
- label="团组名">
- </el-table-column>
- <el-table-column
- prop="clientUnit"
- label="客户单位">
- </el-table-column>
- <el-table-column
- prop="visitDate"
- label="出访日期"
- width="110">
- <template slot-scope="scope">
- {{ cltade(scope.row.visitDate) }}
- </template>
- </el-table-column>
- <el-table-column
- prop="visitDays"
- label="天数"
- width="50">
- </el-table-column>
- <el-table-column
- prop="visitPNumber"
- label="人数"
- width="50">
- </el-table-column>
- <el-table-column
- prop="budgetAmount"
- label="团组预算"
- width="120">
- <template slot-scope="scope">
- {{ townum(scope.row.budgetAmount) }}
- </template>
- </el-table-column>
- <el-table-column
- prop="realityAmount"
- label="团组实际成本"
- width="120">
- <template slot-scope="scope">
- {{ townum(scope.row.realityAmount) }}
- </template>
- </el-table-column>
- <el-table-column
- prop="excessAmount"
- label="实际比预算超出金额"
- width="160">
- <template slot-scope="scope">
- {{ townum(scope.row.excessAmount) }}
- </template>
- </el-table-column>
- <el-table-column
- prop="excessPercentage"
- label="实际比预算超出百分比"
- width="180">
- </el-table-column>
- <el-table-column
- label="详细"
- width="100">
- <template slot-scope="scope">
- <el-popover
- placement="left"
- width="1000"
- trigger="hover">
- <el-table
- height="600"
- :data="scope.row.details"
- border
- style="width: 100%;font-size:12px">
- <el-table-column
- prop="module"
- label="模块"
- width="100">
- </el-table-column>
- <el-table-column
- prop="budgetAmountDesc"
- label="该模块预算"
- width="350">
- </el-table-column>
- <el-table-column
- prop="realityAmountDesc"
- label="实际费用的金额 ">
- </el-table-column>
- </el-table>
- <span style="cursor: pointer;color: #48a2ff;" slot="reference" type="text">移上查看</span>
- </el-popover>
- </template>
- </el-table-column>
- </el-table>
- <div class="block">
- <el-pagination
- @size-change="handleSizeChange"
- @current-change="handleCurrentChange"
- :current-page="fourthcurrentPage"
- :page-sizes="[5, 10, 20, 30]"
- :page-size="fourthPagesize"
- layout="total, sizes, prev, pager, next, jumper"
- :total="fourthtotal">
- </el-pagination>
- </div>
- </div>
- </el-tab-pane>
- <el-tab-pane label="国交数据统计" name="second">
- <el-select style="width:200px; margin-bottom: 10px;" @change="countrieschange" v-model="value" filterable placeholder="请选择">
- <el-option
- v-for="item in options"
- :key="item.value"
- :label="item.label"
- :value="item.value">
- </el-option>
- </el-select>
- <div class="canvas-box">
- <div v-if="value==7" style="width: 100%;">
- <div id="teamCooperationbox" style="width: 100%;height:400px;"></div>
- <div style="display: flex;justify-content: space-between;">
- <div id="groupnumbox" style="width: 50%;height:400px;"></div>
- <div id="customersNumberbox" style="width: 50%;height:400px;"></div>
- </div>
- <div id="scaleDrawingbox" style="width: 50%;height:400px;"></div>
- </div>
- <div v-else-if="value==1" style="width: 100%;">
- <div id="grossmarginss" style="width: 100%;height:400px;"></div>
- <div id="Airticketcitybox" style="width: 100%;height:400px;"></div>
- <div id="AirPredeterminedPlatform" style="width: 100%;height:700px;"></div>
- </div>
- <div v-else-if="value==2" style="width: 100%;">
- <div id="hoteltopten" style="width: 100%;height:400px;"></div>
- <div id="hotelPredeterminedPlatform" style="width: 100%;height:400px;"></div>
- </div>
- <div v-else-if="value==5" style="width: 100%;">
- <div id="invitationtopten" style="width: 100%;height:400px;"></div>
- </div>
- <div v-else-if="value==3" style="width: 100%;text-align: center;">
- <div class="tabletitle">年记录</div>
- <div class="yeartableul">
- <div class="yeartableli">
- <div>年份</div>
- <div>{{TimeProcessingriY(year)}}</div>
- <div>{{(TimeProcessingriY(year))-1}}</div>
- </div>
- <div class="yeartableli" v-for="(item,index) in tableData" :key="index">
- <div>{{item.feeName}}</div>
- <el-popover
- placement="top"
- width="600"
- trigger="hover">
- <!-- <div>
- <div>{{TimeProcessingriY(year)}}年/{{TimeProcessingriY(year)-1}}年{{item.monthName}}{{items.feeName}}增长率:{{items.currPeriodFee}}/{{items.samePeriodFee}}({{items.yoy}} %)</div>
- </div> -->
- <div class="device_err">
- <el-table size="small" :header-cell-style="{color: '#555',fontSize: '14px', backgroundColor: '#f0f9ff'}" border :data="item.subFeeData">
- <el-table-column type="expand">
- <div class="device_err" slot-scope="props">
- <el-table
- size="small"
- height="205"
- :header-cell-style="{color: '#555',fontSize: '14px', backgroundColor: '#f0f9ff'}"
- border
- :data="props.row.cityData"
- style="width: 100%">
- <el-table-column
- prop="cityName"
- label="城市"
- width="100">
- </el-table-column>
- <el-table-column
- label="本年费用"
- width="150">
- <template slot-scope="props">
- {{townum(props.row.currPeriodFee)}}
- </template>
- </el-table-column>
- <el-table-column
- width="150"
- label="前一年费用">
- <template slot-scope="props">
- {{townum(props.row.samePeriodFee)}}
- </template>
- </el-table-column>
- <el-table-column property="yoy" label="增长率">
- <template slot-scope="props">
- {{props.row.yoy}} %
- </template>
- </el-table-column>
- </el-table>
- </div>
- </el-table-column>
- <el-table-column width="150" property="feeName" label="类型"></el-table-column>
- <el-table-column width="150" property="currPeriodFee" label="本年费用">
- <template slot-scope="props">
- {{townum(props.row.currPeriodFee)}}
- </template>
- </el-table-column>
- <el-table-column width="150" property="samePeriodFee" label="前一年费用">
- <template slot-scope="props">
- {{townum(props.row.samePeriodFee)}}
- </template>
- </el-table-column>
- <el-table-column width="99" property="yoy" label="增长率">
- <template slot-scope="props">
- {{props.row.yoy}} %
- </template>
- </el-table-column>
- </el-table>
- </div>
- <div class="hourbox" style="cursor: pointer;" slot="reference">{{townum(item.currPeriodFee)}}</div>
- </el-popover>
- <!-- <div></div> -->
- <div>{{townum(item.samePeriodFee)}}</div>
- </div>
- </div>
- <div class="tabletitle">月记录</div>
- <div class="monthtableul">
- <div class="monthtableli">
- <div class="monthtablebox" v-for="(item,index) in tableheader" :key="index">{{item}}</div>
- </div>
- <div class="monthtableli" v-for="(item,index) in tableDatamonth" :key="index">
- <!-- <div class="monthtablebox" v-for="(item,index) in tableheader" :key="index">{{item}}</div> -->
- <div class="monthtablebox">{{item.monthName}}</div>
- <div class="monthtablebox" v-for="(items,index) in item.feeDatas" :key="index">
- <el-popover
- placement="top"
- width="600"
- trigger="hover">
- <div>
- <div>{{TimeProcessingriY(year)}}年/{{TimeProcessingriY(year)-1}}年{{item.monthName}}{{items.feeName}}增长率:{{items.currPeriodFee}}/{{items.samePeriodFee}}({{items.yoy}} %)</div>
- </div>
- <div class="device_err">
- <el-table size="small" :header-cell-style="{color: '#555',fontSize: '14px', backgroundColor: '#f0f9ff'}" border :data="items.subFeeData">
- <el-table-column type="expand">
- <div class="device_err" slot-scope="props">
- <el-table
- size="small"
- height="205"
- :header-cell-style="{color: '#555',fontSize: '14px', backgroundColor: '#f0f9ff'}"
- border
- :data="props.row.cityData"
- style="width: 100%">
- <el-table-column
- prop="cityName"
- label="城市"
- width="100">
- </el-table-column>
- <el-table-column
- label="本年费用"
- width="150">
- <template slot-scope="props">
- {{townum(props.row.currPeriodFee)}}
- </template>
- </el-table-column>
- <el-table-column
- width="150"
- label="前一年费用">
- <template slot-scope="props">
- {{townum(props.row.samePeriodFee)}}
- </template>
- </el-table-column>
- <el-table-column property="yoy" label="增长率">
- <template slot-scope="props">
- {{props.row.yoy}} %
- </template>
- </el-table-column>
- </el-table>
- </div>
- </el-table-column>
- <el-table-column width="150" property="feeName" label="类型"></el-table-column>
- <el-table-column width="150" property="currPeriodFee" label="本年费用">
- <template slot-scope="props">
- {{townum(props.row.currPeriodFee)}}
- </template>
- </el-table-column>
- <el-table-column width="150" property="samePeriodFee" label="前一年费用">
- <template slot-scope="props">
- {{townum(props.row.samePeriodFee)}}
- </template>
- </el-table-column>
- <el-table-column width="99" property="yoy" label="增长率">
- <template slot-scope="props">
- {{props.row.yoy}} %
- </template>
- </el-table-column>
- </el-table>
- </div>
- <span style="cursor: pointer;" slot="reference">{{items.currPeriodFee}}/{{items.samePeriodFee}}({{items.yoy}} %)</span>
- </el-popover>
-
- </div>
- </div>
- </div>
- <!-- <el-table
- :data="tableData"
- border
- style="width: 100%">
- <el-table-column
- prop="date"
- label="日期"
- width="180">
- </el-table-column>
- <el-table-column
- prop="name"
- label="姓名"
- width="180">
- </el-table-column>
- <el-table-column
- prop="address"
- label="地址">
- </el-table-column>
- </el-table> -->
- </div>
- </div>
- </el-tab-pane>
- <el-tab-pane label="地图" name="fifth">
- <div id="map" style="width:100%; height: 800px;"></div>
- </el-tab-pane>
- <!-- <el-tab-pane label="会务数据统计" name="third">会务数据统计</el-tab-pane> -->
-
-
- </el-tabs>
- </div>
- </div>
- </template>
- <script>
- import { getToken } from 'mapkit-token';
- import * as echarts from 'echarts';
- export default {
- data () {
- return {
- fullscreenLoading:false,
- year:new Date(),
- businessincome:[],
- Grossprofit:[],
- costing:[],
- Airticketnum:[],
- Airticketcity:[],
- AirticketPredetermined:[],
- Hoteltop:[],
- hotelPredetermined:[],
- invitationtop:[],
- teamCooperation:[],
- groupnum:[],
- customersNumber:[],
- scaleDrawing:[],
- aaa:[
- ['product', '去年销售额', '今年销售额'],
- ['1月', 43.3, 85.8],
- ['2月', 83.1, 73.4],
- ['3月', 86.4, 65.2],
- ['4月', 72.4, 53.9],
- ['5月', 72.4, 53.9],
- ['6月', 72.4, 53.9],
- ['7月', 72.4, 53.9],
- ['8月', 72.4, 53.9],
- ['9月', 72.4, 53.9],
- ['10月', 72.4, 53.9],
- ['11月', 72.4, 53.9],
- ['12月', 72.4, 53.9],
- ],
- bbb:[
- ['product', '毛利率',],
- ['1月', 43.3,],
- ['2月', 83.1,],
- ['3月', 86.4,],
- ['4月', 72.4,],
- ['5月', 72.4,],
- ['6月', 72.4,],
- ['7月', 72.4,],
- ['8月', 72.4,],
- ['9月', 72.4,],
- ['10月', 72.4,],
- ['11月', 72.4,],
- ['12月', 72.4,],
- ],
- activeName: 'first',
- options: [{
- value: 1,
- label: '机票'
- }, {
- value: 2,
- label: '酒店'
- }, {
- value: 3,
- label: 'OP'
- }, {
- value: 4,
- label: '签证'
- }, {
- value: 5,
- label: '商邀'
- }, {
- value: 7,
- label: '团组数据'
- }],
- value: 1,
- tableData:[],
- tableDatamonth:[],
- tableheader:['月份','车费','导游费','司机费','小费','接送机费','餐费','住补费','景点费','翻译费','饮料/零食/水果费','其他费用'],
- fourthData:[],
- fourthcurrentPage:1,
- fourthPagesize:10,
- fourthtotal:0,
- input:'',
- map:null
- }
- },
- methods: {
- handleSizeChange(val) {
- this.fourthcurrentPage = 1;
- this.fourthPagesize = val;
- this.StatisticsGroupCost();
- },
- handleCurrentChange(val) {
- this.fourthcurrentPage = val;
- this.StatisticsGroupCost();
- },
- //保留两位小数
- townum(val){
- val=Number(val);
- return val.toFixed(2);
- },
- //保留两位小数
- cltade(val){
- return val.split(" ")[0];
- },
- //日期处理(年)
- TimeProcessingriY(val){
- let datetime=new Date(val)
- let newsyear=datetime.getFullYear();
- // let newsMonth=datetime.getMonth() + 1<10?'0'+(datetime.getMonth() + 1):datetime.getMonth() + 1;
- // let newsday=datetime.getDate()<10?'0'+datetime.getDate():datetime.getDate();
- return newsyear;
- },
- //保留两位小数
- townum(val){
- val=Number(val);
- return val.toFixed(2);
- },
- handleClick(tab, event) {
- if(this.activeName=='first'){
- this.StatisticsYOY()
- }
- if(this.activeName=='second'){
- this.StatisticsAirTicket()
- }
- if (this.activeName=='fourth') {
- this.input='';
- this.StatisticsGroupCost()
- }
- // console.log(tab, event);
- },
- //处理时间
- getdate(val){
- var date=new Date(val);
- var y=date.getFullYear();
- return y
- },
- //团组机票
- groupstatisone(){
- var grossmarginss = echarts.init(document.getElementById('grossmarginss'));
- grossmarginss.setOption({
- title:{
- text: '预订机票数量',
- },
- legend: {},
- tooltip: {
- formatter:function(params){
- var html="该月总次数:"+params.data[1]+"次<br/>";
- for(let i=0;i<params.data[2].length;i++){
- html += '团组:'+params.data[2][i].groupName+' '+'预订机票次数:' +params.data[2][i].quantity+"<br/>";
- }
- return html
- }
- },
- dataset: {
- source: this.Airticketnum
- },
- xAxis: { type: 'category' },
- yAxis: {
- name: '机票数量',
- },
- color:['#2e83d4'],
- series: [{ type: 'bar' }]
- },true);
- var Airticketcitybox = echarts.init(document.getElementById('Airticketcitybox'));
- Airticketcitybox.setOption({
- title:{
- text: '机票到达地数量',
- },
- legend: {},
- tooltip: {
- formatter:function(params){
- var html="该月总次数:"+params.data[1]+"次<br/>";
- for(let i=0;i<params.data[2].length;i++){
- html += '城市:'+params.data[2][i].city+' '+'到此城市次数:' +params.data[2][i].quantity+"<br/>";
- }
- return html
- }
- },
- dataset: {
- source: this.Airticketcity
- },
- xAxis: { type: 'category' },
- yAxis: {
- name: '到达次数',
- },
- color:['#2e83d4'],
- series: [{ type: 'bar' }]
- },true);
- //预定平台
- var AirPredeterminedPlatform = echarts.init(document.getElementById('AirPredeterminedPlatform'));
- AirPredeterminedPlatform.setOption({
- title:{
- text: '机票预订平台排行',
- },
- legend: {},
- tooltip: {
- formatter:function(params){
- var html=params.data[0]+"预订总次数:"+params.data[1]+"次<br/>"
- for(let i=0;i<params.data[2].length;i++){
- html += '团组名称:'+params.data[2][i].groupName+' 次数:'+params.data[2][i].total+",<br/>";
- }
- return html
- }
- },
- dataset: {
- source: this.AirticketPredetermined
- },
- xAxis: {
- type: 'category',
- axisLabel: {
- formatter:function(value){
- value = value.replace(/\s/g,"");
- return value.split("").join("\n");
- } ,
- },
- },
- grid:{
- left: '1%',
- right: '1%',
- bottom: '7%',
- top: '10%',
- containLabel: true
- },
- yAxis: {
- name: '该平台预订次数',
- },
- color:['#2e83d4'],
- series: [{ type: 'bar' }]
- },true);
- },
- //在线引入
- getonline(){
- const oScript = document.createElement('script');
- oScript.type = 'text/javascript';
- oScript.src = 'https://cdn.apple-mapkit.com/mk/5.x.x/mapkit.core.js';
- document.body.appendChild(oScript);
- this.onlinemap();
- },
- //在线地图
- onlinemap(){
- // var token="eyJraWQiOiI1NEIyRkFLODMzIiwidHlwIjoiSldUIiwiYWxnIjoiRVMyNTYifQ.eyJpc3MiOiJIS0YzNzJKU01LIiwiaWF0IjoxNzMzMTkxMzI2LCJvcmlnaW4iOiJvYS5wYW4tYW1lcmljYW4taW50bC5jb20ifQ.1czYQb-Nxh6n4kG9sVylQH32XawN92gBKXjn6i_SU0F2M9fpwbStM-gDRvfANEiEUDz5ogUmm_FQf9eBF8o9Zg";
- // mapkit.init({
- // authorization: token, // 使用获取到的token
- // language: 'zh'
- // });
- // this.map = new mapkit.Map(document.getElementById('map'), {
- // center: new mapkit.Coordinate(37.7749, -122.4194),
- // zoom: 11
- // });
- // const token = mapkitToken.getToken(CLIENT_ID, TEAM_ID, KEY_ID, PRIVATE_KEY);
- // const { getToken } = require('mapkit-token');
- const token = "eyJraWQiOiI1NEIyRkFLODMzIiwidHlwIjoiSldUIiwiYWxnIjoiRVMyNTYifQ.eyJpc3MiOiJIS0YzNzJKU01LIiwiaWF0IjoxNzMzMTkxMzI2LCJvcmlnaW4iOiJvYS5wYW4tYW1lcmljYW4taW50bC5jb20ifQ.1czYQb-Nxh6n4kG9sVylQH32XawN92gBKXjn6i_SU0F2M9fpwbStM-gDRvfANEiEUDz5ogUmm_FQf9eBF8o9Zg";
- mapkit.init({
- language: 'zh-CN',
- authorizationCallback: function(done) {
- done(token);
- }
- });
- var map = new mapkit.Map("map");
- },
- //团组酒店
- grouphotel(){
- var hoteltopten = echarts.init(document.getElementById('hoteltopten'));
- hoteltopten.setOption({
- title:{
- text: '预订酒店前十排行',
- },
- legend: {},
- tooltip: {
- formatter:function(params){
- var html="该城市酒店预订总次数:"+params.data[1]+"次<br/>"
- for(let i=0;i<params.data[2].length;i++){
- html += '酒店名称:'+params.data[2][i].hotelName+', '+'单人间:' +params.data[2][i].singleRoomCount+', '+'双人间:' +params.data[2][i].doubleRoomCount+', '+'套房:' +params.data[2][i].suiteRoomCount+', '+'其他房型:' +params.data[2][i].otherRoomCount+', '+'总房数:' +params.data[2][i].roomTotal+",<br/>";
- }
- return html
- }
- },
- dataset: {
- source: this.Hoteltop
- },
- xAxis: {
- type: 'category' ,
- axisLabel:{
- rotate:30
- },
- },
- yAxis: {
- name: '预订次数',
- },
- color:['#2e83d4'],
- series: [{ type: 'bar' }]
- },true);
- //预定平台
- var hotelPredeterminedPlatform = echarts.init(document.getElementById('hotelPredeterminedPlatform'));
- hotelPredeterminedPlatform.setOption({
- title:{
- text: '预订酒店平台排行',
- },
- legend: {},
- tooltip: {
- formatter:function(params){
- var html="该平台预订总次数:"+params.data[1]+"次<br/>"
- for(let i=0;i<params.data[2].length;i++){
- html += '酒店名称:'+params.data[2][i].hotelName+', '+'单人间:' +params.data[2][i].singleRoomCount+', '+'双人间:' +params.data[2][i].doubleRoomCount+', '+'套房:' +params.data[2][i].suiteRoomCount+', '+'其他房型:' +params.data[2][i].otherRoomCount+', '+'总房数:' +params.data[2][i].roomTotal+",<br/>";
- }
- return html
- }
- },
- dataset: {
- source: this.hotelPredetermined
- },
- xAxis: { type: 'category' },
- yAxis: {
- name: '该平台预订次数',
- },
- color:['#2e83d4'],
- series: [{ type: 'bar' }]
- },true);
- },
- //团组商邀
- groupinvitation(){
- var invitationtopten = echarts.init(document.getElementById('invitationtopten'));
- invitationtopten.setOption({
- title:{
- text: '邀请国家数量排行',
- },
- legend: {},
- tooltip: {
- formatter:function(params){
- var html=params.data[0]+":"+params.data[1]+"次<br/>";
- return html
- }
- },
- dataset: {
- source: this.invitationtop
- },
- xAxis: { type: 'category' },
- yAxis: {
- name: '数量',
- },
- color:['#2e83d4'],
- series: [{ type: 'bar' }]
- },true);
- },
- //团组客户合作
- teamhz(){
- var teamCooperationbox = echarts.init(document.getElementById('teamCooperationbox'));
- teamCooperationbox.setOption({
- title:{
- text: '团组合作客户排行',
- },
- legend: {},
- tooltip: {
- formatter:function(params){
- var html="客户单位:"+params.data[0]+"<br/>"+"客户负责人:"+params.data[2]+"<br/>"+"合作次数:"+params.data[1];
- return html
- }
- },
- dataset: {
- source: this.teamCooperation
- },
- xAxis: { type: 'category' },
- yAxis: {
- name: '次数',
- },
- color:['#2e83d4'],
- series: [{ type: 'bar' }]
- },true);
- },
- //获取团组预算/实际成本
- StatisticsGroupCost(){
- var url = "/api/Statistics/StatisticsGroupCost"
- var that = this
- this.$axios({
- method: 'post',
- url: url,
- headers: {
- Authorization: 'Bearer '
- },
- data:{
- portType:1,
- pageIndex:that.fourthcurrentPage,
- pageSize:that.fourthPagesize,
- year:that.getdate(that.year),
- search:that.input,
- }
- }).then(function (res) {
- if(res.data.code==200){
- that.fourthtotal=res.data.count;
- that.fourthData=res.data.data;
- }else{
- that.$message({
- message: res.data.msg,
- type: 'warning'
- });
- }
- })
- },
- //团组数量
- teamsl(){
- var groupnumbox = echarts.init(document.getElementById('groupnumbox'));
- groupnumbox.setOption({
- title:{
- text: '团组数量统计',
- },
- legend: {},
- tooltip: {},
- dataset: {
- source: this.groupnum
- },
- xAxis: { type: 'category' },
- yAxis: {
- name: '数量',
- },
- color:['#2e83d4'],
- series: [{ type: 'bar' }]
- },true);
- },
- //团组出访人数
- teamrs(){
- var customersNumberbox = echarts.init(document.getElementById('customersNumberbox'));
- customersNumberbox.setOption({
- title:{
- text: '团组出访人数统计',
- },
- legend: {},
- tooltip: {},
- dataset: {
- source: this.customersNumber
- },
- xAxis: { type: 'category' },
- yAxis: {
- name: '人数',
- },
- color:['#2e83d4'],
- series: [{ type: 'bar' }]
- },true);
- },
- //比例图
- teamblt(){
- var scaleDrawingbox = echarts.init(document.getElementById('scaleDrawingbox'));
- scaleDrawingbox.setOption({
- title: {
- text: '客户类型分布表',
- left: 'center'
- },
- tooltip: {
- trigger: 'item'
- },
- series: [
- {
- type: 'pie',
- radius: '50%',
- data: this.scaleDrawing,
- emphasis: {
- itemStyle: {
- shadowBlur: this.scaleDrawing.length,
- shadowOffsetX: 0,
- shadowColor: 'rgba(0, 0, 0, 0.5)'
- }
- }
- }
- ]
- },true);
- },
- statisone(){
- var myChart = echarts.init(document.getElementById('statisticallyone'));
- myChart.setOption({
- title:{
- text: '业务总营业额',
- },
- legend: {},
- tooltip: {},
- dataset: {
- source: this.businessincome
- },
- xAxis: { type: 'category' },
- yAxis: {
- name: '营业额',
- },
- series: [{ type: 'bar' }, { type: 'bar' },]
- },true);
- var grossmargins = echarts.init(document.getElementById('grossmargins'));
- grossmargins.setOption({
- title:{
- text: '成本',
- },
- legend: {},
- tooltip: {},
- dataset: {
- source: this.costing
- },
- xAxis: { type: 'category' },
- yAxis: {
- name: '成本额',
- },
- series: [{ type: 'bar' }, { type: 'bar' },]
- },true);
- var grossmargin = echarts.init(document.getElementById('grossmargin'));
- grossmargin.setOption({
- title:{
- text: '毛利润',
- },
- legend: {},
- tooltip: {
- // formatter:function(params){
- // console.log(params);
- // var html = params.data[0]+'毛利率'+"<br/>"+ params.data[1]+"%";
- // return html
- // }
- },
- dataset: {
- source: this.Grossprofit
- },
- xAxis: { type: 'category' },
- yAxis: {
- name: '毛利额',
- },
- color:['#EEAD0E','#a0a7e6'],
- // Declare several bar series, each will be mapped
- // to a column of dataset.source by default.
- series: [{ type: 'bar' },{ type: 'bar' }]
- },true);
- },
- //年change
- yearchange(){
- if(this.activeName=='first'){
- this.StatisticsYOY();
- }
- if(this.activeName=='second'){
- this.countrieschange(this.value);
- }
- if (this.activeName=='fourth') {
- this.input='';
- this.StatisticsGroupCost()
- }
- // this.businessincome=[];
- // this.Grossprofit=[];
- // this.costing=[];
-
- },
- //国交部分类型切换
- countrieschange(val){
- if(document.getElementById('grossmarginss')!=null){
- echarts.init(document.getElementById('grossmarginss')).dispose();
- echarts.init(document.getElementById('Airticketcitybox')).dispose();
- echarts.init(document.getElementById('AirPredeterminedPlatform')).dispose();
- }
- if(document.getElementById('teamCooperationbox')!=null){
- echarts.init(document.getElementById('teamCooperationbox')).dispose();
- echarts.init(document.getElementById('groupnumbox')).dispose();
- echarts.init(document.getElementById('customersNumberbox')).dispose();
- echarts.init(document.getElementById('scaleDrawingbox')).dispose();
- }
- if(document.getElementById('hoteltopten')!=null){
- echarts.init(document.getElementById('hoteltopten')).dispose();
- echarts.init(document.getElementById('hotelPredeterminedPlatform')).dispose();
- }
- if(document.getElementById('invitationtopten')!=null){
- echarts.init(document.getElementById('invitationtopten')).dispose();
- }
- if(val==1){
- this.StatisticsAirTicket();
- }
- if(val==2){
- this.StatisticsHotel();
- }
- if(val==5){
- this.StatisticsInvitation();
- }
- if (val==7) {
- this.StatisticsCooperativeCustomer();
- this.StatisticsCooperativeCustomerType();
- this.StatisticsGroupNum();
- this.StatisticsGroupPeopleNum();
- }
- if(val==3){
- this.StatisticsOP(1);
- }
- },
- //获取营业额、成本支出、毛利润数据
- StatisticsYOY(){
- var url = "/api/Statistics/StatisticsYOY"
- var that = this
- this.$axios({
- method: 'post',
- url: url,
- headers: {
- Authorization: 'Bearer '
- },
- data:{
- year:that.getdate(that.year),
- }
- }).then(function (res) {
- if(res.data.code==200){
- that.businessincome=[];
- that.Grossprofit=[];
- that.costing=[];
- //营业额
- that.businessincome.push(['product', '前一年该月营业额', '本年该月营业额']);
- for(let i=0;i<res.data.data.salesYOYData.length;i++){
- that.businessincome.push([res.data.data.salesYOYData[i].month+'月',res.data.data.salesYOYData[i].lastAmount,res.data.data.salesYOYData[i].thisAmount]);
- }
- //毛利润
- that.Grossprofit.push(['product', '前一年该月毛利润', '本年该月毛利润']);
- for(let j=0;j<res.data.data.grossProfitYOYData.length;j++){
- that.Grossprofit.push([res.data.data.grossProfitYOYData[j].month+'月',res.data.data.grossProfitYOYData[j].lastAmount,res.data.data.grossProfitYOYData[j].thisAmount]);
- }
- //成本
- that.costing.push(['product', '前一年该月成本', '本年该月成本']);
- for(let g=0;g<res.data.data.costYOYData.length;g++){
- that.costing.push([res.data.data.costYOYData[g].month+'月',res.data.data.costYOYData[g].lastAmount,res.data.data.costYOYData[g].thisAmount]);
- }
- that.statisone()
- }else{
- that.$message({
- message: res.data.msg,
- type: 'warning'
- });
- }
- })
- },
- //获取国交数据统计数据机票
- StatisticsAirTicket(){
- var url = "/api/Statistics/StatisticsAirTicket"
- var that = this
- this.$axios({
- method: 'post',
- url: url,
- headers: {
- Authorization: 'Bearer '
- },
- data:{
- year:that.getdate(that.year),
- }
- }).then(function (res) {
- if(res.data.code==200){
- that.Airticketnum=[];
- that.Airticketcity=[];
- that.Airticketpred=[];
- var datainfo=res.data.data;
- //机票数
- that.Airticketnum.push(['product','本年机票数量']);
- for(let i=0;i<datainfo.airTicketNumData.length;i++){
- that.Airticketnum.push([datainfo.airTicketNumData[i].month+'月',datainfo.airTicketNumData[i].quantity,datainfo.airTicketNumData[i].aitTicketInfos]);
- }
- //机票到达地
- that.Airticketcity.push(['product','本年机票到达地']);
- for(let i=0;i<datainfo.airTicketAreaData.length;i++){
- that.Airticketcity.push([datainfo.airTicketAreaData[i].month+'月',datainfo.airTicketAreaData[i].quantity,datainfo.airTicketAreaData[i].cityData]);
- }
- //机票预订平台
- that.AirticketPredetermined.push(['product','机票预订平台排行榜']);
- for(let i=0;i<datainfo.airTicketPlatformData.length;i++){
- that.AirticketPredetermined.push([datainfo.airTicketPlatformData[i].platform,datainfo.airTicketPlatformData[i].total,datainfo.airTicketPlatformData[i].children]);
- }
- that.groupstatisone()
- }else{
- that.$message({
- message: res.data.msg,
- type: 'warning'
- });
- }
- })
- },
- //获取国交数据统计数据酒店
- StatisticsHotel(){
- var url = "/api/Statistics/StatisticsHotel"
- var that = this
- this.$axios({
- method: 'post',
- url: url,
- headers: {
- Authorization: 'Bearer '
- },
- data:{
- year:that.getdate(that.year),
- }
- }).then(function (res) {
- if(res.data.code==200){
- that.Hoteltop=[];
- that.hotelPredetermined=[];
- var datainfo=res.data.data.hotelCityData;
- var hotelpred=res.data.data.hotelPlatformData
- //酒店预订数
- that.Hoteltop.push(['product','城市酒店预订排行榜']);
- for(let i=0;i<datainfo.length;i++){
- that.Hoteltop.push([datainfo[i].city,datainfo[i].bookingRoomNum,datainfo[i].hotelData]);
- }
- //酒店预订平台
- that.hotelPredetermined.push(['product','酒店预订平台排行榜']);
- for(let k=0;k<hotelpred.length;k++){
- that.hotelPredetermined.push([hotelpred[k].platform,hotelpred[k].bookingRoomNum,hotelpred[k].hotelData]);
- }
- that.grouphotel()
- }else{
- that.$message({
- message: res.data.msg,
- type: 'warning'
- });
- }
- })
- },
- //获取国交数据统计数据商邀
- StatisticsInvitation(){
- var url = "/api/Statistics/StatisticsInvitation"
- var that = this
- this.$axios({
- method: 'post',
- url: url,
- headers: {
- Authorization: 'Bearer '
- },
- data:{
- year:that.getdate(that.year),
- }
- }).then(function (res) {
- if(res.data.code==200){
- that.invitationtop=[];
- let datainfo=res.data.data;
- that.invitationtop.push(['product','商邀邀请国家数量']);
- for(let i=0;i<datainfo.length;i++){
- that.invitationtop.push([datainfo[i].country,datainfo[i].timeNum]);
- }
- that.groupinvitation()
- }else{
- that.$message({
- message: res.data.msg,
- type: 'warning'
- });
- }
- })
- },
- //获取国交数据统计数据团组合作
- StatisticsCooperativeCustomer(){
- var url = "/api/Statistics/StatisticsCooperativeCustomer"
- var that = this
- this.$axios({
- method: 'post',
- url: url,
- headers: {
- Authorization: 'Bearer '
- },
- data:{
- year:that.getdate(that.year),
- }
- }).then(function (res) {
- if(res.data.code==200){
- that.teamCooperation=[];
- let datainfo=res.data.data;
- that.teamCooperation.push(['product','团组合作前十的客户']);
- for(let i=0;i<datainfo.length;i++){
- that.teamCooperation.push([datainfo[i].clientUnit,datainfo[i].visitsNum,datainfo[i].clienName]);
- }
- that.teamhz()
- }else{
- that.$message({
- message: res.data.msg,
- type: 'warning'
- });
- }
- })
- },
- //获取国交数据统计数据团组数量
- StatisticsGroupNum(){
- var url = "/api/Statistics/StatisticsGroupNum"
- var that = this
- this.$axios({
- method: 'post',
- url: url,
- headers: {
- Authorization: 'Bearer '
- },
- data:{
- year:that.getdate(that.year),
- }
- }).then(function (res) {
- if(res.data.code==200){
- that.groupnum=[];
- let datainfo=res.data.data;
- that.groupnum.push(['product',datainfo.yearData.yearName+'团组数量']);
- for(let i=0;i<datainfo.quarterData.length;i++){
- that.groupnum.push([datainfo.quarterData[i].quarterName,datainfo.quarterData[i].num]);
- }
- that.teamsl();
- }else{
- that.$message({
- message: res.data.msg,
- type: 'warning'
- });
- }
- })
- },
- //获取会务数据统计
- StatisticsConferenceCity(){
- var url = "/api/Statistics/StatisticsConferenceCity"
- var that = this
- this.$axios({
- method: 'post',
- url: url,
- headers: {
- Authorization: 'Bearer '
- },
- data:{
- year:that.getdate(that.year),
- }
- }).then(function (res) {
- if(res.data.code==200){
- // that.customersNumber=[];
- // let datainfo=res.data.data;
- // that.customersNumber.push(['product',datainfo.yearData.yearName+'出访人数']);
- // for(let i=0;i<datainfo.quarterData.length;i++){
- // that.customersNumber.push([datainfo.quarterData[i].quarterName,datainfo.quarterData[i].num]);
- // }
- // that.teamrs();
- }else{
- that.$message({
- message: res.data.msg,
- type: 'warning'
- });
- }
- })
- },
- //获取国交数据统计数据出访人数
- StatisticsGroupPeopleNum(){
- var url = "/api/Statistics/StatisticsGroupPeopleNum"
- var that = this
- this.$axios({
- method: 'post',
- url: url,
- headers: {
- Authorization: 'Bearer '
- },
- data:{
- year:that.getdate(that.year),
- }
- }).then(function (res) {
- if(res.data.code==200){
- that.customersNumber=[];
- let datainfo=res.data.data;
- that.customersNumber.push(['product',datainfo.yearData.yearName+'出访人数']);
- for(let i=0;i<datainfo.quarterData.length;i++){
- that.customersNumber.push([datainfo.quarterData[i].quarterName,datainfo.quarterData[i].num]);
- }
- that.teamrs();
- }else{
- that.$message({
- message: res.data.msg,
- type: 'warning'
- });
- }
- })
- },
- //获取国交数据统计数据类型比例图
- StatisticsCooperativeCustomerType(){
- var url = "/api/Statistics/StatisticsCooperativeCustomerType"
- var that = this
- this.$axios({
- method: 'post',
- url: url,
- headers: {
- Authorization: 'Bearer '
- },
- data:{
- year:that.getdate(that.year),
- }
- }).then(function (res) {
- if(res.data.code==200){
- that.scaleDrawing=[];
- var newArr = res.data.data.map(item => ({
- name: item.groupTypeName,
- value: item.groupNum
- }))
- that.scaleDrawing=newArr;
- that.teamblt();
- }else{
- that.$message({
- message: res.data.msg,
- type: 'warning'
- });
- }
- })
- },
- //获取国交数据统计数据OP(年)
- StatisticsOP(val){
- this.fullscreenLoading=true;
- var url = "/api/Statistics/StatisticsOP"
- var that = this
- this.$axios({
- method: 'post',
- url: url,
- headers: {
- Authorization: 'Bearer '
- },
- data:{
- year:that.getdate(that.year),
- type:val
- }
- }).then(function (res) {
- if(res.data.code==200){
- that.tableData=[];
- that.tableData=res.data.data;
- that.StatisticsOPmonth(2);
- }else{
- that.fullscreenLoading=false;
- that.$message({
- message: res.data.msg,
- type: 'warning'
- });
- }
- })
- },
- //获取国交数据统计数据OP(月)
- StatisticsOPmonth(val){
- var url = "/api/Statistics/StatisticsOP"
- var that = this
- this.$axios({
- method: 'post',
- url: url,
- headers: {
- Authorization: 'Bearer '
- },
- data:{
- year:that.getdate(that.year),
- type:val
- }
- }).then(function (res) {
- if(res.data.code==200){
- that.tableDatamonth=[];
- that.tableDatamonth=res.data.data;
- that.fullscreenLoading=false;
- }else{
- that.fullscreenLoading=false;
- that.$message({
- message: res.data.msg,
- type: 'warning'
- });
- }
- })
- },
- },
- watch:{
- invitationtop:{
- handler(val,oldval){
- // this.groupinvitation()
- },
- deep:true
- },
- },
- mounted(){
- this.getonline();
-
- this.StatisticsYOY();
- // this.countrieschange(this.value);
- // this.StatisticsOP(1);
- // this.StatisticsAirTicket();
- // this.StatisticsHotel();
- // this.StatisticsInvitation();
- }
- }
- </script>
- <style>
- .statistically-all{
- background-color: #fff;
- padding: 10px;
- box-shadow: 0 0 5px #0005;
- border-radius: 10px;
- height: 100%;
- min-height: 830px;
- }
- .canvas-box{
- display: flex;
- flex-wrap: wrap;
- }
- .yeardate{
- margin-bottom: 10px;
- }
- .yeartableul{
- width: 99.9%;
- margin-bottom: 20px;
- display: inline-flex;
- border: 1px solid #E4E7ED;
- }
- .yeartableli{
- width: 8.33%;
- text-align: center;
- }
- .yeartableli div{
- color: #555;
- font-size: 12px;
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- padding: 8px;
- }
- .yeartableli div{
- border-top: 1px solid #E4E7ED;
- border-left: 1px solid #E4E7ED;
- background-color: #fbfcff;
- }
- .canvas-box .yeartableli .hourbox{
- border-top: 1px solid #E4E7ED;
- border-left: 1px solid #E4E7ED;
- background-color: #fbfcff;
- font-weight:400 ;
- }
- .yeartableli div:nth-child(1){
- border-top:none;
- background-color: #f0f9ff;
- color: #555;
- font-weight: 600;
- }
- .yeartableli:nth-child(1) div{
- border-left: none;
- }
- .monthtableul{
- margin-bottom: 500px;
- }
- .monthtableli{
- background-color: #fbfcff;
- }
- .canvas-box .monthtableli:nth-child(1){
- background-color: #f0f9ff;
- color: #555;
- font-weight: 600;
- }
- .monthtableli{
- font-size: 12px;
- display: flex;
- }
- .monthtableli:nth-last-child(1){
- border-bottom: 1px solid #E4E7ED;
- }
- .monthtablebox{
- width: 8.3%;
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- padding: 8px;
- border-top: 1px solid #E4E7ED;
- border-left: 1px solid #E4E7ED;
- }
- .monthtablebox:nth-last-child(1){
- border-right: 1px solid #E4E7ED;
- }
- .tabletitle{
- font-size: 17px;
- font-weight: 600;
- color: #555;
- margin-bottom:15px ;
- }
- /*设置table表格中每行的背景色 及 显示的字体颜色*/
- .device_err .el-table tr {
- background-color: #fbfcff !important;
- font-weight: bold;
-
- }
- .el-table td.el-table__cell div{
- text-align: center !important;
- }
- .el-table th.el-table__cell>.cell{
- text-align: center !important;
- }
- .statistically-all .block{
- margin-top: 10px;
- text-align: center;
- }
- .Search-yscb-ul{
- display: flex;
- align-items: center;
- margin-bottom: 10px;
- }
- .Search-yscb-ul label{
- width: 70px;
- }
- .Search-yscb-ul .el-input{
- width: 200px;
- margin-right: 10px;
- }
- </style>
|