d20c15ead33b9dc4ddb069897d0622dc13d0f458.svn-base 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414
  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. <div class="search">
  50. <el-date-picker v-model="tab2.table.getdataListParm.parammaps.inputDatetime" class="inputDatetime" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 250px;" />
  51. <span style="margin-left: 10px;">统计类型:</span>
  52. <el-radio v-model="tab2.radio" label="1" @change="changeRadio2">牲畜类别</el-radio>
  53. <el-radio v-model="tab2.radio" label="2" @change="changeRadio2">栏舍名称</el-radio>
  54. <el-radio v-model="tab2.radio" label="3" @change="changeRadio2">日期</el-radio>
  55. <el-radio v-model="tab2.radio" label="4" @change="changeRadio2">TMR设备编号</el-radio>
  56. <el-radio v-model="tab2.radio" label="5" @change="changeRadio2">班次</el-radio>
  57. <el-radio v-model="tab2.radio" label="6" @change="changeRadio2">车次</el-radio>
  58. <el-input v-model="tab2.table.getdataListParm.parammaps.source" style="width: 245px;" placeholder="栏舍名称" />
  59. <el-button class="successBorder" @click="handleSearch">查询</el-button>
  60. </div>
  61. <el-table :data="tab2.table.list" max-height="420">
  62. <el-table-column v-for="item in tab2.table.tableConfig" :key="item.id" align="center" :label="item.label" :prop="item.prop" :width="item.width">
  63. <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">
  64. <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" />
  65. </el-table-column>
  66. </el-table-column>
  67. </el-table>
  68. </el-tab-pane>
  69. <el-tab-pane label="价格分析" name="third">价格分析</el-tab-pane>
  70. </el-tabs>
  71. </div>
  72. </div>
  73. </template>
  74. <script>
  75. import { GetDataByName } from '@/api/common'
  76. import Cookies from 'js-cookie'
  77. import { parseTime } from '@/utils/index.js'
  78. import Pagination from '@/components/Pagination'
  79. export default {
  80. name: 'InventoryManagement',
  81. components: { Pagination },
  82. data() {
  83. return {
  84. fileComment: [{ 'label': '商务文件评分', 'children': [{ 'label': '1' }, { 'label': '2' }, { 'label': '管理员' }] }],
  85. activeName: 'first',
  86. tab: {
  87. table: {
  88. getdataListParm: {
  89. name: 'getBarmilkList',
  90. page: 1,
  91. offset: 1,
  92. pagecount: 10,
  93. returntype: 'Map',
  94. parammaps: {
  95. pastureid: Cookies.get('pastureid'),
  96. startTime: '',
  97. stopTime: '',
  98. inputDatetime: ''
  99. }
  100. },
  101. tableKey: 1,
  102. list: [],
  103. total: 0,
  104. listLoading: true
  105. }
  106. },
  107. tab2: {
  108. table: {
  109. getdataListParm: {
  110. name: 'getBarmilkList',
  111. page: 1,
  112. offset: 1,
  113. pagecount: 10,
  114. returntype: 'Map',
  115. parammaps: {
  116. pastureid: Cookies.get('pastureid'),
  117. startTime: '',
  118. stopTime: '',
  119. inputDatetime: ''
  120. }
  121. },
  122. tableKey: 1,
  123. list: [],
  124. tableConfig: [],
  125. total: 0,
  126. listLoading: true
  127. },
  128. radio: '1'
  129. },
  130. rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
  131. cellStyle: { padding: 0 + 'px' }
  132. }
  133. },
  134. created() {
  135. this.getTabList()
  136. this.getTab2List()
  137. },
  138. methods: {
  139. handleTabClick() {
  140. },
  141. getTabList() {
  142. this.tab.table.listLoading = true
  143. GetDataByName(this.tab.table.getdataListParm).then(response => {
  144. console.log('库存统计table数据', response.data.list)
  145. if (response.data.list !== null) {
  146. this.tab.table.list = response.data.list
  147. this.tab.table.total = response.data.total
  148. } else {
  149. this.tab.table.list = []
  150. }
  151. setTimeout(() => {
  152. this.tab.table.listLoading = false
  153. }, 100)
  154. })
  155. },
  156. handleSearch() {},
  157. handleExport() {},
  158. getTab2List() {
  159. this.tab2.table.listLoading = true
  160. GetDataByName(this.tab2.table.getdataListParm).then(response => {
  161. console.log('库存统计table数据', response.data.list)
  162. this.tab2.table.list = [
  163. {
  164. 'districtName': 10, 'timeDimension1': '00001', 'timeDimension2': '00002', 'timeDimension3': '00003', 'timeDimension4': '00004'
  165. }, {
  166. 'districtName': 11, 'timeDimension1': '11111', 'timeDimension2': '11112', 'timeDimension3': '11113', 'timeDimension4': '11114'
  167. }, {
  168. 'districtName': 12, 'timeDimension1': '22221', 'timeDimension2': '22222', 'timeDimension3': '22223', 'timeDimension4': '22224'
  169. }, {
  170. 'districtName': 13, 'timeDimension1': '33331', 'timeDimension2': '33332', 'timeDimension3': '33333', 'timeDimension4': '33334'
  171. }
  172. ],
  173. this.tab2.table.tableConfig = [{
  174. id: 90, label: '饲料名称', prop: '', width: '',
  175. children: [{ id: 91, label: '栏舍名称/饲料参数', prop: 'districtName', width: '' }]
  176. }, {
  177. id: 100, label: '饲料01', prop: '', width: '',
  178. children: [
  179. { id: 101, label: '理论', prop: 'timeDimension1', width: '' },
  180. { id: 102, label: '实际', prop: 'timeDimension2', width: '' },
  181. { id: 103, label: '误差值', prop: 'timeDimension2', width: '' },
  182. { id: 104, label: '误差率', prop: 'timeDimension2', width: '' }
  183. ]
  184. }, {
  185. id: 110, label: '饲料02', prop: '', width: '',
  186. children: [
  187. { id: 111, label: '理论', prop: 'timeDimension3', width: '' },
  188. { id: 112, label: '实际', prop: 'timeDimension4', width: '' },
  189. { id: 113, label: '误差值', prop: 'timeDimension2', width: '' },
  190. { id: 114, label: '误差率', prop: 'timeDimension2', width: '' }
  191. ]
  192. }]
  193. // if (response.data.list !== null) {
  194. // this.tab2.table.list = response.data.list
  195. // this.tab2.table.total = response.data.total
  196. // } else {
  197. // this.tab2.table.list = []
  198. // }
  199. setTimeout(() => {
  200. this.tab2.table.listLoading = false
  201. }, 100)
  202. })
  203. },
  204. changeRadio2() {
  205. console.log(this.tab.radio)
  206. if (this.tab.radio == '1') {
  207. this.tab2.table.list = [
  208. {
  209. 'districtName': 10, 'timeDimension1': '00001', 'timeDimension2': '00002', 'timeDimension3': '00003', 'timeDimension4': '00004'
  210. }, {
  211. 'districtName': 11, 'timeDimension1': '11111', 'timeDimension2': '11112', 'timeDimension3': '11113', 'timeDimension4': '11114'
  212. }, {
  213. 'districtName': 12, 'timeDimension1': '22221', 'timeDimension2': '22222', 'timeDimension3': '22223', 'timeDimension4': '22224'
  214. }, {
  215. 'districtName': 13, 'timeDimension1': '33331', 'timeDimension2': '33332', 'timeDimension3': '33333', 'timeDimension4': '33334'
  216. }
  217. ],
  218. this.tab2.table.tableConfig = [{
  219. id: 90, label: '饲料名称', prop: '', width: '',
  220. children: [{ id: 91, label: '牲畜类别', prop: 'districtName', width: '' }]
  221. }, {
  222. id: 100, label: '饲料01', prop: '', width: '',
  223. children: [
  224. { id: 101, label: '理论', prop: 'timeDimension1', width: '' },
  225. { id: 102, label: '实际', prop: 'timeDimension2', width: '' },
  226. { id: 103, label: '误差值', prop: 'timeDimension2', width: '' },
  227. { id: 104, label: '误差率', prop: 'timeDimension2', width: '' }
  228. ]
  229. }, {
  230. id: 110, label: '饲料02', prop: '', width: '',
  231. children: [
  232. { id: 111, label: '理论', prop: 'timeDimension3', width: '' },
  233. { id: 112, label: '实际', prop: 'timeDimension4', width: '' },
  234. { id: 113, label: '误差值', prop: 'timeDimension2', width: '' },
  235. { id: 114, label: '误差率', prop: 'timeDimension2', width: '' }
  236. ]
  237. }]
  238. } else if (this.tab.radio == '2') {
  239. this.tab2.table.list = [
  240. {
  241. 'districtName': 10, 'timeDimension1': '00001', 'timeDimension2': '00002', 'timeDimension3': '00003', 'timeDimension4': '00004'
  242. }, {
  243. 'districtName': 11, 'timeDimension1': '11111', 'timeDimension2': '11112', 'timeDimension3': '11113', 'timeDimension4': '11114'
  244. }, {
  245. 'districtName': 12, 'timeDimension1': '22221', 'timeDimension2': '22222', 'timeDimension3': '22223', 'timeDimension4': '22224'
  246. }, {
  247. 'districtName': 13, 'timeDimension1': '33331', 'timeDimension2': '33332', 'timeDimension3': '33333', 'timeDimension4': '33334'
  248. }
  249. ],
  250. this.tab2.table.tableConfig = [{
  251. id: 90, label: '饲料名称', prop: '', width: '',
  252. children: [{ id: 91, label: '栏舍名称', prop: 'districtName', width: '' }]
  253. }, {
  254. id: 100, label: '饲料01', prop: '', width: '',
  255. children: [
  256. { id: 101, label: '理论', prop: 'timeDimension1', width: '' },
  257. { id: 102, label: '实际', prop: 'timeDimension2', width: '' },
  258. { id: 103, label: '误差值', prop: 'timeDimension2', width: '' },
  259. { id: 104, label: '误差率', prop: 'timeDimension2', width: '' }
  260. ]
  261. }, {
  262. id: 110, label: '饲料02', prop: '', width: '',
  263. children: [
  264. { id: 111, label: '理论', prop: 'timeDimension3', width: '' },
  265. { id: 112, label: '实际', prop: 'timeDimension4', width: '' },
  266. { id: 113, label: '误差值', prop: 'timeDimension2', width: '' },
  267. { id: 114, label: '误差率', prop: 'timeDimension2', width: '' }
  268. ]
  269. }]
  270. } else if (this.tab.radio == '3') {
  271. this.tab2.table.list = [
  272. {
  273. 'districtName': 10, 'timeDimension1': '00001', 'timeDimension2': '00002', 'timeDimension3': '00003', 'timeDimension4': '00004'
  274. }, {
  275. 'districtName': 11, 'timeDimension1': '11111', 'timeDimension2': '11112', 'timeDimension3': '11113', 'timeDimension4': '11114'
  276. }, {
  277. 'districtName': 12, 'timeDimension1': '22221', 'timeDimension2': '22222', 'timeDimension3': '22223', 'timeDimension4': '22224'
  278. }, {
  279. 'districtName': 13, 'timeDimension1': '33331', 'timeDimension2': '33332', 'timeDimension3': '33333', 'timeDimension4': '33334'
  280. }
  281. ],
  282. this.tab2.table.tableConfig = [{
  283. id: 90, label: '饲料名称', prop: '', width: '',
  284. children: [{ id: 91, label: '日期', prop: 'districtName', width: '' }]
  285. }, {
  286. id: 100, label: '饲料01', prop: '', width: '',
  287. children: [
  288. { id: 101, label: '理论', prop: 'timeDimension1', width: '' },
  289. { id: 102, label: '实际', prop: 'timeDimension2', width: '' },
  290. { id: 103, label: '误差值', prop: 'timeDimension2', width: '' },
  291. { id: 104, label: '误差率', prop: 'timeDimension2', width: '' }
  292. ]
  293. }, {
  294. id: 110, label: '饲料02', prop: '', width: '',
  295. children: [
  296. { id: 111, label: '理论', prop: 'timeDimension3', width: '' },
  297. { id: 112, label: '实际', prop: 'timeDimension4', width: '' },
  298. { id: 113, label: '误差值', prop: 'timeDimension2', width: '' },
  299. { id: 114, label: '误差率', prop: 'timeDimension2', width: '' }
  300. ]
  301. }]
  302. } else if (this.tab.radio == '4') {
  303. this.tab2.table.list = [
  304. {
  305. 'districtName': 10, 'timeDimension1': '00001', 'timeDimension2': '00002', 'timeDimension3': '00003', 'timeDimension4': '00004'
  306. }, {
  307. 'districtName': 11, 'timeDimension1': '11111', 'timeDimension2': '11112', 'timeDimension3': '11113', 'timeDimension4': '11114'
  308. }, {
  309. 'districtName': 12, 'timeDimension1': '22221', 'timeDimension2': '22222', 'timeDimension3': '22223', 'timeDimension4': '22224'
  310. }, {
  311. 'districtName': 13, 'timeDimension1': '33331', 'timeDimension2': '33332', 'timeDimension3': '33333', 'timeDimension4': '33334'
  312. }
  313. ],
  314. this.tab2.table.tableConfig = [{
  315. id: 90, label: '饲料名称', prop: '', width: '',
  316. children: [{ id: 91, label: 'TMR设备编号', prop: 'districtName', width: '' }]
  317. }, {
  318. id: 100, label: '饲料01', prop: '', width: '',
  319. children: [
  320. { id: 101, label: '理论', prop: 'timeDimension1', width: '' },
  321. { id: 102, label: '实际', prop: 'timeDimension2', width: '' },
  322. { id: 103, label: '误差值', prop: 'timeDimension2', width: '' },
  323. { id: 104, label: '误差率', prop: 'timeDimension2', width: '' }
  324. ]
  325. }, {
  326. id: 110, label: '饲料02', prop: '', width: '',
  327. children: [
  328. { id: 111, label: '理论', prop: 'timeDimension3', width: '' },
  329. { id: 112, label: '实际', prop: 'timeDimension4', width: '' },
  330. { id: 113, label: '误差值', prop: 'timeDimension2', width: '' },
  331. { id: 114, label: '误差率', prop: 'timeDimension2', width: '' }
  332. ]
  333. }]
  334. } else if (this.tab.radio == '5') {
  335. this.tab2.table.list = [
  336. {
  337. 'districtName': 10, 'timeDimension1': '00001', 'timeDimension2': '00002', 'timeDimension3': '00003', 'timeDimension4': '00004'
  338. }, {
  339. 'districtName': 11, 'timeDimension1': '11111', 'timeDimension2': '11112', 'timeDimension3': '11113', 'timeDimension4': '11114'
  340. }, {
  341. 'districtName': 12, 'timeDimension1': '22221', 'timeDimension2': '22222', 'timeDimension3': '22223', 'timeDimension4': '22224'
  342. }, {
  343. 'districtName': 13, 'timeDimension1': '33331', 'timeDimension2': '33332', 'timeDimension3': '33333', 'timeDimension4': '33334'
  344. }
  345. ],
  346. this.tab2.table.tableConfig = [{
  347. id: 90, label: '饲料名称', prop: '', width: '',
  348. children: [{ id: 91, label: '班次', prop: 'districtName', width: '' }]
  349. }, {
  350. id: 100, label: '饲料01', prop: '', width: '',
  351. children: [
  352. { id: 101, label: '理论', prop: 'timeDimension1', width: '' },
  353. { id: 102, label: '实际', prop: 'timeDimension2', width: '' },
  354. { id: 103, label: '误差值', prop: 'timeDimension2', width: '' },
  355. { id: 104, label: '误差率', prop: 'timeDimension2', width: '' }
  356. ]
  357. }, {
  358. id: 110, label: '饲料02', prop: '', width: '',
  359. children: [
  360. { id: 111, label: '理论', prop: 'timeDimension3', width: '' },
  361. { id: 112, label: '实际', prop: 'timeDimension4', width: '' },
  362. { id: 113, label: '误差值', prop: 'timeDimension2', width: '' },
  363. { id: 114, label: '误差率', prop: 'timeDimension2', width: '' }
  364. ]
  365. }]
  366. } else if (this.tab.radio == '6') {
  367. this.tab2.table.list = [
  368. {
  369. 'districtName': 10, 'timeDimension1': '00001', 'timeDimension2': '00002', 'timeDimension3': '00003', 'timeDimension4': '00004'
  370. }, {
  371. 'districtName': 11, 'timeDimension1': '11111', 'timeDimension2': '11112', 'timeDimension3': '11113', 'timeDimension4': '11114'
  372. }, {
  373. 'districtName': 12, 'timeDimension1': '22221', 'timeDimension2': '22222', 'timeDimension3': '22223', 'timeDimension4': '22224'
  374. }, {
  375. 'districtName': 13, 'timeDimension1': '33331', 'timeDimension2': '33332', 'timeDimension3': '33333', 'timeDimension4': '33334'
  376. }
  377. ],
  378. this.tab2.table.tableConfig = [{
  379. id: 90, label: '饲料名称', prop: '', width: '',
  380. children: [{ id: 91, label: '车次', prop: 'districtName', width: '' }]
  381. }, {
  382. id: 100, label: '饲料01', prop: '', width: '',
  383. children: [
  384. { id: 101, label: '理论', prop: 'timeDimension1', width: '' },
  385. { id: 102, label: '实际', prop: 'timeDimension2', width: '' },
  386. { id: 103, label: '误差值', prop: 'timeDimension2', width: '' },
  387. { id: 104, label: '误差率', prop: 'timeDimension2', width: '' }
  388. ]
  389. }, {
  390. id: 110, label: '饲料02', prop: '', width: '',
  391. children: [
  392. { id: 111, label: '理论', prop: 'timeDimension3', width: '' },
  393. { id: 112, label: '实际', prop: 'timeDimension4', width: '' },
  394. { id: 113, label: '误差值', prop: 'timeDimension2', width: '' },
  395. { id: 114, label: '误差率', prop: 'timeDimension2', width: '' }
  396. ]
  397. }]
  398. }
  399. }
  400. }
  401. }
  402. </script>
  403. <style lang="scss" scoped>
  404. .search{margin-bottom:10px;}
  405. </style>