| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487 |
- <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: 700px;"></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()
- }
- if (this.activeName=='fifth') {
- this.getonline();
- }
- // 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-Hans',
- authorizationCallback: function(done) {
- done(token);
- }
- });
- // var map = new mapkit.Map('map', { center: new mapkit.Coordinate(104.096488, 30.635261) });
- // const coordinate = new mapkit.Coordinate(104.096488, 30.635261)
- // const map = new mapkit.Map("map", {
- // center: coordinate,
- // countryCode: "CN",
- // isZoomEnabled:true,
- // })
- let map = new mapkit.Map("map", {
- center: new mapkit.Coordinate(104.096488, 30.635261),
- showsMapTypeControl: true,
- showsZoomControl: true,
- zoomEnabled: true,
- region: new mapkit.CoordinateRegion(
- new mapkit.Coordinate(104.096488, 30.635261),
- new mapkit.CoordinateSpan(0.01, 0.01)
- )
- });
- // let overlay = new mapkit.MapOverlay(map.region, {
- // urlTemplate: "https://example.com/overlay/{x}/{y}/{z}.png"
- // });
- // map.addOverlay(overlay);
-
- },
- //团组酒店
- 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',
- axisLabel:{
- rotate:30
- },
- },
- 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',
- axisLabel:{
- rotate:25
- },
- },
- 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()
- }
- if (this.activeName=='fifth') {
- this.getonline();
- }
- // 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.groupByCountry;
- 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.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>
|