30685581addd79e4b451206c6e25860273586ed7.svn-base 150 KB

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