e8dde2737ff31dd01d89b2920e30ae7ffe488f0e.svn-base 142 KB

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