8bab74e554d1423e2dfd82beab9657e532027f2a.svn-base 121 KB

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