|
@@ -1,15 +1,19 @@
|
|
|
<template>
|
|
|
|
|
|
<div>
|
|
|
-
|
|
|
+<!-- 102 -->
|
|
|
<el-card class="box-card">
|
|
|
|
|
|
<!-- 搜索区域 -->
|
|
|
<div class="search-bx1">
|
|
|
|
|
|
|
|
|
- <el-date-picker v-model="searchData.inputDatetime1" class="g-mr20" type="year" style="width: 250px;" />
|
|
|
- <el-select v-model="searchData.typeId" filterable placeholder="犊牛类型" style="width: 180px;" class="g-mr20">
|
|
|
+
|
|
|
+
|
|
|
+ <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>
|
|
|
|
|
@@ -30,24 +34,24 @@
|
|
|
|
|
|
<!-- 表格 -->
|
|
|
<el-table key="0" :data="tableList" v-loading="tableLoading" element-loading-text="给我一点时间" border fit>
|
|
|
- <el-table-column label="日期" width="50px" align="center">
|
|
|
+ <el-table-column label="日期" width="150px" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
- <span>{{ scope.row.id }}</span>
|
|
|
+ <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.name }}</span>
|
|
|
+ <span>{{ scope.row.calf_count }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="死亡率" min-width="150px" align="center">
|
|
|
+ <el-table-column label="死亡数" min-width="150px" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
- <span>{{ scope.row.number }}</span>
|
|
|
+ <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.number }}</span>
|
|
|
+ <span>{{ scope.row.survival_ratio }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
|
|
@@ -77,18 +81,17 @@ export default {
|
|
|
|
|
|
|
|
|
//接口 - 获取 - 表格
|
|
|
- url_get_table:'/api/v1/ops/barn_group/list',
|
|
|
+ url_get_table:'/api/v1/ops/statistics/survival',
|
|
|
//接口 - 获取 - 图表
|
|
|
url_get_echart:'/api/v1/ops/barn_group/add',
|
|
|
|
|
|
//获取 - 表格数据 - 参数
|
|
|
searchData:{
|
|
|
- inputDatetime1:"",
|
|
|
- typeId:"全部",
|
|
|
- name: "",
|
|
|
- barn_group_name: "",
|
|
|
- number: "",
|
|
|
- status: undefined,
|
|
|
+ date_for_year: parseTime(new Date(), '{y}'),
|
|
|
+ month: parseTime(new Date(), '{m}'),
|
|
|
+ calf_category_id: undefined,
|
|
|
+
|
|
|
+
|
|
|
page: 1, //页码
|
|
|
page_size: 10, //每页数量
|
|
|
total:0, //总页数
|
|
@@ -147,14 +150,14 @@ export default {
|
|
|
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'],
|
|
|
+ // 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'],
|
|
|
|
|
|
},
|
|
|
|
|
@@ -163,7 +166,7 @@ export default {
|
|
|
},
|
|
|
mounted() {
|
|
|
//加载 - 图表假数据,如果是图表需要放mounted里测试假数据
|
|
|
- this.roadchartLine1(this.chartLine1_data)
|
|
|
+ //this.roadchartLine1(this.chartLine1_data)
|
|
|
|
|
|
|
|
|
|
|
@@ -205,17 +208,9 @@ export default {
|
|
|
form_search(){
|
|
|
var me = this
|
|
|
console.log('请求表格列表searchData',me.searchData)
|
|
|
-
|
|
|
- if (me.searchData.inputDatetime1 !== '' && me.searchData.inputDatetime1 !== null) {
|
|
|
- me.searchData.min_operation_time = parseTime(me.searchData.inputDatetime1[0], '{y}-{m}-{d}')
|
|
|
- me.searchData.max_operation_time = parseTime(me.searchData.inputDatetime1[1], '{y}-{m}-{d}')
|
|
|
- } else {
|
|
|
- me.searchData.inputDatetime1 = ''
|
|
|
- me.searchData.min_operation_time = ''
|
|
|
- me.searchData.max_operation_time = ''
|
|
|
- }
|
|
|
+
|
|
|
me.get_table_data()
|
|
|
- me.getChart1()
|
|
|
+
|
|
|
|
|
|
},
|
|
|
|
|
@@ -230,29 +225,31 @@ export default {
|
|
|
|
|
|
|
|
|
|
|
|
- if( me.searchData.status == ""){
|
|
|
- me.searchData.status = undefined
|
|
|
+
|
|
|
+ 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.list
|
|
|
- me.searchData.total = e.data.total; // 总数
|
|
|
- me.searchData.page = e.data.page; //页码
|
|
|
- me.searchData.page_size = e.data.page_size; //每页数量
|
|
|
-
|
|
|
+ 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)
|
|
|
|
|
|
+
|
|
|
})
|
|
|
|
|
|
|
|
@@ -308,13 +305,13 @@ export default {
|
|
|
xAxis: {
|
|
|
type: 'category',
|
|
|
axisPointer: { type: 'shadow'},
|
|
|
- data: chartLine1_data.monthdate
|
|
|
+ data: chartLine1_data.date_month
|
|
|
},
|
|
|
yAxis: [
|
|
|
{ type: 'value',axisLabel: {formatter: '{value} 头' }},
|
|
|
],
|
|
|
series: [
|
|
|
- { name: '死亡', type: 'line', data: chartLine1_data.arr1 }
|
|
|
+ { name: '死亡', type: 'line', data: chartLine1_data.die_count }
|
|
|
]
|
|
|
}
|
|
|
|