Browse Source

更新了问题清单

duanxiaoduan 1 year ago
parent
commit
16fe03e53b

+ 2 - 2
.env.development

@@ -3,11 +3,11 @@ ENV = 'development'
 
 # base api
 # 测试线
-# VUE_APP_BASE_API = 'http://192.168.1.70:8081/'
+VUE_APP_BASE_API = 'http://192.168.1.70:8081/'
 
 
 #许义平本地
-VUE_APP_BASE_API = 'http://192.168.1.96:8090/'
+# VUE_APP_BASE_API = 'http://192.168.1.96:8090/'
 
 #=====
 # vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable,

+ 87 - 29
src/views/dashboard/index.vue

@@ -165,14 +165,14 @@
             <div id="chartLine3" v-loading="abnormal.chart1.listLoading" style="height:420px;" />
           </div>
           <div v-else style="margin: 10px 10px;">
-            <el-select v-model="abnormal.value2" style="width:100px;margin-right: 5px;margin-bottom:10px;" class="filter-item" @change="changeformula('3')">
-              <el-option v-for="item in abnormal.formulaList" :key="item.value" :label="item.label" :value="item.value">
-              </el-option>
+            <el-select v-model="abnormal.value3" style="width:100px;margin-right: 5px;margin-bottom:10px;" class="filter-item" @change="changepasture('3')">
+              <el-option v-for="item in abnormal.pastureList" :key="item.id" :label="item.name" :value="item.id" />
             </el-select>
-            <el-select v-model="abnormal.value2" style="width:100px;margin-right: 5px;margin-bottom:10px;" class="filter-item" @change="changeformula('3')">
-              <el-option v-for="item in abnormal.formulaList" :key="item.value" :label="item.label" :value="item.value">
+            <el-select v-model="abnormal.value4" style="width:100px;margin-right: 5px;margin-bottom:10px;" class="filter-item" @change="changestate('3')">
+              <el-option v-for="item in abnormal.stateList" :key="item.value" :label="item.label" :value="item.value">
               </el-option>
-            </el-select>
+            </el-select>
+            <span style="float: right;">共{{abnormal.chart1.tableDataList1.length}}次</span>
             <el-table :data="abnormal.chart1.tableDataList1" border style="width: 100%;" :max-height="410"
               :row-style="rowStyle" :cell-style="cellStyle" class="elTable">
               <el-table-column label="牧场" min-width="130px" align="center" prop="pasture_name" />
@@ -202,10 +202,10 @@
             <el-tab-pane label="撒料正确率" name="fourth" />
           </el-tabs>
           <div class="search">
-            <el-input v-model="accuracy.seeRanking.name" placeholder="准确率" style="width: 180px;" class="filter-item"
+            <el-input v-model="accuracy.seeRanking.top_rand_start" placeholder="准确率" style="width: 180px;" class="filter-item"
               type="number" clearable />
             <span style="margin-right: 5px;">-</span>
-            <el-input v-model="accuracy.seeRanking.name" placeholder="准确率" style="width: 180px;" class="filter-item"
+            <el-input v-model="accuracy.seeRanking.top_rand_end" placeholder="准确率" style="width: 180px;" class="filter-item"
               type="number" clearable />
             <el-button class="successBorder" @click="handleSearch">查询</el-button>
           </div>
