|
@@ -297,6 +297,7 @@
|
|
|
<!-- 折线图 -->
|
|
|
<el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogECharts" :close-on-click-modal="false" width="80%">
|
|
|
<div>
|
|
|
+ <h3 style="text-align: center;"> 月总用量: {{mountTotal}} 吨</h3>
|
|
|
<div id="chart7" style="width: 100%;height:400px;" />
|
|
|
</div>
|
|
|
|
|
@@ -312,7 +313,7 @@
|
|
|
// 引入
|
|
|
require('script-loader!file-saver')
|
|
|
import echarts from 'echarts'
|
|
|
-import { GetDataByName, GetDataByNames, PostDataByName, checkButtons, ExecDataByConfig, GetAccount,GetReportform } from '@/api/common'
|
|
|
+import { GetDataByName, GetDataByNames, PostDataByName, checkButtons, ExecDataByConfig, GetAccount,GetReportform, getJson } from '@/api/common'
|
|
|
import waves from '@/directive/waves'
|
|
|
import { parseTime, sortChange } from '@/utils/index.js'
|
|
|
import Pagination from '@/components/Pagination' // secondary package based on el-pagination
|
|
@@ -326,6 +327,10 @@ export default {
|
|
|
directives: { waves },
|
|
|
data() {
|
|
|
return {
|
|
|
+ mountTotal:0,
|
|
|
+ pastureName: Cookies.get('pasturename'),
|
|
|
+ year: new Date().getFullYear(),
|
|
|
+ month: new Date().getMonth() < 9 ? '0' + (new Date().getMonth() + 1) : new Date().getMonth() + 1,
|
|
|
myHeight:document.documentElement.clientHeight - 85- 200,
|
|
|
isokDisable: false,
|
|
|
isWaterAdd: [],
|
|
@@ -518,11 +523,47 @@ export default {
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
+ // 水年度每月总用量
|
|
|
+ // 各牧场年度用水量对比
|
|
|
+ getChart1() {
|
|
|
+ let date = new Date();
|
|
|
+ let year = date.getFullYear()
|
|
|
+ let month = date.getMonth() + 1
|
|
|
+ let startTime = ''
|
|
|
+ let endTime = ''
|
|
|
+ let lastDay = new Date(year, month, 0).getDate();
|
|
|
+ if(this.getdataListParm.parammaps.inputDatetime !== null && this.getdataListParm.parammaps.inputDatetime.length > 0){
|
|
|
+ startTime = parseTime(this.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}') + '-01'
|
|
|
+ endTime = parseTime(this.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}') + '-' + lastDay
|
|
|
+ }else{
|
|
|
+ startTime = parseTime(new Date(), '{y}-{m}') + '-01'
|
|
|
+ endTime = parseTime(new Date(), '{y}-{m}') + '-' + lastDay
|
|
|
+ }
|
|
|
+ let datas = {
|
|
|
+ name: "getPastureSumMonthWater",
|
|
|
+ parammaps: {
|
|
|
+ startTime: startTime,
|
|
|
+ endTime: endTime,
|
|
|
+ pastureName: this.pastureName.toString(),
|
|
|
+ },
|
|
|
+ }
|
|
|
+ GetReportform(datas).then(response => {
|
|
|
+ console.log('牧场每月用水量', response.data.chart_data.nowYear[0])
|
|
|
+ if (response.data) {
|
|
|
+ this.mountTotal = response.data.chart_data.nowYear[0][0]
|
|
|
+ }else{
|
|
|
+ this.mountTotal = 0;
|
|
|
+ }
|
|
|
+ console.log('this.mountTotal', this.mountTotal)
|
|
|
+ })
|
|
|
+
|
|
|
+ },
|
|
|
// 折线图
|
|
|
- formEchart() {
|
|
|
+ formEchart(){
|
|
|
this.dialogECharts = true;
|
|
|
this.dialogStatus = 'echarts'
|
|
|
this.getChart7();
|
|
|
+
|
|
|
},
|
|
|
// XX月每日用水量
|
|
|
getChart7() {
|
|
@@ -535,7 +576,7 @@ export default {
|
|
|
this.getChart7Parm.parammaps.endTime = ''
|
|
|
this.getChart7Parm.parammaps.date = parseTime(new Date(), '{y}-{m}')
|
|
|
}
|
|
|
-
|
|
|
+ this.getChart1();
|
|
|
let data = {
|
|
|
name:"getPastureSumDayWater",
|
|
|
parammaps:{
|