d1e0e178154a16b89a019d8d8c642413bd93ae60.svn-base 72 KB

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