f21047d161a7f314f439122e78ef64ea8ee47239.svn-base 76 KB

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