0c641f051e405c5b0bcec9b31681b7b16d813d0c.svn-base 149 KB

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