dce7d0d4e90f1fc6de26873d9a3ca904d61343b7.svn-base 142 KB

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