12e628561cf33ff7c69224ede2a5ff2bdaed7b8e.svn-base 50 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297
  1. <template>
  2. <div class="dashboard-editor-container">
  3. <h1>集团</h1>
  4. <div class="search">
  5. <el-row>
  6. <el-col :span="6">
  7. <el-form label-position="right" label-width="85px">
  8. <el-form-item label="统计范围:">
  9. <el-date-picker v-model="inputDatetime" :clearable="false" class="inputDatetime filter-item" type="daterange" :picker-options="pickerOptions" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" align="right" @change="changeDate" />
  10. </el-form-item>
  11. </el-form>
  12. </el-col>
  13. </el-row>
  14. </div>
  15. <div class="bottom">
  16. <h4>{{ date }}</h4>
  17. <el-row :gutter="20" style="margin-top: 10px;">
  18. <el-col :span="6">
  19. <div class="grid-content one">
  20. <div class="Left">
  21. <i class="iconfont icon-shuaxin" />
  22. </div>
  23. <div class="Right">
  24. <span>混料平均准确率:</span>{{ row1.list[0].rateAvg }}<br>
  25. <span>混料最高准确率:</span>{{ row1.list[0].rateMAX }}<br>
  26. <span>混料最低准确率:</span>{{ row1.list[0].rateMIN }}
  27. </div>
  28. </div>
  29. </el-col>
  30. <el-col :span="6">
  31. <div class="grid-content two">
  32. <div class="Left">
  33. <i class="iconfont icon-zhunqueshuai2" />
  34. </div>
  35. <div class="Right">
  36. <span>撒料平均准确率:</span>{{ row1.list[1].rateAvg }}<br>
  37. <span>撒料最高准确率:</span>{{ row1.list[1].rateMAX }}<br>
  38. <span>撒料最低准确率:</span>{{ row1.list[1].rateMIN }}
  39. </div>
  40. </div>
  41. </el-col>
  42. <el-col :span="6">
  43. <div class="grid-content three">
  44. <div class="Left">
  45. <i class="iconfont icon-zhinengsiwei" style="font-size: 40px;" />
  46. </div>
  47. <div class="Right">
  48. <span>撒料平均正确率:</span>{{ row1.list[2].rateAvg }}<br>
  49. <span>撒料最高正确率:</span>{{ row1.list[2].rateMAX }}<br>
  50. <span>撒料最低正确率:</span>{{ row1.list[2].rateMIN }}
  51. </div>
  52. </div>
  53. </el-col>
  54. <el-col :span="6">
  55. <div class="grid-content four">
  56. <div class="Left">
  57. <i class="iconfont icon-siliaotoufangjilu" style="font-size: 50px;" />
  58. </div>
  59. <div class="Right">
  60. <span style="width:116px;">撒料平均偏差:</span>{{ row1.list[3].rateAvg }} min<br>
  61. <span style="width:116px;">撒料最高偏差:</span>{{ row1.list[3].rateMAX }} min<br>
  62. <span style="width:116px;">撒料最低偏差:</span>{{ row1.list[3].rateMIN }} min
  63. </div>
  64. </div>
  65. </el-col>
  66. </el-row>
  67. <el-row :gutter="20" style="margin-top: 20px;">
  68. <el-col :span="6">
  69. <div class="grid-content" style="height:500px;background: #fff;">
  70. <div style="height: 250px; border-bottom: 1px solid #000;">
  71. <b style="padding-left: 10px;line-height: 50px;font-size: 20px;">今日计划统计</b><br>
  72. <div style="text-align: center;">
  73. <b style="padding-right: 10px;font-size: 14px;">完成车次:{{ row2.chart1.chartLine_data.data1 }}</b>
  74. <b style="padding-right: 10px;font-size: 14px;">计划车次:{{ row2.chart1.chartLine_data.data2 }}</b>
  75. </div>
  76. <div id="row2chartLine1" style="height: 150px;" />
  77. </div>
  78. <div style="height: 250px;">
  79. <div style="text-align: center;padding-top:50px;">
  80. <b style="padding-right: 5px;font-size: 14px;">完成重量:{{ row2.chart2.chartLine_data.data1 }}kg</b>
  81. <b style="padding-right: 5px;font-size: 14px;">计划重量:{{ row2.chart2.chartLine_data.data2 }}kg</b>
  82. </div>
  83. <div id="row2chartLine2" style="height: 150px;" />
  84. </div>
  85. </div>
  86. </el-col>
  87. <el-col :span="18">
  88. <div class="grid-content" style="height:500px;overflow: auto;">
  89. <h4>当前车辆数:{{ row2.carLength }}</h4>
  90. <div class="car" style="position: relative;">
  91. <el-row :gutter="20" class="carList">
  92. <el-col v-for="(item,index) in row2.list" :key="index" :span="8">
  93. <div ref="list" class="list" :style="{'background': item.background,'color':item.color}" @click="handleList(index,item)">
  94. <el-row :gutter="20">
  95. <el-col :span="12" class="list-l">
  96. <!-- 车辆/描述 -->
  97. <p><span>车辆:</span>{{ item.tname }}</p>
  98. <el-tooltip placement="top">
  99. <p slot="content">
  100. <span v-if="item.inorout == 0">饲料:{{ item.fname }}</span>
  101. <span v-if="item.inorout == 1">栏舍:{{ item.fname }}</span>
  102. </p>
  103. <p>
  104. <span v-if="item.inorout == 0">饲料:{{ item.fname }}</span>
  105. <span v-if="item.inorout == 1">栏舍:{{ item.fname }}</span>
  106. </p>
  107. </el-tooltip>
  108. <p><span>完成重量:</span>{{ item.doneweight }}</p>
  109. <p><span>完成度:</span>{{ item.donerate }}</p>
  110. </el-col>
  111. <el-col :span="12" class="list-r">
  112. <!-- 栏舍/饲料 -->
  113. <el-tooltip placement="top">
  114. <p slot="content"> <span>描述:</span> {{ item.remark }} </p>
  115. <p> <span>描述:</span> {{ item.remark }} </p>
  116. </el-tooltip>
  117. <p><span>计划重量:</span>{{ item.lweight }}</p>
  118. <p><span>剩余重量:</span>{{ item.leftweight }}</p>
  119. <p><span>车辆当前载重:</span>{{ item.nowweight }}</p>
  120. </el-col>
  121. </el-row>
  122. </div>
  123. </el-col>
  124. </el-row>
  125. </div>
  126. </div>
  127. </el-col>
  128. </el-row>
  129. <el-row :gutter="20" style="margin-top: 20px;">
  130. <el-col :span="12" style="position: relative;">
  131. <div class="Title">计划统计<span>({{ myDate }})</span></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">泌乳牛干物质采食量<span>({{ myDate }})</span></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" style="margin-top: 20px;">
  199. <!-- 成本统计 -->
  200. <el-col :span="8" style="position: relative;">
  201. <div class="Title">成本统计<span>({{ myDate }})</span></div>
  202. <div style="background: #fff;height:50px;">
  203. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleExport('row4chartLine1')">导出</el-button>
  204. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleTable('row4chartLine1')">切换表格</el-button>
  205. </div>
  206. <div id="row4chartLine1" style="background: #fff;height:350px;" />
  207. <div v-if="row4.chart1.isTable" class="table" style="position: absolute;width:97%;top:19px;">
  208. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleExport('row4chartLine1')">导出</el-button>
  209. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleChart('row4chartLine1')">切换图表</el-button>
  210. <el-table
  211. :key="row4.chart1.table.tableKey"
  212. v-loading="row4.chart1.table.listLoading"
  213. element-loading-text="给我一点时间"
  214. :data="row4.chart1.table.list"
  215. border
  216. fit
  217. highlight-current-row
  218. style="width: 100%;"
  219. height="400"
  220. :row-style="rowStyle"
  221. :cell-style="cellStyle"
  222. class="elTable table-fixed"
  223. >
  224. <el-table-column label="日期" sortable min-width="110px" align="center" prop="日期" />
  225. <el-table-column label="泌乳牛采食量(kg)" sortable min-width="110px" align="center" prop="field1" />
  226. <el-table-column label="泌乳牛产奶量(kg)" sortable min-width="110px" align="center" prop="field2" />
  227. </el-table>
  228. </div>
  229. </el-col>
  230. <el-col :span="8" style="position: relative;">
  231. <div class="Title">混料实际重量统计<span>({{ myDate }})</span></div>
  232. <div style="background: #fff;height:50px;">
  233. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleExport('row4chartLine2')">导出</el-button>
  234. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleTable('row4chartLine2')">切换表格</el-button>
  235. </div>
  236. <div id="row4chartLine2" style="background: #fff;height:350px;" />
  237. <div v-if="row4.chart2.isTable" class="table" style="position: absolute;width:97%;top:19px;">
  238. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleExport('row4chartLine2')">导出</el-button>
  239. <el-button type="text" style="float: right;margin-right: 5px;" @click="handleChart('row4chartLine2')">切换图表</el-button>
  240. <el-table
  241. :key="row4.chart2.table.tableKey"
  242. v-loading="row4.chart2.table.listLoading"
  243. element-loading-text="给我一点时间"
  244. :data="row4.chart2.table.list"
  245. border
  246. fit
  247. highlight-current-row
  248. style="width: 100%;"
  249. height="400"
  250. :row-style="rowStyle"
  251. :cell-style="cellStyle"
  252. class="elTable table-fixed"
  253. >
  254. <el-table-column label="日期" sortable min-width="110px" align="center" prop="日期" />
  255. <el-table-column label="泌乳牛采食量(kg)" sortable min-width="110px" align="center" prop="field1" />
  256. <el-table-column label="泌乳牛产奶量(kg)" sortable min-width="110px" align="center" prop="field2" />
  257. </el-table>
  258. </div>
  259. </el-col>
  260. <el-col :span="8">
  261. <div class="Title">库存预警</div>
  262. <div id="table" style="height: 400px;background: #fff;">
  263. <el-table
  264. :key="row4.table.tableKey"
  265. v-loading="row4.table.listLoading"
  266. element-loading-text="给我一点时间"
  267. :data="row4.table.list"
  268. border
  269. fit
  270. highlight-current-row
  271. style="width: 100%;background: #fff;"
  272. height="400"
  273. :row-style="rowStyle"
  274. :cell-style="cellStyle"
  275. class="elTable table-fixed"
  276. >
  277. <el-table-column label="序号" type="index" min-width="80px" align="center" />
  278. <el-table-column label="牧场" min-width="80px" align="center" prop="pasturename" />
  279. <el-table-column label="饲料名称" min-width="80px" align="center" prop="feedname" />
  280. <el-table-column label="库存量(kg)" min-width="70px" align="center" prop="stockweight" />
  281. <el-table-column label="剩余使用天数" min-width="80px" align="center" prop="ldays" />
  282. </el-table>
  283. </div>
  284. </el-col>
  285. </el-row>
  286. </div>
  287. </div>
  288. </template>
  289. <script>
  290. import { GetDataByName, GetReportform } from '@/api/common'
  291. import Cookies from 'js-cookie'
  292. import { parseTime } from '@/utils/index.js'
  293. import echarts from 'echarts'
  294. import { json2excel } from '@/utils/index.js'
  295. require('echarts/theme/macarons')
  296. export default {
  297. name: 'GroupDashboard',
  298. data() {
  299. return {
  300. inputDatetime: [new Date().setTime(new Date().getTime() - 3600 * 1000 * 24 * 7), new Date()],
  301. myDate: parseTime(new Date().setTime(new Date().getTime() - 3600 * 1000 * 24 * 7), '{y}/{m}/{d}') + '-' + parseTime(new Date(), '{y}/{m}/{d}'),
  302. pickerOptions: {
  303. shortcuts: [{
  304. text: '最近一周',
  305. onClick(picker) {
  306. const end = new Date()
  307. const start = new Date()
  308. start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
  309. picker.$emit('pick', [start, end])
  310. }
  311. }, {
  312. text: '最近一个月',
  313. onClick(picker) {
  314. const end = new Date()
  315. const start = new Date()
  316. start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
  317. picker.$emit('pick', [start, end])
  318. }
  319. }, {
  320. text: '最近一年',
  321. onClick(picker) {
  322. const end = new Date()
  323. const start = new Date()
  324. start.setTime(start.getTime() - 3600 * 1000 * 24 * 365)
  325. picker.$emit('pick', [start, end])
  326. }
  327. }]
  328. },
  329. date: parseTime(new Date(), '{y}-{m}-{d}'),
  330. row1: {
  331. getdataListParm: {
  332. name: 'getHomepageStrJT',
  333. page: 1,
  334. offset: 1,
  335. pagecount: 10,
  336. returntype: 'Map',
  337. parammaps: {
  338. pastureid: Cookies.get('pastureid')
  339. }
  340. },
  341. listLoading: true,
  342. list: ''
  343. },
  344. row2: {
  345. chart1: {
  346. chartLine: null,
  347. chartLine_data: {}
  348. },
  349. chart2: {
  350. chartLine: null,
  351. chartLine_data: {}
  352. },
  353. list: [],
  354. total: 0,
  355. listLoading: true,
  356. getdataListParmList: {
  357. name: 'getHomepageLBList',
  358. page: 1,
  359. offset: 1,
  360. pagecount: 3,
  361. returntype: 'Map',
  362. parammaps: {
  363. pastureid: Cookies.get('pastureid')
  364. }
  365. }
  366. },
  367. row3: {
  368. chartDate: [],
  369. chart1: {
  370. chartLine: null,
  371. chartLine_data: {},
  372. getdataListParm: {
  373. name: 'getAccuracyAllJH',
  374. page: 1,
  375. offset: 1,
  376. pagecount: 10,
  377. returntype: 'Map',
  378. parammaps: {
  379. pastureid: Cookies.get('pastureid'),
  380. startTime: parseTime(new Date(), '{y}-{m}-{d}'),
  381. stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
  382. inputDatetime: [new Date(), new Date()]
  383. }
  384. },
  385. list: [],
  386. total: 0,
  387. listLoading: true,
  388. isChart: true,
  389. isTable: false,
  390. table: {
  391. tableKey: 1,
  392. list: [],
  393. total: 0,
  394. listLoading: false
  395. }
  396. },
  397. chart2: {
  398. chartLine: null,
  399. chartLine_data: {},
  400. getdataListParm: {
  401. name: 'getFeedEffMR',
  402. page: 1,
  403. offset: 1,
  404. pagecount: 10,
  405. returntype: 'Map',
  406. parammaps: {
  407. pastureid: Cookies.get('pastureid'),
  408. startTime: parseTime(new Date(), '{y}-{m}-{d}'),
  409. stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
  410. inputDatetime: [new Date(), new Date()]
  411. }
  412. },
  413. list: [],
  414. total: 0,
  415. listLoading: true,
  416. isChart: true,
  417. isTable: false,
  418. table: {
  419. tableKey: 1,
  420. list: [],
  421. total: 0,
  422. listLoading: false
  423. }
  424. }
  425. },
  426. row4: {
  427. chartDate: [],
  428. chart1: {
  429. chartLine: null,
  430. chartLine_data: {},
  431. getdataListParm: {
  432. name: 'getAccuracyAllJH',
  433. page: 1,
  434. offset: 1,
  435. pagecount: 10,
  436. returntype: 'Map',
  437. parammaps: {
  438. pastureid: Cookies.get('pastureid'),
  439. startTime: parseTime(new Date(), '{y}-{m}-{d}'),
  440. stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
  441. inputDatetime: [new Date(), new Date()]
  442. }
  443. },
  444. list: [],
  445. total: 0,
  446. listLoading: true,
  447. isChart: true,
  448. isTable: false,
  449. table: {
  450. tableKey: 1,
  451. list: [],
  452. total: 0,
  453. listLoading: false
  454. }
  455. },
  456. chart2: {
  457. chartLine: null,
  458. chartLine_data: {},
  459. getdataListParm: {
  460. name: 'getAccuracActHLJT',
  461. page: 1,
  462. offset: 1,
  463. pagecount: 10,
  464. returntype: 'Map',
  465. parammaps: {
  466. pastureid: Cookies.get('pastureid'),
  467. startTime: parseTime(new Date(), '{y}-{m}-{d}'),
  468. stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
  469. inputDatetime: [new Date(), new Date()]
  470. }
  471. },
  472. list: [],
  473. total: 0,
  474. listLoading: true,
  475. isChart: true,
  476. isTable: false,
  477. table: {
  478. tableKey: 1,
  479. list: [],
  480. total: 0,
  481. listLoading: false
  482. }
  483. },
  484. table: {
  485. getdataListParm: {
  486. name: 'getFsWarnListJT',
  487. page: 1,
  488. offset: 1,
  489. pagecount: 5,
  490. returntype: 'Map',
  491. parammaps: {
  492. pastureid: Cookies.get('pastureid')
  493. }
  494. },
  495. tableKey: 1,
  496. list: [],
  497. total: 0,
  498. listLoading: true,
  499. temp: {}
  500. }
  501. },
  502. rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
  503. cellStyle: { padding: 0 + 'px' }
  504. }
  505. },
  506. created() {
  507. this.getRow1List()
  508. this.getRow2List1()
  509. this.getRow3List1()
  510. this.getRow3List2()
  511. this.getRow4List1()
  512. this.getRow4List2()
  513. this.getRow4List3()
  514. },
  515. methods: {
  516. changeDate(item) {
  517. this.myDate = parseTime(this.inputDatetime[0], '{y}/{m}/{d}') + '-' + parseTime(this.inputDatetime[1], '{y}/{m}/{d}')
  518. },
  519. getRow1List() {
  520. this.row1.listLoading = true
  521. GetDataByName(this.row1.getdataListParm).then(response => {
  522. console.log('row1数据', response.data.list)
  523. if (response.data.list !== null) {
  524. for (let i = 0; i < response.data.list.length; i++) {
  525. if (response.data.list[i].rateAvg == undefined) {
  526. this.$set(response.data.list[i], 'rateAvg', '')
  527. }
  528. if (response.data.list[i].rateMAX == undefined) {
  529. this.$set(response.data.list[i], 'rateMAX', '')
  530. }
  531. if (response.data.list[i].rateMIN == undefined) {
  532. this.$set(response.data.list[i], 'rateMIN', '')
  533. }
  534. }
  535. this.row1.list = response.data.list
  536. this.row2.chart1.chartLine_data.data1 = parseFloat(response.data.list[0].doneTimes)
  537. this.row2.chart1.chartLine_data.data2 = parseFloat(response.data.list[0].planTimes)
  538. this.row2.chart2.chartLine_data.data1 = parseFloat(response.data.list[0].doneWeight)
  539. this.row2.chart2.chartLine_data.data2 = parseFloat(response.data.list[0].planWeight)
  540. this.roadRow1ChartLine1(this.row2.chart1.chartLine_data)
  541. this.roadRow1ChartLine2(this.row2.chart2.chartLine_data)
  542. } else {
  543. this.row1.list.data1.monRateHL = ''
  544. this.row1.list.data1.monRateSL = ''
  545. this.row1.list.data1.monRateSLR = ''
  546. this.row1.list.data1.yesRateHL = ''
  547. this.row1.list.data1.yesRateSL = ''
  548. this.row1.list.data1.yesRateSLR = ''
  549. this.row1.list.data1.temtime = ''
  550. this.row1.list.data1.montime = ''
  551. this.row2.chart1.chartLine_data.data1 = ''
  552. this.row2.chart1.chartLine_data.data2 = ''
  553. this.row2.chart2.chartLine_data.data1 = ''
  554. this.row2.chart2.chartLine_data.data2 = ''
  555. }
  556. setTimeout(() => {
  557. this.row1.listLoading = false
  558. }, 100)
  559. })
  560. },
  561. // 今日计划统计-完成车次
  562. roadRow1ChartLine1(chartLine_data) {
  563. console.log(chartLine_data)
  564. if (this.row2.chart1.chartLine != null) {
  565. this.row2.chart1.chartLine.dispose()
  566. }
  567. this.row2.chart1.chartLine = echarts.init(document.getElementById('row2chartLine1'))
  568. var option = {
  569. // 标题组件,包含主标题和副标题
  570. title: {
  571. show: true,
  572. x: 'center',
  573. textStyle: {
  574. fontSize: '15',
  575. color: 'green',
  576. fontWeight: 'bold'
  577. }
  578. },
  579. // 提示框组件
  580. tooltip: {
  581. // 是否显示提示框组件,包括提示框浮层和 axisPointe
  582. show: false,
  583. // 触发类型: item:数据项触发,axis:坐标轴触发
  584. trigger: 'item',
  585. formatter: '{a} <br/>{b}: {c} ({d}%)'
  586. },
  587. // 系列列表。每个系列通过 type 决定自己的图表类型
  588. series: [{
  589. // 系列名称,用于tooltip的显示,legend 的图例筛选,在 setOption 更新数据和配置项时用于指定对应的系列。
  590. name: '任务进度',
  591. type: 'pie',
  592. // 饼图的半径,数组的第一项是内半径,第二项是外半径
  593. radius: ['80%', '70%'],
  594. // 是否启用防止标签重叠策略,默认开启
  595. avoidLabelOverlap: false,
  596. hoverAnimation: false,
  597. // 标签的视觉引导线样式,在 label 位置 设置为'outside'的时候会显示视觉引导线
  598. labelLine: {
  599. normal: {
  600. show: false
  601. }
  602. },
  603. data: [{
  604. value: chartLine_data.data1, // 数据值
  605. name: '完成率', // 数据项名称
  606. selected: false, // 该数据项是否被选中
  607. // 单个扇区的标签配置
  608. label: {
  609. normal: {
  610. show: true, // 是显示标签
  611. position: 'center',
  612. fontSize: 20,
  613. // 标签内容格式器,支持字符串模板和回调函数两种形式,字符串模板与回调函数返回的字符串均支持用 \n 换行
  614. formatter: '{b}\n{d}%'
  615. }
  616. }
  617. }, {
  618. value: chartLine_data.data2 - chartLine_data.data1,
  619. label: {
  620. normal: {
  621. show: false
  622. }
  623. }
  624. }]
  625. }],
  626. color: ['#409EFF', '#B7DBFF']
  627. }
  628. this.row2.chart1.chartLine.setOption(option)
  629. window.onresize = function() {
  630. this.row2.chart1.chartLine.resize()
  631. }
  632. },
  633. // 今日计划统计-完成重量
  634. roadRow1ChartLine2(chartLine_data) {
  635. if (this.row2.chart2.chartLine != null) {
  636. this.row2.chart2.chartLine.dispose()
  637. }
  638. this.row2.chart2.chartLine = echarts.init(document.getElementById('row2chartLine2'))
  639. var option = {
  640. // 标题组件,包含主标题和副标题
  641. title: {
  642. show: true,
  643. x: 'center',
  644. textStyle: {
  645. fontSize: '15',
  646. color: 'green',
  647. fontWeight: 'bold'
  648. }
  649. },
  650. // 提示框组件
  651. tooltip: {
  652. // 是否显示提示框组件,包括提示框浮层和 axisPointe
  653. show: false,
  654. // 触发类型: item:数据项触发,axis:坐标轴触发
  655. trigger: 'item',
  656. formatter: '{a} <br/>{b}: {c} ({d}%)'
  657. },
  658. // 系列列表。每个系列通过 type 决定自己的图表类型
  659. series: [{
  660. // 系列名称,用于tooltip的显示,legend 的图例筛选,在 setOption 更新数据和配置项时用于指定对应的系列。
  661. name: '任务进度',
  662. type: 'pie',
  663. // 饼图的半径,数组的第一项是内半径,第二项是外半径
  664. radius: ['80%', '70%'],
  665. // 是否启用防止标签重叠策略,默认开启
  666. avoidLabelOverlap: false,
  667. hoverAnimation: false,
  668. // 标签的视觉引导线样式,在 label 位置 设置为'outside'的时候会显示视觉引导线
  669. labelLine: {
  670. normal: {
  671. show: false
  672. }
  673. },
  674. data: [{
  675. value: chartLine_data.data1, // 数据值
  676. name: '完成率', // 数据项名称
  677. selected: false, // 该数据项是否被选中
  678. // 单个扇区的标签配置
  679. label: {
  680. normal: {
  681. show: true, // 是显示标签
  682. position: 'center',
  683. fontSize: 20,
  684. // 标签内容格式器,支持字符串模板和回调函数两种形式,字符串模板与回调函数返回的字符串均支持用 \n 换行
  685. formatter: '{b}\n{d}%'
  686. }
  687. }
  688. }, {
  689. value: chartLine_data.data2 - chartLine_data.data1,
  690. label: {
  691. normal: {
  692. show: false
  693. }
  694. }
  695. }]
  696. }],
  697. color: ['#409EFF', '#B7DBFF']
  698. }
  699. this.row2.chart2.chartLine.setOption(option)
  700. window.onresize = function() {
  701. this.row2.chart2.chartLine.resize()
  702. }
  703. },
  704. // 今日执行计划监控
  705. getRow2List1() {
  706. this.row2.listLoading2 = true
  707. GetDataByName(this.row2.getdataListParmList).then(response => {
  708. if (response.data.list !== null) {
  709. response.data.list = [
  710. { 'datacaptureno': 1, 'donerate': '198.14%', 'doneweight': 510, 'fname': '测试饲料1,测试饲料0927', 'id': '3052755377885545472', 'inorout': 0, 'lastactualweight': '100.0', 'leftweight': -252.60000000000002, 'lweight': '257.40', 'nowweight': 610, 'pid': '575305', 'tname': '卧式固定TMR搅拌机' },
  711. { 'datacaptureno': 1, 'donerate': '198.14%', 'doneweight': 510, 'fname': '测试饲料1,测试饲料0927', 'id': '3052755377885545472', 'inorout': 0, 'lastactualweight': '100.0', 'leftweight': -252.60000000000002, 'lweight': '257.40', 'nowweight': 610, 'pid': '575305', 'tname': '卧式固定TMR搅拌机2' },
  712. { 'datacaptureno': 1, 'donerate': '198.14%', 'doneweight': 510, 'fname': '测试饲料1,测试饲料0927', 'id': '3052755377885545472', 'inorout': 0, 'lastactualweight': '100.0', 'leftweight': -252.60000000000002, 'lweight': '257.40', 'nowweight': 610, 'pid': '575305', 'tname': '卧式固定TMR搅拌机3' },
  713. { 'datacaptureno': 1, 'donerate': '198.14%', 'doneweight': 510, 'fname': '测试饲料1,测试饲料0927', 'id': '3052755377885545472', 'inorout': 0, 'lastactualweight': '100.0', 'leftweight': -252.60000000000002, 'lweight': '257.40', 'nowweight': 610, 'pid': '575305', 'tname': '卧式固定TMR搅拌机4' },
  714. { 'datacaptureno': 1, 'donerate': '198.14%', 'doneweight': 510, 'fname': '测试饲料1,测试饲料0927', 'id': '3052755377885545472', 'inorout': 0, 'lastactualweight': '100.0', 'leftweight': -252.60000000000002, 'lweight': '257.40', 'nowweight': 610, 'pid': '575305', 'tname': '卧式固定TMR搅拌机4' },
  715. { 'datacaptureno': 1, 'donerate': '198.14%', 'doneweight': 510, 'fname': '测试饲料1,测试饲料0927', 'id': '3052755377885545472', 'inorout': 0, 'lastactualweight': '100.0', 'leftweight': -252.60000000000002, 'lweight': '257.40', 'nowweight': 610, 'pid': '575305', 'tname': '卧式固定TMR搅拌机4' },
  716. { 'datacaptureno': 1, 'donerate': '198.14%', 'doneweight': 510, 'fname': '测试饲料1,测试饲料0927', 'id': '3052755377885545472', 'inorout': 0, 'lastactualweight': '100.0', 'leftweight': -252.60000000000002, 'lweight': '257.40', 'nowweight': 610, 'pid': '575305', 'tname': '卧式固定TMR搅拌机4' },
  717. { 'datacaptureno': 1, 'donerate': '198.14%', 'doneweight': 510, 'fname': '测试饲料1,测试饲料0927', 'id': '3052755377885545472', 'inorout': 0, 'lastactualweight': '100.0', 'leftweight': -252.60000000000002, 'lweight': '257.40', 'nowweight': 610, 'pid': '575305', 'tname': '卧式固定TMR搅拌机4' },
  718. { 'datacaptureno': 1, 'donerate': '198.14%', 'doneweight': 510, 'fname': '测试饲料1,测试饲料0927', 'id': '3052755377885545472', 'inorout': 0, 'lastactualweight': '100.0', 'leftweight': -252.60000000000002, 'lweight': '257.40', 'nowweight': 610, 'pid': '575305', 'tname': '卧式固定TMR搅拌机4' },
  719. { 'datacaptureno': 1, 'donerate': '198.14%', 'doneweight': 510, 'fname': '测试饲料1,测试饲料0927', 'id': '3052755377885545472', 'inorout': 0, 'lastactualweight': '100.0', 'leftweight': -252.60000000000002, 'lweight': '257.40', 'nowweight': 610, 'pid': '575305', 'tname': '卧式固定TMR搅拌机4' },
  720. { 'datacaptureno': 1, 'donerate': '198.14%', 'doneweight': 510, 'fname': '测试饲料1,测试饲料0927', 'id': '3052755377885545472', 'inorout': 0, 'lastactualweight': '100.0', 'leftweight': -252.60000000000002, 'lweight': '257.40', 'nowweight': 610, 'pid': '575305', 'tname': '卧式固定TMR搅拌机5' }
  721. ]
  722. for (let i = 0; i < response.data.list.length; i++) {
  723. this.$set(response.data.list[i], 'color', '#fff')
  724. this.$set(response.data.list[i], 'background', '#7ac3ec')
  725. }
  726. this.row2.list = response.data.list
  727. this.row2.carLength = response.data.total
  728. } else {
  729. this.carLength = 0
  730. }
  731. setTimeout(() => {
  732. this.row2.listLoading2 = false
  733. }, 100)
  734. })
  735. },
  736. handleTable(item) {
  737. console.log(item)
  738. if (item == 'row3chartLine1') {
  739. console.log('计划统计表格')
  740. this.row3.chart1.isTable = true
  741. this.row3.chart1.isChart = false
  742. } else if (item == 'row3chartLine2') {
  743. console.log('泌乳牛采食量表格')
  744. this.row3.chart2.isTable = true
  745. this.row3.chart2.isChart = false
  746. } else if (item == 'row4chartLine1') {
  747. console.log('成本统计表格')
  748. this.row4.chart1.isTable = true
  749. this.row4.chart1.isChart = false
  750. } else if (item == 'row4chartLine2') {
  751. console.log('混料实际重量统计表格')
  752. this.row4.chart2.isTable = true
  753. this.row4.chart2.isChart = false
  754. }
  755. },
  756. handleChart(item) {
  757. console.log(item)
  758. // 显示切换图表
  759. if (item == 'row3chartLine1') {
  760. console.log('计划统计图表')
  761. this.row3.chart1.isTable = false
  762. this.row3.chart1.isChart = true
  763. } else if (item == 'row3chartLine2') {
  764. console.log('泌乳牛采食量图表')
  765. this.row3.chart2.isTable = false
  766. this.row3.chart2.isChart = true
  767. } else if (item == 'row4chartLine1') {
  768. console.log('成本统计图表')
  769. this.row4.chart1.isTable = false
  770. this.row4.chart1.isChart = true
  771. } else if (item == 'row4chartLine2') {
  772. console.log('混料实际重量统计图表')
  773. this.row4.chart2.isTable = false
  774. this.row4.chart2.isChart = true
  775. }
  776. },
  777. handleExport(item) {
  778. console.log(item)
  779. // 显示切换图表
  780. if (item == 'row3chartLine1') {
  781. console.log('计划统计')
  782. var excelDatasTabChart1 = [
  783. {
  784. tHeader: ['日期', '计划执行重量(kg)', '配方理论重量(kg)', '计划准确率', '计划取消重量(kg)', '计划准确率(去除取消重量)', '计划正确数', '计划数', '计划正确率'],
  785. filterVal: ['日期', '实际量', '理论量', 'field1', '计划取消重量', 'field3', '正确数', '计划数', 'field2'],
  786. tableDatas: this.row3.chart1.table.list,
  787. sheetName: '计划统计'
  788. }
  789. ]
  790. json2excel(excelDatasTabChart1, '计划统计', true, 'xlsx')
  791. }
  792. },
  793. // 计划统计
  794. getRow3List1() {
  795. this.row3.chart1.listLoading = true
  796. GetReportform(this.row3.chart1.getdataListParm).then(response => {
  797. console.log('计划统计', response.data.list)
  798. if (response.data.list !== null) {
  799. this.row3.chart1.table.list = response.data.data
  800. this.row3.chart1.chartLine_data = response.data.list
  801. this.row3.chart1.chartLine_data = {
  802. 'data1': ['1牧', '2牧', '3牧', '4牧', '5牧', '6牧', '7牧', '8牧', '9牧', '10牧', '11牧', '12牧'], // x轴
  803. '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], // 计划准确率
  804. 'data3': [2.6, 5.9, 9.0, 30, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3], // 计划正确率
  805. 'data4': [2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3]// 计划准确率(去除取消重量)
  806. }
  807. this.row3.chart1.total = response.data.total
  808. this.roadRow3ChartLine1(this.row3.chart1.chartLine_data)
  809. } else {
  810. this.row3.chart1.list = []
  811. }
  812. setTimeout(() => {
  813. this.row3.chart1.listLoading = false
  814. }, 100)
  815. })
  816. },
  817. roadRow3ChartLine1(chartLine_data) {
  818. if (this.row3.chart1.chartLine != null) {
  819. this.row3.chart1.chartLine.dispose()
  820. }
  821. this.row3.chart1.chartLine = echarts.init(document.getElementById('row3chartLine1'))
  822. var option = {
  823. tooltip: {
  824. trigger: 'axis',
  825. axisPointer: {
  826. type: 'cross',
  827. crossStyle: {
  828. color: '#999'
  829. }
  830. }
  831. },
  832. legend: {
  833. data: ['计划准确率', '计划正确率', '计划准确率(去除取消重量)']
  834. },
  835. xAxis: [{ type: 'category', data: chartLine_data.data1, axisPointer: { type: 'shadow' }}],
  836. yAxis: [{ type: 'value', name: '百分比', min: 0, max: 100, interval: 20, axisLabel: { formatter: '{value}' }}],
  837. series: [{ name: '计划准确率', type: 'bar', itemStyle: { normal: { color: '#7ecf51' }},
  838. data: chartLine_data.data2,
  839. markLine: {
  840. data: [{ type: 'average' }],
  841. symbol: ['none', 'none'],
  842. position: 'insideTopCenter',
  843. itemStyle: {
  844. normal: {
  845. lineStyle: { type: 'dotted' },
  846. label: { show: true, position: 'middle', formatter: '' }
  847. }
  848. },
  849. large: true,
  850. effect: { show: false, loop: true, period: 0, scaleSize: 2, color: null, shadowColor: null, shadowBlur: null }
  851. }
  852. },
  853. {
  854. name: '计划正确率',
  855. type: 'bar',
  856. itemStyle: {
  857. normal: {
  858. color: '#ff6600'
  859. }
  860. },
  861. data: chartLine_data.data3,
  862. markLine: {
  863. data: [{ type: 'average' }],
  864. symbol: ['none', 'none'],
  865. position: 'insideTopCenter',
  866. itemStyle: {
  867. normal: {
  868. lineStyle: { type: 'dotted' },
  869. label: { show: true, position: 'middle', formatter: '' }
  870. }
  871. },
  872. large: true,
  873. effect: { show: false, loop: true, period: 0, scaleSize: 2, color: null, shadowColor: null, shadowBlur: null }
  874. }
  875. },
  876. {
  877. name: '计划准确率(去除取消重量)',
  878. type: 'bar',
  879. itemStyle: {
  880. normal: {
  881. color: '#61a5e8'
  882. }
  883. },
  884. data: chartLine_data.data4,
  885. markLine: {
  886. data: [{ type: 'average' }],
  887. symbol: ['none', 'none'],
  888. position: 'insideTopCenter',
  889. itemStyle: {
  890. normal: {
  891. lineStyle: { type: 'dotted' },
  892. label: { show: true, position: 'middle', formatter: '' }
  893. }
  894. },
  895. large: true,
  896. effect: { show: false, loop: true, period: 0, scaleSize: 2, color: null, shadowColor: null, shadowBlur: null }
  897. }
  898. }
  899. ]
  900. }
  901. this.row3.chart1.chartLine.setOption(option)
  902. window.onresize = function() {
  903. this.row3.chart1.chartLine.resize()
  904. }
  905. },
  906. // 泌乳牛干物质采食量
  907. getRow3List2() {
  908. this.row3.chart2.listLoading = true
  909. GetReportform(this.row3.chart2.getdataListParm).then(response => {
  910. console.log('泌乳牛采食量数据', response.data.list)
  911. if (response.data.list !== null) {
  912. this.row3.chart2.table.list = response.data.data
  913. this.row3.chart2.chartLine_data = response.data.list
  914. this.row3.chart2.chartLine_data = {
  915. data1: ['1牧', '2牧', '3牧'], // 折线
  916. data2: ['12/01', '12/02', '12/03'], // X轴
  917. data3: [
  918. { data: [1.5, 1.2, 1.7, 1.2] },
  919. { data: [1.7, 0.8, 1.2, 1.8] },
  920. { data: [1.3, 2.2, 1.9, 1.4] }
  921. ]// 折线对应数据
  922. }
  923. this.row3.chart2.total = response.data.total
  924. this.roadRow3ChartLine2(this.row3.chart2.chartLine_data)
  925. } else {
  926. this.row3.chart2.list = []
  927. }
  928. setTimeout(() => {
  929. this.row3.chart2.listLoading = false
  930. }, 100)
  931. })
  932. },
  933. roadRow3ChartLine2(chartLine_data) {
  934. if (this.row3.chart2.chartLine != null) {
  935. this.row3.chart2.chartLine.dispose()
  936. }
  937. this.row3.chart2.chartLine = echarts.init(document.getElementById('row3chartLine2'))
  938. var option = {
  939. title: {
  940. text: ''
  941. },
  942. tooltip: {
  943. trigger: 'axis'
  944. },
  945. legend: {
  946. data: chartLine_data.data1,
  947. right: 10
  948. },
  949. grid: {
  950. top: '20%',
  951. left: '5%',
  952. right: '8%',
  953. containLabel: true
  954. },
  955. toolbox: {
  956. show: true,
  957. right: '2%',
  958. feature: {}
  959. },
  960. xAxis: { type: 'category', boundaryGap: false, data: chartLine_data.data2, name: '日期' },
  961. yAxis: {
  962. type: 'value', name: 'kg', axisLabel: { formatter: '{value}' }
  963. },
  964. series: (function() {
  965. var serie = []
  966. for (var i = 0; i < chartLine_data.data3.length; i++) {
  967. var item = {
  968. name: chartLine_data.data1[i],
  969. type: 'line',
  970. data: chartLine_data.data3[i].data
  971. }
  972. serie.push(item)
  973. }
  974. return serie
  975. }())
  976. }
  977. this.row3.chart2.chartLine.setOption(option)
  978. window.onresize = function() {
  979. this.row3.chart2.chartLine.resize()
  980. }
  981. },
  982. // 成本统计
  983. getRow4List1() {
  984. this.row4.chart1.listLoading = true
  985. GetReportform(this.row4.chart1.getdataListParm).then(response => {
  986. console.log('成本统计数据', response.data.list)
  987. if (response.data.list !== null) {
  988. this.row4.chart1.table.list = response.data.data
  989. this.row4.chart1.chartLine_data = response.data.list
  990. this.row4.chart1.chartLine_data = {
  991. data1: ['1牧', '2牧', '3牧'], // 折线
  992. data2: ['12/01', '12/02', '12/03'], // X轴
  993. data3: [
  994. { data: [1.5, 1.2, 1.7, 1.2] },
  995. { data: [1.7, 0.8, 1.2, 1.8] },
  996. { data: [1.3, 2.2, 1.9, 1.4] }
  997. ]// 折线对应数据
  998. }
  999. this.row4.chart1.total = response.data.total
  1000. this.roadRow4ChartLine1(this.row4.chart1.chartLine_data)
  1001. } else {
  1002. this.row4.chart1.list = []
  1003. }
  1004. setTimeout(() => {
  1005. this.row4.chart1.listLoading = false
  1006. }, 100)
  1007. })
  1008. },
  1009. roadRow4ChartLine1(chartLine_data) {
  1010. if (this.row4.chart1.chartLine != null) {
  1011. this.row4.chart1.chartLine.dispose()
  1012. }
  1013. this.row4.chart1.chartLine = echarts.init(document.getElementById('row4chartLine1'))
  1014. var option = {
  1015. title: {
  1016. text: ''
  1017. },
  1018. tooltip: {
  1019. trigger: 'axis'
  1020. },
  1021. legend: {
  1022. data: chartLine_data.data1,
  1023. right: 10
  1024. },
  1025. grid: {
  1026. top: '20%',
  1027. left: '5%',
  1028. right: '8%',
  1029. containLabel: true
  1030. },
  1031. toolbox: {
  1032. show: true,
  1033. right: '2%',
  1034. feature: {}
  1035. },
  1036. xAxis: { type: 'category', boundaryGap: false, data: chartLine_data.data2, name: '日期' },
  1037. yAxis: {
  1038. type: 'value', name: 'kg', axisLabel: { formatter: '{value}' }
  1039. },
  1040. series: (function() {
  1041. var serie = []
  1042. for (var i = 0; i < chartLine_data.data3.length; i++) {
  1043. var item = {
  1044. name: chartLine_data.data1[i],
  1045. type: 'line',
  1046. data: chartLine_data.data3[i].data
  1047. }
  1048. serie.push(item)
  1049. }
  1050. return serie
  1051. }())
  1052. }
  1053. this.row4.chart1.chartLine.setOption(option)
  1054. window.onresize = function() {
  1055. this.row4.chart1.chartLine.resize()
  1056. }
  1057. },
  1058. // 混料实际重量统计
  1059. getRow4List2() {
  1060. this.row4.chart2.listLoading = true
  1061. GetReportform(this.row4.chart2.getdataListParm).then(response => {
  1062. console.log('混料实际重量统计数据', response.data.list)
  1063. if (response.data.list !== null) {
  1064. this.row4.chart2.table.list = response.data.data
  1065. this.row4.chart2.chartLine_data = response.data.list
  1066. // this.row4.chart2.chartLine_data = {
  1067. // data1: ['1牧', '2牧', '3牧'], // 折线
  1068. // data2: ['12/01', '12/02', '12/03'], // X轴
  1069. // data3: [
  1070. // { data: [1.5, 1.2, 1.7, 1.2] },
  1071. // { data: [1.7, 0.8, 1.2, 1.8] },
  1072. // { data: [1.3, 2.2, 1.9, 1.4] }
  1073. // ]// 折线对应数据
  1074. // }
  1075. this.row4.chart2.total = response.data.total
  1076. this.roadRow4ChartLine2(this.row4.chart2.chartLine_data)
  1077. } else {
  1078. this.row4.chart2.list = []
  1079. }
  1080. setTimeout(() => {
  1081. this.row4.chart2.listLoading = false
  1082. }, 100)
  1083. })
  1084. },
  1085. roadRow4ChartLine2(chartLine_data) {
  1086. if (this.row4.chart2.chartLine != null) {
  1087. this.row4.chart2.chartLine.dispose()
  1088. }
  1089. this.row4.chart2.chartLine = echarts.init(document.getElementById('row4chartLine2'))
  1090. var option = {
  1091. title: {
  1092. text: ''
  1093. },
  1094. tooltip: {
  1095. trigger: 'axis'
  1096. },
  1097. legend: {
  1098. data: chartLine_data.data1,
  1099. right: 10
  1100. },
  1101. grid: {
  1102. top: '20%',
  1103. left: '5%',
  1104. right: '8%',
  1105. containLabel: true
  1106. },
  1107. toolbox: {
  1108. show: true,
  1109. right: '2%',
  1110. feature: {}
  1111. },
  1112. xAxis: { type: 'category', boundaryGap: false, data: chartLine_data.data2, name: '日期' },
  1113. yAxis: {
  1114. type: 'value', name: 'kg', axisLabel: { formatter: '{value}' }
  1115. },
  1116. series: (function() {
  1117. var serie = []
  1118. for (var i = 0; i < chartLine_data.data3.length; i++) {
  1119. var item = {
  1120. name: chartLine_data.data1[i],
  1121. type: 'line',
  1122. data: chartLine_data.data3[i].data
  1123. }
  1124. serie.push(item)
  1125. }
  1126. return serie
  1127. }())
  1128. }
  1129. this.row4.chart2.chartLine.setOption(option)
  1130. window.onresize = function() {
  1131. this.row4.chart2.chartLine.resize()
  1132. }
  1133. },
  1134. getRow4List3() {
  1135. this.row4.table.listLoading = true
  1136. GetDataByName(this.row4.table.getdataListParm).then(response => {
  1137. console.log('库存预警table数据', response.data.list)
  1138. if (response.data.list !== null) {
  1139. this.row4.table.list = response.data.list
  1140. this.row4.table.total = response.data.total
  1141. } else {
  1142. this.row4.table.list = []
  1143. }
  1144. setTimeout(() => {
  1145. this.row4.table.listLoading = false
  1146. }, 100)
  1147. })
  1148. }
  1149. }
  1150. }
  1151. </script>
  1152. <style lang="scss" scoped>
  1153. .Title{
  1154. 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;
  1155. }
  1156. .dashboard-editor-container {
  1157. background-color: #F4F4F4;
  1158. min-height: 100vh;
  1159. }
  1160. .bottom{
  1161. padding:0 30px;
  1162. h4{text-align: right;}
  1163. .grid-content{
  1164. background: #fff;height: 125px;
  1165. border-radius: 10px;
  1166. }
  1167. .one{
  1168. border: 1px solid #82CBB3;height: 125px;
  1169. .Left{
  1170. float: left;
  1171. width: 65px;
  1172. text-align: center;
  1173. i{font-size: 36px;color:#82CBB3;line-height: 125px;}
  1174. }
  1175. .Right{
  1176. float: left;
  1177. margin-top:15px;
  1178. height: 60px;
  1179. font-weight: 600;
  1180. font-size: 14px;
  1181. line-height: 30px;
  1182. span{
  1183. display: inline-block;
  1184. width: 130px;
  1185. text-align: right;
  1186. }
  1187. }
  1188. }
  1189. .two{
  1190. border: 1px solid #FF9900;
  1191. .Left{
  1192. float: left;
  1193. width: 65px;
  1194. text-align: center;
  1195. i{font-size: 36px;color:#FF9900;line-height: 125px;}
  1196. }
  1197. .Right{
  1198. float: left;
  1199. margin-top:15px;
  1200. height: 60px;
  1201. font-weight: 600;
  1202. font-size: 14px;
  1203. line-height: 30px;
  1204. span{
  1205. display: inline-block;
  1206. width: 130px;
  1207. text-align: right;
  1208. }
  1209. }
  1210. }
  1211. .three{
  1212. border: 1px solid #0099FF;
  1213. .Left{
  1214. float: left;
  1215. width: 65px;
  1216. text-align: center;
  1217. i{font-size: 36px;color:#0099FF;line-height: 125px;}
  1218. }
  1219. .Right{
  1220. float: left;
  1221. height: 60px;
  1222. font-weight: 600;
  1223. font-size: 14px;
  1224. line-height: 30px;
  1225. margin-top:15px;
  1226. span{
  1227. display: inline-block;
  1228. width: 130px;
  1229. text-align: right;
  1230. }
  1231. }
  1232. }
  1233. .four{
  1234. border: 1px solid #FF5C5C;
  1235. .Left{
  1236. float: left;
  1237. width: 55px;
  1238. text-align: center;
  1239. i{font-size: 36px;color:#FF5C5C;line-height: 125px;}
  1240. }
  1241. .Right{
  1242. float: left;
  1243. flex: 1;
  1244. height: 60px;
  1245. font-weight: 600;
  1246. font-size: 14px;
  1247. line-height: 30px;
  1248. margin-top:15px;
  1249. span{
  1250. display: inline-block;
  1251. width: 150px;
  1252. text-align: right;
  1253. }
  1254. }
  1255. }
  1256. .car{
  1257. width:95%;height:150px;margin: 0 auto;
  1258. display:flex;
  1259. display: -webkit-flex;
  1260. -webkit-flex-direction:row;
  1261. i{font-size: 50px;width:50px;display: block;line-height: 150px;}
  1262. .carList{
  1263. flex:1;height: 130px;
  1264. .list{
  1265. height: 130px;color: #fff;margin-bottom: 20px;
  1266. // box-shadow: #000 0px 0px 10px;
  1267. // border-radius: 10px;
  1268. .list-l{
  1269. p{
  1270. padding-left:10px;font-size:13px;line-height: 16px; text-overflow: ellipsis;white-space:nowrap; overflow:hidden;
  1271. }
  1272. }
  1273. .list-r{
  1274. p{
  1275. font-size:13px;line-height: 16px;text-overflow: ellipsis;white-space:nowrap; overflow:hidden;
  1276. }
  1277. }
  1278. }
  1279. }
  1280. }
  1281. }
  1282. </style>