<template> <div class="app-container"> <el-tabs v-model="activeName" @tab-click="handleTabClick"> <el-tab-pane label="库存统计" name="first"> <div class="search"> <el-date-picker v-model="tab.table.getdataListParm.parammaps.inputDatetime" class="inputDatetime" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="float: left;width: 250px;margin-bottom:10px;" /> <el-input v-model="tab.table.getdataListParm.parammaps.source" style="float: left;width: 245px;margin-bottom:10px;" placeholder="配方名称" /> <el-button class="successBorder" style="float: left;margin-left: 10px;margin-bottom:10px;" @click="handleSearch">查询</el-button> <el-button class="export" style="float: right;margin-right: 10px;margin-bottom:10px;" @click="handleExport">导出</el-button> </div> <div class="table"> <el-table :key="tab.table.tableKey" v-loading="tab.table.listLoading" element-loading-text="给我一点时间" :data="tab.table.list" border fit highlight-current-row style="width: 100%;" :row-style="rowStyle" :cell-style="cellStyle" class="elTable table-fixed" > <el-table-column label="饲料名称" min-width="130px" align="center"> <template slot-scope="scope"> <span>{{ scope.row.bigcowclass }}</span> </template> </el-table-column> <el-table-column label="期初" min-width="130px" align="center"> <el-table-column prop="bigcowclass" align="center" label="期初库存(kg)" min-width="120" /> <el-table-column prop="bigcowclass" align="center" label="期初金额(元)" min-width="120" /> </el-table-column> <el-table-column label="用量" min-width="110px" align="center"> <el-table-column prop="bigcowclass" align="center" label="入库重量(kg)" min-width="120" /> <el-table-column prop="bigcowclass" align="center" label="系统出库重量(kg)" min-width="120" /> <el-table-column prop="bigcowclass" align="center" label="人工用料重量(kg)" min-width="120" /> <el-table-column prop="bigcowclass" align="center" label="损耗重量(kg)" min-width="120" /> </el-table-column> <el-table-column label="期末" min-width="130px" align="center"> <el-table-column prop="bigcowclass" align="center" label="期末库存(kg)" min-width="120" /> <el-table-column prop="bigcowclass" align="center" label="期末金额(元)" min-width="120" /> </el-table-column> </el-table> <pagination v-show="tab.table.total>=0" :total="tab.table.total" :page.sync="tab.table.getdataListParm.offset" :limit.sync="tab.table.getdataListParm.pagecount" @pagination="getTabList" /> </div> </el-tab-pane> <el-tab-pane label="用料分析" name="second">用料分析</el-tab-pane> <el-tab-pane label="价格分析" name="third">价格分析</el-tab-pane> </el-tabs> </div> </template> <script> import { GetDataByName } from '@/api/common' import Cookies from 'js-cookie' import { parseTime } from '@/utils/index.js' import Pagination from '@/components/Pagination' export default { name: 'InventoryManagement', components: { Pagination }, data() { return { activeName:'first', tab:{ table: { getdataListParm: { name: 'getBarmilkList', page: 1, offset: 1, pagecount: 10, returntype: 'Map', parammaps: { pastureid: Cookies.get('pastureid'), startTime: '', stopTime: '', inputDatetime: '' } }, tableKey: 1, list: [], total: 0, listLoading: true, } }, rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' }, cellStyle: { padding: 0 + 'px' } } }, created() { this.getTabList() }, methods: { handleTabClick(){ }, getTabList() { this.tab.table.listLoading = true GetDataByName(this.tab.table.getdataListParm).then(response => { console.log('库存统计table数据', response.data.list) if (response.data.list !== null) { this.tab.table.list = response.data.list this.tab.table.total = response.data.total } else { this.tab.table.list = [] } setTimeout(() => { this.tab.table.listLoading = false }, 100) }) }, handleSearch(){}, handleExport(){} } } </script> <style lang="scss" scoped> .search{margin-bottom:10px;} </style>