Commit 4e105c52 authored by 张锡奇's avatar 张锡奇

upload

parent 2b03b25c
...@@ -124,7 +124,7 @@ export default { ...@@ -124,7 +124,7 @@ export default {
resize(chart){ resize(chart){
var option=chart.getOption() var option=chart.getOption()
if(!option)return; if(!option)return;
option.dataZoom[0].end=option.dataZoom[0].start+(window.innerWidth*0.9)/option.xAxis[0].data.length // option.dataZoom[0].end=option.dataZoom[0].start+(window.innerWidth*0.9)/option.xAxis[0].data.length
chart.setOption(option) chart.setOption(option)
chart.resize() chart.resize()
}, },
...@@ -159,6 +159,7 @@ export default { ...@@ -159,6 +159,7 @@ export default {
nPaydAmount:v.nPaydAmount, nPaydAmount:v.nPaydAmount,
sMonth:v.sMonth, sMonth:v.sMonth,
iSalesId:v.sSalesName, iSalesId:v.sSalesName,
nReceivedAmount:v.nReceivedAmount
} }
}) })
this.chartData2=this.tempChartData2.filter(v=>this.chartData1.length>0&&v.iSalesId==this.chartData1[0].iSalesId); this.chartData2=this.tempChartData2.filter(v=>this.chartData1.length>0&&v.iSalesId==this.chartData1[0].iSalesId);
...@@ -173,7 +174,7 @@ export default { ...@@ -173,7 +174,7 @@ export default {
} }
}) })
this.chartData3=this.tempChartData3.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)
this.setChart1(this.myChart3,this.chartData3,1) this.setChart2(this.myChart3,this.chartData3,1)
} }
}, },
setChart(myChart,value){ setChart(myChart,value){
...@@ -252,6 +253,99 @@ export default { ...@@ -252,6 +253,99 @@ export default {
myChart.setOption(options); myChart.setOption(options);
}, },
setChart1(myChart,value,id){ setChart1(myChart,value,id){
let options = {
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross',
label: {
backgroundColor: '#283b56'
}
}
},
grid: {
top:"40",
bottom:"20",
left: '2%', // 与容器左侧的距离
right: '5%', // 与容器右侧的距离
containLabel: true
},
legend: {
data:['比例', '回款金额']
},
toolbox: {
show: true,
feature: {
dataView: {readOnly: false},
restore: {},
saveAsImage: {}
}
},
xAxis: [
{
type: 'category',
boundaryGap: true,
data: this.chartData2.map(x=>x.sMonth)
},
{
type: 'category',
boundaryGap: true,
data: this.chartData2.map(x=>x.sMonth)
},
],
yAxis: [
{
type: 'value',
scale: true,
name: '比例',
},
{
type: 'value',
scale: true,
name: '回款金额',
axisLabel: {
margin: 2,
formatter: function (value, index) {
if(value >= 1000 && value < 10000){
value = Math.round(value/10) / 100 + "千";
}else if (value >= 10000 && value < 10000000) {
value = Math.round(value/100) / 100 + "万";
} else if (value >= 10000000) {
value = Math.round(value/1000) / 10000 + "千万";
}
return value;
}
},
}
],
series: [
{
name: '比例',
type: 'bar',
data: this.chartData2.map(x=>x.nPaydAmount)
},
{
name: '回款金额',
type: 'line',
xAxisIndex: 1,
yAxisIndex: 1,
data: this.chartData2.map(x=>x.nReceivedAmount)
}
],
dataZoom: [{
type: 'inside',
show: true, //flase直接隐藏图形
xAxisIndex: [0],
left: '9%', //滚动条靠左侧的百分比
start: 0,//滚动条的起始位置
end: (window.innerWidth*0.9)/value.length //滚动条的截止位置(按比例分割你的柱状图x轴长度)
}]
};
myChart.setOption(options);
},
setChart2(myChart,value,id){
let options = { let options = {
tooltip: { tooltip: {
trigger: 'axis', trigger: 'axis',
......
...@@ -43,12 +43,26 @@ ...@@ -43,12 +43,26 @@
<td @click="routerPushOperateDetail('销售退货')"> <td @click="routerPushOperateDetail('销售退货')">
<div>{{Number(value['销售退货']||0).toLocaleString()}}</div> <div>{{Number(value['销售退货']||0).toLocaleString()}}</div>
</td> </td>
<td style="width:100px;">
<div>销售退货率</div>
</td>
<td style="text-decoration:none;">
<div>{{Number(value['销售退货率']||0).toLocaleString() * 100 + '%'}}</div>
</td>
</tr>
<tr>
<td style="width:100px;"> <td style="width:100px;">
<div>采购退货</div> <div>采购退货</div>
</td> </td>
<td @click="routerPushOperateDetail('采购退货')"> <td @click="routerPushOperateDetail('采购退货')">
<div>{{Number(value['采购退货']||0).toLocaleString()}}</div> <div>{{Number(value['采购退货']||0).toLocaleString()}}</div>
</td> </td>
<td style="width:100px;">
<div>采购退货率</div>
</td>
<td style="text-decoration:none;">
<div>{{Number(value['采购退货率']||0).toLocaleString() * 100 + '%'}}</div>
</td>
</tr> </tr>
<tr> <tr>
<td > <td >
......
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