Bläddra i källkod

messageReciew

epans 11 månader sedan
förälder
incheckning
1b48539266

+ 1 - 1
src/utils/request.js

@@ -24,7 +24,7 @@ if (reg.test(browserUrl)){
 
 
 //正常本地打包地址
-//axios.defaults.baseURL = process.env.VUE_APP_BASE_API
+ //axios.defaults.baseURL = process.env.VUE_APP_BASE_API
 
 
 

+ 50 - 3
src/views/Home.vue

@@ -2,7 +2,7 @@
  
   <el-container class ="home-container">
     <!-- 头部区域 -->
-    <el-header>
+    <el-header style = "position:relative">
       <div  class ="left-logo">
         <!-- <span>犊牛饲喂系统</span> -->
       </div>
@@ -10,8 +10,14 @@
         
         <!-- <span>犊牛饲喂系统</span> -->
       </div>
-      
-      <el-button @click="logout" >退出</el-button>
+
+      <!--  -->
+      <span style="position:absolute;top:20px;right:120px;font-size:14px;">
+        {{user_name}}
+      </span>
+
+      <el-button type="primary" plain size="mini"  @click="logout">退出</el-button>
+ 
     </el-header>
     <el-container style = "position:relative">
       <!-- 侧边栏 -->
@@ -82,6 +88,12 @@ import { parseTime, json2excel } from '@/utils/index.js'
 export default {
   data() {
     return {
+      messageNum: 0,
+      messageList:[
+        // {id:1},{id:2},
+        
+      ],
+      user_name:'',
 
 
       editableTabsValue: '2',
@@ -176,11 +188,46 @@ export default {
       
      this.getMenuList()
      this.activePath = window.sessionStorage.getItem('activePath')
+
+     console.log(" this.activePath==========",this.activePath)
+
+     this.getUserInfo()
   },
   methods:{
 
+     
+    //获取用户信息
+    getUserInfo(){
+      var me = this 
+
+     
+      ajaxDataGet('/api/v1/system/user_info', {}).then(e => {
+        console.log("获取用户信息",e)
+          //打印请求成功结果
+          if(e.code == 200 ){
+            me.user_name = e.data.employee_name
+           
+          } else {
+            me.user_name = ""
+          }
 
+        
   
+        })
+
+
+    },
+
+     click_message_all(){
+       var me = this 
+      
+       window.sessionStorage.setItem('activePath','/MessagesReceive')
+       me.activePath = '/MessagesReceive'
+       me.$router.push('/MessagesReceive')
+       
+ 
+       console.log(me.activePath)
+     },
 
       handleClick(val) {
         // console.log(tab, event);

+ 1 - 1
src/views/Login.vue

@@ -261,7 +261,7 @@ export default {
     -webkit-text-fill-color: #000 !important;
 }
 
-.login-container{position: relative;height: 100%;width: 100%; min-height: 500px;background:  url("../assets/bg.png") no-repeat; }
+.login-container{position: relative;height: 100%;max-width: 100%; min-height: 500px;background:  url("../assets/bg.png") no-repeat; }
 
 .new-login{   width: 1000px;height: 700px;position: absolute;left: 0;right: 0;bottom: 0;top: 0;margin: auto; background:  url("../assets/lg-img.png") no-repeat; }
  

+ 355 - 4
src/views/dataStatistics/DiseaseSituation.vue

@@ -1,7 +1,70 @@
 <template>
  
   <div>
-        1.0.2版本页面,待开发
+
+    <el-card class="box-card">
+
+       <!-- 搜索区域 -->
+       <div class="search-bx1">
+
+
+        <el-date-picker v-model="searchData.date_for_year" class="g-mr20" type="year" value-format="yyyy"  style="width: 250px;" />
+
+
+        <!-- <el-date-picker v-model="table.get_table_dataParm.parammaps.year" style="width:100px;" :clearable="false"  type="year" placeholder="选择年" format="yyyy" value-format="yyyy" @change="changeYear" />
+      <el-date-picker v-model="month"  type="month" style="width:90px;" placeholder="选择月" format="MM" value-format="MM" /> -->
+
+        <el-select v-model="searchData.calf_category_id" filterable placeholder="犊牛类型" style="width: 180px;" class="g-mr20">
+          <el-option v-for="item in calfTypeList" :key="item.id" :label="item.name" :value="item.id" />
+        </el-select>
+
+        <el-select   v-model="searchData.diseased_id"   placeholder="疾病类型" style="width: 180px;" class="g-mr20" clearable>
+          <el-option v-for="item in diseaseList" :key="item.id" :label="item.name" :value="item.id" />
+        </el-select>
+
+       
+
+
+         
+          <el-button type="primary"   @click="form_search">搜索</el-button>
+          <!-- <el-button type="primary"   @click="form_clear">重置</el-button> -->
+     
+            <el-button type="primary"   @click="form_export">导出</el-button>  
+      </div>
+
+
+      <div id="chartBar1"  style="width: 100%;height:280px;"></div>
+
+
+      <!-- 表格 -->
+      <el-table   key="0"  :data="tableList"  v-loading="tableLoading" element-loading-text="给我一点时间"    border fit>
+        <el-table-column label="日期"  width="250px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.date_month }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="发病次数" min-width="150px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.disease_count }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="治愈次数" min-width="150px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.recover_count }}</span>
+          </template>
+        </el-table-column>  
+        <el-table-column label="治愈率" min-width="150px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.recover_ratio }}</span>
+          </template>
+        </el-table-column>  
+        
+      </el-table>
+
+      
+
+
+    </el-card >
   </div>
 
 
@@ -10,26 +73,314 @@
 <script>
 import {  ajaxDataGet, ajaxDataPost, ajaxDataPut, ajaxDataDelete, checkButtons} from '@/api/common'
 import { parseTime, json2excel } from '@/utils/index.js'
+
+import * as echarts from 'echarts';
+
 export default {
   data() {
 
-
-    
+ 
  
   
     return {
 
+
+      //接口 - 获取 - 表格
+      url_get_table:'/api/v1/ops/statistics/disease',
+ 
+ 
+      //获取 - 表格数据 - 参数
+      searchData:{
+        date_for_year: parseTime(new Date(), '{y}'),
+        month: parseTime(new Date(), '{m}'),
+        calf_category_id: undefined,
+        diseased_id: undefined,
+        page: 1,  //页码
+        page_size: 10,   //每页数量
+        total:0,  //总页数
+        pastureId: ""
+      },
+      tableLoading: false,
+      //表格内容
+      tableList:[
+        //  { username:"admin", id:100, date:'2023-12-01',email:'测试信息1123',roleList:[2,3] },
+        // { username:"epans", id:200, date:'2023-12-01',email:'测试信息1123',roleList:[] },
+        // { username:"derek", id:300, date:'2023-12-01',email:'测试信息1123' },
+        // { username:"admin", id:100, date:'2023-12-01',email:'测试信息1123' },
+        // { username:"epans", id:200, date:'2023-12-01',email:'测试信息1123' },
+        // { username:"derek", id:300, date:'2023-12-01',email:'测试信息1123' },
+        // { username:"admin", id:100, date:'2023-12-01',email:'测试信息1123' },
+        // { username:"epans", id:200, date:'2023-12-01',email:'测试信息1123' },
+        // { username:"derek", id:300, date:'2023-12-01',email:'测试信息1123' },
+        // { username:"admin", id:100, date:'2023-12-01',email:'测试信息1123' },
+        // { username:"epans", id:200, date:'2023-12-01',email:'测试信息1123' },
+        // { username:"derek", id:300, date:'2023-12-01',email:'测试信息1123' },
+      ],
+
+
+      diseaseList: [
+        //  {id: "疾病1", name: "疾病1"}, 
+        //  {id: "疾病1", name: "疾病1"}, 
+        //  {id: "疾病1", name: "疾病1"}, 
+ 
+      ], 
+
+      //  下拉框 - 栏舍组 
+      calfTypeList: [
+        // {id: "栏舍组1", name: "栏舍组1"}, 
+        // {id: "栏舍组2", name: "栏舍组2"}, 
+        // {id: "栏舍组3", name: "栏舍组3"}
+      ], 
+
+
+
+      chart1: {
+        getdataListParm: {
+          name: 'getChart1ByHomepage',
+          page: 1,
+          offset: 1,
+          pagecount: '',
+          returntype: 'Map',
+          parammaps: {
+            inputDatetime: '',
+            beginDate: '',
+            endDate: '',
+        
+          }
+        }
+      },
+      //图表实例
+      chartBar1: null,
+      //图表数据
+      chartBar1_data: {
+        // date_month:['2022-01', '2022-02', '2022-03', '2022-04', '2022-05', '2022-06', '2022-07'],
+        // disease_count:[49, 71, 98, 92, 104, 76, 113],
+        // recover_count:[83, 78, 98, 93, 106, 85, 115],
+       
+      },
   
        
     }
+  },
+  mounted() {
+    //加载 - 图表假数据,如果是图表需要放mounted里测试假数据
+     //this.roadchartBar1(this.chartBar1_data)
+
+ 
   },
   created(){
     
-    
+    //获取下拉框
+    this.get_select_list1()
+    //表格 - 初始化 
+    this.get_table_data()
+
+
+     //this.getChart1
+
   },
   methods:{
 
+    //获取 下拉框
+    get_select_list1(){
+        var me = this
+
+
+        
+ 
+
+        ajaxDataPost('/api/v1/ops/base_setting/calf_type/list?page=1&page_size=1000', {name:"" }).then(e => {
+            console.log("犊牛类型1:",e)
+
+            //打印请求成功结果
+            if(e.data.list == null || e.data.list == undefined ||e.data.list.length == 0   ){
+              me.calfTypeList = []
+            } else {
+              me.calfTypeList = e.data.list
+            }
+
+        })
+ 
+        ajaxDataPost('/api/v1/ops/base_setting/category_table/list?page=1&page_size=1000', {category_type: 3 }).then(e => {
+            console.log("疾病:",e)
+
+            //打印请求成功结果
+            if(e.data.list == null || e.data.list == undefined ||e.data.list.length == 0   ){
+              me.diseaseList = []
+            } else {
+              me.diseaseList = e.data.list
+            }
+
+        })
+
+ 
+    
+    },
+
+
+    //搜索 查询表格
+    form_search(){
+      var me = this
+      console.log('请求表格列表searchData',me.searchData)
+
+              
+      me.get_table_data()
+      //me.getChart1()
+
+    },
+    
+
+    //获取 表格
+    get_table_data() {
+ 
+      var me = this
+
+      me.tableLoading = true
+      console.log("searchData======>", me.searchData)
+
+
+      
+      if( me.searchData.calf_category_id == ""){
+        me.searchData.calf_category_id = undefined
+      }
+      if( me.searchData.diseased_id == ""){
+        me.searchData.diseased_id = undefined
+      }
+
+       var send_url = me.url_get_table + '?page=' + me.searchData.page +  '&page_size=' + me.searchData.page_size
+
+       ajaxDataPost(send_url,  me.searchData).then(e => {
+          console.log("表格+图表请求结果:",e)
+          //打印请求成功结果
+            if(e.code == 200 ){
+              me.tableList = e.data.table
+              me.chartBar1_data = e.data.chart
+            } else {
+
     
+              me.$message({ type: 'error', message: '请求表格列表失败!' + e.msg, duration: 2000 })
+            }
+
+            setTimeout(() => {
+              me.tableLoading = false
+
+              me.roadchartBar1(me.chartBar1_data)
+            }, 100)
+
+        })
+
+      
+    },
+
+    getChart1() {
+
+
+      var send_url = me.url_get_chart + '?page=' + me.searchData.page +  '&page_size=' + me.searchData.page_size
+
+      ajaxDataPost(send_url,  me.searchData).then(e => {
+        console.log("图表请求结果:",e)
+        //打印请求成功结果
+          // if(e.code == 200 ){
+          //   me.tableList = e.data.list
+          //   me.searchData.total = e.data.total;	// 总数
+          //   me.searchData.page = e.data.page;	//页码
+          //   me.searchData.page_size = e.data.page_size;	//每页数量
+          
+          // } else {
+          //   me.$message({ type: 'error', message: '请求表格列表失败!' + e.msg, duration: 2000 })
+          // }
+
+          // if (response.data.list !== null) {
+          //   var chartBar1_data = response.data.list[0]
+          //   this.chartBar1_data =  chartBar1_data
+          //   this.roadchartBar1(chartBar1_data)
+          // } else {
+          //   this.chart1.list = []
+          // }
+ 
+
+      })
+
+ 
+     
+    },
+
+    roadchartBar1(chartBar1_data) {
+
+            
+      if (this.chartBar1 != null) {
+        this.chartBar1.dispose()
+      }
+
+      console.log(echarts)
+      this.chartBar1 = echarts.init(document.getElementById('chartBar1'))
+      var option = {
+        title: { text: '疾病情况'},
+        tooltip: { trigger: 'axis' },
+        legend: { data: ['治愈','疾病' ] },
+        grid: { left: '3%',right: '4%', bottom: '3%', containLabel: true },
+        xAxis: {
+          type: 'category',
+          axisPointer: { type: 'shadow'},
+          data: chartBar1_data.date_month 
+        },
+        yAxis: [
+          { type: 'value',axisLabel: {formatter: '{value} 次' }},
+        ],
+        series: [
+          { name: '治愈',  type: 'bar', data: chartBar1_data.recover_count   },
+          { name: '疾病',  type: 'bar', data: chartBar1_data.disease_count   },
+        ]
+      }
+
+
+      this.chartBar1.setOption(option)
+      window.onresize = function () {
+        this.chartBar1.resize()
+      }
+    },
+
+
+    form_export() {
+        //获取请求表格数据的参数
+        //this.download.getdataListParm.parammaps = this.tableObj.getdataListParm.parammaps
+        //请求表格
+        // GetDataByName(this.download.getdataListParm).then(response => {
+        //     if (response.data.list !== null) {
+        //       this.download.list = response.data.list
+        //     } else {
+        //       this.download.list = []
+        //     }
+        //     var excelDatas = [
+        //       {
+        //         tHeader: ['表头1', '表头2', '表头3', '表头4',],
+        //         filterVal: ['title1', 'title2', 'title3', 'title4'],
+        //         tableDatas: this.download.list,
+        //         sheetName: 'Sheet1'
+        //       }
+        //     ]
+        //     json2excel(excelDatas, '表格大标题', true, 'xlsx')
+        // })
+
+        var excelDatas = [
+            {
+                tHeader: ['表头1', '表头2', '表头3', '表头4',],
+                filterVal: ['title1', 'title2', 'title3', 'title4'],
+                tableDatas: [ 
+                    {title1: "内容1",title2: "内容2",title3: "内容3",title4: "内容4"},
+                    {title1: "内容11",title2: "内容22",title3: "内容32",title4: "内容44"},
+                    {title1: "内容111",title2: "内容222",title3: "内容333",title4: "内容444"},
+                ],
+                sheetName: 'Sheet1'
+            }
+        ]
+        json2excel(excelDatas, '表格大标题', true, 'xlsx')
+    }
+
+
+    
+
+   
      
 
   }

+ 2 - 2
src/views/dataStatistics/FeedProcess.vue

@@ -1,7 +1,7 @@
 <template>
- 
-  <div>
 
+  <div>
+    <!-- 100 -->
 
     <el-card class="box-card">
       <!-- 搜索区域 -->

+ 481 - 0
src/views/dataStatistics/FeedProcess100.vue

@@ -0,0 +1,481 @@
+<template>
+
+  <div>
+    <!-- 100 -->
+
+    <el-card class="box-card">
+      <!-- 搜索区域 -->
+      <div class="search-bx1">
+
+        <el-row :gutter="20">
+            <el-col :span="24">
+              <el-date-picker v-model="searchData.date"  type="date"  placeholder="选择日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd"  :clearable="false" style="width: 180px;"  class="g-mr20  g-mb20" />
+ 
+
+              <el-select v-model="searchData.feed_plan_id" filterable placeholder="饲喂计划" class="g-mr20" style="width: 180px;"   @change="change_plan">
+                <el-option v-for="item in feedPlanList" :key="item.id" :label="item.name" :value="item.id" />
+              </el-select>
+
+              <span>班次:</span>
+              <el-input v-model="searchData.class_number_name" placeholder=""  style="width: 180px;" disabled />
+
+              <span>饲喂车:</span>
+              <el-input v-model="searchData.feed_vehicle_name" placeholder=""  style="width: 180px;" disabled />
+
+
+         
+
+              <!-- <el-select v-model="searchData.class_number" filterable placeholder="班次" class="g-mr20  g-mb20" style="width: 180px;" clearable>
+                <el-option v-for="item in classList" :key="item.value" :label="item.label" :value="item.value" />
+              </el-select>
+              <el-select v-model="searchData.feed_vehicle_id" filterable placeholder="饲喂车" class="g-mr20" style="width: 180px;" clearable  @change="change_car">
+                <el-option v-for="item in feedCarList" :key="item.id" :label="item.name" :value="item.id" />
+              </el-select> -->
+              <span>饲喂车编号:</span>
+              <el-input v-model="searchData.feed_vehicle_number" placeholder=""  style="width: 180px;" disabled />
+            </el-col>
+        </el-row>
+        <el-row :gutter="20">
+            <el-col :span="24">
+ 
+                <el-input v-model="searchData.barn_name" placeholder="栏舍名称"  style="width: 220px;" class="g-mr20  g-mb20" clearable />
+                <el-input v-model="searchData.barn_group_name" placeholder="栏舍组名称"  style="width: 220px;" class="g-mr20 " clearable />
+
+                <el-input-number v-model="searchData.min_accurate_ratio" style="width:120px;" :controls="false" placeholder="准确率" />
+                <span style="margin:0px 8px;">至</span>
+                <el-input-number v-model="searchData.max_accurate_ratio" style="width:120px;" class="g-mr20" :controls="false" placeholder="准确率" />
+
+                <el-input-number v-model="searchData.min_temp" style="width:120px;" :controls="false" placeholder="温差" />
+                <span style="margin:0px 8px;">至</span>
+                <el-input-number v-model="searchData.max_temp" style="width:120px;" class="g-mr20" :controls="false" placeholder="温差" />
+
+                <el-button type="primary"   @click="form_search">搜索</el-button>
+                <el-button type="primary"   @click="form_clear">重置</el-button>
+            </el-col>
+        </el-row>
+
+ 
+      </div>
+
+ 
+      <!-- 表格 -->
+      <el-table   key="0"  :data="tableList"  v-loading="tableLoading" element-loading-text="给我一点时间"    border fit>
+                <el-table-column label="序号"  width="50px" align="center">
+                  <template slot-scope="scope">
+                    <span>{{ scope.row.id }}</span>
+                  </template>
+                </el-table-column>
+                <el-table-column label="栏舍名称" min-width="120px" align="center" show-overflow-tooltip>
+                  <template slot-scope="scope">
+                    <span>{{ scope.row.barn_name  }}</span>
+                  </template>
+                </el-table-column>
+                <el-table-column label="栏舍组名称" min-width="120px" align="center" show-overflow-tooltip>
+                  <template slot-scope="scope">
+                    <span>{{ scope.row.barn_group_name  }}</span>
+                  </template>
+                </el-table-column>
+                <el-table-column label="开始日龄" min-width="120px" align="center" show-overflow-tooltip>
+                  <template slot-scope="scope">
+                    <span>{{ scope.row.start_age  }}</span>
+                  </template>
+                </el-table-column>
+                <el-table-column label="结束日龄" min-width="120px" align="center" show-overflow-tooltip>
+                  <template slot-scope="scope">
+                    <span>{{ scope.row.end_age  }}</span>
+                  </template>
+                </el-table-column>
+                <el-table-column label="计划量(kg)" min-width="120px" align="center" show-overflow-tooltip>
+                  <template slot-scope="scope">
+                    <span>{{ scope.row.plan_feed_number  }}</span>
+                  </template>
+                </el-table-column>
+                <el-table-column label="实际量(kg)" min-width="120px" align="center" show-overflow-tooltip>
+                  <template slot-scope="scope">
+                    <span>{{ scope.row.reality_feed_number  }}</span>
+                  </template>
+                </el-table-column>
+                <el-table-column label="误差量(kg)" min-width="120px" align="center" show-overflow-tooltip>
+                  <template slot-scope="scope">
+                    <span>{{ scope.row.error_number  }}</span>
+                  </template>
+                </el-table-column>
+                <el-table-column label="准确率" min-width="120px" align="center" show-overflow-tooltip>
+                  <template slot-scope="scope">
+                    <span>{{ scope.row.accurate_ratio  }}</span>
+                  </template>
+                </el-table-column>
+                <el-table-column label="计划温度°C" min-width="120px" align="center" show-overflow-tooltip>
+                  <template slot-scope="scope">
+                    <span>{{ scope.row.plan_temp  }}</span>
+                  </template>
+                </el-table-column>
+                <el-table-column label="温差°C" min-width="120px" align="center" show-overflow-tooltip>
+                  <template slot-scope="scope">
+                    <span>{{ scope.row.reality_temp - scope.row.plan_temp  }}</span>
+                  </template>
+                </el-table-column>
+                <el-table-column label="过程时间" min-width="120px" align="center" show-overflow-tooltip>
+                  <template slot-scope="scope">
+                    <span>{{ scope.row.process_time  }}</span>
+                  </template>
+                </el-table-column>
+                <el-table-column label="上报时间" min-width="120px" align="center" show-overflow-tooltip>
+                  <template slot-scope="scope">
+                    <span>{{ scope.row.created_at_format  }}</span>
+                  </template>
+                </el-table-column>
+
+      </el-table>
+
+      <!-- 图表 -->
+      <div id="chartLine"  style="width: 100%;height:400px;"></div>
+
+   
+    </el-card>
+
+
+   
+ 
+    
+  </div>
+
+
+</template> 
+
+<script>
+import {  ajaxDataGet, ajaxDataPost, ajaxDataPut, ajaxDataDelete, checkButtons} from '@/api/common'
+import { parseTime, json2excel } from '@/utils/index.js'
+export default {
+  data() {
+
+
+    
+ 
+  
+    return {
+
+ 
+
+      //接口 - 获取 - 表格
+      url_get_table:'/api/v1/ops/statistics/feed_process',
+     
+      
+      //接口 - 下拉框 列表 
+      url_get_select1:'/role/getAll',
+
+      //按钮权限
+      isButtonEdit:false,
+
+      //获取 - 表格数据 - 参数
+      searchData:{
+        date: parseTime(new Date(), '{y}-{m}-{d}'),
+        feed_plan_id: undefined,
+        class_number: undefined,
+        feed_vehicle_id: undefined,
+        barn_name: "",
+        barn_group_name: "",
+        min_accurate_ratio: undefined,
+        max_accurate_ratio: undefined,
+        min_temp: undefined,
+        max_temp: undefined,
+ 
+        page: 1,  //页码
+        page_size: 10,   //每页数量
+        total:0  //总页数
+      },
+      tableLoading: false,
+      //表格内容
+      tableList:[
+        //  { username:"admin", id:100, date:'2023-12-01',email:'测试信息1123',roleList:[2,3] },
+        // { username:"epans", id:200, date:'2023-12-01',email:'测试信息1123',roleList:[] },
+        // { username:"derek", id:300, date:'2023-12-01',email:'测试信息1123' },
+        // { username:"admin", id:100, date:'2023-12-01',email:'测试信息1123' },
+        // { username:"epans", id:200, date:'2023-12-01',email:'测试信息1123' },
+        // { username:"derek", id:300, date:'2023-12-01',email:'测试信息1123' },
+        // { username:"admin", id:100, date:'2023-12-01',email:'测试信息1123' },
+        // { username:"epans", id:200, date:'2023-12-01',email:'测试信息1123' },
+        // { username:"derek", id:300, date:'2023-12-01',email:'测试信息1123' },
+        // { username:"admin", id:100, date:'2023-12-01',email:'测试信息1123' },
+        // { username:"epans", id:200, date:'2023-12-01',email:'测试信息1123' },
+        // { username:"derek", id:300, date:'2023-12-01',email:'测试信息1123' },
+      ],
+
+
+      
+      feedPlanList:[
+    
+      ],
+      classList:[
+    
+      ],
+      feedCarList:[
+    
+    ],
+  
+
+ 
+
+
+    
+     
+       
+    }
+  },
+  created(){
+      //获取按钮权限
+      // this.get_auto_buttons 
+     
+
+     //获取下拉框
+      this.get_select_list1()
+
+      
+
+     
+
+    
+  },
+  methods:{
+
+    get_auto_buttons() {
+      // 编辑
+      const isButtonEdit = checkButtons(this.$store.state.buttonsList, "用户管理编辑")
+      this.isButtonEdit = isButtonEdit
+      console.log('this.isButtonEdit==========',this.isButtonEdit)
+    },
+    
+    //获取 下拉框
+    get_select_list1(){
+        var me = this
+        ajaxDataPost('/api/v1/ops/formula_plan/list?page=1&page_size=1000', { }).then(e => {
+          console.log("饲喂下拉框:",e)
+
+          //打印请求成功结果
+          if(e.code === 200){
+            me.feedPlanList = e.data.list
+          } else {
+            me.feedPlanList = []
+          }
+
+           
+          var plan_item = e.data.list[0]
+          console.log("plan_item", plan_item)
+
+          var feed_plan_id = plan_item.id
+          me.searchData.feed_plan_id = feed_plan_id
+
+          var class_number = plan_item.class_number
+          me.searchData.class_number = class_number
+
+          if(class_number == 1){  me.searchData.class_number_name = '第一班' }
+          if(class_number == 2){  me.searchData.class_number_name = '第二班' }
+          if(class_number == 3){  me.searchData.class_number_name = '第三班' }
+          if(class_number == 4){  me.searchData.class_number_name = '第四班' }
+
+          var feed_vehicle_id = plan_item.feed_vehicle_id
+          me.searchData.feed_vehicle_id = feed_vehicle_id
+
+          var feed_vehicle_name = plan_item.feed_vehicle_name
+          me.searchData.feed_vehicle_name = feed_vehicle_name
+
+          var feed_vehicle_number = plan_item.feed_vehicle_number
+          me.searchData.feed_vehicle_number = feed_vehicle_number
+
+          
+
+
+          //表格 - 初始化 
+          me.get_table_data()
+ 
+        })
+
+
+        // 班次下拉框
+        ajaxDataGet('/api/v1/ops/calf_feed/enum/list').then(e => {
+          console.log("班次下拉框:",e)
+          if(e.code === 200){
+            me.classList = e.data.class_list
+          } else {
+            me.classList = []
+          }
+        })
+
+        ajaxDataPost('/api/v1/ops/base_setting/feed_vehicle/list?page=1&page_size=1000', { }).then(e => {
+          console.log("饲喂车下拉框:",e)
+          //打印请求成功结果
+          if(e.code === 200){
+            me.feedCarList = e.data.list
+          } else {
+            me.feedCarList = []
+          }
+ 
+        })
+
+     
+
+     
+
+    
+    },
+   
+ 
+
+    change_plan(item){
+      var me = this
+      console.log(item)
+      var plan_item = me.feedPlanList.find(obj => obj.id == item) 
+      console.log("plan_item", plan_item)
+
+      var class_number = plan_item.class_number
+      me.searchData.class_number = class_number
+
+      if(class_number == 1){  me.searchData.class_number_name = '第一班' }
+      if(class_number == 2){  me.searchData.class_number_name = '第二班' }
+      if(class_number == 3){  me.searchData.class_number_name = '第三班' }
+      if(class_number == 4){  me.searchData.class_number_name = '第四班' }
+
+      var feed_vehicle_id = plan_item.feed_vehicle_id
+      me.searchData.feed_vehicle_id = feed_vehicle_id
+
+      var feed_vehicle_name = plan_item.feed_vehicle_name
+      me.searchData.feed_vehicle_name = feed_vehicle_name
+
+      var feed_vehicle_number = plan_item.feed_vehicle_number
+          me.searchData.feed_vehicle_number = feed_vehicle_number
+
+      
+     
+    },
+    change_car(item){
+      var me = this
+      console.log(item)
+      var carNum = me.feedCarList.find(obj => obj.id == item).number
+      console.log(carNum)
+      me.searchData.carNum = carNum
+    },
+    //获取 表格
+    get_table_data() {
+ 
+     var me = this
+
+     me.tableLoading = true
+     console.log("searchData======>", me.searchData)
+
+ 
+     
+      if( me.searchData.class_number == ""){
+        me.searchData.class_number = undefined
+      }
+      if( me.searchData.feed_vehicle_id == ""){
+        me.searchData.feed_vehicle_id = undefined
+      }
+
+
+      var send_url = me.url_get_table + '?page=1&page_size=1000'
+
+      ajaxDataPost(send_url,  me.searchData).then(e => {
+        console.log("表格请求结果:",e)
+          //打印请求成功结果
+          if(e.code == 200 ){
+            me.tableList = e.data.list
+            me.searchData.total = e.data.total;	// 总数
+            me.searchData.page = e.data.page;	//页码
+            me.searchData.page_size = e.data.page_size;	//每页数量
+           
+          } else {
+            me.$message({ type: 'error', message: '请求表格列表失败!' + e.msg, duration: 2000 })
+          }
+
+          setTimeout(() => {
+            me.tableLoading = false
+          }, 100)
+  
+        })
+
+       
+    },
+    //搜索 查询表格
+    form_search(){
+      var me = this
+      console.log('请求表格列表searchData',me.searchData)
+      me.get_table_data()
+
+    },
+
+    //重置 表格
+    form_clear(){
+      var me = this
+      // me.searchData.date = ""
+      me.searchData.barn_name = ""
+      me.searchData.barn_group_name = ""
+      // me.searchData.feed_plan_id = undefined
+      // me.searchData.class_number = undefined
+      // me.searchData.feed_vehicle_id = undefined
+      me.searchData.min_accurate_ratio = undefined
+      me.searchData.max_accurate_ratio = undefined
+      me.searchData.min_temp = undefined
+      me.searchData.max_temp = undefined
+
+   
+      me.get_table_data()
+    },
+ 
+
+    
+   
+ 
+
+
+    
+    
+
+
+
+  
+ 
+    form_export() {
+    //获取请求表格数据的参数
+    //this.download.getdataListParm.parammaps = this.tableObj.getdataListParm.parammaps
+    //请求表格
+    // GetDataByName(this.download.getdataListParm).then(response => {
+    //     if (response.data.list !== null) {
+    //       this.download.list = response.data.list
+    //     } else {
+    //       this.download.list = []
+    //     }
+    //     var excelDatas = [
+    //       {
+    //         tHeader: ['表头1', '表头2', '表头3', '表头4',],
+    //         filterVal: ['title1', 'title2', 'title3', 'title4'],
+    //         tableDatas: this.download.list,
+    //         sheetName: 'Sheet1'
+    //       }
+    //     ]
+    //     json2excel(excelDatas, '表格大标题', true, 'xlsx')
+    // })
+
+    var excelDatas = [
+        {
+            tHeader: ['表头1', '表头2', '表头3', '表头4',],
+            filterVal: ['title1', 'title2', 'title3', 'title4'],
+            tableDatas: [ 
+                {title1: "内容1",title2: "内容2",title3: "内容3",title4: "内容4"},
+                {title1: "内容11",title2: "内容22",title3: "内容32",title4: "内容44"},
+                {title1: "内容111",title2: "内容222",title3: "内容333",title4: "内容444"},
+            ],
+            sheetName: 'Sheet1'
+        }
+    ]
+    json2excel(excelDatas, '表格大标题', true, 'xlsx')
+}
+
+     
+
+  }
+}
+</script>
+<!-- 加了scoped,则是仅在此组件里生效 -->
+<style scoped>
+
+</style>

+ 0 - 0
src/views/dataStatistics/FeedProcess102.vue


+ 336 - 4
src/views/dataStatistics/SurvivalRate.vue

@@ -1,7 +1,65 @@
 <template>
  
   <div>
-        1.0.2版本页面,待开发
+<!-- 102 -->
+    <el-card class="box-card">
+
+       <!-- 搜索区域 -->
+       <div class="search-bx1">
+
+
+ 
+
+        <el-date-picker v-model="searchData.date_for_year" class="g-mr20" type="year" value-format="yyyy"  style="width: 250px;" />
+
+
+        <el-select v-model="searchData.calf_category_id" filterable placeholder="犊牛类型" style="width: 180px;" class="g-mr20">
+          <el-option v-for="item in calfTypeList" :key="item.id" :label="item.name" :value="item.id" />
+        </el-select>
+ 
+
+       
+
+
+         
+          <el-button type="primary"   @click="form_search">搜索</el-button>
+          <!-- <el-button type="primary"   @click="form_clear">重置</el-button> -->
+     
+            <el-button type="primary"   @click="form_export">导出</el-button>  
+      </div>
+
+
+      <div id="chartLine1"  style="width: 100%;height:280px;"></div>
+
+
+      <!-- 表格 -->
+      <el-table   key="0"  :data="tableList"  v-loading="tableLoading" element-loading-text="给我一点时间"    border fit>
+        <el-table-column label="日期"  width="150px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.date_month }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="犊牛数" min-width="150px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.calf_count }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="死亡数" min-width="150px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.die_count }}</span>
+          </template>
+        </el-table-column>  
+        <el-table-column label="存活率" min-width="150px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.survival_ratio }}</span>
+          </template>
+        </el-table-column>  
+        
+      </el-table>
+
+       
+
+    </el-card >
   </div>
 
 
@@ -10,26 +68,300 @@
 <script>
 import {  ajaxDataGet, ajaxDataPost, ajaxDataPut, ajaxDataDelete, checkButtons} from '@/api/common'
 import { parseTime, json2excel } from '@/utils/index.js'
+
+import * as echarts from 'echarts';
+
 export default {
   data() {
 
-
-    
+ 
  
   
     return {
 
+
+      //接口 - 获取 - 表格
+      url_get_table:'/api/v1/ops/statistics/survival',
+      //接口 - 获取 - 图表
+      url_get_echart:'/api/v1/ops/barn_group/add',  
+ 
+      //获取 - 表格数据 - 参数
+      searchData:{
+        date_for_year: parseTime(new Date(), '{y}'),
+        month: parseTime(new Date(), '{m}'),
+        calf_category_id: undefined,
+ 
+ 
+        page: 1,  //页码
+        page_size: 10,   //每页数量
+        total:0,  //总页数
+        pastureId: ""
+      },
+      tableLoading: false,
+      //表格内容
+      tableList:[
+        //  { username:"admin", id:100, date:'2023-12-01',email:'测试信息1123',roleList:[2,3] },
+        // { username:"epans", id:200, date:'2023-12-01',email:'测试信息1123',roleList:[] },
+        // { username:"derek", id:300, date:'2023-12-01',email:'测试信息1123' },
+        // { username:"admin", id:100, date:'2023-12-01',email:'测试信息1123' },
+        // { username:"epans", id:200, date:'2023-12-01',email:'测试信息1123' },
+        // { username:"derek", id:300, date:'2023-12-01',email:'测试信息1123' },
+        // { username:"admin", id:100, date:'2023-12-01',email:'测试信息1123' },
+        // { username:"epans", id:200, date:'2023-12-01',email:'测试信息1123' },
+        // { username:"derek", id:300, date:'2023-12-01',email:'测试信息1123' },
+        // { username:"admin", id:100, date:'2023-12-01',email:'测试信息1123' },
+        // { username:"epans", id:200, date:'2023-12-01',email:'测试信息1123' },
+        // { username:"derek", id:300, date:'2023-12-01',email:'测试信息1123' },
+      ],
+
+
+      feedList: [
+         {id: "全部饲料", name: "全部饲料"}, 
+         {id: "牛奶", name: "牛奶"}, 
+         {id: "水", name: "水"}, 
+         {id: "代乳粉", name: "代乳粉"}, 
+      ], 
+
+      //  下拉框 - 栏舍组 
+      calfTypeList: [
+        // {id: "栏舍组1", name: "栏舍组1"}, 
+        // {id: "栏舍组2", name: "栏舍组2"}, 
+        // {id: "栏舍组3", name: "栏舍组3"}
+      ], 
+
+
+
+      chart1: {
+        getdataListParm: {
+          name: 'getChart1ByHomepage',
+          page: 1,
+          offset: 1,
+          pagecount: '',
+          returntype: 'Map',
+          parammaps: {
+            inputDatetime: '',
+            beginDate: '',
+            endDate: '',
+        
+          }
+        }
+      },
+      //图表实例
+      chartLine1: null,
+      //图表数据
+      chartLine1_data: {
+        // monthdate:['2022-08-04', '2022-08-05', '2022-08-06', '2022-08-07', '2022-08-08', '2022-08-09', '2022-08-10'],
+        // arr1:['3.52', '3.17', '3.31', '2.79', '3.22', '2.98', '3.06'],
+        // arr2:['3.52', '3.17', '3.31', '2.79', '3.22', '2.98', '3.06'],
+        // arr3:['3.52', '3.17', '3.31', '2.79', '3.22', '2.98', '3.06'],
+        // arr4:['3.52', '3.17', '3.31', '2.79', '3.22', '2.98', '3.06'],
+        // arr5:['3.52', '3.17', '3.31', '2.79', '3.22', '2.98', '3.06'],
+        // arr6:['3.52', '3.17', '3.31', '2.79', '3.22', '2.98', '3.06'],
+        // sum:['300.52', '300.17', '300.31', '200.79', '300.22', '200.98', '300.06'],
+       
+      },
   
        
     }
+  },
+  mounted() {
+    //加载 - 图表假数据,如果是图表需要放mounted里测试假数据
+     //this.roadchartLine1(this.chartLine1_data)
+
+ 
+
   },
   created(){
     
-    
+    //获取下拉框
+    this.get_select_list1()
+    //表格 - 初始化 
+    this.get_table_data()
+
+
+     //this.getChart1
+
   },
   methods:{
 
+    //获取 下拉框
+    get_select_list1(){
+        var me = this
+        ajaxDataPost('/api/v1/ops/base_setting/calf_type/list?page=1&page_size=1000', {name:"" }).then(e => {
+            console.log("穿梭框1:",e)
+
+            //打印请求成功结果
+            if(e.data.list == null || e.data.list == undefined ||e.data.list.length == 0   ){
+              me.calfTypeList = []
+            } else {
+              me.calfTypeList = e.data.list
+            }
+
+        })
+
+ 
+    
+    },
+
+
+    //搜索 查询表格
+    form_search(){
+      var me = this
+      console.log('请求表格列表searchData',me.searchData)
+         
+      me.get_table_data()
+   
+
+    },
+    
+
+    //获取 表格
+    get_table_data() {
+ 
+      var me = this
+
+      me.tableLoading = true
+      console.log("searchData======>", me.searchData)
+
+
+      
+      
+      if( me.searchData.calf_category_id == ""){
+        me.searchData.calf_category_id = undefined
+      }
+       var send_url = me.url_get_table + '?page=' + me.searchData.page +  '&page_size=' + me.searchData.page_size
+
+       ajaxDataPost(send_url,  me.searchData).then(e => {
+          console.log("表格请求结果:",e)
+          //打印请求成功结果
+          if(e.code == 200 ){
+              me.tableList = e.data.table
+              me.chartLine1_data = e.data.chart
+            } else {
+
     
+              me.$message({ type: 'error', message: '请求表格列表失败!' + e.msg, duration: 2000 })
+            }
+
+            setTimeout(() => {
+              me.tableLoading = false
+
+              me.roadchartLine1(me.chartLine1_data)
+            }, 100)
+
+
+        })
+
+      
+    },
+
+    getChart1() {
+
+
+      var send_url = me.url_get_chart + '?page=' + me.searchData.page +  '&page_size=' + me.searchData.page_size
+
+      ajaxDataPost(send_url,  me.searchData).then(e => {
+        console.log("图表请求结果:",e)
+        //打印请求成功结果
+          // if(e.code == 200 ){
+          //   me.tableList = e.data.list
+          //   me.searchData.total = e.data.total;	// 总数
+          //   me.searchData.page = e.data.page;	//页码
+          //   me.searchData.page_size = e.data.page_size;	//每页数量
+          
+          // } else {
+          //   me.$message({ type: 'error', message: '请求表格列表失败!' + e.msg, duration: 2000 })
+          // }
+
+          // if (response.data.list !== null) {
+          //   var chartLine1_data = response.data.list[0]
+          //   this.chartLine1_data =  chartLine1_data
+          //   this.roadchartLine1(chartLine1_data)
+          // } else {
+          //   this.chart1.list = []
+          // }
+ 
+
+      })
+
+ 
+     
+    },
+
+    roadchartLine1(chartLine1_data) {
+
+            
+      if (this.chartLine1 != null) {
+        this.chartLine1.dispose()
+      }
+
+      console.log(echarts)
+      this.chartLine1 = echarts.init(document.getElementById('chartLine1'))
+      var option = {
+        title: { text: '犊牛死亡趋势'},
+        tooltip: { trigger: 'axis' },
+        legend: { data: ['死亡' ] },
+        grid: { left: '3%',right: '4%', bottom: '3%', containLabel: true },
+        xAxis: {
+          type: 'category',
+          axisPointer: { type: 'shadow'},
+          data: chartLine1_data.date_month 
+        },
+        yAxis: [
+          { type: 'value',axisLabel: {formatter: '{value} 头' }},
+        ],
+        series: [
+          { name: '死亡',  type: 'line', data: chartLine1_data.die_count   }
+        ]
+      }
+
+      this.chartLine1.setOption(option)
+      window.onresize = function () {
+        this.chartLine1.resize()
+      }
+    },
+
+
+    form_export() {
+        //获取请求表格数据的参数
+        //this.download.getdataListParm.parammaps = this.tableObj.getdataListParm.parammaps
+        //请求表格
+        // GetDataByName(this.download.getdataListParm).then(response => {
+        //     if (response.data.list !== null) {
+        //       this.download.list = response.data.list
+        //     } else {
+        //       this.download.list = []
+        //     }
+        //     var excelDatas = [
+        //       {
+        //         tHeader: ['表头1', '表头2', '表头3', '表头4',],
+        //         filterVal: ['title1', 'title2', 'title3', 'title4'],
+        //         tableDatas: this.download.list,
+        //         sheetName: 'Sheet1'
+        //       }
+        //     ]
+        //     json2excel(excelDatas, '表格大标题', true, 'xlsx')
+        // })
+
+        var excelDatas = [
+            {
+                tHeader: ['表头1', '表头2', '表头3', '表头4',],
+                filterVal: ['title1', 'title2', 'title3', 'title4'],
+                tableDatas: [ 
+                    {title1: "内容1",title2: "内容2",title3: "内容3",title4: "内容4"},
+                    {title1: "内容11",title2: "内容22",title3: "内容32",title4: "内容44"},
+                    {title1: "内容111",title2: "内容222",title3: "内容333",title4: "内容444"},
+                ],
+                sheetName: 'Sheet1'
+            }
+        ]
+        json2excel(excelDatas, '表格大标题', true, 'xlsx')
+    }
+
+
+    
+
+   
      
 
   }

+ 499 - 4
src/views/messageCenter/MessagesReceive.vue

@@ -1,7 +1,95 @@
 <template>
  
   <div>
-        1.0.2版本页面,待开发
+<!-- 102 -->
+
+    <el-card class="box-card">
+      <!-- 搜索区域 -->
+      <div class="search-bx1">
+          <el-input v-model="searchData.name" placeholder="消息名称"  style="width: 220px;" class="g-mr20" clearable />
+          <el-date-picker v-model="searchData.inputDatetime1" class="g-mr20" type="daterange" range-separator="至" start-placeholder="开始时间" end-placeholder="结束时间" style="width: 250px;" />
+          <el-button type="primary" class ="btn-search"  @click="form_search">搜索</el-button>
+          <el-button type="primary" class ="btn-clear"  @click="form_clear">重置</el-button>
+          <!-- <el-button type="primary"  class ="btn-add"  v-if="isButtonEdit" @click="form_add">添加</el-button> -->
+           <!-- <el-button type="primary"   @click="form_export">导出</el-button> -->
+      </div>
+
+ 
+      <!-- 表格 -->
+      <el-table   key="0"  :data="tableList"  v-loading="tableLoading" element-loading-text="给我一点时间"    border fit>
+        <el-table-column label="序号"  width="50px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.id }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="消息名称" min-width="150px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.name }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="消息内容" min-width="150px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.content }}</span>
+          </template>
+        </el-table-column>
+         
+        <el-table-column label="接收时间" min-width="150px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.created_at_format }}</span>
+          </template>
+        </el-table-column>
+
+        <el-table-column label="消息状态" min-width="150px" align="center">
+          <template slot-scope="scope">
+ 
+            <span v-show  = "scope.row.status  == 1">未读</span>
+            <span v-show  = "scope.row.status  == 2">已读</span>
+          </template>
+        </el-table-column>
+  
+
+        <el-table-column label="操作" align="center" width="300" class-name="small-padding fixed-width" fixed="right">
+          <template slot-scope="scope">
+            <el-button type="primary" v-if="isButtonEdit" size="mini" icon="el-icon-edit" @click="form_see(scope.row)">查看</el-button>
+             <!-- 修改按钮 -->
+            
+             <el-button type="danger" v-if="isButtonEdit" size="mini" icon="el-icon-delete" @click="form_delete(scope.row)">删除</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+
+      <!-- 分页区域 -->
+      <el-pagination  @size-change="change_size_page"  @current-change="change_current_page"  :current-page="searchData.page" :page-sizes="[1,5,10,20,30,50]"  :page-size="searchData.page_size" layout="total, prev, pager, next" :total="searchData.total"/>
+    </el-card>
+
+
+    <!-- 弹窗 新增or修改 -->
+    <el-dialog  :title="addFormTxt[addFormStatus]" :visible.sync="addFormShow" @close="add_dialog_close" width="50%">
+      <div class="">
+        <el-form  ref="addFormRef"  :rules="addFormRules"  :model="addForm"  label-position="right" label-width="100px"  style="width:50%;margin:0 auto 50px">
+    
+            <el-form-item label="类型名称:" prop="name">
+                <el-input   v-model="addForm.name" disabled  ></el-input>  
+            </el-form-item>
+          
+
+       
+            <el-form-item label="消息内容:" prop="content">
+              <el-input ref="content" v-model="addForm.content" type="textarea" maxlength="200"  style="width: 100%;" :rows="3"  disabled />
+            </el-form-item>
+
+         
+            
+        </el-form>
+        <div slot="footer" class="dialog-footer">
+       
+          <el-button @close="add_dialog_close" >关闭</el-button>
+        </div>
+      </div>
+    </el-dialog>
+
+ 
+    
   </div>
 
 
@@ -19,23 +107,430 @@ export default {
   
     return {
 
-  
+ 
+
+      //接口 - 获取 - 表格
+      url_get_table:'/api/v1/ops/message_template/user/list',
+      //接口 - 新增 - 表格
+      url_add_table:'/api/v1/ops/message_template/add',  
+      //接口 - 修改 - 表格
+      url_edit_table:'/api/v1/ops/message_template/update', 
+      //接口 - 删除 - 表格
+      url_delete_table:'/api/v1/ops/message_template/user/delete', 
+      
+      //接口 - 下拉框 列表 
+      url_get_select1:'/role/getAll',
+
+      //按钮权限
+      isButtonEdit:false,
+
+      //获取 - 表格数据 - 参数
+      searchData:{
+        name: "",
+        start_created_time: "",
+        end_created_time: "",
+        inputDatetime1:"",
+        page: 1,  //页码
+        page_size: 10,   //每页数量
+        total:0,  //总页数
+        pastureId: ""
+      },
+      tableLoading: false,
+      //表格内容
+      tableList:[
+        { username:"admin", id:100, date:'2023-12-01',email:'测试信息1123',roleList:[2,3] },
+        // { username:"epans", id:200, date:'2023-12-01',email:'测试信息1123',roleList:[] },
+        // { username:"derek", id:300, date:'2023-12-01',email:'测试信息1123' },
+        // { username:"admin", id:100, date:'2023-12-01',email:'测试信息1123' },
+        // { username:"epans", id:200, date:'2023-12-01',email:'测试信息1123' },
+        // { username:"derek", id:300, date:'2023-12-01',email:'测试信息1123' },
+        // { username:"admin", id:100, date:'2023-12-01',email:'测试信息1123' },
+        // { username:"epans", id:200, date:'2023-12-01',email:'测试信息1123' },
+        // { username:"derek", id:300, date:'2023-12-01',email:'测试信息1123' },
+        // { username:"admin", id:100, date:'2023-12-01',email:'测试信息1123' },
+        // { username:"epans", id:200, date:'2023-12-01',email:'测试信息1123' },
+        // { username:"derek", id:300, date:'2023-12-01',email:'测试信息1123' },
+      ],
+
+ 
+      
+      pastureList:[
+    
+      ],
+
+    
+
+ 
+
+
+      addFormShow:false,
+      addFormStatus: '',
+      addFormTxt: {  edit: '修改',  create: '新增' },
+      addForm:{
+        name:'',id:'' ,content:'' ,is_show: 1
+      },
+
+      addFormRules:{
+        name: [ { required: true, message: '名称必填', trigger: 'blur' },  ],
+        content: [ { required: true, message: '内容必填', trigger: 'blur' },  ],
+
+      },
+
+     
        
     }
   },
   created(){
-    
+      //获取按钮权限
+      const isButtonEdit = checkButtons(this.$store.state.buttonsList, "犊牛类型编辑")
+      this.isButtonEdit = isButtonEdit
+      console.log('this.isButtonEdit==========',this.isButtonEdit)
+     
+
+     //获取下拉框
+     // this.get_select_list1()
+
+      //表格 - 初始化 
+     this.get_table_data()
+
+     
+
     
   },
   methods:{
 
+    get_auto_buttons() {
+      // 编辑
+      const isButtonEdit = checkButtons(this.$store.state.buttonsList, "用户管理编辑")
+      this.isButtonEdit = isButtonEdit
+      console.log('this.isButtonEdit==========',this.isButtonEdit)
+    },
     
+    //获取 下拉框
+    get_select_list1(){
+        var me = this
+        ajaxDataGet(me.url_get_select1, {"roleName": "",  "page": 1,   "page_size": 1000}).then(e => {
+          console.log("下拉框1:",e)
+
+          //打印请求成功结果
+          if(e.data == null || e.data == undefined ||e.data.length == 0   ){
+            me.roleList = []
+          } else {
+            me.roleList = e.data
+          }
+
+         
+  
+        })
+
+
+        ajaxDataGet('/authdata/pasture', {  "page": 1,   "page_size": 1000}).then(e => {
+          console.log("牧场下拉框1:",e)
+
+          //打印请求成功结果
+          if(e.data == null || e.data == undefined ||e.data.length == 0   ){
+            me.pastureList = []
+          } else {
+            me.pastureList = e.data
+          }
+  
+        })
+
+    
+    },
+
+    
+    //获取 表格
+    get_table_data() {
+ 
+     var me = this
+
+     me.tableLoading = true
+
+     if (me.searchData.inputDatetime1 !== '' && me.searchData.inputDatetime1 !== null) {
+           me.searchData.start_created_time = parseTime(me.searchData.inputDatetime1[0], '{y}-{m}-{d}')
+           me.searchData.end_created_time = parseTime(me.searchData.inputDatetime1[1], '{y}-{m}-{d}')
+     } else {
+           me.searchData.inputDatetime1 = ''
+           me.searchData.start_created_time = ''
+           me.searchData.end_created_time = ''
+     }
+ 
+
+
+     console.log("searchData======>", me.searchData)
+
+      var send_url = me.url_get_table + '?page=' + me.searchData.page +  '&page_size=' + me.searchData.page_size
+
+      ajaxDataPost(send_url,  me.searchData).then(e => {
+        console.log("表格请求结果:",e)
+          //打印请求成功结果
+          if(e.code == 200 ){
+            me.tableList = e.data.list
+            me.searchData.total = e.data.total;	// 总数
+            me.searchData.page = e.data.page;	//页码
+            me.searchData.page_size = e.data.page_size;	//每页数量
+           
+          } else {
+            me.$message({ type: 'error', message: '请求表格列表失败!' + e.msg, duration: 2000 })
+          }
+
+          setTimeout(() => {
+            me.tableLoading = false
+          }, 100)
+  
+        })
+
+       
+    },
+    //搜索 查询表格
+    form_search(){
+      var me = this
+        // this.$router.push({name: 'MenuManagement' , query: { id: 'create', isEdit: 'edit' }})
+      // console.log('请求表格列表searchData',me.searchData)
+       me.get_table_data()
+
+    },
+
+    //重置 表格
+    form_clear(){
+      var me = this
+      me.searchData.name = ""
+      me.get_table_data()
+    },
+
+    //监听 page_size 改变的事件
+    change_size_page(item){
+      console.log(item)
+     // this.searchData.page_size = item
+      //  this.getUserList()
+    },
+
+    //监听 page 改变的事件
+    change_current_page(item){
+      console.log(item)
+       this.searchData.page = item
+       this.get_table_data()
+    },
+
+    //清空弹窗表单信息
+    reset_form(){
+      this.addForm.name = ''
+      this.addForm.id = undefined
+      this.addForm.content = ''
+      this.addForm.is_show = 1
+
+ 
+    },
+
+    //新增
+    form_add() {
+      this.reset_form()
+      this.addFormStatus = 'create'
+      this.addFormShow = true
+      this.$nextTick(() => {
+        this.$refs['addFormRef'].clearValidate()
+      })
+    },
+
+    //编辑
+    form_edit(row) {
+      this.reset_form()
+      console.log('行内容row=========', row)
+      //编辑行内容赋值
+      this.addForm = Object.assign({}, row)  
+      this.addFormStatus = 'edit'
+      this.addFormShow = true
+      this.$nextTick(() => {
+        this.$refs['addFormRef'].clearValidate()
+      })
+    },
+
+    //编辑
+    form_see(row) {
+      var me = this 
+      console.log('行内容row=========', row)
+ 
+      //编辑行内容赋值
+      me.addForm = Object.assign({}, row)  
+
+      ajaxDataPut("/api/v1/ops/message_template/user/show/"+ row.id , {}).then(e => {
+                console.log("消息已读:",e)
+                //打印请求成功结果
+                if(e.code == 200  ){
+           
+                } else {
+                  // me.$message({ type: 'error', message: '失败!' + e.msg, duration: 2000 })
+                }
+      })
+
+
+      this.addFormStatus = 'see'
+      this.addFormShow = true
+ 
+    },
+
+
+    //新增关闭
+    add_dialog_close(){
+      var me = this
+       //内容重置
+       me.addFormShow = false
+      me.get_table_data()
+    },
+
+    //新增 保存
+    add_dialog_save() {
+      var me = this
+      this.$refs['addFormRef'].validate(valid => {
+        //验证成功
+        if (valid) {
+          //发起请求
+          var send_data = {
+              "name": me.addForm.name,
+              "content": me.addForm.content,
+              "is_show": me.addForm.is_show
+          }
+          console.log("弹窗参数:", send_data)
+
+          //关闭弹窗
+          // me.addFormShow = false
+         //加载 - 发送新增保存
+           ajaxDataPost(me.url_add_table, send_data).then(e => {
+                console.log("新增结果:",e)
+                //打印请求成功结果
+                if(e.code == 200  ){
+                  me.$message({ type: 'success', message: '新增成功!'  , duration: 2000 })
+                  //关闭弹窗
+                  me.addFormShow = false
+                  me.get_table_data()
+                } else {
+                  me.$message({ type: 'error', message: '新增失败!' + e.msg, duration: 2000 })
+                }
+            })
+         
+        }
+      })
+    },
+    //编辑 保存
+    edit_dialog_save(){
+      var me = this
+      this.$refs['addFormRef'].validate(valid => {
+        //验证成功
+        if (valid) {
+          //发起请求
+          var send_data = {
+              "name": me.addForm.name,
+              "id": me.addForm.id,
+              "content": me.addForm.content,
+              "is_show": me.addForm.is_show
+          }
+          console.log("弹窗参数:", send_data)
+
+          //关闭弹窗
+          // me.addFormShow = false
+         //加载 - 发送新增保存
+         ajaxDataPut(me.url_edit_table, send_data).then(e => {
+                console.log("编辑结果:",e)
+                //打印请求成功结果
+                if(e.code == 200  ){
+                  me.$message({ type: 'success', message: '编辑成功!'  , duration: 2000 })
+                  //关闭弹窗
+                  me.addFormShow = false
+                  me.get_table_data()
+                } else {
+                  me.$message({ type: 'error', message: '编辑失败!' + e.msg, duration: 2000 })
+                }
+            })
+         
+        }
+      })
+    },
+
+
+    
+    
+
+
+
+    form_delete(row) {
+      var me = this
+
+       me.$confirm('是否删除此条内容?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+            console.log("删除的ID参数:", row.id)
+            //加载 - 发送新增保存
+            ajaxDataDelete(me.url_delete_table + '/' +row.id, {}).then(e => {
+                console.log("编辑结果:",e)
+                //打印请求成功结果
+                if(e.code == 200  ){
+                  me.$message({ type: 'success',  message: '删除成功!'  });
+                  me.get_table_data()
+                } else {
+                  me.$message({ type: 'error', message: '删除失败!' + e.msg, duration: 2000 })
+                }
+            })
+
+        
+ 
+          
+        }).catch(() => {
+          me.$message({
+            type: 'info',
+            message: '已取消删除'
+          });          
+        });
+
+
+       
+    },
+
+ 
+    form_export() {
+        //获取请求表格数据的参数
+        //this.download.getdataListParm.parammaps = this.tableObj.getdataListParm.parammaps
+        //请求表格
+        // GetDataByName(this.download.getdataListParm).then(response => {
+        //     if (response.data.list !== null) {
+        //       this.download.list = response.data.list
+        //     } else {
+        //       this.download.list = []
+        //     }
+        //     var excelDatas = [
+        //       {
+        //         tHeader: ['表头1', '表头2', '表头3', '表头4',],
+        //         filterVal: ['title1', 'title2', 'title3', 'title4'],
+        //         tableDatas: this.download.list,
+        //         sheetName: 'Sheet1'
+        //       }
+        //     ]
+        //     json2excel(excelDatas, '表格大标题', true, 'xlsx')
+        // })
+
+        var excelDatas = [
+            {
+                tHeader: ['表头1', '表头2', '表头3', '表头4',],
+                filterVal: ['title1', 'title2', 'title3', 'title4'],
+                tableDatas: [ 
+                    {title1: "内容1",title2: "内容2",title3: "内容3",title4: "内容4"},
+                    {title1: "内容11",title2: "内容22",title3: "内容32",title4: "内容44"},
+                    {title1: "内容111",title2: "内容222",title3: "内容333",title4: "内容444"},
+                ],
+                sheetName: 'Sheet1'
+            }
+        ]
+        json2excel(excelDatas, '表格大标题', true, 'xlsx')
+    }
+
      
 
   }
 }
 </script>
- 
+<!-- 加了scoped,则是仅在此组件里生效 -->
 <style scoped>
 
 </style>

+ 20 - 5
src/views/messageCenter/MessagesReceive102.vue

@@ -35,7 +35,7 @@
          
         <el-table-column label="接收时间" min-width="150px" align="center">
           <template slot-scope="scope">
-            <span>{{ scope.row.content }}</span>
+            <span>{{ scope.row.created_at_format }}</span>
           </template>
         </el-table-column>
 
@@ -108,7 +108,7 @@ export default {
  
 
       //接口 - 获取 - 表格
-      url_get_table:'/api/v1/ops/message_template/list',
+      url_get_table:'/api/v1/ops/message_template/user/list',
       //接口 - 新增 - 表格
       url_add_table:'/api/v1/ops/message_template/add',  
       //接口 - 修改 - 表格
@@ -125,6 +125,9 @@ export default {
       //获取 - 表格数据 - 参数
       searchData:{
         name: "",
+        start_created_time: "",
+        end_created_time: "",
+        inputDatetime1:"",
         page: 1,  //页码
         page_size: 10,   //每页数量
         total:0,  //总页数
@@ -186,7 +189,7 @@ export default {
      // this.get_select_list1()
 
       //表格 - 初始化 
-      //this.get_table_data()
+     this.get_table_data()
 
      
 
@@ -241,6 +244,18 @@ export default {
      var me = this
 
      me.tableLoading = true
+
+     if (me.searchData.inputDatetime1 !== '' && me.searchData.inputDatetime1 !== null) {
+           me.searchData.start_created_time = parseTime(me.searchData.inputDatetime1[0], '{y}-{m}-{d}')
+           me.searchData.end_created_time = parseTime(me.searchData.inputDatetime1[1], '{y}-{m}-{d}')
+     } else {
+           me.searchData.inputDatetime1 = ''
+           me.searchData.start_created_time = ''
+           me.searchData.end_created_time = ''
+     }
+ 
+
+
      console.log("searchData======>", me.searchData)
 
       var send_url = me.url_get_table + '?page=' + me.searchData.page +  '&page_size=' + me.searchData.page_size
@@ -269,9 +284,9 @@ export default {
     //搜索 查询表格
     form_search(){
       var me = this
-         this.$router.push({name: 'MenuManagement' , query: { id: 'create', isEdit: 'edit' }})
+        // this.$router.push({name: 'MenuManagement' , query: { id: 'create', isEdit: 'edit' }})
       // console.log('请求表格列表searchData',me.searchData)
-      // me.get_table_data()
+       me.get_table_data()
 
     },
 

+ 12 - 7
src/views/workManagement/WorkTaskAssign.vue

@@ -617,7 +617,7 @@
      
 
      
-     <!-- 弹窗  详情 周期工单  关闭-->
+     <!-- 弹窗  详情 周期工单  关闭  -->  
      <el-dialog   title="工单信息" :visible.sync="closeFormShow2" @close="close_dialog_close2" width="50%">
        <div class="">
          <el-form  ref="closeFormRef2"   :model="closeForm2"  label-position="right" label-width="140px"  style="width:90%;margin:0 auto 50px">
@@ -627,14 +627,19 @@
            <el-row :gutter="20">
  
              <div v-for="item in tableCloseList2">
-                 <h3>{{item.created_at_format}}</h3>
-                
+
+
+                 <h2 style="display:inline-block;float:left">{{item.created_at_format}}</h2>
+                 <el-button style="float:right;margin-top:10px;" type="primary"   size="mini" @click="sure_dialog_close2(item)">关闭该工单</el-button>  
+
+   
+
                  <el-table  :data="item.barn_group_list"   style="width: 100%;margin-bottom: 20px;"    row-key="id"  border :span-method="ObjectSpanMethod" >
                     <el-table-column  prop="barn_group_name_and_number"    label="栏舍组"  min-width="200px"  align="center" >  </el-table-column>
                     <el-table-column   prop="barn_name"   label="栏舍"  min-width="200px"  align="center">   </el-table-column>
                     <el-table-column  prop="barn_calf_amount"  label="数量"     min-width="200px"  align="center">   </el-table-column>
                 </el-table>
-                <el-button type="primary"    @click="sure_dialog_close2(item)">关闭该工单</el-button>
+               
              </div>
  
             
@@ -1024,7 +1029,7 @@
          {id: 4, name: '周四'},
          {id: 5, name: '周五'},
          {id: 6, name: '周六'},
-         {id: 7, name: '周天'},
+         {id: 0, name: '周天'},
        ],
        setList32:[
          {id: 1, name: '1号'}, {id: 2, name: '2号'},  {id: 3, name: '3号'}, {id: 4, name: '4号'},
@@ -1210,7 +1215,7 @@
        },
 
        tableCloseList2:[
-        //  {date:"123123", id: 1,tableArr: [
+        //  {created_at_format:"2022.12.12", id: 1,tableArr: [
         //       {  id: 1,  cowshedGroup: 'A组(总数:100)', groupnum: '100',   num: '33',    cowshed: '001舍' },   
         //       { id: 31,  cowshedGroup: 'A组(总数:100)',  groupnum: '100', num: '33',  cowshed: '002舍'  }, 
         //       { id: 32, cowshedGroup: 'A组(总数:100)',   groupnum: '100',num: '33', cowshed: '003舍' }, 
@@ -1219,7 +1224,7 @@
         //       { id: 32, cowshedGroup: 'B组(总数:100)',  groupnum: '200', num: '33', cowshed: '006舍' }, 
         //     ]
         //  } ,
-        //  {date:"2222", id: 1,tableArr: [
+        //  {created_at_format:"2222", id: 1,tableArr: [
         //       {  id: 1,  cowshedGroup: 'A组(总数:100)', groupnum: '100',   num: '33',    cowshed: '001舍' },   
         //       { id: 31,  cowshedGroup: 'A组(总数:100)',  groupnum: '100', num: '33',  cowshed: '002舍'  }, 
         //       { id: 32, cowshedGroup: 'A组(总数:100)',   groupnum: '100',num: '33', cowshed: '003舍' }, 

+ 2 - 2
src/views/workManagement/WorkTaskImplement.vue

@@ -69,7 +69,7 @@
         <el-table-column label="对象" min-width="150px" align="center">
           <template slot-scope="scope">
              <!-- <el-button type="primary" size="mini"  @click="form_see(scope.row)">查看</el-button> -->
-             <span>{{ scope.row.barn_names }}</span>
+             <span>{{ scope.row.barn_view_string }}</span>
           </template>
         </el-table-column>
         <el-table-column label="任务" min-width="150px" align="center">
@@ -175,7 +175,7 @@
         </el-form>
         <div slot="footer" class="dialog-footer">
         
-          <el-button type="primary"    @click="sure_dialog_close1()">完成该工单</el-button>
+          <el-button type="primary"    @click="sure_dialog_close1()">完成</el-button>
           <el-button    @click="see_dialog_close1()">返回</el-button>
         </div>
       </div>