4b490248f089064a0b3cfe8e6fccaf9a83d87560.svn-base 72 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647
  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: 'getFeedEffCB',
  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 = 'getFeedEffCB'
  787. this.getChart5()
  788. } else if (this.tab.radio == '2') {
  789. console.log('栏舍名称')
  790. this.tab.isFormulaName = false
  791. this.tab.isHouseName = true
  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 = 'getFeedEfficiencyLS'
  798. this.getTabList()
  799. this.tab.chart5.statisticsList = []
  800. this.tab.chart5.getdataListParm.name = 'getFeedEffCBLS'
  801. this.getChart5()
  802. } else if (this.tab.radio == '3') {
  803. console.log(' 牲畜类别')
  804. this.tab.isFormulaName = false
  805. this.tab.isHouseName = false
  806. this.tab.isLivestockType = true
  807. this.tab.table.getdataListParm.parammaps.ftname = ''
  808. this.tab.table.getdataListParm.parammaps.barname = ''
  809. this.tab.table.getdataListParm.parammaps.ftname = ''
  810. this.tab.table.getdataListParm.parammaps.cowclass = ''
  811. this.tab.table.getdataListParm.name = 'getFeedEfficiencySC'
  812. this.getTabList()
  813. this.tab.chart5.statisticsList = []
  814. this.tab.chart5.getdataListParm.name = 'getFeedEffCB'
  815. this.getChart5()
  816. }
  817. },
  818. // 效率统计
  819. getTabList() {
  820. this.tab.table.listLoading = true
  821. GetDataByName(this.tab.table.getdataListParm).then(response => {
  822. console.log('汇总统计/混料table数据', response.data.list)
  823. if (response.data.list !== null) {
  824. this.tab.table.list = response.data.list
  825. this.tab.table.total = response.data.total
  826. } else {
  827. this.tab.table.list = []
  828. }
  829. setTimeout(() => {
  830. this.tab.table.listLoading = false
  831. }, 100)
  832. })
  833. },
  834. // 查询
  835. handleSearch() {
  836. if (this.tab.radio == '1') {
  837. console.log('配方名称/查询')
  838. this.tab.isFormulaName = true
  839. this.tab.isHouseName = false
  840. this.tab.isLivestockType = false
  841. this.tab.table.getdataListParm.name = 'getFeedEfficiencyFT'
  842. this.getTabList()
  843. } else if (this.tab.radio == '2') {
  844. console.log('栏舍名称/查询')
  845. this.tab.isFormulaName = false
  846. this.tab.isHouseName = true
  847. this.tab.isLivestockType = false
  848. this.tab.table.getdataListParm.name = 'getFeedEfficiencyLS'
  849. this.getTabList()
  850. } else if (this.tab.radio == '3') {
  851. console.log(' 牲畜类别/查询')
  852. this.tab.isFormulaName = false
  853. this.tab.isHouseName = false
  854. this.tab.isLivestockType = true
  855. this.tab.table.getdataListParm.name = 'getFeedEfficiencySC'
  856. this.getTabList()
  857. }
  858. },
  859. // 快速跳转到图表
  860. handleQuickJumpChart() {
  861. console.log(document.querySelector('#chartDate'))
  862. document.querySelector('#chartDate').scrollIntoView()
  863. },
  864. // 快速回到顶部
  865. handleQuickJumpTop() {
  866. window.scrollTo(0, 0)
  867. },
  868. // 图表总查询
  869. handleChartDate() {
  870. console.log('点击了确认时间')
  871. MessageBox.confirm('是否调整以下所有图表查询时间?', {
  872. confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
  873. }).then(() => {
  874. var that = this
  875. var startTime = parseTime(this.tab.chartDate[0], '{y}-{m}-{d}')
  876. var stopTime = parseTime(this.tab.chartDate[1], '{y}-{m}-{d}')
  877. that.tab.chart1.getdataListParm.parammaps.inputDatetime = this.tab.chartDate
  878. that.tab.chart1.getdataListParm.parammaps.startTime = startTime
  879. that.tab.chart1.getdataListParm.parammaps.stopTime = stopTime
  880. that.getChart1()
  881. that.tab.chart2.getdataListParm.parammaps.inputDatetime = this.tab.chartDate
  882. that.tab.chart2.getdataListParm.parammaps.startTime = startTime
  883. that.tab.chart2.getdataListParm.parammaps.stopTime = stopTime
  884. that.getChart2()
  885. that.tab.chart3.getdataListParm.parammaps.inputDatetime = this.tab.chartDate
  886. that.tab.chart3.getdataListParm.parammaps.startTime = startTime
  887. that.tab.chart3.getdataListParm.parammaps.stopTime = stopTime
  888. that.getChart3()
  889. that.tab.chart4.getdataListParm.parammaps.inputDatetime = this.tab.chartDate
  890. that.tab.chart4.getdataListParm.parammaps.startTime = startTime
  891. that.tab.chart4.getdataListParm.parammaps.stopTime = stopTime
  892. that.getChart4()
  893. that.tab.chart5.getdataListParm.parammaps.inputDatetime = this.tab.chartDate
  894. that.tab.chart5.getdataListParm.parammaps.startTime = startTime
  895. that.tab.chart5.getdataListParm.parammaps.stopTime = stopTime
  896. that.getChart5()
  897. })
  898. },
  899. // 泌乳牛干物质采食量
  900. getChart1() {
  901. this.tab.chart1.listLoading = true
  902. GetReportform(this.tab.chart1.getdataListParm).then(response => {
  903. console.log('泌乳牛干物质采食量图表数据', response.data.list)
  904. if (response.data.list !== null) {
  905. this.tab.chart1.table.list = response.data.data
  906. this.tab.chart1.chartLine_data = response.data.list
  907. // this.tab.chart1.total = response.data.total
  908. this.roadChartLine1(this.tab.chart1.chartLine_data)
  909. } else {
  910. this.tab.chart1.list = []
  911. }
  912. setTimeout(() => {
  913. this.tab.chart1.listLoading = false
  914. }, 100)
  915. })
  916. },
  917. roadChartLine1(chartLine_data) {
  918. if (this.tab.chart1.chartLine != null) {
  919. this.tab.chart1.chartLine.dispose()
  920. }
  921. this.tab.chart1.chartLine = echarts.init(document.getElementById('chartLine1'))
  922. var option = {
  923. tooltip: {
  924. trigger: 'axis'
  925. },
  926. legend: {
  927. data: ['泌乳牛干物质采食量', '泌乳牛产奶量'],
  928. right: 10
  929. },
  930. grid: {
  931. top: '20%',
  932. left: '5%',
  933. right: '8%',
  934. containLabel: true
  935. },
  936. xAxis: [
  937. {
  938. type: 'category',
  939. data: chartLine_data.data1
  940. }
  941. ],
  942. yAxis: [
  943. {
  944. type: 'value',
  945. name: '泌乳牛干物质采食量',
  946. axisLabel: {
  947. formatter: '{value} '
  948. }
  949. }, {
  950. type: 'value',
  951. name: '泌乳牛产奶量',
  952. axisLabel: {
  953. formatter: '{value} '
  954. }
  955. }
  956. ],
  957. series: [{
  958. name: '泌乳牛干物质采食量',
  959. type: 'bar',
  960. itemStyle: { /* 设置柱状颜色*/
  961. normal: {
  962. color: '#61a5e8'
  963. }
  964. },
  965. data: chartLine_data.data2
  966. }, {
  967. name: '泌乳牛产奶量',
  968. type: 'line',
  969. itemStyle: { /* 设置折线颜色*/
  970. normal: {
  971. color: '#ff2d2d'
  972. }
  973. },
  974. yAxisIndex: 1,
  975. data: chartLine_data.data3
  976. }]
  977. }
  978. this.tab.chart1.chartLine.setOption(option)
  979. window.onresize = function() {
  980. this.tab.chart1.chartLine.resize()
  981. }
  982. },
  983. // 牛栏剩料率
  984. changeStatisticChart2() {
  985. var arrData3 = []
  986. for (let i = 0; i < this.tab.chart2.getdataListParm.parammaps.statisticsList.length; i++) {
  987. const myId = this.tab.chart2.statisticsList.find(obj => obj.name == this.tab.chart2.getdataListParm.parammaps.statisticsList[i]).id
  988. for (let j = 0; j < this.tab.chart2.chart2Data3.length; j++) {
  989. if (j == myId) {
  990. arrData3.push(this.tab.chart2.chart2Data3[j])
  991. }
  992. }
  993. }
  994. this.tab.chart2.chartLine_data.data3 = arrData3
  995. this.tab.chart2.chartLine_data.data1 = this.tab.chart2.getdataListParm.parammaps.statisticsList
  996. this.roadChartLine2(this.tab.chart2.chartLine_data)
  997. },
  998. getChart2() {
  999. this.tab.chart2.listLoading = true
  1000. GetReportform(this.tab.chart2.getdataListParm).then(response => {
  1001. console.log('转化率图表数据', response.data.list)
  1002. if (response.data.list !== null) {
  1003. this.tab.chart2.table.list = response.data.data
  1004. this.tab.chart2.chartLine_data = response.data.list
  1005. this.tab.chart2.total = response.data.total
  1006. this.tab.chart2.statisticsList = []
  1007. this.tab.chart2.getdataListParm.parammaps.statisticsList = []
  1008. for (let i = 0; i < response.data.list.data1.length; i++) {
  1009. if (i < 10) {
  1010. this.tab.chart2.getdataListParm.parammaps.statisticsList.push(response.data.list.data1[i])
  1011. }
  1012. var obj = {}
  1013. obj.id = i
  1014. obj.name = response.data.list.data1[i]
  1015. this.tab.chart2.statisticsList.push(obj)
  1016. }
  1017. this.tab.chart2.chart2Data3 = response.data.list.data3
  1018. this.tab.chart2.total = response.data.total
  1019. console.log('牛栏剩料率图数据', this.tab.chart2.chartLine_data)
  1020. console.log('牛栏剩料率表数据', this.tab.chart2.table.list)
  1021. var arrData3 = []
  1022. for (let i = 0; i < this.tab.chart2.getdataListParm.parammaps.statisticsList.length; i++) {
  1023. const myId = this.tab.chart2.statisticsList.find(obj => obj.name == this.tab.chart2.getdataListParm.parammaps.statisticsList[i]).id
  1024. for (let j = 0; j < this.tab.chart2.chart2Data3.length; j++) {
  1025. if (j == myId) {
  1026. arrData3.push(this.tab.chart2.chart2Data3[j])
  1027. }
  1028. }
  1029. }
  1030. this.tab.chart2.chartLine_data.data3 = arrData3
  1031. this.tab.chart2.chartLine_data.data1 = this.tab.chart2.getdataListParm.parammaps.statisticsList
  1032. this.roadChartLine2(this.tab.chart2.chartLine_data)
  1033. } else {
  1034. this.tab.chart2.list = []
  1035. }
  1036. setTimeout(() => {
  1037. this.tab.chart2.listLoading = false
  1038. }, 100)
  1039. })
  1040. },
  1041. roadChartLine2(chartLine_data) {
  1042. if (this.tab.chart2.chartLine != null) {
  1043. this.tab.chart2.chartLine.dispose()
  1044. }
  1045. this.tab.chart2.chartLine = echarts.init(document.getElementById('chartLine2'))
  1046. var option = {
  1047. title: {
  1048. text: ''
  1049. },
  1050. tooltip: {
  1051. trigger: 'axis'
  1052. },
  1053. legend: {
  1054. data: chartLine_data.data1,
  1055. right: 10
  1056. },
  1057. grid: {
  1058. top: '20%',
  1059. left: '3%',
  1060. right: '8%',
  1061. containLabel: true
  1062. },
  1063. toolbox: {
  1064. show: true,
  1065. right: '2%',
  1066. feature: {}
  1067. },
  1068. xAxis: { type: 'category', boundaryGap: false, data: chartLine_data.data2, name: '日期' },
  1069. yAxis: {
  1070. type: 'value', name: '剩料率', axisLabel: { formatter: '{value} %' }
  1071. },
  1072. series: (function() {
  1073. var serie = []
  1074. for (var i = 0; i < chartLine_data.data3.length; i++) {
  1075. var item = {
  1076. name: chartLine_data.data1[i],
  1077. type: 'line',
  1078. data: chartLine_data.data3[i].data
  1079. }
  1080. serie.push(item)
  1081. }
  1082. return serie
  1083. }())
  1084. }
  1085. this.tab.chart2.chartLine.setOption(option)
  1086. window.onresize = function() {
  1087. this.tab.chart2.chartLine.resize()
  1088. }
  1089. },
  1090. // 混料时间统计
  1091. getChart3() {
  1092. this.tab.chart3.listLoading = true
  1093. GetReportform(this.tab.chart3.getdataListParm).then(response => {
  1094. console.log('混料时间统计图表数据', response.data.list)
  1095. if (response.data.list !== null) {
  1096. this.tab.chart3.table.list = response.data.data
  1097. this.tab.chart3.chartLine_data = response.data.list
  1098. this.tab.chart3.total = response.data.total
  1099. this.tab.chart3.total = response.data.total
  1100. this.roadChartLine3(this.tab.chart3.chartLine_data)
  1101. } else {
  1102. this.tab.chart3.list = []
  1103. }
  1104. setTimeout(() => {
  1105. this.tab.chart3.listLoading = false
  1106. }, 100)
  1107. })
  1108. },
  1109. roadChartLine3(chartLine_data) {
  1110. if (this.tab.chart3.chartLine != null) {
  1111. this.tab.chart3.chartLine.dispose()
  1112. }
  1113. this.tab.chart3.chartLine = echarts.init(document.getElementById('chartLine3'))
  1114. var option = {
  1115. title: {
  1116. text: ''
  1117. },
  1118. tooltip: {
  1119. trigger: 'axis'
  1120. },
  1121. legend: {
  1122. data: ['混料时间'],
  1123. right: 10
  1124. },
  1125. grid: {
  1126. top: '20%',
  1127. left: '5%',
  1128. right: '8%',
  1129. containLabel: true
  1130. },
  1131. toolbox: {
  1132. show: true,
  1133. right: '2%',
  1134. feature: {}
  1135. },
  1136. xAxis: { type: 'category', boundaryGap: false, data: chartLine_data.data1, name: '日期' },
  1137. yAxis: {
  1138. type: 'value', name: '分钟',
  1139. axisLabel: {
  1140. formatter: '{value}min'
  1141. }
  1142. },
  1143. series: [
  1144. {
  1145. name: '混料时间',
  1146. type: 'line',
  1147. stack: '总量',
  1148. data: chartLine_data.data2
  1149. }
  1150. ]
  1151. }
  1152. this.tab.chart3.chartLine.setOption(option)
  1153. window.onresize = function() {
  1154. this.tab.chart3.chartLine.resize()
  1155. }
  1156. },
  1157. // 转化率
  1158. changeStatisticChart4() {
  1159. var arrData3 = []
  1160. for (let i = 0; i < this.tab.chart4.getdataListParm.parammaps.statisticsList.length; i++) {
  1161. const myId = this.tab.chart4.statisticsList.find(obj => obj.name == this.tab.chart4.getdataListParm.parammaps.statisticsList[i]).id
  1162. for (let j = 0; j < this.tab.chart4.chart4Data3.length; j++) {
  1163. if (j == myId) {
  1164. arrData3.push(this.tab.chart4.chart4Data3[j])
  1165. }
  1166. }
  1167. }
  1168. this.tab.chart4.chartLine_data.data3 = arrData3
  1169. this.tab.chart4.chartLine_data.data1 = this.tab.chart4.getdataListParm.parammaps.statisticsList
  1170. this.roadChartLine4(this.tab.chart4.chartLine_data)
  1171. },
  1172. getChart4() {
  1173. this.tab.chart4.listLoading = true
  1174. GetReportform(this.tab.chart4.getdataListParm).then(response => {
  1175. console.log('转化率图表数据', response.data.list)
  1176. if (response.data.list !== null) {
  1177. this.tab.chart4.table.list = response.data.data
  1178. this.tab.chart4.chartLine_data = response.data.list
  1179. this.tab.chart4.total = response.data.total
  1180. this.tab.chart4.statisticsList = []
  1181. this.tab.chart4.getdataListParm.parammaps.statisticsList = []
  1182. for (let i = 0; i < response.data.list.data1.length; i++) {
  1183. if (i < 10) {
  1184. this.tab.chart4.getdataListParm.parammaps.statisticsList.push(response.data.list.data1[i])
  1185. }
  1186. var obj = {}
  1187. obj.id = i
  1188. obj.name = response.data.list.data1[i]
  1189. this.tab.chart4.statisticsList.push(obj)
  1190. }
  1191. this.tab.chart4.chart4Data3 = response.data.list.data3
  1192. this.tab.chart4.total = response.data.total
  1193. console.log('转化率图数据', this.tab.chart4.chartLine_data)
  1194. console.log('转化率表数据', this.tab.chart4.table.list)
  1195. var arrData3 = []
  1196. for (let i = 0; i < this.tab.chart4.getdataListParm.parammaps.statisticsList.length; i++) {
  1197. const myId = this.tab.chart4.statisticsList.find(obj => obj.name == this.tab.chart4.getdataListParm.parammaps.statisticsList[i]).id
  1198. for (let j = 0; j < this.tab.chart4.chart4Data3.length; j++) {
  1199. if (j == myId) {
  1200. arrData3.push(this.tab.chart4.chart4Data3[j])
  1201. }
  1202. }
  1203. }
  1204. this.tab.chart4.chartLine_data.data3 = arrData3
  1205. this.tab.chart4.chartLine_data.data1 = this.tab.chart4.getdataListParm.parammaps.statisticsList
  1206. this.roadChartLine4(this.tab.chart4.chartLine_data)
  1207. } else {
  1208. this.tab.chart4.list = []
  1209. }
  1210. setTimeout(() => {
  1211. this.tab.chart4.listLoading = false
  1212. }, 100)
  1213. })
  1214. },
  1215. roadChartLine4(chartLine_data) {
  1216. if (this.tab.chart4.chartLine != null) {
  1217. this.tab.chart4.chartLine.dispose()
  1218. }
  1219. this.tab.chart4.chartLine = echarts.init(document.getElementById('chartLine4'))
  1220. var option = {
  1221. title: {
  1222. text: ''
  1223. },
  1224. tooltip: {
  1225. trigger: 'axis'
  1226. },
  1227. legend: {
  1228. data: chartLine_data.data1,
  1229. right: 10
  1230. },
  1231. grid: {
  1232. top: '20%',
  1233. left: '3%',
  1234. right: '8%',
  1235. containLabel: true
  1236. },
  1237. toolbox: {
  1238. show: true,
  1239. right: '2%',
  1240. feature: {}
  1241. },
  1242. xAxis: { type: 'category', boundaryGap: false, data: chartLine_data.data2, name: '日期' },
  1243. yAxis: {
  1244. type: 'value', name: '百分比', axisLabel: { formatter: '{value} %' }
  1245. },
  1246. series: (function() {
  1247. var serie = []
  1248. for (var i = 0; i < chartLine_data.data3.length; i++) {
  1249. var item = {
  1250. name: chartLine_data.data1[i],
  1251. type: 'line',
  1252. data: chartLine_data.data3[i].data
  1253. }
  1254. serie.push(item)
  1255. }
  1256. return serie
  1257. }())
  1258. }
  1259. this.tab.chart4.chartLine.setOption(option)
  1260. window.onresize = function() {
  1261. this.tab.chart4.chartLine.resize()
  1262. }
  1263. },
  1264. // 成本分析
  1265. changeStatisticChart5() {
  1266. var arrData3 = []
  1267. for (let i = 0; i < this.tab.chart5.getdataListParm.parammaps.statisticsList.length; i++) {
  1268. const myId = this.tab.chart5.statisticsList.find(obj => obj.name == this.tab.chart5.getdataListParm.parammaps.statisticsList[i]).id
  1269. for (let j = 0; j < this.tab.chart5.chart5Data3.length; j++) {
  1270. if (j == myId) {
  1271. arrData3.push(this.tab.chart5.chart5Data3[j])
  1272. }
  1273. }
  1274. }
  1275. this.tab.chart5.chartLine_data.data3 = arrData3
  1276. this.tab.chart5.chartLine_data.data1 = this.tab.chart5.getdataListParm.parammaps.statisticsList
  1277. this.roadChartLine5(this.tab.chart5.chartLine_data)
  1278. },
  1279. getChart5() {
  1280. this.tab.chart5.listLoading = true
  1281. GetReportform(this.tab.chart5.getdataListParm).then(response => {
  1282. console.log('转化率图表数据', response.data.list)
  1283. if (response.data.list !== null) {
  1284. this.tab.chart5.table.list = response.data.data
  1285. this.tab.chart5.chartLine_data = response.data.list
  1286. this.tab.chart5.total = response.data.total
  1287. this.tab.chart5.statisticsList = []
  1288. this.tab.chart5.getdataListParm.parammaps.statisticsList = []
  1289. for (let i = 0; i < response.data.list.data1.length; i++) {
  1290. if (i < 10) {
  1291. this.tab.chart5.getdataListParm.parammaps.statisticsList.push(response.data.list.data1[i])
  1292. }
  1293. var obj = {}
  1294. obj.id = i
  1295. obj.name = response.data.list.data1[i]
  1296. this.tab.chart5.statisticsList.push(obj)
  1297. }
  1298. this.tab.chart5.chart5Data3 = response.data.list.data3
  1299. this.tab.chart5.total = response.data.total
  1300. console.log('转化率图数据', this.tab.chart5.chartLine_data)
  1301. console.log('转化率表数据', this.tab.chart5.table.list)
  1302. var arrData3 = []
  1303. for (let i = 0; i < this.tab.chart5.getdataListParm.parammaps.statisticsList.length; i++) {
  1304. const myId = this.tab.chart5.statisticsList.find(obj => obj.name == this.tab.chart5.getdataListParm.parammaps.statisticsList[i]).id
  1305. for (let j = 0; j < this.tab.chart5.chart5Data3.length; j++) {
  1306. if (j == myId) {
  1307. arrData3.push(this.tab.chart5.chart5Data3[j])
  1308. }
  1309. }
  1310. }
  1311. this.tab.chart5.chartLine_data.data3 = arrData3
  1312. this.tab.chart5.chartLine_data.data1 = this.tab.chart5.getdataListParm.parammaps.statisticsList
  1313. this.roadChartLine5(this.tab.chart5.chartLine_data)
  1314. } else {
  1315. this.tab.chart5.list = []
  1316. }
  1317. setTimeout(() => {
  1318. this.tab.chart5.listLoading = false
  1319. }, 100)
  1320. })
  1321. },
  1322. roadChartLine5(chartLine_data) {
  1323. if (this.tab.chart5.chartLine != null) {
  1324. this.tab.chart5.chartLine.dispose()
  1325. }
  1326. this.tab.chart5.chartLine = echarts.init(document.getElementById('chartLine5'))
  1327. var option = {
  1328. title: {
  1329. text: ''
  1330. },
  1331. tooltip: {
  1332. trigger: 'axis'
  1333. },
  1334. legend: {
  1335. data: chartLine_data.data1,
  1336. right: 10
  1337. },
  1338. grid: {
  1339. top: '20%',
  1340. left: '5%',
  1341. right: '8%',
  1342. containLabel: true
  1343. },
  1344. toolbox: {
  1345. show: true,
  1346. right: '2%',
  1347. feature: {}
  1348. },
  1349. xAxis: { type: 'category', boundaryGap: false, data: chartLine_data.data2, name: '日期' },
  1350. yAxis: {
  1351. type: 'value', name: '公斤奶饲料成本(元)'
  1352. },
  1353. series: (function() {
  1354. var serie = []
  1355. for (var i = 0; i < chartLine_data.data3.length; i++) {
  1356. var item = {
  1357. name: chartLine_data.data1[i],
  1358. type: 'line',
  1359. data: chartLine_data.data3[i].data
  1360. }
  1361. serie.push(item)
  1362. }
  1363. return serie
  1364. }())
  1365. }
  1366. this.tab.chart5.chartLine.setOption(option)
  1367. window.onresize = function() {
  1368. this.tab.chart5.chartLine.resize()
  1369. }
  1370. },
  1371. // 时间
  1372. changeChartDate(item) {
  1373. console.log(item)
  1374. if (item == 'chart1') {
  1375. if (this.tab.chart1.getdataListParm.parammaps.inputDatetime !== '' && this.tab.chart1.getdataListParm.parammaps.inputDatetime !== null) {
  1376. this.tab.chart1.getdataListParm.parammaps.startTime = parseTime(this.tab.chart1.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  1377. this.tab.chart1.getdataListParm.parammaps.stopTime = parseTime(this.tab.chart1.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  1378. this.getChart1()
  1379. } else {
  1380. this.tab.chart1.getdataListParm.parammaps.inputDatetime = ''
  1381. this.tab.chart1.getdataListParm.parammaps.startTime = ''
  1382. this.tab.chart1.getdataListParm.parammaps.stopTime = ''
  1383. this.getChart1()
  1384. }
  1385. } else if (item == 'chart2') {
  1386. if (this.tab.chart2.getdataListParm.parammaps.inputDatetime !== '' && this.tab.chart2.getdataListParm.parammaps.inputDatetime !== null) {
  1387. this.tab.chart2.getdataListParm.parammaps.startTime = parseTime(this.tab.chart2.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  1388. this.tab.chart2.getdataListParm.parammaps.stopTime = parseTime(this.tab.chart2.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  1389. this.getChart2()
  1390. } else {
  1391. this.tab.chart2.getdataListParm.parammaps.inputDatetime = ''
  1392. this.tab.chart2.getdataListParm.parammaps.startTime = ''
  1393. this.tab.chart2.getdataListParm.parammaps.stopTime = ''
  1394. this.getChart2()
  1395. }
  1396. } else if (item == 'chart3') {
  1397. if (this.tab.chart3.getdataListParm.parammaps.inputDatetime !== '' && this.tab.chart3.getdataListParm.parammaps.inputDatetime !== null) {
  1398. this.tab.chart3.getdataListParm.parammaps.startTime = parseTime(this.tab.chart3.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  1399. this.tab.chart3.getdataListParm.parammaps.stopTime = parseTime(this.tab.chart3.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  1400. this.getChart3()
  1401. } else {
  1402. this.tab.chart3.getdataListParm.parammaps.inputDatetime = ''
  1403. this.tab.chart3.getdataListParm.parammaps.startTime = ''
  1404. this.tab.chart3.getdataListParm.parammaps.stopTime = ''
  1405. this.getChart3()
  1406. }
  1407. } else if (item == 'chart4') {
  1408. if (this.tab.chart4.getdataListParm.parammaps.inputDatetime !== '' && this.tab.chart4.getdataListParm.parammaps.inputDatetime !== null) {
  1409. this.tab.chart4.getdataListParm.parammaps.startTime = parseTime(this.tab.chart4.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  1410. this.tab.chart4.getdataListParm.parammaps.stopTime = parseTime(this.tab.chart4.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  1411. this.getChart4()
  1412. } else {
  1413. this.tab.chart4.getdataListParm.parammaps.inputDatetime = ''
  1414. this.tab.chart4.getdataListParm.parammaps.startTime = ''
  1415. this.tab.chart4.getdataListParm.parammaps.stopTime = ''
  1416. this.getChart4()
  1417. }
  1418. } else if (item == 'chart5') {
  1419. if (this.tab.chart5.getdataListParm.parammaps.inputDatetime !== '' && this.tab.chart5.getdataListParm.parammaps.inputDatetime !== null) {
  1420. this.tab.chart5.getdataListParm.parammaps.startTime = parseTime(this.tab.chart5.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  1421. this.tab.chart5.getdataListParm.parammaps.stopTime = parseTime(this.tab.chart5.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  1422. this.getChart5()
  1423. } else {
  1424. this.tab.chart5.getdataListParm.parammaps.inputDatetime = ''
  1425. this.tab.chart5.getdataListParm.parammaps.startTime = ''
  1426. this.tab.chart5.getdataListParm.parammaps.stopTime = ''
  1427. this.getChart5()
  1428. }
  1429. }
  1430. },
  1431. // 导出
  1432. handleExport(item) {
  1433. if (item == 'chart1') {
  1434. console.log('泌乳牛干物质采食量导出')
  1435. var excelDatasTabChart1 = [
  1436. {
  1437. tHeader: ['日期', '泌乳牛采食量', '泌乳牛产奶量'],
  1438. filterVal: ['日期', 'field1', 'field2'],
  1439. tableDatas: this.tab.chart1.table.list,
  1440. sheetName: '泌乳牛采食量'
  1441. }
  1442. ]
  1443. json2excel(excelDatasTabChart1, '泌乳牛采食量', true, 'xlsx')
  1444. } else if (item == 'chart2') {
  1445. console.log('牛栏剩料率导出')
  1446. var excelDatasTabChart2 = [
  1447. {
  1448. tHeader: ['日期', '栏舍名称', '剩料量', '撒料量', '剩料率'],
  1449. filterVal: ['日期', '名称', '剩料量', '撒料量', '准确率'],
  1450. tableDatas: this.tab.chart2.table.list,
  1451. sheetName: '牛栏剩料率'
  1452. }
  1453. ]
  1454. json2excel(excelDatasTabChart2, '牛栏剩料率', true, 'xlsx')
  1455. } else if (item == 'chart3') {
  1456. console.log('混料时间统计导出')
  1457. var excelDatasTabChart3 = [
  1458. {
  1459. tHeader: ['日期', '混料时间(分钟)'],
  1460. filterVal: ['日期', 'field1'],
  1461. tableDatas: this.tab.chart3.table.list,
  1462. sheetName: '混料时间统计'
  1463. }
  1464. ]
  1465. json2excel(excelDatasTabChart3, '混料时间统计', true, 'xlsx')
  1466. } else if (item == 'chart4') {
  1467. console.log('转化率导出')
  1468. var excelDatasTabChart4 = [
  1469. {
  1470. tHeader: ['日期', '配方名称', '饲料转化率'],
  1471. filterVal: ['日期', '名称', '准确率'],
  1472. tableDatas: this.tab.chart4.table.list,
  1473. sheetName: '转化率统计'
  1474. }
  1475. ]
  1476. json2excel(excelDatasTabChart4, '转化率', true, 'xlsx')
  1477. } else if (item == 'chart5') {
  1478. console.log('成本分析导出')
  1479. var excelDatasTabChart5 = [
  1480. {
  1481. tHeader: ['日期', '牲畜类别', '公斤奶饲料成本(元)'],
  1482. filterVal: ['日期', '名称', '准确率'],
  1483. tableDatas: this.tab.chart5.table.list,
  1484. sheetName: '成本分析'
  1485. }
  1486. ]
  1487. json2excel(excelDatasTabChart5, '成本分析', true, 'xlsx')
  1488. }
  1489. },
  1490. // 切换表格
  1491. handleTable(item) {
  1492. // 显示切换表格
  1493. if (item == 'chart1') {
  1494. console.log('泌乳牛采食量表格')
  1495. this.tab.chart1.isTable = true
  1496. this.tab.chart1.isChart = false
  1497. } else if (item == 'chart2') {
  1498. console.log('牛栏剩料率表格')
  1499. this.tab.chart2.isTable = true
  1500. this.tab.chart2.isChart = false
  1501. } else if (item == 'chart3') {
  1502. console.log('混料时间统计表格')
  1503. this.tab.chart3.isTable = true
  1504. this.tab.chart3.isChart = false
  1505. } else if (item == 'chart4') {
  1506. console.log('转化率表格')
  1507. this.tab.chart4.isTable = true
  1508. this.tab.chart4.isChart = false
  1509. } else if (item == 'chart5') {
  1510. console.log('成本分析表格')
  1511. this.tab.chart5.isTable = true
  1512. this.tab.chart5.isChart = false
  1513. }
  1514. },
  1515. // 切换图表
  1516. handleChart(item) {
  1517. // 显示切换图表
  1518. if (item == 'chart1') {
  1519. console.log('泌乳牛采食量图表')
  1520. this.tab.chart1.isTable = false
  1521. this.tab.chart1.isChart = true
  1522. } else if (item == 'chart2') {
  1523. console.log('牛栏剩料率图表')
  1524. this.tab.chart2.isTable = false
  1525. this.tab.chart2.isChart = true
  1526. } else if (item == 'chart3') {
  1527. console.log('混料时间统计图表')
  1528. this.tab.chart3.isTable = false
  1529. this.tab.chart3.isChart = true
  1530. } else if (item == 'chart4') {
  1531. console.log('转化率图表')
  1532. this.tab.chart4.isTable = false
  1533. this.tab.chart4.isChart = true
  1534. } else if (item == 'chart5') {
  1535. console.log('成本分析图表')
  1536. this.tab.chart5.isTable = false
  1537. this.tab.chart5.isChart = true
  1538. }
  1539. },
  1540. // 切换tab2日期
  1541. changeTab2Date() {
  1542. this.getTab2List()
  1543. this.getTab2List2()
  1544. this.getTab2List3()
  1545. this.getTab2List4()
  1546. },
  1547. // 宾州筛分析
  1548. getTab2List() {
  1549. this.tab2.table.listLoading = true
  1550. GetDataByName(this.tab2.table.getdataListParm).then(response => {
  1551. console.log('宾州筛分析table数据', response.data.list)
  1552. if (response.data.list !== null) {
  1553. this.tab2.table.list = response.data.list
  1554. this.tab2.table.total = response.data.total
  1555. } else {
  1556. this.tab2.table.list = []
  1557. }
  1558. setTimeout(() => {
  1559. this.tab2.table.listLoading = false
  1560. }, 100)
  1561. })
  1562. },
  1563. // 粪便筛分析
  1564. getTab2List2() {
  1565. this.tab2.table2.listLoading = true
  1566. this.tab2.table2.getdataListParm.parammaps.date = this.tab2.table.getdataListParm.parammaps.date
  1567. GetDataByName(this.tab2.table2.getdataListParm).then(response => {
  1568. console.log('粪便筛分析table数据', response.data.list)
  1569. if (response.data.list !== null) {
  1570. this.tab2.table2.list = response.data.list
  1571. this.tab2.table2.total = response.data.total
  1572. } else {
  1573. this.tab2.table2.list = []
  1574. }
  1575. setTimeout(() => {
  1576. this.tab2.table2.listLoading = false
  1577. }, 100)
  1578. })
  1579. },
  1580. // BCS评分
  1581. getTab2List3() {
  1582. this.tab2.table3.listLoading = true
  1583. this.tab2.table3.getdataListParm.parammaps.date = this.tab2.table.getdataListParm.parammaps.date
  1584. GetDataByName(this.tab2.table3.getdataListParm).then(response => {
  1585. console.log('BCS评分table数据', response.data.list)
  1586. if (response.data.list !== null) {
  1587. this.tab2.table3.list = response.data.list
  1588. this.tab2.table3.total = response.data.total
  1589. } else {
  1590. this.tab2.table3.list = []
  1591. }
  1592. setTimeout(() => {
  1593. this.tab2.table3.listLoading = false
  1594. }, 100)
  1595. })
  1596. },
  1597. // 粪便评分
  1598. getTab2List4() {
  1599. this.tab2.table4.listLoading = true
  1600. this.tab2.table4.getdataListParm.parammaps.date = this.tab2.table.getdataListParm.parammaps.date
  1601. GetDataByName(this.tab2.table4.getdataListParm).then(response => {
  1602. console.log('成本分析table数据', response.data.list)
  1603. if (response.data.list !== null) {
  1604. this.tab2.table4.list = response.data.list
  1605. this.tab2.table4.total = response.data.total
  1606. } else {
  1607. this.tab2.table4.list = []
  1608. }
  1609. setTimeout(() => {
  1610. this.tab2.table4.listLoading = false
  1611. }, 100)
  1612. })
  1613. }
  1614. }
  1615. }
  1616. </script>
  1617. <style lang="scss" scoped>
  1618. .search{margin-bottom:10px;}
  1619. </style>