0d2a8c9f21384db4c8ad0d26606df4b50ab2e4fe.svn-base 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348
  1. <template>
  2. <div class="app-container">
  3. <div class="search">
  4. <el-select v-model="table.getdataListParm.parammaps.pastureid" placeholder="牧场" class="filter-item" style="width: 120px;">
  5. <el-option v-for="item in pastureList" :key="item.pastureid" :label="item.pasturename" :value="item.pastureid" />
  6. </el-select>
  7. <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" />
  8. </div>
  9. <div class="table">
  10. <el-row :gutter="10">
  11. <!-- 宾州筛分析 -->
  12. <el-col :span="12">
  13. <h4 style="text-align:center;">宾州筛分析</h4>
  14. <el-table
  15. :key="table.tableKey"
  16. v-loading="table.listLoading"
  17. element-loading-text="给我一点时间"
  18. :data="table.list"
  19. border
  20. fit
  21. highlight-current-row
  22. style="width: 100%;"
  23. :row-style="rowStyle"
  24. :cell-style="cellStyle"
  25. class="elTable table-fixed"
  26. height="400px"
  27. >
  28. <el-table-column label="宾州筛" min-width="110px" align="center" prop="barname" />
  29. <el-table-column label="第一层重量" min-width="110px" align="center" prop="oneweight" />
  30. <el-table-column label="第一层百分比" min-width="110px" align="center" prop="onerate" />
  31. <el-table-column label="第二层重量" min-width="110px" align="center" prop="twoweight" />
  32. <el-table-column label="第二层百分比" min-width="110px" align="center" prop="tworate" />
  33. <el-table-column label="第三层重量" min-width="110px" align="center" prop="threeweight" />
  34. <el-table-column label="第三层百分比" min-width="110px" align="center" prop="threerate" />
  35. <el-table-column label="第四层重量" min-width="110px" align="center" prop="fourweight" />
  36. <el-table-column label="第四层百分比" min-width="110px" align="center" prop="fourrate" />
  37. <el-table-column label="参考标准" min-width="110px" align="center" prop="standard" />
  38. </el-table>
  39. </el-col>
  40. <!-- 粪便筛分析 -->
  41. <el-col :span="12">
  42. <h4 style="text-align:center;">粪便筛分析</h4>
  43. <el-table
  44. :key="table2.tableKey"
  45. v-loading="table2.listLoading"
  46. element-loading-text="给我一点时间"
  47. :data="table2.list"
  48. border
  49. fit
  50. highlight-current-row
  51. style="width: 100%;"
  52. :row-style="rowStyle"
  53. :cell-style="cellStyle"
  54. class="elTable table-fixed"
  55. height="400px"
  56. >
  57. <el-table-column label="粪便筛" min-width="150px" align="center" prop="barname" />
  58. <el-table-column label="第一层重量" min-width="110px" align="center" prop="oneweight" />
  59. <el-table-column label="第一层百分比" min-width="110px" align="center" prop="onerate" />
  60. <el-table-column label="第二层重量" min-width="110px" align="center" prop="twoweight" />
  61. <el-table-column label="第二层百分比" min-width="110px" align="center" prop="tworate" />
  62. <el-table-column label="第三层重量" min-width="110px" align="center" prop="threeweight" />
  63. <el-table-column label="第三层百分比" min-width="110px" align="center" prop="threerate" />
  64. <el-table-column label="参考标准" min-width="110px" align="center" prop="standard" />
  65. </el-table>
  66. </el-col>
  67. </el-row>
  68. <el-row :gutter="10">
  69. <!-- BCS评分 -->
  70. <el-col :span="12">
  71. <h4 style="text-align:center;">BCS评分</h4>
  72. <el-table
  73. :key="table3.tableKey"
  74. v-loading="table3.listLoading"
  75. element-loading-text="给我一点时间"
  76. :data="table3.list"
  77. border
  78. fit
  79. highlight-current-row
  80. style="width: 100%;"
  81. :row-style="rowStyle"
  82. :cell-style="cellStyle"
  83. class="elTable table-fixed"
  84. height="400px"
  85. >
  86. <el-table-column label="栏舍" min-width="110px" align="center" prop="barname" />
  87. <el-table-column label="抽查样本数" min-width="110px" align="center" prop="sumcowcount" />
  88. <el-table-column label="单产" min-width="110px" align="center" prop="product" />
  89. <el-table-column label="干物质采食量" min-width="110px" align="center" prop="dryweight" />
  90. <el-table-column label="泌乳天数" min-width="110px" align="center" prop="avgdim" />
  91. <el-table-column label="标准分数" min-width="110px" align="center" prop="standardscore" />
  92. <el-table-column label="2.75-分(数量、百分比)" min-width="110px" align="center" prop="score25" />
  93. <el-table-column label="2.75分(数量、百分比" min-width="110px" align="center" prop="score275" />
  94. <el-table-column label="3分(数量、百分比)" min-width="110px" align="center" prop="score3" />
  95. <el-table-column label="3.25分(数量、百分比)" min-width="110px" align="center" prop="score325" />
  96. <el-table-column label="3.5分(数量、百分比)" min-width="110px" align="center" prop="score35" />
  97. <el-table-column label="3.75分(数量、百分比)" min-width="110px" align="center" prop="score375" />
  98. <el-table-column label="4+分(数量、百分比)" min-width="110px" align="center" prop="score4" />
  99. </el-table>
  100. </el-col>
  101. <!-- 粪便评分 -->
  102. <el-col :span="12">
  103. <h4 style="text-align:center;">粪便评分</h4>
  104. <el-table
  105. :key="table4.tableKey"
  106. v-loading="table4.listLoading"
  107. element-loading-text="给我一点时间"
  108. :data="table4.list"
  109. border
  110. fit
  111. highlight-current-row
  112. style="width: 100%;"
  113. :row-style="rowStyle"
  114. :cell-style="cellStyle"
  115. class="elTable table-fixed"
  116. height="400px"
  117. >
  118. <el-table-column label="栏舍" min-width="110px" align="center" prop="barname" />
  119. <el-table-column label="抽查样本数" min-width="110px" align="center" prop="sumcowcount" />
  120. <el-table-column label="单产" min-width="110px" align="center" prop="product" />
  121. <el-table-column label="干物质采食量" min-width="110px" align="center" prop="dryweight" />
  122. <el-table-column label="泌乳天数" min-width="110px" align="center" prop="avgdim" />
  123. <el-table-column label="标准分数" min-width="110px" align="center" prop="standardscore" />
  124. <el-table-column label="1分(数量、百分比)" min-width="110px" align="center" prop="score1" />
  125. <el-table-column label="2分(数量、百分比)" min-width="110px" align="center" prop="score2" />
  126. <el-table-column label="3分(数量、百分比)" min-width="110px" align="center" prop="score3" />
  127. <el-table-column label="4分(数量、百分比)" min-width="110px" align="center" prop="score4" />
  128. <el-table-column label="5分(数量、百分比)" min-width="110px" align="center" prop="score5" />
  129. </el-table>
  130. </el-col>
  131. </el-row>
  132. </div>
  133. </div>
  134. </template>
  135. <script>
  136. import echarts from 'echarts'
  137. require('echarts/theme/macarons')
  138. import { GetDataByName, GetReportform, GetDataByNames } from '@/api/common'
  139. import Cookies from 'js-cookie'
  140. import { parseTime } from '@/utils/index.js'
  141. import Pagination from '@/components/Pagination'
  142. import { json2excel } from '@/utils/index.js'
  143. import { MessageBox } from 'element-ui'
  144. export default {
  145. name: 'GroupFeedingEfficiency',
  146. components: { Pagination },
  147. data() {
  148. return {
  149. requestParams: [
  150. { name: 'getPastureListJT', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid'), pasturename: '' }}
  151. ],
  152. pastureList: [], // 牧场
  153. frequencyList: [],
  154. table: {
  155. getdataListParm: {
  156. name: 'getAssessCowPenn',
  157. page: 1,
  158. offset: 1,
  159. pagecount: '',
  160. returntype: 'Map',
  161. parammaps: {
  162. pastureid: Cookies.get('pastureid'),
  163. date: parseTime(new Date(), '{y}-{m}-{d}')
  164. }
  165. },
  166. tableKey: 1,
  167. list: [],
  168. total: 0,
  169. listLoading: true,
  170. temp: {}
  171. },
  172. table2: {
  173. getdataListParm: {
  174. name: 'getAssessCowDung',
  175. page: 1,
  176. offset: 1,
  177. pagecount: '',
  178. returntype: 'Map',
  179. parammaps: {
  180. pastureid: Cookies.get('pastureid'),
  181. date: ''
  182. }
  183. },
  184. tableKey: 1,
  185. list: [],
  186. total: 0,
  187. listLoading: true,
  188. temp: {}
  189. },
  190. table3: {
  191. getdataListParm: {
  192. name: 'getAssessBodyscore',
  193. page: 1,
  194. offset: 1,
  195. pagecount: '',
  196. returntype: 'Map',
  197. parammaps: {
  198. pastureid: Cookies.get('pastureid'),
  199. date: ''
  200. }
  201. },
  202. tableKey: 1,
  203. list: [],
  204. total: 0,
  205. listLoading: true,
  206. temp: {}
  207. },
  208. table4: {
  209. getdataListParm: {
  210. name: 'getAssessDungscore',
  211. page: 1,
  212. offset: 1,
  213. pagecount: '',
  214. returntype: 'Map',
  215. parammaps: {
  216. pastureid: Cookies.get('pastureid'),
  217. date: ''
  218. }
  219. },
  220. tableKey: 1,
  221. list: [],
  222. total: 0,
  223. listLoading: true,
  224. temp: {}
  225. },
  226. rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
  227. cellStyle: { padding: 0 + 'px' }
  228. }
  229. },
  230. created() {
  231. const start2 = new Date()
  232. start2.setTime(start2.getTime() - 3600 * 1000 * 24 * 1)
  233. this.table.getdataListParm.parammaps.date = parseTime(start2, '{y}-{m}-{d}')
  234. this.getDownList()
  235. this.getTab2List()
  236. this.getTab2List2()
  237. this.getTab2List3()
  238. this.getTab2List4()
  239. },
  240. mounted() {},
  241. activated() {
  242. const start2 = new Date()
  243. start2.setTime(start2.getTime() - 3600 * 1000 * 24 * 1)
  244. this.table.getdataListParm.parammaps.date = parseTime(start2, '{y}-{m}-{d}')
  245. this.getDownList()
  246. this.getTab2List()
  247. this.getTab2List2()
  248. this.getTab2List3()
  249. this.getTab2List4()
  250. },
  251. methods: {
  252. getDownList() {
  253. GetDataByNames(this.requestParams).then(response => {
  254. this.pastureList = response.data.getPastureListJT.list
  255. this.table.getdataListParm.parammaps.pastureid = response.data.getPastureListJT.list[0].pastureid
  256. this.table.getdataListParm2.parammaps.pastureid = response.data.getPastureListJT.list[0].pastureid
  257. this.table.getdataListParm3.parammaps.pastureid = response.data.getPastureListJT.list[0].pastureid
  258. this.table.getdataListParm4.parammaps.pastureid = response.data.getPastureListJT.list[0].pastureid
  259. })
  260. },
  261. // 切换tab2日期
  262. changeTab2Date() {
  263. this.getTab2List()
  264. this.getTab2List2()
  265. this.getTab2List3()
  266. this.getTab2List4()
  267. },
  268. // 宾州筛分析
  269. getTab2List() {
  270. this.table.listLoading = true
  271. GetDataByName(this.table.getdataListParm).then(response => {
  272. console.log('宾州筛分析table数据', response.data.list)
  273. if (response.data.list !== null) {
  274. this.table.list = response.data.list
  275. this.table.total = response.data.total
  276. } else {
  277. this.table.list = []
  278. }
  279. setTimeout(() => {
  280. this.table.listLoading = false
  281. }, 100)
  282. })
  283. },
  284. // 粪便筛分析
  285. getTab2List2() {
  286. this.table2.listLoading = true
  287. this.table2.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.date
  288. GetDataByName(this.table2.getdataListParm).then(response => {
  289. console.log('粪便筛分析table数据', response.data.list)
  290. if (response.data.list !== null) {
  291. this.table2.list = response.data.list
  292. this.table2.total = response.data.total
  293. } else {
  294. this.table2.list = []
  295. }
  296. setTimeout(() => {
  297. this.table2.listLoading = false
  298. }, 100)
  299. })
  300. },
  301. // BCS评分
  302. getTab2List3() {
  303. this.table3.listLoading = true
  304. this.table3.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.date
  305. GetDataByName(this.table3.getdataListParm).then(response => {
  306. console.log('BCS评分table数据', response.data.list)
  307. if (response.data.list !== null) {
  308. this.table3.list = response.data.list
  309. this.table3.total = response.data.total
  310. } else {
  311. this.table3.list = []
  312. }
  313. setTimeout(() => {
  314. this.table3.listLoading = false
  315. }, 100)
  316. })
  317. },
  318. // 粪便评分
  319. getTab2List4() {
  320. this.table4.listLoading = true
  321. this.table4.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.date
  322. GetDataByName(this.table4.getdataListParm).then(response => {
  323. console.log('成本分析table数据', response.data.list)
  324. if (response.data.list !== null) {
  325. this.table4.list = response.data.list
  326. this.table4.total = response.data.total
  327. } else {
  328. this.table4.list = []
  329. }
  330. setTimeout(() => {
  331. this.table4.listLoading = false
  332. }, 100)
  333. })
  334. }
  335. }
  336. }
  337. </script>
  338. <style lang="scss" scoped>
  339. .search{margin-bottom:10px;}
  340. </style>