|
@@ -9,32 +9,35 @@
|
|
|
|
|
|
<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.calf_category_id" filterable placeholder="饲喂计划" class="g-mr20 g-mb20" style="width: 180px;" clearable>
|
|
|
- <el-option v-for="item in calfTypeList" :key="item.id" :label="item.name" :value="item.id" />
|
|
|
+ <el-select v-model="searchData.feed_plan_id" filterable placeholder="饲喂计划" class="g-mr20" style="width: 180px;" clearable>
|
|
|
+ <el-option v-for="item in feedPlanList" :key="item.id" :label="item.name" :value="item.id" />
|
|
|
</el-select>
|
|
|
- <el-select v-model="searchData.status" filterable placeholder="班次" class="g-mr20" style="width: 180px;" clearable>
|
|
|
- <el-option v-for="item in statusList" :key="item.id" :label="item.value" :value="item.id" />
|
|
|
+ <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.status" filterable placeholder="饲喂车" class="g-mr20" style="width: 180px;" clearable>
|
|
|
- <el-option v-for="item in statusList" :key="item.id" :label="item.value" :value="item.id" />
|
|
|
+ <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>
|
|
|
- <el-input v-model="searchData.name" placeholder="饲喂车编号" style="width: 180px;" disabled />
|
|
|
+ <span>饲喂车编号:</span>
|
|
|
+ <el-input v-model="searchData.carNum" placeholder="" style="width: 180px;" disabled />
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-row :gutter="20">
|
|
|
<el-col :span="24">
|
|
|
|
|
|
- <el-input v-model="searchData.name" placeholder="栏舍名称" style="width: 220px;" class="g-mr20 g-mb20" clearable />
|
|
|
- <el-input v-model="searchData.name" placeholder="栏舍组名称" style="width: 220px;" class="g-mr20 " clearable />
|
|
|
+ <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_daily_age" style="width:120px;" :controls="false" placeholder="准确率" />
|
|
|
+ <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_daily_age" style="width:120px;" class="g-mr20" :controls="false" placeholder="准确率" />
|
|
|
+ <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_daily_age" style="width:120px;" :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_daily_age" style="width:120px;" class="g-mr20" :controls="false" placeholder="温差" />
|
|
|
+ <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>
|
|
@@ -47,61 +50,77 @@
|
|
|
|
|
|
<!-- 表格 -->
|
|
|
<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.number }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
-
|
|
|
-
|
|
|
- <!-- <el-table-column label="状态" min-width="100px" align="center">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-switch v-model="scope.row.mg_state" active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" />
|
|
|
- </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" size="mini" icon="el-icon-edit" @click="form_edit(scope.row)">修改</el-button>
|
|
|
- <!-- 删除按钮 -->
|
|
|
- <el-button type="danger" size="mini" icon="el-icon-delete" @click="form_delete(scope.row)">删除</el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
+ <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>
|
|
|
|
|
|
- <!-- 分页区域 -->
|
|
|
- <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>
|
|
|
+ <!-- 图表 -->
|
|
|
+ <div id="chartLine" style="width: 100%;height:400px;"></div>
|
|
|
|
|
|
+
|
|
|
+ </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" ></el-input>
|
|
|
- </el-form-item>
|
|
|
-
|
|
|
-
|
|
|
- </el-form>
|
|
|
- <div slot="footer" class="dialog-footer">
|
|
|
- <el-button type="primary" @click="addFormStatus==='create'?add_dialog_save():edit_dialog_save()">确认</el-button>
|
|
|
- <el-button @click="addFormShow = false">关闭</el-button>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </el-dialog>
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
|
</div>
|
|
@@ -124,13 +143,8 @@ export default {
|
|
|
|
|
|
|
|
|
//接口 - 获取 - 表格
|
|
|
- url_get_table:'/api/v1/ops/base_setting/calf_type/list',
|
|
|
- //接口 - 新增 - 表格
|
|
|
- url_add_table:'/api/v1/ops/base_setting/calf_type/add',
|
|
|
- //接口 - 修改 - 表格
|
|
|
- url_edit_table:'/api/v1/ops/base_setting/calf_type/update',
|
|
|
- //接口 - 删除 - 表格
|
|
|
- url_delete_table:'/api/v1/ops/base_setting/calf_type/is_show',
|
|
|
+ url_get_table:'/api/v1/ops/statistics/feed_process',
|
|
|
+
|
|
|
|
|
|
//接口 - 下拉框 列表
|
|
|
url_get_select1:'/role/getAll',
|
|
@@ -140,7 +154,17 @@ export default {
|
|
|
|
|
|
//获取 - 表格数据 - 参数
|
|
|
searchData:{
|
|
|
- name: "",
|
|
|
+ date: '',
|
|
|
+ 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, //总页数
|
|
@@ -165,30 +189,21 @@ export default {
|
|
|
|
|
|
|
|
|
|
|
|
- pastureList:[
|
|
|
+ feedPlanList:[
|
|
|
|
|
|
],
|
|
|
-
|
|
|
+ classList:[
|
|
|
|
|
|
+ ],
|
|
|
+ feedCarList:[
|
|
|
+
|
|
|
+ ],
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- addFormShow:false,
|
|
|
- addFormStatus: '',
|
|
|
- addFormTxt: { edit: '修改', create: '新增' },
|
|
|
- addForm:{
|
|
|
- name:'',id:''
|
|
|
- },
|
|
|
-
|
|
|
- addFormRules:{
|
|
|
- name: [
|
|
|
- { required: true, message: '类型必填', trigger: 'blur' },
|
|
|
- ],
|
|
|
-
|
|
|
-
|
|
|
- },
|
|
|
-
|
|
|
+
|
|
|
|
|
|
|
|
|
}
|
|
@@ -199,7 +214,7 @@ export default {
|
|
|
|
|
|
|
|
|
//获取下拉框
|
|
|
- // this.get_select_list1()
|
|
|
+ this.get_select_list1()
|
|
|
|
|
|
//表格 - 初始化
|
|
|
this.get_table_data()
|
|
@@ -220,37 +235,54 @@ export default {
|
|
|
//获取 下拉框
|
|
|
get_select_list1(){
|
|
|
var me = this
|
|
|
- ajaxDataGet(me.url_get_select1, {"roleName": "", "page": 1, "page_size": 1000}).then(e => {
|
|
|
- console.log("下拉框1:",e)
|
|
|
+ ajaxDataPost('/api/v1/ops/formula_plan/list?page=1&page_size=1000', { }).then(e => {
|
|
|
+ console.log("饲喂下拉框:",e)
|
|
|
|
|
|
//打印请求成功结果
|
|
|
- if(e.data == null || e.data == undefined ||e.data.length == 0 ){
|
|
|
- me.roleList = []
|
|
|
+ if(e.code === 200){
|
|
|
+ me.feedPlanList = e.data.list
|
|
|
} else {
|
|
|
- me.roleList = e.data
|
|
|
+ me.feedPlanList = []
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
})
|
|
|
|
|
|
|
|
|
- ajaxDataGet('/authdata/pasture', { "page": 1, "page_size": 1000}).then(e => {
|
|
|
- console.log("牧场下拉框1:",e)
|
|
|
+ // 班次下拉框
|
|
|
+ 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.data == null || e.data == undefined ||e.data.length == 0 ){
|
|
|
- me.pastureList = []
|
|
|
+ if(e.code === 200){
|
|
|
+ me.feedCarList = e.data.list
|
|
|
} else {
|
|
|
- me.pastureList = e.data
|
|
|
+ me.feedCarList = []
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
})
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
},
|
|
|
|
|
|
-
|
|
|
+ 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() {
|
|
|
|
|
@@ -259,7 +291,7 @@ export default {
|
|
|
me.tableLoading = true
|
|
|
console.log("searchData======>", me.searchData)
|
|
|
|
|
|
- var send_url = me.url_get_table + '?page=' + me.searchData.page + '&page_size=' + me.searchData.page_size
|
|
|
+ var send_url = me.url_get_table + '?page=1&page_size=1000'
|
|
|
|
|
|
ajaxDataPost(send_url, me.searchData).then(e => {
|
|
|
console.log("表格请求结果:",e)
|
|
@@ -296,25 +328,6 @@ export default {
|
|
|
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 = ''
|
|
|
- },
|
|
|
|
|
|
|
|
|
|