Browse Source

原材料需求差异分析

develop
wangxy 2 years ago
parent
commit
a78d018fe0
4 changed files with 94 additions and 28 deletions
  1. +36
    -4
      src/views/plan/workbench/materialAnalysis/chart/commonLineChart.vue
  2. +12
    -10
      src/views/plan/workbench/materialAnalysis/chart/index.vue
  3. +44
    -12
      src/views/plan/workbench/materialAnalysis/chart/lineBarChart.vue
  4. +2
    -2
      src/views/plan/workbench/materialAnalysis/filter/index.vue

+ 36
- 4
src/views/plan/workbench/materialAnalysis/chart/commonLineChart.vue View File

@ -1,5 +1,5 @@
<template> <template>
<div style="height:250px;width:100%;margin-top: 30px;" />
<div style="height:calc(100% - 5px);width:100%;margin-top: 0px;" />
</template> </template>
<script> <script>
import * as echarts from 'echarts' import * as echarts from 'echarts'
@ -43,7 +43,7 @@ export default {
if (currentValue && currentValue.SortKeys) { if (currentValue && currentValue.SortKeys) {
this.xDataArray = currentValue.SortKeys this.xDataArray = currentValue.SortKeys
} }
newValue.PerCustomerDeviationDetailItem.forEach(el => {
(newValue.PerCustomerDeviationDetailItem || []).forEach(el => {
receivableArray = [] receivableArray = []
this.xDataArray.forEach(elChild => { this.xDataArray.forEach(elChild => {
receivableArray.push(el.Item[elChild]) receivableArray.push(el.Item[elChild])
@ -72,11 +72,43 @@ export default {
this.chart = echarts.init(this.$el, 'macarons') this.chart = echarts.init(this.$el, 'macarons')
this.chart.setOption({ this.chart.setOption({
color: ['#126db9'], color: ['#126db9'],
dataZoom: [
{
// start: 0,//0
// end: 100,//100
type: 'slider',
show: true,
// xAxisIndex: [0],
handleSize: 0,// 2
startValue: 0, //
endValue: 30, //
height: 10,//
left: '5%', //
right: '5%',//
bottom: 10,//
borderColor: "#000",
fillerColor: '#269cdb',
borderRadius: 5,
backgroundColor: '#33384b',//
showDataShadow: false,// auto
showDetail: false,// true
realtime: false, //
filterMode: 'filter',
},
//
{
type: 'inside',
show: true,
// xAxisIndex: [0],
start: 1,//1
end: 10,//100
},
],
grid: { grid: {
top: '10%', top: '10%',
left: '5%', left: '5%',
right: '15%',
bottom: '0%',
right: '5%',
bottom: '15%',
containLabel: true containLabel: true
}, },
xAxis: { xAxis: {


+ 12
- 10
src/views/plan/workbench/materialAnalysis/chart/index.vue View File

@ -1,6 +1,5 @@
<template> <template>
<div class="chart-analysis-container"> <div class="chart-analysis-container">
<div class="chart-normal-wrap"> <div class="chart-normal-wrap">
<div class="chart-info clearfix"> <div class="chart-info clearfix">
<div class="fl">原材料</div> <div class="fl">原材料</div>
@ -14,11 +13,11 @@
@download="download" @download="download"
/> />
</div> </div>
<div class="chart-bottom-wrap clearfix">
<div class="chart-bottom-left fl">
<div class="chart-bottom-wrap">
<div class="chart-bottom-top">
<CommonLineChart :dataList="dataList" /> <CommonLineChart :dataList="dataList" />
</div> </div>
<div class="chart-bottom-right fl">
<div class="chart-bottom-bottom">
<LineBarChart :dataList="dataList" /> <LineBarChart :dataList="dataList" />
</div> </div>
</div> </div>
@ -95,13 +94,16 @@ export default {
} }
.chart-bottom-wrap { .chart-bottom-wrap {
height: calc(100% - 90px); height: calc(100% - 90px);
padding: 0 18px 20px 18px;
.chart-bottom-left, .chart-bottom-right {
width: 49%;
height: 100%;
// padding: 0 18px 20px 18px;
.chart-bottom-top, .chart-bottom-bottom {
width: 100%;
overflow-x: auto;
height: calc(50% - 15px);
min-height: 160px;
} }
.chart-bottom-right {
margin-left: 2%;
.chart-bottom-bottom {
// margin-left: 2%;
margin-top: 30px;
} }
} }
} }

+ 44
- 12
src/views/plan/workbench/materialAnalysis/chart/lineBarChart.vue View File

@ -1,5 +1,5 @@
<template> <template>
<div style="height:250px;width:100%;margin-top: 30px;" />
<div style="height:calc(100% - 5px);width:100%;" />
</template> </template>
<script> <script>
import * as echarts from 'echarts' import * as echarts from 'echarts'
@ -71,12 +71,53 @@ export default {
initChart() { initChart() {
this.chart = echarts.init(this.$el, 'macarons') this.chart = echarts.init(this.$el, 'macarons')
this.chart.setOption({ this.chart.setOption({
tooltip: {
trigger: "axis",
textStyle: {
color: '#fff'
}
},
dataZoom: [
{
// start: 0,//0
// end: 100,//100
type: 'slider',
show: true,
// xAxisIndex: [0],
handleSize: 0,// 2
startValue: 0, //
endValue: 30, //
height: 10,//
left: '5%', //
right: '5%',//
bottom: 10,//
borderColor: "#000",
fillerColor: '#269cdb',
borderRadius: 5,
backgroundColor: '#33384b',//
showDataShadow: false,// auto
showDetail: false,// true
realtime: true, //
filterMode: 'filter',
},
//
{
type: 'inside',
show: true,
// xAxisIndex: [0],
start: 1,//1
end: 100,//100
},
],
color: ['#126db9'], color: ['#126db9'],
legend: {
data: this.seriesArray.map(e=>e.name)
},
grid: { grid: {
top: '10%', top: '10%',
left: '5%', left: '5%',
right: '15%',
bottom: '0%',
right: '5%',
bottom: '15%',
containLabel: true containLabel: true
}, },
xAxis: { xAxis: {
@ -86,19 +127,10 @@ export default {
interval: 0, interval: 0,
rotate:'80',// rotate:'80',//
}, },
},
legend: {
data: this.seriesArray.map(e=>e.name)
}, },
yAxis: { yAxis: {
type: 'value', type: 'value',
}, },
tooltip: {
trigger: 'axis',
textStyle: {
color: '#fff'
}
},
series: this.seriesArray series: this.seriesArray
}) })
} }


+ 2
- 2
src/views/plan/workbench/materialAnalysis/filter/index.vue View File

@ -13,7 +13,7 @@
placeholder="请选择原材料"> placeholder="请选择原材料">
<el-option v-for="item in specificationsData" <el-option v-for="item in specificationsData"
:key="item['Article-ArtId']" :key="item['Article-ArtId']"
:label="item['Article-Descr1']"
:label="item['Article-ArtId']+ '-' +item['Article-Descr1']"
:value="item['Article-ArtId']" /> :value="item['Article-ArtId']" />
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -25,7 +25,7 @@
placeholder="请选择规格"> placeholder="请选择规格">
<el-option v-for="item in attributeData" <el-option v-for="item in attributeData"
:key="item['Attribute-AttrCode']" :key="item['Attribute-AttrCode']"
:label="item['Attribute-Descr']"
:label="item['Attribute-AttrCode']+'-'+item['Attribute-Descr']"
:value="item['Attribute-AttrCode']" /> :value="item['Attribute-AttrCode']" />
</el-select> </el-select>
</el-form-item> </el-form-item>


Loading…
Cancel
Save