Kaynağa Gözat

修改了水电柴油用量导出及设备指标页面

段小段 1 yıl önce
ebeveyn
işleme
e4d93612b6

+ 7 - 5
.env.development

@@ -8,14 +8,16 @@ ENV = 'development'
 # 白少后台本地
 # VUE_APP_BASE_API = 'http://192.168.1.77:8082/'
 # 线上测试
- VUE_APP_BASE_API = 'https://tmrwatch.cn:8082/'
-
+# VUE_APP_BASE_API = 'https://tmrwatch.cn:8082/'
+# VUE_APP_BASE_API = 'https://tmrwatch.cn:8082/'
+#
+VUE_APP_BASE_API =  'http://36.155.144.182:18090/'
  # VUE_APP_BASE_API = 'http://127.0.0.1:8082/'
- 
+
  # VUE_APP_BASE_API = 'http://36.155.144.182:18090/'
 
- 
- 
+
+
 
 # vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable,
 # to control whether the babel-plugin-dynamic-import-node plugin is enabled.

+ 6 - 6
.env.production

@@ -2,13 +2,13 @@
 ENV = 'production'
 
 # base api
-# 线上测试
-# VUE_APP_BASE_API = 'https://tmrwatch.cn:8082/'
+# 测试线
+VUE_APP_BASE_API = 'https://tmrwatch.cn:8082/'
 # 后台本地
 # VUE_APP_BASE_API = 'http://192.168.1.77:8082/'
-# 正式地址
-VUE_APP_BASE_API = 'https://eam.modernfarming.cn:8000/'
+# 正式线
+# VUE_APP_BASE_API = 'https://eam.modernfarming.cn:8000/'
 
- # VUE_APP_BASE_API = 'http://127.0.0.1:8082/'
+# VUE_APP_BASE_API = 'http://127.0.0.1:8082/'
 
-# VUE_APP_BASE_API = 'http://36.155.144.182:18090/'
+# VUE_APP_BASE_API = 'http://36.155.144.182:18090/'

BIN
dist.zip


Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
dist/index.html


+ 12 - 0
src/api/common.js

@@ -320,3 +320,15 @@ export function DownloadExcel(data, filename) {
     navigator.msSaveBlob(blob, fileName)
   }
 }
+// 用于获取本月或指定月份的最后一天
+export function getMonthFinalDay(year,month){
+	var day='';
+	if(year==null || year==undefined || year==''){
+		year = new Date().getFullYear();
+	}
+	if(month==null ||  month==undefined || month==''){
+		month = new Date().getMonth()+1;
+	}
+	day = new Date(new Date(year,month).setDate(0)).getDate();
+	return year+"-"+month+"-"+day;
+}

+ 33 - 24
src/views/cost/diesel/index.vue

@@ -18,13 +18,13 @@
       <el-date-picker ref="inputDatetime" v-model="getdataListParm.parammaps.inputDatetime" class="inputDatetime" type="datetimerange" style="width: 250px;top:-5px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" />
       <el-input v-model="getdataListParm.parammaps.equipmentNumber" placeholder="设备编号" clearable class="filter-item" style="width: 120px" />
       <el-input v-model="getdataListParm.parammaps.assetName" placeholder="设备名称" clearable class="filter-item" style="width: 120px" />
-      <el-input v-model="getdataListParm.parammaps.employName" placeholder="加油工" clearable class="filter-item" style="width: 120px" />
+      <el-input v-model="getdataListParm.parammaps.empId" placeholder="加油工" clearable class="filter-item" style="width: 120px" />
       <el-input v-model="getdataListParm.parammaps.oilClass" placeholder="加油工班" clearable class="filter-item" style="width: 120px" />
       <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_search">搜索</el-button>
       <div>
         <el-button v-if="isDieselAdd" class="filter-item" type="primary" icon="el-icon-edit" @click="form_add">新增</el-button>
-        <el-button v-waves class="filter-item" type="info" icon="el-icon-tickets" @click="handleDownloadTemp">导出模板</el-button>
-        <el-button v-if="isDieselExport" v-waves class="filter-item" type="success" icon="el-icon-download" @click="handleDownload">数据导出</el-button>
+        <!-- <el-button v-waves class="filter-item" type="info" icon="el-icon-tickets" @click="handleDownloadTemp">导出模板</el-button> -->
+        <el-button v-if="isDieselExport" v-waves class="filter-item" type="info" icon="el-icon-download" @click="handleDownload">模板</el-button>
         <el-upload style="display: inline-block;" :headers="headers" :data="uploadData" :action="uploadExcelUrl" :show-file-list="false" :before-upload="beforeImportExcel" :on-success="handleImportExcelSuccess">
           <el-button v-if="isRetreatImport" v-waves class="filter-item" type="warning" icon="el-icon-upload2" @click="form_search">导入</el-button>
         </el-upload>
@@ -358,7 +358,13 @@ export default {
         parammaps: {
           selTime: '',
           pastureName: Cookies.get('pasturename'),
-          departName: ''
+          deptName: '',
+          cardNumber: '',
+          equipmentNumber: '',
+          assetName: '',
+          employName: '',
+          oilClass: '',
+          inputDatetime:''
         }
       },
       // 2-3:下拉框请求后数据加入[]
