069544dac66df23cdcf55a689be73d950b516527.svn-base 111 KB

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