a561bc484ed46ed497440d66b91f12eb6940e924.svn-base 76 KB

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