@@ -623,8 +629,8 @@ export default {
       this.temp.deptName = ''
       this.temp.pastureName = ''
       this.temp.price = ''
-    }, 
-    
+    },
+
     handleDownloadTemp(){
       import('@/vendor/Export2Excel').then(excel => {
         const tHeader = [
@@ -637,7 +643,7 @@ export default {
         excel.export_json_to_excel({
           header: tHeader,
           data: data1,
-          filename: '水表',
+          filename: '柴油用量',
           autoWidth: true,
           bookType: 'xlsx'
         })
@@ -656,11 +662,10 @@ export default {
         }
         this.percentage = this.percentage
       }, 1000)
-      this.requestParam.name = 'getDieselList'
+      this.requestParam.name = 'meteringOutfitDiesel'
       this.requestParam.parammaps.pastureName = this.getdataListParm.parammaps.pastureName
       this.requestParam.parammaps.departName = this.getdataListParm.parammaps.departName
-      this.requestParam.parammaps.startTime = this.getdataListParm.parammaps.startTime
-      this.requestParam.parammaps.stopTime = this.getdataListParm.parammaps.stopTime
+      this.requestParam.parammaps.selTime = this.getdataListParm.parammaps.selTime
       GetAccount(this.requestParam).then(response => {
         if (response.data.list !== '') {
           this.percentage = 99
@@ -669,17 +674,23 @@ export default {
           }, 2000)
         }
         this.$nextTick(() => {
-          import('@/vendor/Export2Excel').then(excel => {
-            const list1 = response.data.list
-            const tHeader = [
-              '牧场', '部门', '交易时间', '车号', '加油工班', '加油工', '卡号', '卡类型', '本次加油量(升)', '本次消费金额(元)', '备注'
-            ]
-            const filterVal = [
-              'pastureName', 'departName', 'selTime', 'assetNumber', 'oilClass', 'empId', 'cardNumber', 'cardType', 'oilAmount', 'nowPrice', 'note'
-            ]
-            const data1 = this.formatJson(filterVal, list1)
-            excel.export_json_to_excel({ header: tHeader, data: data1, filename: '柴油用量', autoWidth: true, bookType: 'xlsx' })
-          })
+              import('@/vendor/Export2Excel').then(excel => {
+                const list1 = response.data.list
+                const tHeader = [
+                  '编号', '牧场', '油卡编号', '设备名称', '设备编号', '加油日期', '加油量(升)', '单价', '录入人', '加油人', '加油工班', '备注'
+                ]
+                const filterVal = [
+                  '编号', '牧场', '油卡编号', '设备名称', '设备编号', '加油日期', '加油量(L)', '单价', '录入人', '加油人', '加油工班', '备注'
+                ]
+                const data1 = this.formatJson(filterVal, list1)
+                excel.export_json_to_excel({
+                  header: tHeader,
+                  data: data1,
+                  filename: '柴油',
+                  autoWidth: true,
+                  bookType: 'xlsx'
+                })
+              })
         })
       })
     },
@@ -765,9 +776,7 @@ export default {
           this.list = response.data.list
           this.pageNum = response.data.pageNum
           this.pageSize = response.data.pageSize
-          if (response.data.total) {
-            this.total = response.data.total
-          }
+          this.total = response.data.total
         }
         setTimeout(() => {
           this.listLoading = false

+ 47 - 67
src/views/cost/elec/index.vue

@@ -21,7 +21,6 @@
       <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_search">搜索</el-button>
       <div>
         <el-button v-if="isElecAdd" class="filter-item" type="primary" icon="el-icon-edit" @click="form_add">新增</el-button>
-        <el-button v-waves class="filter-item" type="info" icon="el-icon-tickets" @click="handleDownloadTemp">导出模板</el-button>
         <el-button v-if="isElecExport" v-waves class="filter-item" type="success" icon="el-icon-download" @click="handleDownload">导出</el-button>
         <el-upload style="display: inline-block;" :headers="headers" :data="uploadData" :action="uploadExcelUrl" :show-file-list="false" :before-upload="beforeImportExcel" :on-success="handleImportExcelSuccess">
           <el-button v-if="isElecImport" v-waves class="filter-item" type="warning" icon="el-icon-upload2" @click="form_search">导入</el-button>
@@ -321,6 +320,7 @@ export default {
   directives: { waves },
   data() {
     return {
+      selectionList:[],
       myHeight:document.documentElement.clientHeight - 85- 200,
       isokDisable: false,
       isElecAdd: [],
@@ -538,24 +538,7 @@ export default {
         }
       }, 0)
     },
-    handleDownloadTemp(){
-      import('@/vendor/Export2Excel').then(excel => {
-        const tHeader = [
-          '编号', '牧场', '表名称', '表编号', '抄表日期', '用量(度)', '单价', '录入人', '备注'
-        ]
-        const filterVal = [
-          '编号', '牧场', '表名称', '表编号', '抄表日期2', '用量', '单价2', '录入人', '备注2'
-        ]
-        const data1 = []
-        excel.export_json_to_excel({
-          header: tHeader,
-          data: data1,
-          filename: '电表',
-          autoWidth: true,
-          bookType: 'xlsx'
-        })
-      })
-    },
+
     handleDownload() {
       /*       this.requestParam.name = 'meteringOutfit'
       this.requestParam.returntype = 'xlsx'
@@ -565,52 +548,51 @@ export default {
           DownloadExcel(response, this.requestParam.parammaps.formType)
         }) */
       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.requestParam.name = 'meteringOutfit'
-      this.requestParam.parammaps.pastureName = this.getdataListParm.parammaps.pastureName
-      this.requestParam.parammaps.departName = this.getdataListParm.parammaps.departName
-      this.requestParam.parammaps.formName = this.getdataListParm.parammaps.formName
-      this.requestParam.parammaps.formNumber = this.getdataListParm.parammaps.formNumber
-      this.requestParam.parammaps.useType = this.getdataListParm.parammaps.formType
-      this.requestParam.parammaps.startTime = this.getdataListParm.parammaps.startTime
-      this.requestParam.parammaps.stopTime = this.getdataListParm.parammaps.stopTime
-      this.requestParam.parammaps.formType = '电表'
-      GetAccount(this.requestParam).then(response => {
-        if (response.data.list !== '') {
-          this.percentage = 99
-          setTimeout(() => {
-            this.isPercentage = false
-          }, 2000)
-        }
-        this.$nextTick(() => {
-          import('@/vendor/Export2Excel').then(excel => {
-            const list1 = response.data.list
-            const tHeader = [
-              '编号', '牧场', '表名称', '表编号', '抄表日期', '用量(度)', '单价', '录入人', '备注'
-            ]
-            const filterVal = [
-              '编号', '牧场', '表名称', '表编号', '抄表日期2', '用量', '单价2', '录入人', '备注2'
-            ]
-            const data1 = this.formatJson(filterVal, list1)
-            excel.export_json_to_excel({
-              header: tHeader,
-              data: data1,
-              filename: '电表',
-              autoWidth: true,
-              bookType: 'xlsx'
+            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.requestParam.name = 'meteringOutfit'
+            this.requestParam.parammaps.pastureName = this.getdataListParm.parammaps.pastureName
+            this.requestParam.parammaps.departName = this.getdataListParm.parammaps.departName
+            this.requestParam.parammaps.formName = this.getdataListParm.parammaps.formName
+            this.requestParam.parammaps.formNumber = this.getdataListParm.parammaps.formNumber
+            this.requestParam.parammaps.useType = this.getdataListParm.parammaps.formType
+
+            this.requestParam.parammaps.formType = '电表'
+            GetAccount(this.requestParam).then(response => {
+              if (response.data.list !== '') {
+                this.percentage = 99
+                setTimeout(() => {
+                  this.isPercentage = false
+                }, 2000)
+              }
+              this.$nextTick(() => {
+                import('@/vendor/Export2Excel').then(excel => {
+                  const list1 = response.data.list
+                  const tHeader = [
+                    '编号', '牧场', '表名称', '表编号', '抄表日期', '用量(度)', '单价', '录入人', '备注'
+                  ]
+                  const filterVal = [
+                    '编号', '牧场', '表名称', '表编号', '抄表日期2', '用量', '单价2', '录入人', '备注2'
+                  ]
+                  const data1 = this.formatJson(filterVal, list1)
+                  excel.export_json_to_excel({
+                    header: tHeader,
+                    data: data1,
+                    filename: '电表',
+                    autoWidth: true,
+                    bookType: 'xlsx'
+                  })
+                })
+              })
             })
-          })
-        })
-      })
     },
     formatJson(filterVal, jsonData) {
       return jsonData.map(v =>
@@ -773,9 +755,7 @@ export default {
           this.list = response.data.list
           this.pageNum = response.data.pageNum
           this.pageSize = response.data.pageSize
-          if (response.data.total) {
-            this.total = response.data.total
-          }
+          this.total = response.data.total
         }
         setTimeout(() => {
           this.listLoading = false

+ 58 - 84
src/views/cost/water/index.vue

@@ -21,8 +21,7 @@
       <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_search">搜索</el-button>
       <div>
         <el-button v-if="isWaterAdd" class="filter-item" type="primary" icon="el-icon-edit" @click="form_add">新增</el-button>
-        <el-button v-waves class="filter-item" type="info" icon="el-icon-tickets" @click="handleDownloadTemp">导出模板</el-button>
-        <el-button v-if="isWaterExport" v-waves class="filter-item" type="success" icon="el-icon-download" @click="handleDownload">导出数据</el-button>
+        <el-button v-if="isWaterExport" v-waves class="filter-item" type="success" icon="el-icon-download" @click="handleDownload">导出</el-button>
         <el-upload style="display: inline-block;" :headers="headers" :data="uploadData" :action="uploadExcelUrl" :show-file-list="false" :before-upload="beforeImportExcel" :on-success="handleImportExcelSuccess">
           <el-button v-if="isWaterImport" v-waves class="filter-item" type="warning" icon="el-icon-upload2" @click="form_search">导入</el-button>
         </el-upload>
@@ -43,10 +42,8 @@
       :cell-style="cellStyle"
       class="elTable"
       @sort-change="tableSort1"
-      @selection-change="handleSelectionChange"
       :max-height="myHeight"
     >
-      <el-table-column type="selection" width="55" />
       <el-table-column label="序号" align="center" type="index" width="50px">
         <template slot-scope="scope">
           <span>{{ scope.$index + (pageNum-1) * pageSize + 1 }}</span>
@@ -453,7 +450,8 @@ export default {
       isPercentage: false,
       percentage: 1,
       dialogFormDelete: false,
-      deleteTemp: {}
+      deleteTemp: {},
+      selectionList:[]
     }
   },
 
@@ -531,86 +529,66 @@ export default {
         }
       }, 0)
     },
-    handleDownloadTemp(){
-      import('@/vendor/Export2Excel').then(excel => {
-        const tHeader = [
-          '编号', '牧场', '表名称', '表编号', '抄表日期', '用量(吨)', '单价', '录入人', '备注'
-        ]
-        const filterVal = [
-          '编号', '牧场', '表名称', '表编号', '抄表日期2', '用量', '单价2', '录入人', '备注2'
-        ]
-        const data1 = []
-        excel.export_json_to_excel({
-          header: tHeader,
-          data: data1,
-          filename: '水表',
-          autoWidth: true,
-          bookType: 'xlsx'
-        })
-      })
-    },
+
     // 导出
     handleDownload() {
-      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.requestParam.name = 'meteringOutfit'
-      this.requestParam.parammaps.formType = '水表'
-      this.requestParam.parammaps.pastureName = this.getdataListParm.parammaps.pastureName
-      this.requestParam.parammaps.departName = this.getdataListParm.parammaps.departName
-      this.requestParam.parammaps.formName = this.getdataListParm.parammaps.formName
-      this.requestParam.parammaps.formNumber = this.getdataListParm.parammaps.formNumber
-      this.requestParam.parammaps.useType = this.getdataListParm.parammaps.formType
-      this.requestParam.parammaps.startTime = this.getdataListParm.parammaps.startTime
-      this.requestParam.parammaps.stopTime = this.getdataListParm.parammaps.stopTime
-      GetAccount(this.requestParam).then(response => {
-        this.$nextTick(() => {
-          import('@/vendor/Export2Excel').then(excel => {
-            const list1 = response.data.list
-            if (response.data.list !== '') {
+          this.$alert('水表正在导出中,请勿刷新或离开本页面,若导出时间过长,建议缩小导出数据范围重新导出', {})
+          this.isPercentage = true
+          this.percentage = 1
+          var timer = setInterval(() => {
+            this.percentage += 5
+            if (this.percentage > 95) {
               this.percentage = 99
-              setTimeout(() => {
-                this.isPercentage = false
-              }, 2000)
+              clearInterval(timer)
             }
-
-            const tHeader = [
-              '编号', '牧场', '表名称', '表编号', '抄表日期', '用量(吨)', '单价', '录入人', '备注'
-            ]
-            const filterVal = [
-              '编号', '牧场', '表名称', '表编号', '抄表日期2', '用量', '单价2', '录入人', '备注2'
-            ]
-            const data1 = this.formatJson(filterVal, list1)
-            excel.export_json_to_excel({
-              header: tHeader,
-              data: data1,
-              filename: this.requestParam.parammaps.formType,
-              autoWidth: true,
-              bookType: 'xlsx'
+            this.percentage = this.percentage
+          }, 1000)
+          this.requestParam.name = 'meteringOutfit'
+          this.requestParam.parammaps.formType = '水表'
+          this.requestParam.parammaps.pastureName = this.getdataListParm.parammaps.pastureName
+          this.requestParam.parammaps.departName = this.getdataListParm.parammaps.departName
+          this.requestParam.parammaps.formName = this.getdataListParm.parammaps.formName
+          this.requestParam.parammaps.formNumber = this.getdataListParm.parammaps.formNumber
+          this.requestParam.parammaps.useType = this.getdataListParm.parammaps.formType
+          GetAccount(this.requestParam).then(response => {
+            this.$nextTick(() => {
+              import('@/vendor/Export2Excel').then(excel => {
+                const list1 = response.data.list
+                if (response.data.list !== '') {
+                  this.percentage = 99
+                  setTimeout(() => {
+                    this.isPercentage = false
+                  }, 2000)
+                }
+                const tHeader = [
+                  '编号', '牧场', '表名称', '表编号', '抄表日期', '用量(吨)', '单价', '录入人', '备注'
+                ]
+                const filterVal = [
+                  '编号', '牧场', '表名称', '表编号', '抄表日期2', '用量', '单价2', '录入人', '备注2'
+                ]
+                const data1 = this.formatJson(filterVal, list1)
+                excel.export_json_to_excel({
+                  header: tHeader,
+                  data: data1,
+                  filename: this.requestParam.parammaps.formType,
+                  autoWidth: true,
+                  bookType: 'xlsx'
+                })
+              })
             })
           })
-        })
-      })
-    },
-    formatJson(filterVal, jsonData) {
-      return jsonData.map(v =>
-        filterVal.map(j => {
-          if (j === 'timestamp') {
-            return parseTime(v[j])
-          } else {
-            return v[j]
-          }
-        })
-      )
-    },
+        },
+      formatJson(filterVal, jsonData) {
+        return jsonData.map(v =>
+          filterVal.map(j => {
+            if (j === 'timestamp') {
+              return parseTime(v[j])
+            } else {
+              return v[j]
+            }
+          })
+        )
+      },
     // 导入
     beforeImportExcel(file) {
       const isLt2M = file.size / 1024 / 1024 < 2
@@ -783,9 +761,7 @@ export default {
           this.list = response.data.list
           this.pageNum = response.data.pageNum
           this.pageSize = response.data.pageSize
-          if (response.data.total) {
-            this.total = response.data.total
-          }
+          this.total = response.data.total
         }
         setTimeout(() => {
           this.listLoading = false
@@ -1106,9 +1082,7 @@ export default {
         }, 100)
       })
     },
-    handleSelectionChange(val){
 
-    }
   }
 }
 </script>

+ 98 - 89
src/views/custom/purchase/index.vue

@@ -12,7 +12,7 @@
             <el-select v-model="getdataListParm1.parammaps.departmentId" style="width: 140px;" placeholder="部门" class="filter-item" @change = "change_dept">
               <el-option v-for="item in deptNameList" :key="item.id" :label="item.name" :value="item.id" />
             </el-select>
-            
+
           </div>
 
           <el-table
@@ -88,7 +88,7 @@
               <template slot-scope="scope">
                 <el-form :model="scope.row" :rules="rules">
                   <el-form-item prop="amount">
-                     <el-input  v-model="scope.row.amount"  style="width:80px;margin-top:25px;height:10px"  /> 
+                     <el-input  v-model="scope.row.amount"  style="width:80px;margin-top:25px;height:10px"  />
                      <!-- 白少让先注释了 -->
                     <!-- <el-input  v-if ="scope.row.amount == 0"  v-model="scope.row.amount"  style="width:80px;margin-top:25px;height:10px"   disabled/>
                     <el-input v-else v-model="scope.row.amount"  style="width:80px;margin-top:25px;height:10px"  /> -->
@@ -244,8 +244,8 @@
             <el-date-picker ref="inputDatetime4" v-model="getdataListParm4.parammaps.inputDatetime" class="inputDatetime" type="datetimerange" style="width: 270px;top:-3px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始提交日期" end-placeholder="结束提交日期" />
             <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_search4">搜索</el-button>
 
-            
-            
+
+
           </div>
           <el-table
             :key="tableKey4"
@@ -258,12 +258,12 @@
             style="width: 100%;"
             :row-style="rowStyle"
             :cell-style="cellStyle"
-            class="elTable table-fixed" 
+            class="elTable table-fixed"
             @sort-change="tableSort"
             @current-change="handleCurrentChange"
             :max-height="myHeight"
           >
-         
+
             <el-table-column label="序号" align="center" type="index" width="50px">
               <template slot-scope="scope">
                 <span>{{ scope.$index + (pageNum2-1) * pageSize2 + 1 }}</span>
@@ -291,7 +291,7 @@
               </template>
             </el-table-column>
             <el-table-column label="审核状态" min-width="80px" align="center" :formatter="statue" />
-           
+
             <el-table-column label="操作" align="center" width="250px" class-name="small-padding fixed-width" fixed="right">
               <template slot-scope="{row}">
                 <el-button v-if="isPurchaseSee" type="primary" size="mini" @click="form_see4(row)">查看</el-button>
@@ -337,7 +337,7 @@
                 :cell-style="cellStyle"
                 class="elTable table-fixed"
               >
-             
+
                 <el-table-column label="序号" align="center" type="index" width="50px" />
                 <el-table-column label="采购单号" min-width="110px" align="center">
                   <template slot-scope="scope">
@@ -622,8 +622,8 @@
             @selection-change="change_table_selection"
             :max-height="myHeight"
           >
-          <el-table-column type="selection" :selectable="checkboxInit" align="center" width="50" />
-            <el-table-column label="序号" align="center" type="index" width="50px">
+          <el-table-column type="selection" :selectable="checkboxInit" align="center" width="50" disabled />
+            <el-table-column label="序号1" align="center" type="index" width="50px">
               <template slot-scope="scope">
                 <span>{{ scope.$index + (pageNum2-1) * pageSize2 + 1 }}</span>
               </template>
@@ -656,7 +656,7 @@
                 <span>{{scope.row.sapNumber}}</span>
               </template>
             </el-table-column>
-          
+
             <el-table-column   prop="sapstatus" label="sap上传状态" min-width="80px" align="center">
               <template slot-scope="scope">
                 <span v-show="scope.row.sapstatus == 1">上传失败</span>
@@ -980,7 +980,7 @@
             <el-autocomplete v-model="getdataListParm5.parammaps.providerName" value-key="providerName" class="inline-input" :fetch-suggestions="providerSearch" placeholder="供应商" style="width:150px;top:-3px;" @select="handleSelectProvider" />
             <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_search5">搜索</el-button>
             <el-button  class="filter-item" type="primary" icon="el-icon-edit" @click="form_add5">新增</el-button>
-     
+
           </div>
           <el-table
             :key="tableKey5"
@@ -1011,7 +1011,7 @@
               <template slot-scope="scope">
                 <span>{{ scope.row.providerName }}</span>
               </template>
-            </el-table-column>       
+            </el-table-column>
             <el-table-column label="牧场" min-width="110px" align="center">
               <template slot-scope="scope">
                 <span>{{ scope.row.pastureName }}</span>
@@ -1028,14 +1028,14 @@
               </template>
             </el-table-column>
             <el-table-column label="提交日期" sortable prop="buyerDate" min-width="110px" align="center" />
-           
+
             <el-table-column label="单据状态" min-width="80px" align="center" :formatter="statu" />
             <el-table-column  prop="sapNumber" label="sap编码" min-width="80px" align="center">
               <template slot-scope="scope">
                 <span>{{scope.row.sapNumber}}</span>
               </template>
             </el-table-column>
-   
+
             <el-table-column   prop="sapstatus" label="sap上传状态" min-width="80px" align="center">
               <template slot-scope="scope">
                 <span v-show="scope.row.sapstatus == 1">上传失败</span>
@@ -1054,16 +1054,16 @@
             <el-table-column label="操作" align="center" width="250px" class-name="small-padding fixed-width" fixed="right">
               <template slot-scope="{row}">
                 <el-button type="primary" size="mini" @click="form_see5(row)">查看</el-button>
-                <el-button v-if="row.statu === 0"  type="danger" size="mini" @click="handleClose5(row)">关闭</el-button> 
-           
+                <el-button v-if="row.statu === 0"  type="danger" size="mini" @click="handleClose5(row)">关闭</el-button>
+
               </template>
             </el-table-column>
 
-             
+
           </el-table>
           <pagination v-show="total5>=0" :total="total5" :page.sync="getdataListParm5.offset" :limit.sync="getdataListParm5.pagecount" @pagination="get_table_data5" />
         </div>
-      </el-tab-pane>    
+      </el-tab-pane>
 
 
 
@@ -1151,7 +1151,7 @@
                     <span>{{ scope.row.price }}</span>
                   </template>
                 </el-table-column>
-              
+
                 <el-table-column sortable prop="amount" label="采购数量" min-width="130px" align="center">
                   <template slot-scope="scope">
                     <span>{{ scope.row.amount }}</span>
@@ -1162,7 +1162,7 @@
                     <span>{{ scope.row.sumPrice }}</span>
                   </template>
                 </el-table-column>
-             
+
                 <el-table-column prop="SGremark" label="备注" min-width="110px" align="center">
                   <template slot-scope="scope">
                     <span>{{ scope.row.SGremark }}</span>
@@ -1267,7 +1267,7 @@
                 </el-select>
               </el-form-item>
             </el-col>
-           
+
           </el-row>
           <el-row>
             <el-col :span="15">
@@ -1289,10 +1289,10 @@
                 </el-autocomplete>
               </el-form-item>
             </el-col>
-            
+
           </el-row>
         </el-form>
- 
+
          <el-table
           element-loading-text="给我一点时间"
           :data="listAdd5"
@@ -1304,7 +1304,7 @@
           :cell-style="cellStyle"
           class="elTable table-fixed"
         >
- 
+
           <el-table-column label="序号" align="center" type="index" width="50px" />
           <el-table-column label="备件编号" prop="partCode" align="center" min-width="90">
             <template slot-scope="scope">
@@ -1368,7 +1368,7 @@
               <a class="del" @click="partDelete5(row)">删除</a>
             </template>
           </el-table-column>
-        </el-table>  
+        </el-table>
         <div slot="footer" class="dialog-footer" style="bottom:10px">
           <el-button type="primary" :disabled="isokDisable" @click="add_dialog_save5()">保存并关闭</el-button>
           <el-button @click="dialogFormVisible5 = false;get_table_data5()">取消并关闭</el-button>
@@ -1487,7 +1487,7 @@ export default {
         { name: 'getDepartmentNY', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
         { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
         { name: 'findAllProvider', offset: 0, pagecount: 0, params: [] },
-       
+
       ],
       getdataListParm1: {
         name: 'getbuydetailParts',
@@ -1653,10 +1653,10 @@ export default {
           inputDatetime: ''
         }
       },
- 
- 
+
+
       dialogFormVisible5: false,
- 
+
       createTemp5: {
         providerId: '',
         buyeCode: '',
@@ -1671,7 +1671,7 @@ export default {
       },
 
       rules55: {
- 
+
         note: [{ required: true, message: '必填', trigger: 'blur' }]
       },
 
@@ -1682,7 +1682,7 @@ export default {
         parammaps: {}
       },
 
-      
+
 
       getParmCreateNumber5: {
         name: 'autoCreatCode',
@@ -1721,7 +1721,7 @@ export default {
       findAllProvider5: [],
       temp5: {
         note: ''
-      }, 
+      },
 
       dialogFormVisibleSee5: false,
       dialogStatusSee5: '',
@@ -1752,7 +1752,7 @@ export default {
       },
       statueReason: false,
       dialogFormVisibleClose: false,
-      
+
       dialogFormVisibleClose5: false,
       dialogStatusClose: '',
       textMap: {
@@ -1860,7 +1860,7 @@ export default {
     handleSelectSparePart5(item) {
       console.log('备件模糊查询选中值', item)
       console.log('备件模糊查询选中值', item.id)
-    
+
       if (this.listAdd5.length > 0) {
         // eslint-disable-next-line no-redeclare
         if (this.listAdd5.find(obj => obj.id === item.id)) {
@@ -1870,9 +1870,9 @@ export default {
           })
           console.log(this.listAdd5)
           console.log(this.listAdd5.length)
-           
+
           return false
-          
+
         } else {
           this.listAdd5.unshift(item)
           this.$set(item, 'amount', item.reportery)
@@ -1897,16 +1897,16 @@ export default {
       }
       this.$forceUpdate()
       console.log(this.listAdd5)
-       
+
     },
- 
 
-      
+
+
     changeProvider5(val) {
       console.log(val, '供应商change')
       this.listAdd5 = []
       this.getParmBatchOperation5.parammaps.providerId = val
- 
+
     },
 
     // 新增删除
@@ -1985,7 +1985,7 @@ export default {
             }
           }
         }
-        
+
 
 //保存发的参数!!!!
         var send_data = {
@@ -2049,7 +2049,7 @@ export default {
             this.getdataListParm5.parammaps.inputDatetime = ''
             setTimeout(() => {
               this.get_table_data5()
-         
+
             }, 1000)
             this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
           }
@@ -2066,7 +2066,7 @@ export default {
       }
     },
 
- 
+
 
 
 
@@ -2398,7 +2398,7 @@ export default {
       var providerNameDest = []
 
 
-  
+
 
       // eslint-disable-next-line no-redeclare
       for (var i = 0; i < this.list1.length; i++) {
@@ -2746,7 +2746,7 @@ export default {
     handleClose5(row) {
       this.resetCloseTemp5()
       this.temp5 = Object.assign({}, row)
-  
+
       this.dialogFormVisibleClose5 = true
     },
 
@@ -2788,31 +2788,31 @@ export default {
       if (this.temp5.statu === 0) {
         this.isStatu = false
         this.temp5.statu = '未到货'
- 
+
       } else if (this.temp2.statu === 1) {
         this.isStatu = false
         this.temp5.statu = '部分到货'
- 
+
       } else if (this.temp2.statu === 2) {
         this.isStatu = false
         this.temp5.statu = '按时到货'
-   
+
       } else if (this.temp2.statu === 3) {
         this.isStatu = false
         this.temp5.statu = '已延期'
- 
+
       } else if (this.temp2.statu === 4) {
         this.temp5.statu = '已关闭'
         this.isStatu = true
-      
+
       } else if (this.temp2.statu === 5) {
         this.isStatu = false
         this.temp5.statu = '部分到货-延期'
- 
+
       } else if (this.temp2.statu === 6) {
         this.isStatu = false
         this.temp5.statu = '全部到货-延期'
-     
+
       }
       this.dialogStatusSee5 = 'see'
       this.dialogFormVisibleSee5 = true
@@ -2864,7 +2864,7 @@ export default {
     sapUpload(){
 
 
-      const that = this 
+      const that = this
       console.log("currentRow",this.currentRow.sapstatus)
 
      var send_data = this.selectList
@@ -2882,19 +2882,19 @@ export default {
          that.isSap = 0
          SapOrder(send_data).then(response => {
               console.log('response', response)
-                
+
                if (response.msg !== 'fail') {
                 that.$notify({ title: '成功', message: '上传成功', type: 'success', duration: 2000 })
                 that.selectList = []
                 that.get_table_data2()
-                 
+
                 } else {
                   that.$notify({ title: '失败', message: '上传失败'  , type: 'error', duration: 2000 })
                 }
-               
+
             })
- 
-            
+
+
       } else {
 
         that.$notify({ title: '失败', message: '正在请求中,请稍等几秒钟后再点击'  , type: 'error', duration: 2000 })
@@ -2906,37 +2906,37 @@ export default {
 
 
 
-           
-    
-  
+
+
+
       // if(this.currentRow.sapstatus){
-   
+
       //   if(this.currentRow.sapstatus != 0){
       //     const sapArr = this.currentRow.sapbuyeCode.split(",")
       //     console.log("sapArr",sapArr)
       //     sapArr.forEach(function(item){
       //       console.log("sapArr item",item)
       //       var send_data = {
-         
+
       //             "code":item,
       //             "pastureid":Cookies.get('pastureid')
-              
+
       //       }
 
       //       SapOrder(send_data).then(response => {
       //         console.log('response', response)
-                
+
       //          if (response.msg !== 'fail') {
       //           that.$notify({ title: '成功', message: '上传成功', type: 'success', duration: 2000 })
       //           that.get_table_data()
-                 
+
       //           } else {
       //             that.$notify({ title: '失败', message: '上传失败'  , type: 'error', duration: 2000 })
       //           }
-               
+
       //       })
-        
-        
+
+
 
 
       //     })
@@ -2950,7 +2950,16 @@ export default {
       console.log(row)
       var data1 = new Date(row.buyerDate)
       var data2 = new Date('2022-10-25')
-      if(data1 > data2){ return 1 } else {return 0}
+      if(data1 > data2){
+        if(row.srmstatus !== 0){
+          return 1
+        }else{
+          return 0
+        }
+      } else {
+        return 0
+      }
+
     },
 
     //监听 - 表格 - 勾选
@@ -2961,9 +2970,9 @@ export default {
 
     srmUpload(){
 
-      const that = this 
+      const that = this
       console.log("currentRow",this.currentRow.srmstatus)
-    
+
       console.log('勾选数据selectList', this.selectList)
 
       var send_data = this.selectList
@@ -2982,21 +2991,21 @@ export default {
          that.isSrm = 0
          SrmOrder(send_data).then(response => {
               console.log('response', response)
-                
+
                if (response.msg !== 'fail') {
                 that.$notify({ title: '成功', message: '上传成功', type: 'success', duration: 2000 })
                 that.selectList = []
                 that.get_table_data2()
-                
-                 
+
+
                 } else {
                   that.$notify({ title: '失败', message: '上传失败'  , type: 'error', duration: 2000 })
                 }
-               
+
             })
 
- 
-            
+
+
       } else {
 
         that.$notify({ title: '失败', message: '正在请求中,请稍等几秒钟后再点击'  , type: 'error', duration: 2000 })
@@ -3009,7 +3018,7 @@ export default {
 
 
 
-   
+
       // if(this.currentRow.srmstatus){
       //   if(this.currentRow.srmstatus != 0){
       //     const srmArr = this.currentRow.srmbuyeCode.split(",")
@@ -3017,24 +3026,24 @@ export default {
       //     srmArr.forEach(function(item){
       //       console.log("srmArr item",item)
       //       var send_data = {
-         
+
       //             "code":item,
       //             "pastureid":Cookies.get('pastureid')
       //       }
       //       SrmOrder(send_data).then(response => {
       //         console.log('response', response)
-                
+
       //          if (response.msg !== 'fail') {
       //           that.$notify({ title: '成功', message: '上传成功', type: 'success', duration: 2000 })
       //           that.get_table_data()
-                 
+
       //           } else {
       //             that.$notify({ title: '失败', message: '上传失败'  , type: 'error', duration: 2000 })
       //           }
-               
+
       //       })
-        
-        
+
+
 
 
       //     })
@@ -3044,7 +3053,7 @@ export default {
 
 
     },
-    
+
 
     closeData() {
       this.isokDisable = true
@@ -3143,7 +3152,7 @@ export default {
 
     get_table_data5() {
       this.listLoading5 = true
-      
+
       GetDataByName(this.getdataListParm5).then(response => {
         this.list5 = response.data.list
         this.pageNum5 = response.data.pageNum
@@ -3159,7 +3168,7 @@ export default {
     },
     form_search5() {
       this.listLoading = true
-    
+
       this.getdataListParm5.offset = 1
       this.get_table_data5()
     },

+ 136 - 46
src/views/report/equipmentIndex/index.vue

@@ -5,7 +5,12 @@
       <el-progress style="padding-left: 10px;" :text-inside="true" :stroke-width="26" :percentage="percentage" />
     </div>
     <div :style="{position: 'fixed',height:'55px',top: '90px',zIndex: '999',marginBottom: '50px',background:'#f0f2f5',width: myWidth}">
-      <el-date-picker v-model="yearDate" type="datetimerange" range-separator="至" start-placeholder="开始时间" end-placeholder="结束时间" style="width: 250px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" :clearable="false" @change="changeTime" />
+       <el-radio-group v-model="radio" @change="changeRadio">
+          <el-radio :label="1">月</el-radio>
+          <el-radio :label="2">日</el-radio>
+        </el-radio-group>
+      <el-date-picker v-if="radio == 1" v-model="yearDate" type="monthrange" range-separator="至" start-placeholder="开始月份" end-placeholder="结束月份" style="width: 250px;" format="yyyy-MM" value-format="yyyy-MM" :clearable="false" @change="changeTime('1')" />
+      <el-date-picker v-else v-model="yearDate" type="daterange" range-separator="至" start-placeholder="开始时间" end-placeholder="结束时间" style="width: 250px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" :clearable="false" @change="changeTime('2')" />
       <el-select v-model="jump" style="width: 140pxmargin-top:5px;;" placeholder="快捷跳转方式" class="filter-item" @visible-change="changeJump($event,jump)">
         <el-option v-for="item in jumpList" :key="item.id" :label="item.name" :value="item.name" />
       </el-select>
@@ -15,7 +20,7 @@
       <el-button class="filter-item" style="" type="success" icon="el-icon-edit" @click="handleDownload">导出</el-button>
     </div>
     <div style="margin-top: 50px;">
-      <div>
+      <div v-if="radio == 1">
         <h3 id="equipmentIndexCostTable">设备指标</h3>
         <el-table
           :key="equipmentIndexCostTable.tableKey"
@@ -100,7 +105,7 @@
           </el-table-column>
         </el-table>
       </div>
-      <div>
+      <div v-if="radio == 1">
         <h3 id="waterCostTable">水费</h3>
         <el-table
           :key="waterCostTable.tableKey"
@@ -142,7 +147,7 @@
           </el-table-column>
         </el-table>
       </div>
-      <div>
+      <div v-if="radio == 1">
         <h3 id="elecCostTable">电费</h3>
         <el-table
           :key="elecCostTable.tableKey"
@@ -184,7 +189,7 @@
           </el-table-column>
         </el-table>
       </div>
-      <div>
+      <div v-if="radio == 1">
         <h3 id="gasCostTable">柴油费</h3>
         <el-table
           :key="gasCostTable.tableKey"
@@ -227,6 +232,37 @@
         </el-table>
       </div>
       <div>
+        <h3 id="allConsumptionTable">水电柴油用量</h3>
+        <el-table
+          :key="allConsumptionTable.tableKey"
+          v-loading="allConsumptionTable.listLoading"
+          element-loading-text="给我一点时间"
+          :data="allConsumptionTable.list"
+          border
+          fit
+          highlight-current-row
+          style="width: 100%;"
+          :row-style="rowStyle"
+          :cell-style="tableCellStyle"
+          class="elTable"
+          height="350"
+          @sort-change="tableSort10"
+        >
+          <el-table-column label="序号" align="center" type="index" width="50px" />
+          <el-table-column label="牧场" min-width="70px" align="center">
+            <template slot-scope="{row}">
+              <a @click="clickAllConsumption(row)">{{ row.pastureName }}</a>
+            </template>
+          </el-table-column>
+          <el-table-column label="水迄今实际(吨)" sortable min-width="80px" align="center" prop="waterSumPrice" />
+          <el-table-column label="水单头牛迄今实际(吨)" sortable min-width="80px" align="center" prop="waterOneCowSumPrice" />
+          <el-table-column label="电迄今实际(度)" sortable min-width="80px" align="center" prop="electricitySumPrice" />
+          <el-table-column label="电单头牛迄今实际(度)" sortable min-width="80px" align="center" prop="electricityOneCowSumPrice" />
+          <el-table-column label="柴油迄今实际(升)" sortable min-width="80px" align="center" prop="monthiolSumPrice" />
+          <el-table-column label="柴油单头牛迄今实际(升)" sortable min-width="80px" align="center" prop="monthiolOneCowSumPrice" />
+        </el-table>
+      </div>
+      <!-- <div>
         <h3 id="waterConsumptionTable">水量(吨)</h3>
         <el-table
           :key="waterConsumptionTable.tableKey"
@@ -253,22 +289,17 @@
           </el-table-column>
           <el-table-column label="总指标" align="center">
             <el-table-column label="预算" sortable min-width="80px" align="center" prop="monthBudget" />
-            <!-- <el-table-column label="内控" sortable min-width="80px" align="center" prop="monthLimit" /> -->
             <el-table-column label="迄今预算" sortable min-width="80px" align="center" prop="qmonthBudget" />
             <el-table-column label="迄今实际" sortable min-width="80px" align="center" prop="sumPrice" />
             <el-table-column label="实际节约" sortable min-width="80px" align="center" prop="asave" />
             <el-table-column label="实际达成率" :sortable="true" :sort-method="(a,b) => sortMethod(a ,b , 'realReason')" min-width="90px" align="center" prop="realReason" />
           </el-table-column>
           <el-table-column label="单头牛指标" align="center">
-            <!-- <el-table-column label="单头牛预算" sortable min-width="80px" align="center" prop="oneCowBudget" /> -->
-            <!-- <el-table-column label="单头牛内控" sortable min-width="80px" align="center" prop="oneCowLimit" /> -->
-            <!-- <el-table-column label="单头牛迄今内控" sortable min-width="80px" align="center" prop="oneCowQmonthBudget" /> -->
             <el-table-column label="单头牛迄今实际" sortable min-width="80px" align="center" prop="oneCowSumPrice" />
-            <!-- <el-table-column label="单头牛实际节约" sortable min-width="80px" align="center" prop="oneCowAsave" /> -->
           </el-table-column>
         </el-table>
-      </div>
-      <div>
+      </div> -->
+      <!-- <div>
         <h3 id="elecConsumptionTable">电量(度)</h3>
         <el-table
           :key="elecConsumptionTable.tableKey"
@@ -303,16 +334,13 @@
           </el-table-column>
           <el-table-column label="单头牛指标" align="center">
             <el-table-column label="单头牛预算" sortable min-width="80px" align="center" prop="oneCowBudget" />
-            <!-- <el-table-column label="单头牛内控" sortable min-width="80px" align="center" prop="oneCowLimit" /> -->
-            <!-- <el-table-column label="单头牛迄今内控" sortable min-width="80px" align="center" prop="oneCowQmonthBudget" /> -->
             <el-table-column label="单头牛迄今实际" sortable min-width="80px" align="center" prop="oneCowSumPrice" />
-            <!-- <el-table-column label="单头牛实际节约" sortable min-width="80px" align="center" prop="oneCowAsave" /> -->
           </el-table-column>
         </el-table>
-      </div>
+      </div> -->
 
 
-      <div>
+      <!-- <div>
         <h3 id="gasConsumptionTable">柴油用量(L)</h3>
         <el-table
           :key="gasConsumptionTable.tableKey"
@@ -339,24 +367,19 @@
           </el-table-column>
           <el-table-column label="总指标" align="center">
             <el-table-column label="预算" sortable min-width="80px" align="center" prop="monthBudget" />
-            <!-- <el-table-column label="内控" sortable min-width="80px" align="center" prop="monthLimit" /> -->
             <el-table-column label="迄今预算" sortable min-width="80px" align="center" prop="qmonthBudget" />
             <el-table-column label="迄今实际" sortable min-width="80px" align="center" prop="sumPrice" />
             <el-table-column label="实际节约" sortable min-width="80px" align="center" prop="asave" />
             <el-table-column label="实际达成率" :sortable="true" :sort-method="(a,b) => sortMethod(a ,b , 'realReason')" min-width="90px" align="center" prop="realReason" />
           </el-table-column>
           <el-table-column label="单头牛指标" align="center">
-            <!-- <el-table-column label="单头牛预算" sortable min-width="80px" align="center" prop="oneCowBudget" /> -->
-            <!-- <el-table-column label="单头牛内控" sortable min-width="80px" align="center" prop="oneCowLimit" /> -->
-            <!-- <el-table-column label="单头牛迄今内控" sortable min-width="80px" align="center" prop="oneCowQmonthBudget" /> -->
             <el-table-column label="单头牛迄今实际" sortable min-width="80px" align="center" prop="oneCowSumPrice" />
-            <!-- <el-table-column label="单头牛实际节约" sortable min-width="80px" align="center" prop="oneCowAsave" /> -->
           </el-table-column>
         </el-table>
-      </div>
+      </div> -->
 
 
-      <div>
+      <!-- <div>
         <h3 id="bioConsumptionTable">燃动用量</h3>
         <el-table
           :key="bioConsumptionTable.tableKey"
@@ -383,21 +406,16 @@
           </el-table-column>
           <el-table-column label="总指标" align="center">
             <el-table-column label="预算" sortable min-width="80px" align="center" prop="monthBudget" />
-            <!-- <el-table-column label="内控" sortable min-width="80px" align="center" prop="monthLimit" /> -->
             <el-table-column label="迄今预算" sortable min-width="80px" align="center" prop="qmonthBudget" />
             <el-table-column label="迄今实际" sortable min-width="80px" align="center" prop="sumPrice" />
             <el-table-column label="实际节约" sortable min-width="80px" align="center" prop="asave" />
             <el-table-column label="实际达成率" :sortable="true" :sort-method="(a,b) => sortMethod(a ,b , 'realReason')" min-width="90px" align="center" prop="realReason" />
           </el-table-column>
           <el-table-column label="单头牛指标" align="center">
-            <!-- <el-table-column label="单头牛预算" sortable min-width="80px" align="center" prop="oneCowBudget" /> -->
-            <!-- <el-table-column label="单头牛内控" sortable min-width="80px" align="center" prop="oneCowLimit" /> -->
-            <!-- <el-table-column label="单头牛迄今内控" sortable min-width="80px" align="center" prop="oneCowQmonthBudget" /> -->
             <el-table-column label="单头牛迄今实际" sortable min-width="80px" align="center" prop="oneCowSumPrice" />
-            <!-- <el-table-column label="单头牛实际节约" sortable min-width="80px" align="center" prop="oneCowAsave" /> -->
           </el-table-column>
         </el-table>
-      </div>
+      </div> -->
 
 
 
@@ -449,7 +467,7 @@
 <script>
 // 引入
 require('script-loader!file-saver')
-import { GetDataByName } from '@/api/common'
+import { GetDataByName,postJson,getMonthFinalDay } from '@/api/common'
 import waves from '@/directive/waves'
 import Pagination from '@/components/Pagination'
 import { parseTime, sortChange, json2excel } from '@/utils/index.js'
@@ -468,8 +486,9 @@ export default {
   },
   data() {
     return {
+      radio:1,
       jump: '',
-      jumpList: [{ name: '设备指标', id: '0' }, { name: '维修费用', id: '4' }, { name: '水费', id: '1' }, { name: '电费', id: '2' }, { name: '柴油费', id: '3' }, { name: '水量', id: '5' }, { name: '电量', id: '6' }, { name: '柴油量', id: '7' }],
+      jumpList: [{ name: '设备指标', id: '0' }, { name: '维修费用', id: '4' }, { name: '水费', id: '1' }, { name: '电费', id: '2' }, { name: '柴油费', id: '3' }, { name: '水电柴油用量', id: '5' }],
       // pastureId: Cookies.get('pasturename'),
       pastureId: "现代牧业",
       findAllPasture: [],
@@ -480,7 +499,7 @@ export default {
       getDepartParam: { name: 'findAllDepart1', offset: 0, pagecount: 0, parammaps: { 'pastureId': '18', 'eId': Cookies.get('employeid') }},
       departmentId: '',
       findAllDept: [],
-      yearDate: [parseTime(new Date(), '{y}-{m}-{d}'), parseTime(new Date(), '{y}-{m}-{d}')],
+      yearDate: [],
       // 设备指标
       equipmentIndexCostTable: {
         listLoading: true,
@@ -531,6 +550,14 @@ export default {
           parammaps: { startTime: '', endTime: '', pastureId: '', departmentId: '' }
         }
       },
+      // 水电柴油用量
+      allConsumptionTable: {
+        listLoading: true, list: null, tableKey: 0,
+        getdataListParm: {
+          name: 'getChooseMonthWater', page: 1, offset: 1, returntype: 'Map',
+          parammaps: { startTime: '', endTime: '', pastureId: '', departmentId: '' }
+        }
+      },
       // 水量
       waterConsumptionTable: {
         listLoading: true, list: null, tableKey: 0,
@@ -599,10 +626,18 @@ export default {
       percentage: 1,
       rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
       cellStyle: { padding: 0 + 'px' },
-      myWidth:''
+      myWidth:'',
+      monthDate:[]
     }
   },
   created() {
+    if(this.radio == 1){
+      this.yearDate = [parseTime(new Date(), '{y}-{m}'), parseTime(new Date(), '{y}-{m}')]
+      this.changeTime('1')
+    }else{
+      this.yearDate = [parseTime(new Date(), '{y}-{m}-{d}'), parseTime(new Date(), '{y}-{m}-{d}')]
+    }
+    
     this.getWindowWidth()
     this.getPastureDownList()
     this.getlistEquipmentIndex()
@@ -649,6 +684,9 @@ export default {
     tableSort9(column) {
       sortChange(column, this.dialog.list)
     },
+    tableSort10(column) {
+      sortChange(column, this.allConsumptionTable.list)
+    },
     changeJump(callback, jump) {
       if (!callback) {
         if (jump !== '') {
@@ -669,7 +707,9 @@ export default {
             window.scrollTo(0, document.getElementById('elecConsumptionTable').offsetTop - 150)
           } else if (jump == '柴油量') {
             window.scrollTo(0, document.getElementById('gasConsumptionTable').offsetTop - 150)
-          } else {
+          } else if (jump == '水电柴油用量') {
+            window.scrollTo(0, document.getElementById('allConsumptionTable').offsetTop - 150)
+          }else {
             window.scrollTo(0, document.getElementById('equipmentIndexCostTable').offsetTop - 150)
           }
         }
@@ -743,16 +783,34 @@ export default {
       this.departmentId = ''
       this.getlistEquipmentIndex()
     },
-    changeTime() {
-      // if (parseTime(this.yearDate[0], '{y}-{m}') == parseTime(this.yearDate[1], '{y}-{m}') && parseTime(this.yearDate[0], '{y}-{m}') == parseTime(new Date(), '{y}-{m}')) {
-      //   this.yearDate = [parseTime(new Date(), '{y}-{m}-{d}'), parseTime(new Date(), '{y}-{m}-{d}')]
-      // } else if (parseTime(this.yearDate[0], '{y}-{m}') !== parseTime(this.yearDate[1], '{y}-{m}') && parseTime(this.yearDate[0], '{y}-{m}') == parseTime(new Date(), '{y}-{m}')) {
-      //   this.yearDate = [parseTime(new Date(), '{y}-{m}-{d}'), parseTime(this.yearDate[1], '{y}-{m}') + '-00']
-      // } else if (parseTime(this.yearDate[0], '{y}-{m}') !== parseTime(this.yearDate[1], '{y}-{m}') && parseTime(this.yearDate[1], '{y}-{m}') == parseTime(new Date(), '{y}-{m}')) {
-      //   this.yearDate = [parseTime(this.yearDate[0], '{y}-{m}') + '-00', parseTime(new Date(), '{y}-{m}-{d}')]
-      // } else {
-      //   this.yearDate = [parseTime(this.yearDate[0], '{y}-{m}') + '-00', parseTime(this.yearDate[1], '{y}-{m}') + '-00']
-      // }
+    changeRadio(item){
+      this.yearDate = [parseTime(new Date(), '{y}-{m}-{d}'), parseTime(new Date(), '{y}-{m}-{d}')]
+      if(item == 1){
+        this.jumpList = [{ name: '设备指标', id: '0' }, { name: '维修费用', id: '4' }, { name: '水费', id: '1' }, { name: '电费', id: '2' }, { name: '柴油费', id: '3' }, { name: '水电柴油用量', id: '5' }]
+      }else{
+        this.jumpList = [{ name: '维修费用', id: '4' },  { name: '水电柴油用量', id: '5' }]
+      }
+      this.changeTime(item)
+    },
+    changeTime(item) {
+      if(item == 1){
+        let year = this.yearDate[1].split('-')[0]
+        let month = this.yearDate[1].split('-')[1]
+        let lastday = getMonthFinalDay(year,month)
+        this.yearDate = [parseTime(this.yearDate[0], '{y}-{m}') + '-01',lastday]
+        // if (parseTime(this.yearDate[0], '{y}-{m}') == parseTime(this.yearDate[1], '{y}-{m}') && parseTime(this.yearDate[0], '{y}-{m}') == parseTime(new Date(), '{y}-{m}')) {
+        //   this.yearDate = [parseTime(new Date(), '{y}-{m}-{d}'), parseTime(new Date(), '{y}-{m}-{d}')]
+        // } else if (parseTime(this.yearDate[0], '{y}-{m}') !== parseTime(this.yearDate[1], '{y}-{m}') && parseTime(this.yearDate[0], '{y}-{m}') == parseTime(new Date(), '{y}-{m}')) {
+        //   this.yearDate = [parseTime(new Date(), '{y}-{m}-{d}'), parseTime(this.yearDate[1], '{y}-{m}') + '-00']
+        // } else if (parseTime(this.yearDate[0], '{y}-{m}') !== parseTime(this.yearDate[1], '{y}-{m}') && parseTime(this.yearDate[1], '{y}-{m}') == parseTime(new Date(), '{y}-{m}')) {
+        //   this.yearDate = [parseTime(this.yearDate[0], '{y}-{m}') + '-00', parseTime(new Date(), '{y}-{m}-{d}')]
+        // } else {
+        //   this.yearDate = [parseTime(this.yearDate[0], '{y}-{m}') + '-00', parseTime(this.yearDate[1], '{y}-{m}') + '-00']
+        // }
+
+        console.log(this.yearDate)
+      }
+      console.log(item,'===',this.yearDate)
       this.getlistEquipmentIndex()
     },
     // 设备指标
@@ -849,7 +907,26 @@ export default {
         }
         setTimeout(() => {
           this.gasCostTable.listLoading = false
-          this.get_table_dataWaterConsumption()
+          this.get_table_dataallConsumption()
+        }, 100)
+      })
+    },
+    get_table_dataallConsumption() {
+      this.allConsumptionTable.listLoading = true
+      this.allConsumptionTable.getdataListParm.parammaps.startTime = this.yearDate[0]
+      this.allConsumptionTable.getdataListParm.parammaps.endTime = this.yearDate[1]
+      this.allConsumptionTable.getdataListParm.parammaps.pastureId = this.pastureId
+      this.allConsumptionTable.getdataListParm.parammaps.departmentId = this.departmentId
+      let url = 'authdata/waterandelectricity'
+      let data = this.allConsumptionTable.getdataListParm.parammaps
+      postJson(url,data).then(response => {
+        if (response.data.data !== null) {
+          this.allConsumptionTable.list = response.data.data
+        } else {
+          this.allConsumptionTable.list = []
+        }
+        setTimeout(() => {
+          this.allConsumptionTable.listLoading = false
         }, 100)
       })
     },
@@ -910,6 +987,7 @@ export default {
         }, 100)
       })
     },
+
     //生物质
     get_table_dataBioConsumptionTable() {
       this.bioConsumptionTable.listLoading = true
@@ -1025,6 +1103,18 @@ export default {
         this.get_table_dataDialog()
       }
     },
+    clickAllConsumption(row) {
+      if (row.pastureName !== '现代牧业') {
+        this.textMap.allConsumption = row.pastureName + this.yearDate[0].substring(0, this.yearDate[0].lastIndexOf('-')) + '-' + this.yearDate[1].substring(0, this.yearDate[1].lastIndexOf('-')) + '水量'
+        this.dialogStatus = 'allConsumption'
+        this.dialog.dialogFormVisible = true
+        this.dialog.getdataListParm.name = 'getChooseMonthWaterDepartment'
+        this.dialog.getdataListParm.parammaps.startTime = this.yearDate[0]
+        this.dialog.getdataListParm.parammaps.endTime = this.yearDate[1]
+        this.dialog.getdataListParm.parammaps.pastureId = row.pastureId
+        this.get_table_dataDialog()
+      }
+    },
     // 水量-点击
     clickWaterConsumption(row) {
       if (row.pastureName !== '现代牧业') {

+ 11 - 7
src/views/special/measure/index.vue

@@ -84,11 +84,6 @@
           <span>{{ scope.row.price }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="倍率" sortable prop="Multiple" min-width="90px" align="center">
-        <template slot-scope="scope">
-          <span>{{ scope.row.Multiple }}</span>
-        </template>
-      </el-table-column>
       <el-table-column label="负责人" min-width="110px" align="center">
         <template slot-scope="scope">
           <span>{{ scope.row.employeName }}</span>
@@ -190,6 +185,13 @@
               </el-form-item>
             </el-col>
           </el-row>
+          <!-- <el-row>
+            <el-col :span="8">
+              <el-form-item label="iot编号:" prop="iotNumber">
+                <el-input ref="iotNumber" v-model="createTemp.iotNumber" type="number" />
+              </el-form-item>
+            </el-col>
+          </el-row> -->
         </el-form>
       </div>
       <div slot="footer" class="dialog-footer">
@@ -416,7 +418,8 @@ export default {
         pastureId: this.$store.state.user.pastureid,
         formNumber: '',
         inputDatetime: parseTime(new Date(), '{y}-{m}-{d}'),
-        Multiple: '1'
+        Multiple: '1',
+        iotNumber:''
       },
       requestParam: {},
       activeName: 'first',
@@ -558,7 +561,8 @@ export default {
         pastureId: parseInt(Cookies.get('pastureid')),
         formNumber: '',
         inputDatetime: parseTime(new Date(), '{y}-{m}-{d}'),
-        Multiple: '1'
+        Multiple: '1',
+        iotNumber:''
       }
     },
     form_add() {

Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor