Commit e9cc0ba7 authored by youjie's avatar youjie

统计数据导出

parent d7088084
......@@ -365,6 +365,12 @@ var commonUtils = {
//返回年月日
return myDate.getFullYear() + '-' + parseInt(myDate.getMonth() + 1) + "-" + myDate.getDate()
},
//格式化日期
getFormatDateM(dateStr) {
var myDate = new Date(dateStr);
//返回年月
return myDate.getFullYear() + '-' + parseInt(myDate.getMonth() + 1)
},
//判断字符串是否为数字
isNumber: function (val) {
var regPos = /^\d+(\.\d+)?$/; //非负浮点数
......
<template>
<div style="margin-bottom: 20px; ">
<h3 class="text-center" style="margin-bottom: 5px;">公司统计</h3>
<el-table
:data="BranchAnalysisData"
style="width: 100%;"
class="LineAnalysisDataBJ"
height="600">
<el-table-column
fixed
align="center"
prop="Name"
label="机构名称"
width="150">
</el-table-column>
<el-table-column align="center" :label="title" v-for="(title,i) in MonthList">
<el-table-column
prop=""
label="收入"
min-width="120" align="center">
<template slot-scope="scope">
{{scope.row.DetailList[i].Income.toFixed(2)}}
</template>
</el-table-column>
<el-table-column
prop=""
label="占比"
min-width="120" align="center">
<template slot-scope="scope">
{{scope.row.DetailList[i].IncomeRate}}%
</template>
</el-table-column>
<el-table-column
prop=""
label="毛利"
min-width="120" align="center">
<template slot-scope="scope">
{{scope.row.DetailList[i].MaoLi.toFixed(2)}}
</template>
</el-table-column>
<el-table-column
prop=""
label="毛利率"
min-width="120" align="center">
<template slot-scope="scope">
{{scope.row.DetailList[i].MaoLiRate}}%
</template>
</el-table-column>
<el-table-column
prop=""
label="实际利润"
min-width="120" align="center">
<template slot-scope="scope">
{{scope.row.DetailList[i].Profit.toFixed(2)}}
</template>
</el-table-column>
<el-table-column
prop=""
label="实际利率"
min-width="120" align="center">
<template slot-scope="scope">
{{scope.row.DetailList[i].ProfitRate}}%
</template>
</el-table-column>
</el-table-column>
</el-table>
</div>
</template>
<script>
export default {
props:['StatisticalData'],
data() {
return {
MonthList: [],//月份列表
BranchAnalysisData: [],
}
},
mounted() {
},
methods: {
},
watch: {
StatisticalData:{
handler(n,o){
this.MonthList = n.MonthList//月份列表
this.BranchAnalysisData = n.BranchAnalysisData
},
deep: true,
immediate: false,
}
},
}
</script>
<style scoped>
/deep/.LineAnalysisDataBJ tr td:nth-child(1n){
background: #F5F7FA;
}
/deep/.LineAnalysisDataBJ tr td:nth-child(2n){
background: #fff;
}
/deep/.LineAnalysisDataBJ tr th{
background: #F5F7FA;
}
/deep/.el-table.LineAnalysisDataBJ tr:first-child th:first-child{
background: #F5F7FA;
}
/deep/.el-table.LineAnalysisDataBJ tr:nth-child(2) th:nth-child(1n){
/* background: #fff; */
}
/deep/.el-table.LineAnalysisDataBJ tr:nth-child(2) th:nth-child(2n){
background: #F5F7FA;
}
/deep/.el-table.LineAnalysisDataBJ tr:first-child th{
background: #fff;
}
/deep/.el-table.LineAnalysisDataBJ2 tr:first-child th:nth-child(1n){
background: #F5F7FA;
}
/deep/.el-table.LineAnalysisDataBJ2 tr:first-child th:nth-child(2n){
background: #fff;
}
</style>
<template>
<div style="margin-bottom: 20px;">
<h3 class="text-center" style="margin-bottom: 5px;">线路统计</h3>
<el-table
:data="LineAnalysisData"
style="width: 100%"
class="LineAnalysisDataBJ"
height="450">
<el-table-column
fixed
align="center"
prop="Name"
label="线路"
width="150">
</el-table-column>
<el-table-column align="center" :label="title" v-for="(title,i) in MonthList">
<el-table-column
prop=""
label="收入"
min-width="120" align="center">
<!-- <template slot="header" slot-scope="scope">
收入
<el-tooltip class="item" effect="dark" content="收入=实收-退款" placement="right-end">
<i class="el-icon-warning-outline"></i>
</el-tooltip>
</template> -->
<template slot-scope="scope">
{{scope.row.DetailList[i].Income.toFixed(2)}}
</template>
</el-table-column>
<el-table-column
prop=""
label="占比"
min-width="120" align="center">
<template slot-scope="scope">
{{scope.row.DetailList[i].IncomeRate}}%
</template>
</el-table-column>
<el-table-column
prop=""
label="毛利"
min-width="120" align="center">
<template slot-scope="scope">
{{scope.row.DetailList[i].MaoLi.toFixed(2)}}
</template>
</el-table-column>
<el-table-column
prop=""
label="毛利率"
min-width="120" align="center">
<template slot-scope="scope">
{{scope.row.DetailList[i].MaoLiRate}}%
</template>
</el-table-column>
<el-table-column
prop=""
label="实际利润"
min-width="120" align="center">
<template slot-scope="scope">
{{scope.row.DetailList[i].Profit.toFixed(2)}}
</template>
</el-table-column>
<el-table-column
prop=""
label="实际利率"
min-width="120" align="center">
<template slot-scope="scope">
{{scope.row.DetailList[i].ProfitRate}}%
</template>
</el-table-column>
</el-table-column>
</el-table>
<h3 class="text-center" style="margin-top: 15px;margin-bottom: 5px;">成本统计</h3>
<el-table
:data="CostAnalysisData"
style="width: 100%"
class="LineAnalysisDataBJ LineAnalysisDataBJ2" border>
<el-table-column
fixed
prop=""
label="日期"
min-width="120" align="center">
<template slot-scope="scope">
{{scope.row.Month}}
</template>
</el-table-column>
<el-table-column
prop=""
label="机票款"
min-width="120" align="center">
<template slot-scope="scope">
{{scope.row.JiPiao.toFixed(2)}}
</template>
</el-table-column>
<el-table-column
prop=""
label="机票/收入"
min-width="120" align="center">
<template slot-scope="scope">
{{scope.row.JiPiaoRate}}%
</template>
</el-table-column>
<el-table-column
prop=""
label="房费"
min-width="120" align="center">
<template slot-scope="scope">
{{scope.row.RoomFee.toFixed(2)}}
</template>
</el-table-column>
<el-table-column
prop=""
label="房费/收入"
min-width="120" align="center">
<template slot-scope="scope">
{{scope.row.RommFeeRate}}%
</template>
</el-table-column>
<el-table-column
prop=""
label="车费"
min-width="120" align="center">
<template slot-scope="scope">
{{scope.row.CarFee.toFixed(2)}}
</template>
</el-table-column>
<el-table-column
prop=""
label="车费/收入"
min-width="120" align="center">
<template slot-scope="scope">
{{scope.row.CarFeeRate}}%
</template>
</el-table-column>
<el-table-column
prop=""
label="餐费"
min-width="120" align="center">
<template slot-scope="scope">
{{scope.row.MealFee.toFixed(2)}}
</template>
</el-table-column>
<el-table-column
prop=""
label="餐费/收入"
min-width="120" align="center">
<template slot-scope="scope">
{{scope.row.MealFeeRate}}%
</template>
</el-table-column>
<el-table-column
prop=""
label="门票"
min-width="120" align="center">
<template slot-scope="scope">
{{scope.row.TicketFee.toFixed(2)}}
</template>
</el-table-column>
<el-table-column
prop=""
label="门票/收入"
min-width="120" align="center">
<template slot-scope="scope">
{{scope.row.TicketFeeRate}}%
</template>
</el-table-column>
<el-table-column
prop=""
label="签证"
min-width="120" align="center">
<template slot-scope="scope">
{{scope.row.VisaFee.toFixed(2)}}
</template>
</el-table-column>
<el-table-column
prop=""
label="签证/收入"
min-width="120" align="center">
<template slot-scope="scope">
{{scope.row.VisaFeeRate}}%
</template>
</el-table-column>
</el-table>
</div>
</template>
<script>
export default {
props:['StatisticalData'],
data() {
return {
MonthList: [],//月份列表
LineAnalysisData: [],//各线路统计
CostAnalysisData: [],//各成本统计
}
},
mounted() {
},
methods: {
},
watch: {
StatisticalData:{
handler(n,o){
this.MonthList = n.MonthList//月份列表
this.LineAnalysisData = n.LineAnalysisData//各线路统计
this.CostAnalysisData = n.CostAnalysisData//各成本统计
},
deep: true,
immediate: false,
}
},
}
</script>
<style scoped>
/deep/.LineAnalysisDataBJ tr td:nth-child(1n){
background: #F5F7FA;
}
/deep/.LineAnalysisDataBJ tr td:nth-child(2n){
background: #fff;
}
/deep/.LineAnalysisDataBJ tr th{
background: #F5F7FA;
}
/deep/.el-table.LineAnalysisDataBJ tr:first-child th:first-child{
background: #F5F7FA;
}
/deep/.el-table.LineAnalysisDataBJ tr:nth-child(2) th:nth-child(1n){
/* background: #fff; */
}
/deep/.el-table.LineAnalysisDataBJ tr:nth-child(2) th:nth-child(2n){
background: #F5F7FA;
}
/deep/.el-table.LineAnalysisDataBJ tr:first-child th{
background: #fff;
}
/deep/.el-table.LineAnalysisDataBJ2 tr:first-child th:nth-child(1n){
background: #F5F7FA;
}
/deep/.el-table.LineAnalysisDataBJ2 tr:first-child th:nth-child(2n){
/* background: #fff; */
}
</style>
<template>
<div style="margin-bottom: 20px;">
<h3 class="text-center" style="margin-bottom: 5px;">出境日本线(已出团)</h3>
<el-table
:data="JapanAllData"
style="width: 100%"
class="LineAnalysisDataBJ3" border
height="450">
<el-table-column
fixed
align="center"
prop="Name"
label="名称"
width="150">
</el-table-column>
<el-table-column
prop=""
:label="title" v-for="(title,i) in MonthList"
min-width="120" align="center">
<template slot-scope="scope">
<span v-if="scope.row.Name.indexOf('率')==-1">{{scope.row.MonthData[i].toFixed(2)}}</span>
<span v-else>{{scope.row.MonthData[i]}}%</span>
</template>
</el-table-column>
</el-table>
<h3 class="text-center" style="margin-top: 15px;margin-bottom: 5px;">日本小包团(已出团)</h3>
<el-table
:data="JapanXBData"
style="width: 100%"
class="LineAnalysisDataBJ3 LineAnalysisDataBJ32" border
height="450">
<el-table-column
fixed
align="center"
prop="Name"
label="名称"
width="150">
</el-table-column>
<el-table-column
prop=""
:label="title" v-for="(title,i) in MonthList"
min-width="120" align="center">
<template slot-scope="scope">
<span v-if="scope.row.Name.indexOf('率')==-1">{{scope.row.MonthData[i].toFixed(2)}}</span>
<span v-else>{{scope.row.MonthData[i]}}%</span>
</template>
</el-table-column>
</el-table>
<h3 class="text-center" style="margin-top: 15px;margin-bottom: 5px;">日本散拼团(已出团)</h3>
<el-table
:data="JapanSPData"
style="width: 100%"
class="LineAnalysisDataBJ3 LineAnalysisDataBJ32" border
height="450">
<el-table-column
fixed
align="center"
prop="Name"
label="名称"
width="150">
</el-table-column>
<el-table-column
prop=""
:label="title" v-for="(title,i) in MonthList"
min-width="120" align="center">
<template slot-scope="scope">
<span v-if="scope.row.Name.indexOf('率')==-1&&scope.row.Name.indexOf('/收入')==-1">{{scope.row.MonthData[i].toFixed(2)}}</span>
<span v-else>{{scope.row.MonthData[i]}}%</span>
</template>
</el-table-column>
</el-table>
<h3 class="text-center" style="margin-top: 15px;margin-bottom: 5px;">毛利率分析(已出团)</h3>
<el-table
:data="MaoLiAnalysisData"
style="width: 100%"
class="LineAnalysisDataBJ" border>
<el-table-column
fixed
align="center"
prop="Name"
label="名称"
width="150">
</el-table-column>
<el-table-column align="center" :label="title" v-for="(title,i) in MonthList">
<el-table-column
prop=""
label="收入"
min-width="120" align="center">
<template slot-scope="scope">
{{scope.row.MonthData[i].Income.toFixed(2)}}
</template>
</el-table-column>
<el-table-column
prop=""
label="团数"
min-width="120" align="center">
<template slot-scope="scope">
{{scope.row.MonthData[i].TravelNum}}
</template>
</el-table-column>
</el-table-column>
</el-table>
<h3 class="text-center" style="margin-top: 15px;margin-bottom: 5px;">房费分析(散拼已出团)</h3>
<el-table
:data="RoomAnalysisData"
style="width: 100%"
class="LineAnalysisDataBJ3" border>
<el-table-column
fixed
align="center"
prop="Name"
label="名称"
width="150">
</el-table-column>
<el-table-column
prop=""
:label="title" v-for="(title,i) in MonthList"
min-width="120" align="center">
<template slot-scope="scope">
{{scope.row.MonthData[i].toFixed(2)}}
</template>
</el-table-column>
</el-table>
</div>
</template>
<script>
export default {
props:['StatisticalData'],
data() {
return {
MonthList: [],//月份列表
JapanAllData: [],
JapanXBData: [],
JapanSPData: [],
MaoLiAnalysisData: [],
RoomAnalysisData: [],
}
},
mounted() {
},
methods: {
},
watch: {
StatisticalData:{
handler(n,o){
this.MonthList = n.MonthList//月份列表
this.JapanAllData = n.JapanAllData
this.JapanXBData = n.JapanXBData
this.JapanSPData = n.JapanSPData
this.MaoLiAnalysisData = n.MaoLiAnalysisData
this.RoomAnalysisData = n.RoomAnalysisData
},
deep: true,
immediate: false,
}
},
}
</script>
<style scoped>
/deep/.LineAnalysisDataBJ3 tr th{
background: #F5F7FA;
}
/deep/.el-table.LineAnalysisDataBJ tr:first-child th{
background: #fff !important;
}
/deep/.el-table.LineAnalysisDataBJ tr:first-child th:first-child{
background: #F5F7FA !important;
}
/deep/.el-table.LineAnalysisDataBJ tr:nth-child(2) th:first-child{
background: #F5F7FA;
}
/deep/.el-table.LineAnalysisDataBJ tr td:first-child{
background: #F5F7FA !important;
}
</style>
<template>
<div style="height: 100%;">
<el-tabs v-model="msg.Type" @tab-click="handleClick">
<el-tab-pane label="线路经营情况" name="1"></el-tab-pane>
<el-tab-pane label="公司经营情况" name="2"></el-tab-pane>
<el-tab-pane label="日本小包OR散客" name="3"></el-tab-pane>
</el-tabs>
<div class="query-box">
<el-form class="_info_box clearfix" label-width="110px">
<el-row style="padding: 15px 0px 0 0">
<el-col :span="4">
<el-form-item :label="$t('system.table_company')">
<el-select
filterable
v-model="msg.OutBranchId"
@change="getStatement"
clearable
>
<el-option
:value="-1"
:label="$t('pub.unlimitedSel')"
></el-option>
<el-option
v-for="item in CompanyList"
:label="item.BName"
:value="item.Id"
:key="item.Id"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="线路">
<el-select filterable v-model="msg.LineId" @change="getStatement"
clearable>
<el-option
:value="0"
:label="$t('pub.unlimitedSel')"
></el-option>
<el-option
v-for="item in LineList"
:label="item.LineName"
:value="item.LineID"
:key="item.LineName"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="日期">
<el-date-picker
size="small"
v-model="dateTime"
type="monthrange"
value-format="yyyy-MM"
align="right"
range-separator="至"
start-placeholder="开始月份"
end-placeholder="结束月份"
:picker-options="pickerOptions"
@change="getDateTime"
:clearable="false">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
</el-form>
<ul class="clearfix">
<li class="hight_query">
<button class="hollowFixedBtn" @click="getStatement">
{{ $t("pub.searchBtn") }}
</button>
<button class="normalBtn" @click="exportExcel">
导出
</button>
</li>
</ul>
</div>
<div v-loading="loading" style="height: 78%;overflow: auto;">
<Lines v-if="activeName=='1'" :StatisticalData="StatisticalData"></Lines>
<Corporations v-if="activeName=='2'" :StatisticalData="StatisticalData"></Corporations>
<Packets v-if="activeName=='3'" :StatisticalData="StatisticalData"></Packets>
</div>
</div>
</template>
<script>
import Lines from "./components/line.vue";
import Corporations from "./components/corporation.vue";
import Packets from "./components/packet.vue";
export default {
components: {Lines,Corporations,Packets},
data() {
return {
loading: false,
activeName: 1,
msg:{
startDate: '',
endDate: '',
OutBranchId: -1,
LineId: 0,
Type: '1'
},
dateTime: [],
CompanyList: [],
getCompanyMsg: {
// 公司
RB_Group_Id: "0",
Status: "0",
},
LineList: [],
pickerOptions: {
shortcuts: [{
text: '本月',
onClick(picker) {
picker.$emit('pick', [new Date(), new Date()]);
}
}, {
text: '今年至今',
onClick(picker) {
const end = new Date();
const start = new Date(new Date().getFullYear(), 0);
picker.$emit('pick', [start, end]);
}
}, {
text: '最近六个月',
onClick(picker) {
const end = new Date();
const start = new Date();
start.setMonth(start.getMonth() - 5);
picker.$emit('pick', [start, end]);
}
}]
},
StatisticalData: {} ,//T统计数据
}
},
mounted() {
this.getCompanyMsg.RB_Group_Id = this.getLocalStorage().RB_Group_id
const end = new Date();
const start = new Date();
start.setMonth(start.getMonth() - 5);
this.dateTime = [this.$commonUtils.getFormatDateM(start),this.$commonUtils.getFormatDateM(end)]
this.msg.startDate = this.dateTime[0]
this.msg.endDate = this.dateTime[1]
this.getQueryData()
this.getStatement()
},
methods: {
getStatement(){
this.loading = true
this.apipost(
"financestatistics_post_GetDataAnalysisStat",
this.msg,
res => {
if (res.data.resultCode == 1) {
this.StatisticalData = res.data.data
} else {
this.Error(res.data.message);
}
this.loading = false;
},
err => {
this.loading = false
}
);
},
handleClick(e){
this.activeName = e._props.name
this.msg.Type = e._props.name
this.getStatement()
},
getDateTime(){
if(this.dateTime&&this.dateTime.length>0){
this.msg.startDate = this.dateTime[0]
this.msg.endDate = this.dateTime[1]
}else{
const end = new Date();
const start = new Date();
start.setMonth(start.getMonth() - 5);
this.dateTime = [this.$commonUtils.getFormatDateM(start),this.$commonUtils.getFormatDateM(end)]
this.msg.startDate = start
this.msg.endDate = end
}
this.getStatement()
},
exportExcel(){//导出报表
this.GetLocalFile("financestatistics_post_GetDataAnalysisStatToExcel", this.msg, '数据统计'+ this.$commonUtils.getCurrentDate() + ".xls");
},
getQueryData() {
//获取公司列表
this.apipost(
"admin_get_BranchGetList",
this.getCompanyMsg,
(res) => {
if (res.data.resultCode == 1) {
this.CompanyList = res.data.data;
} else {
}
},
(err) => {}
);
this.apipost(
"line_post_GetList", {
LineDirection: 2
},
res => {
if (res.data.resultCode == 1) {
this.LineList = res.data.data;
}
}
);
},
}
}
</script>
<style scoped>
</style>
......@@ -4537,6 +4537,14 @@ export default {
title: '电商年度比数据'
},
},
{ //财务 团队营收数据分析
path: '/DataAnalysis',
name: 'DataAnalysis',
component: resolve => require(['@/components/FinancialModule/DataAnalysis/index'], resolve),
meta: {
title: '团队营收数据分析'
},
},
{ //金蝶对接 金蝶币种
path: '/KingdeeCurrency',
name: 'KingdeeCurrency',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment