24bde89b637d6aa51e3f85671341d06090383cf5.svn-base 105 KB

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