Browse Source

报表修改集团查看权限

duanxiaoduan 1 year ago
parent
commit
08cd5d3b92

File diff suppressed because it is too large
+ 0 - 0
dist/index.html


+ 25 - 27
src/views/report/queryCombustion/index.vue

@@ -288,7 +288,7 @@ export default {
                 + '&endTime=' + endTime
                 + '&center=' + radio
       getJson(url,data).then(response => {
-        console.log('图1', response)
+        console.log('各牧场燃动费用对比==>图1', response)
         if(response.data){
           this.chart_data1.data1 = response.data.nowYear
           this.chart_data1.data2 = response.data.lastYear
@@ -321,7 +321,7 @@ export default {
                 + '&endTime=' + endTime
                 + '&center=' + radio
       getJson(url,data).then(response => {
-        console.log('图11', response)
+        console.log('各牧场柴油用量对比==>图2', response)
         if(response.data){
           this.chart_data11.data1 = response.data.nowYear
           this.chart_data11.data2 = response.data.lastYear
@@ -349,7 +349,7 @@ export default {
                 + '&endTime=' + endTime
                 + '&center=' + radio
       getJson(url,data).then(response => {
-        console.log('图12', response)
+        console.log('单头牛柴油用量==>图3', response)
         if(response.data){
           this.chart_data12.data1 = response.data.actual
           this.chart_data12.line = response.data.line
@@ -377,7 +377,7 @@ export default {
                 + '&endTime=' + endTime
                 + '&center=' + radio
       getJson(url,data).then(response => {
-        console.log('图2', response)
+        console.log('单头牛燃动费用==>图4', response)
         if(response.data){
           this.chart_data2.data1 = response.data.actual
           this.chart_data2.data2 = response.data.budget
@@ -424,7 +424,7 @@ export default {
                 + '&center=' + radio
                 + '&pastureId=' + pastureId.toString()
       getJson(url,data).then(response => {
-        console.log('图4', response)
+        console.log('牧场每月单头牛用油量对比==>图5', response)
         if(response.data){
           this.chart_data4.data1 = response.data.data3
           this.chart_data4.data_name = response.data.data1
@@ -478,7 +478,7 @@ export default {
         },
       }
       GetDataByName(data).then(response => {
-        console.log('图5', response)
+        console.log('XX月部门统计==>图6', response)
         let data1 = []
         let xdata = []
         if(response.data){
@@ -511,7 +511,7 @@ export default {
         },
       }
       GetReportform(data).then(response => {
-        console.log('图6', response)
+        console.log('牧场每月用油量对比==>图7', response)
         if(response.data.chart_data){
           this.chart_data6 = {
             data1:response.data.chart_data.nowYear,
@@ -547,7 +547,7 @@ export default {
         },
       }
       GetReportform(data).then(response => {
-        console.log('图7', response)
+        console.log('XX月每日用油量==>图8', response)
         if(response.data.chart_data){
           this.chart_data7 = {
               data1:response.data.chart_data.nowYear,
@@ -582,7 +582,7 @@ export default {
         },
       }
       GetDataByName (data).then(response => {
-        console.log('图8', response)
+        console.log('XX月部门统计==>图9', response)
         let data1 = []
         let xdata = []
         if(response.data){
@@ -613,7 +613,7 @@ export default {
         },
       }
       GetReportform(data).then(response => {
-        console.log('图9', response)
+        console.log('XX部门用油量==>图10', response)
         if(response.data.chart_data){
           this.chart_data9 = {
             data1:response.data.eqCost,
@@ -669,7 +669,6 @@ export default {
       }
       var that = this
       that.chart1.on('click', function(param, i) {
-        console.log(param,'图一点击')
         that.pastureName = [param.name]
         that.getChart4()
         that.getChart5()
@@ -720,7 +719,7 @@ export default {
       }
       var that = this
       this.chart11.on('click', function(param, i) {
-        console.log(param)
+        // console.log(param)
       })
     },
     // 单头牛柴油用量
@@ -757,7 +756,7 @@ export default {
       }
       var that = this
       this.chart12.on('click', function(param, i) {
-        console.log(param)
+        // console.log(param)
       })
     },
     // 单头牛燃动费用
@@ -801,7 +800,7 @@ export default {
       }
       var that = this
       this.chart2.on('click', function(param, i) {
-        console.log(param)
+        // console.log(param)
       })
     },
     // 牧场每月单头牛用油量对比
@@ -819,7 +818,7 @@ export default {
           left: 40,
           bottom:0
         },
-        color: ['#2dc0e8', '#769cfc', '#FFB800'],
+        color: ['#eb123a','#eba612','#124feb','#15ab2e','#b20fdb'],
         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: '油量(升)'}],
@@ -844,7 +843,7 @@ export default {
       }
       var that = this
       that.chart4.on('click', function(param, i) {
-        console.log(param)
+        // console.log(param)
         that.getChart5Parm.parammaps.date = param.name
         that.getChart5()
       })
@@ -857,7 +856,7 @@ export default {
       this.chart5 = echarts.init(document.getElementById('chart5'))
       var text = this.getChart5Parm.parammaps.date + '月部门统计'
       var option = {
-        title: { text: text, left:'center',textStyle: { color: '#769cfc' }},
+        title: { text: text, left:'left',textStyle: { color: '#769cfc' }},
         tooltip: { trigger: 'axis' },
         legend: {
           data: ['实际', '预算'],
@@ -891,7 +890,7 @@ export default {
       }
       var that = this
       this.chart5.on('click', function(param, i) {
-        console.log(param)
+        // console.log(param)
       })
     },
     // 牧场每月用油量对比
@@ -901,14 +900,14 @@ export default {
       }
       this.chart6 = echarts.init(document.getElementById('chart6'))
       var option = {
-        title: { text: '牧场每月用油量对比', left:'center',textStyle: { color: '#769cfc' }},
+        title: { text: '牧场每月用油量对比', left:'left',textStyle: { color: '#769cfc' }},
         tooltip: { trigger: 'axis' },
         legend: {
           data: chart_data.data_name,
           right: 40,
           bottom:0
         },
-        color: ['#2dc0e8', '#769cfc'],
+        color: ['#eb123a','#eba612','#124feb','#15ab2e','#b20fdb'],
         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: '油量(升)' }],
@@ -942,7 +941,6 @@ export default {
     },
     // XX月每日用油量
     roadChart7(chart_data) {
-      console.log(chart_data,'====you')
       if (this.chart7 != null) {
         this.chart7.dispose()
       }
@@ -956,7 +954,7 @@ export default {
           left: 40,
           bottom:0
         },
-        color: ['#2dc0e8', '#769cfc', '#FFB800'],
+        color: ['#eb123a','#eba612','#124feb','#15ab2e','#b20fdb'],
         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: '油量(升)'}],
@@ -981,7 +979,7 @@ export default {
       }
       var that = this
       this.chart7.on('click', function(param, i) {
-        console.log(param)
+        // console.log(param)
       })
     },
     // XX月部门统计
@@ -992,7 +990,7 @@ export default {
       this.chart8 = echarts.init(document.getElementById('chart8'))
       var text =  this.getChart8Parm.parammaps.date + '月部门统计'
       var option = {
-        title: { text: text, left:'center',textStyle: { color: '#769cfc' }},
+        title: { text: text, left:'left',textStyle: { color: '#769cfc' }},
         tooltip: { trigger: 'axis' },
         legend: {
           data: ['实际用量'],
@@ -1019,7 +1017,7 @@ export default {
       }
       var that = this
       that.chart8.on('click', function(param, i) {
-        console.log(param)
+        // console.log(param)
         that.getChart9Parm.parammaps.deptName = param.name
         that.getChart9()
       })
@@ -1032,7 +1030,7 @@ export default {
       this.chart9 = echarts.init(document.getElementById('chart9'))
       var text = this.getChart9Parm.parammaps.deptName +'用油量'
       var option = {
-        title: { text: text, left:'center',textStyle: { color: '#769cfc' }},
+        title: { text: text, left:'left',textStyle: { color: '#769cfc' }},
         tooltip: { trigger: 'axis' },
         legend: {
           data: ['实际费用'],
@@ -1059,7 +1057,7 @@ export default {
       }
       var that = this
       this.chart9.on('click', function(param, i) {
-        console.log(param)
+        // console.log(param)
       })
     },
   }

+ 50 - 37
src/views/report/queryElec/index.vue

@@ -21,18 +21,18 @@
       </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>
     </el-row>
 
-    <el-row style="position: relative;">
+    <el-row v-if="isChart1" style="position: relative;">
       <el-col :span="24">
         <div id="chart3" 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="chart8" style="width: 100%;height:400px;" />
       </el-col>
@@ -167,10 +167,10 @@ export default {
   },
   created() {
     this.get_select_list()
-    this.getChart1()
-    this.getChart2()
-    this.getChart3()
-    this.getChart8()
+    // this.getChart1()
+    // this.getChart2()
+    // this.getChart3()
+    // this.getChart8()
     const that = this
     GetDataByName({ 'name': 'getUserPCButtons', 'parammaps': { 'jwt_username': Cookies.get('name') }}).then(response => {
       that.buttons = response.data.list
@@ -182,7 +182,7 @@ export default {
   methods: {
     get_select_list() {
       var send_data =  [
-        { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': 18 }},
+        { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
       ]
       this.pastureList = []
       GetDataByNames(send_data).then(response => {
@@ -197,13 +197,19 @@ export default {
       this.getChart1()
       this.getChart2()
       this.getChart3()
-      this.getChart4()
+      this.getChart8()
     },
     changeMonth(){
-      this.getChart1()
-      this.getChart2()
-      this.getChart3()
-      this.getChart8()
+     if(this.isChart1){
+       this.getChart1()
+       this.getChart2()
+       this.getChart3()
+       this.getChart8()
+     }else{
+       this.pastureName = [Cookies.get('pasturename')]
+       this.getChart4()
+       this.getChart6()
+     }
     },
     changePasture(){
       this.getChart4()
@@ -219,6 +225,16 @@ export default {
       const chart1 = 'report:queryWater:pastures'
       const isChart1 = checkButtons(this.$store.state.user.buttons, chart1)
       this.isChart1 = isChart1
+      if(this.isChart1){
+        this.getChart1()
+        this.getChart2()
+        this.getChart3()
+        this.getChart8()
+      }else{
+        this.pastureName = [Cookies.get('pasturename')]
+        this.getChart4()
+        this.getChart6()
+      }
     },
     // 各牧场年度用电量对比
     getChart1() {
@@ -235,7 +251,7 @@ export default {
                 + '&endTime=' + endTime
                 + '&center=' + radio
       getJson(url,data).then(response => {
-        console.log('图1', response)
+        console.log('各牧场年度用电量对比==>图1', response)
         if(response.data){
           this.chart_data1.data1 = response.data.nowYear
           this.chart_data1.data2 = response.data.lastYear
@@ -268,7 +284,7 @@ export default {
                 + '&endTime=' + endTime
                 + '&center=' + radio
       getJson(url,data).then(response => {
-        console.log('图2', response)
+        console.log('单头牛电量==>图2', response)
         if(response.data){
           this.chart_data2.data1 = response.data.nowYear
           this.chart_data2.data2 = response.data.lastYear
@@ -299,7 +315,7 @@ export default {
                 + '&endTime=' + endTime
                 + '&center=' + radio
       getJson(url,data).then(response => {
-        console.log('图3', response)
+        console.log('单头牛电费==>图3', response)
         if(response.data){
           this.chart_data3.data1 = response.data.actual
           this.chart_data3.xdata = response.data.pasture
@@ -326,7 +342,7 @@ export default {
         radio = this.radio1
       }
       let pastureId = []
-      console.log(this.pastureList,'pastureList')
+      // console.log(this.pastureList,'pastureList')
       this.pastureList.forEach((item)=>{
         if(this.pastureName){
           this.pastureName.forEach((item1)=>{
@@ -342,7 +358,7 @@ export default {
                 + '&center=' + radio
                 + '&pastureId=' + pastureId.toString()
       getJson(url,data).then(response => {
-        console.log('图4', response)
+        console.log('牧场每月单头牛用电量对比==>图5', response)
         if(response.data){
           this.chart_data4.data1 = response.data.data3
           this.chart_data4.data_name = response.data.data1
@@ -389,7 +405,7 @@ export default {
         },
       }
       GetDataByName(data).then(response => {
-        console.log('图5', response)
+        console.log('XX月部门统计==>图6', response)
         let data1 = []
         let xdata = []
         if(response.data){
@@ -422,7 +438,7 @@ export default {
         },
       }
       GetReportform(data).then(response => {
-        console.log('图6', response)
+        console.log('牧场每月用电量对比==>图7', response)
         // this.chart_data6 = response.data.chart_data
         if(response.data){
           this.chart_data6 = {
@@ -462,7 +478,7 @@ export default {
         },
       }
       GetReportform(data).then(response => {
-        console.log('图7', response)
+        console.log('XX月每日用电量==>图8', response)
         // this.chart_data7 = response.data.chart_data
         if(response.data){
           this.chart_data7 = {
@@ -490,7 +506,7 @@ export default {
                 + '&endTime=' + endTime
                 + '&center=' + radio
       getJson(url,data).then(response => {
-        console.log('图8', response)
+        console.log('电费完成率==>图4', response)
         if(response.data){
           this.chart_data8.data1 = response.data.actual
           this.chart_data8.data2 = response.data.budget
@@ -546,7 +562,6 @@ export default {
       }
       var that = this
       that.chart1.on('click', function(param, i) {
-        console.log(param,'=====param')
         that.pastureName = [param.name]
         that.getChart4()
         that.getChart6()
@@ -599,7 +614,7 @@ export default {
       }
       var that = this
       this.chart2.on('click', function(param, i) {
-        console.log(param)
+        // console.log(param)
       })
     },
     // 单头牛电费
@@ -642,18 +657,17 @@ export default {
       }
       var that = this
       this.chart3.on('click', function(param, i) {
-        console.log(param)
+        // console.log(param)
       })
     },
     // 各牧场XX年每月单头牛用电量对比
     roadChart4(chart_data) {
-      console.log(chart_data,'666')
       if (this.chart4 != null) {
         this.chart4.dispose()
       }
       this.chart4 = echarts.init(document.getElementById('chart4'))
       // var text = '各牧场' + parseTime(this.monthDate, '{y}') + '年每月单头牛用电量对比'
-      var text = ''
+      var text = '牧场每月单头牛用电量对比'
       var option = {
         title: { text: text, left:'left',textStyle: { color: '#769cfc' }},
         tooltip: { trigger: 'axis' },
@@ -662,7 +676,7 @@ export default {
           left: 40,
           bottom:0
         },
-        color: ['#2dc0e8', '#7ECF51', '#FFB800'],
+        color: ['#eb123a','#eba612','#124feb','#15ab2e','#b20fdb'],
         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: '用量(度)'}],
@@ -687,7 +701,6 @@ export default {
       }
       var that = this
       that.chart4.on('click', function(param, i) {
-        console.log(param)
         that.getChart5Parm.parammaps.date = param.name
         that.getChart5()
       })
@@ -700,7 +713,7 @@ export default {
       this.chart5 = echarts.init(document.getElementById('chart5'))
       var text = this.getChart5Parm.parammaps.date + '月部门统计'
       var option = {
-        title: { text: text, left:'center',textStyle: { color: '#769cfc' }},
+        title: { text: text, left:'left',textStyle: { color: '#769cfc' }},
         tooltip: { trigger: 'axis' },
         legend: {
           right: 40,
@@ -725,7 +738,7 @@ export default {
       }
       var that = this
       this.chart5.on('click', function(param, i) {
-        console.log(param)
+        // console.log(param)
       })
     },
     // XX牧场XX年每月用电量对比
@@ -736,14 +749,14 @@ export default {
       this.chart6 = echarts.init(document.getElementById('chart6'))
       var text = '牧场每月用电量对比'
       var option = {
-        title: { text: text, left:'center',textStyle: { color: '#769cfc' }},
+        title: { text: text, left:'left',textStyle: { color: '#769cfc' }},
         tooltip: { trigger: 'axis' },
         legend: {
           data: chart_data.data_name,
           right: 40,
           bottom:0
         },
-        color: ['#2dc0e8', '#769cfc', '#FFB800'],
+        color: ['#eb123a','#eba612','#124feb','#15ab2e','#b20fdb'],
         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: '电量(度)'}],
@@ -784,7 +797,7 @@ export default {
       }
       var that = this
       this.chart6.on('click', function(param, i) {
-        console.log(param)
+        // console.log(param)
         that.getChart7Parm.parammaps.date = param.name
         that.getChart7()
       })
@@ -805,7 +818,7 @@ export default {
           left: 40,
           bottom:0
         },
-        // color: ['#2dc0e8', '#769cfc', '#FFB800'],
+        color: ['#eb123a','#eba612','#124feb','#15ab2e','#b20fdb'],
         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: '电量(度)'}],
@@ -830,7 +843,7 @@ export default {
       }
       var that = this
       this.chart7.on('click', function(param, i) {
-        console.log(param)
+        // console.log(param)
       })
     },
     // 电费完成率
@@ -865,7 +878,7 @@ export default {
       }
       var that = this
       this.chart8.on('click', function(param, i) {
-        console.log(param)
+        // console.log(param)
       })
     },
   }

+ 200 - 29
src/views/report/queryRepair/index.vue

@@ -24,7 +24,7 @@
       </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>
@@ -62,8 +62,60 @@
         <div id="chart7" style="width: 100%;height:400px;" />
       </el-col>
     </el-row>
-  </div>
 
+    <el-dialog title="详情" :visible.sync="dialogFormVisibleCard" width="90%" :close-on-click-modal="false">
+      <div class="app-contentcard">
+      <el-form ref="rowSeeData" :model="rowSeeData" label-position="right" label-width="120px" style="width: 100%;margin:0 auto;">
+        <div class="filter-container">
+          <el-input v-model="getdataListParmSee.parammaps.eqName" placeholder="设备内部编号" clearable class="filter-item" style="width: 130px" />
+          <el-input v-model="getdataListParmSee.parammaps.assetCode" placeholder="资产编号" clearable class="filter-item" style="width: 130px" />
+          <el-date-picker ref="inputDatetime" v-model="getdataListParmSee.parammaps.inputDatetime" class="inputDatetime" type="datetimerange" style="width: 250px;top:-3px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="领用开始日期" end-placeholder="领用结束日期" />
+
+          <el-button class="filter-item" type="primary" icon="el-icon-search" @click="form_searchDelivery">搜索</el-button>
+          <el-button class="filter-item" style="margin-left: 10px;" type="success" icon="el-icon-edit" @click="handleDownloadDelivery">导出</el-button>
+        </div>
+      </el-form>
+      <el-table
+        :key="tableKey"
+        v-loading="listLoadingSee"
+        element-loading-text="给我一点时间"
+        :data="listSee"
+        border
+        fit
+        highlight-current-row
+        style="width: 100%;"
+        :row-style="rowStyle"
+        :cell-style="cellStyle"
+        class="elTable"
+      >
+        <el-table-column label="序号" align="center" type="index" width="50px">
+          <template slot-scope="scope">
+            <span>{{ scope.$index + (pageNumSee-1) * pageSizeSee + 1 }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="资产编号" min-width="110px" align="center" prop="assetCode" />
+        <el-table-column label="设备名称" min-width="110px" align="center" prop="eqName" />
+        <el-table-column label="设备内部编号" min-width="110px" align="center" prop="eqCode" />
+        <el-table-column label="设备规格" min-width="110px" align="center" prop="eqSpecification" />
+        <el-table-column label="领用日期" min-width="110px" align="center" prop="receiveTime" />
+        <el-table-column label="领用部门" min-width="110px" align="center" prop="deptName" />
+        <el-table-column label="备件编号" min-width="110px" align="center" prop="partCode" />
+        <el-table-column label="备件名称" min-width="110px" align="center" prop="partName" />
+        <el-table-column label="备件规格" min-width="110px" align="center" prop="specification" />
+        <el-table-column label="备件品牌" min-width="110px" align="center" prop="brandName" />
+        <el-table-column label="计量单位" min-width="110px" align="center" prop="unit" />
+        <el-table-column label="出库数量" min-width="110px" align="center" prop="checkoutNumber" />
+        <el-table-column label="退库数量" min-width="110px" align="center" prop="quitNumber" />
+        <el-table-column label="单价" min-width="110px" align="center" prop="price" />
+        <el-table-column label="总价" min-width="110px" align="center" prop="sumPrice" />
+    </el-table>
+    <pagination v-show="totalSee>=0" :total="totalSee" :page.sync="getdataListParmSee.offset" :limit.sync="getdataListParmSee.pagecount" @pagination="get_table_dataSee" />
+    <div slot="footer" class="dialog-footer" style="right:30px;position:absolute;bottom:10px">
+      <el-button @click="dialogFormVisibleCard = false">关闭</el-button>
+    </div>
+  </div>
+  </el-dialog>
+  </div>
 </template>
 
 <script>
@@ -71,8 +123,10 @@ import echarts from 'echarts'
 import { GetDataByName,GetDataByNames, GetReportform, checkButtons,getJson } from '@/api/common'
 import Cookies from 'js-cookie'
 import { parseTime } from '@/utils/index.js'
+import Pagination from '@/components/Pagination' // secondary package based on el-pagination
 export default {
-  name: 'QueryWater',
+  name: 'QueryRepair',
+  components: { Pagination },
   data() {
     return {
       monthDate: [new Date(),new Date()],
@@ -166,12 +220,39 @@ export default {
           pastureName: Cookies.get('pasturename')
         }
       },
+      tableKey: 0,
+      list: null,
+      total: 0,
+      listLoading: true,
+      rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
+      cellStyle: { padding: 0 + 'px' },
+      dialogFormVisibleCard: false,
+      listLoadingSee: true,
+      rowSeeData: {},
+      listSee: [],
+      totalSee: 0,
+      getdataListParmSee: {
+        name: 'geteqclassSumDay',
+        page: 1,
+        offset: 1,
+        pagecount: 10,
+        returntype: 'Map',
+        parammaps: {
+          receiveTime: new Date().getFullYear() + '-' + (new Date().getMonth() < 9 ? '0' + (new Date().getMonth() + 1) : new Date().getMonth() + 1),
+          deptName: '',
+          typeName: '',
+          assetCode: '',
+          eqName: '',
+          startTime: '',
+          stopTime: '',
+          pastureId: Cookies.get('pastureid'),
+          pastureName: Cookies.get('pasturename')
+        }
+      },
     }
   },
   created() {
     this.get_select_list()
-    this.getChart1()
-    this.getChart2()
     const that = this
     GetDataByName({ 'name': 'getUserPCButtons', 'parammaps': { 'jwt_username': Cookies.get('name') }}).then(response => {
       that.buttons = response.data.list
@@ -208,7 +289,13 @@ export default {
       } else {
         this.costTypeName = '所有维修费'
       }
-      this.getChart1()
+      if(this.isChart1){
+        this.getChart1()
+        this.getChart2()
+      }else{
+        this.getChart4()
+        this.getChart6()
+      }
     },
     changeGroup(){
       this.getChart1()
@@ -216,8 +303,14 @@ export default {
       this.getChart4()
     },
     changeMonth(){
-      this.getChart1()
-      this.getChart2()
+      if(this.isChart1){
+        this.getChart1()
+        this.getChart2()
+      }else{
+        this.pastureName = [Cookies.get('pasturename')]
+        this.getChart4()
+        this.getChart6()
+      }
     },
     changePasture(){
       // this.getChart4()
@@ -235,6 +328,14 @@ export default {
       const chart1 = 'report:queryWater:pastures'
       const isChart1 = checkButtons(this.$store.state.user.buttons, chart1)
       this.isChart1 = isChart1
+      if(this.isChart1){
+        this.getChart1()
+        this.getChart2()
+      }else{
+        this.pastureName = [Cookies.get('pasturename')]
+        this.getChart4()
+        this.getChart6()
+      }
     },
     // 各牧场维修费用对比
     getChart1() {
@@ -252,7 +353,7 @@ export default {
                 + '&center=' + radio
                 + '&departmentName=' + this.type
       getJson(url,data).then(response => {
-        console.log('图1', response)
+        console.log('各牧场维修费用对比==>图1', response)
         if(response.data){
           this.chart_data1.data1 = response.data.nowYear
           this.chart_data1.data2 = response.data.lastYear
@@ -285,7 +386,7 @@ export default {
                 + '&endTime=' + endTime
                 + '&center=' + radio
       getJson(url,data).then(response => {
-        console.log('图2', response)
+        console.log('单头牛维修费用==>图2', response)
         if(response.data){
           this.chart_data2.data1 = response.data.nowYear
           this.chart_data2.data2 = response.data.lastYear
@@ -321,7 +422,7 @@ export default {
         },
       }
       GetReportform(data).then(response => {
-        console.log('图4', response)
+        console.log('XX牧场每月维修费对比==>图3', response)
         if(response.data){
           this.chart_data4 = {
             data1:response.data.chart_data.lastYear,
@@ -344,13 +445,14 @@ export default {
         }else{
           this.getChart5Parm.parammaps.date = ''
         }
-        this.getChart5Parm.parammaps.deptName = this.deptList[0].name
         this.roadChart4(this.chart_data4)
+        this.getChart5Parm.parammaps.deptName = this.deptList[0].name
         this.getChart5()
       })
     },
     // XX月部门统计
     getChart5() {
+      console.log(this.getChart5Parm.parammaps.deptName,'deptName')
       let startTime = parseTime(this.getChart5Parm.parammaps.date,'{y}-{m}') + '-01'
       let date =  new Date(this.getChart5Parm.parammaps.date);
       let year = date.getFullYear()
@@ -367,7 +469,7 @@ export default {
         },
       }
       GetReportform(data).then(response => {
-        console.log('图5', response)
+        console.log('XX部门维修费用==>图4', response)
         if(response.data.chart_data){
           this.chart_data5 = {
             data1:response.data.chart_data.eqCost,
@@ -408,14 +510,14 @@ export default {
                 + '&center=' + radio
                 + '&pastureId=' + pastureId.toString()
       getJson(url,data).then(response => {
-        console.log('图4', response)
+        console.log('牧场每月单头牛维修费对比==>图5', response)
         if(response.data){
           this.chart_data6.data1 = response.data.data3
-          this.chart_data6.data_name = ['去年同期','今年用量','预算']
+          this.chart_data6.data_name = response.data.data1
           this.chart_data6.xdata = response.data.data2
         }else{
           this.chart_data6.data1 = []
-          this.chart_data6.data_name = ['去年同期','今年用量','预算']
+          this.chart_data6.data_name = []
           this.chart_data6.xdata = []
           this.chart_data6.line =0
         }
@@ -431,8 +533,6 @@ export default {
         if(response.data.data3 == null){
           this.chart_data6.data1 = []
         }
-
-        console.log(this.chart_data6,'chart_data6')
         this.roadChart6(this.chart_data6)
         this.getChart7Parm.parammaps.deptName = this.deptList[0].name
         this.getChart7()
@@ -456,7 +556,7 @@ export default {
         },
       }
       GetDataByName(data).then(response => {
-        console.log('图7', response)
+        console.log('XX月部门统计==>图6', response)
         // this.chart_data7 = response.data.chart_data
         if(response.data){
           var data1 = []
@@ -524,7 +624,6 @@ export default {
       }
       var that = this
       that.chart1.on('click', function(param, i) {
-        console.log(param,'=====param')
         that.pastureName = [param.name]
         that.getChart4()
         that.getChart6()
@@ -577,7 +676,7 @@ export default {
       }
       var that = this
       this.chart2.on('click', function(param, i) {
-        console.log(param)
+        // console.log(param)
       })
     },
     // XX牧场每月维修费对比
@@ -596,7 +695,7 @@ export default {
           left: 40,
           bottom:0
         },
-        color: ['#2dc0e8', '#7ECF51', '#FFB800'],
+        color: ['#eb123a','#eba612','#124feb','#15ab2e','#b20fdb'],
         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: '费用(元)'}],
@@ -621,7 +720,7 @@ export default {
       }
       var that = this
       that.chart4.on('click', function(param, i) {
-        console.log(param)
+        // console.log(param)
         that.getChart5Parm.parammaps.date = param.name
         that.getChart5()
       })
@@ -634,7 +733,7 @@ export default {
       this.chart5 = echarts.init(document.getElementById('chart5'))
       var text = this.pastureName + this.getChart5Parm.parammaps.deptName + '维修费用'
       var option = {
-        title: { text: text, left:'center',textStyle: { color: '#769cfc' }},
+        title: { text: text, left:'left',textStyle: { color: '#769cfc' }},
         tooltip: { trigger: 'axis' },
         legend: {
           right: 40,
@@ -659,7 +758,11 @@ export default {
       }
       var that = this
       this.chart5.on('click', function(param, i) {
-        console.log(param)
+        // console.log(param)
+        that.getdataListParmSee.parammaps.typeName = param.name
+        that.getdataListParmSee.offset = 1
+        that.get_table_dataSee()
+        that.dialogFormVisibleCard = true
       })
     },
     // 牧场每月单头牛维修费对比
@@ -670,14 +773,14 @@ export default {
       this.chart6 = echarts.init(document.getElementById('chart6'))
       var text = '牧场每月单头牛维修费对比'
       var option = {
-        title: { text: text, left:'center',textStyle: { color: '#769cfc' }},
+        title: { text: text, left:'left',textStyle: { color: '#769cfc' }},
         tooltip: { trigger: 'axis' },
         legend: {
           data: chart_data.data_name,
           right: 40,
           bottom:0
         },
-        color: ['#2dc0e8', '#769cfc', '#FFB800'],
+        color: ['#eb123a','#eba612','#124feb','#15ab2e','#b20fdb'],
         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: '费用(元)'}],
@@ -702,7 +805,7 @@ export default {
       }
       var that = this
       this.chart6.on('click', function(param, i) {
-        console.log(param)
+        // console.log(param)
         that.getChart7Parm.parammaps.date = param.name
         that.getChart7()
       })
@@ -750,7 +853,75 @@ export default {
       }
       var that = this
       this.chart7.on('click', function(param, i) {
-        console.log(param)
+        // console.log(param)
+      })
+    },
+    form_searchDelivery() {
+      if (this.getdataListParmSee.parammaps.inputDatetime == null) {
+        this.getdataListParmSee.parammaps.startTime = ''
+        this.getdataListParmSee.parammaps.stopTime = ''
+      }
+      this.getdataListParmSee.offset = 1
+      this.get_table_dataSee()
+    },
+    get_table_dataSee() {
+      if (this.getdataListParmSee.parammaps.inputDatetime !== undefined && this.getdataListParmSee.parammaps.inputDatetime !== null) {
+        this.getdataListParmSee.parammaps.startTime = this.$refs['inputDatetime'].value[0]
+        this.getdataListParmSee.parammaps.stopTime = this.$refs['inputDatetime'].value[1]
+      } else {
+        this.getdataListParmSee.parammaps.startTime = ''
+        this.getdataListParmSee.parammaps.stopTime = ''
+      }
+
+      GetDataByName(this.getdataListParmSee).then(response => {
+        this.listSee = response.data.list
+        console.log('记录列表数据', response.data.list)
+        this.pageNumSee = response.data.pageNum
+        this.pageSizeSee = response.data.pageSize
+        if (response.data.total) {
+          this.totalSee = response.data.total
+        }
+        // Just to simulate the time of the request
+        setTimeout(() => {
+          this.listLoadingSee = false
+        }, 300)
+      })
+    },
+    handleDownloadDelivery() {
+      this.$alert('正在导出中,请勿刷新或离开本页面,若导出时间过长,建议缩小导出数据范围重新导出', {})
+      this.isPercentage = true
+      this.percentage = 1
+      var timer = setInterval(() => {
+        this.percentage += 5
+        if (this.percentage > 95) {
+          this.percentage = 99
+          clearInterval(timer)
+        }
+        this.percentage = this.percentage
+      }, 1000)
+      this.downLoadParm.name = 'geteqclassSumDay'
+      this.downLoadParm.returntype = 'Map'
+      this.downLoadParm.parammaps = this.getdataListParmSee.parammaps
+      GetAccount(this.downLoadParm).then(response => {
+        if (response.data.list !== '') {
+          this.percentage = 99
+          setTimeout(() => {
+            this.isPercentage = false
+          }, 2000)
+        }
+        this.$nextTick(() => {
+          this.downLoadList = response.data.list
+          console.log(this.downLoadList)
+          const ExcelDatas = [
+            {
+              tHeader: ['资产编号', '设备名称', '设备内部编号', '设备规格', '领用日期', '领用部门', '备件编号', '备件名称', '备件规格', '备件品牌', '计量单位', '出库数量', '退库数量', '单价', '总价'],
+              filterVal: ['assetCode', 'eqName', 'eqCode', 'eqSpecification', 'receiveTime', 'deptName', 'partCode', 'partName', 'specification', 'brandName', 'unit', 'checkoutNumber', 'quitNumber', 'price', 'sumPrice'],
+              tableDatas: this.downLoadList,
+              sheetName: '设备维修费用'
+            }
+          ]
+          json2excel(ExcelDatas, '设备维修费用', true, 'xlsx')
+        })
       })
     },
   }

+ 41 - 34
src/views/report/queryWater/index.vue

@@ -21,18 +21,18 @@
       </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>
     </el-row>
 
-    <el-row style="position: relative;">
+    <el-row v-if="isChart1" style="position: relative;">
       <el-col :span="24">
         <div id="chart3" 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="chart8" style="width: 100%;height:400px;" />
       </el-col>
@@ -167,10 +167,6 @@ export default {
   },
   created() {
     this.get_select_list()
-    this.getChart1()
-    this.getChart2()
-    this.getChart3()
-    this.getChart8()
     const that = this
     GetDataByName({ 'name': 'getUserPCButtons', 'parammaps': { 'jwt_username': Cookies.get('name') }}).then(response => {
       that.buttons = response.data.list
@@ -182,7 +178,7 @@ export default {
   methods: {
     get_select_list() {
       var send_data =  [
-        { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': 18 }},
+        { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
       ]
       this.pastureList = []
       GetDataByNames(send_data).then(response => {
@@ -197,13 +193,19 @@ export default {
       this.getChart1()
       this.getChart2()
       this.getChart3()
-      this.getChart4()
+      this.getChart8()
     },
     changeMonth(){
-      this.getChart1()
-      this.getChart2()
-      this.getChart3()
-      this.getChart8()
+      if(this.isChart1){
+        this.getChart1()
+        this.getChart2()
+        this.getChart3()
+        this.getChart8()
+      }else{
+        this.pastureName = [Cookies.get('pasturename')]
+        this.getChart4()
+        this.getChart6()
+      }
     },
     changePasture(){
       this.getChart4()
@@ -219,6 +221,16 @@ export default {
       const chart1 = 'report:queryWater:pastures'
       const isChart1 = checkButtons(this.$store.state.user.buttons, chart1)
       this.isChart1 = isChart1
+      if(this.isChart1){
+        this.getChart1()
+        this.getChart2()
+        this.getChart3()
+        this.getChart8()
+      }else{
+        this.pastureName = [Cookies.get('pasturename')]
+        this.getChart4()
+        this.getChart6()
+      }
     },
     // 各牧场年度用水量对比
     getChart1() {
@@ -235,7 +247,7 @@ export default {
                 + '&endTime=' + endTime
                 + '&center=' + radio
       getJson(url,data).then(response => {
-        console.log('图1', response)
+        console.log('各牧场年度用水量对比==>图1', response)
         if(response.data){
           this.chart_data1.data1 = response.data.nowYear
           this.chart_data1.data2 = response.data.lastYear
@@ -268,7 +280,7 @@ export default {
                 + '&endTime=' + endTime
                 + '&center=' + radio
       getJson(url,data).then(response => {
-        console.log('图2', response)
+        console.log('单头牛水量==>图2', response)
         if(response.data){
           this.chart_data2.data1 = response.data.nowYear
           this.chart_data2.data2 = response.data.lastYear
@@ -299,7 +311,7 @@ export default {
                 + '&endTime=' + endTime
                 + '&center=' + radio
       getJson(url,data).then(response => {
-        console.log('图3', response)
+        console.log('单头牛水费==>图3', response)
         if(response.data){
           this.chart_data3.data1 = response.data.actual
           this.chart_data3.xdata = response.data.pasture
@@ -313,7 +325,7 @@ export default {
       })
     },
 
-    // XX牧场每月单头牛用水量对比
+    // 牧场每月单头牛用水量对比
     getChart4() {
       this.getChart5Parm.parammaps.deptName = this.deptList[0].name
       let url = '/authdata/water/perhead?'
@@ -342,7 +354,7 @@ export default {
                 + '&center=' + radio
                 + '&pastureId=' + pastureId.toString()
       getJson(url,data).then(response => {
-        console.log('图4', response)
+        console.log('牧场每月单头牛用水量对比==>图5', response)
         if(response.data){
           this.chart_data4.data1 = response.data.data3
           this.chart_data4.data_name = response.data.data1
@@ -365,8 +377,6 @@ export default {
         if(response.data.data3 == null){
           this.chart_data4.data1 = []
         }
-
-        console.log(this.chart_data4,'chart_data4')
         this.roadChart4(this.chart_data4)
         this.getChart5()
       })
@@ -389,7 +399,7 @@ export default {
         },
       }
       GetDataByName(data).then(response => {
-        console.log('图5', response)
+        console.log('XX月部门统计==>图6', response)
         let data1 = []
         let xdata = []
         if(response.data){
@@ -422,7 +432,7 @@ export default {
         },
       }
       GetReportform(data).then(response => {
-        console.log('图6', response)
+        console.log('牧场每月用水量对比==>图7', response)
         // this.chart_data6 = response.data.chart_data
         if(response.data){
           this.chart_data6 = {
@@ -462,7 +472,7 @@ export default {
         },
       }
       GetReportform(data).then(response => {
-        console.log('图7', response)
+        console.log('XX月每日用水量==>图8', response)
         // this.chart_data7 = response.data.chart_data
         if(response.data){
           this.chart_data7 = {
@@ -490,7 +500,7 @@ export default {
                 + '&endTime=' + endTime
                 + '&center=' + radio
       getJson(url,data).then(response => {
-        console.log('图8', response)
+        console.log('水费完成率==>图4', response)
         if(response.data){
           this.chart_data8.data1 = response.data.actual
           this.chart_data8.data2 = response.data.budget
@@ -546,7 +556,6 @@ export default {
       }
       var that = this
       that.chart1.on('click', function(param, i) {
-        console.log(param,'=====param')
         that.pastureName = [param.name]
         that.getChart4()
         that.getChart6()
@@ -642,18 +651,16 @@ export default {
       }
       var that = this
       this.chart3.on('click', function(param, i) {
-        console.log(param)
       })
     },
-    // 牧场XX年每月单头牛用水量对比
+    // 牧场每月单头牛用水量对比
     roadChart4(chart_data) {
-      console.log(chart_data,'666')
       if (this.chart4 != null) {
         this.chart4.dispose()
       }
       this.chart4 = echarts.init(document.getElementById('chart4'))
       // var text = '各牧场' + parseTime(this.monthDate, '{y}') + '年每月单头牛用水量对比'
-      var text = ''
+      var text = '牧场每月单头牛用水量对比'
       var option = {
         title: { text: text, left:'left',textStyle: { color: '#769cfc' }},
         tooltip: { trigger: 'axis' },
@@ -662,7 +669,7 @@ export default {
           left: 40,
           bottom:0
         },
-        color: ['#2dc0e8', '#7ECF51', '#FFB800'],
+        color: ['#eb123a','#eba612','#124feb','#15ab2e','#b20fdb'],
         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: '用量(吨)'}],
@@ -700,7 +707,7 @@ export default {
       this.chart5 = echarts.init(document.getElementById('chart5'))
       var text = this.getChart5Parm.parammaps.date + '月部门统计'
       var option = {
-        title: { text: text, left:'center',textStyle: { color: '#769cfc' }},
+        title: { text: text, left:'left',textStyle: { color: '#769cfc' }},
         tooltip: { trigger: 'axis' },
         legend: {
           right: 40,
@@ -736,14 +743,14 @@ export default {
       this.chart6 = echarts.init(document.getElementById('chart6'))
       var text = '牧场每月用水量对比'
       var option = {
-        title: { text: text, left:'center',textStyle: { color: '#769cfc' }},
+        title: { text: text, left:'left',textStyle: { color: '#769cfc' }},
         tooltip: { trigger: 'axis' },
         legend: {
           data: chart_data.data_name,
           right: 40,
           bottom:0
         },
-        color: ['#2dc0e8', '#769cfc', '#FFB800'],
+        color: ['#eb123a','#eba612','#124feb','#15ab2e','#b20fdb'],
         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: '水量(吨)'}],
@@ -805,7 +812,7 @@ export default {
           left: 40,
           bottom:0
         },
-        // color: ['#2dc0e8', '#769cfc', '#FFB800'],
+        color: ['#eb123a','#eba612','#124feb','#15ab2e','#b20fdb'],
         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: '水量(吨)'}],

Some files were not shown because too many files changed in this diff