426a82934488d2fbfa057d891779d40c12efb093.svn-base 71 KB

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