59944749d7aa1ed83298ed12e19b74fee395a2a7.svn-base 15 KB

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