039db10b049800cc266da1476e49bed06e1bcc37.svn-base 55 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555
  1. <template>
  2. <div class="dashboard-editor-container">
  3. <div style="background: #F4F4F4;height: 10px;" />
  4. <div v-if="news==1" style="display:none;" class="news"><b>消息提醒:</b>撒料计划未分配完善,请及时进行计划分配</div>
  5. <div v-if="news==2" style="display:none;" class="news"><b>消息提醒:</b>预混计划未分配完善,请及时进行计划分配</div>
  6. <div v-if="news==3" style="display:none;" class="news"><b>消息提醒:</b>剩料计划未分配完善,请及时进行计划分配</div>
  7. <div class="bottom">
  8. <!-- <h4>{{ date }}</h4> -->
  9. <el-row :gutter="20" style="margin-top: 10px;">
  10. <el-col :span="6">
  11. <div class="grid-content one">
  12. <div class="Left">
  13. <i class="iconfont icon-shuaxin" />
  14. </div>
  15. <div class="Right">
  16. <span>昨日混料准确率:</span>{{ row1.list.yesRateHL }}<br>
  17. <span>近30天混料准确率:</span>{{ row1.list.monRateHL }}
  18. </div>
  19. </div>
  20. </el-col>
  21. <el-col :span="6">
  22. <div class="grid-content two">
  23. <div class="Left">
  24. <i class="iconfont icon-zhunqueshuai2" />
  25. </div>
  26. <div class="Right">
  27. <span>昨日撒料准确率:</span>{{ row1.list.yesRateSL }}<br>
  28. <span>近30天撒料准确率:</span>{{ row1.list.monRateSL }}
  29. </div>
  30. </div>
  31. </el-col>
  32. <el-col :span="6">
  33. <div class="grid-content three">
  34. <div class="Left">
  35. <i class="iconfont icon-zhinengsiwei" style="font-size: 40px;" />
  36. </div>
  37. <div class="Right">
  38. <span>昨日撒料正确率:</span>{{ row1.list.yesRateSLR }}<br>
  39. <span>近30天撒料正确率:</span>{{ row1.list.monRateSLR }}
  40. </div>
  41. </div>
  42. </el-col>
  43. <el-col :span="6">
  44. <div class="grid-content four">
  45. <div class="Left">
  46. <i class="iconfont icon-siliaotoufangjilu" style="font-size: 50px;" />
  47. </div>
  48. <div class="Right">
  49. <span style="width:116px;">昨日撒料偏差:</span>{{ row1.list.temtime }} min<br>
  50. <span style="width:116px;">近30天撒料偏差:</span>{{ row1.list.montime }} min
  51. </div>
  52. </div>
  53. </el-col>
  54. </el-row>
  55. <el-row :gutter="20" style="margin-top: 20px;">
  56. <el-col :span="6">
  57. <div class="grid-content" style="height:500px;background: #fff;">
  58. <div style="height: 250px; border-bottom: 1px solid #000;">
  59. <!-- <div class="Title">今日计划统计</div> -->
  60. <b style="padding-left: 10px;line-height: 50px;font-size: 20px;">今日计划统计</b><br>
  61. <div style="text-align: center;">
  62. <b style="padding-right: 10px;font-size: 14px;">完成车次:{{ row2.chart1.chartLine_data.data1 }}</b>
  63. <b style="padding-right: 10px;font-size: 14px;">计划车次:{{ row2.chart1.chartLine_data.data2 }}</b>
  64. </div>
  65. <div id="row2chartLine1" style="height: 150px;" />
  66. </div>
  67. <div style="height: 250px;">
  68. <div style="text-align: center;padding-top:50px;">
  69. <b style="padding-right: 5px;font-size: 14px;">完成重量:{{ row2.chart2.chartLine_data.data1 }}kg</b>
  70. <b style="padding-right: 5px;font-size: 14px;">计划重量:{{ row2.chart2.chartLine_data.data2 }}kg</b>
  71. </div>
  72. <div id="row2chartLine2" style="height: 150px;" />
  73. </div>
  74. </div>
  75. </el-col>
  76. <el-col :span="18" style="margin-top:-20px;">
  77. <div class="grid-content" style="height:500px;">
  78. <div style="height:350px;">
  79. <!-- <div style="font-size:14px;color:#666;margin:0 auto;position: relative;">
  80. <span style="line-height:30px;position:absolute;right:190px;top:30px;"><i class="el-icon-caret-top" style="color:#ff3131;line-height:30px;font-size:30px;" /><b style="line-height:32px;">开始重量</b></span>
  81. <span style="line-height:30px;position:absolute;right:100px;top:30px;"><i class="el-icon-caret-top" style="color:#61a5e8;line-height:30px;font-size:30px;" /><b style="line-height:32px;">结束重量</b></span>
  82. </div> -->
  83. <div class="Title">实时监控</div>
  84. <div id="row2chartLine3" style="height: 90%;" />
  85. </div>
  86. <div class="car" style="position: relative;">
  87. <p style="position: absolute;left:50px;top:-50px;">当前车辆数:{{ carLength }}</p>
  88. <i ref="left" class="el-icon-arrow-left" @click="handleLeft" />
  89. <el-row :gutter="20" class="carList">
  90. <el-col v-for="(item,index) in list" :key="index" :span="8">
  91. <div ref="list" class="list" :style="{'background': item.background,'color':item.color}" @click="handleList(index,item)">
  92. <el-row :gutter="20">
  93. <el-col :span="12" class="list-l">
  94. <!-- 车辆/描述 -->
  95. <p><span>车辆:</span>{{ item.tname }}</p>
  96. <el-tooltip placement="top">
  97. <p slot="content">
  98. <span v-if="item.inorout == 0">饲料:{{ item.fname }}</span>
  99. <span v-if="item.inorout == 1">栏舍:{{ item.fname }}</span>
  100. </p>
  101. <p>
  102. <span v-if="item.inorout == 0">饲料:{{ item.fname }}</span>
  103. <span v-if="item.inorout == 1">栏舍:{{ item.fname }}</span>
  104. </p>
  105. </el-tooltip>
  106. <p><span>完成重量:</span>{{ item.doneweight }}</p>
  107. <p><span>完成度:</span>{{ item.donerate }}</p>
  108. </el-col>
  109. <el-col :span="12" class="list-r">
  110. <!-- 栏舍/饲料 -->
  111. <el-tooltip placement="top">
  112. <p slot="content"> <span>描述:</span> {{ item.remark }} </p>
  113. <p> <span>描述:</span> {{ item.remark }} </p>
  114. </el-tooltip>
  115. <p><span>计划重量:</span>{{ item.lweight }}</p>
  116. <p><span>剩余重量:</span>{{ item.leftweight }}</p>
  117. <p><span>车辆当前载重:</span>{{ item.nowweight }}</p>
  118. </el-col>
  119. </el-row>
  120. </div>
  121. </el-col>
  122. </el-row>
  123. <i ref="right" class="el-icon-arrow-right" @click="handleRight" />
  124. </div>
  125. </div>
  126. </el-col>
  127. </el-row>
  128. <el-row :gutter="20">
  129. <!-- 计划统计 -->
  130. <el-col :span="12" style="position: relative;">
  131. <div class="Title">计划统计</div>
  132. <div style="background: #fff;height:50px;">
  133. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleExport('row3chartLine1')">导出</el-button>
  134. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleTable('row3chartLine1')">切换表格</el-button>
  135. </div>
  136. <div id="row3chartLine1" style="background: #fff;height:350px;" />
  137. <div v-if="row3.chart1.isTable" class="table" style="position: absolute;width:97%;top:19px;">
  138. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleExport('row3chartLine1')">导出</el-button>
  139. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleChart('row3chartLine1')">切换图表</el-button>
  140. <el-table
  141. :key="row3.chart1.table.tableKey"
  142. v-loading="row3.chart1.table.listLoading"
  143. element-loading-text="给我一点时间"
  144. :data="row3.chart1.table.list"
  145. border
  146. fit
  147. highlight-current-row
  148. style="width: 100%;"
  149. height="400"
  150. :row-style="rowStyle"
  151. :cell-style="cellStyle"
  152. class="elTable table-fixed"
  153. >
  154. <el-table-column label="日期" sortable min-width="110px" align="center" prop="日期" />
  155. <el-table-column label="计划执行重量(kg)" sortable min-width="110px" align="center" prop="实际量" />
  156. <el-table-column label="配方理论重量(kg)" sortable min-width="110px" align="center" prop="理论量" />
  157. <el-table-column label="计划准确率" sortable min-width="110px" align="center" prop="field1" />
  158. <el-table-column label="计划取消重量(kg)" sortable min-width="110px" align="center" prop="计划取消重量" />
  159. <el-table-column label="计划准确率(去除取消重量)" sortable min-width="110px" align="center" prop="field3" />
  160. <el-table-column label="计划正确数" sortable min-width="110px" align="center" prop="正确数" />
  161. <el-table-column label="计划数" sortable min-width="110px" align="center" prop="计划数" />
  162. <el-table-column label="计划正确率" sortable min-width="110px" align="center" prop="field2" />
  163. </el-table>
  164. </div>
  165. </el-col>
  166. <!-- 泌乳牛采食量 -->
  167. <el-col :span="12" style="position: relative;">
  168. <div class="Title">泌乳牛采食量</div>
  169. <div style="background: #fff;height:50px;">
  170. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleExport('row3chartLine2')">导出</el-button>
  171. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleTable('row3chartLine2')">切换表格</el-button>
  172. </div>
  173. <div id="row3chartLine2" style="background: #fff;height:350px;" />
  174. <div v-if="row3.chart2.isTable" class="table" style="position: absolute;width:97%;top:19px;">
  175. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleExport('row3chartLine2')">导出</el-button>
  176. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleChart('row3chartLine2')">切换图表</el-button>
  177. <el-table
  178. :key="row3.chart2.table.tableKey"
  179. v-loading="row3.chart2.table.listLoading"
  180. element-loading-text="给我一点时间"
  181. :data="row3.chart2.table.list"
  182. border
  183. fit
  184. highlight-current-row
  185. style="width: 100%;"
  186. height="400"
  187. :row-style="rowStyle"
  188. :cell-style="cellStyle"
  189. class="elTable table-fixed"
  190. >
  191. <el-table-column label="日期" sortable min-width="110px" align="center" prop="日期" />
  192. <el-table-column label="泌乳牛采食量(kg)" sortable min-width="110px" align="center" prop="field1" />
  193. <el-table-column label="泌乳牛产奶量(kg)" sortable min-width="110px" align="center" prop="field2" />
  194. </el-table>
  195. </div>
  196. </el-col>
  197. </el-row>
  198. <el-row :gutter="20">
  199. <!-- 成本统计 -->
  200. <el-col :span="8">
  201. <div class="Title">成本统计</div>
  202. <div id="row4chartLine1" style="background: #fff;height:400px;" />
  203. </el-col>
  204. <!-- 出库统计 -->
  205. <el-col :span="8">
  206. <div class="Title">混料实际重量统计</div>
  207. <div id="row4chartLine2" style="background: #fff;height:400px;" />
  208. </el-col>
  209. <el-col :span="8">
  210. <div class="Title">库存预警</div>
  211. <div id="table" style="height: 400px;background: #fff;">
  212. <el-table
  213. :key="row4.table.tableKey"
  214. v-loading="row4.table.listLoading"
  215. element-loading-text="给我一点时间"
  216. :data="row4.table.list"
  217. border
  218. fit
  219. highlight-current-row
  220. style="width: 100%;background: #fff;"
  221. height="400"
  222. :row-style="rowStyle"
  223. :cell-style="cellStyle"
  224. class="elTable table-fixed"
  225. >
  226. <el-table-column label="序号" type="index" min-width="80px" align="center" />
  227. <el-table-column label="饲料名称" min-width="80px" align="center" prop="feedname" />
  228. <el-table-column label="库存量(kg)" min-width="70px" align="center" prop="stockweight" />
  229. <el-table-column label="剩余使用天数" min-width="80px" align="center" prop="ldays" />
  230. </el-table>
  231. <!-- <span style="line-height: 50px;color:#82CBB3;text-align: center;width: 100%;display: inline-block;cursor:pointer;" @click="handleMore">查看更多</span> -->
  232. </div>
  233. </el-col>
  234. </el-row>
  235. </div>
  236. </div>
  237. </template>
  238. <script>
  239. import { GetDataByName, GetReportform } from '@/api/common'
  240. import Cookies from 'js-cookie'
  241. import { parseTime } from '@/utils/index.js'
  242. import echarts from 'echarts'
  243. import { json2excel } from '@/utils/index.js'
  244. require('echarts/theme/macarons')
  245. // var myKey = 0
  246. export default {
  247. name: 'DashboardEditor',
  248. inject: ['reload'],
  249. data() {
  250. return {
  251. val: '这是值1',
  252. date: parseTime(new Date(), '{y}-{m}-{d}'),
  253. list: [],
  254. news: 1,
  255. carLength: 0, // 车辆
  256. myKey: 0, // 轮播Key值
  257. row1: {
  258. getdataListParm: {
  259. name: 'getHomepageStr',
  260. page: 1,
  261. offset: 1,
  262. pagecount: 10,
  263. returntype: 'Map',
  264. parammaps: {
  265. pastureid: Cookies.get('pastureid')
  266. }
  267. },
  268. listLoading: true,
  269. list: ''
  270. },
  271. row2: {
  272. chart1: {
  273. chartLine: null,
  274. chartLine_data: {}
  275. },
  276. chart2: {
  277. chartLine: null,
  278. chartLine_data: {}
  279. },
  280. chart3: {
  281. chartLine: null,
  282. chartLine_data: {},
  283. getdataListParm: {
  284. name: 'getHomeprocessAnalysis',
  285. page: 1,
  286. offset: 1,
  287. pagecount: 3,
  288. returntype: 'Map',
  289. parammaps: {
  290. pastureid: Cookies.get('pastureid'),
  291. id: '',
  292. pid: ''
  293. }
  294. },
  295. list: [],
  296. total: 0,
  297. listLoading: true,
  298. pageNum: '',
  299. pages: '',
  300. getdataListParmList: {
  301. name: 'getHomepageLBList',
  302. page: 1,
  303. offset: 1,
  304. pagecount: 3,
  305. returntype: 'Map',
  306. parammaps: {
  307. pastureid: Cookies.get('pastureid')
  308. }
  309. },
  310. list2: [],
  311. total2: 0,
  312. listLoading2: true,
  313. pageNum2: '',
  314. pages2: ''
  315. }
  316. },
  317. row3: {
  318. chartDate: [],
  319. chart1: {
  320. chartLine: null,
  321. chartLine_data: {},
  322. getdataListParm: {
  323. name: 'getAccuracyAllJH',
  324. page: 1,
  325. offset: 1,
  326. pagecount: 10,
  327. returntype: 'Map',
  328. parammaps: {
  329. pastureid: Cookies.get('pastureid'),
  330. startTime: parseTime(new Date(), '{y}-{m}-{d}'),
  331. stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
  332. inputDatetime: [new Date(), new Date()]
  333. }
  334. },
  335. list: [],
  336. total: 0,
  337. listLoading: true,
  338. isChart: true,
  339. isTable: false,
  340. table: {
  341. tableKey: 1,
  342. list: [],
  343. total: 0,
  344. listLoading: false
  345. }
  346. },
  347. chart2: {
  348. chartLine: null,
  349. chartLine_data: {},
  350. getdataListParm: {
  351. name: 'getFeedEffMR',
  352. page: 1,
  353. offset: 1,
  354. pagecount: 10,
  355. returntype: 'Map',
  356. parammaps: {
  357. pastureid: Cookies.get('pastureid'),
  358. startTime: parseTime(new Date(), '{y}-{m}-{d}'),
  359. stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
  360. inputDatetime: [new Date(), new Date()]
  361. }
  362. },
  363. list: [],
  364. total: 0,
  365. listLoading: true,
  366. isChart: true,
  367. isTable: false,
  368. table: {
  369. tableKey: 1,
  370. list: [],
  371. total: 0,
  372. listLoading: false
  373. }
  374. }
  375. },
  376. row4: {
  377. chartDate: [],
  378. chart1: {
  379. chartLine: null,
  380. chartLine_data: {},
  381. getdataListParm: {
  382. name: 'getHomepageCB',
  383. page: 1,
  384. offset: 1,
  385. pagecount: 10,
  386. returntype: 'Map',
  387. parammaps: {
  388. pastureid: Cookies.get('pastureid'),
  389. startTime: parseTime(new Date(), '{y}-{m}-{d}'),
  390. stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
  391. inputDatetime: [new Date(), new Date()]
  392. }
  393. },
  394. table: {
  395. list: [],
  396. total: 0,
  397. listLoading: true
  398. }
  399. },
  400. chart2: {
  401. chartLine: null,
  402. chartLine_data: {},
  403. getdataListParm: {
  404. name: 'getAccuraaActHL',
  405. page: 1,
  406. offset: 1,
  407. pagecount: 10,
  408. returntype: 'Map',
  409. parammaps: {
  410. pastureid: Cookies.get('pastureid'),
  411. pastureid: Cookies.get('pastureid'),
  412. startTime: parseTime(new Date(), '{y}-{m}-{d}'),
  413. stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
  414. inputDatetime: [new Date(), new Date()]
  415. }
  416. },
  417. list: [],
  418. total: 0,
  419. listLoading: true
  420. },
  421. table: {
  422. getdataListParm: {
  423. name: 'getFsWarnList',
  424. page: 1,
  425. offset: 1,
  426. pagecount: 5,
  427. returntype: 'Map',
  428. parammaps: {
  429. pastureid: Cookies.get('pastureid')
  430. }
  431. },
  432. tableKey: 1,
  433. list: [],
  434. total: 0,
  435. listLoading: true,
  436. temp: {}
  437. }
  438. },
  439. rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
  440. cellStyle: { padding: 0 + 'px' },
  441. timer: ''
  442. }
  443. },
  444. created() {
  445. // this.reload()
  446. this.getChart3List()
  447. this.getTimeFn()
  448. this.getList()
  449. this.getChart4()
  450. this.getChart5()
  451. this.getChart6()
  452. this.getChart7()
  453. this.getTable8()
  454. },
  455. mounted() {
  456. const that = this
  457. let num = this.myKey + 1
  458. let num2 = this.myKey + 1
  459. // 创建并执行定时器
  460. this.timer = setInterval(() => {
  461. // 当num等于100时清除定时器
  462. console.log(num, 'num')
  463. if (num > this.carLength) {
  464. num = 0
  465. num2 = 0
  466. // clearInterval(that.timer)
  467. this.row2.chart3.getdataListParmList.offset = 1
  468. this.getChart3List()
  469. }
  470. this.myKey = num
  471. console.log(num2, 'num2')
  472. if (num2 == 0) {
  473. if (this.$refs.list[0] !== undefined) {
  474. this.$refs.list[0].style.background = '#7ac3ec'
  475. this.$refs.list[0].style.color = '#f7f941'
  476. this.row2.chart3.getdataListParm.parammaps.pid = this.list[0].pid
  477. this.row2.chart3.getdataListParm.parammaps.id = this.list[0].id
  478. this.getChart3()
  479. }
  480. if (this.$refs.list[1] !== undefined) {
  481. this.$refs.list[1].style.color = '#fff'
  482. this.$refs.list[1].style.background = '#7ac3ec'
  483. }
  484. if (this.$refs.list[2] !== undefined) {
  485. this.$refs.list[2].style.color = '#fff'
  486. this.$refs.list[2].style.background = '#7ac3ec'
  487. }
  488. } else if (num2 == 1) {
  489. if (this.$refs.list[1] !== undefined) {
  490. this.$refs.list[1].style.background = '#7ac3ec'
  491. this.$refs.list[1].style.color = '#f7f941'
  492. this.row2.chart3.getdataListParm.parammaps.pid = this.list[1].pid
  493. this.row2.chart3.getdataListParm.parammaps.id = this.list[1].id
  494. this.getChart3()
  495. }
  496. if (this.$refs.list[0] !== undefined) {
  497. this.$refs.list[0].style.color = '#fff'
  498. this.$refs.list[0].style.background = '#7ac3ec'
  499. }
  500. if (this.$refs.list[2] !== undefined) {
  501. this.$refs.list[2].style.color = '#fff'
  502. this.$refs.list[2].style.background = '#7ac3ec'
  503. }
  504. } else if (num2 == 2) {
  505. if (this.$refs.list[2] !== undefined) {
  506. this.$refs.list[2].style.background = '#7ac3ec'
  507. this.$refs.list[2].style.color = '#f7f941'
  508. this.row2.chart3.getdataListParm.parammaps.pid = this.list[2].pid
  509. this.row2.chart3.getdataListParm.parammaps.id = this.list[2].id
  510. this.getChart3()
  511. }
  512. if (this.$refs.list[0] !== undefined) {
  513. this.$refs.list[0].style.color = '#fff'
  514. this.$refs.list[0].style.background = '#7ac3ec'
  515. }
  516. if (this.$refs.list[1] !== undefined) {
  517. this.$refs.list[1].style.color = '#fff'
  518. this.$refs.list[1].style.background = '#7ac3ec'
  519. }
  520. } else {
  521. if (this.$refs.list[0] !== undefined) {
  522. this.$refs.list[0].style.background = '#7ac3ec'
  523. this.$refs.list[0].style.color = '#f7f941'
  524. this.row2.chart3.getdataListParm.parammaps.pid = this.list[0].pid
  525. this.row2.chart3.getdataListParm.parammaps.id = this.list[0].id
  526. this.getChart3()
  527. }
  528. if (this.$refs.list[1] !== undefined) {
  529. this.$refs.list[1].style.color = '#fff'
  530. this.$refs.list[1].style.background = '#7ac3ec'
  531. }
  532. if (this.$refs.list[2] !== undefined) {
  533. this.$refs.list[2].style.color = '#fff'
  534. this.$refs.list[2].style.background = '#7ac3ec'
  535. }
  536. }
  537. console.log(num++, 'num++')
  538. console.log(num2++, 'num2++')
  539. if (num > this.carLength) {
  540. this.row2.chart3.getdataListParmList.offset = 1
  541. this.getChart3List()
  542. num2 = 0
  543. } else {
  544. if (num % 3 == 1) {
  545. this.row2.chart3.getdataListParmList.offset = this.row2.chart3.pageNum2 + 1
  546. this.getChart3List()
  547. num2 = 1
  548. }
  549. }
  550. }, 15000)
  551. },
  552. destroyed() {
  553. clearInterval(this.timer)
  554. },
  555. methods: {
  556. getTimeFn() {
  557. // this.reload()
  558. const that = this
  559. const end = new Date()
  560. const start = new Date()
  561. start.setTime(start.getTime() - 3600 * 1000 * 24 * 20)
  562. that.row3.chartDate[0] = parseTime(start, '{y}-{m}-{d}')
  563. that.row3.chartDate[1] = parseTime(end, '{y}-{m}-{d}')
  564. that.row3.chart1.getdataListParm.parammaps.inputDatetime[0] = parseTime(start, '{y}-{m}-{d}')
  565. that.row3.chart1.getdataListParm.parammaps.inputDatetime[1] = parseTime(end, '{y}-{m}-{d}')
  566. that.row3.chart1.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
  567. that.row3.chart1.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')
  568. that.row3.chart2.getdataListParm.parammaps.inputDatetime[0] = parseTime(start, '{y}-{m}-{d}')
  569. that.row3.chart2.getdataListParm.parammaps.inputDatetime[1] = parseTime(end, '{y}-{m}-{d}')
  570. that.row3.chart2.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
  571. that.row3.chart2.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')
  572. that.row4.chartDate[0] = parseTime(start, '{y}-{m}-{d}')
  573. that.row4.chartDate[1] = parseTime(end, '{y}-{m}-{d}')
  574. that.row4.chart1.getdataListParm.parammaps.inputDatetime[0] = parseTime(start, '{y}-{m}-{d}')
  575. that.row4.chart1.getdataListParm.parammaps.inputDatetime[1] = parseTime(end, '{y}-{m}-{d}')
  576. that.row4.chart1.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
  577. that.row4.chart1.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')
  578. that.row4.chart2.getdataListParm.parammaps.inputDatetime[0] = parseTime(start, '{y}-{m}-{d}')
  579. that.row4.chart2.getdataListParm.parammaps.inputDatetime[1] = parseTime(end, '{y}-{m}-{d}')
  580. that.row4.chart2.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
  581. that.row4.chart2.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')
  582. },
  583. getList() {
  584. this.row1.listLoading = true
  585. GetDataByName(this.row1.getdataListParm).then(response => {
  586. console.log('row1数据', response.data.list)
  587. if (response.data.list !== null) {
  588. if (response.data.list[0].monRateHL == undefined) { response.data.list[0].monRateHL = '' }
  589. if (response.data.list[0].monRateSL == undefined) { response.data.list[0].monRateSL = '' }
  590. if (response.data.list[0].monRateSLR == undefined) { response.data.list[0].monRateSLR = '' }
  591. if (response.data.list[0].yesRateHL == undefined) { response.data.list[0].yesRateHL = '' }
  592. if (response.data.list[0].yesRateHL == undefined) { response.data.list[0].yesRateHL = '' }
  593. if (response.data.list[0].yesRateSL == undefined) { response.data.list[0].yesRateSL = '' }
  594. if (response.data.list[0].yesRateSLR == undefined) { response.data.list[0].yesRateSLR = '' }
  595. if (response.data.list[0].temtime == undefined) { response.data.list[0].temtime = '' }
  596. if (response.data.list[0].montime == undefined) { response.data.list[0].montime = '' }
  597. this.row1.list = response.data.list[0]
  598. this.row2.chart1.chartLine_data.data1 = parseFloat(response.data.list[0].doneTimes)
  599. this.row2.chart1.chartLine_data.data2 = parseFloat(response.data.list[0].planTimes)
  600. this.row2.chart2.chartLine_data.data1 = parseFloat(response.data.list[0].doneWeight)
  601. this.row2.chart2.chartLine_data.data2 = parseFloat(response.data.list[0].planWeight)
  602. this.roadChartLine1(this.row2.chart1.chartLine_data)
  603. this.roadChartLine2(this.row2.chart2.chartLine_data)
  604. } else {
  605. this.row1.list.data1.monRateHL = ''
  606. this.row1.list.data1.monRateSL = ''
  607. this.row1.list.data1.monRateSLR = ''
  608. this.row1.list.data1.yesRateHL = ''
  609. this.row1.list.data1.yesRateSL = ''
  610. this.row1.list.data1.yesRateSLR = ''
  611. this.row1.list.data1.temtime = ''
  612. this.row1.list.data1.montime = ''
  613. this.row2.chart1.chartLine_data.data1 = ''
  614. this.row2.chart1.chartLine_data.data2 = ''
  615. this.row2.chart2.chartLine_data.data1 = ''
  616. this.row2.chart2.chartLine_data.data2 = ''
  617. }
  618. setTimeout(() => {
  619. this.row1.listLoading = false
  620. }, 100)
  621. })
  622. },
  623. // 今日计划统计-完成车次
  624. roadChartLine1(chartLine_data) {
  625. if (this.row2.chart1.chartLine != null) {
  626. this.row2.chart1.chartLine.dispose()
  627. }
  628. this.row2.chart1.chartLine = echarts.init(document.getElementById('row2chartLine1'))
  629. var option = {
  630. // 标题组件,包含主标题和副标题
  631. title: {
  632. show: true,
  633. x: 'center',
  634. textStyle: {
  635. fontSize: '15',
  636. color: 'green',
  637. fontWeight: 'bold'
  638. }
  639. },
  640. // 提示框组件
  641. tooltip: {
  642. // 是否显示提示框组件,包括提示框浮层和 axisPointe
  643. show: false,
  644. // 触发类型: item:数据项触发,axis:坐标轴触发
  645. trigger: 'item',
  646. formatter: '{a} <br/>{b}: {c} ({d}%)'
  647. },
  648. // 系列列表。每个系列通过 type 决定自己的图表类型
  649. series: [{
  650. // 系列名称,用于tooltip的显示,legend 的图例筛选,在 setOption 更新数据和配置项时用于指定对应的系列。
  651. name: '任务进度',
  652. type: 'pie',
  653. // 饼图的半径,数组的第一项是内半径,第二项是外半径
  654. radius: ['80%', '70%'],
  655. // 是否启用防止标签重叠策略,默认开启
  656. avoidLabelOverlap: false,
  657. hoverAnimation: false,
  658. // 标签的视觉引导线样式,在 label 位置 设置为'outside'的时候会显示视觉引导线
  659. labelLine: {
  660. normal: {
  661. show: false
  662. }
  663. },
  664. data: [{
  665. value: chartLine_data.data1, // 数据值
  666. name: '完成率', // 数据项名称
  667. selected: false, // 该数据项是否被选中
  668. // 单个扇区的标签配置
  669. label: {
  670. normal: {
  671. show: true, // 是显示标签
  672. position: 'center',
  673. fontSize: 20,
  674. // 标签内容格式器,支持字符串模板和回调函数两种形式,字符串模板与回调函数返回的字符串均支持用 \n 换行
  675. formatter: '{b}\n{d}%'
  676. }
  677. }
  678. }, {
  679. value: chartLine_data.data2 - chartLine_data.data1,
  680. label: {
  681. normal: {
  682. show: false
  683. }
  684. }
  685. }]
  686. }],
  687. color: ['#409EFF', '#B7DBFF']
  688. }
  689. this.row2.chart1.chartLine.setOption(option)
  690. window.onresize = function() {
  691. this.row2.chart1.chartLine.resize()
  692. }
  693. },
  694. // 今日计划统计-完成重量
  695. roadChartLine2(chartLine_data) {
  696. if (this.row2.chart2.chartLine != null) {
  697. this.row2.chart2.chartLine.dispose()
  698. }
  699. this.row2.chart2.chartLine = echarts.init(document.getElementById('row2chartLine2'))
  700. var option = {
  701. // 标题组件,包含主标题和副标题
  702. title: {
  703. show: true,
  704. x: 'center',
  705. textStyle: {
  706. fontSize: '15',
  707. color: 'green',
  708. fontWeight: 'bold'
  709. }
  710. },
  711. // 提示框组件
  712. tooltip: {
  713. // 是否显示提示框组件,包括提示框浮层和 axisPointe
  714. show: false,
  715. // 触发类型: item:数据项触发,axis:坐标轴触发
  716. trigger: 'item',
  717. formatter: '{a} <br/>{b}: {c} ({d}%)'
  718. },
  719. // 系列列表。每个系列通过 type 决定自己的图表类型
  720. series: [{
  721. // 系列名称,用于tooltip的显示,legend 的图例筛选,在 setOption 更新数据和配置项时用于指定对应的系列。
  722. name: '任务进度',
  723. type: 'pie',
  724. // 饼图的半径,数组的第一项是内半径,第二项是外半径
  725. radius: ['80%', '70%'],
  726. // 是否启用防止标签重叠策略,默认开启
  727. avoidLabelOverlap: false,
  728. hoverAnimation: false,
  729. // 标签的视觉引导线样式,在 label 位置 设置为'outside'的时候会显示视觉引导线
  730. labelLine: {
  731. normal: {
  732. show: false
  733. }
  734. },
  735. data: [{
  736. value: chartLine_data.data1, // 数据值
  737. name: '完成率', // 数据项名称
  738. selected: false, // 该数据项是否被选中
  739. // 单个扇区的标签配置
  740. label: {
  741. normal: {
  742. show: true, // 是显示标签
  743. position: 'center',
  744. fontSize: 20,
  745. // 标签内容格式器,支持字符串模板和回调函数两种形式,字符串模板与回调函数返回的字符串均支持用 \n 换行
  746. formatter: '{b}\n{d}%'
  747. }
  748. }
  749. }, {
  750. value: chartLine_data.data2 - chartLine_data.data1,
  751. label: {
  752. normal: {
  753. show: false
  754. }
  755. }
  756. }]
  757. }],
  758. color: ['#409EFF', '#B7DBFF']
  759. }
  760. this.row2.chart2.chartLine.setOption(option)
  761. window.onresize = function() {
  762. this.row2.chart2.chartLine.resize()
  763. }
  764. },
  765. // 实时监控
  766. getChart3() {
  767. this.row2.chart3.listLoading = true
  768. GetReportform(this.row2.chart3.getdataListParm).then(response => {
  769. console.log('实时监控数据', response.data.list)
  770. if (response.data.list !== null) {
  771. var evenNumbers = []// 偶数
  772. var oddNumbers = []// 奇数
  773. for (let i = 0; i < response.data.list.data4.length; i++) {
  774. if (i == 0) {
  775. oddNumbers.push(response.data.list.data4[i])
  776. } else {
  777. if (i % 2 == 0) {
  778. evenNumbers.push(response.data.list.data4[i])
  779. } else {
  780. oddNumbers.push(response.data.list.data4[i])
  781. }
  782. }
  783. }
  784. response.data.list.data4 = oddNumbers
  785. response.data.list.data5 = evenNumbers
  786. this.row2.chart3.chartLine_data = response.data.list
  787. this.row2.chart3.total = response.data.total
  788. this.row2.chart3.pageNum = response.data.pageNum
  789. this.row2.chart3.pages = response.data.pages
  790. this.roadChartLine3(this.row2.chart3.chartLine_data)
  791. } else {
  792. this.row2.chart3.list = []
  793. }
  794. setTimeout(() => {
  795. this.row2.chart3.listLoading = false
  796. }, 100)
  797. })
  798. },
  799. roadChartLine3(chartLine_data) {
  800. if (this.row2.chart3.chartLine != null) {
  801. this.row2.chart3.chartLine.dispose()
  802. }
  803. this.row2.chart3.chartLine = echarts.init(document.getElementById('row2chartLine3'))
  804. var option = {
  805. title: {
  806. text: '',
  807. subtext: ''
  808. },
  809. color: ['#ff3131', '#61a5e8', '#ff3131', '#61a5e8'], // 关键加上这句话,legend的颜色和折线的自定义颜色就一致了
  810. legend: {
  811. data: [
  812. { name: '设计重量', icon: 'rectangle' },
  813. { name: '实际重量', icon: 'rectangle' },
  814. { name: '开始重量', icon: 'triangle' },
  815. { name: '结束重量', icon: 'triangle' }
  816. ],
  817. right: '20%',
  818. textStyle: {
  819. fontSize: 12,
  820. color: '#666'
  821. }
  822. },
  823. /* grid:{y:15},*/
  824. tooltip: {
  825. trigger: 'axis'
  826. },
  827. calculable: true,
  828. yAxis: [
  829. {
  830. type: 'value',
  831. name: '重量(kg)',
  832. splitLine: { show: false }, // 去除网格线
  833. axisLabel: {
  834. show: true,
  835. textStyle: {
  836. color: '#666' // 这里用参数代替了
  837. }
  838. }
  839. }
  840. ],
  841. xAxis: [
  842. {
  843. type: 'category',
  844. splitLine: { show: false }, // 去除网格线
  845. name: '时间',
  846. data: chartLine_data.data1,
  847. axisLabel: {
  848. show: true,
  849. textStyle: {
  850. color: '#666' // 这里用参数代替了
  851. }
  852. }
  853. }
  854. ],
  855. series: [{
  856. symbol: 'none',
  857. name: '实际重量',
  858. type: 'line',
  859. // step: 'end',
  860. data: chartLine_data.data3,
  861. smooth: true,
  862. barWidth: '37',
  863. itemStyle: {
  864. normal: {
  865. lineStyle: { color: '#ff3131' }
  866. }
  867. }
  868. }, {
  869. symbol: 'none',
  870. name: '设计重量',
  871. type: 'line',
  872. barWidth: '37',
  873. data: chartLine_data.data2,
  874. itemStyle: {
  875. normal: {
  876. lineStyle: { color: '#61a5e8' }
  877. }
  878. }
  879. }, {
  880. name: '开始重量',
  881. symbol: 'triangle',
  882. symbolSize: 10,
  883. type: 'scatter',
  884. data: chartLine_data.data4
  885. }, {
  886. name: '结束重量',
  887. symbol: 'triangle',
  888. symbolSize: 10,
  889. type: 'scatter',
  890. data: chartLine_data.data5
  891. }]
  892. }
  893. this.row2.chart3.chartLine.setOption(option)
  894. window.onresize = function() {
  895. this.row2.chart3.chartLine.resize()
  896. }
  897. },
  898. // 图三轮询列表
  899. getChart3List() {
  900. this.row2.chart3.listLoading2 = true
  901. GetDataByName(this.row2.chart3.getdataListParmList).then(response => {
  902. if (response.data.list !== null) {
  903. for (let i = 0; i < response.data.list.length; i++) {
  904. this.$set(response.data.list[i], 'color', '#fff')
  905. this.$set(response.data.list[i], 'background', '#7ac3ec')
  906. }
  907. this.list = response.data.list
  908. console.log('实时监控轮播数据', this.list)
  909. this.myKey = 0
  910. this.$nextTick(() => {
  911. console.log(this.$refs.list)
  912. this.$refs.list[this.myKey].style.background = '#7ac3ec'
  913. this.$refs.list[this.myKey].style.color = '#f7f941'
  914. })
  915. this.row2.chart3.getdataListParm.parammaps.pid = this.list[this.myKey].pid
  916. this.row2.chart3.getdataListParm.parammaps.id = this.list[this.myKey].id
  917. this.getChart3()
  918. this.carLength = response.data.total
  919. this.row2.chart3.pageNum2 = response.data.pageNum
  920. this.row2.chart3.pages2 = response.data.pages
  921. if (this.row2.chart3.getdataListParmList.offset == 1) {
  922. this.$refs.left.style.color = '#ccc'
  923. } else {
  924. this.$refs.left.style.color = '#000'
  925. }
  926. if (this.row2.chart3.getdataListParmList.offset < this.row2.chart3.pages2) {
  927. this.$refs.right.style.color = '#000'
  928. } else {
  929. this.$refs.right.style.color = '#ccc'
  930. }
  931. } else {
  932. this.carLength = 0
  933. this.row2.chart3.list2 = []
  934. }
  935. setTimeout(() => {
  936. this.row2.chart3.listLoading2 = false
  937. }, 100)
  938. })
  939. },
  940. // 向左切换
  941. handleLeft() {
  942. console.log('左')
  943. if (this.row2.chart3.getdataListParmList.offset > 1) {
  944. this.$refs.left.style.color = '#000'
  945. this.row2.chart3.getdataListParmList.offset = this.row2.chart3.pageNum2 - 1
  946. this.getChart3List()
  947. if (this.$refs.list[0] !== undefined) {
  948. this.$refs.list[0].style.background = '#7ac3ec'
  949. this.$refs.list[0].style.color = '#f7f941'
  950. this.row2.chart3.getdataListParm.parammaps.pid = this.list[0].pid
  951. this.row2.chart3.getdataListParm.parammaps.id = this.list[0].id
  952. this.getChart3()
  953. }
  954. if (this.$refs.list[1] !== undefined) {
  955. this.$refs.list[1].style.color = '#fff'
  956. this.$refs.list[1].style.background = '#7ac3ec'
  957. }
  958. if (this.$refs.list[2] !== undefined) {
  959. this.$refs.list[2].style.color = '#fff'
  960. this.$refs.list[2].style.background = '#7ac3ec'
  961. }
  962. } else {
  963. this.$refs.left.style.color = '#ccc'
  964. }
  965. },
  966. // 向右切换
  967. handleRight() {
  968. if (this.row2.chart3.getdataListParmList.offset < this.row2.chart3.pages2) {
  969. this.$refs.left.style.color = '#000'
  970. this.$refs.right.style.color = '#000'
  971. this.row2.chart3.getdataListParmList.offset = this.row2.chart3.getdataListParmList.offset + 1
  972. this.getChart3List()
  973. if (this.$refs.list[0] !== undefined) {
  974. this.$refs.list[0].style.background = '#7ac3ec'
  975. this.$refs.list[0].style.color = '#f7f941'
  976. this.row2.chart3.getdataListParm.parammaps.pid = this.list[0].pid
  977. this.row2.chart3.getdataListParm.parammaps.id = this.list[0].id
  978. this.getChart3()
  979. }
  980. if (this.$refs.list[1] !== undefined) {
  981. this.$refs.list[1].style.color = '#fff'
  982. this.$refs.list[1].style.background = '#7ac3ec'
  983. }
  984. if (this.$refs.list[2] !== undefined) {
  985. this.$refs.list[2].style.color = '#fff'
  986. this.$refs.list[2].style.background = '#7ac3ec'
  987. }
  988. }
  989. },
  990. // 点击
  991. handleList(key, item) {
  992. console.log(item)
  993. clearInterval(this.timer)
  994. for (var i in this.$refs.list) {
  995. if (i == key) {
  996. this.$refs.list[i].style.background = '#7ac3ec'
  997. this.$refs.list[i].style.color = '#f7f941'
  998. this.row2.chart3.getdataListParm.parammaps.pid = item.pid
  999. this.row2.chart3.getdataListParm.parammaps.id = item.id
  1000. this.getChart3()
  1001. } else {
  1002. this.$refs.list[i].style.background = '#7ac3ec'
  1003. this.$refs.list[i].style.color = '#fff'
  1004. }
  1005. }
  1006. },
  1007. // 计划统计
  1008. getChart4() {
  1009. this.row3.chart1.listLoading = true
  1010. GetReportform(this.row3.chart1.getdataListParm).then(response => {
  1011. console.log('计划统计数据', response.data.list)
  1012. if (response.data.list !== null) {
  1013. this.row3.chart1.table.list = response.data.data
  1014. this.row3.chart1.chartLine_data = response.data.list
  1015. this.row3.chart1.total = response.data.total
  1016. this.roadChartLine4(this.row3.chart1.chartLine_data)
  1017. } else {
  1018. this.row3.chart1.list = []
  1019. }
  1020. setTimeout(() => {
  1021. this.row3.chart1.listLoading = false
  1022. }, 100)
  1023. })
  1024. },
  1025. roadChartLine4(chartLine_data) {
  1026. if (this.row3.chart1.chartLine != null) {
  1027. this.row3.chart1.chartLine.dispose()
  1028. }
  1029. this.row3.chart1.chartLine = echarts.init(document.getElementById('row3chartLine1'))
  1030. var option = {
  1031. title: {
  1032. text: ''
  1033. },
  1034. tooltip: {
  1035. trigger: 'axis'
  1036. },
  1037. legend: {
  1038. data: ['计划准确率', '计划正确率', '计划准确率(去除取消重量)'],
  1039. top: 10
  1040. },
  1041. grid: {
  1042. top: '20%',
  1043. left: '0%',
  1044. right: '8%',
  1045. containLabel: true
  1046. },
  1047. toolbox: {
  1048. show: true,
  1049. right: '2%',
  1050. feature: {}
  1051. },
  1052. xAxis: { type: 'category', boundaryGap: false, data: chartLine_data.data1, name: '日期' },
  1053. yAxis: {
  1054. type: 'value', name: '百分比', axisLabel: { formatter: '{value} %' }
  1055. },
  1056. series: [
  1057. { name: '计划准确率', type: 'line', data: chartLine_data.data2 },
  1058. { name: '计划正确率', type: 'line', data: chartLine_data.data3 },
  1059. { name: '计划准确率(去除取消重量)', type: 'line', data: chartLine_data.data4 }
  1060. ]
  1061. }
  1062. this.row3.chart1.chartLine.setOption(option)
  1063. window.onresize = function() {
  1064. this.row3.chart1.chartLine.resize()
  1065. }
  1066. },
  1067. // 泌乳牛采食量
  1068. getChart5() {
  1069. this.row3.chart2.listLoading = true
  1070. GetReportform(this.row3.chart2.getdataListParm).then(response => {
  1071. console.log('泌乳牛采食量数据', response.data.list)
  1072. if (response.data.list !== null) {
  1073. this.row3.chart2.table.list = response.data.data
  1074. this.row3.chart2.chartLine_data = response.data.list
  1075. this.row3.chart2.total = response.data.total
  1076. this.roadChartLine5(this.row3.chart2.chartLine_data)
  1077. } else {
  1078. this.row3.chart2.list = []
  1079. }
  1080. setTimeout(() => {
  1081. this.row3.chart2.listLoading = false
  1082. }, 100)
  1083. })
  1084. },
  1085. roadChartLine5(chartLine_data) {
  1086. if (this.row3.chart2.chartLine != null) {
  1087. this.row3.chart2.chartLine.dispose()
  1088. }
  1089. this.row3.chart2.chartLine = echarts.init(document.getElementById('row3chartLine2'))
  1090. var option = {
  1091. tooltip: {
  1092. trigger: 'axis'
  1093. },
  1094. legend: {
  1095. data: ['泌乳牛采食量', '泌乳牛产奶量'],
  1096. right: 10
  1097. },
  1098. xAxis: [
  1099. {
  1100. type: 'category',
  1101. data: chartLine_data.data1
  1102. }
  1103. ],
  1104. yAxis: [
  1105. {
  1106. type: 'value',
  1107. name: '泌乳牛采食量',
  1108. axisLabel: {
  1109. formatter: '{value} '
  1110. }
  1111. }, {
  1112. type: 'value',
  1113. name: '泌乳牛产奶量',
  1114. axisLabel: {
  1115. formatter: '{value} '
  1116. }
  1117. }
  1118. ],
  1119. series: [{
  1120. name: '泌乳牛采食量',
  1121. type: 'bar',
  1122. itemStyle: { /* 设置柱状颜色*/
  1123. normal: {
  1124. color: '#61a5e8'
  1125. }
  1126. },
  1127. data: chartLine_data.data2
  1128. }, {
  1129. name: '泌乳牛产奶量',
  1130. type: 'line',
  1131. itemStyle: { /* 设置折线颜色*/
  1132. normal: {
  1133. color: '#ff2d2d'
  1134. }
  1135. },
  1136. yAxisIndex: 1,
  1137. data: chartLine_data.data3
  1138. }]
  1139. }
  1140. this.row3.chart2.chartLine.setOption(option)
  1141. window.onresize = function() {
  1142. this.row3.chart2.chartLine.resize()
  1143. }
  1144. },
  1145. // 成本统计
  1146. getChart6() {
  1147. this.row4.chart1.listLoading = true
  1148. GetReportform(this.row4.chart1.getdataListParm).then(response => {
  1149. console.log('成本统计数据', response.data.data)
  1150. console.log('成本统计数据', response.data.list)
  1151. if (response.data.list !== null) {
  1152. this.row4.chart1.table.list = response.data.data
  1153. this.row4.chart1.chartLine_data = response.data.list
  1154. this.row4.chart1.total = response.data.total
  1155. this.roadChartLine6(this.row4.chart1.chartLine_data)
  1156. } else {
  1157. this.row4.chart1.list = []
  1158. }
  1159. setTimeout(() => {
  1160. this.row4.chart1.listLoading = false
  1161. }, 100)
  1162. })
  1163. },
  1164. roadChartLine6(chartLine_data) {
  1165. if (this.row4.chart1.chartLine != null) {
  1166. this.row4.chart1.chartLine.dispose()
  1167. }
  1168. console.log(chartLine_data)
  1169. this.row4.chart1.chartLine = echarts.init(document.getElementById('row4chartLine1'))
  1170. var option = {
  1171. title: {
  1172. text: ''
  1173. },
  1174. grid: {
  1175. left: '8%',
  1176. right: '8%',
  1177. bottom: '3%',
  1178. containLabel: true
  1179. },
  1180. tooltip: {
  1181. trigger: 'axis'
  1182. },
  1183. legend: {
  1184. data: ['泌乳牛采食量', '泌乳牛产奶量']
  1185. },
  1186. xAxis: [
  1187. {
  1188. type: 'category',
  1189. data: chartLine_data.data1,
  1190. axisPointer: {
  1191. type: 'shadow'
  1192. },
  1193. name: '日期'
  1194. }
  1195. ],
  1196. yAxis: [
  1197. {
  1198. type: 'value',
  1199. name: '公斤奶\n饲料成本(元)',
  1200. axisLabel: {
  1201. formatter: '{value}'
  1202. }
  1203. }, {
  1204. type: 'value',
  1205. name: '单头牛\n饲料成本(元)',
  1206. axisLabel: {
  1207. formatter: '{value}'
  1208. }
  1209. }
  1210. ],
  1211. series: [
  1212. {
  1213. name: '泌乳牛采食量',
  1214. type: 'bar',
  1215. itemStyle: { /* 设置柱状颜色*/
  1216. normal: {
  1217. color: '#61a5e8'
  1218. }
  1219. },
  1220. data: chartLine_data.data2
  1221. }, {
  1222. name: '泌乳牛产奶量',
  1223. type: 'line',
  1224. yAxisIndex: 1,
  1225. itemStyle: { /* 设置柱状颜色*/
  1226. normal: {
  1227. color: '#ff3131'
  1228. }
  1229. },
  1230. data: chartLine_data.data3
  1231. }
  1232. ]
  1233. }
  1234. this.row4.chart1.chartLine.setOption(option)
  1235. window.onresize = function() {
  1236. this.row4.chart1.chartLine.resize()
  1237. }
  1238. },
  1239. getChart7() {
  1240. this.row4.chart2.listLoading = true
  1241. GetReportform(this.row4.chart2.getdataListParm).then(response => {
  1242. console.log('出库统计数据', response.data.list)
  1243. if (response.data.list !== null) {
  1244. // this.row4.chart2.table.list = response.data.data
  1245. this.row4.chart2.chartLine_data = response.data.list
  1246. console.log(this.row4.chart2.chartLine_data)
  1247. this.row4.chart2.total = response.data.total
  1248. this.roadChartLine7(this.row4.chart2.chartLine_data)
  1249. } else {
  1250. this.row4.chart2.list = []
  1251. }
  1252. setTimeout(() => {
  1253. this.row4.chart2.listLoading = false
  1254. }, 100)
  1255. })
  1256. },
  1257. roadChartLine7(chartLine_data) {
  1258. if (this.row4.chart2.chartLine != null) {
  1259. this.row4.chart2.chartLine.dispose()
  1260. }
  1261. this.row4.chart2.chartLine = echarts.init(document.getElementById('row4chartLine2'))
  1262. var option = {
  1263. title: {
  1264. text: ''
  1265. },
  1266. grid: {
  1267. left: '3%',
  1268. right: '10%',
  1269. bottom: '3%',
  1270. containLabel: true
  1271. },
  1272. tooltip: {
  1273. trigger: 'axis'
  1274. },
  1275. legend: {
  1276. data: ['']
  1277. },
  1278. xAxis: [
  1279. {
  1280. type: 'category',
  1281. data: chartLine_data.data1,
  1282. name: '日期'
  1283. }
  1284. ],
  1285. yAxis: [
  1286. { type: 'value', name: '重量(kg)', axisLabel: { formatter: '{value}' }}
  1287. ],
  1288. series: [
  1289. {
  1290. name: '重量',
  1291. type: 'bar',
  1292. stack: '广告',
  1293. itemStyle: { /* 设置柱状颜色*/
  1294. normal: {
  1295. color: '#61a5e8'
  1296. }
  1297. },
  1298. data: chartLine_data.data2
  1299. }
  1300. ]
  1301. }
  1302. this.row4.chart2.chartLine.setOption(option)
  1303. window.onresize = function() {
  1304. this.row4.chart2.chartLine.resize()
  1305. }
  1306. },
  1307. getTable8() {
  1308. this.row4.table.listLoading = true
  1309. GetDataByName(this.row4.table.getdataListParm).then(response => {
  1310. console.log('库存预警table数据', response.data.list)
  1311. if (response.data.list !== null) {
  1312. this.row4.table.list = response.data.list
  1313. this.row4.table.total = response.data.total
  1314. } else {
  1315. this.row4.table.list = []
  1316. }
  1317. setTimeout(() => {
  1318. this.row4.table.listLoading = false
  1319. }, 100)
  1320. })
  1321. },
  1322. // 更多
  1323. handleMore() {
  1324. this.$router.push({ path: '/inventoryManagement/Warning' })
  1325. },
  1326. // 导出
  1327. handleExport(item) {
  1328. // 计划统计
  1329. if (item == 'row3chartLine1') {
  1330. console.log(this.row3.chart1.table.list)
  1331. var excelDatasTabChart1 = [
  1332. {
  1333. tHeader: ['日期', '计划执行重量(kg)', '配方理论重量(kg)', '计划准确率', '计划取消重量(kg)', '计划准确率(去除取消重量)', '计划正确数', '计划数', '计划正确率'],
  1334. filterVal: ['日期', '实际量', '理论量', 'field1', '计划取消重量', 'field3', '正确数', '计划数', 'field2'],
  1335. tableDatas: this.row3.chart1.table.list,
  1336. sheetName: '计划统计'
  1337. }
  1338. ]
  1339. json2excel(excelDatasTabChart1, '计划统计', true, 'xlsx')
  1340. } else if (item == 'row3chartLine2') {
  1341. // 泌乳牛采食量
  1342. var excelDatasTabChart2 = [
  1343. {
  1344. tHeader: ['日期', '泌乳牛采食量(kg)', '泌乳牛产奶量(kg)'],
  1345. filterVal: ['日期', 'field1', 'field2'],
  1346. tableDatas: this.row3.chart2.table.list,
  1347. sheetName: '泌乳牛采食量'
  1348. }
  1349. ]
  1350. json2excel(excelDatasTabChart2, '泌乳牛采食量', true, 'xlsx')
  1351. }
  1352. },
  1353. handleTable(item) {
  1354. if (item == 'row3chartLine1') {
  1355. console.log('计划统计表格')
  1356. this.row3.chart1.isTable = true
  1357. this.row3.chart1.isChart = false
  1358. } else if (item == 'row3chartLine2') {
  1359. console.log('泌乳牛采食量表格')
  1360. this.row3.chart2.isTable = true
  1361. this.row3.chart2.isChart = false
  1362. }
  1363. },
  1364. handleChart(item) {
  1365. // 显示切换图表
  1366. if (item == 'row3chartLine1') {
  1367. console.log('计划统计图表')
  1368. this.row3.chart1.isTable = false
  1369. this.row3.chart1.isChart = true
  1370. } else if (item == 'row3chartLine2') {
  1371. console.log('泌乳牛采食量图表')
  1372. this.row3.chart2.isTable = false
  1373. this.row3.chart2.isChart = true
  1374. }
  1375. }
  1376. }
  1377. }
  1378. </script>
  1379. <style lang="scss" scoped>
  1380. .Title{
  1381. padding-left: 10px;border-radius: 10px;margin-top: 20px;background: #fff;height:40px;font-size:20px;line-height:40px;text-align: left;font-weight: 600;
  1382. }
  1383. .dashboard-editor-container {
  1384. background-color: #F4F4F4;
  1385. min-height: 100vh;
  1386. .news{
  1387. width: 70%;
  1388. height: 30px;
  1389. background: #fff;
  1390. margin: 0 auto;
  1391. border-radius: 10px;
  1392. text-align: center;
  1393. line-height: 30px;
  1394. color: red;
  1395. b{color: #000;}
  1396. }
  1397. .bottom{
  1398. padding:0 30px;
  1399. h4{text-align: right;}
  1400. .grid-content{
  1401. background: #fff;height: 90px;
  1402. border-radius: 10px;
  1403. }
  1404. .one{
  1405. border: 1px solid #82CBB3;height: 90px;
  1406. .Left{
  1407. float: left;
  1408. width: 65px;
  1409. text-align: center;
  1410. i{font-size: 36px;color:#82CBB3;line-height: 90px;}
  1411. }
  1412. .Right{
  1413. float: left;
  1414. margin-top:15px;
  1415. height: 60px;
  1416. font-weight: 600;
  1417. font-size: 14px;
  1418. line-height: 30px;
  1419. span{
  1420. display: inline-block;
  1421. width: 130px;
  1422. text-align: right;
  1423. }
  1424. }
  1425. }
  1426. .two{
  1427. border: 1px solid #FF9900;
  1428. .Left{
  1429. float: left;
  1430. width: 65px;
  1431. text-align: center;
  1432. i{font-size: 36px;color:#FF9900;line-height: 90px;}
  1433. }
  1434. .Right{
  1435. float: left;
  1436. margin-top:15px;
  1437. height: 60px;
  1438. font-weight: 600;
  1439. font-size: 14px;
  1440. line-height: 30px;
  1441. span{
  1442. display: inline-block;
  1443. width: 130px;
  1444. text-align: right;
  1445. }
  1446. }
  1447. }
  1448. .three{
  1449. border: 1px solid #0099FF;
  1450. .Left{
  1451. float: left;
  1452. width: 65px;
  1453. text-align: center;
  1454. i{font-size: 36px;color:#0099FF;line-height: 90px;}
  1455. }
  1456. .Right{
  1457. float: left;
  1458. height: 60px;
  1459. font-weight: 600;
  1460. font-size: 14px;
  1461. line-height: 30px;
  1462. margin-top:15px;
  1463. span{
  1464. display: inline-block;
  1465. width: 130px;
  1466. text-align: right;
  1467. }
  1468. }
  1469. }
  1470. .four{
  1471. border: 1px solid #FF5C5C;
  1472. .Left{
  1473. float: left;
  1474. width: 55px;
  1475. text-align: center;
  1476. i{font-size: 36px;color:#FF5C5C;line-height: 90px;}
  1477. }
  1478. .Right{
  1479. float: left;
  1480. flex: 1;
  1481. height: 60px;
  1482. font-weight: 600;
  1483. font-size: 14px;
  1484. line-height: 30px;
  1485. margin-top:15px;
  1486. span{
  1487. display: inline-block;
  1488. width: 150px;
  1489. text-align: right;
  1490. }
  1491. }
  1492. }
  1493. .car{
  1494. width:100%;height:150px;
  1495. display:flex;
  1496. display: -webkit-flex;
  1497. -webkit-flex-direction:row;
  1498. i{font-size: 50px;width:50px;display: block;line-height: 150px;}
  1499. .carList{
  1500. flex:1;height: 130px;
  1501. .list{
  1502. height: 130px;color: #fff;
  1503. // box-shadow: #000 0px 0px 10px;
  1504. // border-radius: 10px;
  1505. .list-l{
  1506. p{
  1507. padding-left:10px;font-size:13px;line-height: 16px; text-overflow: ellipsis;white-space:nowrap; overflow:hidden;
  1508. }
  1509. }
  1510. .list-r{
  1511. p{
  1512. font-size:13px;line-height: 16px;text-overflow: ellipsis;white-space:nowrap; overflow:hidden;
  1513. }
  1514. }
  1515. }
  1516. }
  1517. }
  1518. }
  1519. }
  1520. </style>