123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348 |
- <template>
- <div class="app-container">
- <div class="search">
- <el-select v-model="table.getdataListParm.parammaps.pastureid" placeholder="牧场" class="filter-item" style="width: 120px;">
- <el-option v-for="item in pastureList" :key="item.pastureid" :label="item.pasturename" :value="item.pastureid" />
- </el-select>
- <el-date-picker v-model="table.getdataListParm.parammaps.date" :clearable="false" type="date" placeholder="选择日期" style="width: 150px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" @change="changeTab2Date" />
- </div>
- <div class="table">
- <el-row :gutter="10">
- <!-- 宾州筛分析 -->
- <el-col :span="12">
- <h4 style="text-align:center;">宾州筛分析</h4>
- <el-table
- :key="table.tableKey"
- v-loading="table.listLoading"
- element-loading-text="给我一点时间"
- :data="table.list"
- border
- fit
- highlight-current-row
- style="width: 100%;"
- :row-style="rowStyle"
- :cell-style="cellStyle"
- class="elTable table-fixed"
- height="400px"
- >
- <el-table-column label="宾州筛" min-width="110px" align="center" prop="barname" />
- <el-table-column label="第一层重量" min-width="110px" align="center" prop="oneweight" />
- <el-table-column label="第一层百分比" min-width="110px" align="center" prop="onerate" />
- <el-table-column label="第二层重量" min-width="110px" align="center" prop="twoweight" />
- <el-table-column label="第二层百分比" min-width="110px" align="center" prop="tworate" />
- <el-table-column label="第三层重量" min-width="110px" align="center" prop="threeweight" />
- <el-table-column label="第三层百分比" min-width="110px" align="center" prop="threerate" />
- <el-table-column label="第四层重量" min-width="110px" align="center" prop="fourweight" />
- <el-table-column label="第四层百分比" min-width="110px" align="center" prop="fourrate" />
- <el-table-column label="参考标准" min-width="110px" align="center" prop="standard" />
- </el-table>
- </el-col>
- <!-- 粪便筛分析 -->
- <el-col :span="12">
- <h4 style="text-align:center;">粪便筛分析</h4>
- <el-table
- :key="table2.tableKey"
- v-loading="table2.listLoading"
- element-loading-text="给我一点时间"
- :data="table2.list"
- border
- fit
- highlight-current-row
- style="width: 100%;"
- :row-style="rowStyle"
- :cell-style="cellStyle"
- class="elTable table-fixed"
- height="400px"
- >
- <el-table-column label="粪便筛" min-width="150px" align="center" prop="barname" />
- <el-table-column label="第一层重量" min-width="110px" align="center" prop="oneweight" />
- <el-table-column label="第一层百分比" min-width="110px" align="center" prop="onerate" />
- <el-table-column label="第二层重量" min-width="110px" align="center" prop="twoweight" />
- <el-table-column label="第二层百分比" min-width="110px" align="center" prop="tworate" />
- <el-table-column label="第三层重量" min-width="110px" align="center" prop="threeweight" />
- <el-table-column label="第三层百分比" min-width="110px" align="center" prop="threerate" />
- <el-table-column label="参考标准" min-width="110px" align="center" prop="standard" />
- </el-table>
- </el-col>
- </el-row>
- <el-row :gutter="10">
- <!-- BCS评分 -->
- <el-col :span="12">
- <h4 style="text-align:center;">BCS评分</h4>
- <el-table
- :key="table3.tableKey"
- v-loading="table3.listLoading"
- element-loading-text="给我一点时间"
- :data="table3.list"
- border
- fit
- highlight-current-row
- style="width: 100%;"
- :row-style="rowStyle"
- :cell-style="cellStyle"
- class="elTable table-fixed"
- height="400px"
- >
- <el-table-column label="栏舍" min-width="110px" align="center" prop="barname" />
- <el-table-column label="抽查样本数" min-width="110px" align="center" prop="sumcowcount" />
- <el-table-column label="单产" min-width="110px" align="center" prop="product" />
- <el-table-column label="干物质采食量" min-width="110px" align="center" prop="dryweight" />
- <el-table-column label="泌乳天数" min-width="110px" align="center" prop="avgdim" />
- <el-table-column label="标准分数" min-width="110px" align="center" prop="standardscore" />
- <el-table-column label="2.75-分(数量、百分比)" min-width="110px" align="center" prop="score25" />
- <el-table-column label="2.75分(数量、百分比" min-width="110px" align="center" prop="score275" />
- <el-table-column label="3分(数量、百分比)" min-width="110px" align="center" prop="score3" />
- <el-table-column label="3.25分(数量、百分比)" min-width="110px" align="center" prop="score325" />
- <el-table-column label="3.5分(数量、百分比)" min-width="110px" align="center" prop="score35" />
- <el-table-column label="3.75分(数量、百分比)" min-width="110px" align="center" prop="score375" />
- <el-table-column label="4+分(数量、百分比)" min-width="110px" align="center" prop="score4" />
- </el-table>
- </el-col>
- <!-- 粪便评分 -->
- <el-col :span="12">
- <h4 style="text-align:center;">粪便评分</h4>
- <el-table
- :key="table4.tableKey"
- v-loading="table4.listLoading"
- element-loading-text="给我一点时间"
- :data="table4.list"
- border
- fit
- highlight-current-row
- style="width: 100%;"
- :row-style="rowStyle"
- :cell-style="cellStyle"
- class="elTable table-fixed"
- height="400px"
- >
- <el-table-column label="栏舍" min-width="110px" align="center" prop="barname" />
- <el-table-column label="抽查样本数" min-width="110px" align="center" prop="sumcowcount" />
- <el-table-column label="单产" min-width="110px" align="center" prop="product" />
- <el-table-column label="干物质采食量" min-width="110px" align="center" prop="dryweight" />
- <el-table-column label="泌乳天数" min-width="110px" align="center" prop="avgdim" />
- <el-table-column label="标准分数" min-width="110px" align="center" prop="standardscore" />
- <el-table-column label="1分(数量、百分比)" min-width="110px" align="center" prop="score1" />
- <el-table-column label="2分(数量、百分比)" min-width="110px" align="center" prop="score2" />
- <el-table-column label="3分(数量、百分比)" min-width="110px" align="center" prop="score3" />
- <el-table-column label="4分(数量、百分比)" min-width="110px" align="center" prop="score4" />
- <el-table-column label="5分(数量、百分比)" min-width="110px" align="center" prop="score5" />
- </el-table>
- </el-col>
- </el-row>
- </div>
- </div>
- </template>
- <script>
- import echarts from 'echarts'
- require('echarts/theme/macarons')
- import { GetDataByName, GetReportform, GetDataByNames } from '@/api/common'
- import Cookies from 'js-cookie'
- import { parseTime } from '@/utils/index.js'
- import Pagination from '@/components/Pagination'
- import { json2excel } from '@/utils/index.js'
- import { MessageBox } from 'element-ui'
- export default {
- name: 'GroupFeedingEfficiency',
- components: { Pagination },
- data() {
- return {
- requestParams: [
- { name: 'getPastureListJT', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid'), pasturename: '' }}
- ],
- pastureList: [], // 牧场
- frequencyList: [],
- table: {
- getdataListParm: {
- name: 'getAssessCowPenn',
- page: 1,
- offset: 1,
- pagecount: '',
- returntype: 'Map',
- parammaps: {
- pastureid: Cookies.get('pastureid'),
- date: parseTime(new Date(), '{y}-{m}-{d}')
- }
- },
- tableKey: 1,
- list: [],
- total: 0,
- listLoading: true,
- temp: {}
- },
- table2: {
- getdataListParm: {
- name: 'getAssessCowDung',
- page: 1,
- offset: 1,
- pagecount: '',
- returntype: 'Map',
- parammaps: {
- pastureid: Cookies.get('pastureid'),
- date: ''
- }
- },
- tableKey: 1,
- list: [],
- total: 0,
- listLoading: true,
- temp: {}
- },
- table3: {
- getdataListParm: {
- name: 'getAssessBodyscore',
- page: 1,
- offset: 1,
- pagecount: '',
- returntype: 'Map',
- parammaps: {
- pastureid: Cookies.get('pastureid'),
- date: ''
- }
- },
- tableKey: 1,
- list: [],
- total: 0,
- listLoading: true,
- temp: {}
- },
- table4: {
- getdataListParm: {
- name: 'getAssessDungscore',
- page: 1,
- offset: 1,
- pagecount: '',
- returntype: 'Map',
- parammaps: {
- pastureid: Cookies.get('pastureid'),
- date: ''
- }
- },
- tableKey: 1,
- list: [],
- total: 0,
- listLoading: true,
- temp: {}
- },
- rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
- cellStyle: { padding: 0 + 'px' }
- }
- },
- created() {
- const start2 = new Date()
- start2.setTime(start2.getTime() - 3600 * 1000 * 24 * 1)
- this.table.getdataListParm.parammaps.date = parseTime(start2, '{y}-{m}-{d}')
- this.getDownList()
- this.getTab2List()
- this.getTab2List2()
- this.getTab2List3()
- this.getTab2List4()
- },
- mounted() {},
- activated() {
- const start2 = new Date()
- start2.setTime(start2.getTime() - 3600 * 1000 * 24 * 1)
- this.table.getdataListParm.parammaps.date = parseTime(start2, '{y}-{m}-{d}')
- this.getDownList()
- this.getTab2List()
- this.getTab2List2()
- this.getTab2List3()
- this.getTab2List4()
- },
- methods: {
- getDownList() {
- GetDataByNames(this.requestParams).then(response => {
- this.pastureList = response.data.getPastureListJT.list
- this.table.getdataListParm.parammaps.pastureid = response.data.getPastureListJT.list[0].pastureid
- this.table.getdataListParm2.parammaps.pastureid = response.data.getPastureListJT.list[0].pastureid
- this.table.getdataListParm3.parammaps.pastureid = response.data.getPastureListJT.list[0].pastureid
- this.table.getdataListParm4.parammaps.pastureid = response.data.getPastureListJT.list[0].pastureid
- })
- },
- // 切换tab2日期
- changeTab2Date() {
- this.getTab2List()
- this.getTab2List2()
- this.getTab2List3()
- this.getTab2List4()
- },
- // 宾州筛分析
- getTab2List() {
- this.table.listLoading = true
- GetDataByName(this.table.getdataListParm).then(response => {
- console.log('宾州筛分析table数据', response.data.list)
- if (response.data.list !== null) {
- this.table.list = response.data.list
- this.table.total = response.data.total
- } else {
- this.table.list = []
- }
- setTimeout(() => {
- this.table.listLoading = false
- }, 100)
- })
- },
- // 粪便筛分析
- getTab2List2() {
- this.table2.listLoading = true
- this.table2.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.date
- GetDataByName(this.table2.getdataListParm).then(response => {
- console.log('粪便筛分析table数据', response.data.list)
- if (response.data.list !== null) {
- this.table2.list = response.data.list
- this.table2.total = response.data.total
- } else {
- this.table2.list = []
- }
- setTimeout(() => {
- this.table2.listLoading = false
- }, 100)
- })
- },
- // BCS评分
- getTab2List3() {
- this.table3.listLoading = true
- this.table3.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.date
- GetDataByName(this.table3.getdataListParm).then(response => {
- console.log('BCS评分table数据', response.data.list)
- if (response.data.list !== null) {
- this.table3.list = response.data.list
- this.table3.total = response.data.total
- } else {
- this.table3.list = []
- }
- setTimeout(() => {
- this.table3.listLoading = false
- }, 100)
- })
- },
- // 粪便评分
- getTab2List4() {
- this.table4.listLoading = true
- this.table4.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.date
- GetDataByName(this.table4.getdataListParm).then(response => {
- console.log('成本分析table数据', response.data.list)
- if (response.data.list !== null) {
- this.table4.list = response.data.list
- this.table4.total = response.data.total
- } else {
- this.table4.list = []
- }
- setTimeout(() => {
- this.table4.listLoading = false
- }, 100)
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .search{margin-bottom:10px;}
- </style>
|