05d211006853cd59e4e900e2f23b181182bfa50b.svn-base 142 KB

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