ab9f98b4c36c8ceabd4e2fd3d6ba9ee83f088941.svn-base 80 KB

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