bde2acee8965e7c1fe77fd8b06d55352f6638317.svn-base 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383
  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. const start2 = '2021-07-01'
  243. this.table.getdataListParm.parammaps.date = parseTime(start2, '{y}-{m}-{d}')
  244. this.getDownList()
  245. },
  246. methods: {
  247. getDownList() {
  248. GetDataByNames(this.requestParams).then(response => {
  249. this.pastureList = response.data.getPastureListJT.list
  250. this.table.getdataListParm.parammaps.pastureid = response.data.getPastureListJT.list[0].pastureid
  251. this.table2.getdataListParm.parammaps.pastureid = response.data.getPastureListJT.list[0].pastureid
  252. this.table3.getdataListParm.parammaps.pastureid = response.data.getPastureListJT.list[0].pastureid
  253. this.table4.getdataListParm.parammaps.pastureid = response.data.getPastureListJT.list[0].pastureid
  254. this.table2.getdataListParm.parammaps.pastureid = this.table.getdataListParm.parammaps.pastureid
  255. this.table3.getdataListParm.parammaps.pastureid = this.table.getdataListParm.parammaps.pastureid
  256. this.table4.getdataListParm.parammaps.pastureid = this.table.getdataListParm.parammaps.pastureid
  257. this.getTab2List()
  258. this.getTab2List2()
  259. this.getTab2List3()
  260. this.getTab2List4()
  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. changePasture(item) {
  294. console.log(item)
  295. this.table.getdataListParm.parammaps.pastureid = this.table.getdataListParm.parammaps.pastureid
  296. this.table2.getdataListParm.parammaps.pastureid = this.table.getdataListParm.parammaps.pastureid
  297. this.table3.getdataListParm.parammaps.pastureid = this.table.getdataListParm.parammaps.pastureid
  298. this.table4.getdataListParm.parammaps.pastureid = this.table.getdataListParm.parammaps.pastureid
  299. this.getTab2List()
  300. this.getTab2List2()
  301. this.getTab2List3()
  302. this.getTab2List4()
  303. },
  304. // 宾州筛分析
  305. getTab2List() {
  306. this.table.listLoading = true
  307. GetDataByName(this.table.getdataListParm).then(response => {
  308. console.log('宾州筛分析table数据', response.data.list)
  309. if (response.data.list !== null) {
  310. this.table.list = response.data.list
  311. this.table.total = response.data.total
  312. } else {
  313. this.table.list = []
  314. }
  315. setTimeout(() => {
  316. this.table.listLoading = false
  317. }, 100)
  318. })
  319. },
  320. // 粪便筛分析
  321. getTab2List2() {
  322. this.table2.listLoading = true
  323. this.table2.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.date
  324. GetDataByName(this.table2.getdataListParm).then(response => {
  325. console.log('粪便筛分析table数据', response.data.list)
  326. if (response.data.list !== null) {
  327. this.table2.list = response.data.list
  328. this.table2.total = response.data.total
  329. } else {
  330. this.table2.list = []
  331. }
  332. setTimeout(() => {
  333. this.table2.listLoading = false
  334. }, 100)
  335. })
  336. },
  337. // BCS评分
  338. getTab2List3() {
  339. this.table3.listLoading = true
  340. this.table3.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.date
  341. GetDataByName(this.table3.getdataListParm).then(response => {
  342. console.log('BCS评分table数据', response.data.list)
  343. if (response.data.list !== null) {
  344. this.table3.list = response.data.list
  345. this.table3.total = response.data.total
  346. } else {
  347. this.table3.list = []
  348. }
  349. setTimeout(() => {
  350. this.table3.listLoading = false
  351. }, 100)
  352. })
  353. },
  354. // 粪便评分
  355. getTab2List4() {
  356. this.table4.listLoading = true
  357. this.table4.getdataListParm.parammaps.date = this.table.getdataListParm.parammaps.date
  358. GetDataByName(this.table4.getdataListParm).then(response => {
  359. console.log('成本分析table数据', response.data.list)
  360. if (response.data.list !== null) {
  361. this.table4.list = response.data.list
  362. this.table4.total = response.data.total
  363. } else {
  364. this.table4.list = []
  365. }
  366. setTimeout(() => {
  367. this.table4.listLoading = false
  368. }, 100)
  369. })
  370. }
  371. }
  372. }
  373. </script>
  374. <style lang="scss" scoped>
  375. .search{margin-bottom:10px;}
  376. </style>