d0fc25bf0d3edce1579b2308ce9059a67b95d52e.svn-base 124 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508
  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;" :picker-options="pickerOptions" />
  7. <span style="margin-left: 10px;">统计类型:</span>
  8. <el-radio v-model="tab.radio" label="1" @change="changeRadio">配方名称</el-radio>
  9. <el-radio v-model="tab.radio" label="2" @change="changeRadio">栏舍名称</el-radio>
  10. <el-radio v-model="tab.radio" label="3" @change="changeRadio">牲畜类别</el-radio>
  11. <el-radio v-model="tab.radio" label="4" @change="changeRadio">车次</el-radio>
  12. <el-checkbox v-model="tab.checked" style="margin-right: 10px;" @change="changeChecked">按日期统计</el-checkbox>
  13. <el-input v-if="tab.isFormulaName" v-model="tab.table.getdataListParm.parammaps.fname" class="filter-item" style="width: 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="结束日期" :picker-options="pickerOptions" />
  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="结束日期" :picker-options="pickerOptions" @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="开始日期" :picker-options="pickerOptions" 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="开始日期" :picker-options="pickerOptions" 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="开始日期" :picker-options="pickerOptions" 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="开始日期" :picker-options="pickerOptions" 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="开始日期" :picker-options="pickerOptions" 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="开始日期" :picker-options="pickerOptions" 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="结束日期" :picker-options="pickerOptions" />
  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="结束日期" :picker-options="pickerOptions" />
  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. pickerMinDate: '',
  484. pickerOptions: {
  485. onPick: ({ maxDate, minDate }) => {
  486. this.pickerMinDate = minDate.getTime()
  487. if (maxDate) {
  488. this.pickerMinDate = ''
  489. }
  490. },
  491. // 限制不能选择今天之后的日期
  492. disabledDate: (time) => {
  493. if (this.pickerMinDate !== '') {
  494. const one = 31 * 24 * 3600 * 1000
  495. const minTime = this.pickerMinDate - one
  496. let maxTime = this.pickerMinDate + one
  497. if (maxTime > new Date()) {
  498. maxTime = new Date()
  499. }
  500. return time.getTime() < minTime || time.getTime() > maxTime
  501. }
  502. return time.getTime() > Date.now()
  503. }
  504. },
  505. // 班次
  506. maxTime: {
  507. getMaxTimesParm: {
  508. name: 'getSysoptEnable',
  509. page: 1,
  510. offset: 1,
  511. pagecount: 1,
  512. returntype: 'Map',
  513. parammaps: {
  514. pastureid: Cookies.get('pastureid'),
  515. inforname: 'times'
  516. }
  517. }
  518. },
  519. activeName: 'first',
  520. tab: {
  521. radio: '1',
  522. isFormulaName: true, // 配方名称
  523. isHouseName: false, // 栏舍名称
  524. isLivestockType: false, // 牲畜类别
  525. isTrainNumber: false, // 车次
  526. checked: false, // 按日期统计
  527. table: {
  528. getdataListParm: {
  529. name: 'getAccuracyHFT',
  530. page: 1,
  531. offset: 1,
  532. pagecount: '',
  533. returntype: 'Map',
  534. parammaps: {
  535. pastureid: Cookies.get('pastureid'),
  536. startTime: parseTime(new Date(), '{y}-{m}-{d}'),
  537. stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
  538. inputDatetime: [new Date(), new Date()],
  539. fname: '',
  540. sort: '',
  541. times: ''
  542. }
  543. },
  544. tableKey: 1,
  545. list: [],
  546. total: 0,
  547. listLoading: true,
  548. temp: {}
  549. },
  550. table2: {
  551. getdataListParm: {
  552. name: 'getAccuracySFT',
  553. page: 1,
  554. offset: 1,
  555. pagecount: '',
  556. returntype: 'Map',
  557. parammaps: {
  558. pastureid: Cookies.get('pastureid'),
  559. startTime: parseTime(new Date(), '{y}-{m}-{d}'),
  560. stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
  561. inputDatetime: [new Date(), new Date()],
  562. fname: '',
  563. sort: '',
  564. times: ''
  565. }
  566. },
  567. tableKey: 2,
  568. list: [],
  569. total: 0,
  570. listLoading: true,
  571. temp: {}
  572. },
  573. chartDate: [],
  574. // 配方准确率
  575. chart1: {
  576. chartLine: null,
  577. chartLine_data: {},
  578. getdataListParm: {
  579. name: 'getAccuracyAllFT',
  580. page: 1,
  581. offset: 1,
  582. pagecount: '',
  583. returntype: 'Map',
  584. parammaps: {
  585. pastureid: Cookies.get('pastureid'),
  586. startTime: parseTime(new Date(), '{y}-{m}-{d}'),
  587. stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
  588. inputDatetime: [new Date(), new Date()]
  589. }
  590. },
  591. tableKey: 1,
  592. list: [],
  593. total: 0,
  594. listLoading: true,
  595. statisticsList: [],
  596. chart1Data3: [],
  597. isChart: true,
  598. isTable: false,
  599. table: {
  600. tableKey: 1,
  601. list: [],
  602. total: 0,
  603. listLoading: false
  604. }
  605. },
  606. // 计划统计
  607. chart2: {
  608. chartLine: null,
  609. chartLine_data: {},
  610. getdataListParm: {
  611. name: 'getAccuracyAllJH',
  612. page: 1,
  613. offset: 1,
  614. pagecount: '',
  615. returntype: 'Map',
  616. parammaps: {
  617. pastureid: Cookies.get('pastureid'),
  618. startTime: parseTime(new Date(), '{y}-{m}-{d}'),
  619. stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
  620. inputDatetime: [new Date(), new Date()]
  621. }
  622. },
  623. tableKey: 1,
  624. list: [],
  625. total: 0,
  626. listLoading: true,
  627. isChart: true,
  628. isTable: false,
  629. table: {
  630. tableKey: 1,
  631. list: [],
  632. total: 0,
  633. listLoading: false
  634. }
  635. },
  636. // 牛群准确率
  637. chart3: {
  638. chartLine: null,
  639. chartLine_data: {},
  640. getdataListParm: {
  641. name: 'getAccuracyAllNQ',
  642. page: 1,
  643. offset: 1,
  644. pagecount: '',
  645. returntype: 'Map',
  646. parammaps: {
  647. pastureid: Cookies.get('pastureid'),
  648. startTime: parseTime(new Date(), '{y}-{m}-{d}'),
  649. stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
  650. inputDatetime: [new Date(), new Date()]
  651. }
  652. },
  653. tableKey: 1,
  654. list: [],
  655. total: 0,
  656. listLoading: true,
  657. statisticsList: [],
  658. chart1Data3: [],
  659. isChart: true,
  660. isTable: false,
  661. table: {
  662. tableKey: 1,
  663. list: [],
  664. total: 0,
  665. listLoading: false
  666. }
  667. },
  668. // 车辆准确率(重量)
  669. chart4: {
  670. chartLine: null,
  671. chartLine_data: {},
  672. getdataListParm: {
  673. name: 'getAccuracyAllCC',
  674. page: 1,
  675. offset: 1,
  676. pagecount: '',
  677. returntype: 'Map',
  678. parammaps: {
  679. pastureid: Cookies.get('pastureid'),
  680. startTime: parseTime(new Date(), '{y}-{m}-{d}'),
  681. stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
  682. inputDatetime: [new Date(), new Date()]
  683. }
  684. },
  685. tableKey: 1,
  686. list: [],
  687. total: 0,
  688. listLoading: true,
  689. statisticsList: [],
  690. chart4Data3: [],
  691. isChart: true,
  692. isTable: false,
  693. table: {
  694. tableKey: 1,
  695. list: [],
  696. total: 0,
  697. listLoading: false
  698. }
  699. },
  700. // 混料统计
  701. chart5: {
  702. chartLine: null,
  703. chartLine_data: {},
  704. getdataListParm: {
  705. name: 'getAccuracyAllHL',
  706. page: 1,
  707. offset: 1,
  708. pagecount: '',
  709. returntype: 'Map',
  710. parammaps: {
  711. pastureid: Cookies.get('pastureid'),
  712. startTime: parseTime(new Date(), '{y}-{m}-{d}'),
  713. stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
  714. inputDatetime: [new Date(), new Date()]
  715. }
  716. },
  717. tableKey: 1,
  718. list: [],
  719. total: 0,
  720. listLoading: true,
  721. isChart: true,
  722. isTable: false,
  723. table: {
  724. tableKey: 1,
  725. list: [],
  726. total: 0,
  727. listLoading: false
  728. }
  729. },
  730. // 混料计划取消次数
  731. chart6: {
  732. chartLine: null,
  733. chartLine_data: {},
  734. getdataListParm: {
  735. name: 'getAccuracyAllQX',
  736. page: 1,
  737. offset: 1,
  738. pagecount: '',
  739. returntype: 'Map',
  740. parammaps: {
  741. pastureid: Cookies.get('pastureid'),
  742. startTime: parseTime(new Date(), '{y}-{m}-{d}'),
  743. stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
  744. inputDatetime: [new Date(), new Date()]
  745. }
  746. },
  747. tableKey: 1,
  748. list: [],
  749. total: 0,
  750. listLoading: true,
  751. isChart: true,
  752. isTable: false,
  753. table: {
  754. tableKey: 1,
  755. list: [],
  756. total: 0,
  757. listLoading: false
  758. }
  759. },
  760. // 栏舍撒料时间统计
  761. chart7: {
  762. chartLine: null,
  763. chartLine_data: {},
  764. getdataListParm: {
  765. name: 'getAccuracyAllLS',
  766. page: 1,
  767. offset: 1,
  768. pagecount: '',
  769. returntype: 'Map',
  770. parammaps: {
  771. pastureid: Cookies.get('pastureid'),
  772. startTime: parseTime(new Date(), '{y}-{m}-{d}'),
  773. stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
  774. inputDatetime: [new Date(), new Date()]
  775. }
  776. },
  777. tableKey: 1,
  778. list: [],
  779. total: 0,
  780. listLoading: true,
  781. statisticsList: [],
  782. chart7Data3: [],
  783. isChart: true,
  784. isTable: false,
  785. table: {
  786. tableKey: 1,
  787. list: [],
  788. total: 0,
  789. listLoading: false
  790. }
  791. }
  792. },
  793. tab2: {
  794. table: {
  795. getdataListParm: {
  796. name: 'getStatisticsHL',
  797. page: 1,
  798. offset: 1,
  799. pagecount: '',
  800. returntype: 'Map',
  801. parammaps: {
  802. pastureid: Cookies.get('pastureid'),
  803. startTime: parseTime(new Date(), '{y}-{m}-{d}'),
  804. stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
  805. inputDatetime: [new Date(), new Date()],
  806. tmrtname: '',
  807. projname: '',
  808. times: '',
  809. buttontype: '',
  810. templetname: ''
  811. }
  812. },
  813. tableKey: 1,
  814. list: [],
  815. total: 0,
  816. listLoading: true,
  817. temp: {}
  818. },
  819. frequencyList: [],
  820. jumpModeList: [{ id: '0', name: '手动跳转' }, { id: '1', name: '自动跳转' }]
  821. },
  822. tab3: {
  823. table: {
  824. getdataListParm: {
  825. name: 'getStatisticsSL',
  826. page: 1,
  827. offset: 1,
  828. pagecount: '',
  829. returntype: 'Map',
  830. parammaps: {
  831. pastureid: Cookies.get('pastureid'),
  832. startTime: parseTime(new Date(), '{y}-{m}-{d}'),
  833. stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
  834. inputDatetime: [new Date(), new Date()],
  835. tmrtname: '',
  836. projname: '',
  837. times: '',
  838. templetname: '',
  839. fname: '',
  840. buttontype: ''
  841. }
  842. },
  843. tableKey: 1,
  844. list: [],
  845. total: 0,
  846. listLoading: true,
  847. temp: {}
  848. },
  849. frequencyList: [],
  850. jumpModeList: [{ id: '0', name: '手动跳转' }, { id: '1', name: '自动跳转' }]
  851. },
  852. rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
  853. cellStyle: { padding: 0 + 'px' }
  854. }
  855. },
  856. created() {
  857. this.getTimeFn()
  858. this.getIsDisplay()
  859. this.getTabList()
  860. this.getTabList2()
  861. this.getChart1()
  862. this.getChart2()
  863. this.getChart3()
  864. this.getChart4()
  865. this.getChart5()
  866. this.getChart6()
  867. this.getChart7()
  868. },
  869. mounted() {
  870. },
  871. methods: {
  872. getTimeFn() {
  873. const that = this
  874. const start = new Date()
  875. const end = new Date()
  876. const start2 = new Date()
  877. const end2 = new Date()
  878. start2.setTime(start2.getTime() - 3600 * 1000 * 24 * 1)
  879. end2.setTime(end2.getTime() - 3600 * 1000 * 24 * 1)
  880. that.tab.table.getdataListParm.parammaps.inputDatetime[0] = parseTime(start2, '{y}-{m}-{d}')
  881. that.tab.table.getdataListParm.parammaps.inputDatetime[1] = parseTime(end2, '{y}-{m}-{d}')
  882. that.tab.table.getdataListParm.parammaps.startTime = parseTime(start2, '{y}-{m}-{d}')
  883. that.tab.table.getdataListParm.parammaps.stopTime = parseTime(end2, '{y}-{m}-{d}')
  884. that.tab2.table.getdataListParm.parammaps.inputDatetime[0] = parseTime(start2, '{y}-{m}-{d}')
  885. that.tab2.table.getdataListParm.parammaps.inputDatetime[1] = parseTime(end2, '{y}-{m}-{d}')
  886. that.tab2.table.getdataListParm.parammaps.startTime = parseTime(start2, '{y}-{m}-{d}')
  887. that.tab2.table.getdataListParm.parammaps.stopTime = parseTime(end2, '{y}-{m}-{d}')
  888. that.tab3.table.getdataListParm.parammaps.inputDatetime[0] = parseTime(start2, '{y}-{m}-{d}')
  889. that.tab3.table.getdataListParm.parammaps.inputDatetime[1] = parseTime(end2, '{y}-{m}-{d}')
  890. that.tab3.table.getdataListParm.parammaps.startTime = parseTime(start2, '{y}-{m}-{d}')
  891. that.tab3.table.getdataListParm.parammaps.stopTime = parseTime(end2, '{y}-{m}-{d}')
  892. start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
  893. that.tab.chartDate[0] = parseTime(start, '{y}-{m}-{d}')
  894. that.tab.chartDate[1] = parseTime(end, '{y}-{m}-{d}')
  895. that.tab.chart1.getdataListParm.parammaps.inputDatetime[0] = parseTime(start, '{y}-{m}-{d}')
  896. that.tab.chart1.getdataListParm.parammaps.inputDatetime[1] = parseTime(end, '{y}-{m}-{d}')
  897. that.tab.chart1.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
  898. that.tab.chart1.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')
  899. that.tab.chart2.getdataListParm.parammaps.inputDatetime[0] = parseTime(start, '{y}-{m}-{d}')
  900. that.tab.chart2.getdataListParm.parammaps.inputDatetime[1] = parseTime(end, '{y}-{m}-{d}')
  901. that.tab.chart2.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
  902. that.tab.chart2.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')
  903. that.tab.chart3.getdataListParm.parammaps.inputDatetime[0] = parseTime(start, '{y}-{m}-{d}')
  904. that.tab.chart3.getdataListParm.parammaps.inputDatetime[1] = parseTime(end, '{y}-{m}-{d}')
  905. that.tab.chart3.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
  906. that.tab.chart3.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')
  907. that.tab.chart4.getdataListParm.parammaps.inputDatetime[0] = parseTime(start, '{y}-{m}-{d}')
  908. that.tab.chart4.getdataListParm.parammaps.inputDatetime[1] = parseTime(end, '{y}-{m}-{d}')
  909. that.tab.chart4.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
  910. that.tab.chart4.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')
  911. that.tab.chart5.getdataListParm.parammaps.inputDatetime[0] = parseTime(start, '{y}-{m}-{d}')
  912. that.tab.chart5.getdataListParm.parammaps.inputDatetime[1] = parseTime(end, '{y}-{m}-{d}')
  913. that.tab.chart5.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
  914. that.tab.chart5.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')
  915. that.tab.chart6.getdataListParm.parammaps.inputDatetime[0] = parseTime(start, '{y}-{m}-{d}')
  916. that.tab.chart6.getdataListParm.parammaps.inputDatetime[1] = parseTime(end, '{y}-{m}-{d}')
  917. that.tab.chart6.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
  918. that.tab.chart6.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')
  919. that.tab.chart7.getdataListParm.parammaps.inputDatetime[0] = parseTime(start, '{y}-{m}-{d}')
  920. that.tab.chart7.getdataListParm.parammaps.inputDatetime[1] = parseTime(end, '{y}-{m}-{d}')
  921. that.tab.chart7.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
  922. that.tab.chart7.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')
  923. },
  924. getIsDisplay() {
  925. GetDataByName(this.maxTime.getMaxTimesParm).then(response => {
  926. if (response.data.list[0].inforvalue == 1) {
  927. this.tab2.frequencyList = [{ id: '1', name: '第一班' }]
  928. this.tab3.frequencyList = [{ id: '1', name: '第一班' }]
  929. } else if (response.data.list[0].inforvalue == 2) {
  930. this.tab2.frequencyList = [{ id: '1', name: '第一班' }, { id: '2', name: '第二班' }]
  931. this.tab3.frequencyList = [{ id: '1', name: '第一班' }, { id: '2', name: '第二班' }]
  932. } else if (response.data.list[0].inforvalue == 3) {
  933. this.tab2.frequencyList = [{ id: '1', name: '第一班' }, { id: '2', name: '第二班' }, { id: '3', name: '第三班' }]
  934. this.tab3.frequencyList = [{ id: '1', name: '第一班' }, { id: '2', name: '第二班' }, { id: '3', name: '第三班' }]
  935. this.frequencyList = [{ id: '1', name: '第一班' }, { id: '2', name: '第二班' }, { id: '3', name: '第三班' }]
  936. } else if (response.data.list[0].inforvalue == 4) {
  937. this.tab2.frequencyList = [{ id: '1', name: '第一班' }, { id: '2', name: '第二班' }, { id: '3', name: '第三班' }, { id: '4', name: '第四班' }]
  938. this.tab3.frequencyList = [{ id: '1', name: '第一班' }, { id: '2', name: '第二班' }, { id: '3', name: '第三班' }, { id: '4', name: '第四班' }]
  939. }
  940. })
  941. },
  942. // 导出
  943. handleDownload() {
  944. if (this.tab.radio == '1') {
  945. var excelDatas = [
  946. {
  947. tHeader: ['配方名称', '理论重量', '实际重量', '计划混料操作数', '已混料操作数', '混料操作率', '混料误差值', '混料准确率', '混料自动跳转次数', '混料手动跳转次数', '取消次数', '方差'],
  948. filterVal: ['配方名称', '理论重量', '实际重量', '计划混料操作数', '已混料操作数', '混料操作率', '混料误差值', '混料准确率', '混料自动跳转次数', '混料手动跳转次数', '取消次数', '方差'],
  949. tableDatas: this.tab.table.list,
  950. sheetName: '混料'
  951. },
  952. {
  953. tHeader: ['配方名称', '理论重量', '实际重量', '计划撒料操作数', '已撒料操作数', '撒料操作率', '撒料误差值', '撒料准确率', '撒料自动跳转次数', '撒料手动跳转次数'],
  954. filterVal: ['配方名称', '理论重量', '实际重量', '计划撒料操作数', '已撒料操作数', '撒料操作率', '撒料误差值', '撒料准确率', '撒料自动跳转次数', '撒料手动跳转次数'],
  955. tableDatas: this.tab.table2.list,
  956. sheetName: '撒料'
  957. }
  958. ]
  959. json2excel(excelDatas, '汇总统计-配方名称', true, 'xlsx')
  960. } else if (this.tab.radio == '2') {
  961. var excelDatas2 = [
  962. {
  963. tHeader: ['栏舍名称', '理论重量', '实际重量', '计划混料操作数', '已混料操作数', '混料操作率', '混料误差值', '混料准确率', '混料自动跳转次数', '混料手动跳转次数', '取消次数', '方差'],
  964. filterVal: ['栏舍名称', '理论重量', '实际重量', '计划混料操作数', '已混料操作数', '混料操作率', '混料误差值', '混料准确率', '混料自动跳转次数', '混料手动跳转次数', '取消次数', '方差'],
  965. tableDatas: this.tab.table.list,
  966. sheetName: '混料'
  967. },
  968. {
  969. tHeader: ['栏舍名称', '理论重量', '实际重量', '计划撒料操作数', '已撒料操作数', '撒料操作率', '撒料误差值', '撒料准确率', '撒料自动跳转次数', '撒料手动跳转次数'],
  970. filterVal: ['栏舍名称', '理论重量', '实际重量', '计划撒料操作数', '已撒料操作数', '撒料操作率', '撒料误差值', '撒料准确率', '撒料自动跳转次数', '撒料手动跳转次数'],
  971. tableDatas: this.tab.table2.list,
  972. sheetName: '撒料'
  973. }
  974. ]
  975. json2excel(excelDatas2, '汇总统计-栏舍名称', true, 'xlsx')
  976. } else if (this.tab.radio == '3') {
  977. var excelDatas3 = [
  978. {
  979. tHeader: ['牲畜类别', '理论重量', '实际重量', '计划混料操作数', '已混料操作数', '混料操作率', '混料误差值', '混料准确率', '混料自动跳转次数', '混料手动跳转次数', '取消次数', '方差'],
  980. filterVal: ['牲畜类别', '理论重量', '实际重量', '计划混料操作数', '已混料操作数', '混料操作率', '混料误差值', '混料准确率', '混料自动跳转次数', '混料手动跳转次数', '取消次数', '方差'],
  981. tableDatas: this.tab.table.list,
  982. sheetName: '混料'
  983. },
  984. {
  985. tHeader: ['牲畜类别', '理论重量', '实际重量', '计划撒料操作数', '已撒料操作数', '撒料操作率', '撒料误差值', '撒料准确率', '撒料自动跳转次数', '撒料手动跳转次数'],
  986. filterVal: ['牲畜类别', '理论重量', '实际重量', '计划撒料操作数', '已撒料操作数', '撒料操作率', '撒料误差值', '撒料准确率', '撒料自动跳转次数', '撒料手动跳转次数'],
  987. tableDatas: this.tab.table2.list,
  988. sheetName: '撒料'
  989. }
  990. ]
  991. json2excel(excelDatas3, '汇总统计-牲畜类别', true, 'xlsx')
  992. } else if (this.tab.radio == '4') {
  993. var excelDatas4 = [
  994. {
  995. tHeader: ['车次', '班次', 'TMR名称', '驾驶员', '理论重量', '实际重量', '计划混料操作数', '已混料操作数', '混料操作率', '混料误差值', '混料准确率', '混料自动跳转次数', '混料手动跳转次数', '取消次数', '方差'],
  996. filterVal: ['车次', '班次', 'TMR名称', '驾驶员', '理论重量', '实际重量', '计划混料操作数', '已混料操作数', '混料操作率', '混料误差值', '混料准确率', '混料自动跳转次数', '混料手动跳转次数', '取消次数', '方差'],
  997. tableDatas: this.tab.table.list,
  998. sheetName: '混料'
  999. },
  1000. {
  1001. tHeader: ['车次', '理论重量', '实际重量', '计划撒料操作数', '已撒料操作数', '撒料操作率', '撒料误差值', '撒料准确率', '撒料自动跳转次数', '撒料手动跳转次数'],
  1002. filterVal: ['车次', '理论重量', '实际重量', '计划撒料操作数', '已撒料操作数', '撒料操作率', '撒料误差值', '撒料准确率', '撒料自动跳转次数', '撒料手动跳转次数'],
  1003. tableDatas: this.tab.table2.list,
  1004. sheetName: '撒料'
  1005. }
  1006. ]
  1007. json2excel(excelDatas4, '汇总统计-车次', true, 'xlsx')
  1008. }
  1009. },
  1010. // 切换Tab
  1011. handleTabClick() {
  1012. if (this.activeName == 'first') {
  1013. const start2 = new Date()
  1014. const end2 = new Date()
  1015. start2.setTime(start2.getTime() - 3600 * 1000 * 24 * 1)
  1016. end2.setTime(end2.getTime() - 3600 * 1000 * 24 * 1)
  1017. this.tab.table.getdataListParm.parammaps.inputDatetime[0] = parseTime(start2, '{y}-{m}-{d}')
  1018. this.tab.table.getdataListParm.parammaps.inputDatetime[1] = parseTime(end2, '{y}-{m}-{d}')
  1019. this.tab.table.getdataListParm.parammaps.startTime = parseTime(start2, '{y}-{m}-{d}')
  1020. this.tab.table.getdataListParm.parammaps.stopTime = parseTime(end2, '{y}-{m}-{d}')
  1021. this.tab.table.getdataListParm.parammaps.fname = ''
  1022. this.tab.table.getdataListParm.parammaps.sort = ''
  1023. this.tab.table.getdataListParm.parammaps.times = ''
  1024. this.tab.table2.getdataListParm.parammaps.inputDatetime = [new Date(), new Date()]
  1025. this.tab.table2.getdataListParm.parammaps.startTime = parseTime(new Date(), '{y}-{m}-{d}')
  1026. this.tab.table2.getdataListParm.parammaps.stopTime = parseTime(new Date(), '{y}-{m}-{d}'),
  1027. this.tab.table2.getdataListParm.parammaps.fname = ''
  1028. this.tab.table2.getdataListParm.parammaps.sort = ''
  1029. this.tab.table2.getdataListParm.parammaps.times = ''
  1030. this.getTabList()
  1031. this.getTabList2()
  1032. this.getChart1()
  1033. this.getChart2()
  1034. this.getChart3()
  1035. this.getChart4()
  1036. this.getChart5()
  1037. this.getChart6()
  1038. this.getChart7()
  1039. } else if (this.activeName == 'second') {
  1040. const start2 = new Date()
  1041. const end2 = new Date()
  1042. start2.setTime(start2.getTime() - 3600 * 1000 * 24 * 1)
  1043. end2.setTime(end2.getTime() - 3600 * 1000 * 24 * 1)
  1044. this.tab2.table.getdataListParm.parammaps.inputDatetime[0] = parseTime(start2, '{y}-{m}-{d}')
  1045. this.tab2.table.getdataListParm.parammaps.inputDatetime[1] = parseTime(end2, '{y}-{m}-{d}')
  1046. this.tab2.table.getdataListParm.parammaps.startTime = parseTime(start2, '{y}-{m}-{d}')
  1047. this.tab2.table.getdataListParm.parammaps.stopTime = parseTime(end2, '{y}-{m}-{d}')
  1048. this.tab2.table.getdataListParm.parammaps.tmrtname = ''
  1049. this.tab2.table.getdataListParm.parammaps.projname = ''
  1050. this.tab2.table.getdataListParm.parammaps.times = ''
  1051. this.tab2.table.getdataListParm.parammaps.buttontype = ''
  1052. this.tab2.table.getdataListParm.parammaps.templetname = ''
  1053. this.getTab2List()
  1054. } else if (this.activeName == 'third') {
  1055. const start2 = new Date()
  1056. const end2 = new Date()
  1057. start2.setTime(start2.getTime() - 3600 * 1000 * 24 * 1)
  1058. end2.setTime(end2.getTime() - 3600 * 1000 * 24 * 1)
  1059. this.tab3.table.getdataListParm.parammaps.inputDatetime[0] = parseTime(start2, '{y}-{m}-{d}')
  1060. this.tab3.table.getdataListParm.parammaps.inputDatetime[1] = parseTime(end2, '{y}-{m}-{d}')
  1061. this.tab3.table.getdataListParm.parammaps.startTime = parseTime(start2, '{y}-{m}-{d}')
  1062. this.tab3.table.getdataListParm.parammaps.stopTime = parseTime(end2, '{y}-{m}-{d}')
  1063. this.tab3.table.getdataListParm.parammaps.tmrtname = ''
  1064. this.tab3.table.getdataListParm.parammaps.projname = ''
  1065. this.tab3.table.getdataListParm.parammaps.times = ''
  1066. this.tab3.table.getdataListParm.parammaps.templetname = ''
  1067. this.tab3.table.getdataListParm.parammaps.buttontype = ''
  1068. this.getTab3List()
  1069. }
  1070. },
  1071. // 切换统计类型
  1072. changeRadio() {
  1073. console.log(this.tab.radio)
  1074. this.tab.table.getdataListParm.parammaps.sort = ''
  1075. this.tab.table.getdataListParm.parammaps.times = ''
  1076. this.tab.table.getdataListParm.parammaps.fname = ''
  1077. if (this.tab.radio == '1') {
  1078. console.log('配方名称')
  1079. this.tab.isFormulaName = true
  1080. this.tab.isHouseName = false
  1081. this.tab.isLivestockType = false
  1082. this.tab.isTrainNumber = false
  1083. this.tab.table.getdataListParm.name = 'getAccuracyHFT'
  1084. if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
  1085. this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  1086. this.tab.table.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  1087. } else {
  1088. this.tab.table.getdataListParm.parammaps.inputDatetime = ''
  1089. this.tab.table.getdataListParm.parammaps.startTime = ''
  1090. this.tab.table.getdataListParm.parammaps.stopTime = ''
  1091. }
  1092. this.tab.table.getdataListParm.offset = 1
  1093. this.getTabList()
  1094. this.tab.table2.getdataListParm.name = 'getAccuracySFT'
  1095. this.tab.table2.getdataListParm.parammaps.startTime = this.tab.table.getdataListParm.parammaps.startTime
  1096. this.tab.table2.getdataListParm.parammaps.stopTime = this.tab.table.getdataListParm.parammaps.stopTime
  1097. this.getTabList2()
  1098. } else if (this.tab.radio == '2') {
  1099. console.log('栏舍名称')
  1100. this.tab.isFormulaName = false
  1101. this.tab.isHouseName = true
  1102. this.tab.isLivestockType = false
  1103. this.tab.isTrainNumber = false
  1104. this.tab.table.getdataListParm.name = 'getAccuracyHNS'
  1105. if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
  1106. this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  1107. this.tab.table.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  1108. } else {
  1109. this.tab.table.getdataListParm.parammaps.inputDatetime = ''
  1110. this.tab.table.getdataListParm.parammaps.startTime = ''
  1111. this.tab.table.getdataListParm.parammaps.stopTime = ''
  1112. }
  1113. this.tab.table.getdataListParm.offset = 1
  1114. this.getTabList()
  1115. this.tab.table2.getdataListParm.name = 'getAccuracySNS'
  1116. this.tab.table2.getdataListParm.parammaps.startTime = this.tab.table.getdataListParm.parammaps.startTime
  1117. this.tab.table2.getdataListParm.parammaps.stopTime = this.tab.table.getdataListParm.parammaps.stopTime
  1118. this.getTabList2()
  1119. } else if (this.tab.radio == '3') {
  1120. console.log(' 牲畜类别')
  1121. this.tab.isFormulaName = false
  1122. this.tab.isHouseName = false
  1123. this.tab.isLivestockType = true
  1124. this.tab.isTrainNumber = false
  1125. this.tab.table.getdataListParm.name = 'getAccuracyHSC'
  1126. if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
  1127. this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  1128. this.tab.table.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  1129. } else {
  1130. this.tab.table.getdataListParm.parammaps.inputDatetime = ''
  1131. this.tab.table.getdataListParm.parammaps.startTime = ''
  1132. this.tab.table.getdataListParm.parammaps.stopTime = ''
  1133. }
  1134. this.tab.table.getdataListParm.offset = 1
  1135. this.getTabList()
  1136. this.tab.table2.getdataListParm.name = 'getAccuracySSC'
  1137. this.tab.table2.getdataListParm.parammaps.startTime = this.tab.table.getdataListParm.parammaps.startTime
  1138. this.tab.table2.getdataListParm.parammaps.stopTime = this.tab.table.getdataListParm.parammaps.stopTime
  1139. this.tab.table2.getdataListParm.offset = 1
  1140. this.getTabList2()
  1141. } else if (this.tab.radio == '4') {
  1142. console.log('车次')
  1143. this.tab.isFormulaName = false
  1144. this.tab.isHouseName = false
  1145. this.tab.isLivestockType = false
  1146. this.tab.isTrainNumber = true
  1147. this.tab.table.getdataListParm.name = 'getAccuracyHCC'
  1148. if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
  1149. this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  1150. this.tab.table.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  1151. } else {
  1152. this.tab.table.getdataListParm.parammaps.inputDatetime = ''
  1153. this.tab.table.getdataListParm.parammaps.startTime = ''
  1154. this.tab.table.getdataListParm.parammaps.stopTime = ''
  1155. }
  1156. this.tab.table.getdataListParm.offset = 1
  1157. this.getTabList()
  1158. this.tab.table2.getdataListParm.name = 'getAccuracySCC'
  1159. this.tab.table2.getdataListParm.parammaps.startTime = this.tab.table.getdataListParm.parammaps.startTime
  1160. this.tab.table2.getdataListParm.parammaps.stopTime = this.tab.table.getdataListParm.parammaps.stopTime
  1161. this.tab.table2.getdataListParm.offset = 1
  1162. this.getTabList2()
  1163. }
  1164. },
  1165. // 按日期统计
  1166. changeChecked() {
  1167. // console.log(this.tab.checked)
  1168. if (this.tab.radio == '1') {
  1169. console.log('配方名称')
  1170. this.tab.isFormulaName = true
  1171. this.tab.isHouseName = false
  1172. this.tab.isLivestockType = false
  1173. this.tab.isTrainNumber = false
  1174. this.tab.table.getdataListParm.name = 'getAccuracyHFT'
  1175. if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
  1176. this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  1177. this.tab.table.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  1178. } else {
  1179. this.tab.table.getdataListParm.parammaps.inputDatetime = ''
  1180. this.tab.table.getdataListParm.parammaps.startTime = ''
  1181. this.tab.table.getdataListParm.parammaps.stopTime = ''
  1182. }
  1183. this.tab.table.getdataListParm.offset = 1
  1184. this.getTabList()
  1185. this.tab.table2.getdataListParm.name = 'getAccuracySFT'
  1186. this.tab.table2.getdataListParm.parammaps.startTime = this.tab.table.getdataListParm.parammaps.startTime
  1187. this.tab.table2.getdataListParm.parammaps.stopTime = this.tab.table.getdataListParm.parammaps.stopTime
  1188. this.getTabList2()
  1189. } else if (this.tab.radio == '2') {
  1190. console.log('栏舍名称')
  1191. this.tab.isFormulaName = false
  1192. this.tab.isHouseName = true
  1193. this.tab.isLivestockType = false
  1194. this.tab.isTrainNumber = false
  1195. this.tab.table.getdataListParm.name = 'getAccuracyHNS'
  1196. if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
  1197. this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  1198. this.tab.table.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  1199. } else {
  1200. this.tab.table.getdataListParm.parammaps.inputDatetime = ''
  1201. this.tab.table.getdataListParm.parammaps.startTime = ''
  1202. this.tab.table.getdataListParm.parammaps.stopTime = ''
  1203. }
  1204. this.tab.table.getdataListParm.offset = 1
  1205. this.getTabList()
  1206. this.tab.table2.getdataListParm.name = 'getAccuracySNS'
  1207. this.tab.table2.getdataListParm.parammaps.startTime = this.tab.table.getdataListParm.parammaps.startTime
  1208. this.tab.table2.getdataListParm.parammaps.stopTime = this.tab.table.getdataListParm.parammaps.stopTime
  1209. this.getTabList2()
  1210. } else if (this.tab.radio == '3') {
  1211. console.log(' 牲畜类别')
  1212. this.tab.isFormulaName = false
  1213. this.tab.isHouseName = false
  1214. this.tab.isLivestockType = true
  1215. this.tab.isTrainNumber = false
  1216. this.tab.table.getdataListParm.name = 'getAccuracyHSC'
  1217. if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
  1218. this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  1219. this.tab.table.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  1220. } else {
  1221. this.tab.table.getdataListParm.parammaps.inputDatetime = ''
  1222. this.tab.table.getdataListParm.parammaps.startTime = ''
  1223. this.tab.table.getdataListParm.parammaps.stopTime = ''
  1224. }
  1225. this.tab.table.getdataListParm.offset = 1
  1226. this.getTabList()
  1227. this.tab.table2.getdataListParm.name = 'getAccuracySSC'
  1228. this.tab.table2.getdataListParm.parammaps.startTime = this.tab.table.getdataListParm.parammaps.startTime
  1229. this.tab.table2.getdataListParm.parammaps.stopTime = this.tab.table.getdataListParm.parammaps.stopTime
  1230. this.tab.table2.getdataListParm.offset = 1
  1231. this.getTabList2()
  1232. } else if (this.tab.radio == '4') {
  1233. console.log('车次')
  1234. this.tab.isFormulaName = false
  1235. this.tab.isHouseName = false
  1236. this.tab.isLivestockType = false
  1237. this.tab.isTrainNumber = true
  1238. this.tab.table.getdataListParm.name = 'getAccuracyHCC'
  1239. if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
  1240. this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  1241. this.tab.table.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  1242. } else {
  1243. this.tab.table.getdataListParm.parammaps.inputDatetime = ''
  1244. this.tab.table.getdataListParm.parammaps.startTime = ''
  1245. this.tab.table.getdataListParm.parammaps.stopTime = ''
  1246. }
  1247. this.tab.table.getdataListParm.offset = 1
  1248. this.getTabList()
  1249. this.tab.table2.getdataListParm.name = 'getAccuracySCC'
  1250. this.tab.table2.getdataListParm.parammaps.startTime = this.tab.table.getdataListParm.parammaps.startTime
  1251. this.tab.table2.getdataListParm.parammaps.stopTime = this.tab.table.getdataListParm.parammaps.stopTime
  1252. this.tab.table2.getdataListParm.offset = 1
  1253. this.getTabList2()
  1254. }
  1255. },
  1256. // 汇总统计/混料
  1257. getTabList() {
  1258. this.tab.table.listLoading = true
  1259. GetDataByName(this.tab.table.getdataListParm).then(response => {
  1260. console.log('汇总统计/混料table数据', response.data.list)
  1261. if (response.data.list !== null) {
  1262. this.tab.table.list = response.data.list
  1263. // this.tab.table.total = response.data.total
  1264. } else {
  1265. this.tab.table.list = []
  1266. }
  1267. setTimeout(() => {
  1268. this.tab.table.listLoading = false
  1269. }, 100)
  1270. })
  1271. },
  1272. // 汇总统计/撒料
  1273. getTabList2() {
  1274. this.tab.table2.listLoading = true
  1275. GetDataByName(this.tab.table2.getdataListParm).then(response => {
  1276. console.log('汇总统计/撒料table数据', response.data.list)
  1277. if (response.data.list !== null) {
  1278. this.tab.table2.list = response.data.list
  1279. // this.tab.table2.total = response.data.total
  1280. } else {
  1281. this.tab.table2.list = []
  1282. }
  1283. setTimeout(() => {
  1284. this.tab.table2.listLoading = false
  1285. }, 100)
  1286. })
  1287. },
  1288. // 查询
  1289. handleSearch() {
  1290. if (this.tab.radio == '1') {
  1291. console.log('配方名称/查询')
  1292. this.tab.isFormulaName = true
  1293. this.tab.isHouseName = false
  1294. this.tab.isLivestockType = false
  1295. this.tab.isTrainNumber = false
  1296. this.tab.table.getdataListParm.name = 'getAccuracyHFT'
  1297. if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
  1298. this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  1299. this.tab.table.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  1300. } else {
  1301. this.tab.table.getdataListParm.parammaps.inputDatetime = ''
  1302. this.tab.table.getdataListParm.parammaps.startTime = ''
  1303. this.tab.table.getdataListParm.parammaps.stopTime = ''
  1304. }
  1305. this.tab.table.getdataListParm.offset = 1
  1306. this.getTabList()
  1307. this.tab.table2.getdataListParm.name = 'getAccuracySFT'
  1308. this.tab.table2.getdataListParm.parammaps.startTime = this.tab.table.getdataListParm.parammaps.startTime
  1309. this.tab.table2.getdataListParm.parammaps.stopTime = this.tab.table.getdataListParm.parammaps.stopTime
  1310. this.tab.table2.getdataListParm.offset = 1
  1311. this.getTabList2()
  1312. } else if (this.tab.radio == '2') {
  1313. console.log('栏舍名称/查询')
  1314. this.tab.isFormulaName = false
  1315. this.tab.isHouseName = true
  1316. this.tab.isLivestockType = false
  1317. this.tab.isTrainNumber = false
  1318. this.tab.table.getdataListParm.name = 'getAccuracyHNS'
  1319. if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
  1320. this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  1321. this.tab.table.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  1322. } else {
  1323. this.tab.table.getdataListParm.parammaps.inputDatetime = ''
  1324. this.tab.table.getdataListParm.parammaps.startTime = ''
  1325. this.tab.table.getdataListParm.parammaps.stopTime = ''
  1326. }
  1327. this.tab.table.getdataListParm.offset = 1
  1328. this.getTabList()
  1329. this.tab.table2.getdataListParm.name = 'getAccuracySNS'
  1330. this.tab.table2.getdataListParm.parammaps.startTime = this.tab.table.getdataListParm.parammaps.startTime
  1331. this.tab.table2.getdataListParm.parammaps.stopTime = this.tab.table.getdataListParm.parammaps.stopTime
  1332. this.tab.table2.getdataListParm.offset = 1
  1333. this.getTabList2()
  1334. } else if (this.tab.radio == '3') {
  1335. console.log(' 牲畜类别/查询')
  1336. this.tab.isFormulaName = false
  1337. this.tab.isHouseName = false
  1338. this.tab.isLivestockType = true
  1339. this.tab.isTrainNumber = false
  1340. this.tab.table.getdataListParm.name = 'getAccuracyHSC'
  1341. if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
  1342. this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  1343. this.tab.table.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  1344. } else {
  1345. this.tab.table.getdataListParm.parammaps.inputDatetime = ''
  1346. this.tab.table.getdataListParm.parammaps.startTime = ''
  1347. this.tab.table.getdataListParm.parammaps.stopTime = ''
  1348. }
  1349. this.tab.table.getdataListParm.offset = 1
  1350. this.getTabList()
  1351. this.tab.table2.getdataListParm.name = 'getAccuracySSC'
  1352. this.tab.table2.getdataListParm.parammaps.startTime = this.tab.table.getdataListParm.parammaps.startTime
  1353. this.tab.table2.getdataListParm.parammaps.stopTime = this.tab.table.getdataListParm.parammaps.stopTime
  1354. this.tab.table2.getdataListParm.offset = 1
  1355. this.getTabList2()
  1356. } else if (this.tab.radio == '4') {
  1357. console.log('车次/查询')
  1358. this.tab.isFormulaName = false
  1359. this.tab.isHouseName = false
  1360. this.tab.isLivestockType = false
  1361. this.tab.isTrainNumber = true
  1362. this.tab.table.getdataListParm.name = 'getAccuracyHCC'
  1363. if (this.tab.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab.table.getdataListParm.parammaps.inputDatetime !== null) {
  1364. this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  1365. this.tab.table.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  1366. } else {
  1367. this.tab.table.getdataListParm.parammaps.inputDatetime = ''
  1368. this.tab.table.getdataListParm.parammaps.startTime = ''
  1369. this.tab.table.getdataListParm.parammaps.stopTime = ''
  1370. }
  1371. this.tab.table.getdataListParm.offset = 1
  1372. this.getTabList()
  1373. this.tab.table2.getdataListParm.name = 'getAccuracySCC'
  1374. this.tab.table2.getdataListParm.parammaps.startTime = this.tab.table.getdataListParm.parammaps.startTime
  1375. this.tab.table2.getdataListParm.parammaps.stopTime = this.tab.table.getdataListParm.parammaps.stopTime
  1376. this.tab.table2.getdataListParm.offset = 1
  1377. this.getTabList2()
  1378. }
  1379. },
  1380. // 快速跳转到图表
  1381. handleQuickJumpChart() {
  1382. console.log(document.querySelector('#chartDate'))
  1383. document.querySelector('#chartDate').scrollIntoView()
  1384. },
  1385. // 快速回到顶部
  1386. handleQuickJumpTop() {
  1387. window.scrollTo(0, 0)
  1388. },
  1389. // 图表总查询
  1390. handleChartDate() {
  1391. console.log('点击了确认时间')
  1392. MessageBox.confirm('是否调整以下所有图表查询时间?', {
  1393. confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
  1394. }).then(() => {
  1395. var that = this
  1396. var startTime = parseTime(this.tab.chartDate[0], '{y}-{m}-{d}')
  1397. var stopTime = parseTime(this.tab.chartDate[1], '{y}-{m}-{d}')
  1398. that.tab.chart1.getdataListParm.parammaps.inputDatetime = this.tab.chartDate
  1399. that.tab.chart1.getdataListParm.parammaps.startTime = startTime
  1400. that.tab.chart1.getdataListParm.parammaps.stopTime = stopTime
  1401. that.getChart1()
  1402. that.tab.chart2.getdataListParm.parammaps.inputDatetime = this.tab.chartDate
  1403. that.tab.chart2.getdataListParm.parammaps.startTime = startTime
  1404. that.tab.chart2.getdataListParm.parammaps.stopTime = stopTime
  1405. that.getChart2()
  1406. that.tab.chart3.getdataListParm.parammaps.inputDatetime = this.tab.chartDate
  1407. that.tab.chart3.getdataListParm.parammaps.startTime = startTime
  1408. that.tab.chart3.getdataListParm.parammaps.stopTime = stopTime
  1409. that.getChart3()
  1410. that.tab.chart4.getdataListParm.parammaps.inputDatetime = this.tab.chartDate
  1411. that.tab.chart4.getdataListParm.parammaps.startTime = startTime
  1412. that.tab.chart4.getdataListParm.parammaps.stopTime = stopTime
  1413. that.getChart4()
  1414. that.tab.chart5.getdataListParm.parammaps.inputDatetime = this.tab.chartDate
  1415. that.tab.chart5.getdataListParm.parammaps.startTime = startTime
  1416. that.tab.chart5.getdataListParm.parammaps.stopTime = stopTime
  1417. that.getChart5()
  1418. that.tab.chart6.getdataListParm.parammaps.inputDatetime = this.tab.chartDate
  1419. that.tab.chart6.getdataListParm.parammaps.startTime = startTime
  1420. that.tab.chart6.getdataListParm.parammaps.stopTime = stopTime
  1421. that.getChart6()
  1422. that.tab.chart7.getdataListParm.parammaps.inputDatetime = this.tab.chartDate
  1423. that.tab.chart7.getdataListParm.parammaps.startTime = startTime
  1424. that.tab.chart7.getdataListParm.parammaps.stopTime = stopTime
  1425. that.getChart7()
  1426. })
  1427. },
  1428. // 配方准确率
  1429. changeStatisticChart1() {
  1430. var arrData3 = []
  1431. for (let i = 0; i < this.tab.chart1.getdataListParm.parammaps.statisticsList.length; i++) {
  1432. const myId = this.tab.chart1.statisticsList.find(obj => obj.name == this.tab.chart1.getdataListParm.parammaps.statisticsList[i]).id
  1433. for (let j = 0; j < this.tab.chart1.chart1Data3.length; j++) {
  1434. if (j == myId) {
  1435. arrData3.push(this.tab.chart1.chart1Data3[j])
  1436. }
  1437. }
  1438. }
  1439. this.tab.chart1.chartLine_data.data3 = arrData3
  1440. this.tab.chart1.chartLine_data.data1 = this.tab.chart1.getdataListParm.parammaps.statisticsList
  1441. this.roadChartLine1(this.tab.chart1.chartLine_data)
  1442. },
  1443. getChart1() {
  1444. this.tab.chart1.listLoading = true
  1445. GetReportform(this.tab.chart1.getdataListParm).then(response => {
  1446. if (response.data.list !== null) {
  1447. for (let i = 0; i < response.data.data.length; i++) {
  1448. response.data.data[i].准确率 = parseFloat(response.data.data[i].准确率) + '%'
  1449. }
  1450. this.tab.chart1.table.list = response.data.data
  1451. this.tab.chart1.chartLine_data = response.data.list
  1452. this.tab.chart1.statisticsList = []
  1453. this.tab.chart1.getdataListParm.parammaps.statisticsList = []
  1454. for (let i = 0; i < response.data.list.data1.length; i++) {
  1455. if (i < 10) {
  1456. this.tab.chart1.getdataListParm.parammaps.statisticsList.push(response.data.list.data1[i])
  1457. }
  1458. var obj = {}
  1459. obj.id = i
  1460. obj.name = response.data.list.data1[i]
  1461. this.tab.chart1.statisticsList.push(obj)
  1462. }
  1463. this.tab.chart1.chart1Data3 = response.data.list.data3
  1464. this.tab.chart1.total = response.data.total
  1465. console.log('配方准确率表数据', this.tab.chart1.table.list)
  1466. console.log('配方准确率图数据', this.tab.chart1.chartLine_data)
  1467. var arrData3 = []
  1468. for (let i = 0; i < this.tab.chart1.getdataListParm.parammaps.statisticsList.length; i++) {
  1469. const myId = this.tab.chart1.statisticsList.find(obj => obj.name == this.tab.chart1.getdataListParm.parammaps.statisticsList[i]).id
  1470. for (let j = 0; j < this.tab.chart1.chart1Data3.length; j++) {
  1471. if (j == myId) {
  1472. arrData3.push(this.tab.chart1.chart1Data3[j])
  1473. }
  1474. }
  1475. }
  1476. this.tab.chart1.chartLine_data.data3 = arrData3
  1477. this.tab.chart1.chartLine_data.data1 = this.tab.chart1.getdataListParm.parammaps.statisticsList
  1478. this.roadChartLine1(this.tab.chart1.chartLine_data)
  1479. } else {
  1480. this.tab.chart1.list = []
  1481. }
  1482. setTimeout(() => {
  1483. this.tab.chart1.listLoading = false
  1484. }, 100)
  1485. })
  1486. },
  1487. roadChartLine1(chartLine_data) {
  1488. if (this.tab.chart1.chartLine != null) {
  1489. this.tab.chart1.chartLine.dispose()
  1490. }
  1491. this.tab.chart1.chartLine = echarts.init(document.getElementById('chartLine1'))
  1492. var option = {
  1493. title: {
  1494. text: ''
  1495. },
  1496. tooltip: {
  1497. trigger: 'axis'
  1498. },
  1499. legend: {
  1500. data: chartLine_data.data1,
  1501. right: 10
  1502. },
  1503. grid: {
  1504. top: '20%',
  1505. left: '5%',
  1506. right: '8%',
  1507. containLabel: true
  1508. },
  1509. toolbox: {
  1510. show: true,
  1511. right: '2%',
  1512. feature: {}
  1513. },
  1514. xAxis: { type: 'category', boundaryGap: false, data: chartLine_data.data2, name: '日期' },
  1515. yAxis: {
  1516. type: 'value', name: '百分比', axisLabel: { formatter: '{value} %' }
  1517. },
  1518. series: (function() {
  1519. var serie = []
  1520. for (var i = 0; i < chartLine_data.data3.length; i++) {
  1521. var item = {
  1522. name: chartLine_data.data1[i],
  1523. type: 'line',
  1524. data: chartLine_data.data3[i].data
  1525. }
  1526. serie.push(item)
  1527. }
  1528. return serie
  1529. }())
  1530. }
  1531. this.tab.chart1.chartLine.setOption(option)
  1532. window.onresize = function() {
  1533. this.tab.chart1.chartLine.resize()
  1534. }
  1535. },
  1536. // 计划统计
  1537. getChart2() {
  1538. this.tab.chart2.listLoading = true
  1539. GetReportform(this.tab.chart2.getdataListParm).then(response => {
  1540. if (response.data.list !== null) {
  1541. this.tab.chart2.table.list = response.data.data
  1542. this.tab.chart2.chartLine_data = response.data.list
  1543. this.tab.chart2.total = response.data.total
  1544. console.log('计划统计图数据', this.tab.chart2.chartLine_data)
  1545. console.log('计划统计表数据', this.tab.chart2.table.list)
  1546. this.roadChartLine2(this.tab.chart2.chartLine_data)
  1547. } else {
  1548. this.tab.chart2.list = []
  1549. }
  1550. setTimeout(() => {
  1551. this.tab.chart2.listLoading = false
  1552. }, 100)
  1553. })
  1554. },
  1555. roadChartLine2(chartLine_data) {
  1556. if (this.tab.chart2.chartLine != null) {
  1557. this.tab.chart2.chartLine.dispose()
  1558. }
  1559. this.tab.chart2.chartLine = echarts.init(document.getElementById('chartLine2'))
  1560. var option = {
  1561. title: {
  1562. text: ''
  1563. },
  1564. tooltip: {
  1565. trigger: 'axis'
  1566. },
  1567. legend: {
  1568. data: ['计划准确率', '计划正确率', '计划准确率(去除取消重量)'],
  1569. right: 10
  1570. },
  1571. grid: {
  1572. top: '20%',
  1573. left: '5%',
  1574. right: '8%',
  1575. containLabel: true
  1576. },
  1577. toolbox: {
  1578. show: true,
  1579. right: '2%',
  1580. feature: {}
  1581. },
  1582. xAxis: { type: 'category', boundaryGap: false, data: chartLine_data.data1, name: '日期' },
  1583. yAxis: {
  1584. type: 'value', name: '百分比', axisLabel: { formatter: '{value} %' }
  1585. },
  1586. series: [
  1587. { name: '计划准确率', type: 'line', data: chartLine_data.data2 },
  1588. { name: '计划正确率', type: 'line', data: chartLine_data.data3 },
  1589. { name: '计划准确率(去除取消重量)', type: 'line', data: chartLine_data.data4 }
  1590. ]
  1591. }
  1592. this.tab.chart2.chartLine.setOption(option)
  1593. window.onresize = function() {
  1594. this.tab.chart2.chartLine.resize()
  1595. }
  1596. },
  1597. // 牛群准确率
  1598. changeStatisticChart3() {
  1599. var arrData3 = []
  1600. for (let i = 0; i < this.tab.chart3.getdataListParm.parammaps.statisticsList.length; i++) {
  1601. const myId = this.tab.chart3.statisticsList.find(obj => obj.name == this.tab.chart3.getdataListParm.parammaps.statisticsList[i]).id
  1602. for (let j = 0; j < this.tab.chart3.chart3Data3.length; j++) {
  1603. if (j == myId) {
  1604. arrData3.push(this.tab.chart3.chart3Data3[j])
  1605. }
  1606. }
  1607. }
  1608. this.tab.chart3.chartLine_data.data3 = arrData3
  1609. this.tab.chart3.chartLine_data.data1 = this.tab.chart3.getdataListParm.parammaps.statisticsList
  1610. this.roadChartLine3(this.tab.chart3.chartLine_data)
  1611. },
  1612. getChart3() {
  1613. this.tab.chart3.listLoading = true
  1614. GetReportform(this.tab.chart3.getdataListParm).then(response => {
  1615. if (response.data.data !== null) {
  1616. for (let i = 0; i < response.data.data.length; i++) {
  1617. response.data.data[i].准确率 = response.data.data[i].准确率 + '%'
  1618. }
  1619. this.tab.chart3.table.list = response.data.data
  1620. this.tab.chart3.chartLine_data = response.data.list
  1621. this.tab.chart3.total = response.data.total
  1622. this.tab.chart3.statisticsList = []
  1623. this.tab.chart3.getdataListParm.parammaps.statisticsList = []
  1624. for (let i = 0; i < response.data.list.data1.length; i++) {
  1625. if (i < 10) {
  1626. this.tab.chart3.getdataListParm.parammaps.statisticsList.push(response.data.list.data1[i])
  1627. }
  1628. var obj = {}
  1629. obj.id = i
  1630. obj.name = response.data.list.data1[i]
  1631. this.tab.chart3.statisticsList.push(obj)
  1632. }
  1633. this.tab.chart3.chart3Data3 = response.data.list.data3
  1634. this.tab.chart3.total = response.data.total
  1635. console.log('牛群准确率图数据', this.tab.chart3.chartLine_data)
  1636. console.log('牛群准确率表数据', this.tab.chart3.table.list)
  1637. var arrData3 = []
  1638. for (let i = 0; i < this.tab.chart3.getdataListParm.parammaps.statisticsList.length; i++) {
  1639. const myId = this.tab.chart3.statisticsList.find(obj => obj.name == this.tab.chart3.getdataListParm.parammaps.statisticsList[i]).id
  1640. for (let j = 0; j < this.tab.chart3.chart3Data3.length; j++) {
  1641. if (j == myId) {
  1642. arrData3.push(this.tab.chart3.chart3Data3[j])
  1643. }
  1644. }
  1645. }
  1646. this.tab.chart3.chartLine_data.data3 = arrData3
  1647. this.tab.chart3.chartLine_data.data1 = this.tab.chart3.getdataListParm.parammaps.statisticsList
  1648. this.roadChartLine3(this.tab.chart3.chartLine_data)
  1649. } else {
  1650. this.tab.chart3.list = []
  1651. }
  1652. setTimeout(() => {
  1653. this.tab.chart3.listLoading = false
  1654. }, 100)
  1655. })
  1656. },
  1657. roadChartLine3(chartLine_data) {
  1658. if (this.tab.chart3.chartLine != null) {
  1659. this.tab.chart3.chartLine.dispose()
  1660. }
  1661. this.tab.chart3.chartLine = echarts.init(document.getElementById('chartLine3'))
  1662. var option = {
  1663. title: {
  1664. text: ''
  1665. },
  1666. tooltip: {
  1667. trigger: 'axis'
  1668. },
  1669. legend: {
  1670. data: chartLine_data.data1,
  1671. right: 10
  1672. },
  1673. grid: {
  1674. top: '20%',
  1675. left: '5%',
  1676. right: '8%',
  1677. containLabel: true
  1678. },
  1679. toolbox: {
  1680. show: true,
  1681. right: '2%',
  1682. feature: {}
  1683. },
  1684. xAxis: { type: 'category', boundaryGap: false, data: chartLine_data.data2, name: '日期' },
  1685. yAxis: {
  1686. type: 'value', name: '百分比', axisLabel: { formatter: '{value} %' }
  1687. },
  1688. series: (function() {
  1689. var serie = []
  1690. for (var i = 0; i < chartLine_data.data3.length; i++) {
  1691. var item = {
  1692. name: chartLine_data.data1[i],
  1693. type: 'line',
  1694. data: chartLine_data.data3[i].data
  1695. }
  1696. serie.push(item)
  1697. }
  1698. return serie
  1699. }())
  1700. }
  1701. this.tab.chart3.chartLine.setOption(option)
  1702. window.onresize = function() {
  1703. this.tab.chart3.chartLine.resize()
  1704. }
  1705. },
  1706. // 车辆准确率(重量)
  1707. changeStatisticChart4() {
  1708. var arrData3 = []
  1709. for (let i = 0; i < this.tab.chart4.getdataListParm.parammaps.statisticsList.length; i++) {
  1710. const myId = this.tab.chart4.statisticsList.find(obj => obj.name == this.tab.chart4.getdataListParm.parammaps.statisticsList[i]).id
  1711. for (let j = 0; j < this.tab.chart4.chart4Data3.length; j++) {
  1712. if (j == myId) {
  1713. arrData3.push(this.tab.chart4.chart4Data3[j])
  1714. }
  1715. }
  1716. }
  1717. this.tab.chart4.chartLine_data.data3 = arrData3
  1718. this.tab.chart4.chartLine_data.data1 = this.tab.chart4.getdataListParm.parammaps.statisticsList
  1719. this.roadChartLine4(this.tab.chart4.chartLine_data)
  1720. },
  1721. getChart4() {
  1722. this.tab.chart4.listLoading = true
  1723. GetReportform(this.tab.chart4.getdataListParm).then(response => {
  1724. if (response.data.list !== null) {
  1725. for (let i = 0; i < response.data.data.length; i++) {
  1726. response.data.data[i].准确率 = response.data.data[i].准确率 + '%'
  1727. }
  1728. this.tab.chart4.table.list = response.data.data
  1729. this.tab.chart4.chartLine_data = response.data.list
  1730. this.tab.chart4.total = response.data.total
  1731. this.tab.chart4.statisticsList = []
  1732. this.tab.chart4.getdataListParm.parammaps.statisticsList = []
  1733. for (let i = 0; i < response.data.list.data1.length; i++) {
  1734. if (i < 10) {
  1735. this.tab.chart4.getdataListParm.parammaps.statisticsList.push(response.data.list.data1[i])
  1736. }
  1737. var obj = {}
  1738. obj.id = i
  1739. obj.name = response.data.list.data1[i]
  1740. this.tab.chart4.statisticsList.push(obj)
  1741. }
  1742. this.tab.chart4.chart4Data3 = response.data.list.data3
  1743. this.tab.chart4.total = response.data.total
  1744. console.log('车辆准确率(重量)图', this.tab.chart4.chartLine_data)
  1745. console.log('车辆准确率(重量)表', this.tab.chart4.table.list)
  1746. var arrData3 = []
  1747. for (let i = 0; i < this.tab.chart4.getdataListParm.parammaps.statisticsList.length; i++) {
  1748. const myId = this.tab.chart4.statisticsList.find(obj => obj.name == this.tab.chart4.getdataListParm.parammaps.statisticsList[i]).id
  1749. for (let j = 0; j < this.tab.chart4.chart4Data3.length; j++) {
  1750. if (j == myId) {
  1751. arrData3.push(this.tab.chart4.chart4Data3[j])
  1752. }
  1753. }
  1754. }
  1755. this.tab.chart4.chartLine_data.data3 = arrData3
  1756. this.tab.chart4.chartLine_data.data1 = this.tab.chart4.getdataListParm.parammaps.statisticsList
  1757. this.roadChartLine4(this.tab.chart4.chartLine_data)
  1758. } else {
  1759. this.tab.chart4.list = []
  1760. }
  1761. setTimeout(() => {
  1762. this.tab.chart4.listLoading = false
  1763. }, 100)
  1764. })
  1765. },
  1766. roadChartLine4(chartLine_data) {
  1767. if (this.tab.chart4.chartLine != null) {
  1768. this.tab.chart4.chartLine.dispose()
  1769. }
  1770. this.tab.chart4.chartLine = echarts.init(document.getElementById('chartLine4'))
  1771. var option = {
  1772. title: {
  1773. text: ''
  1774. },
  1775. tooltip: {
  1776. trigger: 'axis'
  1777. },
  1778. legend: {
  1779. data: chartLine_data.data1,
  1780. right: 10
  1781. },
  1782. grid: {
  1783. top: '20%',
  1784. left: '5%',
  1785. right: '8%',
  1786. containLabel: true
  1787. },
  1788. toolbox: {
  1789. show: true,
  1790. right: '2%',
  1791. feature: {}
  1792. },
  1793. xAxis: { type: 'category', boundaryGap: false, data: chartLine_data.data2, name: '日期' },
  1794. yAxis: {
  1795. type: 'value', name: '百分比', axisLabel: { formatter: '{value} %' }
  1796. },
  1797. series: (function() {
  1798. var serie = []
  1799. for (var i = 0; i < chartLine_data.data3.length; i++) {
  1800. var item = {
  1801. name: chartLine_data.data1[i],
  1802. type: 'line',
  1803. data: chartLine_data.data3[i].data
  1804. }
  1805. serie.push(item)
  1806. }
  1807. return serie
  1808. }())
  1809. }
  1810. this.tab.chart4.chartLine.setOption(option)
  1811. window.onresize = function() {
  1812. this.tab.chart4.chartLine.resize()
  1813. }
  1814. },
  1815. // 混料统计
  1816. getChart5() {
  1817. this.tab.chart5.listLoading = true
  1818. GetReportform(this.tab.chart5.getdataListParm).then(response => {
  1819. if (response.data.list !== null) {
  1820. this.tab.chart5.table.list = response.data.data
  1821. this.tab.chart5.chartLine_data = response.data.list
  1822. this.tab.chart5.total = response.data.total
  1823. console.log('混料统计图', this.tab.chart5.chartLine_data)
  1824. console.log('混料统计表', this.tab.chart5.table.list)
  1825. this.roadChartLine5(this.tab.chart5.chartLine_data)
  1826. } else {
  1827. this.tab.chart5.list = []
  1828. }
  1829. setTimeout(() => {
  1830. this.tab.chart5.listLoading = false
  1831. }, 100)
  1832. })
  1833. },
  1834. roadChartLine5(chartLine_data) {
  1835. if (this.tab.chart5.chartLine != null) {
  1836. this.tab.chart5.chartLine.dispose()
  1837. }
  1838. this.tab.chart5.chartLine = echarts.init(document.getElementById('chartLine5'))
  1839. var option = {
  1840. tooltip: {
  1841. trigger: 'axis',
  1842. axisPointer: {
  1843. type: 'cross',
  1844. crossStyle: {
  1845. color: '#999'
  1846. }
  1847. }
  1848. },
  1849. toolbox: {
  1850. feature: {}
  1851. },
  1852. legend: {
  1853. data: ['自动跳转次数', '手动跳转次数', '自动跳转准确率', '手动跳转准确率']
  1854. },
  1855. grid: {
  1856. top: '20%',
  1857. left: '5%',
  1858. right: '8%',
  1859. containLabel: true
  1860. },
  1861. xAxis: [
  1862. {
  1863. type: 'category',
  1864. data: chartLine_data.data1,
  1865. axisPointer: {
  1866. type: 'shadow'
  1867. }
  1868. }
  1869. ],
  1870. yAxis: [
  1871. {
  1872. type: 'value',
  1873. name: '跳转次数',
  1874. axisLabel: {
  1875. formatter: '{value}'
  1876. }
  1877. },
  1878. {
  1879. type: 'value',
  1880. name: '混料准确率',
  1881. min: 0,
  1882. max: 100,
  1883. interval: 10,
  1884. axisLabel: {
  1885. formatter: '{value} %'
  1886. }
  1887. }
  1888. ],
  1889. series: [
  1890. {
  1891. name: '自动跳转次数',
  1892. type: 'bar',
  1893. data: chartLine_data.data2
  1894. },
  1895. {
  1896. name: '手动跳转次数',
  1897. type: 'bar',
  1898. data: chartLine_data.data3
  1899. },
  1900. {
  1901. name: '自动跳转准确率',
  1902. type: 'line',
  1903. yAxisIndex: 1,
  1904. data: chartLine_data.data4
  1905. },
  1906. {
  1907. name: '手动跳转准确率',
  1908. type: 'line',
  1909. yAxisIndex: 1,
  1910. data: chartLine_data.data5
  1911. }
  1912. ]
  1913. }
  1914. this.tab.chart5.chartLine.setOption(option)
  1915. window.onresize = function() {
  1916. this.tab.chart5.chartLine.resize()
  1917. }
  1918. },
  1919. // 混料计划取消次数
  1920. getChart6() {
  1921. this.tab.chart6.listLoading = true
  1922. GetReportform(this.tab.chart6.getdataListParm).then(response => {
  1923. if (response.data.list !== null) {
  1924. this.tab.chart6.table.list = response.data.data
  1925. this.tab.chart6.chartLine_data = response.data.list
  1926. this.tab.chart6.total = response.data.total
  1927. console.log('混料计划取消次数图', this.tab.chart6.chartLine_data)
  1928. console.log('混料计划取消次数表', this.tab.chart6.table.list)
  1929. this.roadChartLine6(this.tab.chart6.chartLine_data)
  1930. } else {
  1931. this.tab.chart6.list = []
  1932. }
  1933. setTimeout(() => {
  1934. this.tab.chart6.listLoading = false
  1935. }, 100)
  1936. })
  1937. },
  1938. roadChartLine6(chartLine_data) {
  1939. if (this.tab.chart6.chartLine != null) {
  1940. this.tab.chart6.chartLine.dispose()
  1941. }
  1942. this.tab.chart6.chartLine = echarts.init(document.getElementById('chartLine6'))
  1943. var option = {
  1944. color: ['#3398DB'],
  1945. tooltip: {
  1946. trigger: 'axis',
  1947. axisPointer: { // 坐标轴指示器,坐标轴触发有效
  1948. type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
  1949. }
  1950. },
  1951. legend: {
  1952. data: ['取消次数'],
  1953. right: 10
  1954. },
  1955. grid: {
  1956. top: '20%',
  1957. left: '5%',
  1958. right: '8%',
  1959. containLabel: true
  1960. },
  1961. xAxis: [
  1962. {
  1963. name: '日期',
  1964. type: 'category',
  1965. data: chartLine_data.data1,
  1966. axisTick: {
  1967. alignWithLabel: true
  1968. }
  1969. }
  1970. ],
  1971. yAxis: [
  1972. {
  1973. name: '次数',
  1974. interval: 1, // 会出现负数刻度
  1975. min: 0,
  1976. type: 'value'
  1977. }
  1978. ],
  1979. series: [
  1980. {
  1981. name: '取消次数',
  1982. type: 'bar',
  1983. barWidth: '60%',
  1984. data: chartLine_data.data2
  1985. }
  1986. ]
  1987. }
  1988. this.tab.chart6.chartLine.setOption(option)
  1989. window.onresize = function() {
  1990. this.tab.chart6.chartLine.resize()
  1991. }
  1992. },
  1993. // 栏舍撒料时间统计
  1994. changeStatisticChart7() {
  1995. var arrData3 = []
  1996. for (let i = 0; i < this.tab.chart7.getdataListParm.parammaps.statisticsList.length; i++) {
  1997. const myId = this.tab.chart7.statisticsList.find(obj => obj.name == this.tab.chart7.getdataListParm.parammaps.statisticsList[i]).id
  1998. for (let j = 0; j < this.tab.chart7.chart7Data3.length; j++) {
  1999. if (j == myId) {
  2000. arrData3.push(this.tab.chart7.chart7Data3[j])
  2001. }
  2002. }
  2003. }
  2004. this.tab.chart7.chartLine_data.data3 = arrData3
  2005. this.tab.chart7.chartLine_data.data1 = this.tab.chart7.getdataListParm.parammaps.statisticsList
  2006. this.roadChartLine7(this.tab.chart7.chartLine_data)
  2007. },
  2008. getChart7() {
  2009. this.tab.chart7.listLoading = true
  2010. GetReportform(this.tab.chart7.getdataListParm).then(response => {
  2011. if (response.data.list !== null) {
  2012. for (let i = 0; i < response.data.data.length; i++) {
  2013. // 撒料时间
  2014. var b = []
  2015. for (let j = 0; j <= response.data.data[i].准确率.length; j++) {
  2016. // console.log(response.data.data[i].准确率)
  2017. if (response.data.data[i].准确率.charAt(j) == '.') {
  2018. b[j] = response.data.data[i].准确率.replace('.', ':')
  2019. }
  2020. }
  2021. response.data.data[i].准确率 = b[b.length - 1]
  2022. response.data.data[i].撒料时间 = response.data.data[i].准确率
  2023. }
  2024. this.tab.chart7.table.list = response.data.data
  2025. this.tab.chart7.chartLine_data = response.data.list
  2026. this.tab.chart7.statisticsList = []
  2027. this.tab.chart7.getdataListParm.parammaps.statisticsList = []
  2028. for (let i = 0; i < response.data.list.data1.length; i++) {
  2029. if (i < 10) {
  2030. this.tab.chart7.getdataListParm.parammaps.statisticsList.push(response.data.list.data1[i])
  2031. }
  2032. var obj = {}
  2033. obj.id = i
  2034. obj.name = response.data.list.data1[i]
  2035. this.tab.chart7.statisticsList.push(obj)
  2036. }
  2037. this.tab.chart7.chart7Data3 = response.data.list.data3
  2038. this.tab.chart7.total = response.data.total
  2039. console.log('栏舍撒料时间统计图', this.tab.chart7.chartLine_data)
  2040. console.log('栏舍撒料时间统计表', this.tab.chart7.table.list)
  2041. var arrData3 = []
  2042. for (let i = 0; i < this.tab.chart7.getdataListParm.parammaps.statisticsList.length; i++) {
  2043. const myId = this.tab.chart7.statisticsList.find(obj => obj.name == this.tab.chart7.getdataListParm.parammaps.statisticsList[i]).id
  2044. for (let j = 0; j < this.tab.chart7.chart7Data3.length; j++) {
  2045. if (j == myId) {
  2046. arrData3.push(this.tab.chart7.chart7Data3[j])
  2047. }
  2048. }
  2049. }
  2050. this.tab.chart7.chartLine_data.data3 = arrData3
  2051. this.tab.chart7.chartLine_data.data1 = this.tab.chart7.getdataListParm.parammaps.statisticsList
  2052. this.roadChartLine7(this.tab.chart7.chartLine_data)
  2053. } else {
  2054. this.tab.chart7.list = []
  2055. }
  2056. setTimeout(() => {
  2057. this.tab.chart7.listLoading = false
  2058. }, 100)
  2059. })
  2060. },
  2061. roadChartLine7(chartLine_data) {
  2062. if (this.tab.chart7.chartLine != null) {
  2063. this.tab.chart7.chartLine.dispose()
  2064. }
  2065. this.tab.chart7.chartLine = echarts.init(document.getElementById('chartLine7'))
  2066. var option = {
  2067. title: {
  2068. text: ''
  2069. },
  2070. tooltip: {
  2071. trigger: 'axis',
  2072. formatter: function(params) {
  2073. // console.log(params)
  2074. var tip = params[0].name
  2075. for (let i = 0; i < params.length; i++) {
  2076. var b = []
  2077. // var str = params[i].value
  2078. for (let j = 0; j <= params[i].value.length; j++) {
  2079. if (params[i].value !== '') {
  2080. if (params[i].value.charAt(j) == '.') {
  2081. b[j] = params[i].value.replace('.', ':')
  2082. }
  2083. } else {
  2084. b[j] = ''
  2085. }
  2086. }
  2087. tip += '<br>' + params[i].seriesName + ': ' + b[b.length - 1]
  2088. }
  2089. return tip
  2090. }
  2091. },
  2092. legend: {
  2093. data: chartLine_data.data1,
  2094. right: 10
  2095. },
  2096. grid: {
  2097. top: '20%',
  2098. left: '5%',
  2099. right: '8%',
  2100. containLabel: true
  2101. },
  2102. toolbox: {
  2103. show: true,
  2104. right: '2%',
  2105. feature: {}
  2106. },
  2107. xAxis: { type: 'category', boundaryGap: false, data: chartLine_data.data2, name: '日期' },
  2108. yAxis: [{
  2109. type: '',
  2110. name: '时间',
  2111. mix: 0,
  2112. max: 24,
  2113. interval: 2,
  2114. axisLabel: {
  2115. formatter: function(value) {
  2116. var texts = []
  2117. if (value < 10) {
  2118. texts.push('0' + value + ':00')
  2119. } else {
  2120. texts.push(value + ':00')
  2121. }
  2122. return texts
  2123. }
  2124. }
  2125. }],
  2126. series: (function() {
  2127. var serie = []
  2128. for (var i = 0; i < chartLine_data.data3.length; i++) {
  2129. var item = {
  2130. name: chartLine_data.data1[i],
  2131. type: 'line',
  2132. data: chartLine_data.data3[i].data
  2133. }
  2134. serie.push(item)
  2135. }
  2136. return serie
  2137. }())
  2138. }
  2139. this.tab.chart7.chartLine.setOption(option)
  2140. window.onresize = function() {
  2141. this.tab.chart7.chartLine.resize()
  2142. }
  2143. },
  2144. // 时间
  2145. changeChartDate(item) {
  2146. console.log(item)
  2147. if (item == 'chart1') {
  2148. if (this.tab.chart1.getdataListParm.parammaps.inputDatetime !== '' && this.tab.chart1.getdataListParm.parammaps.inputDatetime !== null) {
  2149. this.tab.chart1.getdataListParm.parammaps.startTime = parseTime(this.tab.chart1.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  2150. this.tab.chart1.getdataListParm.parammaps.stopTime = parseTime(this.tab.chart1.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  2151. this.getChart1()
  2152. } else {
  2153. this.tab.chart1.getdataListParm.parammaps.inputDatetime = ''
  2154. this.tab.chart1.getdataListParm.parammaps.startTime = ''
  2155. this.tab.chart1.getdataListParm.parammaps.stopTime = ''
  2156. this.getChart1()
  2157. }
  2158. } else if (item == 'chart2') {
  2159. if (this.tab.chart2.getdataListParm.parammaps.inputDatetime !== '' && this.tab.chart2.getdataListParm.parammaps.inputDatetime !== null) {
  2160. this.tab.chart2.getdataListParm.parammaps.startTime = parseTime(this.tab.chart2.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  2161. this.tab.chart2.getdataListParm.parammaps.stopTime = parseTime(this.tab.chart2.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  2162. this.getChart2()
  2163. } else {
  2164. this.tab.chart2.getdataListParm.parammaps.inputDatetime = ''
  2165. this.tab.chart2.getdataListParm.parammaps.startTime = ''
  2166. this.tab.chart2.getdataListParm.parammaps.stopTime = ''
  2167. this.getChart2()
  2168. }
  2169. } else if (item == 'chart3') {
  2170. if (this.tab.chart3.getdataListParm.parammaps.inputDatetime !== '' && this.tab.chart3.getdataListParm.parammaps.inputDatetime !== null) {
  2171. this.tab.chart3.getdataListParm.parammaps.startTime = parseTime(this.tab.chart3.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  2172. this.tab.chart3.getdataListParm.parammaps.stopTime = parseTime(this.tab.chart3.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  2173. this.getChart3()
  2174. } else {
  2175. this.tab.chart3.getdataListParm.parammaps.inputDatetime = ''
  2176. this.tab.chart3.getdataListParm.parammaps.startTime = ''
  2177. this.tab.chart3.getdataListParm.parammaps.stopTime = ''
  2178. this.getChart3()
  2179. }
  2180. } else if (item == 'chart4') {
  2181. if (this.tab.chart4.getdataListParm.parammaps.inputDatetime !== '' && this.tab.chart4.getdataListParm.parammaps.inputDatetime !== null) {
  2182. this.tab.chart4.getdataListParm.parammaps.startTime = parseTime(this.tab.chart4.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  2183. this.tab.chart4.getdataListParm.parammaps.stopTime = parseTime(this.tab.chart4.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  2184. this.getChart4()
  2185. } else {
  2186. this.tab.chart4.getdataListParm.parammaps.inputDatetime = ''
  2187. this.tab.chart4.getdataListParm.parammaps.startTime = ''
  2188. this.tab.chart4.getdataListParm.parammaps.stopTime = ''
  2189. this.getChart4()
  2190. }
  2191. } else if (item == 'chart5') {
  2192. if (this.tab.chart5.getdataListParm.parammaps.inputDatetime !== '' && this.tab.chart5.getdataListParm.parammaps.inputDatetime !== null) {
  2193. this.tab.chart5.getdataListParm.parammaps.startTime = parseTime(this.tab.chart5.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  2194. this.tab.chart5.getdataListParm.parammaps.stopTime = parseTime(this.tab.chart5.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  2195. this.getChart5()
  2196. } else {
  2197. this.tab.chart5.getdataListParm.parammaps.inputDatetime = ''
  2198. this.tab.chart5.getdataListParm.parammaps.startTime = ''
  2199. this.tab.chart5.getdataListParm.parammaps.stopTime = ''
  2200. this.getChart5()
  2201. }
  2202. } else if (item == 'chart6') {
  2203. if (this.tab.chart6.getdataListParm.parammaps.inputDatetime !== '' && this.tab.chart6.getdataListParm.parammaps.inputDatetime !== null) {
  2204. this.tab.chart6.getdataListParm.parammaps.startTime = parseTime(this.tab.chart6.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  2205. this.tab.chart6.getdataListParm.parammaps.stopTime = parseTime(this.tab.chart6.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  2206. this.getChart6()
  2207. } else {
  2208. this.tab.chart6.getdataListParm.parammaps.inputDatetime = ''
  2209. this.tab.chart6.getdataListParm.parammaps.startTime = ''
  2210. this.tab.chart6.getdataListParm.parammaps.stopTime = ''
  2211. this.getChart6()
  2212. }
  2213. } else if (item == 'chart7') {
  2214. if (this.tab.chart6.getdataListParm.parammaps.inputDatetime !== '' && this.tab.chart7.getdataListParm.parammaps.inputDatetime !== null) {
  2215. this.tab.chart7.getdataListParm.parammaps.startTime = parseTime(this.tab.chart7.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  2216. this.tab.chart7.getdataListParm.parammaps.stopTime = parseTime(this.tab.chart7.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  2217. this.getChart7()
  2218. } else {
  2219. this.tab.chart7.getdataListParm.parammaps.inputDatetime = ''
  2220. this.tab.chart7.getdataListParm.parammaps.startTime = ''
  2221. this.tab.chart7.getdataListParm.parammaps.stopTime = ''
  2222. this.getChart7()
  2223. }
  2224. }
  2225. },
  2226. // 导出
  2227. handleExport(item) {
  2228. if (item == 'chart1') {
  2229. console.log('配方准确率导出')
  2230. var excelDatasTabChart1 = [
  2231. {
  2232. tHeader: ['日期', '配方名称', '计划重量(kg)', '实际重量(kg)', '准确率'],
  2233. filterVal: ['日期', '名称', '理论量', '实际量', '准确率'],
  2234. tableDatas: this.tab.chart1.table.list,
  2235. sheetName: '配方准确率'
  2236. }
  2237. ]
  2238. json2excel(excelDatasTabChart1, '配方准确率', true, 'xlsx')
  2239. } else if (item == 'chart2') {
  2240. console.log('计划统计导出')
  2241. var excelDatasTabChart2 = [
  2242. {
  2243. tHeader: ['日期', '计划执行重量(kg)', '配方理论重量(kg)', '计划准确率', '计划取消重量(kg)', '计划准确率(去除取消重量)', '计划正确数', '计划数', '计划正确率'],
  2244. filterVal: ['日期', '实际量', '理论量', 'field1', '计划取消重量', 'field3', '正确数', '计划数', 'field2'],
  2245. tableDatas: this.tab.chart2.table.list,
  2246. sheetName: '计划统计'
  2247. }
  2248. ]
  2249. json2excel(excelDatasTabChart2, '计划统计', true, 'xlsx')
  2250. } else if (item == 'chart3') {
  2251. console.log('牛群准确率导出')
  2252. var excelDatasTabChart3 = [
  2253. {
  2254. tHeader: ['日期', '牲畜类别', '计划重量(kg)', '实际重量(kg)', '准确率'],
  2255. filterVal: ['日期', '名称', '理论量', '实际量', '准确率'],
  2256. tableDatas: this.tab.chart3.table.list,
  2257. sheetName: '牛群准确率'
  2258. }
  2259. ]
  2260. json2excel(excelDatasTabChart3, '牛群准确率', true, 'xlsx')
  2261. } else if (item == 'chart4') {
  2262. console.log('车辆准确率(重量)导出')
  2263. var excelDatasTabChart4 = [
  2264. {
  2265. tHeader: ['日期', '车次', '计划重量(kg)', '实际重量(kg)', '准确率'],
  2266. filterVal: ['日期', '名称', '理论量', '实际量', '准确率'],
  2267. tableDatas: this.tab.chart4.table.list,
  2268. sheetName: '车辆准确率(重量)'
  2269. }
  2270. ]
  2271. json2excel(excelDatasTabChart4, '车辆准确率(重量)', true, 'xlsx')
  2272. } else if (item == 'chart5') {
  2273. console.log('混料统计导出')
  2274. var excelDatasTabChart5 = [
  2275. {
  2276. tHeader: ['日期', '自动跳转次数', '手动跳转次数', '自动跳转理论重量', '自动跳转实际重量', '自动跳转准确率', '手动跳转理论重量', '手动跳转实际重量', '手动跳转准确率'],
  2277. filterVal: ['日期', 'field1', 'field2', '理论自动', '实际自动', 'field3', '理论手动', '实际手动', 'field4'],
  2278. tableDatas: this.tab.chart5.table.list,
  2279. sheetName: '混料统计'
  2280. }
  2281. ]
  2282. json2excel(excelDatasTabChart5, '混料统计', true, 'xlsx')
  2283. } else if (item == 'chart6') {
  2284. console.log('混料计划取消次数导出')
  2285. var excelDatasTabChart6 = [
  2286. {
  2287. tHeader: ['日期', '混料计划取消次数'],
  2288. filterVal: ['日期', 'field1'],
  2289. tableDatas: this.tab.chart6.table.list,
  2290. sheetName: '混料计划取消次数'
  2291. }
  2292. ]
  2293. json2excel(excelDatasTabChart6, '混料计划取消次数', true, 'xlsx')
  2294. } else if (item == 'chart7') {
  2295. console.log('栏舍撒料时间统计导出')
  2296. var excelDatasTabChart7 = [
  2297. {
  2298. tHeader: ['日期', '栏舍', '撒料时间'],
  2299. filterVal: ['日期', 'fname', '准确率'],
  2300. tableDatas: this.tab.chart7.table.list,
  2301. sheetName: '栏舍撒料时间统计'
  2302. }
  2303. ]
  2304. json2excel(excelDatasTabChart7, '栏舍撒料时间统计', true, 'xlsx')
  2305. }
  2306. },
  2307. // 切换表格
  2308. handleTable(item) {
  2309. // 显示切换表格
  2310. if (item == 'chart1') {
  2311. console.log('配方准确率表格')
  2312. this.tab.chart1.isTable = true
  2313. this.tab.chart1.isChart = false
  2314. } else if (item == 'chart2') {
  2315. console.log('计划统计表格')
  2316. this.tab.chart2.isTable = true
  2317. this.tab.chart2.isChart = false
  2318. } else if (item == 'chart3') {
  2319. console.log('牛群准确率表格')
  2320. this.tab.chart3.isTable = true
  2321. this.tab.chart3.isChart = false
  2322. } else if (item == 'chart4') {
  2323. console.log('车辆准确率(重量)表格')
  2324. this.tab.chart4.isTable = true
  2325. this.tab.chart4.isChart = false
  2326. } else if (item == 'chart5') {
  2327. console.log('混料统计表格')
  2328. this.tab.chart5.isTable = true
  2329. this.tab.chart5.isChart = false
  2330. } else if (item == 'chart6') {
  2331. console.log('混料计划取消次数表格')
  2332. this.tab.chart6.isTable = true
  2333. this.tab.chart6.isChart = false
  2334. } else if (item == 'chart7') {
  2335. console.log('栏舍撒料时间统计表格')
  2336. this.tab.chart7.isTable = true
  2337. this.tab.chart7.isChart = false
  2338. }
  2339. },
  2340. // 切换图表
  2341. handleChart(item) {
  2342. // 显示切换图表
  2343. if (item == 'chart1') {
  2344. console.log('配方准确率图表')
  2345. this.tab.chart1.isTable = false
  2346. this.tab.chart1.isChart = true
  2347. } else if (item == 'chart2') {
  2348. console.log('计划统计图表')
  2349. this.tab.chart2.isTable = false
  2350. this.tab.chart2.isChart = true
  2351. } else if (item == 'chart3') {
  2352. console.log('牛群准确率图表')
  2353. this.tab.chart3.isTable = false
  2354. this.tab.chart3.isChart = true
  2355. } else if (item == 'chart4') {
  2356. console.log('车辆准确率(重量)图表')
  2357. this.tab.chart4.isTable = false
  2358. this.tab.chart4.isChart = true
  2359. } else if (item == 'chart5') {
  2360. console.log('混料统计图表')
  2361. this.tab.chart5.isTable = false
  2362. this.tab.chart5.isChart = true
  2363. } else if (item == 'chart6') {
  2364. console.log('混料计划取消次数图表')
  2365. this.tab.chart6.isTable = false
  2366. this.tab.chart6.isChart = true
  2367. } else if (item == 'chart7') {
  2368. console.log('栏舍撒料时间统计图表')
  2369. this.tab.chart7.isTable = false
  2370. this.tab.chart7.isChart = true
  2371. }
  2372. },
  2373. // 混料统计
  2374. getTab2List() {
  2375. this.tab2.table.listLoading = true
  2376. GetDataByName(this.tab2.table.getdataListParm).then(response => {
  2377. console.log('混料统计table数据', response.data.list)
  2378. if (response.data.list !== null) {
  2379. this.tab2.table.list = response.data.list
  2380. this.tab2.table.total = response.data.total
  2381. } else {
  2382. this.tab2.table.list = []
  2383. }
  2384. setTimeout(() => {
  2385. this.tab2.table.listLoading = false
  2386. }, 100)
  2387. })
  2388. },
  2389. handleSearch2() {
  2390. this.tab2.table.getdataListParm.name = 'getStatisticsHL'
  2391. if (this.tab2.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab2.table.getdataListParm.parammaps.inputDatetime !== null) {
  2392. console.log(this.tab2.table.getdataListParm.parammaps.inputDatetime)
  2393. this.tab2.table.getdataListParm.parammaps.startTime = parseTime(this.tab2.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  2394. this.tab2.table.getdataListParm.parammaps.stopTime = parseTime(this.tab2.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  2395. } else {
  2396. this.tab2.table.getdataListParm.parammaps.inputDatetime = ''
  2397. this.tab2.table.getdataListParm.parammaps.startTime = ''
  2398. this.tab2.table.getdataListParm.parammaps.stopTime = ''
  2399. }
  2400. this.tab2.table.getdataListParm.offset = 1
  2401. this.getTab2List()
  2402. },
  2403. handleRefresh2() {
  2404. this.tab2.table.getdataListParm.parammaps.tmrtname = ''
  2405. this.tab2.table.getdataListParm.parammaps.projname = ''
  2406. this.tab2.table.getdataListParm.parammaps.times = ''
  2407. this.tab2.table.getdataListParm.parammaps.templetname = ''
  2408. this.tab2.table.getdataListParm.parammaps.buttontype = ''
  2409. this.getTab2List()
  2410. },
  2411. handleExport2() {
  2412. var excelDatasTab2 = [
  2413. {
  2414. tHeader: ['日期', 'TMR名称', '车次', '班次', '配方名称', '饲料', '理论重量', '实际重量', '误差值', '准确率', '计划时间', '开始时间', '结束时间', ' 跳转方式', '开始重量', '结束重量'],
  2415. filterVal: ['日期', 'TMR名称', '车次', '班次', '配方名称', '饲料', '理论重量', '实际重量', '误差值', '准确率', '计划时间', '开始时间', '结束时间', '跳转方式', '开始重量', '结束重量'],
  2416. tableDatas: this.tab2.table.list,
  2417. sheetName: '混料统计'
  2418. }
  2419. ]
  2420. json2excel(excelDatasTab2, '混料统计', true, 'xlsx')
  2421. },
  2422. // 撒料统计
  2423. getTab3List() {
  2424. this.tab3.table.listLoading = true
  2425. GetDataByName(this.tab3.table.getdataListParm).then(response => {
  2426. console.log('撒料统计table数据', response.data.list)
  2427. if (response.data.list !== null) {
  2428. this.tab3.table.list = response.data.list
  2429. this.tab3.table.total = response.data.total
  2430. } else {
  2431. this.tab3.table.list = []
  2432. }
  2433. setTimeout(() => {
  2434. this.tab3.table.listLoading = false
  2435. }, 100)
  2436. })
  2437. },
  2438. handleSearch3() {
  2439. this.tab3.table.getdataListParm.name = 'getStatisticsSL'
  2440. if (this.tab3.table.getdataListParm.parammaps.inputDatetime !== '' && this.tab3.table.getdataListParm.parammaps.inputDatetime !== null) {
  2441. this.tab3.table.getdataListParm.parammaps.startTime = parseTime(this.tab3.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  2442. this.tab3.table.getdataListParm.parammaps.stopTime = parseTime(this.tab3.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  2443. } else {
  2444. this.tab3.table.getdataListParm.parammaps.inputDatetime = ''
  2445. this.tab3.table.getdataListParm.parammaps.startTime = ''
  2446. this.tab3.table.getdataListParm.parammaps.stopTime = ''
  2447. }
  2448. this.tab3.table.getdataListParm.offset = 1
  2449. this.getTab3List()
  2450. },
  2451. handleRefresh3() {
  2452. this.tab3.table.getdataListParm.parammaps.tmrtname = ''
  2453. this.tab3.table.getdataListParm.parammaps.projname = ''
  2454. this.tab3.table.getdataListParm.parammaps.times = ''
  2455. this.tab3.table.getdataListParm.parammaps.templetname = ''
  2456. this.tab3.table.getdataListParm.parammaps.buttontype = ''
  2457. this.tab3.table.getdataListParm.parammaps.fname = ''
  2458. this.getTab3List()
  2459. },
  2460. handleExport3() {
  2461. var excelDatasTab3 = [
  2462. {
  2463. tHeader: ['日期', 'TMR名称', '车次', '班次', '配方名称', '栏舍', '理论重量', '实际重量', '误差值', '准确率', '开始时间', '结束时间', '跳转方式', '开始重量', '结束重量'],
  2464. filterVal: ['日期', 'TMR名称', '车次', '班次', '配方名称', '栏舍', '理论重量', '实际重量', '误差值', '准确率', '开始时间', '结束时间', '跳转方式', '开始重量', '结束重量'],
  2465. tableDatas: this.tab3.table.list,
  2466. sheetName: '撒料统计'
  2467. }
  2468. ]
  2469. json2excel(excelDatasTab3, '撒料统计', true, 'xlsx')
  2470. }
  2471. }
  2472. }
  2473. </script>
  2474. <style lang="scss" scoped>
  2475. .search{margin-bottom:10px;}
  2476. </style>