3c73724a731ae73b13342253bb29b4b36f83a73f.svn-base 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382
  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;" @change="changePasture">
  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: '',
  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: '',
  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: '',
  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: '',
  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. },
  238. mounted() {},
  239. activated() {
  240. const start2 = new Date()
  241. start2.setTime(start2.getTime() - 3600 * 1000 * 24 * 1)
  242. this.table.getdataListParm.parammaps.date = parseTime(start2, '{y}-{m}-{d}')
  243. this.getDownList()
  244. },
  245. methods: {
  246. getDownList() {
  247. GetDataByNames(this.requestParams).then(response => {
  248. this.pastureList = response.data.getPastureListJT.list
  249. this.table.getdataListParm.parammaps.pastureid = response.data.getPastureListJT.list[0].pastureid
  250. this.table2.getdataListParm.parammaps.pastureid = response.data.getPastureListJT.list[0].pastureid
  251. this.table3.getdataListParm.parammaps.pastureid = response.data.getPastureListJT.list[0].pastureid
  252. this.table4.getdataListParm.parammaps.pastureid = response.data.getPastureListJT.list[0].pastureid
  253. this.table2.getdataListParm.parammaps.pastureid = this.table.getdataListParm.parammaps.pastureid
  254. this.table3.getdataListParm.parammaps.pastureid = this.table.getdataListParm.parammaps.pastureid
  255. this.table4.getdataListParm.parammaps.pastureid = this.table.getdataListParm.parammaps.pastureid
  256. this.getTab2List()
  257. this.getTab2List2()
  258. this.getTab2List3()
  259. this.getTab2List4()
  260. })
  261. },
  262. handleBefore() {
  263. if (this.table.getdataListParm.parammaps.date !== '' && this.table.getdataListParm.parammaps.date !== null) {
  264. this.table.getdataListParm.parammaps.date = new Date(this.table.getdataListParm.parammaps.date)
  265. var start = new Date(this.table.getdataListParm.parammaps.date.setDate(this.table.getdataListParm.parammaps.date.getDate() - 1))
  266. // var start = this.table.getdataListParm.parammaps.mydate - 1
  267. this.table.getdataListParm.parammaps.date = parseTime(start, '{y}-{m}-{d}')
  268. this.getTab2List()
  269. this.getTab2List2()
  270. this.getTab2List3()
  271. this.getTab2List4()
  272. }
  273. },
  274. handleNext() {
  275. if (this.table.getdataListParm.parammaps.date !== '' && this.table.getdataListParm.parammaps.date !== null) {
  276. this.table.getdataListParm.parammaps.date = new Date(this.table.getdataListParm.parammaps.date)
  277. var stop = new Date(this.table.getdataListParm.parammaps.date.setDate(this.table.getdataListParm.parammaps.date.getDate() + 1))
  278. this.table.getdataListParm.parammaps.date = parseTime(stop, '{y}-{m}-{d}')
  279. this.getTab2List()
  280. this.getTab2List2()
  281. this.getTab2List3()
  282. this.getTab2List4()
  283. }
  284. },
  285. // 切换tab2日期
  286. changeTab2Date() {
  287. this.getTab2List()
  288. this.getTab2List2()
  289. this.getTab2List3()
  290. this.getTab2List4()
  291. },
  292. changePasture(item) {
  293. console.log(item)
  294. this.table.getdataListParm.parammaps.pastureid = this.table.getdataListParm.parammaps.pastureid
  295. this.table2.getdataListParm.parammaps.pastureid = this.table.getdataListParm.parammaps.pastureid
  296. this.table3.getdataListParm.parammaps.pastureid = this.table.getdataListParm.parammaps.pastureid
  297. this.table4.getdataListParm.parammaps.pastureid = this.table.getdataListParm.parammaps.pastureid
  298. this.getTab2List()
  299. this.getTab2List2()
  300. this.getTab2List3()
  301. this.getTab2List4()
  302. },
  303. // 宾州筛分析
  304. getTab2List() {
  305. this.table.listLoading = true
  306. GetDataByName(this.table.getdataListParm).then(response => {
  307. console.log('宾州筛分析table数据', response.data.list)
  308. if (response.data.list !== null) {
  309. this.table.list = response.data.list
  310. this.table.total = response.data.total
  311. } else {
  312. this.table.list = []
  313. }
  314. setTimeout(() => {
  315. this.table.listLoading = false
  316. }, 100)
  317. })
  318. },
  319. // 粪便筛分析
  320. getTab2List2() {
  321. this.table2.listLoading = true
  322. this.table2.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.date
  323. GetDataByName(this.table2.getdataListParm).then(response => {
  324. console.log('粪便筛分析table数据', response.data.list)
  325. if (response.data.list !== null) {
  326. this.table2.list = response.data.list
  327. this.table2.total = response.data.total
  328. } else {
  329. this.table2.list = []
  330. }
  331. setTimeout(() => {
  332. this.table2.listLoading = false
  333. }, 100)
  334. })
  335. },
  336. // BCS评分
  337. getTab2List3() {
  338. this.table3.listLoading = true
  339. this.table3.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.date
  340. GetDataByName(this.table3.getdataListParm).then(response => {
  341. console.log('BCS评分table数据', response.data.list)
  342. if (response.data.list !== null) {
  343. this.table3.list = response.data.list
  344. this.table3.total = response.data.total
  345. } else {
  346. this.table3.list = []
  347. }
  348. setTimeout(() => {
  349. this.table3.listLoading = false
  350. }, 100)
  351. })
  352. },
  353. // 粪便评分
  354. getTab2List4() {
  355. this.table4.listLoading = true
  356. this.table4.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.date
  357. GetDataByName(this.table4.getdataListParm).then(response => {
  358. console.log('成本分析table数据', response.data.list)
  359. if (response.data.list !== null) {
  360. this.table4.list = response.data.list
  361. this.table4.total = response.data.total
  362. } else {
  363. this.table4.list = []
  364. }
  365. setTimeout(() => {
  366. this.table4.listLoading = false
  367. }, 100)
  368. })
  369. }
  370. }
  371. }
  372. </script>
  373. <style lang="scss" scoped>
  374. .search{margin-bottom:10px;}
  375. </style>