9b2250ca29d7555262c28540afb37affabb2f905.svn-base 92 KB

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