dccaedc6875251592944210249e4af58bf5f06f4.svn-base 159 KB

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