tab1.vue 103 KB

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