|
@@ -0,0 +1,639 @@
|
|
|
+<template>
|
|
|
+
|
|
|
+ <div>
|
|
|
+ <!-- 102 -->
|
|
|
+ 部分接口未对,暂无接口
|
|
|
+ <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-row :gutter="20">
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-card class="box-card">
|
|
|
+ <div slot="header" class="clearfix">
|
|
|
+ <span>计划信息</span>
|
|
|
+ <span style="float: right">
|
|
|
+ 犊牛类型:荷斯坦
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ <div class="bx-row">
|
|
|
+ <span class="bx-tit">工作状态:</span><span class="bx-cont">进行中</span>
|
|
|
+ </div>
|
|
|
+ <div class="bx-row">
|
|
|
+ <span class="bx-tit">饲喂犊牛数:</span><span class="bx-cont">300</span>
|
|
|
+ </div>
|
|
|
+ <div class="bx-row">
|
|
|
+ <span class="bx-tit">栏舍组数量:</span><span class="bx-cont">7</span>
|
|
|
+ </div>
|
|
|
+ <div class="bx-row">
|
|
|
+ <span class="bx-tit">栏舍数量:</span><span class="bx-cont">3</span>
|
|
|
+ </div>
|
|
|
+ <div class="bx-row">
|
|
|
+ <span class="bx-tit">班次数量:</span><span class="bx-cont">3</span>
|
|
|
+ </div>
|
|
|
+ <div class="bx-row">
|
|
|
+ <span class="bx-tit">准确率:</span><span class="bx-cont">99.6%</span>
|
|
|
+ </div>
|
|
|
+ <div class="bx-row">
|
|
|
+ <span class="bx-tit">开始时间:</span><span class="bx-cont">7:00</span>
|
|
|
+ </div>
|
|
|
+ <div class="bx-row">
|
|
|
+ <span class="bx-tit">过程时间:</span><span class="bx-cont">00:30:16</span>
|
|
|
+ </div>
|
|
|
+ </el-card>
|
|
|
+
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="18">
|
|
|
+ <!-- 表格 -->
|
|
|
+ <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-col>
|
|
|
+
|
|
|
+
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ </el-card>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ </div>
|
|
|
+
|
|
|
+
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <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/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:[
|
|
|
+
|
|
|
+ ],
|
|
|
+
|
|
|
+
|
|
|
+ //图表请求参数
|
|
|
+ chart1: {
|
|
|
+ getdataListParm: {
|
|
|
+ name: 'getChart1ByHomepage',
|
|
|
+ page: 1,
|
|
|
+ offset: 1,
|
|
|
+ pagecount: '',
|
|
|
+ returntype: 'Map',
|
|
|
+ parammaps: {
|
|
|
+ inputDatetime: '',
|
|
|
+ beginDate: '',
|
|
|
+ endDate: '',
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //图表实例
|
|
|
+ chartLine: null,
|
|
|
+ //图表数据
|
|
|
+ //这个图表格式让后端参考TMR的getprocessAnalysisTB接口。{"name":"getprocessAnalysisTB","page":1,"offset":1,"pagecount":"","returntype":"Map","parammaps":{"pastureid":"1653271339","id":"","pid":"237423"}}:
|
|
|
+ chartLine_data: {
|
|
|
+ "data1":[null,null,null,null,null,null,null,null,null,null,null],
|
|
|
+ "data2":["2427.72","2576.25","3245.84","3384.97","3508.69","3929.18","8266.22","8475.09","8753.22","10295.48","100.35"],"data3":[null,null,null,null,null,null,null,null,null,null,null],
|
|
|
+ "data4":[["2022-04-01 05:08:05","114.00"],["2022-04-01 05:11:09","2422.00"],["2022-04-01 05:13:36","2571.00"],["2022-04-01 05:17:24","3250.00"],["2022-04-01 05:19:55","3393.00"],["2022-04-01 05:20:05","3505.00"],["2022-04-01 05:21:15","3928.00"],["2022-04-01 05:28:53","8263.00"],["2022-04-01 05:30:16","8464.00"],["2022-04-01 05:31:01","8753.00"],["2022-04-01 05:33:14","10300.00"]],"data5":[["2022-04-01 05:11:09","2422.00"],["2022-04-01 05:13:36","2570.00"],["2022-04-01 05:17:24","3250.00"],["2022-04-01 05:19:55","3392.00"],["2022-04-01 05:20:05","3506.00"],["2022-04-01 05:21:15","3928.00"],["2022-04-01 05:28:53","8262.00"],["2022-04-01 05:30:16","8462.00"],["2022-04-01 05:31:01","8752.00"],["2022-04-01 05:33:14","10300.00"],["2022-04-01 05:39:25","48.00"]],
|
|
|
+ "data5":[["2022-04-01 05:11:09","2422.00"],["2022-04-01 05:13:36","2570.00"],["2022-04-01 05:17:24","3250.00"],["2022-04-01 05:19:55","3392.00"],["2022-04-01 05:20:05","3506.00"],["2022-04-01 05:21:15","3928.00"],["2022-04-01 05:28:53","8262.00"],["2022-04-01 05:30:16","8462.00"],["2022-04-01 05:31:01","8752.00"],["2022-04-01 05:33:14","10300.00"],["2022-04-01 05:39:25","48.00"]]
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ mounted() {
|
|
|
+ var me = this
|
|
|
+ //加载 - 图表假数据,如果是图表需要放mounted里测试假数据
|
|
|
+ me.roadchartLine(me.chartLine_data)
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ 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()
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ //图表数据加载
|
|
|
+ roadchartLine(chartLine_data) {
|
|
|
+ console.log(chartLine_data.data5, 'chartLine_data')
|
|
|
+ if (this.chartLine != null) {
|
|
|
+ this.chartLine.dispose()
|
|
|
+ }
|
|
|
+ this.chartLine = echarts.init(document.getElementById('chartLine'))
|
|
|
+ var option = {
|
|
|
+ title: { text: '', subtext: '' },
|
|
|
+ color: ['#ff0000', '#5199e5', '#fdb06a', '#fb8b73'], // 关键加上这句话,legend的颜色和折线的自定义颜色就一致了
|
|
|
+ legend: [{
|
|
|
+ itemWidth: 15, itemHeight: 7, right: '25%', textStyle: { fontSize: 12 },
|
|
|
+ data: [{ name: '设计重量' }, { name: '实际重量' }]
|
|
|
+ }, {
|
|
|
+ itemWidth: 5, itemHeight: 5, right: '0', textStyle: { fontSize: 12 },
|
|
|
+ data: [
|
|
|
+ // { name: '开始重量', icon: 'image://https://kptyun.cn:8081/file/pic/3.png' }, // { name: '结束重量', icon: 'image://https://kptyun.cn:8081/file/pic/4.png' },
|
|
|
+ // { name: '结束重量', icon: 'image://https://kptyun.cn:8081/file/pic/4.png' }, // { name: '结束重量', icon: 'image://https://kptyun.cn:8081/file/pic/4.png' },
|
|
|
+ { name: '开始重量' },
|
|
|
+ { name: '结束重量' }
|
|
|
+ ]
|
|
|
+ }],
|
|
|
+ tooltip: {
|
|
|
+ trigger: 'axis',
|
|
|
+ formatter: function(params) {
|
|
|
+ // console.log(params, 'params')
|
|
|
+ var tip = params[0].name
|
|
|
+ for (let i = 0; i < params.length; i++) {
|
|
|
+ if (params[i].seriesName == '设计重量') {
|
|
|
+ tip += '<br>' + params[i].seriesName + ':' + params[i].value[1]
|
|
|
+ }
|
|
|
+ if (params[i].seriesName == '实际重量') {
|
|
|
+ tip += '<br>' + params[i].seriesName + ':' + params[i].value[1]
|
|
|
+ }
|
|
|
+ if (params[i].seriesName == '开始重量') {
|
|
|
+ tip += '<br>' + params[i].seriesName + ':' + params[i].value[1]
|
|
|
+ }
|
|
|
+ if (params[i].seriesName == '结束重量') {
|
|
|
+ tip += '<br>' + params[i].seriesName + ':' + params[i].value[1] + '<br>' + params[i].value[2] + params[i].value[3]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return tip
|
|
|
+ }
|
|
|
+ },
|
|
|
+ calculable: true,
|
|
|
+ xAxis: [
|
|
|
+ { type: 'category' }
|
|
|
+ // { type: 'category', splitLine: { show: false }, name: '时间', data: chartLine_data.data1, axisLabel: { show: true, textStyle: { color: '#666' }}}
|
|
|
+ ],
|
|
|
+ yAxis: [{ type: 'value' }],
|
|
|
+ toolbox: {
|
|
|
+ show: false,
|
|
|
+ feature: {
|
|
|
+ dataZoom: { realtime: false, yAxisIndex: 'none', },
|
|
|
+ restore: {},
|
|
|
+ }
|
|
|
+ },
|
|
|
+ dataZoom: [
|
|
|
+ {type: 'inside'}, //用于添加滚轮缩放
|
|
|
+ {type:'slider' }, //用于添加滑动条缩放,
|
|
|
+ ],
|
|
|
+ series: [
|
|
|
+ { symbol: 'none', name: '实际重量', type: 'line', data: chartLine_data.data3, itemStyle: { normal: { lineStyle: { color: '#ff0000' ,width:2}}}},
|
|
|
+ { symbol: 'none', name: '设计重量', type: 'line', step: 'middle', data: chartLine_data.data2 , itemStyle: { normal: { lineStyle: { width:2}}}},
|
|
|
+ // { name: '开始重量', symbol: 'image://https://kptyun.cn:8081/file/pic/3.png', symbolSize: 10, type: 'scatter', data: chartLine_data.data4 },
|
|
|
+ // { name: '结束重量', symbol: 'image://https://kptyun.cn:8081/file/pic/4.png', symbolSize: 10, type: 'scatter', data: chartLine_data.data5 }
|
|
|
+ { name: '开始重量', symbolSize: 6, type: 'scatter', data: chartLine_data.data4 },
|
|
|
+ { name: '结束重量', symbolSize: 6, type: 'scatter', data: chartLine_data.data5 }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ this.chartLine.setOption(option)
|
|
|
+ window.onresize = function() {
|
|
|
+ this.chartLine.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')
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ </script>
|
|
|
+ <!-- 加了scoped,则是仅在此组件里生效 -->
|
|
|
+ <style scoped>
|
|
|
+ .bx-row{margin-bottom: 20px}
|
|
|
+ .bx-tit{display:inline-block;width:45%;text-align:right;font-size:16px;}
|
|
|
+ .bx-cont{display:inline-block;width:54%;font-size:16px;font-weight:bold;color:#4b7902}
|
|
|
+ </style>
|
|
|
+
|