@@ -325,10 +325,14 @@
         },
         abnormal: {
           value1: '',
-          value2: '',
+          value2: '',
+          value3:0,
+          value4:0,
           inputDatetime: [new Date(), new Date()],
           cattleTpyeList: JSON.parse(sessionStorage.downlist).cattle_parent_category,
-          formulaList: JSON.parse(sessionStorage.downlist).formula_list,
+          formulaList: JSON.parse(sessionStorage.downlist).formula_list,
+          pastureList:JSON.parse(sessionStorage.pastureList), //牧场
+          stateList:[{name:'数据状态',id:0},{name:'正常撒料',id:1},{name:'异常撒料',id:2}],
           chart1: {
             isChart: true,
             listLoading: false,
@@ -353,7 +357,8 @@
       }
     },
     created() {
-      // accuracy.inputDatetime
+      // accuracy.inputDatetime
+      this.abnormal.pastureList.unshift({id:0,name:'所有牧场'})
       this.getTimeFn()
     },
     mounted() {
@@ -369,10 +374,17 @@
         const that = this
         const start1 = new Date()
         const end1 = new Date()
-        start1.setTime(start1.getTime() - 3600 * 1000 * 24 * 1)
-        end1.setTime(end1.getTime() - 3600 * 1000 * 24 * 1)
+        start1.setTime(start1.getTime() - 3600 * 1000 * 24 * 7)
+        end1.setTime(end1.getTime() - 3600 * 1000 * 24 * 0)
         that.accuracy.inputDatetime = [start1, end1]
 
+        
+        const start3 = new Date()
+        const end3 = new Date()
+        start3.setTime(start3.getTime() - 3600 * 1000 * 24 * 7)
+        end3.setTime(end3.getTime() - 3600 * 1000 * 24 * 0)
+        that.time.inputDatetime = [start3, end3]
+
         const start2 = new Date()
         const end2 = new Date()
         start2.setTime(start2.getTime() - 3600 * 1000 * 24 * 31)
@@ -477,7 +489,10 @@
             }
           });
         } else {
-          this.abnormal.chart1.isChart = !this.abnormal.chart1.isChart
+          this.abnormal.chart1.isChart = !this.abnormal.chart1.isChart
+          this.abnormal.value3 = 0
+          this.abnormal.value4 = 0
+          this.getChart3List()
           this.$nextTick(() => {
             if (this.abnormal.chart1.isChart) {
               this.roadChartLine3(this.abnormal.chart1.lineData1)
@@ -491,21 +506,34 @@
         this.accuracy.dialogFormVisible = true
         this.getSeeRankingList()
       },
-      getSeeRankingList() {
+      getSeeRankingList(item) {
         let url = '/api/v1/ops/dashboard/top_pasture'
         let pasture_ids = []
         this.pastureList.forEach((item) => {
           pasture_ids.push(item.id)
-        })
+        })
+        let dashboard_top_type = 0
+        if(item){
+          dashboard_top_type = item
+        }else{
+          dashboard_top_type = 0
+        }
         let data = {
           'cattle_parent_category_id': this.accuracy.value1,
           'start_date':parseTime(this.accuracy.inputDatetime[0], '{y}-{m}-{d}'),
           'end_date':parseTime(this.accuracy.inputDatetime[1], '{y}-{m}-{d}'),
           'pasture_ids':pasture_ids,
-          'feed_formula_id':this.accuracy.value2,
+          'feed_formula_id':this.accuracy.value2,
+          'dashboard_top_type':dashboard_top_type
         }
         if (this.accuracy.value2 == '') {
           data.feed_formula_id = 0
+        }
+        if (this.accuracy.seeRanking.top_rand_start !== '') {
+          data.top_rand_start = this.accuracy.seeRanking.top_rand_start
+        }
+        if (this.accuracy.seeRanking.top_rand_end !== '') {
+          data.top_rand_end = this.accuracy.seeRanking.top_rand_end
         }
         postJson(url, data).then(response => {
           if (response.code == 200) {
@@ -536,7 +564,19 @@
           this.accuracy.seeRanking.list = this.accuracy.seeRanking.allData.sprinkle_fodder_correct_ratio
         }
       },
-      handleSearch() {},
+      handleSearch() {
+        let dashboard_top_type = 0
+        if(this.accuracy.seeRanking.activeName == 'first'){
+          dashboard_top_type = 1
+        }else if(this.accuracy.seeRanking.activeName == 'second'){
+          dashboard_top_type = 2
+        }else if(this.accuracy.seeRanking.activeName == 'third'){
+          dashboard_top_type = 3
+        }else{
+          dashboard_top_type = 4
+        }
+        this.getSeeRankingList(dashboard_top_type)
+      },
       handleMore() {
         this.accuracy.dialogStatus = 'more'
         this.getPastureList()
@@ -622,12 +662,27 @@
 
         }
       },
+      changepasture(){
+        this.getChart3List()
+      },
+      changestate(){
+        this.getChart3List()
+      },
       getChart3List() {
-        let url = '/api/v1/ops/dashboard/sprinkle_time'
         let pasture_ids = []
-        this.pastureList.forEach((item) => {
-          pasture_ids.push(item.id)
-        })
+        if(this.abnormal.chart1.isChart){
+          this.abnormal.value3 == 0
+          this.abnormal.value4 == 0
+        }
+        if(this.abnormal.value3 == 0){
+          this.pastureList.forEach((item) => {
+            pasture_ids.push(item.id)
+          })
+        }else{
+          pasture_ids.push(this.abnormal.value3)
+        }
+        let url = '/api/v1/ops/dashboard/sprinkle_time'
+
         let data = {
           'start_date': parseTime(this.abnormal.inputDatetime[0], '{y}-{m}-{d}'),
           'end_date': parseTime(this.abnormal.inputDatetime[1], '{y}-{m}-{d}'),
@@ -667,7 +722,7 @@
           grid: {
             left: '3%',
             right: '14%',
-            top: '3%',
+            // top: '3%',
             containLabel: true
           },
           xAxis: [{
@@ -685,13 +740,14 @@
             },
           }],
           yAxis: [{
-            type: 'value',
+            type: 'value',
+            name: '(%)',
             axisLine: {
               lineStyle: {
                 color: '#666'
               }
             },
-          }],
+          }],
           color: ['#4b07fa', '#0f96fc', '#ff42a9', '#ff724c', '#05fbf0', '#ffae00', '#b705fa', '#9a60b4', '#3cff00'],
           series: function(e) {
             var serie = [];
@@ -735,10 +791,10 @@
           }, // formatter可不设置
           color: `#8d8d8d`, // 箱线图线框的颜色
           grid: {
-            left: 0,
+            left: '3%',
             right: 10,
             bottom: 10,
-            top: 20,
+            // top: 20,
             containLabel: true,
           },
           legend: {
@@ -767,6 +823,7 @@
           },
           yAxis: {  // 此处设置与其他图表类似
             type: `value`,
+            name:'(分钟)',
             splitArea: { show: false },
             axisLine: { lineStyle: { color: `#8d8d8d` } },
           },
@@ -841,7 +898,7 @@
             top: 0,
           },
           grid: {
-            top: '20%',
+            // top: '20%',
             left: '3%',
             right: '14%',
             bottom: '13%',
@@ -852,7 +909,8 @@
             data: chartLine_data.title,
           }],
           yAxis: [{
-            type: 'value',
+            type: 'value',
+            name:'(次)',
             axisLine: {
               lineStyle: {
                 color: '#666'

+ 1 - 1
src/views/rangeManagement/pastureList/index.vue

@@ -276,7 +276,7 @@ export default {
     handleEnableChange(index, row) {
       let url = 'api/v1/ops/pasture/is_show'
       let data = {
-        "pasture_id":row.id,
+        "pasture_id":row.pasture_id,
         "is_show":row.is_show
       }
       postJson(url,data).then(response => {

+ 6 - 4
src/views/statisticalAnalysis/feedingEfficiency/index.vue

@@ -643,8 +643,8 @@ export default {
 
         table: {
           getdataListParm: {
-            // name: 'getFeedEfficiencyFT',
-            name:'getPriceAnalysisLS',
+            name: 'getFeedEfficiencyFT',
+            // name:'getPriceAnalysisLS',
             page: 1,
             offset: 1,
             pagecount: '',
@@ -1710,6 +1710,7 @@ export default {
       let data = {
         'pasture_id':[this.tab.table.getdataListParm.parammaps.pastureId],
         'start_time':this.tab.table.getdataListParm.parammaps.startTime,
+        'end_time':this.tab.table.getdataListParm.parammaps.startTime,
         'api_name':this.tab.table.getdataListParm.name,
         'formula_template':this.tab.table.getdataListParm.parammaps.ftname,
         'barn_name':this.tab.table.getdataListParm.parammaps.barname,
@@ -1720,8 +1721,9 @@ export default {
       // GetDataByName(this.tab.table.getdataListParm).then(response => {
         console.log('汇总统计/混料table数据', response.data.list)
         if (response.data.list !== null) {
-          this.tab.table.list = response.data.list
-          this.tab.table.total = response.data.total
+          let dataValue = Object.values(response.data.list)
+          this.tab.table.list = dataValue
+          this.tab.table.total = dataValue.length
         } else {
           this.tab.table.list = []
         }

+ 1 - 1
src/views/systemManagement/user/index.vue

@@ -33,7 +33,7 @@
         <el-table-column label="用户名称" min-width="120px" align="center" prop="name" />
         <el-table-column label="员工姓名" min-width="120px" align="center" prop="employee_name" />
         <el-table-column label="手机号" min-width="120px" align="center" prop="phone" />
-        <el-table-column label="角色" min-width="120px" align="center" prop="phone" />
+        <el-table-column label="角色" min-width="120px" align="center" prop="role_name" />
         <el-table-column label="创建时间" min-width="120px" align="center" prop="created_at_format" />
         <el-table-column label="创建人" min-width="120px" align="center" prop="create_user" />
         <el-table-column label="是否启用" min-width="110px" align="center">