aa141ce5ec9cfef5ad6ba86c8132334bbfaa2321.svn-base 156 KB

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