92cbb1292a0ea299dae2c2848c1e2f2531f1a851.svn-base 124 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497
  1. <template>
  2. <div class="app-container">
  3. <h1>牧场</h1>
  4. <el-tabs v-model="activeName" @tab-click="handleTabClick">
  5. <el-tab-pane label="汇总统计" name="first">
  6. <div class="search">
  7. <el-date-picker v-model="tab.table.getdataListParm.parammaps.inputDatetime" :clearable="false" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 250px;" :picker-options="pickerOptions" />
  8. <span style="margin-left: 10px;">统计类型:</span>
  9. <el-radio v-model="tab.radio" label="1" @change="changeRadio">配方名称</el-radio>
  10. <el-radio v-model="tab.radio" label="2" @change="changeRadio">栏舍名称</el-radio>
  11. <el-radio v-model="tab.radio" label="3" @change="changeRadio">牲畜类别</el-radio>
  12. <el-radio v-model="tab.radio" label="4" @change="changeRadio">车次</el-radio>
  13. <el-checkbox v-model="tab.checked" style="margin-right: 10px;" @change="changeChecked">按日期统计</el-checkbox>
  14. <el-input v-if="tab.isFormulaName" v-model="tab.table.getdataListParm.parammaps.fname" class="filter-item" style="width: 140px;" placeholder="配方名称" />
  15. <el-input v-if="tab.isHouseName" v-model="tab.table.getdataListParm.parammaps.fname" class="filter-item" style="width: 140px;" placeholder="栏舍名称" />
  16. <el-input v-if="tab.isLivestockType" v-model="tab.table.getdataListParm.parammaps.fname" class="filter-item" style="width: 140px;" placeholder="牲畜名称" />
  17. <el-input v-if="tab.isTrainNumber" v-model="tab.table.getdataListParm.parammaps.sort" class="filter-item" style="width: 100px;" placeholder="车次" />
  18. <el-input v-if="tab.isTrainNumber" v-model="tab.table.getdataListParm.parammaps.times" class="filter-item" style="width: 100px;" placeholder="班次" />
  19. <el-input v-if="tab.isTrainNumber" v-model="tab.table.getdataListParm.parammaps.fname" class="filter-item" style="width: 100px;" placeholder="TMR名称" />
  20. <el-button class="successBorder" @click="handleSearch">查询</el-button>
  21. <el-button class="export" @click="handleDownload">导出</el-button>
  22. <svg-icon icon-class="down" style="width: 40px;height: 40px;float: right;" @click="handleQuickJumpChart" />
  23. </div>
  24. <div class="table">
  25. <h4>混料</h4>
  26. <el-table
  27. :key="tab.table.tableKey"
  28. v-loading="tab.table.listLoading"
  29. element-loading-text="给我一点时间"
  30. :data="tab.table.list"
  31. border
  32. fit
  33. highlight-current-row
  34. style="width: 100%;"
  35. :row-style="rowStyle"
  36. :cell-style="cellStyle"
  37. class="elTable table-fixed"
  38. >
  39. <el-table-column v-if="tab.checked" label="日期" min-width="90px" align="center" prop="日期" />
  40. <el-table-column v-if="tab.isFormulaName" label="配方名称" min-width="100px" align="center" prop="配方名称" />
  41. <el-table-column v-if="tab.isHouseName" label="栏舍名称" min-width="100px" align="center" prop="栏舍名称" />
  42. <el-table-column v-if="tab.isLivestockType" label="牲畜类别" min-width="100px" align="center" prop="牲畜类别" />
  43. <el-table-column v-if="tab.isTrainNumber" label="车次" min-width="100px" align="center" prop="车次" />
  44. <el-table-column v-if="tab.isTrainNumber" label="班次" min-width="100px" align="center" prop="班次" />
  45. <el-table-column v-if="tab.isTrainNumber" label="TMR名称" min-width="100px" align="center" prop="TMR名称" />
  46. <el-table-column v-if="tab.isTrainNumber" label="驾驶员" min-width="100px" align="center" prop="驾驶员" />
  47. <el-table-column label="理论重量" min-width="90px" align="center" prop="理论重量" />
  48. <el-table-column label="实际重量" min-width="90px" align="center" prop="实际重量" />
  49. <el-table-column label="计划混料操作数" min-width="90px" align="center" prop="计划混料操作数" />
  50. <el-table-column label="已混料操作数" min-width="90px" align="center" prop="已混料操作数" />
  51. <el-table-column label="混料操作率" min-width="100px" align="center" prop="混料操作率" />
  52. <el-table-column label="混料误差值" min-width="100px" align="center" prop="混料误差值" />
  53. <el-table-column label="混料准确率" min-width="100px" align="center" prop="混料准确率" />
  54. <el-table-column label="混料自动跳转次数" min-width="90px" align="center" prop="混料自动跳转次数" />
  55. <el-table-column label="混料手动跳转次数" min-width="90px" align="center" prop="混料手动跳转次数" />
  56. <el-table-column label="取消次数" min-width="90px" align="center" prop="取消次数" />
  57. <el-table-column label="方差" min-width="90px" align="center" prop="方差" />
  58. </el-table>
  59. <!-- <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" /> -->
  60. <h4>撒料</h4>
  61. <el-table
  62. :key="tab.table2.tableKey"
  63. v-loading="tab.table2.listLoading"
  64. element-loading-text="给我一点时间"
  65. :data="tab.table2.list"
  66. border
  67. fit
  68. highlight-current-row
  69. style="width: 100%;"
  70. :row-style="rowStyle"
  71. :cell-style="cellStyle"
  72. class="elTable table-fixed"
  73. >
  74. <el-table-column v-if="tab.checked" label="日期" min-width="90px" align="center" prop="日期" />
  75. <el-table-column v-if="tab.isFormulaName" label="配方名称" min-width="100px" align="center" prop="配方名称" />
  76. <el-table-column v-if="tab.isHouseName" label="栏舍名称" min-width="100px" align="center" prop="栏舍名称" />
  77. <el-table-column v-if="tab.isLivestockType" label="牲畜类别" min-width="100px" align="center" prop="牲畜类别" />
  78. <el-table-column v-if="tab.isTrainNumber" label="车次" min-width="100px" align="center" prop="车次" />
  79. <el-table-column v-if="tab.isTrainNumber" label="班次" min-width="100px" align="center" prop="班次" />
  80. <el-table-column v-if="tab.isTrainNumber" label="TMR名称" min-width="100px" align="center" prop="TMR名称" />
  81. <el-table-column v-if="tab.isTrainNumber" label="驾驶员" min-width="100px" align="center" prop="驾驶员" />
  82. <el-table-column label="理论重量" min-width="90px" align="center" prop="理论重量" />
  83. <el-table-column label="实际重量" min-width="90px" align="center" prop="实际重量" />
  84. <el-table-column label="计划撒料操作数" min-width="90px" align="center" prop="计划撒料操作数" />
  85. <el-table-column label="已撒料操作数" min-width="90px" align="center" prop="已撒料操作数" />
  86. <el-table-column label="撒料操作率" min-width="100px" align="center" prop="撒料操作率" />
  87. <el-table-column label="撒料误差值" min-width="100px" align="center" prop="撒料误差值" />
  88. <el-table-column label="撒料准确率" min-width="100px" align="center" prop="撒料准确率" />
  89. <el-table-column label="撒料自动跳转次数" width="90px" align="center" prop="撒料自动跳转次数" />
  90. <el-table-column label="撒料手动跳转次数" width="90px" align="center" prop="撒料手动跳转次数" />
  91. <el-table-column label="取消次数" min-width="90px" align="center" prop="取消次数" />
  92. <el-table-column label="方差" min-width="90px" align="center" prop="方差" />
  93. </el-table>
  94. <!-- <pagination v-show="tab.table2.total>=0" :total="tab.table2.total" :page.sync="tab.table2.getdataListParm.offset" :limit.sync="tab.table2.getdataListParm.pagecount" @pagination="getTabList2" /> -->
  95. </div>
  96. <div id="chartDate" style="height: 90px;" />
  97. <div class="AnalysisChart">
  98. <el-row :gutter="10">
  99. <el-col :span="2"><h4>图表查询时间:</h4></el-col>
  100. <el-col :span="22" style="margin-bottom: 40px;">
  101. <el-date-picker v-model="tab.chartDate" :clearable="false" style="width: 250px;margin-right: 10px;" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions" />
  102. <el-button class="successBorder" @click="handleChartDate">确认</el-button>
  103. <svg-icon icon-class="Up" style="width: 40px;height: 40px;float: right;" @click="handleQuickJumpTop" />
  104. </el-col>
  105. </el-row>
  106. <el-row :gutter="10">
  107. <!-- 计划统计 -->
  108. <el-col :span="12" style="position: relative;">
  109. <h4 style="text-align:center;">计划统计</h4>
  110. <div>
  111. <el-date-picker v-model="tab.chart2.getdataListParm.parammaps.inputDatetime" :clearable="false" style="width: 250px;" class="inputDatetime" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions" @change="changeChartDate('chart2')" />
  112. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleExport('chart2')">导出</el-button>
  113. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleTable('chart2')">切换表格</el-button>
  114. </div>
  115. <div id="chartLine2" style="width:100%;height:400px;" />
  116. <div v-if="tab.chart2.isTable" class="table" style="width: 100%;z-index: 1;position: absolute;top:19px;right: 0;">
  117. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleExport('chart2')">导出</el-button>
  118. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleChart('chart2')">切换图表</el-button>
  119. <el-table
  120. :key="tab.chart2.table.tableKey"
  121. v-loading="tab.chart2.table.listLoading"
  122. element-loading-text="给我一点时间"
  123. :data="tab.chart2.table.list"
  124. border
  125. fit
  126. highlight-current-row
  127. style="width: 100%;"
  128. height="430"
  129. :row-style="rowStyle"
  130. :cell-style="cellStyle"
  131. class="elTable table-fixed"
  132. >
  133. <el-table-column label="日期" sortable min-width="110px" align="center" prop="日期" />
  134. <el-table-column label="计划执行重量(kg)" sortable min-width="110px" align="center" prop="实际量" />
  135. <el-table-column label="配方理论重量(kg)" sortable min-width="110px" align="center" prop="理论量" />
  136. <el-table-column label="计划准确率" sortable min-width="110px" align="center" prop="field1" />
  137. <el-table-column label="计划取消重量(kg)" sortable min-width="110px" align="center" prop="计划取消重量" />
  138. <el-table-column label="计划准确率(去除取消重量)" sortable min-width="110px" align="center" prop="field3" />
  139. <el-table-column label="计划正确数" sortable min-width="110px" align="center" prop="正确数" />
  140. <el-table-column label="计划数" sortable min-width="110px" align="center" prop="计划数" />
  141. <el-table-column label="计划正确率" sortable min-width="110px" align="center" prop="field2" />
  142. </el-table>
  143. </div>
  144. </el-col>
  145. <!-- 配方准确率 -->
  146. <el-col :span="12" style="position: relative;">
  147. <h4 style="text-align:center;">配方准确率</h4>
  148. <div>
  149. <el-select v-model="tab.chart1.getdataListParm.parammaps.statisticsList" style="width: 200px;margin-right: 5px;" multiple collapse-tags placeholder="请选择统计参数" @visible-change="changeStatisticChart1()">
  150. <el-option v-for="item in tab.chart1.statisticsList" :key="item.name" :label="item.name" :value="item.name" />
  151. </el-select>
  152. <el-date-picker v-model="tab.chart1.getdataListParm.parammaps.inputDatetime" style="width: 250px;" class="inputDatetime filter-item" :clearable="false" type="daterange" range-separator="至" start-placeholder="开始日期" :picker-options="pickerOptions" end-placeholder="结束日期" @change="changeChartDate('chart1')" />
  153. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleExport('chart1')">导出</el-button>
  154. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleTable('chart1')">切换表格</el-button>
  155. </div>
  156. <div id="chartLine1" style="width:100%;height:400px;" />
  157. <div v-if="tab.chart1.isTable" class="table" style="width: 100%;z-index: 1;position: absolute;top:19px;right: 0;">
  158. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleExport('chart1')">导出</el-button>
  159. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleChart('chart1')">切换图表</el-button>
  160. <el-table
  161. :key="tab.chart1.table.tableKey"
  162. v-loading="tab.chart1.table.listLoading"
  163. element-loading-text="给我一点时间"
  164. :data="tab.chart1.table.list"
  165. border
  166. fit
  167. highlight-current-row
  168. style="width: 100%;"
  169. height="430"
  170. :row-style="rowStyle"
  171. :cell-style="cellStyle"
  172. class="elTable table-fixed"
  173. >
  174. <el-table-column label="日期" sortable min-width="90px" align="center" prop="日期" />
  175. <el-table-column label="配方名称" sortable min-width="90px" align="center" prop="名称" />
  176. <el-table-column label="计划重量(kg)" sortable min-width="100px" align="center" prop="理论量" />
  177. <el-table-column label="实际重量(kg)" sortable min-width="100px" align="center" prop="实际量" />
  178. <el-table-column label="准确率" sortable min-width="90px" align="center" prop="准确率" />
  179. </el-table>
  180. </div>
  181. </el-col>
  182. </el-row>
  183. <el-row :gutter="10">
  184. <!-- 牛群准确率 -->
  185. <el-col :span="12" style="position: relative;">
  186. <h4 style="text-align:center;">牛群准确率</h4>
  187. <div>
  188. <el-select v-model="tab.chart3.getdataListParm.parammaps.statisticsList" style="width: 200px;margin-right: 5px;" multiple collapse-tags placeholder="请选择统计参数" @visible-change="changeStatisticChart3()">
  189. <el-option v-for="item in tab.chart3.statisticsList" :key="item.name" :label="item.name" :value="item.name" />
  190. </el-select>
  191. <el-date-picker v-model="tab.chart3.getdataListParm.parammaps.inputDatetime" style="width: 250px;" :clearable="false" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" :picker-options="pickerOptions" end-placeholder="结束日期" @change="changeChartDate('chart3')" />
  192. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleExport('chart3')">导出</el-button>
  193. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleTable('chart3')">切换表格</el-button>
  194. </div>
  195. <div id="chartLine3" style="width:100%;height:400px;" />
  196. <div v-if="tab.chart3.isTable" class="table" style="width: 100%;z-index: 1;position: absolute;top:19px;right: 0;">
  197. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleExport('chart3')">导出</el-button>
  198. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleChart('chart3')">切换图表</el-button>
  199. <el-table
  200. :key="tab.chart3.table.tableKey"
  201. v-loading="tab.chart3.table.listLoading"
  202. element-loading-text="给我一点时间"
  203. :data="tab.chart3.table.list"
  204. border
  205. fit
  206. highlight-current-row
  207. style="width: 100%;"
  208. height="430"
  209. :row-style="rowStyle"
  210. :cell-style="cellStyle"
  211. class="elTable table-fixed"
  212. >
  213. <el-table-column label="日期" sortable min-width="90px" align="center" prop="日期" />
  214. <el-table-column label="牲畜类别" sortable min-width="90px" align="center" prop="名称" />
  215. <el-table-column label="计划重量(kg)" sortable min-width="100px" align="center" prop="理论量" />
  216. <el-table-column label="实际重量(kg)" sortable min-width="100px" align="center" prop="实际量" />
  217. <el-table-column label="准确率" sortable min-width="90px" align="center" prop="准确率" />
  218. </el-table>
  219. </div>
  220. </el-col>
  221. <!-- 车辆准确率(重量) -->
  222. <el-col :span="12" style="position: relative;">
  223. <h4 style="text-align:center;">车辆准确率(重量)</h4>
  224. <div>
  225. <el-select v-model="tab.chart4.getdataListParm.parammaps.statisticsList" style="width: 200px;margin-right: 5px;" multiple collapse-tags placeholder="请选择统计参数" @visible-change="changeStatisticChart4()">
  226. <el-option v-for="item in tab.chart4.statisticsList" :key="item.name" :label="item.name" :value="item.name" />
  227. </el-select>
  228. <el-date-picker v-model="tab.chart4.getdataListParm.parammaps.inputDatetime" :clearable="false" style="width: 250px;" class="inputDatetime" type="daterange" range-separator="至" start-placeholder="开始日期" :picker-options="pickerOptions" end-placeholder="结束日期" @change="changeChartDate('chart4')" />
  229. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleExport('chart4')">导出</el-button>
  230. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleTable('chart4')">切换表格</el-button>
  231. </div>
  232. <div id="chartLine4" style="width:100%;height:400px;" />
  233. <div v-if="tab.chart4.isTable" class="table" style="width: 100%;z-index: 1;position: absolute;top:19px;right: 0;">
  234. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleExport('chart4')">导出</el-button>
  235. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleChart('chart4')">切换图表</el-button>
  236. <el-table
  237. :key="tab.chart4.table.tableKey"
  238. v-loading="tab.chart4.table.listLoading"
  239. element-loading-text="给我一点时间"
  240. :data="tab.chart4.table.list"
  241. border
  242. fit
  243. highlight-current-row
  244. style="width: 100%;"
  245. height="430"
  246. :row-style="rowStyle"
  247. :cell-style="cellStyle"
  248. class="elTable table-fixed"
  249. >
  250. <el-table-column label="日期" sortable min-width="90px" align="center" prop="日期" />
  251. <el-table-column label="车次" sortable min-width="90px" align="center" prop="名称" />
  252. <el-table-column label="计划重量(kg)" sortable min-width="100px" align="center" prop="理论量" />
  253. <el-table-column label="实际重量(kg)" sortable min-width="100px" align="center" prop="实际量" />
  254. <el-table-column label="准确率" sortable min-width="90px" align="center" prop="准确率" />
  255. </el-table>
  256. </div>
  257. </el-col>
  258. </el-row>
  259. <el-row :gutter="10">
  260. <!-- 混料统计 -->
  261. <el-col :span="12" style="position: relative;">
  262. <h4 style="text-align:center;">混料统计</h4>
  263. <div>
  264. <el-date-picker v-model="tab.chart5.getdataListParm.parammaps.inputDatetime" :clearable="false" style="width: 250px;" class="inputDatetime" type="daterange" range-separator="至" start-placeholder="开始日期" :picker-options="pickerOptions" end-placeholder="结束日期" @change="changeChartDate('chart5')" />
  265. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleExport('chart5')">导出</el-button>
  266. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleTable('chart5')">切换表格</el-button>
  267. </div>
  268. <div id="chartLine5" style="width:100%;height:400px;" />
  269. <div v-if="tab.chart5.isTable" class="table" style="width: 100%;z-index: 1;position: absolute;top:19px;right: 0;">
  270. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleExport('chart5')">导出</el-button>
  271. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleChart('chart5')">切换图表</el-button>
  272. <el-table
  273. :key="tab.chart5.table.tableKey"
  274. v-loading="tab.chart5.table.listLoading"
  275. element-loading-text="给我一点时间"
  276. :data="tab.chart5.table.list"
  277. border
  278. fit
  279. highlight-current-row
  280. style="width: 100%;"
  281. height="430"
  282. :row-style="rowStyle"
  283. :cell-style="cellStyle"
  284. class="elTable table-fixed"
  285. >
  286. <el-table-column label="日期" sortable min-width="100px" align="center" prop="日期" />
  287. <el-table-column label="自动跳转次数" sortable min-width="130px" align="center" prop="field1" />
  288. <el-table-column label="手动跳转次数" sortable min-width="130px" align="center" prop="field2" />
  289. <el-table-column label="自动跳转理论重量" sortable min-width="110px" align="center" prop="理论自动" />
  290. <el-table-column label="自动跳转实际重量" sortable min-width="110px" align="center" prop="实际自动" />
  291. <el-table-column label="自动跳转准确率" sortable min-width="110px" align="center" prop="field3" />
  292. <el-table-column label="手动跳转理论重量" sortable min-width="110px" align="center" prop="理论手动" />
  293. <el-table-column label="手动跳转实际重量" sortable min-width="110px" align="center" prop="实际手动" />
  294. <el-table-column label="手动跳转准确率" sortable min-width="110px" align="center" prop="field4" />
  295. </el-table>
  296. </div>
  297. </el-col>
  298. <!-- 混料计划取消次数 -->
  299. <el-col :span="12" style="position: relative;">
  300. <h4 style="text-align:center;">混料计划取消次数</h4>
  301. <div>
  302. <el-date-picker v-model="tab.chart6.getdataListParm.parammaps.inputDatetime" :clearable="false" style="width: 250px;" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" :picker-options="pickerOptions" end-placeholder="结束日期" @change="changeChartDate('chart6')" />
  303. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleExport('chart6')">导出</el-button>
  304. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleTable('chart6')">切换表格</el-button>
  305. </div>
  306. <div id="chartLine6" style="width:100%;height:400px;" />
  307. <div v-if="tab.chart6.isTable" class="table" style="width: 100%;z-index: 1;position: absolute;top:19px;right: 0;">
  308. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleExport('chart6')">导出</el-button>
  309. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleChart('chart6')">切换图表</el-button>
  310. <el-table
  311. :key="tab.chart6.table.tableKey"
  312. v-loading="tab.chart6.table.listLoading"
  313. element-loading-text="给我一点时间"
  314. :data="tab.chart6.table.list"
  315. border
  316. fit
  317. highlight-current-row
  318. style="width: 100%;"
  319. height="430"
  320. :row-style="rowStyle"
  321. :cell-style="cellStyle"
  322. class="elTable table-fixed"
  323. >
  324. <el-table-column label="日期" sortable min-width="110px" align="center" prop="日期" />
  325. <el-table-column label="混料计划取消次数" sortable min-width="110px" align="center" prop="field1" />
  326. </el-table>
  327. </div>
  328. </el-col>
  329. </el-row>
  330. <el-row :gutter="10">
  331. <!-- 栏舍撒料时间统计 -->
  332. <el-col :span="24" style="position: relative;">
  333. <h4 style="text-align:center;">栏舍撒料时间统计</h4>
  334. <div>
  335. <el-select v-model="tab.chart7.getdataListParm.parammaps.statisticsList" style="width: 200px;margin-right: 5px;" multiple collapse-tags placeholder="请选择统计参数" @visible-change="changeStatisticChart7()">
  336. <el-option v-for="item in tab.chart7.statisticsList" :key="item.name" :label="item.name" :value="item.name" />
  337. </el-select>
  338. <el-date-picker v-model="tab.chart7.getdataListParm.parammaps.inputDatetime" :clearable="false" style="width: 250px;" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" :picker-options="pickerOptions" end-placeholder="结束日期" @change="changeChartDate('chart7')" />
  339. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleExport('chart7')">导出</el-button>
  340. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleTable('chart7')">切换表格</el-button>
  341. </div>
  342. <div id="chartLine7" style="width:100%;height:400px;" />
  343. <div v-if="tab.chart7.isTable" class="table" style="width: 100%;z-index: 1;position: absolute;top:19px;right: 0;">
  344. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleExport('chart7')">导出</el-button>
  345. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleChart('chart7')">切换图表</el-button>
  346. <el-table
  347. :key="tab.chart7.table.tableKey"
  348. v-loading="tab.chart7.table.listLoading"
  349. element-loading-text="给我一点时间"
  350. :data="tab.chart7.table.list"
  351. border
  352. fit
  353. highlight-current-row
  354. style="width: 100%;"
  355. height="430"
  356. :row-style="rowStyle"
  357. :cell-style="cellStyle"
  358. class="elTable table-fixed"
  359. >
  360. <el-table-column label="日期" sortable min-width="110px" align="center" prop="日期" />
  361. <el-table-column label="栏舍" sortable min-width="110px" align="center" prop="fname" />
  362. <el-table-column label="撒料时间" sortable min-width="110px" align="center" prop="撒料时间" />
  363. </el-table>
  364. </div>
  365. </el-col>
  366. </el-row>
  367. </div>
  368. </el-tab-pane>
  369. <el-tab-pane label="混料统计" name="second">
  370. <div class="search">
  371. <el-date-picker v-model="tab2.table.getdataListParm.parammaps.inputDatetime" :clearable="false" style="float: left;margin-right: 10px;margin-bottom:10px;width: 250px;" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions" />
  372. <el-input v-model="tab2.table.getdataListParm.parammaps.tmrtname" style="float: left;margin-right: 10px;margin-bottom:10px;width: 130px;" placeholder="TMR名称" class="filter-item" clearable />
  373. <el-input v-model="tab2.table.getdataListParm.parammaps.projname" style="float: left;margin-right: 10px;margin-bottom:10px;width: 130px;" placeholder="车次" class="filter-item" clearable />
  374. <el-select v-model="tab2.table.getdataListParm.parammaps.times" style="float: left;margin-right: 10px;margin-bottom:10px;width: 150px;" filterable placeholder="班次" class="filter-item" clearable>
  375. <el-option v-for="item in tab2.frequencyList" :key="item.id" :label="item.name" :value="item.id" />
  376. </el-select>
  377. <el-input v-model="tab2.table.getdataListParm.parammaps.templetname" style="float: left;margin-right: 10px;margin-bottom:10px;width: 130px;" placeholder="配方名称" class="filter-item" clearable />
  378. <el-select v-model="tab2.table.getdataListParm.parammaps.buttontype" style="float: left;margin-right: 10px;margin-bottom:10px;" filterable placeholder="跳转方式" class="filter-item" clearable>
  379. <el-option v-for="item in tab2.jumpModeList" :key="item.id" :label="item.name" :value="item.id" />
  380. </el-select>
  381. <el-button class="successBorder" style="float: left;margin-right: 10px;margin-bottom:10px;" @click="handleSearch2">查询</el-button>
  382. <el-button class="successBorder" style="float: left;margin-right: 10px;margin-bottom:10px;" @click="handleRefresh2">重置</el-button>
  383. <el-button class="export" style="float: right;margin-right: 10px;margin-bottom:10px;" @click="handleExport2">导出</el-button>
  384. </div>
  385. <div class="table">
  386. <el-table
  387. :key="tab2.table.tableKey"
  388. v-loading="tab2.table.listLoading"
  389. element-loading-text="给我一点时间"
  390. :data="tab2.table.list"
  391. border
  392. fit
  393. highlight-current-row
  394. style="width: 100%;"
  395. :row-style="rowStyle"
  396. :cell-style="cellStyle"
  397. class="elTable table-fixed"
  398. >
  399. <el-table-column label="日期" min-width="110px" align="center" prop="日期" />
  400. <el-table-column label="TMR名称" min-width="110px" align="center" prop="TMR名称" />
  401. <el-table-column label="车次" min-width="110px" align="center" prop="车次" />
  402. <el-table-column label="班次" min-width="110px" align="center" prop="班次" />
  403. <el-table-column label="配方名称" min-width="110px" align="center" prop="配方名称" />
  404. <el-table-column label="饲料" min-width="110px" align="center" prop="饲料" />
  405. <el-table-column label="理论重量" min-width="110px" align="center" prop="理论重量" />
  406. <el-table-column label="实际重量" min-width="110px" align="center" prop="实际重量" />
  407. <el-table-column label="误差值" min-width="110px" align="center" prop="误差值" />
  408. <el-table-column label="准确率" min-width="110px" align="center" prop="准确率" />
  409. <el-table-column label="计划时间" min-width="110px" align="center" prop="计划时间" />
  410. <el-table-column label="开始时间" min-width="110px" align="center" prop="开始时间" />
  411. <el-table-column label="结束时间" min-width="110px" align="center" prop="结束时间" />
  412. <el-table-column label="跳转方式" min-width="110px" align="center" prop="跳转方式" />
  413. <el-table-column label="开始重量" min-width="110px" align="center" prop="开始重量" />
  414. <el-table-column label="结束重量" min-width="110px" align="center" prop="结束重量" />
  415. </el-table>
  416. <!-- <pagination v-show="tab2.table.total>=0" :total="tab2.table.total" :page.sync="tab2.table.getdataListParm.offset" :limit.sync="tab2.table.getdataListParm.pagecount" @pagination="getTab2List" /> -->
  417. </div>
  418. </el-tab-pane>
  419. <el-tab-pane label="撒料统计" name="third">
  420. <div class="search">
  421. <el-date-picker v-model="tab3.table.getdataListParm.parammaps.inputDatetime" :clearable="false" style="float: left;margin-right: 10px;margin-bottom:10px;width: 250px;" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions" />
  422. <el-input v-model="tab3.table.getdataListParm.parammaps.tmrtname" style="float: left;margin-right: 10px;margin-bottom:10px;width: 110px;" placeholder="TMR名称" class="filter-item" clearable />
  423. <el-input v-model="tab3.table.getdataListParm.parammaps.projname" style="float: left;margin-right: 10px;margin-bottom:10px;width: 110px;" placeholder="车次" class="filter-item" clearable />
  424. <el-select v-model="tab3.table.getdataListParm.parammaps.times" style="float: left;margin-right: 10px;margin-bottom:10px;width: 100px;" filterable placeholder="班次" class="filter-item" clearable>
  425. <el-option v-for="item in tab3.frequencyList" :key="item.id" :label="item.name" :value="item.id" />
  426. </el-select>
  427. <el-input v-model="tab3.table.getdataListParm.parammaps.templetname" style="float: left;margin-right: 10px;margin-bottom:10px;width: 110px;" placeholder="配方名称" class="filter-item" clearable />
  428. <el-input v-model="tab3.table.getdataListParm.parammaps.fname" style="float: left;margin-right: 10px;margin-bottom:10px;width: 110px;" placeholder="栏舍名称" class="filter-item" clearable />
  429. <el-select v-model="tab3.table.getdataListParm.parammaps.buttontype" style="float: left;margin-right: 10px;margin-bottom:10px;width: 110px;" filterable placeholder="跳转方式" class="filter-item" clearable>
  430. <el-option v-for="item in tab3.jumpModeList" :key="item.id" :label="item.name" :value="item.id" />
  431. </el-select>
  432. <el-button class="successBorder" style="float: left;margin-right: 10px;margin-bottom:10px;" @click="handleSearch3">查询</el-button>
  433. <el-button class="successBorder" style="float: left;margin-right: 10px;margin-bottom:10px;" @click="handleRefresh3">重置</el-button>
  434. <el-button class="export" style="float: right;margin-right: 10px;margin-bottom:10px;" @click="handleExport3">导出</el-button>
  435. </div>
  436. <div class="table">
  437. <el-table
  438. :key="tab3.table.tableKey"
  439. v-loading="tab3.table.listLoading"
  440. element-loading-text="给我一点时间"
  441. :data="tab3.table.list"
  442. border
  443. fit
  444. highlight-current-row
  445. style="width: 100%;"
  446. :row-style="rowStyle"
  447. :cell-style="cellStyle"
  448. class="elTable table-fixed"
  449. >
  450. <el-table-column label="日期" min-width="110px" align="center" prop="日期" />
  451. <el-table-column label="TMR名称" min-width="110px" align="center" prop="TMR名称" />
  452. <el-table-column label="车次" min-width="110px" align="center" prop="车次" />
  453. <el-table-column label="班次" min-width="110px" align="center" prop="班次" />
  454. <el-table-column label="配方名称" min-width="110px" align="center" prop="配方名称" />
  455. <el-table-column label="栏舍" min-width="110px" align="center" prop="栏舍" />
  456. <el-table-column label="理论重量" min-width="110px" align="center" prop="理论重量" />
  457. <el-table-column label="实际重量" min-width="110px" align="center" prop="实际重量" />
  458. <el-table-column label="误差值" min-width="110px" align="center" prop="误差值" />
  459. <el-table-column label="准确率" min-width="110px" align="center" prop="准确率" />
  460. <el-table-column label="开始时间" min-width="110px" align="center" prop="开始时间" />
  461. <el-table-column label="结束时间" min-width="110px" align="center" prop="结束时间" />
  462. <el-table-column label="跳转方式" min-width="110px" align="center" prop="跳转方式" />
  463. <el-table-column label="开始重量" min-width="110px" align="center" prop="开始重量" />
  464. <el-table-column label="结束重量" min-width="110px" align="center" prop="结束重量" />
  465. </el-table>
  466. <!-- <pagination v-show="tab3.table.total>=0" :total="tab3.table.total" :page.sync="tab3.table.getdataListParm.offset" :limit.sync="tab3.table.getdataListParm.pagecount" @pagination="getTab3List" /> -->
  467. </div>
  468. </el-tab-pane>
  469. </el-tabs>
  470. </div>
  471. </template>
  472. <script>
  473. import echarts from 'echarts'
  474. require('echarts/theme/macarons')
  475. import { GetDataByName, GetReportform } from '@/api/common'
  476. import Cookies from 'js-cookie'
  477. import { parseTime } from '@/utils/index.js'
  478. import Pagination from '@/components/Pagination'
  479. import { json2excel } from '@/utils/index.js'
  480. import { MessageBox } from 'element-ui'
  481. export default {
  482. name: 'PastureErrorAnalysis',
  483. components: { Pagination },
  484. data() {
  485. return {
  486. pickerMinDate: '',
  487. pickerOptions: {
  488. onPick: ({ maxDate, minDate }) => {
  489. this.pickerMinDate = minDate.getTime()
  490. if (maxDate) {
  491. this.pickerMinDate = ''
  492. }
  493. },
  494. // 限制不能选择今天之后的日期
  495. disabledDate: (time) => {
  496. if (this.pickerMinDate !== '') {
  497. const one = 31 * 24 * 3600 * 1000
  498. const minTime = this.pickerMinDate - one
  499. let maxTime = this.pickerMinDate + one
  500. if (maxTime > new Date()) {
  501. maxTime = new Date()
  502. }
  503. return time.getTime() < minTime || time.getTime() > maxTime
  504. }
  505. return time.getTime() > Date.now()
  506. }
  507. },
  508. // 班次
  509. maxTime: {
  510. getMaxTimesParm: {
  511. name: 'getSysoptEnable',
  512. page: 1,
  513. offset: 1,
  514. pagecount: 1,
  515. returntype: 'Map',
  516. parammaps: {
  517. pastureid: Cookies.get('pastureid'),
  518. inforname: 'times'
  519. }
  520. }
  521. },
  522. activeName: 'first',
  523. tab: {
  524. radio: '1',
  525. isFormulaName: true, // 配方名称
  526. isHouseName: false, // 栏舍名称
  527. isLivestockType: false, // 牲畜类别
  528. isTrainNumber: false, // 车次
  529. checked: false, // 按日期统计
  530. table: {
  531. getdataListParm: {
  532. name: 'getAccuracyHFT',
  533. page: 1,
  534. offset: 1,
  535. pagecount: '',
  536. returntype: 'Map',
  537. parammaps: {
  538. pastureid: Cookies.get('pastureid'),
  539. startTime: parseTime(new Date(), '{y}-{m}-{d}'),
  540. stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
  541. inputDatetime: [new Date(), new Date()],
  542. fname: '',
  543. sort: '',
  544. times: ''
  545. }
  546. },
  547. tableKey: 1,
  548. list: [],
  549. total: 0,
  550. listLoading: true,
  551. temp: {}
  552. },
  553. table2: {
  554. getdataListParm: {
  555. name: 'getAccuracySFT',
  556. page: 1,
  557. offset: 1,
  558. pagecount: '',
  559. returntype: 'Map',
  560. parammaps: {
  561. pastureid: Cookies.get('pastureid'),
  562. startTime: parseTime(new Date(), '{y}-{m}-{d}'),
  563. stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
  564. inputDatetime: [new Date(), new Date()],
  565. fname: '',
  566. sort: '',
  567. times: ''
  568. }
  569. },
  570. tableKey: 2,
  571. list: [],
  572. total: 0,
  573. listLoading: true,
  574. temp: {}
  575. },
  576. chartDate: [],
  577. // 配方准确率
  578. chart1: {
  579. chartLine: null,
  580. chartLine_data: {},
  581. getdataListParm: {
  582. name: 'getAccuracyAllFT',
  583. page: 1,
  584. offset: 1,
  585. pagecount: '',
  586. returntype: 'Map',
  587. parammaps: {
  588. pastureid: Cookies.get('pastureid'),
  589. startTime: parseTime(new Date(), '{y}-{m}-{d}'),
  590. stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
  591. inputDatetime: [new Date(), new Date()]
  592. }
  593. },
  594. tableKey: 1,
  595. list: [],
  596. total: 0,
  597. listLoading: true,
  598. statisticsList: [],
  599. chart1Data3: [],
  600. isChart: true,
  601. isTable: false,
  602. table: {
  603. tableKey: 1,
  604. list: [],
  605. total: 0,
  606. listLoading: false
  607. }
  608. },
  609. // 计划统计
  610. chart2: {
  611. chartLine: null,
  612. chartLine_data: {},
  613. getdataListParm: {
  614. name: 'getAccuracyAllJH',
  615. page: 1,
  616. offset: 1,
  617. pagecount: '',
  618. returntype: 'Map',
  619. parammaps: {
  620. pastureid: Cookies.get('pastureid'),
  621. startTime: parseTime(new Date(), '{y}-{m}-{d}'),
  622. stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
  623. inputDatetime: [new Date(), new Date()]
  624. }
  625. },
  626. tableKey: 1,
  627. list: [],
  628. total: 0,
  629. listLoading: true,
  630. isChart: true,
  631. isTable: false,
  632. table: {
  633. tableKey: 1,
  634. list: [],
  635. total: 0,
  636. listLoading: false
  637. }
  638. },
  639. // 牛群准确率
  640. chart3: {
  641. chartLine: null,
  642. chartLine_data: {},
  643. getdataListParm: {
  644. name: 'getAccuracyAllNQ',
  645. page: 1,
  646. offset: 1,
  647. pagecount: '',
  648. returntype: 'Map',
  649. parammaps: {
  650. pastureid: Cookies.get('pastureid'),
  651. startTime: parseTime(new Date(), '{y}-{m}-{d}'),
  652. stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
  653. inputDatetime: [new Date(), new Date()]
  654. }
  655. },
  656. tableKey: 1,
  657. list: [],
  658. total: 0,
  659. listLoading: true,
  660. statisticsList: [],
  661. chart1Data3: [],
  662. isChart: true,
  663. isTable: false,
  664. table: {
  665. tableKey: 1,
  666. list: [],
  667. total: 0,
  668. listLoading: false
  669. }
  670. },
  671. // 车辆准确率(重量)
  672. chart4: {
  673. chartLine: null,
  674. chartLine_data: {},
  675. getdataListParm: {
  676. name: 'getAccuracyAllCC',
  677. page: 1,
  678. offset: 1,
  679. pagecount: '',
  680. returntype: 'Map',
  681. parammaps: {
  682. pastureid: Cookies.get('pastureid'),
  683. startTime: parseTime(new Date(), '{y}-{m}-{d}'),
  684. stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
  685. inputDatetime: [new Date(), new Date()]
  686. }
  687. },
  688. tableKey: 1,
  689. list: [],
  690. total: 0,
  691. listLoading: true,
  692. statisticsList: [],
  693. chart4Data3: [],
  694. isChart: true,
  695. isTable: false,
  696. table: {
  697. tableKey: 1,
  698. list: [],
  699. total: 0,
  700. listLoading: false
  701. }
  702. },
  703. // 混料统计
  704. chart5: {
  705. chartLine: null,
  706. chartLine_data: {},
  707. getdataListParm: {
  708. name: 'getAccuracyAllHL',
  709. page: 1,
  710. offset: 1,
  711. pagecount: '',
  712. returntype: 'Map',
  713. parammaps: {
  714. pastureid: Cookies.get('pastureid'),
  715. startTime: parseTime(new Date(), '{y}-{m}-{d}'),
  716. stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
  717. inputDatetime: [new Date(), new Date()]
  718. }
  719. },
  720. tableKey: 1,
  721. list: [],
  722. total: 0,
  723. listLoading: true,
  724. isChart: true,
  725. isTable: false,
  726. table: {
  727. tableKey: 1,
  728. list: [],
  729. total: 0,
  730. listLoading: false
  731. }
  732. },
  733. // 混料计划取消次数
  734. chart6: {
  735. chartLine: null,
  736. chartLine_data: {},
  737. getdataListParm: {
  738. name: 'getAccuracyAllQX',
  739. page: 1,
  740. offset: 1,
  741. pagecount: '',
  742. returntype: 'Map',
  743. parammaps: {
  744. pastureid: Cookies.get('pastureid'),
  745. startTime: parseTime(new Date(), '{y}-{m}-{d}'),
  746. stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
  747. inputDatetime: [new Date(), new Date()]
  748. }
  749. },
  750. tableKey: 1,
  751. list: [],
  752. total: 0,
  753. listLoading: true,
  754. isChart: true,
  755. isTable: false,
  756. table: {
  757. tableKey: 1,
  758. list: [],
  759. total: 0,
  760. listLoading: false
  761. }
  762. },
  763. // 栏舍撒料时间统计
  764. chart7: {
  765. chartLine: null,
  766. chartLine_data: {},
  767. getdataListParm: {
  768. name: 'getAccuracyAllLS',
  769. page: 1,
  770. offset: 1,
  771. pagecount: '',
  772. returntype: 'Map',
  773. parammaps: {
  774. pastureid: Cookies.get('pastureid'),
  775. startTime: parseTime(new Date(), '{y}-{m}-{d}'),
  776. stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
  777. inputDatetime: [new Date(), new Date()]
  778. }
  779. },
  780. tableKey: 1,
  781. list: [],
  782. total: 0,
  783. listLoading: true,
  784. statisticsList: [],
  785. chart7Data3: [],
  786. isChart: true,
  787. isTable: false,
  788. table: {
  789. tableKey: 1,
  790. list: [],
  791. total: 0,
  792. listLoading: false
  793. }
  794. }
  795. },
  796. tab2: {
  797. table: {
  798. getdataListParm: {
  799. name: 'getStatisticsHL',
  800. page: 1,
  801. offset: 1,
  802. pagecount: '',
  803. returntype: 'Map',
  804. parammaps: {
  805. pastureid: Cookies.get('pastureid'),
  806. startTime: parseTime(new Date(), '{y}-{m}-{d}'),
  807. stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
  808. inputDatetime: [new Date(), new Date()],
  809. tmrtname: '',
  810. projname: '',
  811. times: '',
  812. buttontype: '',
  813. templetname: ''
  814. }
  815. },
  816. tableKey: 1,
  817. list: [],
  818. total: 0,
  819. listLoading: true,
  820. temp: {}
  821. },
  822. frequencyList: [],
  823. jumpModeList: [{ id: '0', name: '手动跳转' }, { id: '1', name: '自动跳转' }]
  824. },
  825. tab3: {
  826. table: {
  827. getdataListParm: {
  828. name: 'getStatisticsSL',
  829. page: 1,
  830. offset: 1,
  831. pagecount: '',
  832. returntype: 'Map',
  833. parammaps: {
  834. pastureid: Cookies.get('pastureid'),
  835. startTime: parseTime(new Date(), '{y}-{m}-{d}'),
  836. stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
  837. inputDatetime: [new Date(), new Date()],
  838. tmrtname: '',
  839. projname: '',
  840. times: '',
  841. templetname: '',
  842. fname: '',
  843. buttontype: ''
  844. }
  845. },
  846. tableKey: 1,
  847. list: [],
  848. total: 0,
  849. listLoading: true,
  850. temp: {}
  851. },
  852. frequencyList: [],
  853. jumpModeList: [{ id: '0', name: '手动跳转' }, { id: '1', name: '自动跳转' }]
  854. },
  855. rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
  856. cellStyle: { padding: 0 + 'px' }
  857. }
  858. },
  859. created() {
  860. this.getTimeFn()
  861. this.getIsDisplay()
  862. this.getTabList()
  863. this.getTabList2()
  864. this.getChart1()
  865. this.getChart2()
  866. this.getChart3()
  867. this.getChart4()
  868. this.getChart5()
  869. this.getChart6()
  870. this.getChart7()
  871. },
  872. mounted() {
  873. },
  874. methods: {
  875. getTimeFn() {
  876. const that = this
  877. const start = new Date()
  878. const end = new Date()
  879. const start2 = new Date()
  880. const end2 = new Date()
  881. start2.setTime(start2.getTime() - 3600 * 1000 * 24 * 1)
  882. end2.setTime(end2.getTime() - 3600 * 1000 * 24 * 1)
  883. that.tab.table.getdataListParm.parammaps.inputDatetime[0] = parseTime(start2, '{y}-{m}-{d}')
  884. that.tab.table.getdataListParm.parammaps.inputDatetime[1] = parseTime(end2, '{y}-{m}-{d}')
  885. that.tab.table.getdataListParm.parammaps.startTime = parseTime(start2, '{y}-{m}-{d}')
  886. that.tab.table.getdataListParm.parammaps.stopTime = parseTime(end2, '{y}-{m}-{d}')
  887. that.tab.table2.getdataListParm.parammaps.startTime = parseTime(start2, '{y}-{m}-{d}')
  888. that.tab.table2.getdataListParm.parammaps.stopTime = parseTime(end2, '{y}-{m}-{d}')
  889. that.tab2.table.getdataListParm.parammaps.inputDatetime[0] = parseTime(start2, '{y}-{m}-{d}')
  890. that.tab2.table.getdataListParm.parammaps.inputDatetime[1] = parseTime(end2, '{y}-{m}-{d}')
  891. that.tab2.table.getdataListParm.parammaps.startTime = parseTime(start2, '{y}-{m}-{d}')
  892. that.tab2.table.getdataListParm.parammaps.stopTime = parseTime(end2, '{y}-{m}-{d}')
  893. that.tab3.table.getdataListParm.parammaps.inputDatetime[0] = parseTime(start2, '{y}-{m}-{d}')
  894. that.tab3.table.getdataListParm.parammaps.inputDatetime[1] = parseTime(end2, '{y}-{m}-{d}')
  895. that.tab3.table.getdataListParm.parammaps.startTime = parseTime(start2, '{y}-{m}-{d}')
  896. that.tab3.table.getdataListParm.parammaps.stopTime = parseTime(end2, '{y}-{m}-{d}')
  897. start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
  898. that.tab.chartDate[0] = parseTime(start, '{y}-{m}-{d}')
  899. that.tab.chartDate[1] = parseTime(end, '{y}-{m}-{d}')
  900. that.tab.chart1.getdataListParm.parammaps.inputDatetime[0] = parseTime(start, '{y}-{m}-{d}')
  901. that.tab.chart1.getdataListParm.parammaps.inputDatetime[1] = parseTime(end, '{y}-{m}-{d}')
  902. that.tab.chart1.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
  903. that.tab.chart1.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')
  904. that.tab.chart2.getdataListParm.parammaps.inputDatetime[0] = parseTime(start, '{y}-{m}-{d}')
  905. that.tab.chart2.getdataListParm.parammaps.inputDatetime[1] = parseTime(end, '{y}-{m}-{d}')
  906. that.tab.chart2.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
  907. that.tab.chart2.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')
  908. that.tab.chart3.getdataListParm.parammaps.inputDatetime[0] = parseTime(start, '{y}-{m}-{d}')
  909. that.tab.chart3.getdataListParm.parammaps.inputDatetime[1] = parseTime(end, '{y}-{m}-{d}')
  910. that.tab.chart3.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
  911. that.tab.chart3.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')
  912. that.tab.chart4.getdataListParm.parammaps.inputDatetime[0] = parseTime(start, '{y}-{m}-{d}')
  913. that.tab.chart4.getdataListParm.parammaps.inputDatetime[1] = parseTime(end, '{y}-{m}-{d}')
  914. that.tab.chart4.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
  915. that.tab.chart4.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')
  916. that.tab.chart5.getdataListParm.parammaps.inputDatetime[0] = parseTime(start, '{y}-{m}-{d}')
  917. that.tab.chart5.getdataListParm.parammaps.inputDatetime[1] = parseTime(end, '{y}-{m}-{d}')
  918. that.tab.chart5.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
  919. that.tab.chart5.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')
  920. that.tab.chart6.getdataListParm.parammaps.inputDatetime[0] = parseTime(start, '{y}-{m}-{d}')
  921. that.tab.chart6.getdataListParm.parammaps.inputDatetime[1] = parseTime(end, '{y}-{m}-{d}')
  922. that.tab.chart6.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
  923. that.tab.chart6.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')
  924. that.tab.chart7.getdataListParm.parammaps.inputDatetime[0] = parseTime(start, '{y}-{m}-{d}')
  925. that.tab.chart7.getdataListParm.parammaps.inputDatetime[1] = parseTime(end, '{y}-{m}-{d}')
  926. that.tab.chart7.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
  927. that.tab.chart7.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')
  928. },
  929. getIsDisplay() {
  930. GetDataByName(this.maxTime.getMaxTimesParm).then(response => {
  931. if (response.data.list[0].inforvalue == 1) {
  932. this.tab2.frequencyList = [{ id: '1', name: '第一班' }]
  933. this.tab3.frequencyList = [{ id: '1', name: '第一班' }]
  934. } else if (response.data.list[0].inforvalue == 2) {
  935. this.tab2.frequencyList = [{ id: '1', name: '第一班' }, { id: '2', name: '第二班' }]
  936. this.tab3.frequencyList = [{ id: '1', name: '第一班' }, { id: '2', name: '第二班' }]
  937. } else if (response.data.list[0].inforvalue == 3) {
  938. this.tab2.frequencyList = [{ id: '1', name: '第一班' }, { id: '2', name: '第二班' }, { id: '3', name: '第三班' }]
  939. this.tab3.frequencyList = [{ id: '1', name: '第一班' }, { id: '2', name: '第二班' }, { id: '3', name: '第三班' }]
  940. this.frequencyList = [{ id: '1', name: '第一班' }, { id: '2', name: '第二班' }, { id: '3', name: '第三班' }]
  941. } else if (response.data.list[0].inforvalue == 4) {
  942. this.tab2.frequencyList = [{ id: '1', name: '第一班' }, { id: '2', name: '第二班' }, { id: '3', name: '第三班' }, { id: '4', name: '第四班' }]
  943. this.tab3.frequencyList = [{ id: '1', name: '第一班' }, { id: '2', name: '第二班' }, { id: '3', name: '第三班' }, { id: '4', name: '第四班' }]
  944. }
  945. })
  946. },
  947. // 导出
  948. handleDownload() {
  949. if (this.tab.radio == '1') {
  950. var excelDatas = [
  951. {
  952. tHeader: ['配方名称', '理论重量', '实际重量', '计划混料操作数', '已混料操作数', '混料操作率', '混料误差值', '混料准确率', '混料自动跳转次数', '混料手动跳转次数', '取消次数', '方差'],
  953. filterVal: ['配方名称', '理论重量', '实际重量', '计划混料操作数', '已混料操作数', '混料操作率', '混料误差值', '混料准确率', '混料自动跳转次数', '混料手动跳转次数', '取消次数', '方差'],
  954. tableDatas: this.tab.table.list,
  955. sheetName: '混料'
  956. },
  957. {
  958. tHeader: ['配方名称', '理论重量', '实际重量', '计划撒料操作数', '已撒料操作数', '撒料操作率', '撒料误差值', '撒料准确率', '撒料自动跳转次数', '撒料手动跳转次数'],
  959. filterVal: ['配方名称', '理论重量', '实际重量', '计划撒料操作数', '已撒料操作数', '撒料操作率', '撒料误差值', '撒料准确率', '撒料自动跳转次数', '撒料手动跳转次数'],
  960. tableDatas: this.tab.table2.list,
  961. sheetName: '撒料'
  962. }
  963. ]
  964. json2excel(excelDatas, '准确性分析—汇总统计', true, 'xlsx')
  965. } else if (this.tab.radio == '2') {
  966. var excelDatas2 = [
  967. {
  968. tHeader: ['栏舍名称', '理论重量', '实际重量', '计划混料操作数', '已混料操作数', '混料操作率', '混料误差值', '混料准确率', '混料自动跳转次数', '混料手动跳转次数', '取消次数', '方差'],
  969. filterVal: ['栏舍名称', '理论重量', '实际重量', '计划混料操作数', '已混料操作数', '混料操作率', '混料误差值', '混料准确率', '混料自动跳转次数', '混料手动跳转次数', '取消次数', '方差'],
  970. tableDatas: this.tab.table.list,
  971. sheetName: '混料'
  972. },
  973. {
  974. tHeader: ['栏舍名称', '理论重量', '实际重量', '计划撒料操作数', '已撒料操作数', '撒料操作率', '撒料误差值', '撒料准确率', '撒料自动跳转次数', '撒料手动跳转次数'],
  975. filterVal: ['栏舍名称', '理论重量', '实际重量', '计划撒料操作数', '已撒料操作数', '撒料操作率', '撒料误差值', '撒料准确率', '撒料自动跳转次数', '撒料手动跳转次数'],
  976. tableDatas: this.tab.table2.list,
  977. sheetName: '撒料'
  978. }
  979. ]
  980. json2excel(excelDatas2, '汇总统计-栏舍名称', true, 'xlsx')
  981. } else if (this.tab.radio == '3') {
  982. var excelDatas3 = [
  983. {
  984. tHeader: ['牲畜类别', '理论重量', '实际重量', '计划混料操作数', '已混料操作数', '混料操作率', '混料误差值', '混料准确率', '混料自动跳转次数', '混料手动跳转次数', '取消次数', '方差'],
  985. filterVal: ['牲畜类别', '理论重量', '实际重量', '计划混料操作数', '已混料操作数', '混料操作率', '混料误差值', '混料准确率', '混料自动跳转次数', '混料手动跳转次数', '取消次数', '方差'],
  986. tableDatas: this.tab.table.list,
  987. sheetName: '混料'
  988. },
  989. {
  990. tHeader: ['牲畜类别', '理论重量', '实际重量', '计划撒料操作数', '已撒料操作数', '撒料操作率', '撒料误差值', '撒料准确率', '撒料自动跳转次数', '撒料手动跳转次数'],
  991. filterVal: ['牲畜类别', '理论重量', '实际重量', '计划撒料操作数', '已撒料操作数', '撒料操作率', '撒料误差值', '撒料准确率', '撒料自动跳转次数', '撒料手动跳转次数'],
  992. tableDatas: this.tab.table2.list,
  993. sheetName: '撒料'
  994. }
  995. ]
  996. json2excel(excelDatas3, '汇总统计-牲畜类别', true, 'xlsx')
  997. } else if (this.tab.radio == '4') {
  998. var excelDatas4 = [
  999. {
  1000. tHeader: ['车次', '班次', 'TMR名称', '驾驶员', '理论重量', '实际重量', '计划混料操作数', '已混料操作数', '混料操作率', '混料误差值', '混料准确率', '混料自动跳转次数', '混料手动跳转次数', '取消次数', '方差'],
  1001. filterVal: ['车次', '班次', 'TMR名称', '驾驶员', '理论重量', '实际重量', '计划混料操作数', '已混料操作数', '混料操作率', '混料误差值', '混料准确率', '混料自动跳转次数', '混料手动跳转次数', '取消次数', '方差'],
  1002. tableDatas: this.tab.table.list,
  1003. sheetName: '混料'
  1004. },
  1005. {
  1006. tHeader: ['车次', '理论重量', '实际重量', '计划撒料操作数', '已撒料操作数', '撒料操作率', '撒料误差值', '撒料准确率', '撒料自动跳转次数', '撒料手动跳转次数'],
  1007. filterVal: ['车次', '理论重量', '实际重量', '计划撒料操作数', '已撒料操作数', '撒料操作率', '撒料误差值', '撒料准确率', '撒料自动跳转次数', '撒料手动跳转次数'],
  1008. tableDatas: this.tab.table2.list,
  1009. sheetName: '撒料'
  1010. }
  1011. ]
  1012. json2excel(excelDatas4, '汇总统计-车次', true, 'xlsx')
  1013. }
  1014. },
  1015. // 切换Tab
  1016. handleTabClick() {
  1017. if (this.activeName == 'first') {
  1018. this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  1019. this.tab.table.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  1020. this.tab.table2.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  1021. this.tab.table2.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  1022. this.tab.table.getdataListParm.parammaps.fname = ''
  1023. this.tab.table.getdataListParm.parammaps.sort = ''
  1024. this.tab.table.getdataListParm.parammaps.times = ''
  1025. this.tab.table2.getdataListParm.parammaps.fname = ''
  1026. this.tab.table2.getdataListParm.parammaps.sort = ''
  1027. this.tab.table2.getdataListParm.parammaps.times = ''
  1028. this.getTabList()
  1029. this.getTabList2()
  1030. this.getChart1()
  1031. this.getChart2()
  1032. this.getChart3()
  1033. this.getChart4()
  1034. this.getChart5()
  1035. this.getChart6()
  1036. this.getChart7()
  1037. } else if (this.activeName == 'second') {
  1038. this.tab2.table.getdataListParm.parammaps.startTime = parseTime(this.tab2.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  1039. this.tab2.table.getdataListParm.parammaps.stopTime = parseTime(this.tab2.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  1040. this.tab2.table.getdataListParm.parammaps.tmrtname = ''
  1041. this.tab2.table.getdataListParm.parammaps.projname = ''
  1042. this.tab2.table.getdataListParm.parammaps.times = ''
  1043. this.tab2.table.getdataListParm.parammaps.buttontype = ''
  1044. this.tab2.table.getdataListParm.parammaps.templetname = ''
  1045. this.getTab2List()
  1046. } else if (this.activeName == 'third') {
  1047. this.tab3.table.getdataListParm.parammaps.startTime = parseTime(this.tab3.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  1048. this.tab3.table.getdataListParm.parammaps.stopTime = parseTime(this.tab3.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  1049. this.tab3.table.getdataListParm.parammaps.tmrtname = ''
  1050. this.tab3.table.getdataListParm.parammaps.projname = ''
  1051. this.tab3.table.getdataListParm.parammaps.times = ''
  1052. this.tab3.table.getdataListParm.parammaps.templetname = ''
  1053. this.tab3.table.getdataListParm.parammaps.buttontype = ''
  1054. this.getTab3List()
  1055. }
  1056. },
  1057. // 切换统计类型
  1058. changeRadio() {
  1059. console.log(this.tab.radio)
  1060. this.tab.table.getdataListParm.parammaps.sort = ''
  1061. this.tab.table.getdataListParm.parammaps.times = ''
  1062. this.tab.table.getdataListParm.parammaps.fname = ''
  1063. this.tab.table2.getdataListParm.parammaps.sort = ''
  1064. this.tab.table2.getdataListParm.parammaps.times = ''
  1065. this.tab.table2.getdataListParm.parammaps.fname = ''
  1066. if (this.tab.radio == '1') {
  1067. console.log('配方名称')
  1068. this.tab.isFormulaName = true
  1069. this.tab.isHouseName = false
  1070. this.tab.isLivestockType = false
  1071. this.tab.isTrainNumber = false
  1072. this.tab.table.getdataListParm.name = 'getAccuracyHFT'
  1073. if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
  1074. this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  1075. this.tab.table.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  1076. } else {
  1077. this.tab.table.getdataListParm.parammaps.inputDatetime = ''
  1078. this.tab.table.getdataListParm.parammaps.startTime = ''
  1079. this.tab.table.getdataListParm.parammaps.stopTime = ''
  1080. }
  1081. this.tab.table.getdataListParm.offset = 1
  1082. this.getTabList()
  1083. this.tab.table2.getdataListParm.name = 'getAccuracySFT'
  1084. this.tab.table2.getdataListParm.parammaps.startTime = this.tab.table.getdataListParm.parammaps.startTime
  1085. this.tab.table2.getdataListParm.parammaps.stopTime = this.tab.table.getdataListParm.parammaps.stopTime
  1086. this.getTabList2()
  1087. } else if (this.tab.radio == '2') {
  1088. console.log('栏舍名称')
  1089. this.tab.isFormulaName = false
  1090. this.tab.isHouseName = true
  1091. this.tab.isLivestockType = false
  1092. this.tab.isTrainNumber = false
  1093. this.tab.table.getdataListParm.name = 'getAccuracyHNS'
  1094. if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
  1095. this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  1096. this.tab.table.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  1097. } else {
  1098. this.tab.table.getdataListParm.parammaps.inputDatetime = ''
  1099. this.tab.table.getdataListParm.parammaps.startTime = ''
  1100. this.tab.table.getdataListParm.parammaps.stopTime = ''
  1101. }
  1102. this.tab.table.getdataListParm.offset = 1
  1103. this.getTabList()
  1104. this.tab.table2.getdataListParm.name = 'getAccuracySNS'
  1105. this.tab.table2.getdataListParm.parammaps.startTime = this.tab.table.getdataListParm.parammaps.startTime
  1106. this.tab.table2.getdataListParm.parammaps.stopTime = this.tab.table.getdataListParm.parammaps.stopTime
  1107. this.getTabList2()
  1108. } else if (this.tab.radio == '3') {
  1109. console.log(' 牲畜类别')
  1110. this.tab.isFormulaName = false
  1111. this.tab.isHouseName = false
  1112. this.tab.isLivestockType = true
  1113. this.tab.isTrainNumber = false
  1114. this.tab.table.getdataListParm.name = 'getAccuracyHSC'
  1115. if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
  1116. this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  1117. this.tab.table.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  1118. } else {
  1119. this.tab.table.getdataListParm.parammaps.inputDatetime = ''
  1120. this.tab.table.getdataListParm.parammaps.startTime = ''
  1121. this.tab.table.getdataListParm.parammaps.stopTime = ''
  1122. }
  1123. this.tab.table.getdataListParm.offset = 1
  1124. this.getTabList()
  1125. this.tab.table2.getdataListParm.name = 'getAccuracySSC'
  1126. this.tab.table2.getdataListParm.parammaps.startTime = this.tab.table.getdataListParm.parammaps.startTime
  1127. this.tab.table2.getdataListParm.parammaps.stopTime = this.tab.table.getdataListParm.parammaps.stopTime
  1128. this.tab.table2.getdataListParm.offset = 1
  1129. this.getTabList2()
  1130. } else if (this.tab.radio == '4') {
  1131. console.log('车次')
  1132. this.tab.isFormulaName = false
  1133. this.tab.isHouseName = false
  1134. this.tab.isLivestockType = false
  1135. this.tab.isTrainNumber = true
  1136. this.tab.table.getdataListParm.name = 'getAccuracyHCC'
  1137. if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
  1138. this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  1139. this.tab.table.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  1140. } else {
  1141. this.tab.table.getdataListParm.parammaps.inputDatetime = ''
  1142. this.tab.table.getdataListParm.parammaps.startTime = ''
  1143. this.tab.table.getdataListParm.parammaps.stopTime = ''
  1144. }
  1145. this.tab.table.getdataListParm.offset = 1
  1146. this.getTabList()
  1147. this.tab.table2.getdataListParm.name = 'getAccuracySCC'
  1148. this.tab.table2.getdataListParm.parammaps.startTime = this.tab.table.getdataListParm.parammaps.startTime
  1149. this.tab.table2.getdataListParm.parammaps.stopTime = this.tab.table.getdataListParm.parammaps.stopTime
  1150. this.tab.table2.getdataListParm.offset = 1
  1151. this.getTabList2()
  1152. }
  1153. },
  1154. // 按日期统计
  1155. changeChecked() {
  1156. // console.log(this.tab.checked)
  1157. if (this.tab.radio == '1') {
  1158. console.log('配方名称')
  1159. this.tab.isFormulaName = true
  1160. this.tab.isHouseName = false
  1161. this.tab.isLivestockType = false
  1162. this.tab.isTrainNumber = false
  1163. this.tab.table.getdataListParm.name = 'getAccuracyHFT'
  1164. if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
  1165. this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  1166. this.tab.table.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  1167. } else {
  1168. this.tab.table.getdataListParm.parammaps.inputDatetime = ''
  1169. this.tab.table.getdataListParm.parammaps.startTime = ''
  1170. this.tab.table.getdataListParm.parammaps.stopTime = ''
  1171. }
  1172. this.tab.table.getdataListParm.offset = 1
  1173. this.getTabList()
  1174. this.tab.table2.getdataListParm.name = 'getAccuracySFT'
  1175. this.tab.table2.getdataListParm.parammaps.startTime = this.tab.table.getdataListParm.parammaps.startTime
  1176. this.tab.table2.getdataListParm.parammaps.stopTime = this.tab.table.getdataListParm.parammaps.stopTime
  1177. this.getTabList2()
  1178. } else if (this.tab.radio == '2') {
  1179. console.log('栏舍名称')
  1180. this.tab.isFormulaName = false
  1181. this.tab.isHouseName = true
  1182. this.tab.isLivestockType = false
  1183. this.tab.isTrainNumber = false
  1184. this.tab.table.getdataListParm.name = 'getAccuracyHNS'
  1185. if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
  1186. this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  1187. this.tab.table.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  1188. } else {
  1189. this.tab.table.getdataListParm.parammaps.inputDatetime = ''
  1190. this.tab.table.getdataListParm.parammaps.startTime = ''
  1191. this.tab.table.getdataListParm.parammaps.stopTime = ''
  1192. }
  1193. this.tab.table.getdataListParm.offset = 1
  1194. this.getTabList()
  1195. this.tab.table2.getdataListParm.name = 'getAccuracySNS'
  1196. this.tab.table2.getdataListParm.parammaps.startTime = this.tab.table.getdataListParm.parammaps.startTime
  1197. this.tab.table2.getdataListParm.parammaps.stopTime = this.tab.table.getdataListParm.parammaps.stopTime
  1198. this.getTabList2()
  1199. } else if (this.tab.radio == '3') {
  1200. console.log(' 牲畜类别')
  1201. this.tab.isFormulaName = false
  1202. this.tab.isHouseName = false
  1203. this.tab.isLivestockType = true
  1204. this.tab.isTrainNumber = false
  1205. this.tab.table.getdataListParm.name = 'getAccuracyHSC'
  1206. if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
  1207. this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  1208. this.tab.table.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  1209. } else {
  1210. this.tab.table.getdataListParm.parammaps.inputDatetime = ''
  1211. this.tab.table.getdataListParm.parammaps.startTime = ''
  1212. this.tab.table.getdataListParm.parammaps.stopTime = ''
  1213. }
  1214. this.tab.table.getdataListParm.offset = 1
  1215. this.getTabList()
  1216. this.tab.table2.getdataListParm.name = 'getAccuracySSC'
  1217. this.tab.table2.getdataListParm.parammaps.startTime = this.tab.table.getdataListParm.parammaps.startTime
  1218. this.tab.table2.getdataListParm.parammaps.stopTime = this.tab.table.getdataListParm.parammaps.stopTime
  1219. this.tab.table2.getdataListParm.offset = 1
  1220. this.getTabList2()
  1221. } else if (this.tab.radio == '4') {
  1222. console.log('车次')
  1223. this.tab.isFormulaName = false
  1224. this.tab.isHouseName = false
  1225. this.tab.isLivestockType = false
  1226. this.tab.isTrainNumber = true
  1227. this.tab.table.getdataListParm.name = 'getAccuracyHCC'
  1228. if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
  1229. this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  1230. this.tab.table.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  1231. } else {
  1232. this.tab.table.getdataListParm.parammaps.inputDatetime = ''
  1233. this.tab.table.getdataListParm.parammaps.startTime = ''
  1234. this.tab.table.getdataListParm.parammaps.stopTime = ''
  1235. }
  1236. this.tab.table.getdataListParm.offset = 1
  1237. this.getTabList()
  1238. this.tab.table2.getdataListParm.name = 'getAccuracySCC'
  1239. this.tab.table2.getdataListParm.parammaps.startTime = this.tab.table.getdataListParm.parammaps.startTime
  1240. this.tab.table2.getdataListParm.parammaps.stopTime = this.tab.table.getdataListParm.parammaps.stopTime
  1241. this.tab.table2.getdataListParm.offset = 1
  1242. this.getTabList2()
  1243. }
  1244. },
  1245. // 汇总统计/混料
  1246. getTabList() {
  1247. this.tab.table.listLoading = true
  1248. GetDataByName(this.tab.table.getdataListParm).then(response => {
  1249. console.log('汇总统计/混料table数据', response.data.list)
  1250. if (response.data.list !== null) {
  1251. this.tab.table.list = response.data.list
  1252. // this.tab.table.total = response.data.total
  1253. } else {
  1254. this.tab.table.list = []
  1255. }
  1256. setTimeout(() => {
  1257. this.tab.table.listLoading = false
  1258. }, 100)
  1259. })
  1260. },
  1261. // 汇总统计/撒料
  1262. getTabList2() {
  1263. this.tab.table2.listLoading = true
  1264. GetDataByName(this.tab.table2.getdataListParm).then(response => {
  1265. console.log('汇总统计/撒料table数据', response.data.list)
  1266. if (response.data.list !== null) {
  1267. this.tab.table2.list = response.data.list
  1268. // this.tab.table2.total = response.data.total
  1269. } else {
  1270. this.tab.table2.list = []
  1271. }
  1272. setTimeout(() => {
  1273. this.tab.table2.listLoading = false
  1274. }, 100)
  1275. })
  1276. },
  1277. // 查询
  1278. handleSearch() {
  1279. if (this.tab.radio == '1') {
  1280. console.log('配方名称/查询')
  1281. this.tab.isFormulaName = true
  1282. this.tab.isHouseName = false
  1283. this.tab.isLivestockType = false
  1284. this.tab.isTrainNumber = false
  1285. this.tab.table.getdataListParm.name = 'getAccuracyHFT'
  1286. if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
  1287. this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  1288. this.tab.table.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  1289. } else {
  1290. this.tab.table.getdataListParm.parammaps.inputDatetime = ''
  1291. this.tab.table.getdataListParm.parammaps.startTime = ''
  1292. this.tab.table.getdataListParm.parammaps.stopTime = ''
  1293. }
  1294. this.tab.table.getdataListParm.offset = 1
  1295. this.getTabList()
  1296. this.tab.table2.getdataListParm.name = 'getAccuracySFT'
  1297. this.tab.table2.getdataListParm.parammaps.startTime = this.tab.table.getdataListParm.parammaps.startTime
  1298. this.tab.table2.getdataListParm.parammaps.stopTime = this.tab.table.getdataListParm.parammaps.stopTime
  1299. this.tab.table2.getdataListParm.offset = 1
  1300. this.getTabList2()
  1301. } else if (this.tab.radio == '2') {
  1302. console.log('栏舍名称/查询')
  1303. this.tab.isFormulaName = false
  1304. this.tab.isHouseName = true
  1305. this.tab.isLivestockType = false
  1306. this.tab.isTrainNumber = false
  1307. this.tab.table.getdataListParm.name = 'getAccuracyHNS'
  1308. if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
  1309. this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  1310. this.tab.table.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  1311. } else {
  1312. this.tab.table.getdataListParm.parammaps.inputDatetime = ''
  1313. this.tab.table.getdataListParm.parammaps.startTime = ''
  1314. this.tab.table.getdataListParm.parammaps.stopTime = ''
  1315. }
  1316. this.tab.table.getdataListParm.offset = 1
  1317. this.getTabList()
  1318. this.tab.table2.getdataListParm.name = 'getAccuracySNS'
  1319. this.tab.table2.getdataListParm.parammaps.startTime = this.tab.table.getdataListParm.parammaps.startTime
  1320. this.tab.table2.getdataListParm.parammaps.stopTime = this.tab.table.getdataListParm.parammaps.stopTime
  1321. this.tab.table2.getdataListParm.offset = 1
  1322. this.getTabList2()
  1323. } else if (this.tab.radio == '3') {
  1324. console.log(' 牲畜类别/查询')
  1325. this.tab.isFormulaName = false
  1326. this.tab.isHouseName = false
  1327. this.tab.isLivestockType = true
  1328. this.tab.isTrainNumber = false
  1329. this.tab.table.getdataListParm.name = 'getAccuracyHSC'
  1330. if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
  1331. this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  1332. this.tab.table.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  1333. } else {
  1334. this.tab.table.getdataListParm.parammaps.inputDatetime = ''
  1335. this.tab.table.getdataListParm.parammaps.startTime = ''
  1336. this.tab.table.getdataListParm.parammaps.stopTime = ''
  1337. }
  1338. this.tab.table.getdataListParm.offset = 1
  1339. this.getTabList()
  1340. this.tab.table2.getdataListParm.name = 'getAccuracySSC'
  1341. this.tab.table2.getdataListParm.parammaps.startTime = this.tab.table.getdataListParm.parammaps.startTime
  1342. this.tab.table2.getdataListParm.parammaps.stopTime = this.tab.table.getdataListParm.parammaps.stopTime
  1343. this.tab.table2.getdataListParm.offset = 1
  1344. this.getTabList2()
  1345. } else if (this.tab.radio == '4') {
  1346. console.log('车次/查询')
  1347. this.tab.isFormulaName = false
  1348. this.tab.isHouseName = false
  1349. this.tab.isLivestockType = false
  1350. this.tab.isTrainNumber = true
  1351. this.tab.table.getdataListParm.name = 'getAccuracyHCC'
  1352. if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
  1353. this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  1354. this.tab.table.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  1355. } else {
  1356. this.tab.table.getdataListParm.parammaps.inputDatetime = ''
  1357. this.tab.table.getdataListParm.parammaps.startTime = ''
  1358. this.tab.table.getdataListParm.parammaps.stopTime = ''
  1359. }
  1360. this.tab.table.getdataListParm.offset = 1
  1361. this.getTabList()
  1362. this.tab.table2.getdataListParm.name = 'getAccuracySCC'
  1363. this.tab.table2.getdataListParm.parammaps.startTime = this.tab.table.getdataListParm.parammaps.startTime
  1364. this.tab.table2.getdataListParm.parammaps.stopTime = this.tab.table.getdataListParm.parammaps.stopTime
  1365. this.tab.table2.getdataListParm.offset = 1
  1366. this.getTabList2()
  1367. }
  1368. this.tab.table2.getdataListParm.parammaps.fname = this.tab.table.getdataListParm.parammaps.fname
  1369. },
  1370. // 快速跳转到图表
  1371. handleQuickJumpChart() {
  1372. console.log(document.querySelector('#chartDate'))
  1373. document.querySelector('#chartDate').scrollIntoView()
  1374. },
  1375. // 快速回到顶部
  1376. handleQuickJumpTop() {
  1377. window.scrollTo(0, 0)
  1378. },
  1379. // 图表总查询
  1380. handleChartDate() {
  1381. console.log('点击了确认时间')
  1382. MessageBox.confirm('是否调整以下所有图表查询时间?', {
  1383. confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
  1384. }).then(() => {
  1385. var that = this
  1386. var startTime = parseTime(this.tab.chartDate[0], '{y}-{m}-{d}')
  1387. var stopTime = parseTime(this.tab.chartDate[1], '{y}-{m}-{d}')
  1388. that.tab.chart1.getdataListParm.parammaps.inputDatetime = this.tab.chartDate
  1389. that.tab.chart1.getdataListParm.parammaps.startTime = startTime
  1390. that.tab.chart1.getdataListParm.parammaps.stopTime = stopTime
  1391. that.getChart1()
  1392. that.tab.chart2.getdataListParm.parammaps.inputDatetime = this.tab.chartDate
  1393. that.tab.chart2.getdataListParm.parammaps.startTime = startTime
  1394. that.tab.chart2.getdataListParm.parammaps.stopTime = stopTime
  1395. that.getChart2()
  1396. that.tab.chart3.getdataListParm.parammaps.inputDatetime = this.tab.chartDate
  1397. that.tab.chart3.getdataListParm.parammaps.startTime = startTime
  1398. that.tab.chart3.getdataListParm.parammaps.stopTime = stopTime
  1399. that.getChart3()
  1400. that.tab.chart4.getdataListParm.parammaps.inputDatetime = this.tab.chartDate
  1401. that.tab.chart4.getdataListParm.parammaps.startTime = startTime
  1402. that.tab.chart4.getdataListParm.parammaps.stopTime = stopTime
  1403. that.getChart4()
  1404. that.tab.chart5.getdataListParm.parammaps.inputDatetime = this.tab.chartDate
  1405. that.tab.chart5.getdataListParm.parammaps.startTime = startTime
  1406. that.tab.chart5.getdataListParm.parammaps.stopTime = stopTime
  1407. that.getChart5()
  1408. that.tab.chart6.getdataListParm.parammaps.inputDatetime = this.tab.chartDate
  1409. that.tab.chart6.getdataListParm.parammaps.startTime = startTime
  1410. that.tab.chart6.getdataListParm.parammaps.stopTime = stopTime
  1411. that.getChart6()
  1412. that.tab.chart7.getdataListParm.parammaps.inputDatetime = this.tab.chartDate
  1413. that.tab.chart7.getdataListParm.parammaps.startTime = startTime
  1414. that.tab.chart7.getdataListParm.parammaps.stopTime = stopTime
  1415. that.getChart7()
  1416. })
  1417. },
  1418. // 配方准确率
  1419. changeStatisticChart1() {
  1420. var arrData3 = []
  1421. for (let i = 0; i < this.tab.chart1.getdataListParm.parammaps.statisticsList.length; i++) {
  1422. const myId = this.tab.chart1.statisticsList.find(obj => obj.name == this.tab.chart1.getdataListParm.parammaps.statisticsList[i]).id
  1423. for (let j = 0; j < this.tab.chart1.chart1Data3.length; j++) {
  1424. if (j == myId) {
  1425. arrData3.push(this.tab.chart1.chart1Data3[j])
  1426. }
  1427. }
  1428. }
  1429. this.tab.chart1.chartLine_data.data3 = arrData3
  1430. this.tab.chart1.chartLine_data.data1 = this.tab.chart1.getdataListParm.parammaps.statisticsList
  1431. this.roadChartLine1(this.tab.chart1.chartLine_data)
  1432. },
  1433. getChart1() {
  1434. this.tab.chart1.listLoading = true
  1435. GetReportform(this.tab.chart1.getdataListParm).then(response => {
  1436. if (response.data.list !== null) {
  1437. for (let i = 0; i < response.data.data.length; i++) {
  1438. response.data.data[i].准确率 = parseFloat(response.data.data[i].准确率) + '%'
  1439. }
  1440. this.tab.chart1.table.list = response.data.data
  1441. this.tab.chart1.chartLine_data = response.data.list
  1442. this.tab.chart1.statisticsList = []
  1443. this.tab.chart1.getdataListParm.parammaps.statisticsList = []
  1444. for (let i = 0; i < response.data.list.data1.length; i++) {
  1445. if (i < 10) {
  1446. this.tab.chart1.getdataListParm.parammaps.statisticsList.push(response.data.list.data1[i])
  1447. }
  1448. var obj = {}
  1449. obj.id = i
  1450. obj.name = response.data.list.data1[i]
  1451. this.tab.chart1.statisticsList.push(obj)
  1452. }
  1453. this.tab.chart1.chart1Data3 = response.data.list.data3
  1454. this.tab.chart1.total = response.data.total
  1455. console.log('配方准确率表数据', this.tab.chart1.table.list)
  1456. console.log('配方准确率图数据', this.tab.chart1.chartLine_data)
  1457. var arrData3 = []
  1458. for (let i = 0; i < this.tab.chart1.getdataListParm.parammaps.statisticsList.length; i++) {
  1459. const myId = this.tab.chart1.statisticsList.find(obj => obj.name == this.tab.chart1.getdataListParm.parammaps.statisticsList[i]).id
  1460. for (let j = 0; j < this.tab.chart1.chart1Data3.length; j++) {
  1461. if (j == myId) {
  1462. arrData3.push(this.tab.chart1.chart1Data3[j])
  1463. }
  1464. }
  1465. }
  1466. this.tab.chart1.chartLine_data.data3 = arrData3
  1467. this.tab.chart1.chartLine_data.data1 = this.tab.chart1.getdataListParm.parammaps.statisticsList
  1468. this.roadChartLine1(this.tab.chart1.chartLine_data)
  1469. } else {
  1470. this.tab.chart1.list = []
  1471. }
  1472. setTimeout(() => {
  1473. this.tab.chart1.listLoading = false
  1474. }, 100)
  1475. })
  1476. },
  1477. roadChartLine1(chartLine_data) {
  1478. if (this.tab.chart1.chartLine != null) {
  1479. this.tab.chart1.chartLine.dispose()
  1480. }
  1481. this.tab.chart1.chartLine = echarts.init(document.getElementById('chartLine1'))
  1482. var option = {
  1483. title: {
  1484. text: ''
  1485. },
  1486. tooltip: {
  1487. trigger: 'axis'
  1488. },
  1489. legend: {
  1490. data: chartLine_data.data1,
  1491. right: 10
  1492. },
  1493. grid: {
  1494. top: '20%',
  1495. left: '5%',
  1496. right: '8%',
  1497. containLabel: true
  1498. },
  1499. toolbox: {
  1500. show: true,
  1501. right: '2%',
  1502. feature: {}
  1503. },
  1504. xAxis: { type: 'category', boundaryGap: false, data: chartLine_data.data2, name: '日期' },
  1505. yAxis: {
  1506. type: 'value', name: '百分比', axisLabel: { formatter: '{value} %' }
  1507. },
  1508. series: (function() {
  1509. var serie = []
  1510. for (var i = 0; i < chartLine_data.data3.length; i++) {
  1511. var item = {
  1512. name: chartLine_data.data1[i],
  1513. type: 'line',
  1514. data: chartLine_data.data3[i].data
  1515. }
  1516. serie.push(item)
  1517. }
  1518. return serie
  1519. }())
  1520. }
  1521. this.tab.chart1.chartLine.setOption(option)
  1522. window.onresize = function() {
  1523. this.tab.chart1.chartLine.resize()
  1524. }
  1525. },
  1526. // 计划统计
  1527. getChart2() {
  1528. this.tab.chart2.listLoading = true
  1529. GetReportform(this.tab.chart2.getdataListParm).then(response => {
  1530. if (response.data.list !== null) {
  1531. this.tab.chart2.table.list = response.data.data
  1532. this.tab.chart2.chartLine_data = response.data.list
  1533. this.tab.chart2.total = response.data.total
  1534. console.log('计划统计图数据', this.tab.chart2.chartLine_data)
  1535. console.log('计划统计表数据', this.tab.chart2.table.list)
  1536. this.roadChartLine2(this.tab.chart2.chartLine_data)
  1537. } else {
  1538. this.tab.chart2.list = []
  1539. }
  1540. setTimeout(() => {
  1541. this.tab.chart2.listLoading = false
  1542. }, 100)
  1543. })
  1544. },
  1545. roadChartLine2(chartLine_data) {
  1546. if (this.tab.chart2.chartLine != null) {
  1547. this.tab.chart2.chartLine.dispose()
  1548. }
  1549. this.tab.chart2.chartLine = echarts.init(document.getElementById('chartLine2'))
  1550. var option = {
  1551. title: {
  1552. text: ''
  1553. },
  1554. tooltip: {
  1555. trigger: 'axis'
  1556. },
  1557. legend: {
  1558. data: ['计划准确率', '计划正确率', '计划准确率(去除取消重量)'],
  1559. right: 10
  1560. },
  1561. grid: {
  1562. top: '20%',
  1563. left: '5%',
  1564. right: '8%',
  1565. containLabel: true
  1566. },
  1567. toolbox: {
  1568. show: true,
  1569. right: '2%',
  1570. feature: {}
  1571. },
  1572. xAxis: { type: 'category', boundaryGap: false, data: chartLine_data.data1, name: '日期' },
  1573. yAxis: {
  1574. type: 'value', name: '百分比', axisLabel: { formatter: '{value} %' }
  1575. },
  1576. series: [
  1577. { name: '计划准确率', type: 'line', data: chartLine_data.data2 },
  1578. { name: '计划正确率', type: 'line', data: chartLine_data.data3 },
  1579. { name: '计划准确率(去除取消重量)', type: 'line', data: chartLine_data.data4 }
  1580. ]
  1581. }
  1582. this.tab.chart2.chartLine.setOption(option)
  1583. window.onresize = function() {
  1584. this.tab.chart2.chartLine.resize()
  1585. }
  1586. },
  1587. // 牛群准确率
  1588. changeStatisticChart3() {
  1589. var arrData3 = []
  1590. for (let i = 0; i < this.tab.chart3.getdataListParm.parammaps.statisticsList.length; i++) {
  1591. const myId = this.tab.chart3.statisticsList.find(obj => obj.name == this.tab.chart3.getdataListParm.parammaps.statisticsList[i]).id
  1592. for (let j = 0; j < this.tab.chart3.chart3Data3.length; j++) {
  1593. if (j == myId) {
  1594. arrData3.push(this.tab.chart3.chart3Data3[j])
  1595. }
  1596. }
  1597. }
  1598. this.tab.chart3.chartLine_data.data3 = arrData3
  1599. this.tab.chart3.chartLine_data.data1 = this.tab.chart3.getdataListParm.parammaps.statisticsList
  1600. this.roadChartLine3(this.tab.chart3.chartLine_data)
  1601. },
  1602. getChart3() {
  1603. this.tab.chart3.listLoading = true
  1604. GetReportform(this.tab.chart3.getdataListParm).then(response => {
  1605. if (response.data.data !== null) {
  1606. for (let i = 0; i < response.data.data.length; i++) {
  1607. response.data.data[i].准确率 = response.data.data[i].准确率 + '%'
  1608. }
  1609. this.tab.chart3.table.list = response.data.data
  1610. this.tab.chart3.chartLine_data = response.data.list
  1611. this.tab.chart3.total = response.data.total
  1612. this.tab.chart3.statisticsList = []
  1613. this.tab.chart3.getdataListParm.parammaps.statisticsList = []
  1614. for (let i = 0; i < response.data.list.data1.length; i++) {
  1615. if (i < 10) {
  1616. this.tab.chart3.getdataListParm.parammaps.statisticsList.push(response.data.list.data1[i])
  1617. }
  1618. var obj = {}
  1619. obj.id = i
  1620. obj.name = response.data.list.data1[i]
  1621. this.tab.chart3.statisticsList.push(obj)
  1622. }
  1623. this.tab.chart3.chart3Data3 = response.data.list.data3
  1624. this.tab.chart3.total = response.data.total
  1625. console.log('牛群准确率图数据', this.tab.chart3.chartLine_data)
  1626. console.log('牛群准确率表数据', this.tab.chart3.table.list)
  1627. var arrData3 = []
  1628. for (let i = 0; i < this.tab.chart3.getdataListParm.parammaps.statisticsList.length; i++) {
  1629. const myId = this.tab.chart3.statisticsList.find(obj => obj.name == this.tab.chart3.getdataListParm.parammaps.statisticsList[i]).id
  1630. for (let j = 0; j < this.tab.chart3.chart3Data3.length; j++) {
  1631. if (j == myId) {
  1632. arrData3.push(this.tab.chart3.chart3Data3[j])
  1633. }
  1634. }
  1635. }
  1636. this.tab.chart3.chartLine_data.data3 = arrData3
  1637. this.tab.chart3.chartLine_data.data1 = this.tab.chart3.getdataListParm.parammaps.statisticsList
  1638. this.roadChartLine3(this.tab.chart3.chartLine_data)
  1639. } else {
  1640. this.tab.chart3.list = []
  1641. }
  1642. setTimeout(() => {
  1643. this.tab.chart3.listLoading = false
  1644. }, 100)
  1645. })
  1646. },
  1647. roadChartLine3(chartLine_data) {
  1648. if (this.tab.chart3.chartLine != null) {
  1649. this.tab.chart3.chartLine.dispose()
  1650. }
  1651. this.tab.chart3.chartLine = echarts.init(document.getElementById('chartLine3'))
  1652. var option = {
  1653. title: {
  1654. text: ''
  1655. },
  1656. tooltip: {
  1657. trigger: 'axis'
  1658. },
  1659. legend: {
  1660. data: chartLine_data.data1,
  1661. right: 10
  1662. },
  1663. grid: {
  1664. top: '20%',
  1665. left: '5%',
  1666. right: '8%',
  1667. containLabel: true
  1668. },
  1669. toolbox: {
  1670. show: true,
  1671. right: '2%',
  1672. feature: {}
  1673. },
  1674. xAxis: { type: 'category', boundaryGap: false, data: chartLine_data.data2, name: '日期' },
  1675. yAxis: {
  1676. type: 'value', name: '百分比', axisLabel: { formatter: '{value} %' }
  1677. },
  1678. series: (function() {
  1679. var serie = []
  1680. for (var i = 0; i < chartLine_data.data3.length; i++) {
  1681. var item = {
  1682. name: chartLine_data.data1[i],
  1683. type: 'line',
  1684. data: chartLine_data.data3[i].data
  1685. }
  1686. serie.push(item)
  1687. }
  1688. return serie
  1689. }())
  1690. }
  1691. this.tab.chart3.chartLine.setOption(option)
  1692. window.onresize = function() {
  1693. this.tab.chart3.chartLine.resize()
  1694. }
  1695. },
  1696. // 车辆准确率(重量)
  1697. changeStatisticChart4() {
  1698. var arrData3 = []
  1699. for (let i = 0; i < this.tab.chart4.getdataListParm.parammaps.statisticsList.length; i++) {
  1700. const myId = this.tab.chart4.statisticsList.find(obj => obj.name == this.tab.chart4.getdataListParm.parammaps.statisticsList[i]).id
  1701. for (let j = 0; j < this.tab.chart4.chart4Data3.length; j++) {
  1702. if (j == myId) {
  1703. arrData3.push(this.tab.chart4.chart4Data3[j])
  1704. }
  1705. }
  1706. }
  1707. this.tab.chart4.chartLine_data.data3 = arrData3
  1708. this.tab.chart4.chartLine_data.data1 = this.tab.chart4.getdataListParm.parammaps.statisticsList
  1709. this.roadChartLine4(this.tab.chart4.chartLine_data)
  1710. },
  1711. getChart4() {
  1712. this.tab.chart4.listLoading = true
  1713. GetReportform(this.tab.chart4.getdataListParm).then(response => {
  1714. if (response.data.list !== null) {
  1715. for (let i = 0; i < response.data.data.length; i++) {
  1716. response.data.data[i].准确率 = response.data.data[i].准确率 + '%'
  1717. }
  1718. this.tab.chart4.table.list = response.data.data
  1719. this.tab.chart4.chartLine_data = response.data.list
  1720. this.tab.chart4.total = response.data.total
  1721. this.tab.chart4.statisticsList = []
  1722. this.tab.chart4.getdataListParm.parammaps.statisticsList = []
  1723. for (let i = 0; i < response.data.list.data1.length; i++) {
  1724. if (i < 10) {
  1725. this.tab.chart4.getdataListParm.parammaps.statisticsList.push(response.data.list.data1[i])
  1726. }
  1727. var obj = {}
  1728. obj.id = i
  1729. obj.name = response.data.list.data1[i]
  1730. this.tab.chart4.statisticsList.push(obj)
  1731. }
  1732. this.tab.chart4.chart4Data3 = response.data.list.data3
  1733. this.tab.chart4.total = response.data.total
  1734. console.log('车辆准确率(重量)图', this.tab.chart4.chartLine_data)
  1735. console.log('车辆准确率(重量)表', this.tab.chart4.table.list)
  1736. var arrData3 = []
  1737. for (let i = 0; i < this.tab.chart4.getdataListParm.parammaps.statisticsList.length; i++) {
  1738. const myId = this.tab.chart4.statisticsList.find(obj => obj.name == this.tab.chart4.getdataListParm.parammaps.statisticsList[i]).id
  1739. for (let j = 0; j < this.tab.chart4.chart4Data3.length; j++) {
  1740. if (j == myId) {
  1741. arrData3.push(this.tab.chart4.chart4Data3[j])
  1742. }
  1743. }
  1744. }
  1745. this.tab.chart4.chartLine_data.data3 = arrData3
  1746. this.tab.chart4.chartLine_data.data1 = this.tab.chart4.getdataListParm.parammaps.statisticsList
  1747. this.roadChartLine4(this.tab.chart4.chartLine_data)
  1748. } else {
  1749. this.tab.chart4.list = []
  1750. }
  1751. setTimeout(() => {
  1752. this.tab.chart4.listLoading = false
  1753. }, 100)
  1754. })
  1755. },
  1756. roadChartLine4(chartLine_data) {
  1757. if (this.tab.chart4.chartLine != null) {
  1758. this.tab.chart4.chartLine.dispose()
  1759. }
  1760. this.tab.chart4.chartLine = echarts.init(document.getElementById('chartLine4'))
  1761. var option = {
  1762. title: {
  1763. text: ''
  1764. },
  1765. tooltip: {
  1766. trigger: 'axis'
  1767. },
  1768. legend: {
  1769. data: chartLine_data.data1,
  1770. right: 10
  1771. },
  1772. grid: {
  1773. top: '20%',
  1774. left: '5%',
  1775. right: '8%',
  1776. containLabel: true
  1777. },
  1778. toolbox: {
  1779. show: true,
  1780. right: '2%',
  1781. feature: {}
  1782. },
  1783. xAxis: { type: 'category', boundaryGap: false, data: chartLine_data.data2, name: '日期' },
  1784. yAxis: {
  1785. type: 'value', name: '百分比', axisLabel: { formatter: '{value} %' }
  1786. },
  1787. series: (function() {
  1788. var serie = []
  1789. for (var i = 0; i < chartLine_data.data3.length; i++) {
  1790. var item = {
  1791. name: chartLine_data.data1[i],
  1792. type: 'line',
  1793. data: chartLine_data.data3[i].data
  1794. }
  1795. serie.push(item)
  1796. }
  1797. return serie
  1798. }())
  1799. }
  1800. this.tab.chart4.chartLine.setOption(option)
  1801. window.onresize = function() {
  1802. this.tab.chart4.chartLine.resize()
  1803. }
  1804. },
  1805. // 混料统计
  1806. getChart5() {
  1807. this.tab.chart5.listLoading = true
  1808. GetReportform(this.tab.chart5.getdataListParm).then(response => {
  1809. if (response.data.list !== null) {
  1810. this.tab.chart5.table.list = response.data.data
  1811. this.tab.chart5.chartLine_data = response.data.list
  1812. this.tab.chart5.total = response.data.total
  1813. console.log('混料统计图', this.tab.chart5.chartLine_data)
  1814. console.log('混料统计表', this.tab.chart5.table.list)
  1815. this.roadChartLine5(this.tab.chart5.chartLine_data)
  1816. } else {
  1817. this.tab.chart5.list = []
  1818. }
  1819. setTimeout(() => {
  1820. this.tab.chart5.listLoading = false
  1821. }, 100)
  1822. })
  1823. },
  1824. roadChartLine5(chartLine_data) {
  1825. if (this.tab.chart5.chartLine != null) {
  1826. this.tab.chart5.chartLine.dispose()
  1827. }
  1828. this.tab.chart5.chartLine = echarts.init(document.getElementById('chartLine5'))
  1829. var option = {
  1830. tooltip: {
  1831. trigger: 'axis',
  1832. axisPointer: {
  1833. type: 'cross',
  1834. crossStyle: {
  1835. color: '#999'
  1836. }
  1837. }
  1838. },
  1839. toolbox: {
  1840. feature: {}
  1841. },
  1842. legend: {
  1843. data: ['自动跳转次数', '手动跳转次数', '自动跳转准确率', '手动跳转准确率']
  1844. },
  1845. grid: {
  1846. top: '20%',
  1847. left: '5%',
  1848. right: '8%',
  1849. containLabel: true
  1850. },
  1851. xAxis: [
  1852. {
  1853. type: 'category',
  1854. data: chartLine_data.data1,
  1855. axisPointer: {
  1856. type: 'shadow'
  1857. }
  1858. }
  1859. ],
  1860. yAxis: [
  1861. {
  1862. type: 'value',
  1863. name: '跳转次数',
  1864. axisLabel: {
  1865. formatter: '{value}'
  1866. }
  1867. },
  1868. {
  1869. type: 'value',
  1870. name: '混料准确率',
  1871. min: 0,
  1872. max: 100,
  1873. interval: 10,
  1874. axisLabel: {
  1875. formatter: '{value} %'
  1876. }
  1877. }
  1878. ],
  1879. series: [
  1880. {
  1881. name: '自动跳转次数',
  1882. type: 'bar',
  1883. data: chartLine_data.data2
  1884. },
  1885. {
  1886. name: '手动跳转次数',
  1887. type: 'bar',
  1888. data: chartLine_data.data3
  1889. },
  1890. {
  1891. name: '自动跳转准确率',
  1892. type: 'line',
  1893. yAxisIndex: 1,
  1894. data: chartLine_data.data4
  1895. },
  1896. {
  1897. name: '手动跳转准确率',
  1898. type: 'line',
  1899. yAxisIndex: 1,
  1900. data: chartLine_data.data5
  1901. }
  1902. ]
  1903. }
  1904. this.tab.chart5.chartLine.setOption(option)
  1905. window.onresize = function() {
  1906. this.tab.chart5.chartLine.resize()
  1907. }
  1908. },
  1909. // 混料计划取消次数
  1910. getChart6() {
  1911. this.tab.chart6.listLoading = true
  1912. GetReportform(this.tab.chart6.getdataListParm).then(response => {
  1913. if (response.data.list !== null) {
  1914. this.tab.chart6.table.list = response.data.data
  1915. this.tab.chart6.chartLine_data = response.data.list
  1916. this.tab.chart6.total = response.data.total
  1917. console.log('混料计划取消次数图', this.tab.chart6.chartLine_data)
  1918. console.log('混料计划取消次数表', this.tab.chart6.table.list)
  1919. this.roadChartLine6(this.tab.chart6.chartLine_data)
  1920. } else {
  1921. this.tab.chart6.list = []
  1922. }
  1923. setTimeout(() => {
  1924. this.tab.chart6.listLoading = false
  1925. }, 100)
  1926. })
  1927. },
  1928. roadChartLine6(chartLine_data) {
  1929. if (this.tab.chart6.chartLine != null) {
  1930. this.tab.chart6.chartLine.dispose()
  1931. }
  1932. this.tab.chart6.chartLine = echarts.init(document.getElementById('chartLine6'))
  1933. var option = {
  1934. color: ['#3398DB'],
  1935. tooltip: {
  1936. trigger: 'axis',
  1937. axisPointer: { // 坐标轴指示器,坐标轴触发有效
  1938. type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
  1939. }
  1940. },
  1941. legend: {
  1942. data: ['取消次数'],
  1943. right: 10
  1944. },
  1945. grid: {
  1946. top: '20%',
  1947. left: '5%',
  1948. right: '8%',
  1949. containLabel: true
  1950. },
  1951. xAxis: [
  1952. {
  1953. name: '日期',
  1954. type: 'category',
  1955. data: chartLine_data.data1,
  1956. axisTick: {
  1957. alignWithLabel: true
  1958. }
  1959. }
  1960. ],
  1961. yAxis: [
  1962. {
  1963. name: '次数',
  1964. interval: 1, // 会出现负数刻度
  1965. min: 0,
  1966. type: 'value'
  1967. }
  1968. ],
  1969. series: [
  1970. {
  1971. name: '取消次数',
  1972. type: 'bar',
  1973. barWidth: '60%',
  1974. data: chartLine_data.data2
  1975. }
  1976. ]
  1977. }
  1978. this.tab.chart6.chartLine.setOption(option)
  1979. window.onresize = function() {
  1980. this.tab.chart6.chartLine.resize()
  1981. }
  1982. },
  1983. // 栏舍撒料时间统计
  1984. changeStatisticChart7() {
  1985. var arrData3 = []
  1986. for (let i = 0; i < this.tab.chart7.getdataListParm.parammaps.statisticsList.length; i++) {
  1987. const myId = this.tab.chart7.statisticsList.find(obj => obj.name == this.tab.chart7.getdataListParm.parammaps.statisticsList[i]).id
  1988. for (let j = 0; j < this.tab.chart7.chart7Data3.length; j++) {
  1989. if (j == myId) {
  1990. arrData3.push(this.tab.chart7.chart7Data3[j])
  1991. }
  1992. }
  1993. }
  1994. this.tab.chart7.chartLine_data.data3 = arrData3
  1995. this.tab.chart7.chartLine_data.data1 = this.tab.chart7.getdataListParm.parammaps.statisticsList
  1996. this.roadChartLine7(this.tab.chart7.chartLine_data)
  1997. },
  1998. getChart7() {
  1999. this.tab.chart7.listLoading = true
  2000. GetReportform(this.tab.chart7.getdataListParm).then(response => {
  2001. if (response.data.list !== null) {
  2002. for (let i = 0; i < response.data.data.length; i++) {
  2003. // 撒料时间
  2004. var b = []
  2005. for (let j = 0; j <= response.data.data[i].准确率.length; j++) {
  2006. // console.log(response.data.data[i].准确率)
  2007. if (response.data.data[i].准确率.charAt(j) == '.') {
  2008. b[j] = response.data.data[i].准确率.replace('.', ':')
  2009. }
  2010. }
  2011. response.data.data[i].准确率 = b[b.length - 1]
  2012. response.data.data[i].撒料时间 = response.data.data[i].准确率
  2013. }
  2014. this.tab.chart7.table.list = response.data.data
  2015. this.tab.chart7.chartLine_data = response.data.list
  2016. this.tab.chart7.statisticsList = []
  2017. this.tab.chart7.getdataListParm.parammaps.statisticsList = []
  2018. for (let i = 0; i < response.data.list.data1.length; i++) {
  2019. if (i < 10) {
  2020. this.tab.chart7.getdataListParm.parammaps.statisticsList.push(response.data.list.data1[i])
  2021. }
  2022. var obj = {}
  2023. obj.id = i
  2024. obj.name = response.data.list.data1[i]
  2025. this.tab.chart7.statisticsList.push(obj)
  2026. }
  2027. this.tab.chart7.chart7Data3 = response.data.list.data3
  2028. this.tab.chart7.total = response.data.total
  2029. console.log('栏舍撒料时间统计图', this.tab.chart7.chartLine_data)
  2030. console.log('栏舍撒料时间统计表', this.tab.chart7.table.list)
  2031. var arrData3 = []
  2032. for (let i = 0; i < this.tab.chart7.getdataListParm.parammaps.statisticsList.length; i++) {
  2033. const myId = this.tab.chart7.statisticsList.find(obj => obj.name == this.tab.chart7.getdataListParm.parammaps.statisticsList[i]).id
  2034. for (let j = 0; j < this.tab.chart7.chart7Data3.length; j++) {
  2035. if (j == myId) {
  2036. arrData3.push(this.tab.chart7.chart7Data3[j])
  2037. }
  2038. }
  2039. }
  2040. this.tab.chart7.chartLine_data.data3 = arrData3
  2041. this.tab.chart7.chartLine_data.data1 = this.tab.chart7.getdataListParm.parammaps.statisticsList
  2042. this.roadChartLine7(this.tab.chart7.chartLine_data)
  2043. } else {
  2044. this.tab.chart7.list = []
  2045. }
  2046. setTimeout(() => {
  2047. this.tab.chart7.listLoading = false
  2048. }, 100)
  2049. })
  2050. },
  2051. roadChartLine7(chartLine_data) {
  2052. if (this.tab.chart7.chartLine != null) {
  2053. this.tab.chart7.chartLine.dispose()
  2054. }
  2055. this.tab.chart7.chartLine = echarts.init(document.getElementById('chartLine7'))
  2056. var option = {
  2057. title: {
  2058. text: ''
  2059. },
  2060. tooltip: {
  2061. trigger: 'axis',
  2062. formatter: function(params) {
  2063. // console.log(params)
  2064. var tip = params[0].name
  2065. for (let i = 0; i < params.length; i++) {
  2066. var b = []
  2067. // var str = params[i].value
  2068. for (let j = 0; j <= params[i].value.length; j++) {
  2069. if (params[i].value !== '') {
  2070. if (params[i].value.charAt(j) == '.') {
  2071. b[j] = params[i].value.replace('.', ':')
  2072. }
  2073. } else {
  2074. b[j] = ''
  2075. }
  2076. }
  2077. tip += '<br>' + params[i].seriesName + ': ' + b[b.length - 1]
  2078. }
  2079. return tip
  2080. }
  2081. },
  2082. legend: {
  2083. data: chartLine_data.data1,
  2084. right: 10
  2085. },
  2086. grid: {
  2087. top: '20%',
  2088. left: '5%',
  2089. right: '8%',
  2090. containLabel: true
  2091. },
  2092. toolbox: {
  2093. show: true,
  2094. right: '2%',
  2095. feature: {}
  2096. },
  2097. xAxis: { type: 'category', boundaryGap: false, data: chartLine_data.data2, name: '日期' },
  2098. yAxis: [{
  2099. type: '',
  2100. name: '时间',
  2101. mix: 0,
  2102. max: 24,
  2103. interval: 2,
  2104. axisLabel: {
  2105. formatter: function(value) {
  2106. var texts = []
  2107. if (value < 10) {
  2108. texts.push('0' + value + ':00')
  2109. } else {
  2110. texts.push(value + ':00')
  2111. }
  2112. return texts
  2113. }
  2114. }
  2115. }],
  2116. series: (function() {
  2117. var serie = []
  2118. for (var i = 0; i < chartLine_data.data3.length; i++) {
  2119. var item = {
  2120. name: chartLine_data.data1[i],
  2121. type: 'line',
  2122. data: chartLine_data.data3[i].data
  2123. }
  2124. serie.push(item)
  2125. }
  2126. return serie
  2127. }())
  2128. }
  2129. this.tab.chart7.chartLine.setOption(option)
  2130. window.onresize = function() {
  2131. this.tab.chart7.chartLine.resize()
  2132. }
  2133. },
  2134. // 时间
  2135. changeChartDate(item) {
  2136. console.log(item)
  2137. if (item == 'chart1') {
  2138. if (this.tab.chart1.getdataListParm.parammaps.inputDatetime !== '' && this.tab.chart1.getdataListParm.parammaps.inputDatetime !== null) {
  2139. this.tab.chart1.getdataListParm.parammaps.startTime = parseTime(this.tab.chart1.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  2140. this.tab.chart1.getdataListParm.parammaps.stopTime = parseTime(this.tab.chart1.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  2141. this.getChart1()
  2142. } else {
  2143. this.tab.chart1.getdataListParm.parammaps.inputDatetime = ''
  2144. this.tab.chart1.getdataListParm.parammaps.startTime = ''
  2145. this.tab.chart1.getdataListParm.parammaps.stopTime = ''
  2146. this.getChart1()
  2147. }
  2148. } else if (item == 'chart2') {
  2149. if (this.tab.chart2.getdataListParm.parammaps.inputDatetime !== '' && this.tab.chart2.getdataListParm.parammaps.inputDatetime !== null) {
  2150. this.tab.chart2.getdataListParm.parammaps.startTime = parseTime(this.tab.chart2.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  2151. this.tab.chart2.getdataListParm.parammaps.stopTime = parseTime(this.tab.chart2.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  2152. this.getChart2()
  2153. } else {
  2154. this.tab.chart2.getdataListParm.parammaps.inputDatetime = ''
  2155. this.tab.chart2.getdataListParm.parammaps.startTime = ''
  2156. this.tab.chart2.getdataListParm.parammaps.stopTime = ''
  2157. this.getChart2()
  2158. }
  2159. } else if (item == 'chart3') {
  2160. if (this.tab.chart3.getdataListParm.parammaps.inputDatetime !== '' && this.tab.chart3.getdataListParm.parammaps.inputDatetime !== null) {
  2161. this.tab.chart3.getdataListParm.parammaps.startTime = parseTime(this.tab.chart3.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  2162. this.tab.chart3.getdataListParm.parammaps.stopTime = parseTime(this.tab.chart3.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  2163. this.getChart3()
  2164. } else {
  2165. this.tab.chart3.getdataListParm.parammaps.inputDatetime = ''
  2166. this.tab.chart3.getdataListParm.parammaps.startTime = ''
  2167. this.tab.chart3.getdataListParm.parammaps.stopTime = ''
  2168. this.getChart3()
  2169. }
  2170. } else if (item == 'chart4') {
  2171. if (this.tab.chart4.getdataListParm.parammaps.inputDatetime !== '' && this.tab.chart4.getdataListParm.parammaps.inputDatetime !== null) {
  2172. this.tab.chart4.getdataListParm.parammaps.startTime = parseTime(this.tab.chart4.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  2173. this.tab.chart4.getdataListParm.parammaps.stopTime = parseTime(this.tab.chart4.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  2174. this.getChart4()
  2175. } else {
  2176. this.tab.chart4.getdataListParm.parammaps.inputDatetime = ''
  2177. this.tab.chart4.getdataListParm.parammaps.startTime = ''
  2178. this.tab.chart4.getdataListParm.parammaps.stopTime = ''
  2179. this.getChart4()
  2180. }
  2181. } else if (item == 'chart5') {
  2182. if (this.tab.chart5.getdataListParm.parammaps.inputDatetime !== '' && this.tab.chart5.getdataListParm.parammaps.inputDatetime !== null) {
  2183. this.tab.chart5.getdataListParm.parammaps.startTime = parseTime(this.tab.chart5.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  2184. this.tab.chart5.getdataListParm.parammaps.stopTime = parseTime(this.tab.chart5.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  2185. this.getChart5()
  2186. } else {
  2187. this.tab.chart5.getdataListParm.parammaps.inputDatetime = ''
  2188. this.tab.chart5.getdataListParm.parammaps.startTime = ''
  2189. this.tab.chart5.getdataListParm.parammaps.stopTime = ''
  2190. this.getChart5()
  2191. }
  2192. } else if (item == 'chart6') {
  2193. if (this.tab.chart6.getdataListParm.parammaps.inputDatetime !== '' && this.tab.chart6.getdataListParm.parammaps.inputDatetime !== null) {
  2194. this.tab.chart6.getdataListParm.parammaps.startTime = parseTime(this.tab.chart6.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  2195. this.tab.chart6.getdataListParm.parammaps.stopTime = parseTime(this.tab.chart6.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  2196. this.getChart6()
  2197. } else {
  2198. this.tab.chart6.getdataListParm.parammaps.inputDatetime = ''
  2199. this.tab.chart6.getdataListParm.parammaps.startTime = ''
  2200. this.tab.chart6.getdataListParm.parammaps.stopTime = ''
  2201. this.getChart6()
  2202. }
  2203. } else if (item == 'chart7') {
  2204. if (this.tab.chart6.getdataListParm.parammaps.inputDatetime !== '' && this.tab.chart7.getdataListParm.parammaps.inputDatetime !== null) {
  2205. this.tab.chart7.getdataListParm.parammaps.startTime = parseTime(this.tab.chart7.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  2206. this.tab.chart7.getdataListParm.parammaps.stopTime = parseTime(this.tab.chart7.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  2207. this.getChart7()
  2208. } else {
  2209. this.tab.chart7.getdataListParm.parammaps.inputDatetime = ''
  2210. this.tab.chart7.getdataListParm.parammaps.startTime = ''
  2211. this.tab.chart7.getdataListParm.parammaps.stopTime = ''
  2212. this.getChart7()
  2213. }
  2214. }
  2215. },
  2216. // 导出
  2217. handleExport(item) {
  2218. if (item == 'chart1') {
  2219. console.log('配方准确率导出')
  2220. var excelDatasTabChart1 = [
  2221. {
  2222. tHeader: ['日期', '配方名称', '计划重量(kg)', '实际重量(kg)', '准确率'],
  2223. filterVal: ['日期', '名称', '理论量', '实际量', '准确率'],
  2224. tableDatas: this.tab.chart1.table.list,
  2225. sheetName: '配方准确率'
  2226. }
  2227. ]
  2228. json2excel(excelDatasTabChart1, '配方准确率', true, 'xlsx')
  2229. } else if (item == 'chart2') {
  2230. console.log('计划统计导出')
  2231. var excelDatasTabChart2 = [
  2232. {
  2233. tHeader: ['日期', '计划执行重量(kg)', '配方理论重量(kg)', '计划准确率', '计划取消重量(kg)', '计划准确率(去除取消重量)', '计划正确数', '计划数', '计划正确率'],
  2234. filterVal: ['日期', '实际量', '理论量', 'field1', '计划取消重量', 'field3', '正确数', '计划数', 'field2'],
  2235. tableDatas: this.tab.chart2.table.list,
  2236. sheetName: '计划统计'
  2237. }
  2238. ]
  2239. json2excel(excelDatasTabChart2, '计划统计', true, 'xlsx')
  2240. } else if (item == 'chart3') {
  2241. console.log('牛群准确率导出')
  2242. var excelDatasTabChart3 = [
  2243. {
  2244. tHeader: ['日期', '牲畜类别', '计划重量(kg)', '实际重量(kg)', '准确率'],
  2245. filterVal: ['日期', '名称', '理论量', '实际量', '准确率'],
  2246. tableDatas: this.tab.chart3.table.list,
  2247. sheetName: '牛群准确率'
  2248. }
  2249. ]
  2250. json2excel(excelDatasTabChart3, '牛群准确率', true, 'xlsx')
  2251. } else if (item == 'chart4') {
  2252. console.log('车辆准确率(重量)导出')
  2253. var excelDatasTabChart4 = [
  2254. {
  2255. tHeader: ['日期', '车次', '计划重量(kg)', '实际重量(kg)', '准确率'],
  2256. filterVal: ['日期', '名称', '理论量', '实际量', '准确率'],
  2257. tableDatas: this.tab.chart4.table.list,
  2258. sheetName: '车辆准确率(重量)'
  2259. }
  2260. ]
  2261. json2excel(excelDatasTabChart4, '车辆准确率(重量)', true, 'xlsx')
  2262. } else if (item == 'chart5') {
  2263. console.log('混料统计导出')
  2264. var excelDatasTabChart5 = [
  2265. {
  2266. tHeader: ['日期', '自动跳转次数', '手动跳转次数', '自动跳转理论重量', '自动跳转实际重量', '自动跳转准确率', '手动跳转理论重量', '手动跳转实际重量', '手动跳转准确率'],
  2267. filterVal: ['日期', 'field1', 'field2', '理论自动', '实际自动', 'field3', '理论手动', '实际手动', 'field4'],
  2268. tableDatas: this.tab.chart5.table.list,
  2269. sheetName: '混料统计'
  2270. }
  2271. ]
  2272. json2excel(excelDatasTabChart5, '混料统计', true, 'xlsx')
  2273. } else if (item == 'chart6') {
  2274. console.log('混料计划取消次数导出')
  2275. var excelDatasTabChart6 = [
  2276. {
  2277. tHeader: ['日期', '混料计划取消次数'],
  2278. filterVal: ['日期', 'field1'],
  2279. tableDatas: this.tab.chart6.table.list,
  2280. sheetName: '混料计划取消次数'
  2281. }
  2282. ]
  2283. json2excel(excelDatasTabChart6, '混料计划取消次数', true, 'xlsx')
  2284. } else if (item == 'chart7') {
  2285. console.log('栏舍撒料时间统计导出')
  2286. var excelDatasTabChart7 = [
  2287. {
  2288. tHeader: ['日期', '栏舍', '撒料时间'],
  2289. filterVal: ['日期', 'fname', '准确率'],
  2290. tableDatas: this.tab.chart7.table.list,
  2291. sheetName: '栏舍撒料时间统计'
  2292. }
  2293. ]
  2294. json2excel(excelDatasTabChart7, '栏舍撒料时间统计', true, 'xlsx')
  2295. }
  2296. },
  2297. // 切换表格
  2298. handleTable(item) {
  2299. // 显示切换表格
  2300. if (item == 'chart1') {
  2301. console.log('配方准确率表格')
  2302. this.tab.chart1.isTable = true
  2303. this.tab.chart1.isChart = false
  2304. } else if (item == 'chart2') {
  2305. console.log('计划统计表格')
  2306. this.tab.chart2.isTable = true
  2307. this.tab.chart2.isChart = false
  2308. } else if (item == 'chart3') {
  2309. console.log('牛群准确率表格')
  2310. this.tab.chart3.isTable = true
  2311. this.tab.chart3.isChart = false
  2312. } else if (item == 'chart4') {
  2313. console.log('车辆准确率(重量)表格')
  2314. this.tab.chart4.isTable = true
  2315. this.tab.chart4.isChart = false
  2316. } else if (item == 'chart5') {
  2317. console.log('混料统计表格')
  2318. this.tab.chart5.isTable = true
  2319. this.tab.chart5.isChart = false
  2320. } else if (item == 'chart6') {
  2321. console.log('混料计划取消次数表格')
  2322. this.tab.chart6.isTable = true
  2323. this.tab.chart6.isChart = false
  2324. } else if (item == 'chart7') {
  2325. console.log('栏舍撒料时间统计表格')
  2326. this.tab.chart7.isTable = true
  2327. this.tab.chart7.isChart = false
  2328. }
  2329. },
  2330. // 切换图表
  2331. handleChart(item) {
  2332. // 显示切换图表
  2333. if (item == 'chart1') {
  2334. console.log('配方准确率图表')
  2335. this.tab.chart1.isTable = false
  2336. this.tab.chart1.isChart = true
  2337. } else if (item == 'chart2') {
  2338. console.log('计划统计图表')
  2339. this.tab.chart2.isTable = false
  2340. this.tab.chart2.isChart = true
  2341. } else if (item == 'chart3') {
  2342. console.log('牛群准确率图表')
  2343. this.tab.chart3.isTable = false
  2344. this.tab.chart3.isChart = true
  2345. } else if (item == 'chart4') {
  2346. console.log('车辆准确率(重量)图表')
  2347. this.tab.chart4.isTable = false
  2348. this.tab.chart4.isChart = true
  2349. } else if (item == 'chart5') {
  2350. console.log('混料统计图表')
  2351. this.tab.chart5.isTable = false
  2352. this.tab.chart5.isChart = true
  2353. } else if (item == 'chart6') {
  2354. console.log('混料计划取消次数图表')
  2355. this.tab.chart6.isTable = false
  2356. this.tab.chart6.isChart = true
  2357. } else if (item == 'chart7') {
  2358. console.log('栏舍撒料时间统计图表')
  2359. this.tab.chart7.isTable = false
  2360. this.tab.chart7.isChart = true
  2361. }
  2362. },
  2363. // 混料统计
  2364. getTab2List() {
  2365. this.tab2.table.listLoading = true
  2366. GetDataByName(this.tab2.table.getdataListParm).then(response => {
  2367. console.log('混料统计table数据', response.data.list)
  2368. if (response.data.list !== null) {
  2369. this.tab2.table.list = response.data.list
  2370. this.tab2.table.total = response.data.total
  2371. } else {
  2372. this.tab2.table.list = []
  2373. }
  2374. setTimeout(() => {
  2375. this.tab2.table.listLoading = false
  2376. }, 100)
  2377. })
  2378. },
  2379. handleSearch2() {
  2380. this.tab2.table.getdataListParm.name = 'getStatisticsHL'
  2381. if (this.tab2.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab2.table.getdataListParm.parammaps.inputDatetime !== null) {
  2382. console.log(this.tab2.table.getdataListParm.parammaps.inputDatetime)
  2383. this.tab2.table.getdataListParm.parammaps.startTime = parseTime(this.tab2.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  2384. this.tab2.table.getdataListParm.parammaps.stopTime = parseTime(this.tab2.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  2385. } else {
  2386. this.tab2.table.getdataListParm.parammaps.inputDatetime = ''
  2387. this.tab2.table.getdataListParm.parammaps.startTime = ''
  2388. this.tab2.table.getdataListParm.parammaps.stopTime = ''
  2389. }
  2390. this.tab2.table.getdataListParm.offset = 1
  2391. this.getTab2List()
  2392. },
  2393. handleRefresh2() {
  2394. this.tab2.table.getdataListParm.parammaps.tmrtname = ''
  2395. this.tab2.table.getdataListParm.parammaps.projname = ''
  2396. this.tab2.table.getdataListParm.parammaps.times = ''
  2397. this.tab2.table.getdataListParm.parammaps.templetname = ''
  2398. this.tab2.table.getdataListParm.parammaps.buttontype = ''
  2399. this.getTab2List()
  2400. },
  2401. handleExport2() {
  2402. var excelDatasTab2 = [
  2403. {
  2404. tHeader: ['日期', 'TMR名称', '车次', '班次', '配方名称', '饲料', '理论重量', '实际重量', '误差值', '准确率', '计划时间', '开始时间', '结束时间', ' 跳转方式', '开始重量', '结束重量'],
  2405. filterVal: ['日期', 'TMR名称', '车次', '班次', '配方名称', '饲料', '理论重量', '实际重量', '误差值', '准确率', '计划时间', '开始时间', '结束时间', '跳转方式', '开始重量', '结束重量'],
  2406. tableDatas: this.tab2.table.list,
  2407. sheetName: '混料统计'
  2408. }
  2409. ]
  2410. json2excel(excelDatasTab2, '混料统计', true, 'xlsx')
  2411. },
  2412. // 撒料统计
  2413. getTab3List() {
  2414. this.tab3.table.listLoading = true
  2415. GetDataByName(this.tab3.table.getdataListParm).then(response => {
  2416. console.log('撒料统计table数据', response.data.list)
  2417. if (response.data.list !== null) {
  2418. this.tab3.table.list = response.data.list
  2419. this.tab3.table.total = response.data.total
  2420. } else {
  2421. this.tab3.table.list = []
  2422. }
  2423. setTimeout(() => {
  2424. this.tab3.table.listLoading = false
  2425. }, 100)
  2426. })
  2427. },
  2428. handleSearch3() {
  2429. this.tab3.table.getdataListParm.name = 'getStatisticsSL'
  2430. if (this.tab3.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab3.table.getdataListParm.parammaps.inputDatetime !== null) {
  2431. this.tab3.table.getdataListParm.parammaps.startTime = parseTime(this.tab3.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  2432. this.tab3.table.getdataListParm.parammaps.stopTime = parseTime(this.tab3.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  2433. } else {
  2434. this.tab3.table.getdataListParm.parammaps.inputDatetime = ''
  2435. this.tab3.table.getdataListParm.parammaps.startTime = ''
  2436. this.tab3.table.getdataListParm.parammaps.stopTime = ''
  2437. }
  2438. this.tab3.table.getdataListParm.offset = 1
  2439. this.getTab3List()
  2440. },
  2441. handleRefresh3() {
  2442. this.tab3.table.getdataListParm.parammaps.tmrtname = ''
  2443. this.tab3.table.getdataListParm.parammaps.projname = ''
  2444. this.tab3.table.getdataListParm.parammaps.times = ''
  2445. this.tab3.table.getdataListParm.parammaps.templetname = ''
  2446. this.tab3.table.getdataListParm.parammaps.buttontype = ''
  2447. this.tab3.table.getdataListParm.parammaps.fname = ''
  2448. this.getTab3List()
  2449. },
  2450. handleExport3() {
  2451. var excelDatasTab3 = [
  2452. {
  2453. tHeader: ['日期', 'TMR名称', '车次', '班次', '配方名称', '栏舍', '理论重量', '实际重量', '误差值', '准确率', '开始时间', '结束时间', '跳转方式', '开始重量', '结束重量'],
  2454. filterVal: ['日期', 'TMR名称', '车次', '班次', '配方名称', '栏舍', '理论重量', '实际重量', '误差值', '准确率', '开始时间', '结束时间', '跳转方式', '开始重量', '结束重量'],
  2455. tableDatas: this.tab3.table.list,
  2456. sheetName: '撒料统计'
  2457. }
  2458. ]
  2459. json2excel(excelDatasTab3, '撒料统计', true, 'xlsx')
  2460. }
  2461. }
  2462. }
  2463. </script>
  2464. <style lang="scss" scoped>
  2465. .search{margin-bottom:10px;}
  2466. </style>