b6588b8058f2abfd01bf8fad70cf0dbced596576.svn-base 72 KB

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