a68d928808776441f982a67f1d02b83f77aa4339.svn-base 79 KB

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