8121012884f7850476cffdb9a2af4b3d051f9445.svn-base 71 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603
  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.date" :clearable="false" type="date" placeholder="选择日期" style="width: 150px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" />
  7. <span style="margin-left: 10px;">统计类型:</span>
  8. <el-radio v-model="tab.radio" label="1" @change="changeRadio">配方</el-radio>
  9. <el-radio v-model="tab.radio" label="2" @change="changeRadio">栏舍</el-radio>
  10. <el-radio v-model="tab.radio" label="3" @change="changeRadio">牲畜类别</el-radio>
  11. <el-input v-if="tab.isFormulaName" v-model="tab.table.getdataListParm.parammaps.ftname" class="filter-item" style="width: 245px;" placeholder="配方模板" />
  12. <el-input v-if="tab.isHouseName" v-model="tab.table.getdataListParm.parammaps.barname" class="filter-item" style="width: 150px;" placeholder="栏舍" />
  13. <el-input v-if="tab.isHouseName" v-model="tab.table.getdataListParm.parammaps.ftname" class="filter-item" style="width: 150px;" placeholder="配方模板" />
  14. <el-input v-if="tab.isLivestockType" v-model="tab.table.getdataListParm.parammaps.cowclass" class="filter-item" style="width: 150px;" placeholder="牲畜类别" />
  15. <el-button class="successBorder" @click="handleSearch">查询</el-button>
  16. <el-button class="export" @click="handleDownload">导出</el-button>
  17. </div>
  18. <div class="table">
  19. <el-table
  20. :key="tab.table.tableKey"
  21. v-loading="tab.table.listLoading"
  22. element-loading-text="给我一点时间"
  23. :data="tab.table.list"
  24. border
  25. fit
  26. highlight-current-row
  27. style="width: 100%;"
  28. :row-style="rowStyle"
  29. :cell-style="cellStyle"
  30. class="elTable table-fixed"
  31. >
  32. <el-table-column v-if="tab.isFormulaName" label="配方模板" min-width="110px" align="center" prop="配方模板" />
  33. <el-table-column v-if="tab.isHouseName" label="栏舍" min-width="110px" align="center" prop="栏舍" />
  34. <el-table-column v-if="tab.isHouseName" label="配方模板" min-width="110px" align="center" prop="配方模板" />
  35. <el-table-column v-if="tab.isLivestockType" label="牲畜类别" min-width="110px" align="center" prop="牲畜类别" />
  36. <el-table-column label="实际牛头数" min-width="110px" align="center" prop="实际牛头数" />
  37. <el-table-column label="应混料量(kg)" min-width="110px" align="center" prop="应混料量" />
  38. <el-table-column label="实际混料量(kg)" min-width="110px" align="center" prop="实际混料量" />
  39. <el-table-column label="撒料量(kg)" min-width="110px" align="center" prop="撒料量" />
  40. <el-table-column label="混料时间(min)" min-width="110px" align="center" prop="混料时间" />
  41. <el-table-column label="转投剩料量(kg)" min-width="110px" align="center" prop="转投剩料量" />
  42. <el-table-column label="今日剩料量(kg)" min-width="110px" align="center" prop="今日剩料量" />
  43. <el-table-column label="剩料率(%)" min-width="110px" align="center" prop="剩料率" />
  44. <el-table-column label="TMR干物质(%)" min-width="110px" align="center" prop="TMR干物质" />
  45. <el-table-column label="配方干物质采食量(kg/头)" min-width="110px" align="center" prop="配方干物质采食量" />
  46. <el-table-column label="实际干物质采食量(kg/头)" min-width="110px" align="center" prop="实际干物质采食量" />
  47. <el-table-column label="采食率(%)" min-width="110px" align="center" prop="采食率" />
  48. <el-table-column label="配方成本(元/头)" min-width="110px" align="center" prop="配方成本" />
  49. <el-table-column label="实际成本(元/头)" min-width="110px" align="center" prop="实际成本" />
  50. <el-table-column label="产奶量(kg/头)" min-width="110px" align="center" prop="产奶量" />
  51. <el-table-column label="饲料转化率" min-width="110px" align="center" prop="饲料转化率" />
  52. <el-table-column label="公斤奶饲料成本" min-width="110px" align="center" prop="公斤奶饲料成本" />
  53. </el-table>
  54. <!-- <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" /> -->
  55. </div>
  56. <div class="AnalysisChart">
  57. <el-row :gutter="10">
  58. <el-col :span="12" style="margin-top: 10px;">
  59. <el-date-picker v-model="tab.chartDate" :clearable="false" style="width: 250px;margin-right: 10px;" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" />
  60. <el-button class="successBorder" @click="handleChartDate">确认</el-button>
  61. </el-col>
  62. </el-row>
  63. <el-row :gutter="10">
  64. <!-- 泌乳牛采食量 -->
  65. <el-col :span="12" style="position: relative;">
  66. <h4 style="text-align:center;">泌乳牛采食量</h4>
  67. <div>
  68. <el-date-picker v-model="tab.chart1.getdataListParm.parammaps.inputDatetime" style="width: 250px;" class="inputDatetime" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :clearable="false" @change="changeChartDate('chart1')" />
  69. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleExport('chart1')">导出</el-button>
  70. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleTable('chart1')">切换表格</el-button>
  71. </div>
  72. <div id="chartLine1" style="width:100%;height:430px;" />
  73. <div v-if="tab.chart1.isTable" class="table" style="width: 100%;position: absolute;top:19px;right: 0;">
  74. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleExport('chart1')">导出</el-button>
  75. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleChart('chart1')">切换图表</el-button>
  76. <el-table
  77. :key="tab.chart1.table.tableKey"
  78. v-loading="tab.chart1.table.listLoading"
  79. element-loading-text="给我一点时间"
  80. :data="tab.chart1.table.list"
  81. border
  82. fit
  83. highlight-current-row
  84. style="width: 100%;"
  85. height="430"
  86. :row-style="rowStyle"
  87. :cell-style="cellStyle"
  88. class="elTable table-fixed"
  89. >
  90. <el-table-column label="日期" sortable min-width="110px" align="center" prop="日期" />
  91. <el-table-column label="泌乳牛采食量(kg)" sortable min-width="110px" align="center" prop="field1" />
  92. <el-table-column label="泌乳牛产奶量(kg)" sortable min-width="110px" align="center" prop="field2" />
  93. </el-table>
  94. </div>
  95. </el-col>
  96. <!-- 牛栏剩料率 -->
  97. <el-col :span="12" style="position: relative;">
  98. <h4 style="text-align:center;">牛栏剩料率</h4>
  99. <div>
  100. <el-select v-model="tab.chart2.getdataListParm.parammaps.statisticsList" style="width: 200px;margin-right: 5px;" multiple collapse-tags placeholder="请选择统计参数" @visible-change="changeStatisticChart2()">
  101. <el-option v-for="item in tab.chart2.statisticsList" :key="item.id" :label="item.name" :value="item.name" />
  102. </el-select>
  103. <el-date-picker v-model="tab.chart2.getdataListParm.parammaps.inputDatetime" style="width: 250px;" class="inputDatetime" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :clearable="false" @change="changeChartDate('chart2')" />
  104. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleExport('chart2')">导出</el-button>
  105. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleTable('chart2')">切换表格</el-button>
  106. </div>
  107. <div id="chartLine2" style="width:100%;height:430px;" />
  108. <div v-if="tab.chart2.isTable" class="table" style="width: 100%;z-index:1;position: absolute;top:19px;right: 0;">
  109. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleExport('chart2')">导出</el-button>
  110. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleChart('chart2')">切换图表</el-button>
  111. <el-table
  112. :key="tab.chart2.table.tableKey"
  113. v-loading="tab.chart2.table.listLoading"
  114. element-loading-text="给我一点时间"
  115. :data="tab.chart2.table.list"
  116. border
  117. fit
  118. highlight-current-row
  119. style="width: 100%;"
  120. height="430"
  121. :row-style="rowStyle"
  122. :cell-style="cellStyle"
  123. class="elTable table-fixed"
  124. >
  125. <el-table-column label="日期" sortable min-width="110px" align="center" prop="日期" />
  126. <el-table-column label="栏舍名称" sortable min-width="110px" align="center" prop="名称" />
  127. <el-table-column label="剩料量" sortable min-width="110px" align="center" prop="剩料量" />
  128. <el-table-column label="撒料量" sortable min-width="110px" align="center" prop="撒料量" />
  129. <el-table-column label="剩料率" sortable min-width="110px" align="center" prop="准确率" />
  130. </el-table>
  131. </div>
  132. </el-col>
  133. </el-row>
  134. <el-row :gutter="10">
  135. <!-- 混料时间统计 -->
  136. <el-col :span="12" style="position: relative;">
  137. <h4 style="text-align:center;">混料时间统计</h4>
  138. <div>
  139. <el-date-picker v-model="tab.chart3.getdataListParm.parammaps.inputDatetime" style="width: 250px;" class="inputDatetime" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :clearable="false" @change="changeChartDate('chart3')" />
  140. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleExport('chart3')">导出</el-button>
  141. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleTable('chart3')">切换表格</el-button>
  142. </div>
  143. <div id="chartLine3" style="width:100%;height:430px;" />
  144. <div v-if="tab.chart3.isTable" class="table" style="width: 100%;position: absolute;top:19px;right: 0;">
  145. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleExport('chart3')">导出</el-button>
  146. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleChart('chart3')">切换图表</el-button>
  147. <el-table
  148. :key="tab.chart3.table.tableKey"
  149. v-loading="tab.chart3.table.listLoading"
  150. element-loading-text="给我一点时间"
  151. :data="tab.chart3.table.list"
  152. border
  153. fit
  154. highlight-current-row
  155. style="width: 100%;"
  156. height="430"
  157. :row-style="rowStyle"
  158. :cell-style="cellStyle"
  159. class="elTable table-fixed"
  160. >
  161. <el-table-column label="日期" min-width="110px" align="center" prop="日期" />
  162. <el-table-column label="混料时间(分钟)" min-width="110px" align="center" prop="field1" />
  163. </el-table>
  164. </div>
  165. </el-col>
  166. <!-- 转化率 -->
  167. <el-col :span="12" style="position: relative;">
  168. <h4 style="text-align:center;">转化率</h4>
  169. <div>
  170. <el-select v-model="tab.chart4.getdataListParm.parammaps.statisticsList" style="width: 200px;margin-right: 5px;" multiple collapse-tags placeholder="请选择统计参数" @visible-change="changeStatisticChart4()">
  171. <el-option v-for="item in tab.chart4.statisticsList" :key="item.id" :label="item.name" :value="item.name" />
  172. </el-select>
  173. <el-date-picker v-model="tab.chart4.getdataListParm.parammaps.inputDatetime" style="width: 250px;" class="inputDatetime" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :clearable="false" @change="changeChartDate('chart4')" />
  174. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleExport('chart4')">导出</el-button>
  175. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleTable('chart4')">切换表格</el-button>
  176. </div>
  177. <div id="chartLine4" style="width:100%;height:430px;" />
  178. <div v-if="tab.chart4.isTable" class="table" style="width: 100%;z-index:1;position: absolute;top:19px;right: 0;">
  179. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleExport('chart4')">导出</el-button>
  180. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleChart('chart4')">切换图表</el-button>
  181. <el-table
  182. :key="tab.chart4.table.tableKey"
  183. v-loading="tab.chart4.table.listLoading"
  184. element-loading-text="给我一点时间"
  185. :data="tab.chart4.table.list"
  186. border
  187. fit
  188. highlight-current-row
  189. style="width: 100%;"
  190. height="430"
  191. :row-style="rowStyle"
  192. :cell-style="cellStyle"
  193. class="elTable table-fixed"
  194. >
  195. <el-table-column label="日期" min-width="110px" align="center" prop="日期" />
  196. <el-table-column label="配方名称" min-width="110px" align="center" prop="名称" />
  197. <el-table-column label="饲料转化率" min-width="110px" align="center" prop="准确率" />
  198. </el-table>
  199. </div>
  200. </el-col>
  201. </el-row>
  202. <el-row :gutter="10">
  203. <!-- 成本分析 -->
  204. <el-col :span="24" style="position: relative;">
  205. <h4 style="text-align:center;">成本分析</h4>
  206. <div>
  207. <el-select v-model="tab.chart5.getdataListParm.parammaps.statisticsList" style="width: 200px;margin-right: 5px;" multiple collapse-tags placeholder="请选择统计参数" @visible-change="changeStatisticChart5()">
  208. <el-option v-for="item in tab.chart5.statisticsList" :key="item.id" :label="item.name" :value="item.name" />
  209. </el-select>
  210. <el-date-picker v-model="tab.chart5.getdataListParm.parammaps.inputDatetime" style="width: 250px;" class="inputDatetime" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :clearable="false" @change="changeChartDate('chart5')" />
  211. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleExport('chart5')">导出</el-button>
  212. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleTable('chart5')">切换表格</el-button>
  213. </div>
  214. <div id="chartLine5" style="width:100%;height:430px;" />
  215. <div v-if="tab.chart5.isTable" class="table" style="width: 100%;z-index:1;position: absolute;top:19px;right: 0;">
  216. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleExport('chart5')">导出</el-button>
  217. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleChart('chart5')">切换图表</el-button>
  218. <el-table
  219. :key="tab.chart5.table.tableKey"
  220. v-loading="tab.chart5.table.listLoading"
  221. element-loading-text="给我一点时间"
  222. :data="tab.chart5.table.list"
  223. border
  224. fit
  225. highlight-current-row
  226. style="width: 100%;"
  227. height="430"
  228. :row-style="rowStyle"
  229. :cell-style="cellStyle"
  230. class="elTable table-fixed"
  231. >
  232. <el-table-column label="日期" min-width="110px" align="center" prop="日期" />
  233. <el-table-column label="牲畜类别" min-width="110px" align="center" prop="名称" />
  234. <el-table-column label="公斤奶饲料成本(元)" min-width="110px" align="center" prop="准确率" />
  235. </el-table>
  236. </div>
  237. </el-col>
  238. </el-row>
  239. </div>
  240. </el-tab-pane>
  241. <el-tab-pane label="牛群评估" name="second">
  242. <div class="search">
  243. <el-date-picker v-model="tab2.table.getdataListParm.parammaps.date" :clearable="false" type="date" placeholder="选择日期" style="width: 150px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" @change="changeTab2Date" />
  244. </div>
  245. <div class="table">
  246. <el-row :gutter="10">
  247. <!-- 宾州筛分析 -->
  248. <el-col :span="12">
  249. <h4 style="text-align:center;">宾州筛分析</h4>
  250. <el-table
  251. :key="tab2.table.tableKey"
  252. v-loading="tab2.table.listLoading"
  253. element-loading-text="给我一点时间"
  254. :data="tab2.table.list"
  255. border
  256. fit
  257. highlight-current-row
  258. style="width: 100%;"
  259. :row-style="rowStyle"
  260. :cell-style="cellStyle"
  261. class="elTable table-fixed"
  262. height="400px"
  263. >
  264. <el-table-column label="宾州筛" min-width="110px" align="center" prop="宾州筛" />
  265. <el-table-column label="第一层重量" min-width="110px" align="center" prop="oneweight" />
  266. <el-table-column label="第一层百分比" min-width="110px" align="center" prop="onerate" />
  267. <el-table-column label="第二层重量" min-width="110px" align="center" prop="twoweight" />
  268. <el-table-column label="第二层百分比" min-width="110px" align="center" prop="tworate" />
  269. <el-table-column label="第三层重量" min-width="110px" align="center" prop="threeweight" />
  270. <el-table-column label="第三层百分比" min-width="110px" align="center" prop="threerate" />
  271. <el-table-column label="第四层重量" min-width="110px" align="center" prop="fourweight" />
  272. <el-table-column label="第四层百分比" min-width="110px" align="center" prop="fourrate" />
  273. <el-table-column label="参考标准" min-width="110px" align="center" prop="standard" />
  274. </el-table>
  275. </el-col>
  276. <!-- 粪便筛分析 -->
  277. <el-col :span="12">
  278. <h4 style="text-align:center;">粪便筛分析</h4>
  279. <el-table
  280. :key="tab2.table2.tableKey"
  281. v-loading="tab2.table2.listLoading"
  282. element-loading-text="给我一点时间"
  283. :data="tab2.table2.list"
  284. border
  285. fit
  286. highlight-current-row
  287. style="width: 100%;"
  288. :row-style="rowStyle"
  289. :cell-style="cellStyle"
  290. class="elTable table-fixed"
  291. height="400px"
  292. >
  293. <el-table-column label="粪便筛" min-width="150px" align="center" prop="barname" />
  294. <el-table-column label="第一层重量" min-width="110px" align="center" prop="oneweight" />
  295. <el-table-column label="第一层百分比" min-width="110px" align="center" prop="onerate" />
  296. <el-table-column label="第二层重量" min-width="110px" align="center" prop="twoweight" />
  297. <el-table-column label="第二层百分比" min-width="110px" align="center" prop="tworate" />
  298. <el-table-column label="第三层重量" min-width="110px" align="center" prop="threeweight" />
  299. <el-table-column label="第三层百分比" min-width="110px" align="center" prop="threerate" />
  300. <el-table-column label="参考标准" min-width="110px" align="center" prop="standard" />
  301. </el-table>
  302. </el-col>
  303. </el-row>
  304. <el-row :gutter="10">
  305. <!-- BCS评分 -->
  306. <el-col :span="12">
  307. <h4 style="text-align:center;">BCS评分</h4>
  308. <el-table
  309. :key="tab2.table3.tableKey"
  310. v-loading="tab2.table3.listLoading"
  311. element-loading-text="给我一点时间"
  312. :data="tab2.table3.list"
  313. border
  314. fit
  315. highlight-current-row
  316. style="width: 100%;"
  317. :row-style="rowStyle"
  318. :cell-style="cellStyle"
  319. class="elTable table-fixed"
  320. height="400px"
  321. >
  322. <el-table-column label="栏舍" min-width="110px" align="center" prop="barname" />
  323. <el-table-column label="抽查样本数" min-width="110px" align="center" prop="sumcowcount" />
  324. <el-table-column label="单产" min-width="110px" align="center" prop="product" />
  325. <el-table-column label="干物质采食量" min-width="110px" align="center" prop="dryweight" />
  326. <el-table-column label="泌乳天数" min-width="110px" align="center" prop="avgdim" />
  327. <el-table-column label="标准分数" min-width="110px" align="center" prop="standardscore" />
  328. <el-table-column label="2.75-分(数量、百分比)" min-width="110px" align="center" prop="score25" />
  329. <el-table-column label="2.75分(数量、百分比" min-width="110px" align="center" prop="score275" />
  330. <el-table-column label="3分(数量、百分比)" min-width="110px" align="center" prop="score3" />
  331. <el-table-column label="3.25分(数量、百分比)" min-width="110px" align="center" prop="score325" />
  332. <el-table-column label="3.5分(数量、百分比)" min-width="110px" align="center" prop="score35" />
  333. <el-table-column label="3.75分(数量、百分比)" min-width="110px" align="center" prop="score375" />
  334. <el-table-column label="4+分(数量、百分比)" min-width="110px" align="center" prop="score4" />
  335. </el-table>
  336. </el-col>
  337. <!-- 粪便评分 -->
  338. <el-col :span="12">
  339. <h4 style="text-align:center;">粪便评分</h4>
  340. <el-table
  341. :key="tab2.table4.tableKey"
  342. v-loading="tab2.table4.listLoading"
  343. element-loading-text="给我一点时间"
  344. :data="tab2.table4.list"
  345. border
  346. fit
  347. highlight-current-row
  348. style="width: 100%;"
  349. :row-style="rowStyle"
  350. :cell-style="cellStyle"
  351. class="elTable table-fixed"
  352. height="400px"
  353. >
  354. <el-table-column label="栏舍" min-width="110px" align="center" prop="barname" />
  355. <el-table-column label="抽查样本数" min-width="110px" align="center" prop="sumcowcount" />
  356. <el-table-column label="单产" min-width="110px" align="center" prop="product" />
  357. <el-table-column label="干物质采食量" min-width="110px" align="center" prop="dryweight" />
  358. <el-table-column label="泌乳天数" min-width="110px" align="center" prop="avgdim" />
  359. <el-table-column label="标准分数" min-width="110px" align="center" prop="standardscore" />
  360. <el-table-column label="1分(数量、百分比)" min-width="110px" align="center" prop="score1" />
  361. <el-table-column label="2分(数量、百分比)" min-width="110px" align="center" prop="score2" />
  362. <el-table-column label="3分(数量、百分比)" min-width="110px" align="center" prop="score3" />
  363. <el-table-column label="4分(数量、百分比)" min-width="110px" align="center" prop="score4" />
  364. <el-table-column label="5分(数量、百分比)" min-width="110px" align="center" prop="score5" />
  365. </el-table>
  366. </el-col>
  367. </el-row>
  368. </div>
  369. </el-tab-pane>
  370. </el-tabs>
  371. </div>
  372. </template>
  373. <script>
  374. import echarts from 'echarts'
  375. require('echarts/theme/macarons')
  376. import { GetDataByName, GetReportform } from '@/api/common'
  377. import Cookies from 'js-cookie'
  378. import { parseTime } from '@/utils/index.js'
  379. import Pagination from '@/components/Pagination'
  380. import { json2excel } from '@/utils/index.js'
  381. import { MessageBox } from 'element-ui'
  382. export default {
  383. name: 'ErrorAnalysis',
  384. components: { Pagination },
  385. data() {
  386. return {
  387. activeName: 'first',
  388. tab: {
  389. radio: '1',
  390. isFormulaName: true, // 配方名称
  391. isHouseName: false, // 栏舍名称
  392. isLivestockType: false, // 牲畜类别
  393. chartDate: [],
  394. table: {
  395. getdataListParm: {
  396. name: 'getFeedEfficiencyFT',
  397. page: 1,
  398. offset: 1,
  399. pagecount: '',
  400. returntype: 'Map',
  401. parammaps: {
  402. pastureid: Cookies.get('pastureid'),
  403. date: parseTime(new Date(), '{y}-{m}-{d}'),
  404. ftname: '',
  405. barname: '',
  406. cowclass: ''
  407. }
  408. },
  409. tableKey: 1,
  410. list: [],
  411. total: 0,
  412. listLoading: true,
  413. temp: {}
  414. },
  415. chart1: {
  416. chartLine: null,
  417. chartLine_data: {},
  418. getdataListParm: {
  419. name: 'getFeedEffMR',
  420. page: 1,
  421. offset: 1,
  422. pagecount: '',
  423. returntype: 'Map',
  424. parammaps: {
  425. pastureid: Cookies.get('pastureid'),
  426. startTime: parseTime(new Date(), '{y}-{m}-{d}'),
  427. stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
  428. inputDatetime: [new Date(), new Date()]
  429. }
  430. },
  431. tableKey: 1,
  432. list: [],
  433. total: 0,
  434. listLoading: true,
  435. isChart: true,
  436. isTable: false,
  437. table: {
  438. tableKey: 1,
  439. list: [],
  440. total: 0,
  441. listLoading: false
  442. }
  443. },
  444. chart2: {
  445. chartLine: null,
  446. chartLine_data: {},
  447. getdataListParm: {
  448. name: 'getFeedEffSL',
  449. page: 1,
  450. offset: 1,
  451. pagecount: '',
  452. returntype: 'Map',
  453. parammaps: {
  454. pastureid: Cookies.get('pastureid'),
  455. startTime: parseTime(new Date(), '{y}-{m}-{d}'),
  456. stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
  457. inputDatetime: [new Date(), new Date()]
  458. }
  459. },
  460. tableKey: 1,
  461. list: [],
  462. total: 0,
  463. listLoading: true,
  464. statisticsList: [],
  465. chart2Data3: [],
  466. isChart: true,
  467. isTable: false,
  468. table: {
  469. tableKey: 1,
  470. list: [],
  471. total: 0,
  472. listLoading: false
  473. }
  474. },
  475. chart3: {
  476. chartLine: null,
  477. chartLine_data: {},
  478. getdataListParm: {
  479. name: 'getFeedEffHL',
  480. page: 1,
  481. offset: 1,
  482. pagecount: '',
  483. returntype: 'Map',
  484. parammaps: {
  485. pastureid: Cookies.get('pastureid'),
  486. startTime: parseTime(new Date(), '{y}-{m}-{d}'),
  487. stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
  488. inputDatetime: [new Date(), new Date()]
  489. }
  490. },
  491. tableKey: 1,
  492. list: [],
  493. total: 0,
  494. listLoading: true,
  495. isChart: true,
  496. isTable: false,
  497. table: {
  498. tableKey: 1,
  499. list: [],
  500. total: 0,
  501. listLoading: false
  502. }
  503. },
  504. chart4: {
  505. chartLine: null,
  506. chartLine_data: {},
  507. getdataListParm: {
  508. name: 'getFeedEffZH',
  509. page: 1,
  510. offset: 1,
  511. pagecount: '',
  512. returntype: 'Map',
  513. parammaps: {
  514. pastureid: Cookies.get('pastureid'),
  515. startTime: parseTime(new Date(), '{y}-{m}-{d}'),
  516. stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
  517. inputDatetime: [new Date(), new Date()]
  518. }
  519. },
  520. tableKey: 1,
  521. list: [],
  522. total: 0,
  523. listLoading: true,
  524. statisticsList: [],
  525. chart4Data3: [],
  526. isChart: true,
  527. isTable: false,
  528. table: {
  529. tableKey: 1,
  530. list: [],
  531. total: 0,
  532. listLoading: false
  533. }
  534. },
  535. chart5: {
  536. chartLine: null,
  537. chartLine_data: {},
  538. getdataListParm: {
  539. name: 'getFeedEffCB',
  540. page: 1,
  541. offset: 1,
  542. pagecount: '',
  543. returntype: 'Map',
  544. parammaps: {
  545. pastureid: Cookies.get('pastureid'),
  546. startTime: parseTime(new Date(), '{y}-{m}-{d}'),
  547. stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
  548. inputDatetime: [new Date(), new Date()]
  549. }
  550. },
  551. tableKey: 1,
  552. list: [],
  553. total: 0,
  554. listLoading: true,
  555. statisticsList: [],
  556. chart5Data3: [],
  557. isChart: true,
  558. isTable: false,
  559. table: {
  560. tableKey: 1,
  561. list: [],
  562. total: 0,
  563. listLoading: false
  564. }
  565. }
  566. },
  567. tab2: {
  568. table: {
  569. getdataListParm: {
  570. name: 'getAssessCowPenn',
  571. page: 1,
  572. offset: 1,
  573. pagecount: '',
  574. returntype: 'Map',
  575. parammaps: {
  576. pastureid: Cookies.get('pastureid'),
  577. date: parseTime(new Date(), '{y}-{m}-{d}')
  578. }
  579. },
  580. tableKey: 1,
  581. list: [],
  582. total: 0,
  583. listLoading: true,
  584. temp: {}
  585. },
  586. table2: {
  587. getdataListParm: {
  588. name: 'getAssessCowDung',
  589. page: 1,
  590. offset: 1,
  591. pagecount: '',
  592. returntype: 'Map',
  593. parammaps: {
  594. pastureid: Cookies.get('pastureid'),
  595. date: ''
  596. }
  597. },
  598. tableKey: 1,
  599. list: [],
  600. total: 0,
  601. listLoading: true,
  602. temp: {}
  603. },
  604. table3: {
  605. getdataListParm: {
  606. name: 'getAssessBodyscore',
  607. page: 1,
  608. offset: 1,
  609. pagecount: '',
  610. returntype: 'Map',
  611. parammaps: {
  612. pastureid: Cookies.get('pastureid'),
  613. date: ''
  614. }
  615. },
  616. tableKey: 1,
  617. list: [],
  618. total: 0,
  619. listLoading: true,
  620. temp: {}
  621. },
  622. table4: {
  623. getdataListParm: {
  624. name: 'getAssessDungscore',
  625. page: 1,
  626. offset: 1,
  627. pagecount: '',
  628. returntype: 'Map',
  629. parammaps: {
  630. pastureid: Cookies.get('pastureid'),
  631. date: ''
  632. }
  633. },
  634. tableKey: 1,
  635. list: [],
  636. total: 0,
  637. listLoading: true,
  638. temp: {}
  639. }
  640. },
  641. rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
  642. cellStyle: { padding: 0 + 'px' }
  643. }
  644. },
  645. created() {
  646. this.getTabList()
  647. this.getTimeFn()
  648. this.getChart1()
  649. this.getChart2()
  650. this.getChart3()
  651. this.getChart4()
  652. this.getChart5()
  653. },
  654. mounted() {
  655. },
  656. methods: {
  657. getTimeFn() {
  658. const that = this
  659. const end = new Date()
  660. const start = new Date()
  661. start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
  662. that.tab.chartDate[0] = parseTime(start, '{y}-{m}-{d}')
  663. that.tab.chartDate[1] = parseTime(end, '{y}-{m}-{d}')
  664. that.tab.chart1.getdataListParm.parammaps.inputDatetime[0] = parseTime(start, '{y}-{m}-{d}')
  665. that.tab.chart1.getdataListParm.parammaps.inputDatetime[1] = parseTime(end, '{y}-{m}-{d}')
  666. that.tab.chart1.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
  667. that.tab.chart1.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')
  668. that.tab.chart2.getdataListParm.parammaps.inputDatetime[0] = parseTime(start, '{y}-{m}-{d}')
  669. that.tab.chart2.getdataListParm.parammaps.inputDatetime[1] = parseTime(end, '{y}-{m}-{d}')
  670. that.tab.chart2.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
  671. that.tab.chart2.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')
  672. that.tab.chart3.getdataListParm.parammaps.inputDatetime[0] = parseTime(start, '{y}-{m}-{d}')
  673. that.tab.chart3.getdataListParm.parammaps.inputDatetime[1] = parseTime(end, '{y}-{m}-{d}')
  674. that.tab.chart3.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
  675. that.tab.chart3.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')
  676. that.tab.chart4.getdataListParm.parammaps.inputDatetime[0] = parseTime(start, '{y}-{m}-{d}')
  677. that.tab.chart4.getdataListParm.parammaps.inputDatetime[1] = parseTime(end, '{y}-{m}-{d}')
  678. that.tab.chart4.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
  679. that.tab.chart4.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')
  680. that.tab.chart5.getdataListParm.parammaps.inputDatetime[0] = parseTime(start, '{y}-{m}-{d}')
  681. that.tab.chart5.getdataListParm.parammaps.inputDatetime[1] = parseTime(end, '{y}-{m}-{d}')
  682. that.tab.chart5.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
  683. that.tab.chart5.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')
  684. },
  685. // 导出
  686. handleDownload() {
  687. if (this.tab.radio == '1') {
  688. var excelDatas = [
  689. {
  690. tHeader: ['配方模板', '实际牛头数', '应混料量(kg)', '实际混料量(kg)', '撒料量(kg)', '混料时间(min)', '转投剩料量(kg)', '今日剩料量(kg)', '剩料率(%)', 'TMR干物质(%)', '配方干物质采食量(kg/头)', '实际干物质采食量(kg/头)', '采食率(%)', '配方成本(元/头 )', '实际成本(元/ 头)', '产奶量(kg /头)', '饲料转化率', '公斤奶饲料成本'],
  691. filterVal: ['配方模板', '实际牛头数', '应混料量', '实际混料量', '撒料量', '混料时间', '转投剩料量', '今日剩料量', '剩料率', 'TMR干物质', '配方干物质采食量', '实际干物质采食量', '采食率', '配方成本', '实际成本', '产奶量', '饲料转化率', '公斤奶饲料成本'],
  692. tableDatas: this.tab.table.list,
  693. sheetName: '配方'
  694. }
  695. ]
  696. json2excel(excelDatas, '效率统计-配方', true, 'xlsx')
  697. } else if (this.tab.radio == '2') {
  698. var excelDatas2 = [
  699. {
  700. tHeader: ['栏舍', '配方模板', '实际牛头数', '应混料量(kg)', '实际混料量(kg)', '撒料量(kg)', '混料时间(min)', '转投剩料量(kg)', '今日剩料量(kg)', '剩料率(%)', 'TMR干物质(%)', '配方干物质采食量(kg/头)', ' 实际干物质采食量( kg/头)', '采食率 (%)', '配方成本( 元/头)', '实际成本 (元/头)', '产奶量(kg/头)', '饲料转化率', '公斤奶饲料成本'],
  701. filterVal: ['栏舍', '配方模板', '实际牛头数', '应混料量', '实际混料量', '撒料量', '混料时间', '转投剩料量', '今日剩料量', '剩料率', 'TMR干物质', '配方干物质采食量', '实际干物质采食量', '采食率', '配方成本', '实际成本', '产奶量', '饲料转化率', '公斤奶饲料成本'],
  702. tableDatas: this.tab.table.list,
  703. sheetName: '栏舍'
  704. }
  705. ]
  706. json2excel(excelDatas2, '效率统计-栏舍', true, 'xlsx')
  707. } else if (this.tab.radio == '3') {
  708. var excelDatas3 = [
  709. {
  710. tHeader: ['牲畜类别', '实际牛头数', '应混料量(kg)', '实际混料量(kg)', '撒料量(kg)', '混料时间(min)', '转投剩料量(kg)', '今日剩料量(kg)', '剩料率(%)', 'TMR干物质(%)', '配方 物质采食量(kg/ 头)', '实际干物质采 食量(kg/头)', ' 采食率(%)', '配方 成本(元/头)', '实际成本(元/头)', '产奶量(kg/头)', '饲料转化率', '公斤奶饲料成本'],
  711. filterVal: ['牲畜类别', '实际牛头数', '应混料量', '实际混料量', '撒料量', '混料时间', '转投剩料量', '今日剩料量', '剩料率', 'TMR干物质', '配方干物质采食量', '实际干物质采食量', ' 采食率', '配方成本', '实际成本', '产奶量', '饲料转化率', '公斤奶饲料成本'],
  712. tableDatas: this.tab.table.list,
  713. sheetName: '牲畜类别'
  714. }
  715. ]
  716. json2excel(excelDatas3, '效率统计-牲畜类别', true, 'xlsx')
  717. }
  718. },
  719. // Tab切换
  720. handleTabClick() {
  721. if (this.activeName == 'first') {
  722. this.getTabList()
  723. this.getChart1()
  724. this.getChart2()
  725. this.getChart3()
  726. this.getChart4()
  727. this.getChart5()
  728. } else if (this.activeName == 'second') {
  729. this.getTab2List()
  730. this.getTab2List2()
  731. this.getTab2List3()
  732. this.getTab2List4()
  733. }
  734. },
  735. // 切换统计类型
  736. changeRadio() {
  737. console.log(this.tab.radio)
  738. if (this.tab.radio == '1') {
  739. console.log('配方名称')
  740. this.tab.isFormulaName = true
  741. this.tab.isHouseName = false
  742. this.tab.isLivestockType = false
  743. this.tab.table.getdataListParm.parammaps.ftname = ''
  744. this.tab.table.getdataListParm.parammaps.barname = ''
  745. this.tab.table.getdataListParm.parammaps.ftname = ''
  746. this.tab.table.getdataListParm.parammaps.cowclass = ''
  747. this.tab.table.getdataListParm.name = 'getFeedEfficiencyFT'
  748. this.getTabList()
  749. } else if (this.tab.radio == '2') {
  750. console.log('栏舍名称')
  751. this.tab.isFormulaName = false
  752. this.tab.isHouseName = true
  753. this.tab.isLivestockType = false
  754. this.tab.table.getdataListParm.parammaps.ftname = ''
  755. this.tab.table.getdataListParm.parammaps.barname = ''
  756. this.tab.table.getdataListParm.parammaps.ftname = ''
  757. this.tab.table.getdataListParm.parammaps.cowclass = ''
  758. this.tab.table.getdataListParm.name = 'getFeedEfficiencyLS'
  759. this.getTabList()
  760. } else if (this.tab.radio == '3') {
  761. console.log(' 牲畜类别')
  762. this.tab.isFormulaName = false
  763. this.tab.isHouseName = false
  764. this.tab.isLivestockType = true
  765. this.tab.table.getdataListParm.parammaps.ftname = ''
  766. this.tab.table.getdataListParm.parammaps.barname = ''
  767. this.tab.table.getdataListParm.parammaps.ftname = ''
  768. this.tab.table.getdataListParm.parammaps.cowclass = ''
  769. this.tab.table.getdataListParm.name = 'getFeedEfficiencySC'
  770. this.getTabList()
  771. }
  772. },
  773. // 效率统计
  774. getTabList() {
  775. this.tab.table.listLoading = true
  776. GetDataByName(this.tab.table.getdataListParm).then(response => {
  777. console.log('汇总统计/混料table数据', response.data.list)
  778. if (response.data.list !== null) {
  779. this.tab.table.list = response.data.list
  780. this.tab.table.total = response.data.total
  781. } else {
  782. this.tab.table.list = []
  783. }
  784. setTimeout(() => {
  785. this.tab.table.listLoading = false
  786. }, 100)
  787. })
  788. },
  789. // 查询
  790. handleSearch() {
  791. if (this.tab.radio == '1') {
  792. console.log('配方名称/查询')
  793. this.tab.isFormulaName = true
  794. this.tab.isHouseName = false
  795. this.tab.isLivestockType = false
  796. this.tab.table.getdataListParm.name = 'getFeedEfficiencyFT'
  797. this.getTabList()
  798. } else if (this.tab.radio == '2') {
  799. console.log('栏舍名称/查询')
  800. this.tab.isFormulaName = false
  801. this.tab.isHouseName = true
  802. this.tab.isLivestockType = false
  803. this.tab.table.getdataListParm.name = 'getFeedEfficiencyLS'
  804. this.getTabList()
  805. } else if (this.tab.radio == '3') {
  806. console.log(' 牲畜类别/查询')
  807. this.tab.isFormulaName = false
  808. this.tab.isHouseName = false
  809. this.tab.isLivestockType = true
  810. this.tab.table.getdataListParm.name = 'getFeedEfficiencySC'
  811. this.getTabList()
  812. }
  813. },
  814. // 图表总查询
  815. handleChartDate() {
  816. console.log('点击了确认时间')
  817. MessageBox.confirm('是否调整以下所有图表查询时间?', {
  818. confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
  819. }).then(() => {
  820. var that = this
  821. var startTime = parseTime(this.tab.chartDate[0], '{y}-{m}-{d}')
  822. var stopTime = parseTime(this.tab.chartDate[1], '{y}-{m}-{d}')
  823. that.tab.chart1.getdataListParm.parammaps.inputDatetime = this.tab.chartDate
  824. that.tab.chart1.getdataListParm.parammaps.startTime = startTime
  825. that.tab.chart1.getdataListParm.parammaps.stopTime = stopTime
  826. that.getChart1()
  827. that.tab.chart2.getdataListParm.parammaps.inputDatetime = this.tab.chartDate
  828. that.tab.chart2.getdataListParm.parammaps.startTime = startTime
  829. that.tab.chart2.getdataListParm.parammaps.stopTime = stopTime
  830. that.getChart2()
  831. that.tab.chart3.getdataListParm.parammaps.inputDatetime = this.tab.chartDate
  832. that.tab.chart3.getdataListParm.parammaps.startTime = startTime
  833. that.tab.chart3.getdataListParm.parammaps.stopTime = stopTime
  834. that.getChart3()
  835. that.tab.chart4.getdataListParm.parammaps.inputDatetime = this.tab.chartDate
  836. that.tab.chart4.getdataListParm.parammaps.startTime = startTime
  837. that.tab.chart4.getdataListParm.parammaps.stopTime = stopTime
  838. that.getChart4()
  839. that.tab.chart5.getdataListParm.parammaps.inputDatetime = this.tab.chartDate
  840. that.tab.chart5.getdataListParm.parammaps.startTime = startTime
  841. that.tab.chart5.getdataListParm.parammaps.stopTime = stopTime
  842. that.getChart5()
  843. })
  844. },
  845. // 泌乳牛采食量
  846. getChart1() {
  847. this.tab.chart1.listLoading = true
  848. GetReportform(this.tab.chart1.getdataListParm).then(response => {
  849. console.log('泌乳牛采食量图表数据', response.data.list)
  850. if (response.data.list !== null) {
  851. this.tab.chart1.table.list = response.data.data
  852. this.tab.chart1.chartLine_data = response.data.list
  853. // this.tab.chart1.total = response.data.total
  854. this.roadChartLine1(this.tab.chart1.chartLine_data)
  855. } else {
  856. this.tab.chart1.list = []
  857. }
  858. setTimeout(() => {
  859. this.tab.chart1.listLoading = false
  860. }, 100)
  861. })
  862. },
  863. roadChartLine1(chartLine_data) {
  864. if (this.tab.chart1.chartLine != null) {
  865. this.tab.chart1.chartLine.dispose()
  866. }
  867. this.tab.chart1.chartLine = echarts.init(document.getElementById('chartLine1'))
  868. var option = {
  869. tooltip: {
  870. trigger: 'axis'
  871. },
  872. legend: {
  873. data: ['泌乳牛采食量', '泌乳牛产奶量'],
  874. right: 10
  875. },
  876. grid: {
  877. top: '20%',
  878. left: '5%',
  879. right: '8%',
  880. containLabel: true
  881. },
  882. xAxis: [
  883. {
  884. type: 'category',
  885. data: chartLine_data.data1
  886. }
  887. ],
  888. yAxis: [
  889. {
  890. type: 'value',
  891. name: '泌乳牛采食量',
  892. axisLabel: {
  893. formatter: '{value} '
  894. }
  895. }, {
  896. type: 'value',
  897. name: '泌乳牛产奶量',
  898. axisLabel: {
  899. formatter: '{value} '
  900. }
  901. }
  902. ],
  903. series: [{
  904. name: '泌乳牛采食量',
  905. type: 'bar',
  906. itemStyle: { /* 设置柱状颜色*/
  907. normal: {
  908. color: '#61a5e8'
  909. }
  910. },
  911. data: chartLine_data.data2
  912. }, {
  913. name: '泌乳牛产奶量',
  914. type: 'line',
  915. itemStyle: { /* 设置折线颜色*/
  916. normal: {
  917. color: '#ff2d2d'
  918. }
  919. },
  920. yAxisIndex: 1,
  921. data: chartLine_data.data3
  922. }]
  923. }
  924. this.tab.chart1.chartLine.setOption(option)
  925. window.onresize = function() {
  926. this.tab.chart1.chartLine.resize()
  927. }
  928. },
  929. // 牛栏剩料率
  930. changeStatisticChart2() {
  931. var arrData3 = []
  932. for (let i = 0; i < this.tab.chart2.getdataListParm.parammaps.statisticsList.length; i++) {
  933. const myId = this.tab.chart2.statisticsList.find(obj => obj.name == this.tab.chart2.getdataListParm.parammaps.statisticsList[i]).id
  934. for (let j = 0; j < this.tab.chart2.chart2Data3.length; j++) {
  935. if (j == myId) {
  936. arrData3.push(this.tab.chart2.chart2Data3[j])
  937. }
  938. }
  939. }
  940. this.tab.chart2.chartLine_data.data3 = arrData3
  941. this.tab.chart2.chartLine_data.data1 = this.tab.chart2.getdataListParm.parammaps.statisticsList
  942. this.roadChartLine2(this.tab.chart2.chartLine_data)
  943. },
  944. getChart2() {
  945. this.tab.chart2.listLoading = true
  946. GetReportform(this.tab.chart2.getdataListParm).then(response => {
  947. console.log('牛栏剩料率图表数据', response.data.list)
  948. if (response.data.list !== null) {
  949. for (let i = 0; i < response.data.data.length; i++) {
  950. if (response.data.data[i].准确率 !== undefined) {
  951. response.data.data[i].准确率 = response.data.data[i].准确率 + '%'
  952. }
  953. }
  954. this.tab.chart2.table.list = response.data.data
  955. this.tab.chart2.chartLine_data = response.data.list
  956. this.tab.chart2.total = response.data.total
  957. this.tab.chart2.statisticsList = []
  958. this.tab.chart2.getdataListParm.parammaps.statisticsList = []
  959. for (let i = 0; i < response.data.list.data1.length; i++) {
  960. if (i < 10) {
  961. this.tab.chart2.getdataListParm.parammaps.statisticsList.push(response.data.list.data1[i])
  962. }
  963. var obj = {}
  964. obj.id = i
  965. obj.name = response.data.list.data1[i]
  966. this.tab.chart2.statisticsList.push(obj)
  967. }
  968. this.tab.chart2.chart2Data3 = response.data.list.data3
  969. this.tab.chart2.total = response.data.total
  970. console.log('牛栏剩料率图数据', this.tab.chart2.chartLine_data)
  971. console.log('牛栏剩料率表数据', this.tab.chart2.table.list)
  972. var arrData3 = []
  973. for (let i = 0; i < this.tab.chart2.getdataListParm.parammaps.statisticsList.length; i++) {
  974. const myId = this.tab.chart2.statisticsList.find(obj => obj.name == this.tab.chart2.getdataListParm.parammaps.statisticsList[i]).id
  975. for (let j = 0; j < this.tab.chart2.chart2Data3.length; j++) {
  976. if (j == myId) {
  977. arrData3.push(this.tab.chart2.chart2Data3[j])
  978. }
  979. }
  980. }
  981. this.tab.chart2.chartLine_data.data3 = arrData3
  982. this.tab.chart2.chartLine_data.data1 = this.tab.chart2.getdataListParm.parammaps.statisticsList
  983. this.roadChartLine2(this.tab.chart2.chartLine_data)
  984. } else {
  985. this.tab.chart2.list = []
  986. }
  987. setTimeout(() => {
  988. this.tab.chart2.listLoading = false
  989. }, 100)
  990. })
  991. },
  992. roadChartLine2(chartLine_data) {
  993. if (this.tab.chart2.chartLine != null) {
  994. this.tab.chart2.chartLine.dispose()
  995. }
  996. this.tab.chart2.chartLine = echarts.init(document.getElementById('chartLine2'))
  997. var option = {
  998. title: {
  999. text: ''
  1000. },
  1001. tooltip: {
  1002. trigger: 'axis'
  1003. },
  1004. legend: {
  1005. data: chartLine_data.data1,
  1006. right: 10
  1007. },
  1008. grid: {
  1009. top: '20%',
  1010. left: '5%',
  1011. right: '8%',
  1012. containLabel: true
  1013. },
  1014. toolbox: {
  1015. show: true,
  1016. right: '2%',
  1017. feature: {}
  1018. },
  1019. xAxis: { type: 'category', boundaryGap: false, data: chartLine_data.data2, name: '日期' },
  1020. yAxis: {
  1021. type: 'value', name: '剩料率'
  1022. },
  1023. series: (function() {
  1024. var serie = []
  1025. for (var i = 0; i < chartLine_data.data3.length; i++) {
  1026. var item = {
  1027. name: chartLine_data.data1[i],
  1028. type: 'line',
  1029. data: chartLine_data.data3[i].data
  1030. }
  1031. serie.push(item)
  1032. }
  1033. return serie
  1034. }())
  1035. }
  1036. this.tab.chart2.chartLine.setOption(option)
  1037. window.onresize = function() {
  1038. this.tab.chart2.chartLine.resize()
  1039. }
  1040. },
  1041. // 混料时间统计
  1042. getChart3() {
  1043. this.tab.chart3.listLoading = true
  1044. GetReportform(this.tab.chart3.getdataListParm).then(response => {
  1045. console.log('混料时间统计图表数据', response.data.list)
  1046. if (response.data.list !== null) {
  1047. this.tab.chart3.table.list = response.data.data
  1048. this.tab.chart3.chartLine_data = response.data.list
  1049. this.tab.chart3.total = response.data.total
  1050. // this.tab.chart3.chartLine_data = {
  1051. // data1: ['平均搅拌时间', '混料+搅拌时间'],
  1052. // data2: ['09/16', '09/17', '09/18', '09/19', '09/20', '09/21', '09/22', '09/23', '09/24', '09/25', '09/26', '09/27', '09/28', '09/29', '09/30'],
  1053. // data3: [12, 13, 10.5, 10.4, 12.9, 13.3, 11.1, 11.5, 10.8, 12.5, 11.8, 12.9, 12.3, 12.1, 11.9],
  1054. // data4: [33.5, 33.2, 34.1, 35.4, 35.9, 36.4, 34.1, 34.2, 33.9, 35.5, 34.7, 35.9, 35.2, 34.8, 34.1]
  1055. // }
  1056. this.tab.chart3.total = response.data.total
  1057. this.roadChartLine3(this.tab.chart3.chartLine_data)
  1058. } else {
  1059. this.tab.chart3.list = []
  1060. }
  1061. setTimeout(() => {
  1062. this.tab.chart3.listLoading = false
  1063. }, 100)
  1064. })
  1065. },
  1066. roadChartLine3(chartLine_data) {
  1067. if (this.tab.chart3.chartLine != null) {
  1068. this.tab.chart3.chartLine.dispose()
  1069. }
  1070. this.tab.chart3.chartLine = echarts.init(document.getElementById('chartLine3'))
  1071. var option = {
  1072. title: {
  1073. text: ''
  1074. },
  1075. tooltip: {
  1076. trigger: 'axis'
  1077. },
  1078. legend: {
  1079. data: ['混料时间'],
  1080. right: 10
  1081. },
  1082. grid: {
  1083. top: '20%',
  1084. left: '5%',
  1085. right: '8%',
  1086. containLabel: true
  1087. },
  1088. toolbox: {
  1089. show: true,
  1090. right: '2%',
  1091. feature: {}
  1092. },
  1093. xAxis: { type: 'category', boundaryGap: false, data: chartLine_data.data1, name: '日期' },
  1094. yAxis: {
  1095. type: 'value', name: '分钟',
  1096. axisLabel: {
  1097. formatter: '{value}min'
  1098. }
  1099. },
  1100. series: [
  1101. {
  1102. name: '混料时间',
  1103. type: 'line',
  1104. stack: '总量',
  1105. data: chartLine_data.data2
  1106. }
  1107. ]
  1108. }
  1109. this.tab.chart3.chartLine.setOption(option)
  1110. window.onresize = function() {
  1111. this.tab.chart3.chartLine.resize()
  1112. }
  1113. },
  1114. // 转化率
  1115. changeStatisticChart4() {
  1116. var arrData3 = []
  1117. for (let i = 0; i < this.tab.chart4.getdataListParm.parammaps.statisticsList.length; i++) {
  1118. const myId = this.tab.chart4.statisticsList.find(obj => obj.name == this.tab.chart4.getdataListParm.parammaps.statisticsList[i]).id
  1119. for (let j = 0; j < this.tab.chart4.chart4Data3.length; j++) {
  1120. if (j == myId) {
  1121. arrData3.push(this.tab.chart4.chart4Data3[j])
  1122. }
  1123. }
  1124. }
  1125. this.tab.chart4.chartLine_data.data3 = arrData3
  1126. this.tab.chart4.chartLine_data.data1 = this.tab.chart4.getdataListParm.parammaps.statisticsList
  1127. this.roadChartLine4(this.tab.chart4.chartLine_data)
  1128. },
  1129. getChart4() {
  1130. this.tab.chart4.listLoading = true
  1131. GetReportform(this.tab.chart4.getdataListParm).then(response => {
  1132. console.log('转化率图表数据', response.data.list)
  1133. if (response.data.list !== null) {
  1134. this.tab.chart4.table.list = response.data.data
  1135. this.tab.chart4.chartLine_data = response.data.list
  1136. this.tab.chart4.total = response.data.total
  1137. this.tab.chart4.statisticsList = []
  1138. this.tab.chart4.getdataListParm.parammaps.statisticsList = []
  1139. for (let i = 0; i < response.data.list.data1.length; i++) {
  1140. if (i < 10) {
  1141. this.tab.chart4.getdataListParm.parammaps.statisticsList.push(response.data.list.data1[i])
  1142. }
  1143. var obj = {}
  1144. obj.id = i
  1145. obj.name = response.data.list.data1[i]
  1146. this.tab.chart4.statisticsList.push(obj)
  1147. }
  1148. this.tab.chart4.chart4Data3 = response.data.list.data3
  1149. this.tab.chart4.total = response.data.total
  1150. console.log('转化率图数据', this.tab.chart4.chartLine_data)
  1151. console.log('转化率表数据', this.tab.chart4.table.list)
  1152. var arrData3 = []
  1153. for (let i = 0; i < this.tab.chart4.getdataListParm.parammaps.statisticsList.length; i++) {
  1154. const myId = this.tab.chart4.statisticsList.find(obj => obj.name == this.tab.chart4.getdataListParm.parammaps.statisticsList[i]).id
  1155. for (let j = 0; j < this.tab.chart4.chart4Data3.length; j++) {
  1156. if (j == myId) {
  1157. arrData3.push(this.tab.chart4.chart4Data3[j])
  1158. }
  1159. }
  1160. }
  1161. this.tab.chart4.chartLine_data.data3 = arrData3
  1162. this.tab.chart4.chartLine_data.data1 = this.tab.chart4.getdataListParm.parammaps.statisticsList
  1163. this.roadChartLine4(this.tab.chart4.chartLine_data)
  1164. } else {
  1165. this.tab.chart4.list = []
  1166. }
  1167. setTimeout(() => {
  1168. this.tab.chart4.listLoading = false
  1169. }, 100)
  1170. })
  1171. },
  1172. roadChartLine4(chartLine_data) {
  1173. if (this.tab.chart4.chartLine != null) {
  1174. this.tab.chart4.chartLine.dispose()
  1175. }
  1176. this.tab.chart4.chartLine = echarts.init(document.getElementById('chartLine4'))
  1177. var option = {
  1178. title: {
  1179. text: ''
  1180. },
  1181. tooltip: {
  1182. trigger: 'axis'
  1183. },
  1184. legend: {
  1185. data: chartLine_data.data1,
  1186. right: 10
  1187. },
  1188. grid: {
  1189. top: '20%',
  1190. left: '3%',
  1191. right: '8%',
  1192. containLabel: true
  1193. },
  1194. toolbox: {
  1195. show: true,
  1196. right: '2%',
  1197. feature: {}
  1198. },
  1199. xAxis: { type: 'category', boundaryGap: false, data: chartLine_data.data2, name: '日期' },
  1200. yAxis: {
  1201. type: 'value', name: '百分比', axisLabel: { formatter: '{value} %' }
  1202. },
  1203. series: (function() {
  1204. var serie = []
  1205. for (var i = 0; i < chartLine_data.data3.length; i++) {
  1206. var item = {
  1207. name: chartLine_data.data1[i],
  1208. type: 'line',
  1209. data: chartLine_data.data3[i].data
  1210. }
  1211. serie.push(item)
  1212. }
  1213. return serie
  1214. }())
  1215. }
  1216. this.tab.chart4.chartLine.setOption(option)
  1217. window.onresize = function() {
  1218. this.tab.chart4.chartLine.resize()
  1219. }
  1220. },
  1221. // 成本分析
  1222. changeStatisticChart5() {
  1223. var arrData3 = []
  1224. for (let i = 0; i < this.tab.chart5.getdataListParm.parammaps.statisticsList.length; i++) {
  1225. const myId = this.tab.chart5.statisticsList.find(obj => obj.name == this.tab.chart5.getdataListParm.parammaps.statisticsList[i]).id
  1226. for (let j = 0; j < this.tab.chart5.chart5Data3.length; j++) {
  1227. if (j == myId) {
  1228. arrData3.push(this.tab.chart5.chart5Data3[j])
  1229. }
  1230. }
  1231. }
  1232. this.tab.chart5.chartLine_data.data3 = arrData3
  1233. this.tab.chart5.chartLine_data.data1 = this.tab.chart5.getdataListParm.parammaps.statisticsList
  1234. this.roadChartLine5(this.tab.chart5.chartLine_data)
  1235. },
  1236. getChart5() {
  1237. this.tab.chart5.listLoading = true
  1238. GetReportform(this.tab.chart5.getdataListParm).then(response => {
  1239. console.log('转化率图表数据', response.data.list)
  1240. if (response.data.list !== null) {
  1241. this.tab.chart5.table.list = response.data.data
  1242. this.tab.chart5.chartLine_data = response.data.list
  1243. this.tab.chart5.total = response.data.total
  1244. this.tab.chart5.statisticsList = []
  1245. this.tab.chart5.getdataListParm.parammaps.statisticsList = []
  1246. for (let i = 0; i < response.data.list.data1.length; i++) {
  1247. if (i < 10) {
  1248. this.tab.chart5.getdataListParm.parammaps.statisticsList.push(response.data.list.data1[i])
  1249. }
  1250. var obj = {}
  1251. obj.id = i
  1252. obj.name = response.data.list.data1[i]
  1253. this.tab.chart5.statisticsList.push(obj)
  1254. }
  1255. this.tab.chart5.chart5Data3 = response.data.list.data3
  1256. this.tab.chart5.total = response.data.total
  1257. console.log('转化率图数据', this.tab.chart5.chartLine_data)
  1258. console.log('转化率表数据', this.tab.chart5.table.list)
  1259. var arrData3 = []
  1260. for (let i = 0; i < this.tab.chart5.getdataListParm.parammaps.statisticsList.length; i++) {
  1261. const myId = this.tab.chart5.statisticsList.find(obj => obj.name == this.tab.chart5.getdataListParm.parammaps.statisticsList[i]).id
  1262. for (let j = 0; j < this.tab.chart5.chart5Data3.length; j++) {
  1263. if (j == myId) {
  1264. arrData3.push(this.tab.chart5.chart5Data3[j])
  1265. }
  1266. }
  1267. }
  1268. this.tab.chart5.chartLine_data.data3 = arrData3
  1269. this.tab.chart5.chartLine_data.data1 = this.tab.chart5.getdataListParm.parammaps.statisticsList
  1270. this.roadChartLine5(this.tab.chart5.chartLine_data)
  1271. } else {
  1272. this.tab.chart5.list = []
  1273. }
  1274. setTimeout(() => {
  1275. this.tab.chart5.listLoading = false
  1276. }, 100)
  1277. })
  1278. },
  1279. roadChartLine5(chartLine_data) {
  1280. if (this.tab.chart5.chartLine != null) {
  1281. this.tab.chart5.chartLine.dispose()
  1282. }
  1283. this.tab.chart5.chartLine = echarts.init(document.getElementById('chartLine5'))
  1284. var option = {
  1285. title: {
  1286. text: ''
  1287. },
  1288. tooltip: {
  1289. trigger: 'axis'
  1290. },
  1291. legend: {
  1292. data: chartLine_data.data1,
  1293. right: 10
  1294. },
  1295. grid: {
  1296. top: '20%',
  1297. left: '5%',
  1298. right: '8%',
  1299. containLabel: true
  1300. },
  1301. toolbox: {
  1302. show: true,
  1303. right: '2%',
  1304. feature: {}
  1305. },
  1306. xAxis: { type: 'category', boundaryGap: false, data: chartLine_data.data2, name: '日期' },
  1307. yAxis: {
  1308. type: 'value', name: '公斤奶饲料成本(元)'
  1309. },
  1310. series: (function() {
  1311. var serie = []
  1312. for (var i = 0; i < chartLine_data.data3.length; i++) {
  1313. var item = {
  1314. name: chartLine_data.data1[i],
  1315. type: 'line',
  1316. data: chartLine_data.data3[i].data
  1317. }
  1318. serie.push(item)
  1319. }
  1320. return serie
  1321. }())
  1322. }
  1323. this.tab.chart5.chartLine.setOption(option)
  1324. window.onresize = function() {
  1325. this.tab.chart5.chartLine.resize()
  1326. }
  1327. },
  1328. // 时间
  1329. changeChartDate(item) {
  1330. console.log(item)
  1331. if (item == 'chart1') {
  1332. if (this.tab.chart1.getdataListParm.parammaps.inputDatetime !== '' && this.tab.chart1.getdataListParm.parammaps.inputDatetime !== null) {
  1333. this.tab.chart1.getdataListParm.parammaps.startTime = parseTime(this.tab.chart1.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  1334. this.tab.chart1.getdataListParm.parammaps.stopTime = parseTime(this.tab.chart1.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  1335. this.getChart1()
  1336. } else {
  1337. this.tab.chart1.getdataListParm.parammaps.inputDatetime = ''
  1338. this.tab.chart1.getdataListParm.parammaps.startTime = ''
  1339. this.tab.chart1.getdataListParm.parammaps.stopTime = ''
  1340. this.getChart1()
  1341. }
  1342. } else if (item == 'chart2') {
  1343. if (this.tab.chart2.getdataListParm.parammaps.inputDatetime !== '' && this.tab.chart2.getdataListParm.parammaps.inputDatetime !== null) {
  1344. this.tab.chart2.getdataListParm.parammaps.startTime = parseTime(this.tab.chart2.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  1345. this.tab.chart2.getdataListParm.parammaps.stopTime = parseTime(this.tab.chart2.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  1346. this.getChart2()
  1347. } else {
  1348. this.tab.chart2.getdataListParm.parammaps.inputDatetime = ''
  1349. this.tab.chart2.getdataListParm.parammaps.startTime = ''
  1350. this.tab.chart2.getdataListParm.parammaps.stopTime = ''
  1351. this.getChart2()
  1352. }
  1353. } else if (item == 'chart3') {
  1354. if (this.tab.chart3.getdataListParm.parammaps.inputDatetime !== '' && this.tab.chart3.getdataListParm.parammaps.inputDatetime !== null) {
  1355. this.tab.chart3.getdataListParm.parammaps.startTime = parseTime(this.tab.chart3.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  1356. this.tab.chart3.getdataListParm.parammaps.stopTime = parseTime(this.tab.chart3.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  1357. this.getChart3()
  1358. } else {
  1359. this.tab.chart3.getdataListParm.parammaps.inputDatetime = ''
  1360. this.tab.chart3.getdataListParm.parammaps.startTime = ''
  1361. this.tab.chart3.getdataListParm.parammaps.stopTime = ''
  1362. this.getChart3()
  1363. }
  1364. } else if (item == 'chart4') {
  1365. if (this.tab.chart4.getdataListParm.parammaps.inputDatetime !== '' && this.tab.chart4.getdataListParm.parammaps.inputDatetime !== null) {
  1366. this.tab.chart4.getdataListParm.parammaps.startTime = parseTime(this.tab.chart4.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  1367. this.tab.chart4.getdataListParm.parammaps.stopTime = parseTime(this.tab.chart4.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  1368. this.getChart4()
  1369. } else {
  1370. this.tab.chart4.getdataListParm.parammaps.inputDatetime = ''
  1371. this.tab.chart4.getdataListParm.parammaps.startTime = ''
  1372. this.tab.chart4.getdataListParm.parammaps.stopTime = ''
  1373. this.getChart4()
  1374. }
  1375. } else if (item == 'chart5') {
  1376. if (this.tab.chart5.getdataListParm.parammaps.inputDatetime !== '' && this.tab.chart5.getdataListParm.parammaps.inputDatetime !== null) {
  1377. this.tab.chart5.getdataListParm.parammaps.startTime = parseTime(this.tab.chart5.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  1378. this.tab.chart5.getdataListParm.parammaps.stopTime = parseTime(this.tab.chart5.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  1379. this.getChart5()
  1380. } else {
  1381. this.tab.chart5.getdataListParm.parammaps.inputDatetime = ''
  1382. this.tab.chart5.getdataListParm.parammaps.startTime = ''
  1383. this.tab.chart5.getdataListParm.parammaps.stopTime = ''
  1384. this.getChart5()
  1385. }
  1386. }
  1387. },
  1388. // 导出
  1389. handleExport(item) {
  1390. if (item == 'chart1') {
  1391. console.log('泌乳牛采食量导出')
  1392. var excelDatasTabChart1 = [
  1393. {
  1394. tHeader: ['日期', '泌乳牛采食量', '泌乳牛产奶量'],
  1395. filterVal: ['日期', 'field1', 'field2'],
  1396. tableDatas: this.tab.chart1.table.list,
  1397. sheetName: '泌乳牛采食量'
  1398. }
  1399. ]
  1400. json2excel(excelDatasTabChart1, '泌乳牛采食量', true, 'xlsx')
  1401. } else if (item == 'chart2') {
  1402. console.log('牛栏剩料率导出')
  1403. var excelDatasTabChart2 = [
  1404. {
  1405. tHeader: ['日期', '栏舍名称', '剩料量', '撒料量', '剩料率'],
  1406. filterVal: ['日期', '名称', '剩料量', '撒料量', '准确率'],
  1407. tableDatas: this.tab.chart2.table.list,
  1408. sheetName: '牛栏剩料率'
  1409. }
  1410. ]
  1411. json2excel(excelDatasTabChart2, '牛栏剩料率', true, 'xlsx')
  1412. } else if (item == 'chart3') {
  1413. console.log('混料时间统计导出')
  1414. var excelDatasTabChart3 = [
  1415. {
  1416. tHeader: ['日期', '混料时间(分钟)'],
  1417. filterVal: ['日期', 'field1'],
  1418. tableDatas: this.tab.chart3.table.list,
  1419. sheetName: '混料时间统计'
  1420. }
  1421. ]
  1422. json2excel(excelDatasTabChart3, '混料时间统计', true, 'xlsx')
  1423. } else if (item == 'chart4') {
  1424. console.log('转化率导出')
  1425. var excelDatasTabChart4 = [
  1426. {
  1427. tHeader: ['日期', '配方名称', '饲料转化率'],
  1428. filterVal: ['日期', '名称', '准确率'],
  1429. tableDatas: this.tab.chart4.table.list,
  1430. sheetName: '转化率统计'
  1431. }
  1432. ]
  1433. json2excel(excelDatasTabChart4, '转化率', true, 'xlsx')
  1434. } else if (item == 'chart5') {
  1435. console.log('成本分析导出')
  1436. var excelDatasTabChart5 = [
  1437. {
  1438. tHeader: ['日期', '牲畜类别', '公斤奶饲料成本(元)'],
  1439. filterVal: ['日期', '名称', '准确率'],
  1440. tableDatas: this.tab.chart5.table.list,
  1441. sheetName: '成本分析'
  1442. }
  1443. ]
  1444. json2excel(excelDatasTabChart5, '成本分析', true, 'xlsx')
  1445. }
  1446. },
  1447. // 切换表格
  1448. handleTable(item) {
  1449. // 显示切换表格
  1450. if (item == 'chart1') {
  1451. console.log('泌乳牛采食量表格')
  1452. this.tab.chart1.isTable = true
  1453. this.tab.chart1.isChart = false
  1454. } else if (item == 'chart2') {
  1455. console.log('牛栏剩料率表格')
  1456. this.tab.chart2.isTable = true
  1457. this.tab.chart2.isChart = false
  1458. } else if (item == 'chart3') {
  1459. console.log('混料时间统计表格')
  1460. this.tab.chart3.isTable = true
  1461. this.tab.chart3.isChart = false
  1462. } else if (item == 'chart4') {
  1463. console.log('转化率表格')
  1464. this.tab.chart4.isTable = true
  1465. this.tab.chart4.isChart = false
  1466. } else if (item == 'chart5') {
  1467. console.log('成本分析表格')
  1468. this.tab.chart5.isTable = true
  1469. this.tab.chart5.isChart = false
  1470. }
  1471. },
  1472. // 切换图表
  1473. handleChart(item) {
  1474. // 显示切换图表
  1475. if (item == 'chart1') {
  1476. console.log('泌乳牛采食量图表')
  1477. this.tab.chart1.isTable = false
  1478. this.tab.chart1.isChart = true
  1479. } else if (item == 'chart2') {
  1480. console.log('牛栏剩料率图表')
  1481. this.tab.chart2.isTable = false
  1482. this.tab.chart2.isChart = true
  1483. } else if (item == 'chart3') {
  1484. console.log('混料时间统计图表')
  1485. this.tab.chart3.isTable = false
  1486. this.tab.chart3.isChart = true
  1487. } else if (item == 'chart4') {
  1488. console.log('转化率图表')
  1489. this.tab.chart4.isTable = false
  1490. this.tab.chart4.isChart = true
  1491. } else if (item == 'chart5') {
  1492. console.log('成本分析图表')
  1493. this.tab.chart5.isTable = false
  1494. this.tab.chart5.isChart = true
  1495. }
  1496. },
  1497. // 切换tab2日期
  1498. changeTab2Date() {
  1499. this.getTab2List()
  1500. this.getTab2List2()
  1501. this.getTab2List3()
  1502. this.getTab2List4()
  1503. },
  1504. // 宾州筛分析
  1505. getTab2List() {
  1506. this.tab2.table.listLoading = true
  1507. GetDataByName(this.tab2.table.getdataListParm).then(response => {
  1508. console.log('宾州筛分析table数据', response.data.list)
  1509. if (response.data.list !== null) {
  1510. this.tab2.table.list = response.data.list
  1511. this.tab2.table.total = response.data.total
  1512. } else {
  1513. this.tab2.table.list = []
  1514. }
  1515. setTimeout(() => {
  1516. this.tab2.table.listLoading = false
  1517. }, 100)
  1518. })
  1519. },
  1520. // 粪便筛分析
  1521. getTab2List2() {
  1522. this.tab2.table2.listLoading = true
  1523. this.tab2.table2.getdataListParm.parammaps.date = this.tab2.table.getdataListParm.parammaps.date
  1524. GetDataByName(this.tab2.table2.getdataListParm).then(response => {
  1525. console.log('粪便筛分析table数据', response.data.list)
  1526. if (response.data.list !== null) {
  1527. this.tab2.table2.list = response.data.list
  1528. this.tab2.table2.total = response.data.total
  1529. } else {
  1530. this.tab2.table2.list = []
  1531. }
  1532. setTimeout(() => {
  1533. this.tab2.table2.listLoading = false
  1534. }, 100)
  1535. })
  1536. },
  1537. // BCS评分
  1538. getTab2List3() {
  1539. this.tab2.table3.listLoading = true
  1540. this.tab2.table3.getdataListParm.parammaps.date = this.tab2.table.getdataListParm.parammaps.date
  1541. GetDataByName(this.tab2.table3.getdataListParm).then(response => {
  1542. console.log('BCS评分table数据', response.data.list)
  1543. if (response.data.list !== null) {
  1544. this.tab2.table3.list = response.data.list
  1545. this.tab2.table3.total = response.data.total
  1546. } else {
  1547. this.tab2.table3.list = []
  1548. }
  1549. setTimeout(() => {
  1550. this.tab2.table3.listLoading = false
  1551. }, 100)
  1552. })
  1553. },
  1554. // 粪便评分
  1555. getTab2List4() {
  1556. this.tab2.table4.listLoading = true
  1557. this.tab2.table4.getdataListParm.parammaps.date = this.tab2.table.getdataListParm.parammaps.date
  1558. GetDataByName(this.tab2.table4.getdataListParm).then(response => {
  1559. console.log('成本分析table数据', response.data.list)
  1560. if (response.data.list !== null) {
  1561. this.tab2.table4.list = response.data.list
  1562. this.tab2.table4.total = response.data.total
  1563. } else {
  1564. this.tab2.table4.list = []
  1565. }
  1566. setTimeout(() => {
  1567. this.tab2.table4.listLoading = false
  1568. }, 100)
  1569. })
  1570. }
  1571. }
  1572. }
  1573. </script>
  1574. <style lang="scss" scoped>
  1575. .search{margin-bottom:10px;}
  1576. </style>