6a46c8bf12d039a47d61f63acfedb9e47cd3526c.svn-base 96 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077
  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. that.table.getdataListParm.parammaps.inputDatetime = [start2, end2]
  786. that.table.getdataListParm.parammaps.startTime = parseTime(start2, '{y}-{m}-{d}')
  787. that.table.getdataListParm.parammaps.stopTime = parseTime(end2, '{y}-{m}-{d}')
  788. that.table2.getdataListParm.parammaps.inputDatetime = that.table.getdataListParm.parammaps.inputDatetime
  789. that.table2.getdataListParm.parammaps.startTime = that.table.getdataListParm.parammaps.startTime
  790. that.table2.getdataListParm.parammaps.stopTime = that.table.getdataListParm.parammaps.stopTime
  791. // start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
  792. that.chartDate[0] = parseTime(start, '{y}-{m}-{d}')
  793. that.chartDate[1] = parseTime(end, '{y}-{m}-{d}')
  794. that.chart1.getdataListParm.parammaps.inputDatetime = [start, end]
  795. that.chart1.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
  796. that.chart1.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')
  797. that.chart2.getdataListParm.parammaps.inputDatetime[0] = parseTime(start, '{y}-{m}-{d}')
  798. that.chart2.getdataListParm.parammaps.inputDatetime[1] = parseTime(end, '{y}-{m}-{d}')
  799. that.chart2.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
  800. that.chart2.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')
  801. that.chart3.getdataListParm.parammaps.inputDatetime[0] = parseTime(start, '{y}-{m}-{d}')
  802. that.chart3.getdataListParm.parammaps.inputDatetime[1] = parseTime(end, '{y}-{m}-{d}')
  803. that.chart3.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
  804. that.chart3.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')
  805. that.chart4.getdataListParm.parammaps.inputDatetime[0] = parseTime(start, '{y}-{m}-{d}')
  806. that.chart4.getdataListParm.parammaps.inputDatetime[1] = parseTime(end, '{y}-{m}-{d}')
  807. that.chart4.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
  808. that.chart4.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')
  809. that.chart5.getdataListParm.parammaps.inputDatetime[0] = parseTime(start, '{y}-{m}-{d}')
  810. that.chart5.getdataListParm.parammaps.inputDatetime[1] = parseTime(end, '{y}-{m}-{d}')
  811. that.chart5.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
  812. that.chart5.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')
  813. that.chart6.getdataListParm.parammaps.inputDatetime[0] = parseTime(start, '{y}-{m}-{d}')
  814. that.chart6.getdataListParm.parammaps.inputDatetime[1] = parseTime(end, '{y}-{m}-{d}')
  815. that.chart6.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
  816. that.chart6.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')
  817. },
  818. getList() {
  819. this.table.listLoading = true
  820. GetDataByName(this.table.getdataListParm).then(response => {
  821. console.log('汇总统计/混料table数据', response.data.list)
  822. if (response.data.list !== null) {
  823. this.table.list = response.data.list
  824. } else {
  825. this.table.list = []
  826. }
  827. setTimeout(() => {
  828. this.table.listLoading = false
  829. }, 100)
  830. })
  831. },
  832. // 汇总统计/撒料
  833. getList2() {
  834. this.table2.listLoading = true
  835. GetDataByName(this.table2.getdataListParm).then(response => {
  836. console.log('汇总统计/撒料table数据', response.data.list)
  837. if (response.data.list !== null) {
  838. this.table2.list = response.data.list
  839. } else {
  840. this.table2.list = []
  841. }
  842. setTimeout(() => {
  843. this.table2.listLoading = false
  844. }, 100)
  845. })
  846. },
  847. changeDate() {
  848. console.log(this.$refs.inputDatetime.value)
  849. const startTime = this.$refs.inputDatetime.value[0]
  850. const stopTime = this.$refs.inputDatetime.value[1]
  851. this.table.getdataListParm.parammaps.startTime = parseTime(startTime, '{y}-{m}-{d}')
  852. this.table.getdataListParm.parammaps.stopTime = parseTime(stopTime, '{y}-{m}-{d}')
  853. this.table2.getdataListParm.parammaps.startTime = parseTime(startTime, '{y}-{m}-{d}')
  854. this.table2.getdataListParm.parammaps.stopTime = parseTime(stopTime, '{y}-{m}-{d}')
  855. this.getList()
  856. this.getList2()
  857. },
  858. handleBefore() {
  859. if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
  860. var start = new Date(this.table.getdataListParm.parammaps.inputDatetime[0].setDate(this.table.getdataListParm.parammaps.inputDatetime[0].getDate() - 1))
  861. var stop = new Date(this.table.getdataListParm.parammaps.inputDatetime[1].setDate(this.table.getdataListParm.parammaps.inputDatetime[1].getDate() - 1))
  862. if (stop > Date.now() - 8.64e7) {
  863. this.Nextdisabled = true
  864. this.Beforedisabled = false
  865. } else {
  866. this.Nextdisabled = false
  867. this.Beforedisabled = false
  868. }
  869. this.table.getdataListParm.parammaps.inputDatetime.length = 0
  870. this.table.getdataListParm.parammaps.inputDatetime.push(start, stop)
  871. this.$forceUpdate()
  872. }
  873. this.table.getdataListParm.parammaps.startTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  874. this.table.getdataListParm.parammaps.stopTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  875. this.getList()
  876. this.table2.getdataListParm.parammaps.startTime = this.table.getdataListParm.parammaps.startTime
  877. this.table2.getdataListParm.parammaps.stopTime = this.table.getdataListParm.parammaps.stopTime
  878. this.getList2()
  879. },
  880. handleNext() {
  881. if (this.table.getdataListParm.parammaps.inputDatetime !== '' && this.table.getdataListParm.parammaps.inputDatetime !== null) {
  882. var start2 = new Date(this.table.getdataListParm.parammaps.inputDatetime[0].setDate(this.table.getdataListParm.parammaps.inputDatetime[0].getDate() + 1))
  883. var stop2 = new Date(this.table.getdataListParm.parammaps.inputDatetime[1].setDate(this.table.getdataListParm.parammaps.inputDatetime[1].getDate() + 1))
  884. if (stop2 > Date.now() - 8.64e7) {
  885. this.Nextdisabled = true
  886. this.Beforedisabled = false
  887. } else {
  888. this.Nextdisabled = false
  889. this.Beforedisabled = false
  890. }
  891. this.table.getdataListParm.parammaps.inputDatetime.length = 0
  892. this.table.getdataListParm.parammaps.inputDatetime.push(start2, stop2)
  893. this.$forceUpdate()
  894. }
  895. this.table.getdataListParm.parammaps.startTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  896. this.table.getdataListParm.parammaps.stopTime = parseTime(this.table.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  897. this.getList()
  898. this.table2.getdataListParm.parammaps.startTime = this.table.getdataListParm.parammaps.startTime
  899. this.table2.getdataListParm.parammaps.stopTime = this.table.getdataListParm.parammaps.stopTime
  900. this.getList2()
  901. },
  902. tableCellStyle({ row, column, rowIndex, columnIndex }) {
  903. if (columnIndex === 0 && row.pastureid !== '-1') {
  904. return {
  905. textDecoration: 'underline'
  906. }
  907. }
  908. return {
  909. textDecoration: 'none'
  910. }
  911. },
  912. clickPasture(row) {
  913. console.log(row)
  914. if (row.pastureid !== '-1') {
  915. this.pasture.dialogStatus = 'pasture'
  916. this.pasture.dialogFormVisible = true
  917. this.pasture.table.getdataListParm.parammaps.pastureid = row.pastureid
  918. this.pasture.table2.getdataListParm.parammaps.pastureid = row.pastureid
  919. this.getTabList()
  920. this.getTabList2()
  921. }
  922. },
  923. // 切换统计类型
  924. changeRadio() {
  925. console.log(this.pasture.radio)
  926. this.pasture.table.getdataListParm.parammaps.sort = ''
  927. this.pasture.table.getdataListParm.parammaps.times = ''
  928. this.pasture.table.getdataListParm.parammaps.fname = ''
  929. this.pasture.table2.getdataListParm.parammaps.sort = ''
  930. this.pasture.table2.getdataListParm.parammaps.times = ''
  931. this.pasture.table2.getdataListParm.parammaps.fname = ''
  932. if (this.pasture.checked == true) {
  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 = 'getAccuracyHFTDate'
  940. this.pasture.table.getdataListParm.offset = 1
  941. this.getTabList()
  942. this.pasture.table2.getdataListParm.name = 'getAccuracySFTDate'
  943. this.pasture.table2.getdataListParm.parammaps.startTime = this.pasture.table.getdataListParm.parammaps.startTime
  944. this.pasture.table2.getdataListParm.parammaps.stopTime = this.pasture.table.getdataListParm.parammaps.stopTime
  945. this.getTabList2()
  946. } else if (this.pasture.radio == '2') {
  947. console.log('栏舍名称')
  948. this.pasture.isFormulaName = false
  949. this.pasture.isHouseName = true
  950. this.pasture.isLivestockType = false
  951. this.pasture.isTrainNumber = false
  952. this.pasture.table.getdataListParm.name = 'getAccuracyHNSDate'
  953. this.pasture.table.getdataListParm.offset = 1
  954. this.getTabList()
  955. this.pasture.table2.getdataListParm.name = 'getAccuracySNSDate'
  956. this.pasture.table2.getdataListParm.parammaps.startTime = this.pasture.table.getdataListParm.parammaps.startTime
  957. this.pasture.table2.getdataListParm.parammaps.stopTime = this.pasture.table.getdataListParm.parammaps.stopTime
  958. this.getTabList2()
  959. } else if (this.pasture.radio == '3') {
  960. console.log(' 牲畜类别')
  961. this.pasture.isFormulaName = false
  962. this.pasture.isHouseName = false
  963. this.pasture.isLivestockType = true
  964. this.pasture.isTrainNumber = false
  965. this.pasture.table.getdataListParm.name = 'getAccuracyHSCDate'
  966. this.pasture.table.getdataListParm.offset = 1
  967. this.getTabList()
  968. this.pasture.table2.getdataListParm.name = 'getAccuracySSCDate'
  969. this.pasture.table2.getdataListParm.parammaps.startTime = this.pasture.table.getdataListParm.parammaps.startTime
  970. this.pasture.table2.getdataListParm.parammaps.stopTime = this.pasture.table.getdataListParm.parammaps.stopTime
  971. this.pasture.table2.getdataListParm.offset = 1
  972. this.getTabList2()
  973. } else if (this.pasture.radio == '4') {
  974. console.log('车次')
  975. this.pasture.isFormulaName = false
  976. this.pasture.isHouseName = false
  977. this.pasture.isLivestockType = false
  978. this.pasture.isTrainNumber = true
  979. this.pasture.table.getdataListParm.name = 'getAccuracyHCCDate'
  980. this.pasture.table.getdataListParm.offset = 1
  981. this.getTabList()
  982. this.pasture.table2.getdataListParm.name = 'getAccuracySCCDate'
  983. this.pasture.table2.getdataListParm.parammaps.startTime = this.pasture.table.getdataListParm.parammaps.startTime
  984. this.pasture.table2.getdataListParm.parammaps.stopTime = this.pasture.table.getdataListParm.parammaps.stopTime
  985. this.pasture.table2.getdataListParm.offset = 1
  986. this.getTabList2()
  987. }
  988. } else {
  989. if (this.pasture.radio == '1') {
  990. console.log('配方名称')
  991. this.pasture.isFormulaName = true
  992. this.pasture.isHouseName = false
  993. this.pasture.isLivestockType = false
  994. this.pasture.isTrainNumber = false
  995. this.pasture.table.getdataListParm.name = 'getAccuracyHFT'
  996. this.pasture.table.getdataListParm.offset = 1
  997. this.getTabList()
  998. this.pasture.table2.getdataListParm.name = 'getAccuracySFT'
  999. this.pasture.table2.getdataListParm.parammaps.startTime = this.pasture.table.getdataListParm.parammaps.startTime
  1000. this.pasture.table2.getdataListParm.parammaps.stopTime = this.pasture.table.getdataListParm.parammaps.stopTime
  1001. this.getTabList2()
  1002. } else if (this.pasture.radio == '2') {
  1003. console.log('栏舍名称')
  1004. this.pasture.isFormulaName = false
  1005. this.pasture.isHouseName = true
  1006. this.pasture.isLivestockType = false
  1007. this.pasture.isTrainNumber = false
  1008. this.pasture.table.getdataListParm.name = 'getAccuracyHNS'
  1009. this.pasture.table.getdataListParm.offset = 1
  1010. this.getTabList()
  1011. this.pasture.table2.getdataListParm.name = 'getAccuracySNS'
  1012. this.pasture.table2.getdataListParm.parammaps.startTime = this.pasture.table.getdataListParm.parammaps.startTime
  1013. this.pasture.table2.getdataListParm.parammaps.stopTime = this.pasture.table.getdataListParm.parammaps.stopTime
  1014. this.getTabList2()
  1015. } else if (this.pasture.radio == '3') {
  1016. console.log(' 牲畜类别')
  1017. this.pasture.isFormulaName = false
  1018. this.pasture.isHouseName = false
  1019. this.pasture.isLivestockType = true
  1020. this.pasture.isTrainNumber = false
  1021. this.pasture.table.getdataListParm.name = 'getAccuracyHSC'
  1022. this.pasture.table.getdataListParm.offset = 1
  1023. this.getTabList()
  1024. this.pasture.table2.getdataListParm.name = 'getAccuracySSC'
  1025. this.pasture.table2.getdataListParm.parammaps.startTime = this.pasture.table.getdataListParm.parammaps.startTime
  1026. this.pasture.table2.getdataListParm.parammaps.stopTime = this.pasture.table.getdataListParm.parammaps.stopTime
  1027. this.pasture.table2.getdataListParm.offset = 1
  1028. this.getTabList2()
  1029. } else if (this.pasture.radio == '4') {
  1030. console.log('车次')
  1031. this.pasture.isFormulaName = false
  1032. this.pasture.isHouseName = false
  1033. this.pasture.isLivestockType = false
  1034. this.pasture.isTrainNumber = true
  1035. this.pasture.table.getdataListParm.name = 'getAccuracyHCC'
  1036. this.pasture.table.getdataListParm.offset = 1
  1037. this.getTabList()
  1038. this.pasture.table2.getdataListParm.name = 'getAccuracySCC'
  1039. this.pasture.table2.getdataListParm.parammaps.startTime = this.pasture.table.getdataListParm.parammaps.startTime
  1040. this.pasture.table2.getdataListParm.parammaps.stopTime = this.pasture.table.getdataListParm.parammaps.stopTime
  1041. this.pasture.table2.getdataListParm.offset = 1
  1042. this.getTabList2()
  1043. }
  1044. }
  1045. },
  1046. changeChecked() {
  1047. this.handleSearch()
  1048. },
  1049. handleSearch() {
  1050. if (this.pasture.checked == true) {
  1051. if (this.pasture.radio == '1') {
  1052. console.log('配方名称/查询111')
  1053. this.pasture.isFormulaName = true
  1054. this.pasture.isHouseName = false
  1055. this.pasture.isLivestockType = false
  1056. this.pasture.isTrainNumber = false
  1057. this.pasture.table.getdataListParm.name = 'getAccuracyHFTDate'
  1058. this.pasture.table.getdataListParm.offset = 1
  1059. this.getTabList()
  1060. this.pasture.table2.getdataListParm.name = 'getAccuracySFTDate'
  1061. this.pasture.table2.getdataListParm.parammaps.startTime = this.pasture.table.getdataListParm.parammaps.startTime
  1062. this.pasture.table2.getdataListParm.parammaps.stopTime = this.pasture.table.getdataListParm.parammaps.stopTime
  1063. this.pasture.table2.getdataListParm.offset = 1
  1064. this.getTabList2()
  1065. } else if (this.pasture.radio == '2') {
  1066. console.log('栏舍名称/查询')
  1067. this.pasture.isFormulaName = false
  1068. this.pasture.isHouseName = true
  1069. this.pasture.isLivestockType = false
  1070. this.pasture.isTrainNumber = false
  1071. this.pasture.table.getdataListParm.name = 'getAccuracyHNSDate'
  1072. this.pasture.table.getdataListParm.offset = 1
  1073. this.getTabList()
  1074. this.pasture.table2.getdataListParm.name = 'getAccuracySNSDate'
  1075. this.pasture.table2.getdataListParm.parammaps.startTime = this.pasture.table.getdataListParm.parammaps.startTime
  1076. this.pasture.table2.getdataListParm.parammaps.stopTime = this.pasture.table.getdataListParm.parammaps.stopTime
  1077. this.pasture.table2.getdataListParm.offset = 1
  1078. this.getTabList2()
  1079. } else if (this.pasture.radio == '3') {
  1080. console.log(' 牲畜类别/查询')
  1081. this.pasture.isFormulaName = false
  1082. this.pasture.isHouseName = false
  1083. this.pasture.isLivestockType = true
  1084. this.pasture.isTrainNumber = false
  1085. this.pasture.table.getdataListParm.name = 'getAccuracyHSCDate'
  1086. this.pasture.table.getdataListParm.offset = 1
  1087. this.getTabList()
  1088. this.pasture.table2.getdataListParm.name = 'getAccuracySSCDate'
  1089. this.pasture.table2.getdataListParm.parammaps.startTime = this.pasture.table.getdataListParm.parammaps.startTime
  1090. this.pasture.table2.getdataListParm.parammaps.stopTime = this.pasture.table.getdataListParm.parammaps.stopTime
  1091. this.pasture.table2.getdataListParm.offset = 1
  1092. this.getTabList2()
  1093. } else if (this.pasture.radio == '4') {
  1094. console.log('车次/查询')
  1095. this.pasture.isFormulaName = false
  1096. this.pasture.isHouseName = false
  1097. this.pasture.isLivestockType = false
  1098. this.pasture.isTrainNumber = true
  1099. this.pasture.table.getdataListParm.name = 'getAccuracyHCCDate'
  1100. this.pasture.table.getdataListParm.offset = 1
  1101. this.getTabList()
  1102. this.pasture.table2.getdataListParm.name = 'getAccuracySCCDate'
  1103. this.pasture.table2.getdataListParm.parammaps.startTime = this.pasture.table.getdataListParm.parammaps.startTime
  1104. this.pasture.table2.getdataListParm.parammaps.stopTime = this.pasture.table.getdataListParm.parammaps.stopTime
  1105. this.pasture.table2.getdataListParm.parammaps.fname = this.pasture.table.getdataListParm.parammaps.fname
  1106. this.pasture.table2.getdataListParm.parammaps.times = this.pasture.table.getdataListParm.parammaps.times
  1107. this.pasture.table2.getdataListParm.parammaps.projname = this.pasture.table.getdataListParm.parammaps.projname
  1108. this.pasture.table2.getdataListParm.offset = 1
  1109. this.getTabList2()
  1110. }
  1111. } else {
  1112. if (this.pasture.radio == '1') {
  1113. console.log('配方名称/查询')
  1114. this.pasture.isFormulaName = true
  1115. this.pasture.isHouseName = false
  1116. this.pasture.isLivestockType = false
  1117. this.pasture.isTrainNumber = false
  1118. this.pasture.table.getdataListParm.name = 'getAccuracyHFT'
  1119. this.pasture.table.getdataListParm.offset = 1
  1120. this.getTabList()
  1121. this.pasture.table2.getdataListParm.name = 'getAccuracySFT'
  1122. this.pasture.table2.getdataListParm.parammaps.startTime = this.pasture.table.getdataListParm.parammaps.startTime
  1123. this.pasture.table2.getdataListParm.parammaps.stopTime = this.pasture.table.getdataListParm.parammaps.stopTime
  1124. this.pasture.table2.getdataListParm.offset = 1
  1125. this.getTabList2()
  1126. } else if (this.pasture.radio == '2') {
  1127. console.log('栏舍名称/查询')
  1128. this.pasture.isFormulaName = false
  1129. this.pasture.isHouseName = true
  1130. this.pasture.isLivestockType = false
  1131. this.pasture.isTrainNumber = false
  1132. this.pasture.table.getdataListParm.name = 'getAccuracyHNS'
  1133. this.pasture.table.getdataListParm.offset = 1
  1134. this.getTabList()
  1135. this.pasture.table2.getdataListParm.name = 'getAccuracySNS'
  1136. this.pasture.table2.getdataListParm.parammaps.startTime = this.pasture.table.getdataListParm.parammaps.startTime
  1137. this.pasture.table2.getdataListParm.parammaps.stopTime = this.pasture.table.getdataListParm.parammaps.stopTime
  1138. this.pasture.table2.getdataListParm.offset = 1
  1139. this.getTabList2()
  1140. } else if (this.pasture.radio == '3') {
  1141. console.log(' 牲畜类别/查询')
  1142. this.pasture.isFormulaName = false
  1143. this.pasture.isHouseName = false
  1144. this.pasture.isLivestockType = true
  1145. this.pasture.isTrainNumber = false
  1146. this.pasture.table.getdataListParm.name = 'getAccuracyHSC'
  1147. this.pasture.table.getdataListParm.offset = 1
  1148. this.getTabList()
  1149. this.pasture.table2.getdataListParm.name = 'getAccuracySSC'
  1150. this.pasture.table2.getdataListParm.parammaps.startTime = this.pasture.table.getdataListParm.parammaps.startTime
  1151. this.pasture.table2.getdataListParm.parammaps.stopTime = this.pasture.table.getdataListParm.parammaps.stopTime
  1152. this.pasture.table2.getdataListParm.offset = 1
  1153. this.getTabList2()
  1154. } else if (this.pasture.radio == '4') {
  1155. console.log('车次/查询')
  1156. this.pasture.isFormulaName = false
  1157. this.pasture.isHouseName = false
  1158. this.pasture.isLivestockType = false
  1159. this.pasture.isTrainNumber = true
  1160. this.pasture.table.getdataListParm.name = 'getAccuracyHCC'
  1161. this.pasture.table.getdataListParm.offset = 1
  1162. this.getTabList()
  1163. this.pasture.table2.getdataListParm.name = 'getAccuracySCC'
  1164. this.pasture.table2.getdataListParm.parammaps.startTime = this.pasture.table.getdataListParm.parammaps.startTime
  1165. this.pasture.table2.getdataListParm.parammaps.stopTime = this.pasture.table.getdataListParm.parammaps.stopTime
  1166. this.pasture.table2.getdataListParm.parammaps.fname = this.pasture.table.getdataListParm.parammaps.fname
  1167. this.pasture.table2.getdataListParm.parammaps.times = this.pasture.table.getdataListParm.parammaps.times
  1168. this.pasture.table2.getdataListParm.parammaps.projname = this.pasture.table.getdataListParm.parammaps.projname
  1169. this.pasture.table2.getdataListParm.offset = 1
  1170. this.getTabList2()
  1171. }
  1172. }
  1173. this.pasture.table2.getdataListParm.parammaps.fname = this.pasture.table.getdataListParm.parammaps.fname
  1174. },
  1175. // 汇总统计/混料
  1176. getTabList() {
  1177. this.pasture.table.listLoading = true
  1178. this.pasture.table.getdataListParm.parammaps.startTime = this.table.getdataListParm.parammaps.startTime
  1179. this.pasture.table.getdataListParm.parammaps.stopTime = this.table.getdataListParm.parammaps.stopTime
  1180. GetDataByName(this.pasture.table.getdataListParm).then(response => {
  1181. console.log('汇总统计/混料table数据', response.data.list)
  1182. if (response.data.list !== null) {
  1183. this.pasture.table.list = response.data.list
  1184. } else {
  1185. this.pasture.table.list = []
  1186. }
  1187. setTimeout(() => {
  1188. this.pasture.table.listLoading = false
  1189. }, 100)
  1190. })
  1191. },
  1192. // 汇总统计/撒料
  1193. getTabList2() {
  1194. this.pasture.table2.listLoading = true
  1195. this.pasture.table2.getdataListParm.parammaps.startTime = this.table.getdataListParm.parammaps.startTime
  1196. this.pasture.table2.getdataListParm.parammaps.stopTime = this.table.getdataListParm.parammaps.stopTime
  1197. GetDataByName(this.pasture.table2.getdataListParm).then(response => {
  1198. console.log('汇总统计/撒料table数据', response.data.list)
  1199. if (response.data.list !== null) {
  1200. this.pasture.table2.list = response.data.list
  1201. } else {
  1202. this.pasture.table2.list = []
  1203. }
  1204. setTimeout(() => {
  1205. this.pasture.table2.listLoading = false
  1206. }, 100)
  1207. })
  1208. },
  1209. // 快速跳转到图表
  1210. handleQuickJumpChart() {
  1211. var myHeight = document.getElementById('table').offsetHeight + 120
  1212. window.scrollTo(myHeight, myHeight)
  1213. },
  1214. // 快速回到顶部
  1215. handleQuickJumpTop() {
  1216. window.scrollTo(0, 0)
  1217. },
  1218. // 表总查询
  1219. handleChartDate() {
  1220. console.log('点击了确认时间')
  1221. MessageBox.confirm('是否调整以下所有图表查询时间?', {
  1222. confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
  1223. }).then(() => {
  1224. var that = this
  1225. var startTime = parseTime(this.chartDate[0], '{y}-{m}-{d}')
  1226. var stopTime = parseTime(this.chartDate[1], '{y}-{m}-{d}')
  1227. that.chart1.getdataListParm.parammaps.inputDatetime = this.chartDate
  1228. that.chart1.getdataListParm.parammaps.startTime = startTime
  1229. that.chart1.getdataListParm.parammaps.stopTime = stopTime
  1230. that.getChart1()
  1231. that.chart2.getdataListParm.parammaps.inputDatetime = this.chartDate
  1232. that.chart2.getdataListParm.parammaps.startTime = startTime
  1233. that.chart2.getdataListParm.parammaps.stopTime = stopTime
  1234. that.getChart2()
  1235. that.chart3.getdataListParm.parammaps.inputDatetime = this.chartDate
  1236. that.chart3.getdataListParm.parammaps.startTime = startTime
  1237. that.chart3.getdataListParm.parammaps.stopTime = stopTime
  1238. that.getChart3()
  1239. that.chart4.getdataListParm.parammaps.inputDatetime = this.chartDate
  1240. that.chart4.getdataListParm.parammaps.startTime = startTime
  1241. that.chart4.getdataListParm.parammaps.stopTime = stopTime
  1242. that.getChart4()
  1243. that.chart5.getdataListParm.parammaps.inputDatetime = this.chartDate
  1244. that.chart5.getdataListParm.parammaps.startTime = startTime
  1245. that.chart5.getdataListParm.parammaps.stopTime = stopTime
  1246. that.getChart5()
  1247. that.chart6.getdataListParm.parammaps.inputDatetime = this.chartDate
  1248. that.chart6.getdataListParm.parammaps.startTime = startTime
  1249. that.chart6.getdataListParm.parammaps.stopTime = stopTime
  1250. that.getChart6()
  1251. })
  1252. },
  1253. // 计划统计
  1254. getChart1() {
  1255. this.chart1.listLoading = true
  1256. console.log(this.chart1.getdataListParm.name, '计划统计接口')
  1257. GetReportform(this.chart1.getdataListParm).then(response => {
  1258. if (response.data !== null && response.data.list !== null) {
  1259. this.chart1.table.list = response.data.data
  1260. this.chart1.total = response.data.total
  1261. this.chart1.chartLine_data = response.data.list
  1262. console.log('计划统计图数据', this.chart1.chartLine_data)
  1263. console.log('计划统计表数据', this.chart1.table.list)
  1264. this.roadChartLine1(this.chart1.chartLine_data)
  1265. } else {
  1266. this.chart1.list = []
  1267. this.chart1.chartLine_data = {}
  1268. this.roadChartLine1(this.chart1.chartLine_data)
  1269. }
  1270. setTimeout(() => {
  1271. this.chart1.listLoading = false
  1272. }, 100)
  1273. })
  1274. },
  1275. roadChartLine1(chartLine_data) {
  1276. if (this.chart1.chartLine != null) {
  1277. this.chart1.chartLine.dispose()
  1278. }
  1279. this.chart1.chartLine = echarts.init(document.getElementById('chartLine1'))
  1280. var option = {
  1281. tooltip: { trigger: 'axis', axisPointer: { type: 'cross', crossStyle: { color: '#999' }}},
  1282. legend: { data: ['计划准确率', '计划正确率', '计划准确率(去除取消重量)'] },
  1283. xAxis: [{ type: 'category', data: chartLine_data.data1, axisPointer: { type: 'shadow' }}],
  1284. yAxis: [{ type: 'value', name: '百分比', min: 0, max: 100, interval: 20, axisLabel: { formatter: '{value}' }}],
  1285. series: [
  1286. { 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 }}},
  1287. { 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 }}},
  1288. { 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 }}}
  1289. ]
  1290. }
  1291. this.chart1.chartLine.setOption(option)
  1292. window.onresize = function() {
  1293. this.chart1.chartLine.resize()
  1294. }
  1295. },
  1296. // 牛群准确率
  1297. getChart2() {
  1298. this.chart2.listLoading = true
  1299. GetReportform(this.chart2.getdataListParm).then(response => {
  1300. console.log('牛群准确率图数据', this.chart2.chartLine_data)
  1301. if (response.data.list !== null) {
  1302. // for (let i = 0; i < response.data.data.length; i++) {
  1303. // response.data.data[i].准确率 = response.data.data[i].准确率 + '%'
  1304. // }
  1305. this.chart2.table.list = response.data.data
  1306. this.chart2.chartLine_data = response.data.list
  1307. this.chart2.total = response.data.total
  1308. this.chart2.chart3Data3 = response.data.list.data3
  1309. this.chart2.total = response.data.total
  1310. console.log('牛群准确率图数据', this.chart2.chartLine_data)
  1311. console.log('牛群准确率表数据', this.chart2.table.list)
  1312. this.roadChartLine2(this.chart2.chartLine_data)
  1313. } else {
  1314. this.chart2.list = []
  1315. this.chart2.chartLine_data = {}
  1316. this.roadChartLine2(this.chart2.chartLine_data)
  1317. }
  1318. setTimeout(() => {
  1319. this.chart2.listLoading = false
  1320. }, 100)
  1321. })
  1322. },
  1323. roadChartLine2(chartLine_data) {
  1324. if (this.chart2.chartLine != null) {
  1325. this.chart2.chartLine.dispose()
  1326. }
  1327. this.chart2.chartLine = echarts.init(document.getElementById('chartLine2'))
  1328. var option = {
  1329. tooltip: {
  1330. trigger: 'axis',
  1331. axisPointer: {
  1332. type: 'cross',
  1333. crossStyle: {
  1334. color: '#999'
  1335. }
  1336. }
  1337. },
  1338. legend: {
  1339. data: ['泌乳牛', '后备牛', '干奶牛', '围产牛']
  1340. },
  1341. xAxis: [{ type: 'category', data: chartLine_data.data1, axisPointer: { type: 'shadow' }}],
  1342. yAxis: [{ type: 'value', name: '准确率', min: 0, max: 100, interval: 20, axisLabel: { formatter: '{value}%' }}],
  1343. series: [{ name: '泌乳牛', type: 'bar', itemStyle: { normal: { color: '#7ecf51' }},
  1344. data: chartLine_data.data2,
  1345. markLine: {
  1346. data: [{ type: 'average' }],
  1347. symbol: ['none', 'none'],
  1348. position: 'insideTopCenter',
  1349. itemStyle: {
  1350. normal: {
  1351. lineStyle: { type: 'dotted', width: 3 },
  1352. label: { show: true, position: 'middle', formatter: '' }
  1353. }
  1354. },
  1355. large: true,
  1356. effect: { show: false, loop: true, period: 0, scaleSize: 2, color: null, shadowColor: null, shadowBlur: null }
  1357. }
  1358. },
  1359. {
  1360. name: '后备牛',
  1361. type: 'bar',
  1362. itemStyle: {
  1363. normal: {
  1364. color: '#ff6600'
  1365. }
  1366. },
  1367. data: chartLine_data.data3,
  1368. markLine: {
  1369. data: [{ type: 'average' }],
  1370. symbol: ['none', 'none'],
  1371. position: 'insideTopCenter',
  1372. itemStyle: {
  1373. normal: {
  1374. lineStyle: { type: 'dotted', width: 3 },
  1375. label: { show: true, position: 'middle', formatter: '' }
  1376. }
  1377. },
  1378. large: true,
  1379. effect: { show: false, loop: true, period: 0, scaleSize: 2, color: null, shadowColor: null, shadowBlur: null }
  1380. }
  1381. },
  1382. {
  1383. name: '干奶牛',
  1384. type: 'bar',
  1385. itemStyle: {
  1386. normal: {
  1387. color: '#61a5e8'
  1388. }
  1389. },
  1390. data: chartLine_data.data4,
  1391. markLine: {
  1392. data: [{ type: 'average' }],
  1393. symbol: ['none', 'none'],
  1394. position: 'insideTopCenter',
  1395. itemStyle: {
  1396. normal: {
  1397. lineStyle: { type: 'dotted', width: 3 },
  1398. label: { show: true, position: 'middle', formatter: '' }
  1399. }
  1400. },
  1401. large: true,
  1402. effect: { show: false, loop: true, period: 0, scaleSize: 2, color: null, shadowColor: null, shadowBlur: null }
  1403. }
  1404. },
  1405. {
  1406. name: '围产牛',
  1407. type: 'bar',
  1408. itemStyle: {
  1409. normal: {
  1410. color: '#ffff00'
  1411. }
  1412. },
  1413. data: chartLine_data.data5,
  1414. markLine: {
  1415. data: [{ type: 'average' }],
  1416. symbol: ['none', 'none'],
  1417. position: 'insideTopCenter',
  1418. itemStyle: {
  1419. normal: {
  1420. lineStyle: { type: 'dotted', width: 3 },
  1421. label: { show: true, position: 'middle', formatter: '' }
  1422. }
  1423. },
  1424. large: true,
  1425. effect: { show: false, loop: true, period: 0, scaleSize: 2, color: null, shadowColor: null, shadowBlur: null }
  1426. }
  1427. }
  1428. ]
  1429. }
  1430. this.chart2.chartLine.setOption(option)
  1431. window.onresize = function() {
  1432. this.chart2.chartLine.resize()
  1433. }
  1434. },
  1435. // 混料次数统计
  1436. getChart3() {
  1437. this.chart3.listLoading = true
  1438. GetReportform(this.chart3.getdataListParm).then(response => {
  1439. if (response.data !== null && response.data.list !== null) {
  1440. // for (let i = 0; i < response.data.data.length; i++) {
  1441. // response.data.data[i].准确率 = response.data.data[i].准确率 + '%'
  1442. // }
  1443. this.chart3.table.list = response.data.data
  1444. this.chart3.chartLine_data = response.data.list
  1445. this.chart3.total = response.data.total
  1446. this.chart3.total = response.data.total
  1447. console.log('混料次数统计图', this.chart3.chartLine_data)
  1448. console.log('混料次数统计表', this.chart3.table.list)
  1449. this.roadChartLine3(this.chart3.chartLine_data)
  1450. } else {
  1451. this.chart3.list = []
  1452. this.chart3.chartLine_data = {}
  1453. this.roadChartLine3(this.chart3.chartLine_data)
  1454. }
  1455. setTimeout(() => {
  1456. this.chart3.listLoading = false
  1457. }, 100)
  1458. })
  1459. },
  1460. roadChartLine3(chartLine_data) {
  1461. if (this.chart3.chartLine != null) {
  1462. this.chart3.chartLine.dispose()
  1463. }
  1464. this.chart3.chartLine = echarts.init(document.getElementById('chartLine3'))
  1465. var option = {
  1466. tooltip: {
  1467. trigger: 'axis',
  1468. axisPointer: {
  1469. type: 'cross',
  1470. crossStyle: {
  1471. color: '#999'
  1472. }
  1473. }
  1474. },
  1475. legend: {
  1476. data: ['自动跳转', '手动跳转', '取消次数']
  1477. },
  1478. xAxis: [{ type: 'category', data: chartLine_data.data1, axisPointer: { type: 'shadow' }}],
  1479. yAxis: [{ type: 'value', name: '次数', min: 0, max: 100, interval: 20, axisLabel: { formatter: '{value}' }}],
  1480. series: [{ name: '自动跳转', type: 'bar', itemStyle: { normal: { color: '#7ecf51' }},
  1481. data: chartLine_data.data2,
  1482. markLine: {
  1483. data: [{ type: 'average' }],
  1484. symbol: ['none', 'none'],
  1485. position: 'insideTopCenter',
  1486. itemStyle: {
  1487. normal: {
  1488. lineStyle: { type: 'dotted', width: 3 },
  1489. label: { show: true, position: 'middle', formatter: '' }
  1490. }
  1491. },
  1492. large: true,
  1493. effect: { show: false, loop: true, period: 0, scaleSize: 2, color: null, shadowColor: null, shadowBlur: null }
  1494. }
  1495. },
  1496. {
  1497. name: '手动跳转',
  1498. type: 'bar',
  1499. itemStyle: {
  1500. normal: {
  1501. color: '#ff6600'
  1502. }
  1503. },
  1504. data: chartLine_data.data3,
  1505. markLine: {
  1506. data: [{ type: 'average' }],
  1507. symbol: ['none', 'none'],
  1508. position: 'insideTopCenter',
  1509. itemStyle: {
  1510. normal: {
  1511. lineStyle: { type: 'dotted', width: 3 },
  1512. label: { show: true, position: 'middle', formatter: '' }
  1513. }
  1514. },
  1515. large: true,
  1516. effect: { show: false, loop: true, period: 0, scaleSize: 2, color: null, shadowColor: null, shadowBlur: null }
  1517. }
  1518. }]
  1519. }
  1520. this.chart3.chartLine.setOption(option)
  1521. window.onresize = function() {
  1522. this.chart3.chartLine.resize()
  1523. }
  1524. },
  1525. // 混料准确率统计
  1526. getChart4() {
  1527. this.chart4.listLoading = true
  1528. GetReportform(this.chart4.getdataListParm).then(response => {
  1529. if (response.data !== null && response.data.list !== null) {
  1530. // for (let i = 0; i < response.data.data.length; i++) {
  1531. // response.data.data[i].准确率 = response.data.data[i].准确率 + '%'
  1532. // }
  1533. this.chart4.table.list = response.data.data
  1534. this.chart4.chartLine_data = response.data.list
  1535. // this.chart4.chartLine_data = {
  1536. // 'data1': ['1牧', '2牧', '3牧', '4牧', '5牧', '6牧', '7牧', '8牧', '9牧', '10牧', '11牧', '12牧'], // x轴
  1537. // '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], // 自动跳转准确率
  1538. // 'data3': [2.6, 5.9, 9.0, 30, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3] // 手动跳转准确率
  1539. // }
  1540. this.chart4.total = response.data.total
  1541. console.log('混料准确率统计图', this.chart4.chartLine_data)
  1542. console.log('混料准确率统计表', this.chart4.table.list)
  1543. this.roadChartLine4(this.chart4.chartLine_data)
  1544. } else {
  1545. this.chart4.list = []
  1546. this.chart4.chartLine_data = {}
  1547. this.roadChartLine4(this.chart4.chartLine_data)
  1548. }
  1549. setTimeout(() => {
  1550. this.chart4.listLoading = false
  1551. }, 100)
  1552. })
  1553. },
  1554. roadChartLine4(chartLine_data) {
  1555. if (this.chart4.chartLine != null) {
  1556. this.chart4.chartLine.dispose()
  1557. }
  1558. this.chart4.chartLine = echarts.init(document.getElementById('chartLine4'))
  1559. var option = {
  1560. tooltip: {
  1561. trigger: 'axis',
  1562. axisPointer: {
  1563. type: 'cross',
  1564. crossStyle: {
  1565. color: '#999'
  1566. }
  1567. }
  1568. },
  1569. legend: {
  1570. data: ['自动跳转准确率', '手动跳转准确率']
  1571. },
  1572. xAxis: [{ type: 'category', data: chartLine_data.data1, axisPointer: { type: 'shadow' }}],
  1573. yAxis: [{ type: 'value', name: '混料准确率', min: 0, max: 100, interval: 20, axisLabel: { formatter: '{value}%' }}],
  1574. series: [{ name: '自动跳转准确率', type: 'bar', itemStyle: { normal: { color: '#7ecf51' }},
  1575. data: chartLine_data.data2,
  1576. markLine: {
  1577. data: [{ type: 'average' }],
  1578. symbol: ['none', 'none'],
  1579. position: 'insideTopCenter',
  1580. itemStyle: {
  1581. normal: {
  1582. lineStyle: { type: 'dotted', width: 3 },
  1583. label: { show: true, position: 'middle', formatter: '' }
  1584. }
  1585. },
  1586. large: true,
  1587. effect: { show: false, loop: true, period: 0, scaleSize: 2, color: null, shadowColor: null, shadowBlur: null }
  1588. }
  1589. },
  1590. {
  1591. name: '手动跳转准确率',
  1592. type: 'bar',
  1593. itemStyle: {
  1594. normal: {
  1595. color: '#ff6600'
  1596. }
  1597. },
  1598. data: chartLine_data.data3,
  1599. markLine: {
  1600. data: [{ type: 'average' }],
  1601. symbol: ['none', 'none'],
  1602. position: 'insideTopCenter',
  1603. itemStyle: {
  1604. normal: {
  1605. lineStyle: { type: 'dotted', width: 3 },
  1606. label: { show: true, position: 'middle', formatter: '' }
  1607. }
  1608. },
  1609. large: true,
  1610. effect: { show: false, loop: true, period: 0, scaleSize: 2, color: null, shadowColor: null, shadowBlur: null }
  1611. }
  1612. }]
  1613. }
  1614. this.chart4.chartLine.setOption(option)
  1615. window.onresize = function() {
  1616. this.chart4.chartLine.resize()
  1617. }
  1618. },
  1619. // 栏舍平均撒料时间统计
  1620. getChart5() {
  1621. this.chart5.listLoading = true
  1622. GetReportform(this.chart5.getdataListParm).then(response => {
  1623. if (response.data !== null && response.data.list !== null) {
  1624. this.chart5.table.list = response.data.data
  1625. this.chart5.chartLine_data = response.data.list
  1626. this.chart5.total = response.data.total
  1627. console.log('栏舍平均撒料时间统计图', this.chart5.chartLine_data)
  1628. console.log('栏舍平均撒料时间统计表', this.chart5.table.list)
  1629. this.roadChartLine5(this.chart5.chartLine_data)
  1630. } else {
  1631. this.chart5.list = []
  1632. this.chart5.chartLine_data = {}
  1633. this.roadChartLine5(this.chart5.chartLine_data)
  1634. }
  1635. setTimeout(() => {
  1636. this.chart5.listLoading = false
  1637. }, 100)
  1638. })
  1639. },
  1640. roadChartLine5(chartLine_data) {
  1641. if (this.chart5.chartLine != null) {
  1642. this.chart5.chartLine.dispose()
  1643. }
  1644. this.chart5.chartLine = echarts.init(document.getElementById('chartLine5'))
  1645. var option = {
  1646. title: {
  1647. text: ''
  1648. },
  1649. tooltip: {
  1650. trigger: 'axis',
  1651. formatter: function(params) {
  1652. // console.log(params)
  1653. if (params.length > 0) {
  1654. var tip = params[0].name
  1655. for (let i = 0; i < params.length; i++) {
  1656. var b = []
  1657. // var str = params[i].value
  1658. for (let j = 0; j <= params[i].value.length; j++) {
  1659. if (params[i].value !== '') {
  1660. if (params[i].value.charAt(j) == '.') {
  1661. b[j] = params[i].value.replace('.', ':')
  1662. }
  1663. } else {
  1664. b[j] = ''
  1665. }
  1666. }
  1667. tip += '<br>' + params[i].seriesName + ': ' + b[b.length - 1]
  1668. }
  1669. return tip
  1670. }
  1671. }
  1672. },
  1673. legend: {
  1674. data: chartLine_data.data1,
  1675. right: 10
  1676. },
  1677. grid: {
  1678. top: '20%',
  1679. left: '5%',
  1680. right: '8%',
  1681. containLabel: true
  1682. },
  1683. toolbox: {
  1684. show: true,
  1685. right: '2%',
  1686. feature: {}
  1687. },
  1688. xAxis: { type: 'category', boundaryGap: false, data: chartLine_data.data2, name: '日期' },
  1689. yAxis: [{
  1690. type: '',
  1691. name: '时间',
  1692. mix: 0,
  1693. max: 24,
  1694. interval: 2,
  1695. axisLabel: {
  1696. formatter: function(value) {
  1697. var texts = []
  1698. if (value < 10) {
  1699. texts.push('0' + value + ':00')
  1700. } else {
  1701. texts.push(value + ':00')
  1702. }
  1703. return texts
  1704. }
  1705. }
  1706. }],
  1707. series: (function() {
  1708. if (chartLine_data.data3 !== undefined) {
  1709. var serie = []
  1710. for (var i = 0; i < chartLine_data.data3.length; i++) {
  1711. var item = {
  1712. name: chartLine_data.data1[i],
  1713. type: 'line',
  1714. data: chartLine_data.data3[i].data
  1715. }
  1716. serie.push(item)
  1717. }
  1718. return serie
  1719. }
  1720. }())
  1721. }
  1722. this.chart5.chartLine.setOption(option)
  1723. window.onresize = function() {
  1724. this.chart5.chartLine.resize()
  1725. }
  1726. },
  1727. // 混料计划取消次数
  1728. getChart6() {
  1729. this.chart6.listLoading = true
  1730. GetReportform(this.chart6.getdataListParm).then(response => {
  1731. if (response.data !== null && response.data.list !== null) {
  1732. // for (let i = 0; i < response.data.data.length; i++) {
  1733. // response.data.data[i].准确率 = response.data.data[i].准确率 + '%'
  1734. // }
  1735. this.chart6.table.list = response.data.data
  1736. this.chart6.chartLine_data = response.data.list
  1737. // this.chart6.chartLine_data = {
  1738. // 'data1': ['1牧', '2牧', '3牧', '4牧', '5牧', '6牧', '7牧', '8牧', '9牧', '10牧', '11牧', '12牧'], // x轴
  1739. // '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], // 自动跳转准确率
  1740. // 'data3': [2.6, 5.9, 9.0, 30, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3] // 手动跳转准确率
  1741. // }
  1742. this.chart6.total = response.data.total
  1743. console.log('混料计划取消次数图', this.chart6.chartLine_data)
  1744. console.log('混料计划取消次数表', this.chart6.table.list)
  1745. this.roadChartLine6(this.chart6.chartLine_data)
  1746. } else {
  1747. this.chart6.list = []
  1748. this.chart6.chartLine_data = {}
  1749. this.roadChartLine6(this.chart6.chartLine_data)
  1750. }
  1751. setTimeout(() => {
  1752. this.chart6.listLoading = false
  1753. }, 100)
  1754. })
  1755. },
  1756. roadChartLine6(chartLine_data) {
  1757. if (this.chart6.chartLine != null) {
  1758. this.chart6.chartLine.dispose()
  1759. }
  1760. this.chart6.chartLine = echarts.init(document.getElementById('chartLine6'))
  1761. var option = {
  1762. tooltip: {
  1763. trigger: 'axis',
  1764. axisPointer: {
  1765. type: 'cross',
  1766. crossStyle: {
  1767. color: '#999'
  1768. }
  1769. }
  1770. },
  1771. legend: {
  1772. data: ['混料计划取消次数']
  1773. },
  1774. xAxis: [{ type: 'category', data: chartLine_data.data1, axisPointer: { type: 'shadow' }}],
  1775. yAxis: [{ type: 'value', name: '次数', min: 0, max: 100, interval: 20, axisLabel: { formatter: '{value}%' }}],
  1776. series: [{ name: '混料计划取消次数', type: 'bar', itemStyle: { normal: { color: '#7ecf51' }},
  1777. data: chartLine_data.data2,
  1778. markLine: {
  1779. data: [{ type: 'average' }],
  1780. symbol: ['none', 'none'],
  1781. position: 'insideTopCenter',
  1782. itemStyle: {
  1783. normal: {
  1784. lineStyle: { type: 'dotted', width: 3 },
  1785. label: { show: true, position: 'middle', formatter: '' }
  1786. }
  1787. },
  1788. large: true,
  1789. effect: { show: false, loop: true, period: 0, scaleSize: 2, color: null, shadowColor: null, shadowBlur: null }
  1790. }
  1791. }]
  1792. }
  1793. this.chart6.chartLine.setOption(option)
  1794. window.onresize = function() {
  1795. this.chart6.chartLine.resize()
  1796. }
  1797. },
  1798. handleDownload() {
  1799. var excelDatas = [
  1800. {
  1801. tHeader: ['配方名称', '理论重量', '实际重量', '计划混料操作数', '已混料操作数', '混料操作率', '混料误差值', '混料准确率', '混料自动跳转次数', '混料手动跳转次数', '取消次数', '混料正确数', '混料正确率', '去除取消正确率', '标准差'],
  1802. filterVal: ['配方名称', '理论重量', '实际重量', '计划混料操作数', '已混料操作数', '混料操作率', '混料误差值', '混料准确率', '混料自动跳转次数', '混料手动跳转次数', '取消次数', '混料正确数', '混料正确率', '去除取消正确率', '方差'],
  1803. tableDatas: this.table.list,
  1804. sheetName: '混料'
  1805. },
  1806. {
  1807. tHeader: ['配方名称', '理论重量', '实际重量', '计划撒料操作数', '已撒料操作数', '撒料操作率', '撒料误差值', '撒料准确率', '撒料自动跳转次数', '撒料手动跳转次数', '撒料正确数', '撒料正确率', '去除取消正确率', '标准差'],
  1808. filterVal: ['配方名称', '理论重量', '实际重量', '计划撒料操作数', '已撒料操作数', '撒料操作率', '撒料误差值', '撒料准确率', '撒料自动跳转次数', '撒料手动跳转次数', '撒料正确数', '撒料正确率', '去除取消正确率', '方差'],
  1809. tableDatas: this.table2.list,
  1810. sheetName: '撒料'
  1811. }
  1812. ]
  1813. json2excel(excelDatas, '汇总统计-配方名称', true, 'xlsx')
  1814. },
  1815. // 时间
  1816. changeChartDate(item) {
  1817. console.log(item)
  1818. if (item == 'chart1') {
  1819. if (this.chart1.getdataListParm.parammaps.inputDatetime !== '' && this.chart1.getdataListParm.parammaps.inputDatetime !== null) {
  1820. this.chart1.getdataListParm.parammaps.startTime = parseTime(this.chart1.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  1821. this.chart1.getdataListParm.parammaps.stopTime = parseTime(this.chart1.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  1822. this.getChart1()
  1823. } else {
  1824. this.chart1.getdataListParm.parammaps.inputDatetime = ''
  1825. this.chart1.getdataListParm.parammaps.startTime = ''
  1826. this.chart1.getdataListParm.parammaps.stopTime = ''
  1827. this.getChart1()
  1828. }
  1829. } else if (item == 'chart2') {
  1830. if (this.chart2.getdataListParm.parammaps.inputDatetime !== '' && this.chart2.getdataListParm.parammaps.inputDatetime !== null) {
  1831. this.chart2.getdataListParm.parammaps.startTime = parseTime(this.chart2.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  1832. this.chart2.getdataListParm.parammaps.stopTime = parseTime(this.chart2.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  1833. this.getChart2()
  1834. } else {
  1835. this.chart2.getdataListParm.parammaps.inputDatetime = ''
  1836. this.chart2.getdataListParm.parammaps.startTime = ''
  1837. this.chart2.getdataListParm.parammaps.stopTime = ''
  1838. this.getChart2()
  1839. }
  1840. } else if (item == 'chart3') {
  1841. if (this.chart3.getdataListParm.parammaps.inputDatetime !== '' && this.chart3.getdataListParm.parammaps.inputDatetime !== null) {
  1842. this.chart3.getdataListParm.parammaps.startTime = parseTime(this.chart3.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  1843. this.chart3.getdataListParm.parammaps.stopTime = parseTime(this.chart3.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  1844. this.getChart3()
  1845. } else {
  1846. this.chart3.getdataListParm.parammaps.inputDatetime = ''
  1847. this.chart3.getdataListParm.parammaps.startTime = ''
  1848. this.chart3.getdataListParm.parammaps.stopTime = ''
  1849. this.getChart3()
  1850. }
  1851. } else if (item == 'chart4') {
  1852. if (this.chart4.getdataListParm.parammaps.inputDatetime !== '' && this.chart4.getdataListParm.parammaps.inputDatetime !== null) {
  1853. this.chart4.getdataListParm.parammaps.startTime = parseTime(this.chart4.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  1854. this.chart4.getdataListParm.parammaps.stopTime = parseTime(this.chart4.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  1855. this.getChart4()
  1856. } else {
  1857. this.chart4.getdataListParm.parammaps.inputDatetime = ''
  1858. this.chart4.getdataListParm.parammaps.startTime = ''
  1859. this.chart4.getdataListParm.parammaps.stopTime = ''
  1860. this.getChart4()
  1861. }
  1862. } else if (item == 'chart5') {
  1863. if (this.chart5.getdataListParm.parammaps.inputDatetime !== '' && this.chart5.getdataListParm.parammaps.inputDatetime !== null) {
  1864. this.chart5.getdataListParm.parammaps.startTime = parseTime(this.chart5.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  1865. this.chart5.getdataListParm.parammaps.stopTime = parseTime(this.chart5.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  1866. this.getChart5()
  1867. } else {
  1868. this.chart5.getdataListParm.parammaps.inputDatetime = ''
  1869. this.chart5.getdataListParm.parammaps.startTime = ''
  1870. this.chart5.getdataListParm.parammaps.stopTime = ''
  1871. this.getChart5()
  1872. }
  1873. } else if (item == 'chart6') {
  1874. if (this.chart6.getdataListParm.parammaps.inputDatetime !== '' && this.chart6.getdataListParm.parammaps.inputDatetime !== null) {
  1875. this.chart6.getdataListParm.parammaps.startTime = parseTime(this.chart6.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  1876. this.chart6.getdataListParm.parammaps.stopTime = parseTime(this.chart6.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  1877. this.getChart6()
  1878. } else {
  1879. this.chart6.getdataListParm.parammaps.inputDatetime = ''
  1880. this.chart6.getdataListParm.parammaps.startTime = ''
  1881. this.chart6.getdataListParm.parammaps.stopTime = ''
  1882. this.getChart6()
  1883. }
  1884. }
  1885. },
  1886. handleExport(item) {
  1887. if (item == 'chart1') {
  1888. console.log('配方准确率导出')
  1889. var excelDatasTabChart1 = [
  1890. {
  1891. tHeader: ['日期', '配方名称', '计划重量(kg)', '实际重量(kg)', '准确率'],
  1892. filterVal: ['日期', '名称', '理论量', '实际量', '准确率'],
  1893. tableDatas: this.chart1.table.list,
  1894. sheetName: '配方准确率'
  1895. }
  1896. ]
  1897. json2excel(excelDatasTabChart1, '配方准确率', true, 'xlsx')
  1898. } else if (item == 'chart2') {
  1899. console.log('计划统计导出')
  1900. var excelDatasTabChart2 = [
  1901. {
  1902. tHeader: ['日期', '计划执行重量(kg)', '配方理论重量(kg)', '计划准确率', '计划取消重量(kg)', '计划准确率(去除取消重量)', '计划正确数', '计划数', '计划正确率'],
  1903. filterVal: ['日期', '实际量', '理论量', 'field1', '计划取消重量', 'field3', '正确数', '计划数', 'field2'],
  1904. tableDatas: this.chart2.table.list,
  1905. sheetName: '计划统计'
  1906. }
  1907. ]
  1908. json2excel(excelDatasTabChart2, '计划统计', true, 'xlsx')
  1909. } else if (item == 'chart3') {
  1910. console.log('牛群准确率导出')
  1911. var excelDatasTabChart3 = [
  1912. {
  1913. tHeader: ['日期', '牲畜类别', '计划重量(kg)', '实际重量(kg)', '准确率'],
  1914. filterVal: ['日期', '名称', '理论量', '实际量', '准确率'],
  1915. tableDatas: this.chart3.table.list,
  1916. sheetName: '牛群准确率'
  1917. }
  1918. ]
  1919. json2excel(excelDatasTabChart3, '牛群准确率', true, 'xlsx')
  1920. } else if (item == 'chart4') {
  1921. console.log('车辆准确率(重量)导出')
  1922. var excelDatasTabChart4 = [
  1923. {
  1924. tHeader: ['日期', '车次', '计划重量(kg)', '实际重量(kg)', '准确率'],
  1925. filterVal: ['日期', '名称', '理论量', '实际量', '准确率'],
  1926. tableDatas: this.chart4.table.list,
  1927. sheetName: '车辆准确率(重量)'
  1928. }
  1929. ]
  1930. json2excel(excelDatasTabChart4, '车辆准确率(重量)', true, 'xlsx')
  1931. } else if (item == 'chart5') {
  1932. console.log('混料统计导出')
  1933. var excelDatasTabChart5 = [
  1934. {
  1935. tHeader: ['日期', '自动跳转次数', '手动跳转次数', '自动跳转理论重量', '自动跳转实际重量', '自动跳转准确率', '手动跳转理论重量', '手动跳转实际重量', '手动跳转准确率'],
  1936. filterVal: ['日期', 'field1', 'field2', '理论自动', '实际自动', 'field3', '理论手动', '实际手动', 'field4'],
  1937. tableDatas: this.chart5.table.list,
  1938. sheetName: '混料统计'
  1939. }
  1940. ]
  1941. json2excel(excelDatasTabChart5, '混料统计', true, 'xlsx')
  1942. } else if (item == 'chart6') {
  1943. console.log('混料计划取消次数导出')
  1944. var excelDatasTabChart5 = [
  1945. {
  1946. tHeader: ['日期', '自动跳转次数', '手动跳转次数', '自动跳转理论重量', '自动跳转实际重量', '自动跳转准确率', '手动跳转理论重量', '手动跳转实际重量', '手动跳转准确率'],
  1947. filterVal: ['日期', 'field1', 'field2', '理论自动', '实际自动', 'field3', '理论手动', '实际手动', 'field4'],
  1948. tableDatas: this.chart5.table.list,
  1949. sheetName: '混料计划取消次数'
  1950. }
  1951. ]
  1952. json2excel(excelDatasTabChart5, '混料计划取消次数', true, 'xlsx')
  1953. }
  1954. },
  1955. handleTable(item) {
  1956. // 显示切换表格
  1957. if (item == 'chart1') {
  1958. console.log('配方准确率表格')
  1959. this.chart1.isTable = true
  1960. this.chart1.isChart = false
  1961. } else if (item == 'chart2') {
  1962. console.log('计划统计表格')
  1963. this.chart2.isTable = true
  1964. this.chart2.isChart = false
  1965. } else if (item == 'chart3') {
  1966. console.log('牛群准确率表格')
  1967. this.chart3.isTable = true
  1968. this.chart3.isChart = false
  1969. } else if (item == 'chart4') {
  1970. console.log('车辆准确率(重量)表格')
  1971. this.chart4.isTable = true
  1972. this.chart4.isChart = false
  1973. } else if (item == 'chart5') {
  1974. console.log('混料统计表格')
  1975. this.chart5.isTable = true
  1976. this.chart5.isChart = false
  1977. } else if (item == 'chart6') {
  1978. console.log('混料计划取消次数表格')
  1979. this.chart6.isTable = true
  1980. this.chart6.isChart = false
  1981. } else if (item == 'chart7') {
  1982. console.log('栏舍撒料时间统计表格')
  1983. this.chart7.isTable = true
  1984. this.chart7.isChart = false
  1985. }
  1986. },
  1987. // 切换图表
  1988. handleChart(item) {
  1989. // 显示切换图表
  1990. if (item == 'chart1') {
  1991. console.log('配方准确率图表')
  1992. this.chart1.isTable = false
  1993. this.chart1.isChart = true
  1994. this.getChart1()
  1995. } else if (item == 'chart2') {
  1996. console.log('计划统计图表')
  1997. this.chart2.isTable = false
  1998. this.chart2.isChart = true
  1999. this.getChart2()
  2000. } else if (item == 'chart3') {
  2001. console.log('牛群准确率图表')
  2002. this.chart3.isTable = false
  2003. this.chart3.isChart = true
  2004. this.getChart3()
  2005. } else if (item == 'chart4') {
  2006. console.log('车辆准确率(重量)图表')
  2007. this.chart4.isTable = false
  2008. this.chart4.isChart = true
  2009. this.getChart4()
  2010. } else if (item == 'chart5') {
  2011. console.log('混料统计图表')
  2012. this.chart5.isTable = false
  2013. this.chart5.isChart = true
  2014. this.getChart5()
  2015. } else if (item == 'chart6') {
  2016. console.log('混料计划取消次数图表')
  2017. this.chart6.isTable = false
  2018. this.chart6.isChart = true
  2019. this.getChart6()
  2020. } else if (item == 'chart7') {
  2021. console.log('栏舍撒料时间统计图表')
  2022. this.chart7.isTable = false
  2023. this.chart7.isChart = true
  2024. this.getChart7()
  2025. }
  2026. }
  2027. }
  2028. }
  2029. </script>
  2030. <style lang="scss" scoped>
  2031. .button{
  2032. height: 50px;
  2033. .exportTable{float: right;margin-right: 5px;}
  2034. }
  2035. .app-container1{padding-left: 10px;background-color: #F4F4F4;}
  2036. .dashboard-editor-container {
  2037. background-color: #F4F4F4;
  2038. .grid-content{
  2039. background-color:#fff;padding: 0 10px;
  2040. h4{text-align: center;line-height: 50px;}
  2041. }
  2042. }
  2043. .table{margin-bottom: 50px;}
  2044. </style>