|
@@ -10,17 +10,17 @@
|
|
|
<p style="position: absolute;top:-12px;left:40%;color:rgb(130, 165, 252);background:rgb(230, 243, 255);border:1px solid rgb(130, 165, 252);padding:10px;border-radius:10px">
|
|
|
燃动费用{{ total }}万元
|
|
|
</p>
|
|
|
- <el-radio-group v-model="radio1" class="group" @change="changeGroup()">
|
|
|
- <el-radio :label="1">集团</el-radio>
|
|
|
- <el-radio :label="2">一中心</el-radio>
|
|
|
- <el-radio :label="3">二中心</el-radio>
|
|
|
- <el-radio :label="4">三中心</el-radio>
|
|
|
+ <el-radio-group v-model="radio1" class="group" @change="changeGroup">
|
|
|
+ <el-radio :label="'集团'">集团</el-radio>
|
|
|
+ <el-radio :label="'一中心'"></el-radio>
|
|
|
+ <el-radio :label="'二中心'"></el-radio>
|
|
|
+ <el-radio :label="'三中心'"></el-radio>
|
|
|
</el-radio-group>
|
|
|
<el-col :span="24">
|
|
|
<div id="chart1" style="width: 100%;height:400px;" />
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
- <el-row style="position: relative;">
|
|
|
+ <el-row v-if="isChart1" style="position: relative;">
|
|
|
<p style="position: absolute;top:-12px;left:40%;color:rgb(130, 165, 252);background:rgb(230, 243, 255);border:1px solid rgb(130, 165, 252);padding:10px;border-radius:10px">
|
|
|
柴油用量
|
|
|
</p>
|
|
@@ -28,12 +28,12 @@
|
|
|
<div id="chart11" style="width: 100%;height:400px;" />
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
- <el-row style="position: relative;">
|
|
|
+ <el-row v-if="isChart1" style="position: relative;">
|
|
|
<el-col :span="24">
|
|
|
<div id="chart12" style="width: 100%;height:400px;" />
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
- <el-row style="position: relative;">
|
|
|
+ <el-row v-if="isChart1" style="position: relative;">
|
|
|
<el-col :span="24">
|
|
|
<div id="chart2" style="width: 100%;height:400px;" />
|
|
|
</el-col>
|
|
@@ -41,7 +41,7 @@
|
|
|
<el-row style="position: relative;">
|
|
|
<el-col :span="12">
|
|
|
<div style="height: 50px;">
|
|
|
- <el-select style="float: right;margin-right: 20px;" v-model="getChart4Parm.parammaps.pastureName" multiple :multiple-limit="5" collapse-tags placeholder="牧场" @change="changePasture()">
|
|
|
+ <el-select style="float: right;margin-right: 20px;" v-model="pastureName" multiple :multiple-limit="5" collapse-tags placeholder="牧场" @change="changePasture()">
|
|
|
<el-option v-for="item in pastureList" :key="item.id" :label="item.name" :value="item.name"> </el-option>
|
|
|
</el-select>
|
|
|
</div>
|
|
@@ -97,31 +97,30 @@ export default {
|
|
|
pastureList:[],
|
|
|
deptList:[{id:0,name:'挤奶处'},{id:1,name:'犊牛处'},{id:2,name:'办公室'},{id:3,name:'饲养处'},{id:4,name:'兽医处'},{id:5,name:'品控处'},{id:6,name:'设备处'}],
|
|
|
total: '',
|
|
|
- radio1:1,
|
|
|
+ radio1:'集团',
|
|
|
+ pastureName:'',
|
|
|
isChart1: [],
|
|
|
chart_data1: {},
|
|
|
getChart1Parm: {
|
|
|
- name: 'getpSumNowWater',
|
|
|
+ name: '',
|
|
|
parammaps: {
|
|
|
receiveTime: new Date().getFullYear(),
|
|
|
pastureName: Cookies.get('pasturename')
|
|
|
}
|
|
|
},
|
|
|
- radio11:1,
|
|
|
isChart11: [],
|
|
|
chart_data11: {},
|
|
|
getChart11Parm: {
|
|
|
- name: 'getpSumNowWater',
|
|
|
+ name: '',
|
|
|
parammaps: {
|
|
|
receiveTime: new Date().getFullYear(),
|
|
|
pastureName: Cookies.get('pasturename')
|
|
|
}
|
|
|
},
|
|
|
- radio12:1,
|
|
|
isChart12: [],
|
|
|
chart_data12: {},
|
|
|
getChart12Parm: {
|
|
|
- name: 'getpSumNowWater',
|
|
|
+ name: '',
|
|
|
parammaps: {
|
|
|
receiveTime: new Date().getFullYear(),
|
|
|
pastureName: Cookies.get('pasturename')
|
|
@@ -131,7 +130,7 @@ export default {
|
|
|
isChart2: [],
|
|
|
chart_data2: {},
|
|
|
getChart2Parm: {
|
|
|
- name: 'getpSumNowWater',
|
|
|
+ name: '',
|
|
|
parammaps: {
|
|
|
receiveTime: new Date().getFullYear(),
|
|
|
pastureName: Cookies.get('pasturename')
|
|
@@ -142,7 +141,7 @@ export default {
|
|
|
isChart3: [],
|
|
|
chart_data3: {},
|
|
|
getChart3Parm: {
|
|
|
- name: 'getpSumNowWater',
|
|
|
+ name: '',
|
|
|
parammaps: {
|
|
|
receiveTime: new Date().getFullYear(),
|
|
|
pastureName: Cookies.get('pasturename')
|
|
@@ -153,7 +152,7 @@ export default {
|
|
|
isChart4: [],
|
|
|
chart_data4: {},
|
|
|
getChart4Parm: {
|
|
|
- name: 'getpSumNowWater',
|
|
|
+ name: '',
|
|
|
parammaps: {
|
|
|
receiveTime: new Date().getFullYear(),
|
|
|
pastureName: Cookies.get('pasturename')
|
|
@@ -163,7 +162,7 @@ export default {
|
|
|
isChart5: [],
|
|
|
chart_data5: {},
|
|
|
getChart5Parm: {
|
|
|
- name: 'getpSumNowWater',
|
|
|
+ name: '',
|
|
|
parammaps: {
|
|
|
receiveTime: new Date().getFullYear(),
|
|
|
pastureName: Cookies.get('pasturename'),
|
|
@@ -174,7 +173,7 @@ export default {
|
|
|
isChart6: [],
|
|
|
chart_data6: {},
|
|
|
getChart6Parm: {
|
|
|
- name: 'getpSumNowWater',
|
|
|
+ name: '',
|
|
|
parammaps: {
|
|
|
receiveTime: new Date().getFullYear(),
|
|
|
pastureName: Cookies.get('pasturename')
|
|
@@ -183,7 +182,7 @@ export default {
|
|
|
isChart7: [],
|
|
|
chart_data7: {},
|
|
|
getChart7Parm: {
|
|
|
- name: 'getpSumNowWater',
|
|
|
+ name: '',
|
|
|
parammaps: {
|
|
|
receiveTime: new Date().getFullYear(),
|
|
|
pastureName: Cookies.get('pasturename')
|
|
@@ -192,7 +191,7 @@ export default {
|
|
|
isChart8: [],
|
|
|
chart_data8: {},
|
|
|
getChart8Parm: {
|
|
|
- name: 'getpSumNowWater',
|
|
|
+ name: '',
|
|
|
parammaps: {
|
|
|
receiveTime: new Date().getFullYear(),
|
|
|
pastureName: Cookies.get('pasturename')
|
|
@@ -201,7 +200,7 @@ export default {
|
|
|
isChart9: [],
|
|
|
chart_data9: {},
|
|
|
getChart9Parm: {
|
|
|
- name: 'getpSumNowWater',
|
|
|
+ name: '',
|
|
|
parammaps: {
|
|
|
receiveTime: new Date().getFullYear(),
|
|
|
pastureName: Cookies.get('pasturename')
|
|
@@ -211,16 +210,6 @@ export default {
|
|
|
},
|
|
|
created() {
|
|
|
this.get_select_list()
|
|
|
- this.getChart1()
|
|
|
- this.getChart11()
|
|
|
- this.getChart12()
|
|
|
- this.getChart2()
|
|
|
- this.getChart4()
|
|
|
- this.getChart5()
|
|
|
- this.getChart6()
|
|
|
- this.getChart7()
|
|
|
- this.getChart8()
|
|
|
- this.getChart9()
|
|
|
const that = this
|
|
|
GetDataByName({ 'name': 'getUserPCButtons', 'parammaps': { 'jwt_username': Cookies.get('name') }}).then(response => {
|
|
|
that.buttons = response.data.list
|
|
@@ -238,6 +227,18 @@ export default {
|
|
|
this.pastureList = response.data.findAllPasture.list
|
|
|
})
|
|
|
},
|
|
|
+ changeMonth(){
|
|
|
+ if(this.isChart1){
|
|
|
+ this.getChart1()
|
|
|
+ this.getChart11()
|
|
|
+ this.getChart12()
|
|
|
+ this.getChart2()
|
|
|
+ }else{
|
|
|
+ this.pastureName = [Cookies.get('pasturename')]
|
|
|
+ this.getChart4()
|
|
|
+ this.getChart6()
|
|
|
+ }
|
|
|
+ },
|
|
|
changeGroup(){
|
|
|
this.getChart1()
|
|
|
this.getChart11()
|
|
@@ -249,7 +250,6 @@ export default {
|
|
|
this.getChart5()
|
|
|
this.getChart6()
|
|
|
this.getChart7()
|
|
|
-
|
|
|
},
|
|
|
changeDept(){
|
|
|
this.getChart5()
|
|
@@ -259,13 +259,23 @@ export default {
|
|
|
},
|
|
|
get_auto_buttons() {
|
|
|
// 图1
|
|
|
- const chart1 = 'report:queryWater:pastures'
|
|
|
+ const chart1 = 'report:queryCombustion:pastures'
|
|
|
const isChart1 = checkButtons(this.$store.state.user.buttons, chart1)
|
|
|
this.isChart1 = isChart1
|
|
|
+ if(this.isChart1){
|
|
|
+ this.getChart1()
|
|
|
+ this.getChart11()
|
|
|
+ this.getChart12()
|
|
|
+ this.getChart2()
|
|
|
+ }else{
|
|
|
+ this.pastureName = [Cookies.get('pasturename')]
|
|
|
+ this.getChart4()
|
|
|
+ this.getChart6()
|
|
|
+ }
|
|
|
},
|
|
|
// 各牧场燃动费用对比
|
|
|
getChart1() {
|
|
|
- let url = '/authdata/electricity/nowelectricity?'
|
|
|
+ let url = '/authdata/ignition/nowwater?'
|
|
|
let startTime = parseTime(this.monthDate[0],'{y}-{m}')
|
|
|
let endTime = parseTime(this.monthDate[1],'{y}-{m}')
|
|
|
let radio = ''
|
|
@@ -291,23 +301,14 @@ export default {
|
|
|
this.chart_data1.xdata = []
|
|
|
this.total = 0
|
|
|
}
|
|
|
- this.chart_data1 = {
|
|
|
- data1:[10,20,30,40,50],
|
|
|
- data2:[20,30,40,50,60],
|
|
|
- xdata:["马鞍山牧场", "汶上牧场", "商河牧场", "合肥牧场", "蚌埠牧场"]
|
|
|
- }
|
|
|
this.roadChart1(this.chart_data1)
|
|
|
this.getChart4()
|
|
|
- this.getChart5()
|
|
|
this.getChart6()
|
|
|
- this.getChart7()
|
|
|
- this.getChart8()
|
|
|
- this.getChart9()
|
|
|
})
|
|
|
},
|
|
|
// 各牧场柴油用量对比
|
|
|
getChart11() {
|
|
|
- let url = '/authdata/electricity/nowelectricity?'
|
|
|
+ let url = '/authdata/diesel/nowwater?'
|
|
|
let startTime = parseTime(this.monthDate[0],'{y}-{m}')
|
|
|
let endTime = parseTime(this.monthDate[1],'{y}-{m}')
|
|
|
let radio = ''
|
|
@@ -322,28 +323,20 @@ export default {
|
|
|
getJson(url,data).then(response => {
|
|
|
console.log('图11', response)
|
|
|
if(response.data){
|
|
|
- this.chart_data1.data1 = response.data.nowYear
|
|
|
- this.chart_data1.data2 = response.data.lastYear
|
|
|
- this.chart_data1.xdata = response.data.pasture
|
|
|
- this.pastureName = [response.data.pasture[0]]
|
|
|
- this.total = response.data.all
|
|
|
+ this.chart_data11.data1 = response.data.nowYear
|
|
|
+ this.chart_data11.data2 = response.data.lastYear
|
|
|
+ this.chart_data11.xdata = response.data.pasture
|
|
|
}else{
|
|
|
- this.chart_data1.data1 = []
|
|
|
- this.chart_data1.data2 = []
|
|
|
- this.chart_data1.xdata = []
|
|
|
- this.total = 0
|
|
|
- }
|
|
|
- this.chart_data11 = {
|
|
|
- data1:[10,20,30,40,50],
|
|
|
- data2:[20,30,40,50,60],
|
|
|
- xdata:["马鞍山牧场", "汶上牧场", "商河牧场", "合肥牧场", "蚌埠牧场"]
|
|
|
+ this.chart_data11.data1 = []
|
|
|
+ this.chart_data11.data2 = []
|
|
|
+ this.chart_data11.xdata = []
|
|
|
}
|
|
|
this.roadChart11(this.chart_data11)
|
|
|
})
|
|
|
},
|
|
|
// 单头牛柴油用量
|
|
|
getChart12() {
|
|
|
- let url = '/authdata/electricity/nowelectricity?'
|
|
|
+ let url = '/authdata/diesel/rate?'
|
|
|
let startTime = parseTime(this.monthDate[0],'{y}-{m}')
|
|
|
let endTime = parseTime(this.monthDate[1],'{y}-{m}')
|
|
|
let radio = ''
|
|
@@ -358,28 +351,20 @@ export default {
|
|
|
getJson(url,data).then(response => {
|
|
|
console.log('图12', response)
|
|
|
if(response.data){
|
|
|
- this.chart_data1.data1 = response.data.nowYear
|
|
|
- this.chart_data1.data2 = response.data.lastYear
|
|
|
- this.chart_data1.xdata = response.data.pasture
|
|
|
- this.pastureName = [response.data.pasture[0]]
|
|
|
- this.total = response.data.all
|
|
|
+ this.chart_data12.data1 = response.data.actual
|
|
|
+ this.chart_data12.line = response.data.line
|
|
|
+ this.chart_data12.xdata = response.data.pasture
|
|
|
}else{
|
|
|
- this.chart_data1.data1 = []
|
|
|
- this.chart_data1.data2 = []
|
|
|
- this.chart_data1.xdata = []
|
|
|
- this.total = 0
|
|
|
- }
|
|
|
- this.chart_data12 = {
|
|
|
- data1:[10,20,30,40,50],
|
|
|
- data2:[20,30,40,50,60],
|
|
|
- xdata:["马鞍山牧场", "汶上牧场", "商河牧场", "合肥牧场", "蚌埠牧场"]
|
|
|
+ this.chart_data12.data1 = []
|
|
|
+ this.chart_data12.line = 0
|
|
|
+ this.chart_data12.xdata = []
|
|
|
}
|
|
|
this.roadChart12(this.chart_data12)
|
|
|
})
|
|
|
},
|
|
|
// 单头牛燃动费用
|
|
|
getChart2() {
|
|
|
- let url = '/authdata/electricity/singlecow?'
|
|
|
+ let url = '/authdata/ignition/rate?'
|
|
|
let startTime = parseTime(this.monthDate[0],'{y}-{m}')
|
|
|
let endTime = parseTime(this.monthDate[1],'{y}-{m}')
|
|
|
let radio = ''
|
|
@@ -394,8 +379,8 @@ export default {
|
|
|
getJson(url,data).then(response => {
|
|
|
console.log('图2', response)
|
|
|
if(response.data){
|
|
|
- this.chart_data2.data1 = response.data.nowYear
|
|
|
- this.chart_data2.data2 = response.data.lastYear
|
|
|
+ this.chart_data2.data1 = response.data.actual
|
|
|
+ this.chart_data2.data2 = response.data.budget
|
|
|
this.chart_data2.xdata = response.data.pasture
|
|
|
this.chart_data2.line = response.data.line
|
|
|
}else{
|
|
@@ -404,100 +389,241 @@ export default {
|
|
|
this.chart_data2.xdata = []
|
|
|
this.chart_data2.line = 0
|
|
|
}
|
|
|
- this.chart_data2 = {
|
|
|
- data1:[10,20,30,40,50],
|
|
|
- data2:[20,30,40,50,60],
|
|
|
- data3:[30,40,50,60,70],
|
|
|
- xdata:["马鞍山牧场", "汶上牧场", "商河牧场", "合肥牧场", "蚌埠牧场"]
|
|
|
- }
|
|
|
this.roadChart2(this.chart_data2)
|
|
|
})
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
- // 牧场每月单头牛用水量对比
|
|
|
+ // 牧场每月单头牛用油量对比
|
|
|
getChart4() {
|
|
|
- GetReportform(this.getChart4Parm).then(response => {
|
|
|
+ this.getChart5Parm.parammaps.deptName = this.deptList[0].name
|
|
|
+ let url = '/authdata/diesel/perhead?'
|
|
|
+ let startTime = parseTime(this.monthDate[0],'{y}-{m}')
|
|
|
+ let endTime = parseTime(this.monthDate[1],'{y}-{m}')
|
|
|
+ let radio = ''
|
|
|
+ if(this.radio1 == '集团'){
|
|
|
+ radio = ''
|
|
|
+ }else{
|
|
|
+ radio = this.radio1
|
|
|
+ }
|
|
|
+ let pastureId = []
|
|
|
+ console.log(this.pastureList,'pastureList')
|
|
|
+ this.pastureList.forEach((item)=>{
|
|
|
+ if(this.pastureName){
|
|
|
+ this.pastureName.forEach((item1)=>{
|
|
|
+ if(item.name == item1){
|
|
|
+ pastureId.push(item.id)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ console.log(pastureId,'pastureId')
|
|
|
+ let data = 'startTime=' + startTime
|
|
|
+ + '&endTime=' + endTime
|
|
|
+ + '¢er=' + radio
|
|
|
+ + '&pastureId=' + pastureId.toString()
|
|
|
+ getJson(url,data).then(response => {
|
|
|
console.log('图4', response)
|
|
|
- // this.chart_data4 = response.data.chart_data
|
|
|
- this.chart_data4 = {
|
|
|
- data1:[
|
|
|
- {data:[10,20,30,40,50]},
|
|
|
- {data:[20,30,40,50,60]},
|
|
|
- {data:[30,40,50,60,70]},
|
|
|
- ],
|
|
|
- data_name:["马鞍山牧场", "汶上牧场", "商河牧场"],
|
|
|
- xdata:["2023-01", "2023-02", "2023-03", "2023-04", "2023-05"]
|
|
|
+ if(response.data){
|
|
|
+ this.chart_data4.data1 = response.data.data3
|
|
|
+ this.chart_data4.data_name = response.data.data1
|
|
|
+ this.chart_data4.xdata = response.data.data2
|
|
|
+ }else{
|
|
|
+ this.chart_data4.data1 = []
|
|
|
+ this.chart_data4.data_name = []
|
|
|
+ this.chart_data4.xdata = []
|
|
|
+ }
|
|
|
+ if(response.data.data1 == null){
|
|
|
+ this.chart_data4.data_name = []
|
|
|
+ }
|
|
|
+ if(response.data.data2 == null ){
|
|
|
+ this.chart_data4.xdata = []
|
|
|
+ this.getChart5Parm.parammaps.date = ''
|
|
|
+ }else{
|
|
|
+ this.getChart5Parm.parammaps.date = response.data.data2[0]
|
|
|
+ }
|
|
|
+ if(response.data.data3 == null){
|
|
|
+ this.chart_data4.data1 = []
|
|
|
}
|
|
|
+
|
|
|
+ console.log(this.chart_data4,'chart_data4')
|
|
|
this.roadChart4(this.chart_data4)
|
|
|
+ this.getChart5()
|
|
|
})
|
|
|
},
|
|
|
|
|
|
// XX月部门统计
|
|
|
getChart5() {
|
|
|
- GetReportform(this.getChart5Parm).then(response => {
|
|
|
+ let startTime = ''
|
|
|
+ let endTime = ''
|
|
|
+ if(this.getChart5Parm.parammaps.date !== ''){
|
|
|
+ startTime = parseTime(this.getChart5Parm.parammaps.date,'{y}-{m}') + '-01'
|
|
|
+ let date = new Date(this.getChart5Parm.parammaps.date);
|
|
|
+ let year = date.getFullYear()
|
|
|
+ let month = date.getMonth() + 1
|
|
|
+ let lastDay = new Date(year, month, 0).getDate();
|
|
|
+ endTime = parseTime(this.getChart5Parm.parammaps.date,'{y}-{m}') + '-' + lastDay
|
|
|
+ }else{
|
|
|
+ startTime = ''
|
|
|
+ endTime = ''
|
|
|
+ }
|
|
|
+ let data = {
|
|
|
+ name:"getdeptSumMonthDiesel",
|
|
|
+ parammaps:{
|
|
|
+ startTime:startTime,
|
|
|
+ endTime:endTime,
|
|
|
+ pastureName:this.pastureName.toString(),
|
|
|
+ departmentName:this.getChart5Parm.parammaps.deptName,
|
|
|
+ },
|
|
|
+ }
|
|
|
+ GetDataByName(data).then(response => {
|
|
|
console.log('图5', response)
|
|
|
- // this.chart_data5 = response.data.chart_data
|
|
|
+ let data1 = []
|
|
|
+ let xdata = []
|
|
|
+ if(response.data){
|
|
|
+ response.data.list.forEach((item)=>{
|
|
|
+ data1.push(item.value)
|
|
|
+ xdata.push(item.name)
|
|
|
+ })
|
|
|
+ }
|
|
|
this.chart_data5 = {
|
|
|
- data1:[10,20,30,40,50],
|
|
|
- data2:[20,30,40,50,60],
|
|
|
- xdata:["马鞍山牧场挤奶处", "和林牧场挤奶处", "蚌埠牧场挤奶处", "塞一牧场挤奶处", "塞二牧场挤奶处"]
|
|
|
+ data1:data1,
|
|
|
+ xdata:xdata
|
|
|
}
|
|
|
this.roadChart5(this.chart_data5)
|
|
|
})
|
|
|
},
|
|
|
// 牧场每月用油量对比
|
|
|
getChart6() {
|
|
|
- GetReportform(this.getChart6Parm).then(response => {
|
|
|
+ let startTime = parseTime(this.monthDate[0],'{y}-{m}') + '-01'
|
|
|
+ let date = this.monthDate[1];
|
|
|
+ let year = date.getFullYear()
|
|
|
+ let month = date.getMonth() + 1
|
|
|
+ let lastDay = new Date(year, month, 0).getDate();
|
|
|
+ let endTime = parseTime(this.monthDate[1],'{y}-{m}') + '-' + lastDay
|
|
|
+ let data = {
|
|
|
+ name:"getPastureSumMonthDiesel",
|
|
|
+ parammaps:{
|
|
|
+ startTime:startTime,
|
|
|
+ endTime:endTime,
|
|
|
+ pastureName:this.pastureName.toString(),
|
|
|
+ },
|
|
|
+ }
|
|
|
+ GetReportform(data).then(response => {
|
|
|
console.log('图6', response)
|
|
|
- // this.chart_data6 = response.data.chart_data
|
|
|
- this.chart_data6 = {
|
|
|
- data1:[10,20,30,40,50],
|
|
|
- data2:[20,30,40,50,60],
|
|
|
- data3:[30,40,50,60,70],
|
|
|
- xdata:["2023-01", "2023-02", "2023-03", "2023-04", "2023-05"]
|
|
|
+ if(response.data.chart_data){
|
|
|
+ this.chart_data6 = {
|
|
|
+ data1:response.data.chart_data.nowYear,
|
|
|
+ data_name:response.data.chart_data.pastureName,
|
|
|
+ xdata:response.data.chart_data.months
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ this.chart_data6 = {
|
|
|
+ data1:[],
|
|
|
+ data_name:[],
|
|
|
+ xdata:[]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(response.data.chart_data.months == null ){
|
|
|
+ this.getChart7Parm.parammaps.date = ''
|
|
|
+ }else{
|
|
|
+ this.getChart7Parm.parammaps.date = response.data.chart_data.months[0]
|
|
|
+ this.getChart8Parm.parammaps.date = response.data.chart_data.months[0]
|
|
|
+ this.getChart9Parm.parammaps.date = response.data.chart_data.months[0]
|
|
|
}
|
|
|
this.roadChart6(this.chart_data6)
|
|
|
+ this.getChart7()
|
|
|
+ this.getChart8()
|
|
|
})
|
|
|
},
|
|
|
// XX月每日用油量
|
|
|
getChart7() {
|
|
|
- GetReportform(this.getChart7Parm).then(response => {
|
|
|
+ let data = {
|
|
|
+ name:"getPastureSumDayDiesel",
|
|
|
+ parammaps:{
|
|
|
+ startTime:this.getChart7Parm.parammaps.date,
|
|
|
+ pastureName:this.pastureName.toString(),
|
|
|
+ },
|
|
|
+ }
|
|
|
+ GetReportform(data).then(response => {
|
|
|
console.log('图7', response)
|
|
|
- // this.chart_data7 = response.data.chart_data
|
|
|
- this.chart_data7 = {
|
|
|
- data1:[
|
|
|
- {data:[10,20,30,40,50]},
|
|
|
- {data:[20,30,40,50,60]},
|
|
|
- {data:[30,40,50,60,70]},
|
|
|
- ],
|
|
|
- data_name:["马鞍山牧场", "汶上牧场", "商河牧场"],
|
|
|
- xdata:["2023-01", "2023-02", "2023-03", "2023-04", "2023-05"]
|
|
|
+ if(response.data.chart_data){
|
|
|
+ this.chart_data7 = {
|
|
|
+ data1:response.data.chart_data.nowYear,
|
|
|
+ data_name:response.data.chart_data.pastureName,
|
|
|
+ xdata:response.data.chart_data.day
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ this.chart_data7 = {
|
|
|
+ data1:[],
|
|
|
+ data_name:[],
|
|
|
+ xdata:[]
|
|
|
+ }
|
|
|
}
|
|
|
this.roadChart7(this.chart_data7)
|
|
|
})
|
|
|
},
|
|
|
// XX月部门统计
|
|
|
getChart8() {
|
|
|
- GetReportform(this.getChart8Parm).then(response => {
|
|
|
+ let startTime = parseTime(this.getChart8Parm.parammaps.date,'{y}-{m}') + '-01'
|
|
|
+ let date = new Date(this.getChart8Parm.parammaps.date);
|
|
|
+ let year = date.getFullYear()
|
|
|
+ let month = date.getMonth() + 1
|
|
|
+ let lastDay = new Date(year, month, 0).getDate();
|
|
|
+ let endTime = parseTime(this.getChart8Parm.parammaps.date,'{y}-{m}') + '-' + lastDay
|
|
|
+ let data = {
|
|
|
+ name:"getdeptSumMonthDiesel",
|
|
|
+ parammaps:{
|
|
|
+ startTime:startTime,
|
|
|
+ endTime:endTime,
|
|
|
+ pastureName:this.pastureName.toString(),
|
|
|
+ departmentName:''
|
|
|
+ },
|
|
|
+ }
|
|
|
+ GetDataByName (data).then(response => {
|
|
|
console.log('图8', response)
|
|
|
+ let data1 = []
|
|
|
+ let xdata = []
|
|
|
+ if(response.data){
|
|
|
+ response.data.list.forEach((item)=>{
|
|
|
+ data1.push(item.value)
|
|
|
+ xdata.push(item.name)
|
|
|
+ })
|
|
|
+ }
|
|
|
this.chart_data8 = {
|
|
|
- data1:[10,20,30,40,50],
|
|
|
- data2:[20,30,40,50,60],
|
|
|
- xdata:["马鞍山牧场挤奶处", "和林牧场挤奶处", "蚌埠牧场挤奶处", "塞一牧场挤奶处", "塞二牧场挤奶处"]
|
|
|
+ data1:data1,
|
|
|
+ xdata:xdata
|
|
|
+ }
|
|
|
+ if(response.data.list){
|
|
|
+ this.getChart9Parm.parammaps.deptName = response.data.list[0].name
|
|
|
}
|
|
|
this.roadChart8(this.chart_data8)
|
|
|
+ this.getChart9()
|
|
|
})
|
|
|
},
|
|
|
- // XX部门用X统计
|
|
|
+ // XX部门用油量
|
|
|
getChart9() {
|
|
|
- GetReportform(this.getChart9Parm).then(response => {
|
|
|
+ let data = {
|
|
|
+ name:"geteqclassSumMonthDiesel",
|
|
|
+ parammaps:{
|
|
|
+ startTime:this.getChart9Parm.parammaps.date,
|
|
|
+ pastureName:this.pastureName.toString(),
|
|
|
+ deptName:this.getChart9Parm.parammaps.deptName
|
|
|
+ },
|
|
|
+ }
|
|
|
+ GetReportform(data).then(response => {
|
|
|
console.log('图9', response)
|
|
|
- this.chart_data9 = {
|
|
|
- data1:[10,20,30,40,50],
|
|
|
- data2:[20,30,40,50,60],
|
|
|
- xdata:["马鞍山牧场挤奶处", "和林牧场挤奶处", "蚌埠牧场挤奶处", "塞一牧场挤奶处", "塞二牧场挤奶处"]
|
|
|
+ if(response.data.chart_data){
|
|
|
+ this.chart_data9 = {
|
|
|
+ data1:response.data.eqCost,
|
|
|
+ xdata:response.data.typeName
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ this.chart_data9 = {
|
|
|
+ data1:[],
|
|
|
+ xdata:[]
|
|
|
+ }
|
|
|
}
|
|
|
this.roadChart9(this.chart_data9)
|
|
|
})
|
|
@@ -620,6 +746,7 @@ export default {
|
|
|
type: 'bar',
|
|
|
data: chart_data.data1,
|
|
|
barMaxWidth:20,
|
|
|
+ markLine:{ data:[ {yAxis:chart_data.line} ] },
|
|
|
emphasis: { label: { show: true, position: 'inside' }}
|
|
|
},
|
|
|
]
|
|
@@ -657,7 +784,7 @@ export default {
|
|
|
data: chart_data.data1,
|
|
|
emphasis: { label: { show: true, position: 'inside' }},
|
|
|
barMaxWidth:20,
|
|
|
- markLine:{ data:[ {yAxis:20} ] }
|
|
|
+ markLine:{ data:[ {yAxis:chart_data.line} ] }
|
|
|
},
|
|
|
{
|
|
|
name: '预算',
|
|
@@ -703,7 +830,7 @@ export default {
|
|
|
var item = {
|
|
|
name: chart_data.data_name[i],
|
|
|
type: 'line',
|
|
|
- data: chart_data.data1[i].data
|
|
|
+ data: chart_data.data1[i]
|
|
|
}
|
|
|
serie.push(item)
|
|
|
}
|
|
@@ -718,6 +845,7 @@ export default {
|
|
|
var that = this
|
|
|
that.chart4.on('click', function(param, i) {
|
|
|
console.log(param)
|
|
|
+ that.getChart5Parm.parammaps.date = param.name
|
|
|
that.getChart5()
|
|
|
})
|
|
|
},
|
|
@@ -727,7 +855,7 @@ export default {
|
|
|
this.chart5.dispose()
|
|
|
}
|
|
|
this.chart5 = echarts.init(document.getElementById('chart5'))
|
|
|
- var text = parseTime(new Date(), '{m}') + '月部门统计'
|
|
|
+ var text = this.getChart5Parm.parammaps.date + '月部门统计'
|
|
|
var option = {
|
|
|
title: { text: text, left:'center',textStyle: { color: '#769cfc' }},
|
|
|
tooltip: { trigger: 'axis' },
|
|
@@ -776,7 +904,7 @@ export default {
|
|
|
title: { text: '牧场每月用油量对比', left:'center',textStyle: { color: '#769cfc' }},
|
|
|
tooltip: { trigger: 'axis' },
|
|
|
legend: {
|
|
|
- data: ['去年同期用量', '今年用量'],
|
|
|
+ data: chart_data.data_name,
|
|
|
right: 40,
|
|
|
bottom:0
|
|
|
},
|
|
@@ -784,22 +912,20 @@ export default {
|
|
|
grid: { left: '3%', right: '10%', bottom: '4%', containLabel: true },
|
|
|
xAxis: [{ type: 'category', name: '月份',data: chart_data.xdata, axisLabel: { interval: 0, rotate: 30 }}],
|
|
|
yAxis: [{ type: 'value',name: '油量(升)' }],
|
|
|
- series: [
|
|
|
- {
|
|
|
- name: '去年同期用量',
|
|
|
- type: 'line',
|
|
|
- data: chart_data.data1,
|
|
|
- emphasis: { label: { show: true, position: 'inside' }},
|
|
|
- barMaxWidth:20
|
|
|
- },
|
|
|
- {
|
|
|
- name: '今年用量',
|
|
|
- type: 'line',
|
|
|
- data: chart_data.data2,
|
|
|
- emphasis: { label: { show: true, position: 'inside' }},
|
|
|
- barMaxWidth:20
|
|
|
+ series: (function() {
|
|
|
+ var serie = []
|
|
|
+ if(chart_data.data1 !== null){
|
|
|
+ for (var i = 0; i < chart_data.data1.length; i++) {
|
|
|
+ var item = {
|
|
|
+ name: chart_data.data_name[i],
|
|
|
+ type: 'line',
|
|
|
+ data: chart_data.data1[i]
|
|
|
+ }
|
|
|
+ serie.push(item)
|
|
|
+ }
|
|
|
}
|
|
|
- ]
|
|
|
+ return serie
|
|
|
+ }())
|
|
|
}
|
|
|
this.chart6.setOption(option)
|
|
|
window.onresize = function() {
|
|
@@ -807,17 +933,21 @@ export default {
|
|
|
}
|
|
|
var that = this
|
|
|
that.chart6.on('click', function(param, i) {
|
|
|
- console.log(param)
|
|
|
- that.roadChart7()
|
|
|
+ console.log(param,'======6')
|
|
|
+ that.getChart7Parm.parammaps.date = param.name
|
|
|
+ that.getChart7()
|
|
|
+ that.getChart8Parm.parammaps.date = param.name
|
|
|
+ that.getChart8()
|
|
|
})
|
|
|
},
|
|
|
// XX月每日用油量
|
|
|
roadChart7(chart_data) {
|
|
|
+ console.log(chart_data,'====you')
|
|
|
if (this.chart7 != null) {
|
|
|
this.chart7.dispose()
|
|
|
}
|
|
|
this.chart7 = echarts.init(document.getElementById('chart7'))
|
|
|
- var text = parseTime(new Date(), '{m}') + '月每日用油量'
|
|
|
+ var text = this.getChart7Parm.parammaps.date+ '月每日用油量'
|
|
|
var option = {
|
|
|
title: { text: text, left:'left',textStyle: { color: '#769cfc' }},
|
|
|
tooltip: { trigger: 'axis' },
|
|
@@ -837,7 +967,7 @@ export default {
|
|
|
var item = {
|
|
|
name: chart_data.data_name[i],
|
|
|
type: 'line',
|
|
|
- data: chart_data.data1[i].data
|
|
|
+ data: chart_data.data1[i]
|
|
|
}
|
|
|
serie.push(item)
|
|
|
}
|
|
@@ -860,7 +990,7 @@ export default {
|
|
|
this.chart8.dispose()
|
|
|
}
|
|
|
this.chart8 = echarts.init(document.getElementById('chart8'))
|
|
|
- var text = parseTime(new Date(), '{m}') + '月部门统计'
|
|
|
+ var text = this.getChart8Parm.parammaps.date + '月部门统计'
|
|
|
var option = {
|
|
|
title: { text: text, left:'center',textStyle: { color: '#769cfc' }},
|
|
|
tooltip: { trigger: 'axis' },
|
|
@@ -890,7 +1020,8 @@ export default {
|
|
|
var that = this
|
|
|
that.chart8.on('click', function(param, i) {
|
|
|
console.log(param)
|
|
|
- that.roadChart9()
|
|
|
+ that.getChart9Parm.parammaps.deptName = param.name
|
|
|
+ that.getChart9()
|
|
|
})
|
|
|
},
|
|
|
// XX部门用X量
|
|
@@ -899,7 +1030,7 @@ export default {
|
|
|
this.chart9.dispose()
|
|
|
}
|
|
|
this.chart9 = echarts.init(document.getElementById('chart9'))
|
|
|
- var text = 'XX部门用油量'
|
|
|
+ var text = this.getChart9Parm.parammaps.deptName +'用油量'
|
|
|
var option = {
|
|
|
title: { text: text, left:'center',textStyle: { color: '#769cfc' }},
|
|
|
tooltip: { trigger: 'axis' },
|