99134002c239be0c0d55b5585494cf449350e9ae.svn-base 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <template>
  2. <div class="app-container">
  3. <el-tabs v-model="activeName" @tab-click="handleTabClick">
  4. <el-tab-pane label="库存统计" name="first">
  5. <div class="search">
  6. <el-date-picker v-model="tab.table.getdataListParm.parammaps.inputDatetime" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="float: left;width: 250px;margin-bottom:10px;" />
  7. <el-input v-model="tab.table.getdataListParm.parammaps.source" style="float: left;width: 245px;margin-bottom:10px;" placeholder="配方名称" />
  8. <el-button class="successBorder" style="float: left;margin-left: 10px;margin-bottom:10px;" @click="handleSearch">查询</el-button>
  9. <el-button class="export" style="float: right;margin-right: 10px;margin-bottom:10px;" @click="handleExport">导出</el-button>
  10. </div>
  11. <div class="table">
  12. <el-table
  13. :key="tab.table.tableKey"
  14. v-loading="tab.table.listLoading"
  15. element-loading-text="给我一点时间"
  16. :data="tab.table.list"
  17. border
  18. fit
  19. highlight-current-row
  20. style="width: 100%;"
  21. :row-style="rowStyle"
  22. :cell-style="cellStyle"
  23. class="elTable table-fixed"
  24. >
  25. <el-table-column label="饲料名称" min-width="130px" align="center">
  26. <template slot-scope="scope">
  27. <span>{{ scope.row.bigcowclass }}</span>
  28. </template>
  29. </el-table-column>
  30. <el-table-column label="期初" min-width="130px" align="center">
  31. <el-table-column prop="bigcowclass" align="center" label="期初库存(kg)" min-width="120" />
  32. <el-table-column prop="bigcowclass" align="center" label="期初金额(元)" min-width="120" />
  33. </el-table-column>
  34. <el-table-column label="用量" min-width="110px" align="center">
  35. <el-table-column prop="bigcowclass" align="center" label="入库重量(kg)" min-width="120" />
  36. <el-table-column prop="bigcowclass" align="center" label="系统出库重量(kg)" min-width="120" />
  37. <el-table-column prop="bigcowclass" align="center" label="人工用料重量(kg)" min-width="120" />
  38. <el-table-column prop="bigcowclass" align="center" label="损耗重量(kg)" min-width="120" />
  39. </el-table-column>
  40. <el-table-column label="期末" min-width="130px" align="center">
  41. <el-table-column prop="bigcowclass" align="center" label="期末库存(kg)" min-width="120" />
  42. <el-table-column prop="bigcowclass" align="center" label="期末金额(元)" min-width="120" />
  43. </el-table-column>
  44. </el-table>
  45. <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" />
  46. </div>
  47. </el-tab-pane>
  48. <el-tab-pane label="用料分析" name="second">用料分析</el-tab-pane>
  49. <el-tab-pane label="价格分析" name="third">价格分析</el-tab-pane>
  50. </el-tabs>
  51. </div>
  52. </template>
  53. <script>
  54. import { GetDataByName } from '@/api/common'
  55. import Cookies from 'js-cookie'
  56. import { parseTime } from '@/utils/index.js'
  57. import Pagination from '@/components/Pagination'
  58. export default {
  59. name: 'InventoryManagement',
  60. components: { Pagination },
  61. data() {
  62. return {
  63. activeName:'first',
  64. tab:{
  65. table: {
  66. getdataListParm: {
  67. name: 'getBarmilkList',
  68. page: 1,
  69. offset: 1,
  70. pagecount: 10,
  71. returntype: 'Map',
  72. parammaps: {
  73. pastureid: Cookies.get('pastureid'),
  74. startTime: '',
  75. stopTime: '',
  76. inputDatetime: ''
  77. }
  78. },
  79. tableKey: 1,
  80. list: [],
  81. total: 0,
  82. listLoading: true,
  83. }
  84. },
  85. rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
  86. cellStyle: { padding: 0 + 'px' }
  87. }
  88. },
  89. created() {
  90. this.getTabList()
  91. },
  92. methods: {
  93. handleTabClick(){
  94. },
  95. getTabList() {
  96. this.tab.table.listLoading = true
  97. GetDataByName(this.tab.table.getdataListParm).then(response => {
  98. console.log('库存统计table数据', response.data.list)
  99. if (response.data.list !== null) {
  100. this.tab.table.list = response.data.list
  101. this.tab.table.total = response.data.total
  102. } else {
  103. this.tab.table.list = []
  104. }
  105. setTimeout(() => {
  106. this.tab.table.listLoading = false
  107. }, 100)
  108. })
  109. },
  110. handleSearch(){},
  111. handleExport(){}
  112. }
  113. }
  114. </script>
  115. <style lang="scss" scoped>
  116. .search{margin-bottom:10px;}
  117. </style>