495d7247edb8ff8280edf1c5e06e46bf1b344e8e.svn-base 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  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" 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">
  49. <el-table :data="tab2.table.list" max-height="420">
  50. <el-table-column v-for="item in tab2.table.tableConfig" :key="item.id" align="center" :label="item.label" :prop="item.prop" :width="item.width">
  51. <el-table-column v-for="item1 in item.children" v-if="item.children || item.children.length>0" :key="item1.id" align="center" :label="item1.label" :prop="item1.prop" :width="item1.width">
  52. <el-table-column v-for="item2 in item1.children" v-if="item1.children || item1.children.length>0" :key="item2.id" :label="item2.label" :prop="item2.prop" :width="item2.width" />
  53. </el-table-column>
  54. </el-table-column>
  55. </el-table>
  56. </el-tab-pane>
  57. <el-tab-pane label="价格分析" name="third">价格分析</el-tab-pane>
  58. </el-tabs>
  59. </div>
  60. </div>
  61. </template>
  62. <script>
  63. import { GetDataByName } from '@/api/common'
  64. import Cookies from 'js-cookie'
  65. import { parseTime } from '@/utils/index.js'
  66. import Pagination from '@/components/Pagination'
  67. export default {
  68. name: 'InventoryManagement',
  69. components: { Pagination },
  70. data() {
  71. return {
  72. fileComment: [{ 'label': '商务文件评分', 'children': [{ 'label': '1' }, { 'label': '2' }, { 'label': '管理员' }] }],
  73. activeName: 'first',
  74. tab: {
  75. table: {
  76. getdataListParm: {
  77. name: 'getBarmilkList',
  78. page: 1,
  79. offset: 1,
  80. pagecount: 10,
  81. returntype: 'Map',
  82. parammaps: {
  83. pastureid: Cookies.get('pastureid'),
  84. startTime: '',
  85. stopTime: '',
  86. inputDatetime: ''
  87. }
  88. },
  89. tableKey: 1,
  90. list: [],
  91. total: 0,
  92. listLoading: true
  93. }
  94. },
  95. tab2: {
  96. table: {
  97. getdataListParm: {
  98. name: 'getBarmilkList',
  99. page: 1,
  100. offset: 1,
  101. pagecount: 10,
  102. returntype: 'Map',
  103. parammaps: {
  104. pastureid: Cookies.get('pastureid'),
  105. startTime: '',
  106. stopTime: '',
  107. inputDatetime: ''
  108. }
  109. },
  110. tableKey: 1,
  111. list: [],
  112. tableConfig: [],
  113. total: 0,
  114. listLoading: true
  115. }
  116. },
  117. rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
  118. cellStyle: { padding: 0 + 'px' }
  119. }
  120. },
  121. created() {
  122. this.getTabList()
  123. this.getTab2List()
  124. },
  125. methods: {
  126. handleTabClick() {
  127. },
  128. getTabList() {
  129. this.tab.table.listLoading = true
  130. GetDataByName(this.tab.table.getdataListParm).then(response => {
  131. console.log('库存统计table数据', response.data.list)
  132. if (response.data.list !== null) {
  133. this.tab.table.list = response.data.list
  134. this.tab.table.total = response.data.total
  135. } else {
  136. this.tab.table.list = []
  137. }
  138. setTimeout(() => {
  139. this.tab.table.listLoading = false
  140. }, 100)
  141. })
  142. },
  143. handleSearch() {},
  144. handleExport() {},
  145. getTab2List() {
  146. this.tab2.table.listLoading = true
  147. GetDataByName(this.tab2.table.getdataListParm).then(response => {
  148. console.log('库存统计table数据', response.data.list)
  149. this.tab2.table.list = [{
  150. 'districtName': 10,
  151. 'timeDimension1': '00001',
  152. 'timeDimension2': '00002',
  153. 'timeDimension3': '00003',
  154. 'timeDimension4': '00004'
  155. }, {
  156. 'districtName': 11,
  157. 'timeDimension1': '11111',
  158. 'timeDimension2': '11112',
  159. 'timeDimension3': '11113',
  160. 'timeDimension4': '11114'
  161. }, {
  162. 'districtName': 12,
  163. 'timeDimension1': '22221',
  164. 'timeDimension2': '22222',
  165. 'timeDimension3': '22223',
  166. 'timeDimension4': '22224'
  167. }, {
  168. 'districtName': 13,
  169. 'timeDimension1': '33331',
  170. 'timeDimension2': '33332',
  171. 'timeDimension3': '33333',
  172. 'timeDimension4': '33334'
  173. }],
  174. this.tab2.table.tableConfig = [{
  175. id: 90,
  176. label: '饲料名称',
  177. prop: '',
  178. width: '',
  179. children: [{
  180. id: 91,
  181. label: '栏舍名称/饲料参数',
  182. prop: 'districtName',
  183. width: ''
  184. }]
  185. }, {
  186. id: 100,
  187. label: '饲料01',
  188. prop: '',
  189. width: '',
  190. children: [{
  191. id: 101,
  192. label: '理论',
  193. prop: 'timeDimension1',
  194. width: ''
  195. }, {
  196. id: 102,
  197. label: '实际',
  198. prop: 'timeDimension2',
  199. width: ''
  200. }, {
  201. id: 103,
  202. label: '误差值',
  203. prop: 'timeDimension2',
  204. width: ''
  205. }, {
  206. id: 104,
  207. label: '误差率',
  208. prop: 'timeDimension2',
  209. width: ''
  210. }]
  211. }, {
  212. id: 110,
  213. label: '饲料02',
  214. prop: '',
  215. width: '',
  216. children: [{
  217. id: 111,
  218. label: '理论',
  219. prop: 'timeDimension3',
  220. width: ''
  221. }, {
  222. id: 112,
  223. label: '实际',
  224. prop: 'timeDimension4',
  225. width: ''
  226. }, {
  227. id: 113,
  228. label: '误差值',
  229. prop: 'timeDimension2',
  230. width: ''
  231. }, {
  232. id: 114,
  233. label: '误差率',
  234. prop: 'timeDimension2',
  235. width: ''
  236. }]
  237. }]
  238. // if (response.data.list !== null) {
  239. // this.tab2.table.list = response.data.list
  240. // this.tab2.table.total = response.data.total
  241. // } else {
  242. // this.tab2.table.list = []
  243. // }
  244. setTimeout(() => {
  245. this.tab2.table.listLoading = false
  246. }, 100)
  247. })
  248. }
  249. }
  250. }
  251. </script>
  252. <style lang="scss" scoped>
  253. .search{margin-bottom:10px;}
  254. </style>