4dd82a9b2eb7aab542e2b74ade91198a3ffa5529.svn-base 119 KB

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