a
This commit is contained in:
@@ -26,9 +26,9 @@
|
||||
<el-table
|
||||
:data="tableDataA"
|
||||
border
|
||||
style="width: 100%;max-height: 450px;margin-top: 10px"
|
||||
style="width: 100%;max-height: 450px"
|
||||
stripe
|
||||
height="450px"
|
||||
highlight-current-row
|
||||
size="small">
|
||||
<el-table-column
|
||||
type="index"
|
||||
@@ -82,6 +82,18 @@
|
||||
@current-change="handleCurrentChange"/>
|
||||
</div>
|
||||
</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">
|
||||
<div id="myChart1" style="width: 1000px; height: 570px; margin: auto"/>
|
||||
</el-card>
|
||||
@@ -201,46 +213,48 @@ export default {
|
||||
searchData1() {
|
||||
getData2(this.MachineValue1, this.date1, this.date2).then(response => {
|
||||
this.table = response.data
|
||||
console.log(this.table, 222)
|
||||
}).then(() => {
|
||||
this.drawLine()
|
||||
})
|
||||
if (this.date1 === null || this.date2 === null) {
|
||||
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天!')
|
||||
if (!this.date1 || !this.date2) {
|
||||
this.$message.warning('请选择开始时间或结束时间')
|
||||
} 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].状态)
|
||||
if (!this.MachineValue1) {
|
||||
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
|
||||
}
|
||||
})
|
||||
getData3(this.MachineValue1, this.date1, this.date2).then(response => {
|
||||
this.table1 = response.data
|
||||
console.log(this.table1)
|
||||
}).then(() => {
|
||||
this.drawLine3()
|
||||
})
|
||||
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 {
|
||||
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() {
|
||||
@@ -248,7 +262,6 @@ export default {
|
||||
const xData = []
|
||||
const lineData = []
|
||||
for (let i = 0; i < this.table.length; i++) {
|
||||
console.log(this.table[i].日期, 1111)
|
||||
xData.push(this.table[i].日期.split(' ')[0])
|
||||
lineData.push(this.table[i].利用率.toFixed(2))
|
||||
}
|
||||
@@ -304,8 +317,8 @@ export default {
|
||||
myChart.clear()
|
||||
myChart.setOption({
|
||||
title: {
|
||||
text: '单台设备状态',
|
||||
x: 350
|
||||
text: this.MachineValue + '设备状态' + '(' + this.Time + ')',
|
||||
x: 250
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'item',
|
||||
@@ -344,8 +357,8 @@ export default {
|
||||
myChart.clear()
|
||||
myChart.setOption({
|
||||
title: {
|
||||
text: '全员设备状态',
|
||||
x: 350
|
||||
text: '全员设备状态' + '(' + this.Time + ')',
|
||||
x: 300
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'item',
|
||||
|
||||
@@ -4447,7 +4447,7 @@ export default {
|
||||
font-weight: bold;
|
||||
}
|
||||
.el-card{
|
||||
margin: 5px 10px 5px 10px;
|
||||
margin: 0;
|
||||
}
|
||||
.showDiv{
|
||||
height: 380px;
|
||||
|
||||
@@ -87,7 +87,7 @@
|
||||
<el-button type="baocun" size="small" icon="el-icon-download" style="margin-left: 10px" @click="saveMateriel">保存</el-button>
|
||||
</el-tooltip>
|
||||
</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">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="Number(scope.row.采购计划状态)===0" type="warning" size="mini">编辑中</el-tag>
|
||||
|
||||
Reference in New Issue
Block a user