This commit is contained in:
zhangdingyu
2019-09-24 13:51:20 +08:00
parent 2287ae5df4
commit 5323473e15
4 changed files with 57 additions and 44 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 115 KiB

View File

@@ -26,9 +26,9 @@
<el-table <el-table
:data="tableDataA" :data="tableDataA"
border border
style="width: 100%;max-height: 450px;margin-top: 10px" style="width: 100%;max-height: 450px"
stripe
height="450px" height="450px"
highlight-current-row
size="small"> size="small">
<el-table-column <el-table-column
type="index" type="index"
@@ -82,6 +82,18 @@
@current-change="handleCurrentChange"/> @current-change="handleCurrentChange"/>
</div> </div>
</el-card> </el-card>
<!--<el-row>-->
<!--<el-col :xs="24" :sm="24" :lg="8">-->
<!--<el-card>-->
<!--<div id="myChart1" style="width: 1000px; height: 570px; margin: auto"/>-->
<!--</el-card>-->
<!--</el-col>-->
<!--<el-col :xs="24" :sm="24" :lg="8">-->
<!--<el-card>-->
<!--<div id="myChart2" style="width: 1000px; height: 570px; margin: auto"/>-->
<!--</el-card>-->
<!--</el-col>-->
<!--</el-row>-->
<el-card style="width: 49.8%; float: left;margin-right: 5px"> <el-card style="width: 49.8%; float: left;margin-right: 5px">
<div id="myChart1" style="width: 1000px; height: 570px; margin: auto"/> <div id="myChart1" style="width: 1000px; height: 570px; margin: auto"/>
</el-card> </el-card>
@@ -201,46 +213,48 @@ export default {
searchData1() { searchData1() {
getData2(this.MachineValue1, this.date1, this.date2).then(response => { getData2(this.MachineValue1, this.date1, this.date2).then(response => {
this.table = response.data this.table = response.data
console.log(this.table, 222)
}).then(() => { }).then(() => {
this.drawLine() this.drawLine()
}) if (!this.date1 || !this.date2) {
if (this.date1 === null || this.date2 === null) { this.$message.warning('请选择开始时间或结束时间')
this.$message.warning('请选择开始时间或结束时间')
} else {
const endYear = parseInt(this.date2.split('-')[0])
const startYear = parseInt(this.date1.split('-')[0])
const endMonth = parseInt(this.date2.split('-')[1])
const startMonth = parseInt(this.date1.split('-')[1])
const endDate = parseInt(this.date2.split('-')[2])
const startDate = parseInt(this.date1.split('-')[2])
let diff
if ((endMonth - startMonth) === 0) {
diff = endDate - startDate
}
if ((endMonth - startMonth) === 1) {
diff = endDate - startDate + 10
}
if ((endMonth - startMonth) > 1 || (endYear - startYear) !== 0) {
diff = 999
}
if (diff > 6) {
this.$message.warning('选择时间区间不得超过6天')
} else { } else {
searchState().then(response => { if (!this.MachineValue1) {
for (let i = 0; i < response.data.length; i++) { this.$message.warning('请选择工位')
this.colors.push(response.data[i].颜色) } else {
this.state.push(response.data[i].状态) const endYear = parseInt(this.date2.split('-')[0])
const startYear = parseInt(this.date1.split('-')[0])
const endMonth = parseInt(this.date2.split('-')[1])
const startMonth = parseInt(this.date1.split('-')[1])
const endDate = parseInt(this.date2.split('-')[2])
const startDate = parseInt(this.date1.split('-')[2])
let diff
if ((endMonth - startMonth) === 0) {
diff = endDate - startDate
} }
}) if ((endMonth - startMonth) === 1) {
getData3(this.MachineValue1, this.date1, this.date2).then(response => { diff = endDate - startDate + 10
this.table1 = response.data }
console.log(this.table1) if ((endMonth - startMonth) > 1 || (endYear - startYear) !== 0) {
}).then(() => { diff = 999
this.drawLine3() }
}) if (diff > 6) {
this.$message.warning('选择时间区间不得超过6天')
} else {
searchState().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.colors.push(response.data[i].颜色)
this.state.push(response.data[i].状态)
}
})
getData3(this.MachineValue1, this.date1, this.date2).then(response => {
this.table1 = response.data
}).then(() => {
this.drawLine3()
})
}
}
} }
} })
}, },
// 绘制图形 // 绘制图形
drawLine() { drawLine() {
@@ -248,7 +262,6 @@ export default {
const xData = [] const xData = []
const lineData = [] const lineData = []
for (let i = 0; i < this.table.length; i++) { for (let i = 0; i < this.table.length; i++) {
console.log(this.table[i].日期, 1111)
xData.push(this.table[i].日期.split(' ')[0]) xData.push(this.table[i].日期.split(' ')[0])
lineData.push(this.table[i].利用率.toFixed(2)) lineData.push(this.table[i].利用率.toFixed(2))
} }
@@ -304,8 +317,8 @@ export default {
myChart.clear() myChart.clear()
myChart.setOption({ myChart.setOption({
title: { title: {
text: '单台设备状态', text: this.MachineValue + '设备状态' + '(' + this.Time + ')',
x: 350 x: 250
}, },
tooltip: { tooltip: {
trigger: 'item', trigger: 'item',
@@ -344,8 +357,8 @@ export default {
myChart.clear() myChart.clear()
myChart.setOption({ myChart.setOption({
title: { title: {
text: '全员设备状态', text: '全员设备状态' + '(' + this.Time + ')',
x: 350 x: 300
}, },
tooltip: { tooltip: {
trigger: 'item', trigger: 'item',

View File

@@ -4447,7 +4447,7 @@ export default {
font-weight: bold; font-weight: bold;
} }
.el-card{ .el-card{
margin: 5px 10px 5px 10px; margin: 0;
} }
.showDiv{ .showDiv{
height: 380px; height: 380px;

View File

@@ -87,7 +87,7 @@
<el-button type="baocun" size="small" icon="el-icon-download" style="margin-left: 10px" @click="saveMateriel">保存</el-button> <el-button type="baocun" size="small" icon="el-icon-download" style="margin-left: 10px" @click="saveMateriel">保存</el-button>
</el-tooltip> </el-tooltip>
</div> </div>
<el-table v-loading="" :data="tableData2" border stripe h style="max-height: 460px;" height="230px" size="mini" highlight-current-row @row-click="searchTable3"> <el-table v-loading="" :data="tableData2" border stripe style="max-height: 460px;" height="230px" size="mini" highlight-current-row @row-click="searchTable3">
<el-table-column label="单号状态" align="center" width="100" fixed="left"> <el-table-column label="单号状态" align="center" width="100" fixed="left">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag v-if="Number(scope.row.采购计划状态)===0" type="warning" size="mini">编辑中</el-tag> <el-tag v-if="Number(scope.row.采购计划状态)===0" type="warning" size="mini">编辑中</el-tag>