Commit 6f2e0ea7 authored by godwithdh's avatar godwithdh

form

parent c305843a
......@@ -65,10 +65,11 @@ const methodMap = {
/**
* tiip 小程序
*/
getTtipTotalamount:{url:'/bianalysis/totalamount/',method:'get',host:"default"},
getTtipSellinfo:{url:'/bianalysis/sellinfo/',method:'get',host:"default"},
getTiipTotalamount:{url:'/bianalysis/totalamount/',method:'get',host:"default"},
getTiipSellinfo:{url:'/bianalysis/sellinfo/',method:'get',host:"default"},
getTiipSalesinfo:{url:'/bianalysis/salesinfo/',method:'get',host:"default"},
getTiipPayinfo:{url:"/bianalysis/payinfo/",method:"get",host:"default"},
getTiipReceiveinfo:{url:"/bianalysis/receiveinfo/",method:"get",host:"default"},
getTiipReceive:{url:"/bianalysis/receivemoney/",method:"get",host:"default"},
getTiipCost:{url:"/bianalysis/costanalysis/",method:"get",host:"default"},
......
......@@ -13,8 +13,8 @@ function urlFun(name){
* 默认公司
*/
// default:`http://192.168.4.39:5001`,
// default:`https://weixin.huansi.net/apiproxy/huansi/hszh_HSFabricTradeTest`,
default:`https://weixin.huansi.net/apiproxy/huansi/service/proxy/${userID}`,
default:`https://weixin.huansi.net/apiproxy/huansi/hszh_HSFabricTradeTest`,
// default:`https://weixin.huansi.net/apiproxy/huansi/service/proxy/${userID}`,
/**
* 基本地址
......
......@@ -7,6 +7,16 @@
color:#fff;
text-align: center;
}
.iCard{
position:relative;
}
.noData{
position:absolute;
top:40px;
>img{
width:100%;
}
}
}
</style>
<template>
......@@ -14,7 +24,7 @@
<searchComponent :search="search" />
<div class="iCard">
<div class="head">当月总费用进度情况(万)</div>
<div ref="chart1" :style="{height:'240px',opacity:value1.length>0?1:0}"/>
<div ref="chart1" :style="{height:'220px',opacity:value1.length>0?1:0}"/>
<div class="noData" v-if="value1.length <= 0">
<img src="@/assets/noData.jpg">
</div>
......@@ -86,24 +96,130 @@ export default {
this.value2=value.set2||[]
this.value3=value.set3||[]
this.drawBar(this.chart1,this.value1.map(v=>{
this.value1.length>0&&this.drawBar(this.chart1,this.value1.map(v=>{
return{
name:v.sChargeTypeName,
value:v.nAmount
}
}))
this.drawLing(this.chart2,this.value2.map(v=>{
// return{
// name:v.
// }
}))
this.drawLing()
this.value2.length>0&&this.drawLing(this.chart2,this.value2,Object.keys(this.value2[0]).filter(v=>v!="nMonth"))
this.value3.length>0&&this.drawLing(this.chart3,this.value3,Object.keys(this.value3[0]).filter(v=>v!="nMonth"))
},
drawLing(chart,data){
drawLing(chart,data,title){
chart.setOption({
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross',
crossStyle: {
color: '#111'
}
}
},
legend: {
data:title,
x: 'left'
},
grid:{
left: '2%', // 与容器左侧的距离
right: '2%', // 与容器右侧的距离
top:30,
height:200,
containLabel: true
},
xAxis:[{
type:"category",
data:data.map(v=>v.nMonth),
axisPointer: {
type: 'shadow'
},
axisTick: {
alignWithLabel: true
},
axisLabel: {
interval:0
},
}],
yAxis:{
type:"value"
},
series:title.map(v1=>{
return{
name:v1,
type:"line",
data:data.map(v2=>v2[v1])
}
}),
dataZoom: [{
type: 'inside',
show: true, //flase直接隐藏图形
xAxisIndex: [0],
left: '9%', //滚动条靠左侧的百分比
start: 0,//滚动条的起始位置
end: (window.innerWidth*1.35)/data.length //滚动条的截止位置(按比例分割你的柱状图x轴长度)
}],
})
},
drawBar(chart,data){
chart.setOption({
tooltip:{
trigger:"axis",
axisPointer:{
type:"cross",
crossStyle:{
color:"#111"
}
}
},
grid: {
left: '2%', // 与容器左侧的距离
right: '2%', // 与容器右侧的距离
top:10,
height:200,
containLabel: true
},
xAxis: {
type: 'category',
data: data.map(v=>v.name),
axisPointer: {
type: 'shadow'
},
axisTick: {
alignWithLabel: true
},
axisLabel: {
interval:0
},
},
yAxis:{
type:"value",
axisLine:{
lineStyle:{
color:'#5CADFF',
}
}
},
series:{
type:"bar",
data:data.map(v=>v.value),
barWidth:32,
color:new this.$echarts.graphic.LinearGradient(0.5, 0, 0.5, 1, [{
offset: 0,
color: '#708bf6'
}, {
offset: 1,
color: '#00B2EE'
}])
},
dataZoom: [{
type: 'inside',
show: true, //flase直接隐藏图形
xAxisIndex: [0],
left: '9%', //滚动条靠左侧的百分比
start: 0,//滚动条的起始位置
end: (window.innerWidth*1.35)/data.length //滚动条的截止位置(按比例分割你的柱状图x轴长度)
}],
})
},
},
......
......@@ -35,21 +35,21 @@
<div class="CONTENT">
<div class="iCard" ref="chart1">
<p>前十名员工(联动)</p>
<canvas id="chart1" v-show="chartData1.length > 0" width="400" height="260" style="width:100%;height:240px; touch-action: pan-y; user-select: none; -webkit-user-drag: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"></canvas>
<canvas id="chart1" v-if="chartData1.length > 0" width="400" height="260" style="width:100%;height:240px; touch-action: pan-y; user-select: none; -webkit-user-drag: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"></canvas>
<div class="noData" v-if="chartData1.length <= 0">
<img src="@/assets/noData.jpg" class="_img" alt="">
</div>
</div>
<div class="iCard" ref="chart2">
<p>{{title}}每月回款率</p>
<canvas id="chart2" v-show="chartData2.length > 0" width="400" height="260" style="width:100%;height:240px;"></canvas>
<canvas id="chart2" v-if="chartData2.length > 0" width="400" height="260" style="width:100%;height:240px;"></canvas>
<div class="noData" v-if="chartData2.length <= 0">
<img src="@/assets/noData.jpg" class="_img" alt="">
</div>
</div>
<div class="iCard" ref="chart3">
<p>{{title}}按月统计订单金额</p>
<canvas id="chart3" v-show="chartData3.length > 0" width="400" height="260" style="width:100%;height:240px;"></canvas>
<canvas id="chart3" v-if="chartData3.length > 0" width="400" height="260" style="width:100%;height:240px;"></canvas>
<div class="noData" v-if="chartData3.length <= 0">
<img src="@/assets/noData.jpg" class="_img" alt="">
</div>
......@@ -164,38 +164,42 @@ export default {
}
},
async getData(){
var res=await this.request("getTipSalesinfo",{
var res=await this.request("getTiipSalesinfo",{
data:{
dStartDate:this.search.dBeginDate,
dEndDate:this.search.dEndDate,
sSalesName:"环思软件",
}
},"加载中",{})
this.title=res.set1&&res.set1[0]&&res.set1[0].sSalesName
this.chartData1=res.set1&&res.set1.map(v=>{
if(res.set1.length>0){
this.title=res.set1[0].sSalesName
this.chartData1=res.set1.map(v=>{
return{
sSalesName:v.sSalesName,
nAmount:v.nAmount,
iSalesId:v.sSalesName,
}
})||[]
this.tempChartData2 = res.set2&&res.set2.map(v=>{
})
}
if(res.set2.length>0){
this.tempChartData2 = res.set2.map(v=>{
return{
nPaydAmount:v.nPaydAmount,
sMonth:v.sMonth,
iSalesId:v.sSalesName,
}
})||[];
this.tempChartData3 = res.set3&&res.set3.map(v=>{
})
this.chartData2=this.tempChartData2.filter(v=>this.chartData1.length>0&&v.iSalesId==this.chartData1[0].iSalesId)
}
if(res.set3.length>0){
this.tempChartData3 = res.set3.map(v=>{
return{
iSalesId:v.sSalesName,
sMonth:v.sMonth,
nAmount:v.nAmount,
}
})||[];
this.chartData2=res.set2&&res.set2.filter(v=>this.chartData1.length>0&&v.iSalesId==this.chartData1[0].iSalesId)||[]
this.chartData3=res.set3&&res.set3.filter(v=>this.chartData1.length>0&&v.iSalesId==this.chartData1[0].iSalesId)||[]
})
this.chartData3=this.tempChartData3.filter(v=>this.chartData1.length>0&&v.iSalesId==this.chartData1[0].iSalesId)
}
},
},
}
......
......@@ -171,7 +171,7 @@ export default {
},
methods:{
async init(){
var res=await this.request("getTipTotalamount",{},"加载中",{})
var res=await this.request("getTiipTotalamount",{},"加载中",{})
this.list=[
{
child:[
......
<style lang="less">
@import url("../../../styles/common.less");
.DATA{
width:100%;
>tr{
>td{
padding:8px 4px;
&:first-child{
width:50px;
&>div>span{
background: rgb(146, 190, 7);
box-shadow: 2px 2px 3px rgba(146, 190, 7,0.3);
color: #fff;
border-radius: 50%;
width: 30px;
height: 30px;
display: flex;
justify-content: center;
align-items: center;
margin: 0 auto;
padding: 0 5px;
font-size: 17px;
}
}
&:last-child{
text-align: right;
}
}
&:not(:first-child)>td{
border-bottom:1px solid #ddd;
&:first-child>div>span{
width:20px;
height:20px;
font-size:10px;
background:#F56860;
box-shadow: 2px 2px 3px rgba(245, 104, 96,0.3);
}
&:nth-child(n+3){
color:#777;
}
}
}
}
</style>
<template>
<div id="revenue">
<tab>
<tab-item :selected="tabIndex=='getTiipReceiveinfo'" @on-item-click="tabIndex='getTiipReceiveinfo'">收入</tab-item>
<tab-item :selected="tabIndex=='getTiipPayinfo'" @on-item-click="tabIndex='getTiipPayinfo'">支出</tab-item>
</tab>
<searchComponent :search='search' />
<div class="iCard">
<div class="iCard" style="margin-bottom:8px;">
<div ref='chart' style="width:100%;height:150px;"/>
<table>
<table class="DATA">
<tr>
<td><div> <span></span> </div></td>
<td><div> <span>总支出</span> </div></td>
<td><div></div></td>
<td><div> <span>{{allPay}}</span> </div></td>
<td><div> <span>{{allPay.toLocaleString()}}</span> </div></td>
</tr>
<tr v-for="(v,k) in list" :key="k">
<td><div> <span>{{v.name.slice(0,1)}}</span> </div></td>
<td><div> <span>{{v.name}}</span> </div></td>
<td><div> <span>{{v.percent}}%</span> </div></td>
<td><div> <span>{{v.value.toLocaleString()}}</span> </div></td>
</tr>
</table>
</div>
......@@ -22,13 +72,14 @@
import Util from '@/libs/util.js'
import { Confirm } from 'vux'
import searchComponent from '@/components/search'
import echarts from 'echarts';
import { Tab, TabItem } from 'vux'
export default {
name:"revenue",
components:{searchComponent},
components:{searchComponent,Tab,TabItem},
data(){
return{
tabIndex:"getTiipReceiveinfo",
search:{
dBeginDate:Util.dateFormat(new Date(),'yyyy-MM-01'),
dEndDate:Util.dateFormat(new Date(),'yyyy-MM-dd'),
......@@ -52,16 +103,81 @@ export default {
},
methods:{
async searchData(){
this.list=await this.request("getTipPayinfo",{
var value=await this.request(this.tabIndex,{
data:{
dStartDate:this.search.dBeginDate,
dEndDate:this.search.dEndDate
}
},"加载中",{})
if(this.tabIndex=="getTiipReceiveinfo"){
this.list=value.set1.filter(v=>v.nAmount!=0&&v.sReceivableType).map(v=>{
return{
name:v.sReceivableType,
value:v.nAmount
}
})
}else{
this.list=value.set1.filter(v=>v.nAmount!=0&&v.sPayableType).map(v=>{
return{
name:v.sPayableType,
value:v.nAmount
}
})
}
this.allPay=0
// this.list.forEach(v=>{
// this.allPay+=v.nAmount
// })
this.list.forEach(v=> this.allPay+=v.value )
this.allPay=Math.round(this.allPay*100)/100
this.list.forEach(v=>{
v.percent=Math.round(v.value/this.allPay*100)
})
this.chart.setOption({
tooltip:{
trigger: 'item',
formatter: "{a} <br/>{b} : {c} ({d}%)",
position:[10,10],
},
series:[
{
name:'访问来源',
type:'pie',
radius: ['60%', '90%'],
avoidLabelOverlap: false,
label: {
normal: {
show: false,
position: 'center',
formatter(v){
return v.name+"\n"+v.value+"\n("+v.percent+"%)";
},
},
emphasis: {
show: true,
textStyle: {
fontSize: '10',
fontWeight: 'bold'
}
}
},
labelLine: {
normal: {
show: true
}
},
data: this.list.map(v=>{
return{
name:v.name,
value:v.value
}
}),
}
],
})
},
},
watch:{
tabIndex(){
this.searchData()
},
},
}
......
......@@ -229,7 +229,7 @@ export default {
this.showValue()
},
async getChartData(){
var value =await this.request('getTipSellinfo',{
var value =await this.request('getTiipSellinfo',{
params:{
dStartDate:this.search.dBeginDate,
dEndDate:this.search.dEndDate
......
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