6b10e1b28dc7735da307b80ce4822bb9fd42412e.svn-base 158 KB

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