76adcd8b4936f3ab968d84b18a9c232db583a717.svn-base 167 KB

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