1ba1bab53b39e4c06e4a44d76ca1bef27ff78655.svn-base 74 KB

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