44075af311f8b527c4d997416216283aadb5ab15.svn-base 80 KB

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