51083c5426c4ab8d6046017c724a2fecb14b0817.svn-base 77 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726
  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. <!-- <span>{{ tab.chart4.statisticsList }}</span> -->
  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.$set(this.tab.chart5, 'statisticsList', [])
  793. this.tab.chart5.getdataListParm.name = 'getFeedEffCBFT'
  794. this.getChart5()
  795. this.$set(this.tab.chart4, 'statisticsList', [])
  796. this.tab.chart4.getdataListParm.name = 'getFeedEffZH'
  797. this.getChart4()
  798. } else if (this.tab.radio == '2') {
  799. console.log('栏舍名称')
  800. this.tab.isFormulaName = false
  801. this.tab.isHouseName = true
  802. this.tab.isLivestockType = false
  803. this.tab.table.getdataListParm.parammaps.ftname = ''
  804. this.tab.table.getdataListParm.parammaps.barname = ''
  805. this.tab.table.getdataListParm.parammaps.ftname = ''
  806. this.tab.table.getdataListParm.parammaps.cowclass = ''
  807. this.tab.table.getdataListParm.name = 'getFeedEfficiencyLS'
  808. this.getTabList()
  809. // this.tab.chart5.statisticsList = []
  810. this.$set(this.tab.chart5, 'statisticsList', [])
  811. this.tab.chart5.getdataListParm.name = 'getFeedEffCBLS'
  812. this.getChart5()
  813. this.$set(this.tab.chart4, 'statisticsList', [])
  814. // this.tab.chart4.statisticsList = []
  815. this.tab.chart4.getdataListParm.name = 'getFeedEffZHLS'
  816. this.getChart4()
  817. } else if (this.tab.radio == '3') {
  818. console.log(' 牲畜类别')
  819. this.tab.isFormulaName = false
  820. this.tab.isHouseName = false
  821. this.tab.isLivestockType = true
  822. this.tab.table.getdataListParm.parammaps.ftname = ''
  823. this.tab.table.getdataListParm.parammaps.barname = ''
  824. this.tab.table.getdataListParm.parammaps.ftname = ''
  825. this.tab.table.getdataListParm.parammaps.cowclass = ''
  826. this.tab.table.getdataListParm.name = 'getFeedEfficiencySC'
  827. this.getTabList()
  828. this.$set(this.tab.chart5, 'statisticsList', [])
  829. this.tab.chart5.getdataListParm.name = 'getFeedEffCB'
  830. this.getChart5()
  831. this.$set(this.tab.chart4, 'statisticsList', [])
  832. this.tab.chart4.getdataListParm.name = 'getFeedEffZHSC'
  833. this.getChart4()
  834. }
  835. },
  836. // 效率统计
  837. getTabList() {
  838. this.tab.table.listLoading = true
  839. GetDataByName(this.tab.table.getdataListParm).then(response => {
  840. console.log('汇总统计/混料table数据', response.data.list)
  841. if (response.data.list !== null) {
  842. this.tab.table.list = response.data.list
  843. this.tab.table.total = response.data.total
  844. } else {
  845. this.tab.table.list = []
  846. }
  847. setTimeout(() => {
  848. this.tab.table.listLoading = false
  849. }, 100)
  850. })
  851. },
  852. // 查询
  853. handleSearch() {
  854. if (this.tab.radio == '1') {
  855. console.log('配方名称/查询')
  856. this.tab.isFormulaName = true
  857. this.tab.isHouseName = false
  858. this.tab.isLivestockType = false
  859. this.tab.table.getdataListParm.name = 'getFeedEfficiencyFT'
  860. this.getTabList()
  861. } else if (this.tab.radio == '2') {
  862. console.log('栏舍名称/查询')
  863. this.tab.isFormulaName = false
  864. this.tab.isHouseName = true
  865. this.tab.isLivestockType = false
  866. this.tab.table.getdataListParm.name = 'getFeedEfficiencyLS'
  867. this.getTabList()
  868. } else if (this.tab.radio == '3') {
  869. console.log(' 牲畜类别/查询')
  870. this.tab.isFormulaName = false
  871. this.tab.isHouseName = false
  872. this.tab.isLivestockType = true
  873. this.tab.table.getdataListParm.name = 'getFeedEfficiencySC'
  874. this.getTabList()
  875. }
  876. },
  877. // 快速跳转到图表
  878. handleQuickJumpChart() {
  879. var myHeight = document.getElementById('table').offsetHeight + 120
  880. window.scrollTo(myHeight, myHeight)
  881. },
  882. // 快速回到顶部
  883. handleQuickJumpTop() {
  884. window.scrollTo(0, 0)
  885. },
  886. // 图表总查询
  887. handleChartDate() {
  888. console.log('点击了确认时间')
  889. MessageBox.confirm('是否调整以下所有图表查询时间?', {
  890. confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
  891. }).then(() => {
  892. var that = this
  893. var startTime = parseTime(this.tab.chartDate[0], '{y}-{m}-{d}')
  894. var stopTime = parseTime(this.tab.chartDate[1], '{y}-{m}-{d}')
  895. that.tab.chart1.getdataListParm.parammaps.inputDatetime = this.tab.chartDate
  896. that.tab.chart1.getdataListParm.parammaps.startTime = startTime
  897. that.tab.chart1.getdataListParm.parammaps.stopTime = stopTime
  898. that.getChart1()
  899. that.tab.chart2.getdataListParm.parammaps.inputDatetime = this.tab.chartDate
  900. that.tab.chart2.getdataListParm.parammaps.startTime = startTime
  901. that.tab.chart2.getdataListParm.parammaps.stopTime = stopTime
  902. that.getChart2()
  903. that.tab.chart3.getdataListParm.parammaps.inputDatetime = this.tab.chartDate
  904. that.tab.chart3.getdataListParm.parammaps.startTime = startTime
  905. that.tab.chart3.getdataListParm.parammaps.stopTime = stopTime
  906. that.getChart3()
  907. that.tab.chart4.getdataListParm.parammaps.inputDatetime = this.tab.chartDate
  908. that.tab.chart4.getdataListParm.parammaps.startTime = startTime
  909. that.tab.chart4.getdataListParm.parammaps.stopTime = stopTime
  910. that.getChart4()
  911. that.tab.chart5.getdataListParm.parammaps.inputDatetime = this.tab.chartDate
  912. that.tab.chart5.getdataListParm.parammaps.startTime = startTime
  913. that.tab.chart5.getdataListParm.parammaps.stopTime = stopTime
  914. that.getChart5()
  915. })
  916. },
  917. // 泌乳牛干物质采食量
  918. getChart1() {
  919. this.tab.chart1.listLoading = true
  920. GetReportform(this.tab.chart1.getdataListParm).then(response => {
  921. console.log('泌乳牛干物质采食量图表数据', response.data.list)
  922. if (response.data.list !== null) {
  923. for (let i = 0; i < response.data.data.length; i++) {
  924. if (response.data.data[i].field1 !== '' && response.data.data[i].field1 !== undefined) {
  925. response.data.data[i].field1 = parseFloat(response.data.data[i].field1)
  926. }
  927. if (response.data.data[i].field2 !== '' && response.data.data[i].field2 !== undefined) {
  928. response.data.data[i].field2 = parseFloat(response.data.data[i].field2)
  929. }
  930. }
  931. this.tab.chart1.table.list = response.data.data
  932. this.tab.chart1.chartLine_data = response.data.list
  933. // this.tab.chart1.total = response.data.total
  934. this.roadChartLine1(this.tab.chart1.chartLine_data)
  935. } else {
  936. this.tab.chart1.list = []
  937. }
  938. setTimeout(() => {
  939. this.tab.chart1.listLoading = false
  940. }, 100)
  941. })
  942. },
  943. roadChartLine1(chartLine_data) {
  944. if (this.tab.chart1.chartLine != null) {
  945. this.tab.chart1.chartLine.dispose()
  946. }
  947. this.tab.chart1.chartLine = echarts.init(document.getElementById('chartLine1'))
  948. var option = {
  949. tooltip: {
  950. trigger: 'axis'
  951. },
  952. legend: {
  953. data: ['泌乳牛干物质采食量', '泌乳牛产奶量'],
  954. right: 10
  955. },
  956. grid: {
  957. top: '20%',
  958. left: '8%',
  959. right: '8%',
  960. containLabel: true
  961. },
  962. xAxis: [
  963. {
  964. type: 'category',
  965. data: chartLine_data.data1
  966. }
  967. ],
  968. yAxis: [
  969. {
  970. splitLine: { show: false }, type: 'value',
  971. name: '泌乳牛干物质\n采食量',
  972. axisLabel: {
  973. formatter: '{value} '
  974. }
  975. }, {
  976. splitLine: { show: false }, type: 'value',
  977. name: '泌乳牛产奶量',
  978. axisLabel: {
  979. formatter: '{value} '
  980. }
  981. }
  982. ],
  983. series: [{
  984. name: '泌乳牛干物质采食量',
  985. type: 'bar',
  986. itemStyle: { /* 设置柱状颜色*/
  987. normal: {
  988. color: '#61a5e8'
  989. }
  990. },
  991. data: chartLine_data.data2
  992. }, {
  993. name: '泌乳牛产奶量',
  994. type: 'line',
  995. itemStyle: { /* 设置折线颜色*/
  996. normal: {
  997. color: '#ff2d2d'
  998. }
  999. },
  1000. yAxisIndex: 1,
  1001. data: chartLine_data.data3
  1002. }]
  1003. }
  1004. this.tab.chart1.chartLine.setOption(option)
  1005. window.onresize = function() {
  1006. this.tab.chart1.chartLine.resize()
  1007. }
  1008. },
  1009. // 牛栏剩料率
  1010. changeStatisticChart2(arr) {
  1011. var arr1 = []
  1012. for (let i = 0; i < arr.length; i++) {
  1013. if (arr[i] !== 'all') {
  1014. arr1.push(arr[i])
  1015. }
  1016. }
  1017. this.tab.chart2.getdataListParm.parammaps.statisticsList = arr1
  1018. var arrData3 = []
  1019. for (let i = 0; i < this.tab.chart2.getdataListParm.parammaps.statisticsList.length; i++) {
  1020. const myId = this.tab.chart2.statisticsList.find(obj => obj.name == this.tab.chart2.getdataListParm.parammaps.statisticsList[i]).id
  1021. for (let j = 0; j < this.tab.chart2.chart2Data3.length; j++) {
  1022. if (j == myId) {
  1023. arrData3.push(this.tab.chart2.chart2Data3[j])
  1024. }
  1025. }
  1026. }
  1027. this.tab.chart2.chartLine_data.data3 = arrData3
  1028. this.tab.chart2.chartLine_data.data1 = this.tab.chart2.getdataListParm.parammaps.statisticsList
  1029. this.roadChartLine2(this.tab.chart2.chartLine_data)
  1030. },
  1031. getChart2() {
  1032. this.tab.chart2.listLoading = true
  1033. GetReportform(this.tab.chart2.getdataListParm).then(response => {
  1034. console.log('转化率图表数据', response.data.list)
  1035. if (response.data.list !== null) {
  1036. for (let i = 0; i < response.data.data.length; i++) {
  1037. if (response.data.data[i].剩料量 !== '' && response.data.data[i].剩料量 !== undefined) {
  1038. response.data.data[i].剩料量 = parseFloat(response.data.data[i].剩料量)
  1039. }
  1040. if (response.data.data[i].撒料量 !== '' && response.data.data[i].撒料量 !== undefined) {
  1041. response.data.data[i].撒料量 = parseFloat(response.data.data[i].撒料量)
  1042. }
  1043. if (response.data.data[i].准确率 !== '' && response.data.data[i].准确率 !== undefined) {
  1044. response.data.data[i].准确率 = parseFloat(response.data.data[i].准确率)
  1045. }
  1046. }
  1047. this.tab.chart2.table.list = response.data.data
  1048. this.tab.chart2.chartLine_data = response.data.list
  1049. this.tab.chart2.total = response.data.total
  1050. this.tab.chart2.statisticsList = []
  1051. this.tab.chart2.getdataListParm.parammaps.statisticsList = []
  1052. for (let i = 0; i < response.data.list.data1.length; i++) {
  1053. if (i < 10) {
  1054. this.tab.chart2.getdataListParm.parammaps.statisticsList.push(response.data.list.data1[i])
  1055. }
  1056. var obj = {}
  1057. obj.id = i
  1058. obj.name = response.data.list.data1[i]
  1059. this.tab.chart2.statisticsList.push(obj)
  1060. }
  1061. this.tab.chart2.chart2Data3 = response.data.list.data3
  1062. this.tab.chart2.total = response.data.total
  1063. console.log('牛栏剩料率图数据', this.tab.chart2.chartLine_data)
  1064. console.log('牛栏剩料率表数据', this.tab.chart2.table.list)
  1065. var arrData3 = []
  1066. for (let i = 0; i < this.tab.chart2.getdataListParm.parammaps.statisticsList.length; i++) {
  1067. const myId = this.tab.chart2.statisticsList.find(obj => obj.name == this.tab.chart2.getdataListParm.parammaps.statisticsList[i]).id
  1068. for (let j = 0; j < this.tab.chart2.chart2Data3.length; j++) {
  1069. if (j == myId) {
  1070. arrData3.push(this.tab.chart2.chart2Data3[j])
  1071. }
  1072. }
  1073. }
  1074. this.tab.chart2.chartLine_data.data3 = arrData3
  1075. this.tab.chart2.chartLine_data.data1 = this.tab.chart2.getdataListParm.parammaps.statisticsList
  1076. this.roadChartLine2(this.tab.chart2.chartLine_data)
  1077. } else {
  1078. this.tab.chart2.list = []
  1079. }
  1080. setTimeout(() => {
  1081. this.tab.chart2.listLoading = false
  1082. }, 100)
  1083. })
  1084. },
  1085. roadChartLine2(chartLine_data) {
  1086. if (this.tab.chart2.chartLine != null) {
  1087. this.tab.chart2.chartLine.dispose()
  1088. }
  1089. this.tab.chart2.chartLine = echarts.init(document.getElementById('chartLine2'))
  1090. var option = {
  1091. title: {
  1092. text: ''
  1093. },
  1094. tooltip: {
  1095. trigger: 'axis'
  1096. },
  1097. legend: {
  1098. data: chartLine_data.data1,
  1099. right: 10
  1100. },
  1101. grid: {
  1102. top: '20%',
  1103. left: '3%',
  1104. right: '8%',
  1105. containLabel: true
  1106. },
  1107. toolbox: {
  1108. show: true,
  1109. right: '2%',
  1110. feature: {}
  1111. },
  1112. xAxis: { type: 'category', boundaryGap: false, data: chartLine_data.data2, name: '日期' },
  1113. yAxis: {
  1114. type: 'value', name: '剩料率', axisLabel: { formatter: '{value} %' }
  1115. },
  1116. series: (function() {
  1117. var serie = []
  1118. for (var i = 0; i < chartLine_data.data3.length; i++) {
  1119. var item = {
  1120. name: chartLine_data.data1[i],
  1121. type: 'line',
  1122. data: chartLine_data.data3[i].data
  1123. }
  1124. serie.push(item)
  1125. }
  1126. return serie
  1127. }())
  1128. }
  1129. this.tab.chart2.chartLine.setOption(option)
  1130. window.onresize = function() {
  1131. this.tab.chart2.chartLine.resize()
  1132. }
  1133. },
  1134. // 混料时间统计
  1135. getChart3() {
  1136. this.tab.chart3.listLoading = true
  1137. GetReportform(this.tab.chart3.getdataListParm).then(response => {
  1138. console.log('混料时间统计图表数据', response.data.list)
  1139. if (response.data.list !== null) {
  1140. this.tab.chart3.table.list = response.data.data
  1141. this.tab.chart3.chartLine_data = response.data.list
  1142. this.tab.chart3.total = response.data.total
  1143. this.tab.chart3.total = response.data.total
  1144. this.roadChartLine3(this.tab.chart3.chartLine_data)
  1145. } else {
  1146. this.tab.chart3.list = []
  1147. }
  1148. setTimeout(() => {
  1149. this.tab.chart3.listLoading = false
  1150. }, 100)
  1151. })
  1152. },
  1153. roadChartLine3(chartLine_data) {
  1154. if (this.tab.chart3.chartLine != null) {
  1155. this.tab.chart3.chartLine.dispose()
  1156. }
  1157. this.tab.chart3.chartLine = echarts.init(document.getElementById('chartLine3'))
  1158. var option = {
  1159. title: {
  1160. text: ''
  1161. },
  1162. tooltip: {
  1163. trigger: 'axis'
  1164. },
  1165. legend: {
  1166. data: ['混料时间'],
  1167. right: 10
  1168. },
  1169. grid: {
  1170. top: '20%',
  1171. left: '5%',
  1172. right: '8%',
  1173. containLabel: true
  1174. },
  1175. toolbox: {
  1176. show: true,
  1177. right: '2%',
  1178. feature: {}
  1179. },
  1180. xAxis: { type: 'category', boundaryGap: false, data: chartLine_data.data1, name: '日期' },
  1181. yAxis: {
  1182. type: 'value', name: '分钟',
  1183. axisLabel: {
  1184. formatter: '{value}min'
  1185. }
  1186. },
  1187. series: [
  1188. {
  1189. name: '混料时间',
  1190. type: 'line',
  1191. stack: '总量',
  1192. data: chartLine_data.data2
  1193. }
  1194. ]
  1195. }
  1196. this.tab.chart3.chartLine.setOption(option)
  1197. window.onresize = function() {
  1198. this.tab.chart3.chartLine.resize()
  1199. }
  1200. },
  1201. // 转化率
  1202. changeStatisticChart4(arr) {
  1203. var arr1 = []
  1204. for (let i = 0; i < arr.length; i++) {
  1205. if (arr[i] !== 'all') {
  1206. arr1.push(arr[i])
  1207. }
  1208. }
  1209. this.tab.chart4.getdataListParm.parammaps.statisticsList = arr1
  1210. var arrData3 = []
  1211. for (let i = 0; i < this.tab.chart4.getdataListParm.parammaps.statisticsList.length; i++) {
  1212. const myId = this.tab.chart4.statisticsList.find(obj => obj.name == this.tab.chart4.getdataListParm.parammaps.statisticsList[i]).id
  1213. for (let j = 0; j < this.tab.chart4.chart4Data3.length; j++) {
  1214. if (j == myId) {
  1215. arrData3.push(this.tab.chart4.chart4Data3[j])
  1216. }
  1217. }
  1218. }
  1219. this.tab.chart4.chartLine_data.data3 = arrData3
  1220. this.tab.chart4.chartLine_data.data1 = this.tab.chart4.getdataListParm.parammaps.statisticsList
  1221. this.roadChartLine4(this.tab.chart4.chartLine_data)
  1222. },
  1223. getChart4() {
  1224. this.tab.chart4.listLoading = true
  1225. GetReportform(this.tab.chart4.getdataListParm).then(response => {
  1226. console.log('转化率图表数据', response.data.list)
  1227. if (response.data.list !== null) {
  1228. this.tab.chart4.table.list = response.data.data
  1229. this.tab.chart4.chartLine_data = response.data.list
  1230. this.tab.chart4.total = response.data.total
  1231. this.$set(this.tab.chart4, 'statisticsList', [])
  1232. this.$set(this.tab.chart4.getdataListParm.parammaps, 'statisticsList', [])
  1233. for (let i = 0; i < response.data.list.data1.length; i++) {
  1234. if (i < 10) {
  1235. this.tab.chart4.getdataListParm.parammaps.statisticsList.push(response.data.list.data1[i])
  1236. }
  1237. var obj = {}
  1238. obj.id = i
  1239. obj.name = response.data.list.data1[i]
  1240. this.tab.chart4.statisticsList.push(obj)
  1241. }
  1242. this.tab.chart4.chart4Data3 = response.data.list.data3
  1243. this.tab.chart4.total = response.data.total
  1244. console.log('转化率图数据-下拉数据', this.tab.chart4.statisticsList)
  1245. console.log('转化率图数据-下拉数据', this.tab.chart4.getdataListParm.parammaps.statisticsList)
  1246. console.log('转化率图数据', this.tab.chart4.chartLine_data)
  1247. console.log('转化率表数据', this.tab.chart4.table.list)
  1248. var arrData3 = []
  1249. for (let i = 0; i < this.tab.chart4.getdataListParm.parammaps.statisticsList.length; i++) {
  1250. const myId = this.tab.chart4.statisticsList.find(obj => obj.name == this.tab.chart4.getdataListParm.parammaps.statisticsList[i]).id
  1251. for (let j = 0; j < this.tab.chart4.chart4Data3.length; j++) {
  1252. if (j == myId) {
  1253. arrData3.push(this.tab.chart4.chart4Data3[j])
  1254. }
  1255. }
  1256. }
  1257. console.log(arrData3, 'woyaokankan2')
  1258. // this.tab.chart4.statisticsList
  1259. this.tab.chart4.chartLine_data.data3 = arrData3
  1260. this.tab.chart4.chartLine_data.data1 = this.tab.chart4.getdataListParm.parammaps.statisticsList
  1261. this.roadChartLine4(this.tab.chart4.chartLine_data)
  1262. } else {
  1263. this.tab.chart4.list = []
  1264. }
  1265. setTimeout(() => {
  1266. this.tab.chart4.listLoading = false
  1267. }, 100)
  1268. })
  1269. },
  1270. roadChartLine4(chartLine_data) {
  1271. if (this.tab.chart4.chartLine != null) {
  1272. this.tab.chart4.chartLine.dispose()
  1273. }
  1274. this.tab.chart4.chartLine = echarts.init(document.getElementById('chartLine4'))
  1275. var option = {
  1276. title: {
  1277. text: ''
  1278. },
  1279. tooltip: {
  1280. trigger: 'axis'
  1281. },
  1282. legend: {
  1283. data: chartLine_data.data1,
  1284. right: 10
  1285. },
  1286. grid: {
  1287. top: '20%',
  1288. left: '3%',
  1289. right: '8%',
  1290. containLabel: true
  1291. },
  1292. toolbox: {
  1293. show: true,
  1294. right: '2%',
  1295. feature: {}
  1296. },
  1297. xAxis: { type: 'category', boundaryGap: false, data: chartLine_data.data2, name: '日期' },
  1298. yAxis: {
  1299. type: 'value', name: '百分比', axisLabel: { formatter: '{value} %' }
  1300. },
  1301. series: (function() {
  1302. var serie = []
  1303. for (var i = 0; i < chartLine_data.data3.length; i++) {
  1304. var item = {
  1305. name: chartLine_data.data1[i],
  1306. type: 'line',
  1307. data: chartLine_data.data3[i].data
  1308. }
  1309. serie.push(item)
  1310. }
  1311. return serie
  1312. }())
  1313. }
  1314. this.tab.chart4.chartLine.setOption(option)
  1315. window.onresize = function() {
  1316. this.tab.chart4.chartLine.resize()
  1317. }
  1318. },
  1319. // 成本分析
  1320. changeStatisticChart5(arr) {
  1321. var arr1 = []
  1322. for (let i = 0; i < arr.length; i++) {
  1323. if (arr[i] !== 'all') {
  1324. arr1.push(arr[i])
  1325. }
  1326. }
  1327. this.tab.chart5.getdataListParm.parammaps.statisticsList = arr1
  1328. var arrData3 = []
  1329. for (let i = 0; i < this.tab.chart5.getdataListParm.parammaps.statisticsList.length; i++) {
  1330. const myId = this.tab.chart5.statisticsList.find(obj => obj.name == this.tab.chart5.getdataListParm.parammaps.statisticsList[i]).id
  1331. for (let j = 0; j < this.tab.chart5.chart5Data3.length; j++) {
  1332. if (j == myId) {
  1333. arrData3.push(this.tab.chart5.chart5Data3[j])
  1334. }
  1335. }
  1336. }
  1337. this.tab.chart5.chartLine_data.data3 = arrData3
  1338. this.tab.chart5.chartLine_data.data1 = this.tab.chart5.getdataListParm.parammaps.statisticsList
  1339. this.roadChartLine5(this.tab.chart5.chartLine_data)
  1340. },
  1341. getChart5() {
  1342. this.tab.chart5.listLoading = true
  1343. GetReportform(this.tab.chart5.getdataListParm).then(response => {
  1344. console.log('转化率图表数据', response.data.list)
  1345. if (response.data.list !== null) {
  1346. this.tab.chart5.table.list = response.data.data
  1347. this.tab.chart5.chartLine_data = response.data.list
  1348. this.tab.chart5.total = response.data.total
  1349. this.tab.chart5.statisticsList = []
  1350. this.tab.chart5.getdataListParm.parammaps.statisticsList = []
  1351. for (let i = 0; i < response.data.list.data1.length; i++) {
  1352. if (i < 10) {
  1353. this.tab.chart5.getdataListParm.parammaps.statisticsList.push(response.data.list.data1[i])
  1354. }
  1355. var obj = {}
  1356. obj.id = i
  1357. obj.name = response.data.list.data1[i]
  1358. this.tab.chart5.statisticsList.push(obj)
  1359. }
  1360. this.tab.chart5.chart5Data3 = response.data.list.data3
  1361. this.tab.chart5.total = response.data.total
  1362. console.log('转化率图数据', this.tab.chart5.chartLine_data)
  1363. console.log('转化率表数据', this.tab.chart5.table.list)
  1364. var arrData3 = []
  1365. for (let i = 0; i < this.tab.chart5.getdataListParm.parammaps.statisticsList.length; i++) {
  1366. const myId = this.tab.chart5.statisticsList.find(obj => obj.name == this.tab.chart5.getdataListParm.parammaps.statisticsList[i]).id
  1367. for (let j = 0; j < this.tab.chart5.chart5Data3.length; j++) {
  1368. if (j == myId) {
  1369. arrData3.push(this.tab.chart5.chart5Data3[j])
  1370. }
  1371. }
  1372. }
  1373. this.tab.chart5.chartLine_data.data3 = arrData3
  1374. this.tab.chart5.chartLine_data.data1 = this.tab.chart5.getdataListParm.parammaps.statisticsList
  1375. this.roadChartLine5(this.tab.chart5.chartLine_data)
  1376. } else {
  1377. this.tab.chart5.list = []
  1378. }
  1379. setTimeout(() => {
  1380. this.tab.chart5.listLoading = false
  1381. }, 100)
  1382. })
  1383. },
  1384. roadChartLine5(chartLine_data) {
  1385. if (this.tab.chart5.chartLine != null) {
  1386. this.tab.chart5.chartLine.dispose()
  1387. }
  1388. this.tab.chart5.chartLine = echarts.init(document.getElementById('chartLine5'))
  1389. var option = {
  1390. title: {
  1391. text: ''
  1392. },
  1393. tooltip: {
  1394. trigger: 'axis'
  1395. },
  1396. legend: {
  1397. data: chartLine_data.data1,
  1398. right: 10
  1399. },
  1400. grid: {
  1401. top: '20%',
  1402. left: '5%',
  1403. right: '8%',
  1404. containLabel: true
  1405. },
  1406. toolbox: {
  1407. show: true,
  1408. right: '2%',
  1409. feature: {}
  1410. },
  1411. xAxis: { type: 'category', boundaryGap: false, data: chartLine_data.data2, name: '日期' },
  1412. yAxis: {
  1413. type: 'value', name: '公斤奶饲料成本(元)'
  1414. },
  1415. series: (function() {
  1416. var serie = []
  1417. for (var i = 0; i < chartLine_data.data3.length; i++) {
  1418. var item = {
  1419. name: chartLine_data.data1[i],
  1420. type: 'line',
  1421. data: chartLine_data.data3[i].data
  1422. }
  1423. serie.push(item)
  1424. }
  1425. return serie
  1426. }())
  1427. }
  1428. this.tab.chart5.chartLine.setOption(option)
  1429. window.onresize = function() {
  1430. this.tab.chart5.chartLine.resize()
  1431. }
  1432. },
  1433. // 时间
  1434. changeChartDate(item) {
  1435. console.log(item)
  1436. if (item == 'chart1') {
  1437. if (this.tab.chart1.getdataListParm.parammaps.inputDatetime !== '' && this.tab.chart1.getdataListParm.parammaps.inputDatetime !== null) {
  1438. this.tab.chart1.getdataListParm.parammaps.startTime = parseTime(this.tab.chart1.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  1439. this.tab.chart1.getdataListParm.parammaps.stopTime = parseTime(this.tab.chart1.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  1440. this.getChart1()
  1441. } else {
  1442. this.tab.chart1.getdataListParm.parammaps.inputDatetime = ''
  1443. this.tab.chart1.getdataListParm.parammaps.startTime = ''
  1444. this.tab.chart1.getdataListParm.parammaps.stopTime = ''
  1445. this.getChart1()
  1446. }
  1447. } else if (item == 'chart2') {
  1448. if (this.tab.chart2.getdataListParm.parammaps.inputDatetime !== '' && this.tab.chart2.getdataListParm.parammaps.inputDatetime !== null) {
  1449. this.tab.chart2.getdataListParm.parammaps.startTime = parseTime(this.tab.chart2.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  1450. this.tab.chart2.getdataListParm.parammaps.stopTime = parseTime(this.tab.chart2.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  1451. this.getChart2()
  1452. } else {
  1453. this.tab.chart2.getdataListParm.parammaps.inputDatetime = ''
  1454. this.tab.chart2.getdataListParm.parammaps.startTime = ''
  1455. this.tab.chart2.getdataListParm.parammaps.stopTime = ''
  1456. this.getChart2()
  1457. }
  1458. } else if (item == 'chart3') {
  1459. if (this.tab.chart3.getdataListParm.parammaps.inputDatetime !== '' && this.tab.chart3.getdataListParm.parammaps.inputDatetime !== null) {
  1460. this.tab.chart3.getdataListParm.parammaps.startTime = parseTime(this.tab.chart3.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  1461. this.tab.chart3.getdataListParm.parammaps.stopTime = parseTime(this.tab.chart3.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  1462. this.getChart3()
  1463. } else {
  1464. this.tab.chart3.getdataListParm.parammaps.inputDatetime = ''
  1465. this.tab.chart3.getdataListParm.parammaps.startTime = ''
  1466. this.tab.chart3.getdataListParm.parammaps.stopTime = ''
  1467. this.getChart3()
  1468. }
  1469. } else if (item == 'chart4') {
  1470. if (this.tab.chart4.getdataListParm.parammaps.inputDatetime !== '' && this.tab.chart4.getdataListParm.parammaps.inputDatetime !== null) {
  1471. this.tab.chart4.getdataListParm.parammaps.startTime = parseTime(this.tab.chart4.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  1472. this.tab.chart4.getdataListParm.parammaps.stopTime = parseTime(this.tab.chart4.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  1473. this.getChart4()
  1474. } else {
  1475. this.tab.chart4.getdataListParm.parammaps.inputDatetime = ''
  1476. this.tab.chart4.getdataListParm.parammaps.startTime = ''
  1477. this.tab.chart4.getdataListParm.parammaps.stopTime = ''
  1478. this.getChart4()
  1479. }
  1480. } else if (item == 'chart5') {
  1481. if (this.tab.chart5.getdataListParm.parammaps.inputDatetime !== '' && this.tab.chart5.getdataListParm.parammaps.inputDatetime !== null) {
  1482. this.tab.chart5.getdataListParm.parammaps.startTime = parseTime(this.tab.chart5.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  1483. this.tab.chart5.getdataListParm.parammaps.stopTime = parseTime(this.tab.chart5.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  1484. this.getChart5()
  1485. } else {
  1486. this.tab.chart5.getdataListParm.parammaps.inputDatetime = ''
  1487. this.tab.chart5.getdataListParm.parammaps.startTime = ''
  1488. this.tab.chart5.getdataListParm.parammaps.stopTime = ''
  1489. this.getChart5()
  1490. }
  1491. }
  1492. },
  1493. // 导出
  1494. handleExport(item) {
  1495. if (item == 'chart1') {
  1496. console.log('泌乳牛干物质采食量导出')
  1497. var excelDatasTabChart1 = [
  1498. {
  1499. tHeader: ['日期', '泌乳牛采食量', '泌乳牛产奶量'],
  1500. filterVal: ['日期', 'field1', 'field2'],
  1501. tableDatas: this.tab.chart1.table.list,
  1502. sheetName: '泌乳牛采食量'
  1503. }
  1504. ]
  1505. json2excel(excelDatasTabChart1, '泌乳牛采食量', true, 'xlsx')
  1506. } else if (item == 'chart2') {
  1507. console.log('牛栏剩料率导出')
  1508. var excelDatasTabChart2 = [
  1509. {
  1510. tHeader: ['日期', '栏舍名称', '剩料量', '撒料量', '剩料率'],
  1511. filterVal: ['日期', '名称', '剩料量', '撒料量', '准确率'],
  1512. tableDatas: this.tab.chart2.table.list,
  1513. sheetName: '牛栏剩料率'
  1514. }
  1515. ]
  1516. json2excel(excelDatasTabChart2, '牛栏剩料率', true, 'xlsx')
  1517. } else if (item == 'chart3') {
  1518. console.log('混料时间统计导出')
  1519. var excelDatasTabChart3 = [
  1520. {
  1521. tHeader: ['日期', '混料时间(分钟)'],
  1522. filterVal: ['日期', 'field1'],
  1523. tableDatas: this.tab.chart3.table.list,
  1524. sheetName: '混料时间统计'
  1525. }
  1526. ]
  1527. json2excel(excelDatasTabChart3, '混料时间统计', true, 'xlsx')
  1528. } else if (item == 'chart4') {
  1529. console.log('转化率导出')
  1530. var excelDatasTabChart4 = [
  1531. {
  1532. tHeader: ['日期', '配方名称', '饲料转化率'],
  1533. filterVal: ['日期', '名称', '准确率'],
  1534. tableDatas: this.tab.chart4.table.list,
  1535. sheetName: '转化率统计'
  1536. }
  1537. ]
  1538. json2excel(excelDatasTabChart4, '转化率', true, 'xlsx')
  1539. } else if (item == 'chart5') {
  1540. console.log('成本分析导出')
  1541. var excelDatasTabChart5 = [
  1542. {
  1543. tHeader: ['日期', '牲畜类别', '公斤奶饲料成本(元)'],
  1544. filterVal: ['日期', '名称', '准确率'],
  1545. tableDatas: this.tab.chart5.table.list,
  1546. sheetName: '成本分析'
  1547. }
  1548. ]
  1549. json2excel(excelDatasTabChart5, '成本分析', true, 'xlsx')
  1550. }
  1551. },
  1552. // 切换表格
  1553. handleTable(item) {
  1554. // 显示切换表格
  1555. if (item == 'chart1') {
  1556. console.log('泌乳牛采食量表格')
  1557. this.tab.chart1.isTable = true
  1558. this.tab.chart1.isChart = false
  1559. } else if (item == 'chart2') {
  1560. console.log('牛栏剩料率表格')
  1561. this.tab.chart2.isTable = true
  1562. this.tab.chart2.isChart = false
  1563. } else if (item == 'chart3') {
  1564. console.log('混料时间统计表格')
  1565. this.tab.chart3.isTable = true
  1566. this.tab.chart3.isChart = false
  1567. } else if (item == 'chart4') {
  1568. console.log('转化率表格')
  1569. this.tab.chart4.isTable = true
  1570. this.tab.chart4.isChart = false
  1571. } else if (item == 'chart5') {
  1572. console.log('成本分析表格')
  1573. this.tab.chart5.isTable = true
  1574. this.tab.chart5.isChart = false
  1575. }
  1576. },
  1577. // 切换图表
  1578. handleChart(item) {
  1579. // 显示切换图表
  1580. if (item == 'chart1') {
  1581. console.log('泌乳牛采食量图表')
  1582. this.tab.chart1.isTable = false
  1583. this.tab.chart1.isChart = true
  1584. this.getChart1()
  1585. } else if (item == 'chart2') {
  1586. console.log('牛栏剩料率图表')
  1587. this.tab.chart2.isTable = false
  1588. this.tab.chart2.isChart = true
  1589. this.getChart2()
  1590. } else if (item == 'chart3') {
  1591. console.log('混料时间统计图表')
  1592. this.tab.chart3.isTable = false
  1593. this.tab.chart3.isChart = true
  1594. this.getChart3()
  1595. } else if (item == 'chart4') {
  1596. console.log('转化率图表')
  1597. this.tab.chart4.isTable = false
  1598. this.tab.chart4.isChart = true
  1599. this.getChart4()
  1600. } else if (item == 'chart5') {
  1601. console.log('成本分析图表')
  1602. this.tab.chart5.isTable = false
  1603. this.tab.chart5.isChart = true
  1604. this.getChart5()
  1605. }
  1606. },
  1607. // 切换tab2日期
  1608. changeTab2Date() {
  1609. this.getTab2List()
  1610. this.getTab2List2()
  1611. this.getTab2List3()
  1612. this.getTab2List4()
  1613. },
  1614. // 宾州筛分析
  1615. getTab2List() {
  1616. this.tab2.table.listLoading = true
  1617. GetDataByName(this.tab2.table.getdataListParm).then(response => {
  1618. console.log('宾州筛分析table数据', response.data.list)
  1619. if (response.data.list !== null) {
  1620. this.tab2.table.list = response.data.list
  1621. this.tab2.table.total = response.data.total
  1622. } else {
  1623. this.tab2.table.list = []
  1624. }
  1625. setTimeout(() => {
  1626. this.tab2.table.listLoading = false
  1627. }, 100)
  1628. })
  1629. },
  1630. // 粪便筛分析
  1631. getTab2List2() {
  1632. this.tab2.table2.listLoading = true
  1633. this.tab2.table2.getdataListParm.parammaps.date = this.tab2.table.getdataListParm.parammaps.date
  1634. GetDataByName(this.tab2.table2.getdataListParm).then(response => {
  1635. console.log('粪便筛分析table数据', response.data.list)
  1636. if (response.data.list !== null) {
  1637. this.tab2.table2.list = response.data.list
  1638. this.tab2.table2.total = response.data.total
  1639. } else {
  1640. this.tab2.table2.list = []
  1641. }
  1642. setTimeout(() => {
  1643. this.tab2.table2.listLoading = false
  1644. }, 100)
  1645. })
  1646. },
  1647. // BCS评分
  1648. getTab2List3() {
  1649. this.tab2.table3.listLoading = true
  1650. this.tab2.table3.getdataListParm.parammaps.date = this.tab2.table.getdataListParm.parammaps.date
  1651. GetDataByName(this.tab2.table3.getdataListParm).then(response => {
  1652. console.log('BCS评分table数据', response.data.list)
  1653. if (response.data.list !== null) {
  1654. this.tab2.table3.list = response.data.list
  1655. this.tab2.table3.total = response.data.total
  1656. } else {
  1657. this.tab2.table3.list = []
  1658. }
  1659. setTimeout(() => {
  1660. this.tab2.table3.listLoading = false
  1661. }, 100)
  1662. })
  1663. },
  1664. // 粪便评分
  1665. getTab2List4() {
  1666. this.tab2.table4.listLoading = true
  1667. this.tab2.table4.getdataListParm.parammaps.date = this.tab2.table.getdataListParm.parammaps.date
  1668. GetDataByName(this.tab2.table4.getdataListParm).then(response => {
  1669. console.log('成本分析table数据', response.data.list)
  1670. if (response.data.list !== null) {
  1671. this.tab2.table4.list = response.data.list
  1672. this.tab2.table4.total = response.data.total
  1673. } else {
  1674. this.tab2.table4.list = []
  1675. }
  1676. setTimeout(() => {
  1677. this.tab2.table4.listLoading = false
  1678. }, 100)
  1679. })
  1680. }
  1681. }
  1682. }
  1683. </script>
  1684. <style lang="scss" scoped>
  1685. .button{
  1686. height: 50px;
  1687. .exportTable{float: right;margin-right: 5px;}
  1688. }
  1689. .app-container1{padding-left: 10px;background-color: #F4F4F4;}
  1690. .dashboard-editor-container {
  1691. background-color: #F4F4F4;
  1692. .grid-content{
  1693. background-color:#fff;padding: 0 10px;
  1694. h4{text-align: center;line-height: 50px;}
  1695. }
  1696. }
  1697. </style>