Commit 7ff13d40 authored by xuzhuo's avatar xuzhuo

大屏当日订单量跳转

parent de84c4d2
......@@ -150,6 +150,13 @@ export const getDepartmentShipmentWeight = (department_code, cur_day) => fetch('
,department_code: department_code
}
}, 'POST');
//折线图目标量
export const getDepartmentTargetWeight = (department_code, year) => fetch('/api/query/*/action/get_department_target_weight', {
aux: {
year: year
,department_code: department_code
}
}, 'POST');
<template>
<div class="target-achievement">
<div class="menu">
<input type="button" :class="{'selectedBtn': currentBtn === 'L022'}" value="上海事业部"
@click="changeDimension('L022')">
<input type="button" :class="{'selectedBtn': currentBtn === 'L026'}" value="广东事业部"
@click="changeDimension('L026')">
<input type="button" :class="{'selectedBtn': currentBtn === 'L024'}" value="江苏事业部"
@click="changeDimension('L024')">
<input type="button" :class="{'selectedBtn': currentBtn === 'L025'}" value="天津事业部"
@click="changeDimension('L025')">
<input type="button" :class="{'selectedBtn': currentBtn === 'L004'}" value="成都事业部"
@click="changeDimension('L004')">
<input type="button" :class="{'selectedBtn': currentBtn === 'L025'}" value="山东事业部"
@click="changeDimension('L005')">
<input type="button" :class="{'selectedBtn': currentBtn === 'L007'}" value="河南事业部"
@click="changeDimension('L007')">
<input type="button" :class="{'selectedBtn': currentBtn === 'L008'}" value="华西事业部"
@click="changeDimension('L008')">
<input type="button" :class="{'selectedBtn': currentBtn === 'L009'}" value="湛江事业部"
@click="changeDimension('L009')">
<input type="button" value="上海事业部" @click="changeDimension('L022')">
<input type="button" value="广东事业部" @click="changeDimension('L026')">
<input type="button" value="江苏事业部" @click="changeDimension('L024')">
<input type="button" value="天津事业部" @click="changeDimension('L025')">
<input type="button" value="成都事业部" @click="changeDimension('L004')">
<input type="button" value="山东事业部" @click="changeDimension('L005')">
<input type="button" value="河南事业部" @click="changeDimension('L007')">
<input type="button" value="华西事业部" @click="changeDimension('L008')">
<input type="button" value="湛江事业部" @click="changeDimension('L009')">
</div>
<div class="chart">
<div ref="chart" style="width: 100%;height: 100%;"/>
......@@ -77,7 +68,7 @@ export default {
//dimension 事业部code
async changeDimension(dimension) {
this.currentBtn = dimension;
this.chart.dispose();
// this.chart.dispose();
let chartDom = this.$refs.chart;
this.chart = echarts.init(chartDom);
......@@ -93,10 +84,6 @@ export default {
},
},
getEcharts() {
this.changeDimension('L022');
},
mounted() {
setTimeout(() => {
let chartDom = this.$refs.chart;
......
......@@ -8,7 +8,7 @@ import {
getBusinessConditionDatasByYear,
getAllTypeBusinessConditionDatasByYear,
getAllTypeBusinessConditionDetailByYear,
getBusinessConditionDatasByYoy, getDepartmentShipmentWeight
getBusinessConditionDatasByYoy, getDepartmentShipmentWeight, getDepartmentTargetWeight
} from "../../api/apiList";
import {calc_hb_str, calc_tb_str, conver_amont} from "../../utils/numUtil";
import moment from 'moment'
......@@ -412,7 +412,7 @@ export const adapterYoySumData = function (type, data) {
}
}
export const adapterXAxisData2 = function (color, data) {
export const adapterXAxisData2 = function (color, data, targetValue) {
return {
type: 'category',
axisTick: {
......@@ -424,6 +424,13 @@ export const adapterXAxisData2 = function (color, data) {
color: color
}
},
axisPointer: {
label: {
formatter: function (params) {
return params.seriesData[0].name + ' 目标量:' + targetValue;
}
}
},
data: data
}
}
......@@ -535,6 +542,7 @@ export const initDetail = function () {
export const getShipmentWeight = async function (department_code, cur_day) {
let pageData = [];
//曲线图数据
let response = await getDepartmentShipmentWeight(department_code, cur_day);
var xAxisData = [];
var line1 = [];
......@@ -548,7 +556,10 @@ export const getShipmentWeight = async function (department_code, cur_day) {
series.push(adapterSeriesData(null, "完成量", line1));
series.push(adapterSeriesData(null, "未完成量", line2));
var xAxis = [];
xAxis.push(adapterXAxisData2("#00bbe5", xAxisData));
//目标量
let targetResp = await getDepartmentTargetWeight(department_code, new Date().getFullYear());
var target = targetResp.data ? targetResp.data.settle_weight_sum : '无';
xAxis.push(adapterXAxisData2("#00bbe5", xAxisData, target));
var seriesBar = [];
seriesBar.push(adapterSeriesDataBar(null, "完成量", line1));
......
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