c99b282e55e70d59ffb978d324e812253abc247b.svn-base 157 KB

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