修改bug
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
<div class="search">
|
||||
<el-form :model="listQuery" :inline="true" ref="dataForm" class="blueTip">
|
||||
<el-form-item label="时间维度" prop="type">
|
||||
<el-select size="small" clearable v-model="listQuery.type" placeholder="请选择">
|
||||
<el-select size="small" clearable v-model="listQuery.type" placeholder="请选择" @change="handleChange">
|
||||
<el-option v-for="item in timeList" :key="item.value" :label="item.label" :value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
@@ -60,18 +60,18 @@
|
||||
生产情况对比
|
||||
</div>
|
||||
<bm-line-bar :type="listQuery.type" style="margin-top: 20px;" :show="false" :chartHeight="chartHeight"
|
||||
:legendList="legendList" :chartMsg="chartMsg" :chartId="chartId" :chartNum="chartNum" />
|
||||
:legendList="legendList" ref="dayChart" :chartMsg="chartMsg" :chartId="chartId" :chartNum="chartNum" />
|
||||
</el-col>
|
||||
<el-col :span="6" style="margin-top: 30px">
|
||||
<bm-line-bar-target :type="listQuery.type" :chartHeight="chartHeight" :legendList="legendList"
|
||||
:chartMsg="chartMsgTarget" :chartId=" 'chartTarget'" :chartNum="chartNum" />
|
||||
:chartMsg="chartMsgTarget" ref="dayTargetChart" :chartId=" 'chartTarget'" :chartNum="chartNum" />
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<div class="blueTip">
|
||||
{{ title }}
|
||||
</div>
|
||||
<bm-line-bar-year-target :type="listQuery.type" :chartHeight="chartHeight" :legendList="legendList"
|
||||
:chartMsg="chartMsgYearTarget" :chartId=" 'chartYearTarget'" :chartNum="chartNum" />
|
||||
:chartMsg="chartMsgYearTarget" ref="chartYearTarget" :chartId=" 'chartYearTarget'" :chartNum="chartNum" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row v-else-if="this.listQuery.type === 1 || this.listQuery.type === 0">
|
||||
@@ -103,8 +103,8 @@
|
||||
:chartId="chartId" :chartNum="chartNum" />
|
||||
<!-- </el-col> -->
|
||||
</el-row>
|
||||
<base-table :key="showTable" :span-method="objectSpanMethod" :table-props="tableProps" :page="listQuery.current"
|
||||
:limit="listQuery.size" :table-data="tableData" :max-height="tableH" />
|
||||
<base-table :key="showTable" :table-props="tableProps" :page="listQuery.current" :limit="listQuery.size"
|
||||
:table-data="tableData" :max-height="tableH" />
|
||||
</div>
|
||||
<!-- <div class="containerBottom">
|
||||
|
||||
@@ -132,6 +132,8 @@ export default {
|
||||
showTable:false,
|
||||
listQuery: {
|
||||
pageNo: 1,
|
||||
start: undefined,
|
||||
end: undefined,
|
||||
pageSize:999,
|
||||
// size: 10,
|
||||
// current: 1,
|
||||
@@ -167,7 +169,7 @@ export default {
|
||||
{ id: 1, name: "FTO投入", type: 1, color: "#8EF0AB" },
|
||||
{ id: 2, name: "芯片产量", type: 1, color: "#288AFF" },
|
||||
{ id: 3, name: "标准组件产量", type: 1, color: "#64BDFF" },
|
||||
this.currentMenu == '瑞昌' ? '' :
|
||||
this.currentMenu == '瑞昌' ? null :
|
||||
{ id: 4, name: "BIPV产量", type: 1, color: "#7164FF" },
|
||||
],
|
||||
chartMsgYearTarget: {
|
||||
@@ -230,7 +232,6 @@ export default {
|
||||
},
|
||||
},
|
||||
},
|
||||
this.currentMenu == '瑞昌' ? '' :
|
||||
{
|
||||
name: "BIPV产量",
|
||||
data: [],
|
||||
@@ -254,7 +255,15 @@ export default {
|
||||
yAxis:{
|
||||
type: "value",
|
||||
name: "单位/片",
|
||||
show:false,
|
||||
show: true,
|
||||
|
||||
// min: function (value) {//取最小值向下取整为最小刻度
|
||||
// return Math.floor(value.min)
|
||||
// },
|
||||
// max: function (value) {//取最大值向上取整为最大刻度
|
||||
// return Math.ceil(value.max)
|
||||
// },
|
||||
scale: true,
|
||||
nameTextStyle: {
|
||||
fontSize: 12,
|
||||
align: "right",
|
||||
@@ -267,14 +276,21 @@ export default {
|
||||
color: ["#8EF0AB", "#288AFF", "#64BDFF", '#7164FF'],
|
||||
xData: [],
|
||||
yName: "单位/片",
|
||||
yAxis:
|
||||
{
|
||||
yAxis:{
|
||||
type: "value",
|
||||
name: "单位/片",
|
||||
nameTextStyle: {
|
||||
fontSize: 12,
|
||||
align: "right",
|
||||
},
|
||||
},
|
||||
scale: true,
|
||||
// min: function (value) {//取最小值向下取整为最小刻度
|
||||
// return Math.floor(value.min)
|
||||
// },
|
||||
splitNumber: 5,
|
||||
// max: function (value) {//取最大值向上取整为最大刻度
|
||||
// return Math.ceil(value.max)
|
||||
// },
|
||||
axisLabel: {},
|
||||
},
|
||||
series: [
|
||||
@@ -323,7 +339,6 @@ export default {
|
||||
},
|
||||
},
|
||||
},
|
||||
this.currentMenu == '瑞昌' ? '' :
|
||||
{
|
||||
name: "BIPV产量",
|
||||
data: [],
|
||||
@@ -394,13 +409,13 @@ export default {
|
||||
},
|
||||
tableProps() {
|
||||
return [
|
||||
{
|
||||
prop: "factory",
|
||||
label: "工厂名称",
|
||||
// filter: (val) => factoryList[val],
|
||||
minWidth: 200,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
// {
|
||||
// prop: "factory",
|
||||
// label: "工厂名称",
|
||||
// // filter: (val) => factoryList[val],
|
||||
// minWidth: 200,
|
||||
// showOverflowtooltip: true,
|
||||
// },
|
||||
{
|
||||
prop: "item",
|
||||
label: "科目",
|
||||
@@ -429,6 +444,24 @@ export default {
|
||||
dataArr(val) {
|
||||
this.tableData = val
|
||||
},
|
||||
currentMenu(val) {
|
||||
console.log(val)
|
||||
if (val === '瑞昌') {
|
||||
this.legendList = [
|
||||
{ id: 1, name: "FTO投入", type: 1, color: "#8EF0AB" },
|
||||
{ id: 2, name: "芯片产量", type: 1, color: "#288AFF" },
|
||||
{ id: 3, name: "标准组件产量", type: 1, color: "#64BDFF" },
|
||||
]
|
||||
} else {
|
||||
[
|
||||
{ id: 1, name: "FTO投入", type: 1, color: "#8EF0AB" },
|
||||
{ id: 2, name: "芯片产量", type: 1, color: "#288AFF" },
|
||||
{ id: 3, name: "标准组件产量", type: 1, color: "#64BDFF" },
|
||||
{ id: 4, name: "BIPV产量", type: 1, color: "#7164FF" },
|
||||
]
|
||||
}
|
||||
this.getDataList()
|
||||
},
|
||||
isOpen(val) {
|
||||
if (this.$route.name === "productionSituationTablets") {
|
||||
this.chartNum++;
|
||||
@@ -459,6 +492,11 @@ export default {
|
||||
this.getDataList()
|
||||
},
|
||||
methods: {
|
||||
handleChange() {
|
||||
this.listQuery.reportTime = []
|
||||
this.listQuery.end = null
|
||||
this.listQuery.start = null
|
||||
},
|
||||
objectSpanMethod({ row, column, rowIndex, columnIndex }) {
|
||||
let spanOneArr = [], concatOne = 0;
|
||||
// let spanTwoArr = [], concatTwo = 0;
|
||||
@@ -589,44 +627,73 @@ export default {
|
||||
this.chartMsgYearTarget.series[3].data = []
|
||||
}
|
||||
console.log(this.listQuery);
|
||||
if (!this.listQuery.startDate && !this.listQuery.endDate) {
|
||||
return this.$message('请选择起止时间')
|
||||
}
|
||||
let arr = []
|
||||
this.currentMenu === '邯郸' ? arr.push(1) : arr.push(0)
|
||||
this.listQuery.factory = arr
|
||||
const res = await getProduceSituationData(this.listQuery)
|
||||
if (this.listQuery.type === 2) {
|
||||
console.log(res.data.list.slice(res.data.list.length - 2, res.data.list.length));
|
||||
res.data.list.forEach((ele, index) => {
|
||||
let i = index + 1
|
||||
// this.chartMsg.xData.push(ele.titleValue.replace(/[^\d]/g, " "))
|
||||
this.otherProps.push({
|
||||
label: ele.titleValue,
|
||||
prop: 'value' + i
|
||||
})
|
||||
res.data.list.forEach((ele, index) => {
|
||||
let i = index + 1
|
||||
// this.chartMsg.xData.push(ele.titleValue.replace(/[^\d]/g, " "))
|
||||
this.otherProps.push({
|
||||
label: ele.titleValue,
|
||||
prop: 'value' + i
|
||||
})
|
||||
})
|
||||
let maxData = []
|
||||
res.data.list.forEach((ele, index) => {
|
||||
let i = index + 1
|
||||
let m = 'value' + i
|
||||
ele.productionSituationDataVOList.forEach((item) => {
|
||||
maxData.push(item.ftoInput, item.chipYield, item.componentYield)
|
||||
this.dataArr[0]['' + m + ''] = item.ftoInput
|
||||
// this.dataArr[3].factory = item.factory == 1 ? '邯郸' : '瑞昌'
|
||||
this.dataArr[1]['' + m + ''] = item.chipYield
|
||||
this.dataArr[2]['' + m + ''] = item.componentYield
|
||||
// this.dataArr[3]['' + m + ''] = item.bipvProductOutput
|
||||
if (this.dataArr[3]) {
|
||||
maxData.push(item.bipvProductOutput)
|
||||
this.dataArr[3]['' + m + ''] = item.bipvProductOutput
|
||||
}
|
||||
})
|
||||
this.chartMsg.yAxis.max = Math.ceil(Math.max(...maxData) / 100) * 100
|
||||
this.chartMsgTarget.yAxis.max = Math.ceil(Math.max(...maxData) / 100) * 100
|
||||
// ele.titleValue
|
||||
// .push({
|
||||
// label: ele.titleValue,
|
||||
// props: 'value' + index + 1,
|
||||
// })
|
||||
})
|
||||
if (this.listQuery.type === 2) {
|
||||
console.log(res.data.list.length);
|
||||
// res.data.list.forEach((ele) => {
|
||||
res.data.list.slice(0, res.data.list.length - 2).forEach((ele, index) => {
|
||||
res.data.list.slice(0, res.data.list.length - 3).forEach((ele, index) => {
|
||||
// let i = index + 1
|
||||
this.chartMsg.xData.push(ele.titleValue.replace(/[^\d]/g, " "))
|
||||
this.chartMsg.xData.push(ele.titleValue.slice(0, ele.titleValue.length-3))
|
||||
ele.productionSituationDataVOList.forEach((item) => {
|
||||
this.chartMsg.series[0].data.push({
|
||||
name: ele.titleValue,
|
||||
value: item.ftoInput
|
||||
value: item.ftoInput === 0 ? null : item.ftoInput
|
||||
})
|
||||
this.chartMsg.series[1].data.push({
|
||||
name: ele.titleValue,
|
||||
value: item.chipYield
|
||||
value: item.chipYield === 0 ? null : item.chipYield
|
||||
})
|
||||
this.chartMsg.series[2].data.push({
|
||||
name: ele.titleValue,
|
||||
value: item.componentYield
|
||||
})
|
||||
this.chartMsg.series[3].data.push({
|
||||
name: ele.titleValue,
|
||||
value: item.bipvProductOutput
|
||||
value: item.componentYield === 0 ? null : item.componentYield
|
||||
})
|
||||
if (this.dataArr[3]) {
|
||||
this.chartMsg.series[3].data.push({
|
||||
name: ele.titleValue,
|
||||
value: item.bipvProductOutput === 0 ? null : item.bipvProductOutput
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
this.chartMsgTarget.xData.push(res.data.list[res.data.list.length - 2].titleValue.replace(/[^\d]/g, " "))
|
||||
this.chartMsgTarget.xData.push(res.data.list[res.data.list.length - 2].titleValue)
|
||||
// this.chartMsgTarget.series = [{
|
||||
// name: "FTO投入",
|
||||
// data: [
|
||||
@@ -855,80 +922,53 @@ export default {
|
||||
ele.productionSituationDataVOList.forEach((item) => {
|
||||
this.chartMsgYearTarget.series[0].data.push({
|
||||
name: ele.titleValue,
|
||||
value: item.ftoInput
|
||||
value: item.ftoInput === 0 ? null : item.ftoInput
|
||||
})
|
||||
this.chartMsgYearTarget.series[1].data.push({
|
||||
name: ele.titleValue,
|
||||
value: item.chipYield
|
||||
value: item.chipYield === 0 ? null : item.chipYield
|
||||
})
|
||||
this.chartMsgYearTarget.series[2].data.push({
|
||||
name: ele.titleValue,
|
||||
value: item.componentYield
|
||||
})
|
||||
this.chartMsgYearTarget.series[3].data.push({
|
||||
name: ele.titleValue,
|
||||
value: item.bipvProductOutput
|
||||
value: item.componentYield === 0 ? null : item.componentYield
|
||||
})
|
||||
if (this.dataArr[3]) {
|
||||
this.chartMsgYearTarget.series[3].data.push({
|
||||
name: ele.titleValue,
|
||||
value: item.bipvProductOutput === 0 ? null : item.bipvProductOutput
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
// })
|
||||
console.log(this.chartMsg.xData)
|
||||
res.data.list.forEach((ele, index) => {
|
||||
let i = index + 1
|
||||
let m = 'value' + i
|
||||
ele.productionSituationDataVOList.forEach((item) => {
|
||||
this.dataArr[0]['' + m + ''] = item.ftoInput
|
||||
this.dataArr[0].factory = item.factory == 1 ? '邯郸' : '瑞昌'
|
||||
this.dataArr[1].factory = item.factory == 1 ? '邯郸' : '瑞昌'
|
||||
this.dataArr[2].factory = item.factory == 1 ? '邯郸' : '瑞昌'
|
||||
// this.dataArr[3].factory = item.factory == 1 ? '邯郸' : '瑞昌'
|
||||
this.dataArr[1]['' + m + ''] = item.chipYield
|
||||
this.dataArr[2]['' + m + ''] = item.componentYield
|
||||
// this.dataArr[3]['' + m + ''] = item.bipvProductOutput
|
||||
if (this.dataArr[3]) {
|
||||
this.dataArr[3].factory = item.factory == 1 ? '邯郸' : '瑞昌'
|
||||
this.dataArr[3]['' + m + ''] = item.bipvProductOutput
|
||||
}
|
||||
})
|
||||
// ele.titleValue
|
||||
// .push({
|
||||
// label: ele.titleValue,
|
||||
// props: 'value' + index + 1,
|
||||
// })
|
||||
})
|
||||
} else if (this.listQuery.type === 1 || this.listQuery.type === 0) {
|
||||
console.log(res.data.list.slice(res.data.list.length - 2, res.data.list.length));
|
||||
res.data.list.forEach((ele, index) => {
|
||||
let i = index + 1
|
||||
// this.chartMsg.xData.push(ele.titleValue.replace(/[^\d]/g, " "))
|
||||
this.otherProps.push({
|
||||
label: ele.titleValue,
|
||||
prop: 'value' + i
|
||||
})
|
||||
})
|
||||
// console.log(res.data.list.slice(res.data.list.length - 2, res.data.list.length));
|
||||
// res.data.list.forEach((ele) => {
|
||||
res.data.list.slice(0, res.data.list.length - 1).forEach((ele, index) => {
|
||||
res.data.list.slice(0, res.data.list.length - 2).forEach((ele, index) => {
|
||||
// let i = index + 1
|
||||
this.chartMsg.xData.push(ele.titleValue.replace(/[^\d]/g, " "))
|
||||
this.chartMsg.xData.push(ele.titleValue.slice(0, ele.titleValue.length - 3))
|
||||
ele.productionSituationDataVOList.forEach((item) => {
|
||||
this.chartMsg.series[0].data.push({
|
||||
name: ele.titleValue,
|
||||
value: item.ftoInput
|
||||
value: item.ftoInput === 0 ? null : item.ftoInput
|
||||
})
|
||||
this.chartMsg.series[1].data.push({
|
||||
name: ele.titleValue,
|
||||
value: item.chipYield
|
||||
value: item.chipYield === 0 ? null : item.chipYield
|
||||
})
|
||||
this.chartMsg.series[2].data.push({
|
||||
name: ele.titleValue,
|
||||
value: item.componentYield
|
||||
})
|
||||
this.chartMsg.series[3].data.push({
|
||||
name: ele.titleValue,
|
||||
value: item.bipvProductOutput
|
||||
value: item.componentYield === 0 ? null : item.componentYield
|
||||
})
|
||||
if (this.dataArr[3]) {
|
||||
this.chartMsg.series[3].data.push({
|
||||
name: ele.titleValue,
|
||||
value: item.bipvProductOutput === 0 ? null : item.bipvProductOutput
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
console.log(this.chartMsg.series[0]);
|
||||
this.chartMsgTarget.xData.push(res.data.list[res.data.list.length - 1].titleValue)
|
||||
// this.chartMsgTarget.series = [{
|
||||
// name: "FTO投入",
|
||||
@@ -1148,68 +1188,16 @@ export default {
|
||||
})
|
||||
|
||||
this.chartMsgTarget.series = [...fto, ...chip, ...std, ...bipv]
|
||||
res.data.list.forEach((ele, index) => {
|
||||
let i = index + 1
|
||||
let m = 'value' + i
|
||||
ele.productionSituationDataVOList.forEach((item) => {
|
||||
this.dataArr[0]['' + m + ''] = item.ftoInput
|
||||
this.dataArr[0].factory = item.factory == 1 ? '邯郸' : '瑞昌'
|
||||
this.dataArr[1].factory = item.factory == 1 ? '邯郸' : '瑞昌'
|
||||
this.dataArr[2].factory = item.factory == 1 ? '邯郸' : '瑞昌'
|
||||
// this.dataArr[3].factory = item.factory == 1 ? '邯郸' : '瑞昌'
|
||||
this.dataArr[1]['' + m + ''] = item.chipYield
|
||||
this.dataArr[2]['' + m + ''] = item.componentYield
|
||||
// this.dataArr[3]['' + m + ''] = item.bipvProductOutput
|
||||
if (this.dataArr[3]) {
|
||||
this.dataArr[3].factory = item.factory == 1 ? '邯郸' : '瑞昌'
|
||||
this.dataArr[3]['' + m + ''] = item.bipvProductOutput
|
||||
}
|
||||
})
|
||||
// ele.titleValue
|
||||
// .push({
|
||||
// label: ele.titleValue,
|
||||
// props: 'value' + index + 1,
|
||||
// })
|
||||
})
|
||||
} else {
|
||||
// if (this.currentMenu !== '瑞昌') {
|
||||
res.data.list.forEach((ele, index) => {
|
||||
let i = index + 1
|
||||
this.chartMsg.xData.push(ele.titleValue)
|
||||
this.otherProps.push({
|
||||
label: ele.titleValue,
|
||||
prop: 'value' + i
|
||||
})
|
||||
})
|
||||
console.log(this.otherProps)
|
||||
res.data.list.forEach((ele, index) => {
|
||||
let i = index + 1
|
||||
let m = 'value' + i
|
||||
ele.productionSituationDataVOList.forEach((item) => {
|
||||
this.dataArr[0]['' + m + ''] = item.ftoInput
|
||||
this.dataArr[0].factory = item.factory == 1 ? '邯郸' : '瑞昌'
|
||||
this.dataArr[1].factory = item.factory == 1 ? '邯郸' : '瑞昌'
|
||||
this.dataArr[2].factory = item.factory == 1 ? '邯郸' : '瑞昌'
|
||||
this.dataArr[1]['' + m + ''] = item.chipYield
|
||||
this.dataArr[2]['' + m + ''] = item.componentYield
|
||||
if (this.dataArr[3]) {
|
||||
this.dataArr[3].factory = item.factory == 1 ? '邯郸' : '瑞昌'
|
||||
this.dataArr[3]['' + m + ''] = item.bipvProductOutput
|
||||
}
|
||||
})
|
||||
// ele.titleValue
|
||||
// .push({
|
||||
// label: ele.titleValue,
|
||||
// props: 'value' + index + 1,
|
||||
// })
|
||||
})
|
||||
res.data.list.forEach((ele, index) => {
|
||||
this.chartMsg.xData.push(ele.titleValue)
|
||||
})
|
||||
for (let i in this.dataArr[0]) {
|
||||
this.chartMsg.series[0].name = this.dataArr[0]['item']
|
||||
if (i.search('value') === 0) {
|
||||
console.log("this.dataArr[0]['item']", this.dataArr[0]['item'], this.dataArr[0][i]);
|
||||
this.chartMsg.series[0].data.push({
|
||||
name: this.dataArr[0]['item'],
|
||||
value: this.dataArr[0][i]
|
||||
value: this.dataArr[0][i] === 0 ? null : this.dataArr[0][i]
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -1218,7 +1206,7 @@ export default {
|
||||
if (i.search('value') === 0) {
|
||||
this.chartMsg.series[1].data.push({
|
||||
name: this.dataArr[1]['item'],
|
||||
value: this.dataArr[1][i]
|
||||
value: this.dataArr[1][i] === 0 ? null : this.dataArr[1][i]
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -1227,7 +1215,7 @@ export default {
|
||||
if (i.search('value') === 0) {
|
||||
this.chartMsg.series[2].data.push({
|
||||
name: this.dataArr[2]['item'],
|
||||
value: this.dataArr[2][i]
|
||||
value: this.dataArr[2][i] === 0 ? null : this.dataArr[2][i]
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -1237,15 +1225,19 @@ export default {
|
||||
if (i.search('value') === 0) {
|
||||
this.chartMsg.series[3].data.push({
|
||||
name: this.dataArr[3]['item'],
|
||||
value: this.dataArr[3][i]
|
||||
value: this.dataArr[3][i] === 0 ? null : this.dataArr[3][i]
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
console.log(this.dataArr)
|
||||
console.log(this.tableData);
|
||||
// console.log(this.dataArr)
|
||||
// console.log(this.tableData);
|
||||
// this.$nextTick(() => {
|
||||
console.log(this.chartMsg.series)
|
||||
this.$refs.dayChart.getMes()
|
||||
this.$refs.dayTargetChart.getMes()
|
||||
this.$refs.chartYearTarget.getMes()
|
||||
this.tableData = this.dataArr
|
||||
this.showTable = !this.showTable
|
||||
// })
|
||||
|
||||
Reference in New Issue
Block a user