e5acb49045e5240e2904e5b2ea70ca6dff12a53e.svn-base 73 KB

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