aed1155ea5066ac8cfa26229395d02de03a98099.svn-base 92 KB

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