acdf987480cf3e4cacfe6204c6356ddceea9acc9.svn-base 80 KB

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