5a659305b0eacb601b537ad28c8e31b2a6280643.svn-base 52 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300
  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: 30 + 'px', height: 30 + '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. this.getRow1List()
  519. },
  520. getRow1List() {
  521. this.row1.listLoading = true
  522. this.row1.getdataListParm.parammaps.startTime = parseTime(this.inputDatetime[0], '{y}-{m}-{d}')
  523. this.row1.getdataListParm.parammaps.stopTime = parseTime(this.inputDatetime[1], '{y}-{m}-{d}')
  524. GetDataByName(this.row1.getdataListParm).then(response => {
  525. console.log('row1数据', response.data.list)
  526. if (response.data.list !== null) {
  527. for (let i = 0; i < response.data.list.length; i++) {
  528. if (response.data.list[i].rateAvg == undefined) {
  529. this.$set(response.data.list[i], 'rateAvg', '')
  530. }
  531. if (response.data.list[i].rateMAX == undefined) {
  532. this.$set(response.data.list[i], 'rateMAX', '')
  533. }
  534. if (response.data.list[i].rateMIN == undefined) {
  535. this.$set(response.data.list[i], 'rateMIN', '')
  536. }
  537. }
  538. this.row1.list = response.data.list
  539. this.row2.chart1.chartLine_data.data1 = parseFloat(response.data.list[0].doneTimes)
  540. this.row2.chart1.chartLine_data.data2 = parseFloat(response.data.list[0].planTimes)
  541. this.row2.chart2.chartLine_data.data1 = parseFloat(response.data.list[0].doneWeight)
  542. this.row2.chart2.chartLine_data.data2 = parseFloat(response.data.list[0].planWeight)
  543. this.roadRow1ChartLine1(this.row2.chart1.chartLine_data)
  544. this.roadRow1ChartLine2(this.row2.chart2.chartLine_data)
  545. } else {
  546. this.row1.list.data1.monRateHL = ''
  547. this.row1.list.data1.monRateSL = ''
  548. this.row1.list.data1.monRateSLR = ''
  549. this.row1.list.data1.yesRateHL = ''
  550. this.row1.list.data1.yesRateSL = ''
  551. this.row1.list.data1.yesRateSLR = ''
  552. this.row1.list.data1.temtime = ''
  553. this.row1.list.data1.montime = ''
  554. this.row2.chart1.chartLine_data.data1 = ''
  555. this.row2.chart1.chartLine_data.data2 = ''
  556. this.row2.chart2.chartLine_data.data1 = ''
  557. this.row2.chart2.chartLine_data.data2 = ''
  558. }
  559. setTimeout(() => {
  560. this.row1.listLoading = false
  561. }, 100)
  562. })
  563. },
  564. // 今日计划统计-完成车次
  565. roadRow1ChartLine1(chartLine_data) {
  566. console.log(chartLine_data)
  567. if (this.row2.chart1.chartLine != null) {
  568. this.row2.chart1.chartLine.dispose()
  569. }
  570. this.row2.chart1.chartLine = echarts.init(document.getElementById('row2chartLine1'))
  571. var option = {
  572. // 标题组件,包含主标题和副标题
  573. title: {
  574. show: true,
  575. x: 'center',
  576. textStyle: {
  577. fontSize: '15',
  578. color: 'green',
  579. fontWeight: 'bold'
  580. }
  581. },
  582. // 提示框组件
  583. tooltip: {
  584. // 是否显示提示框组件,包括提示框浮层和 axisPointe
  585. show: false,
  586. // 触发类型: item:数据项触发,axis:坐标轴触发
  587. trigger: 'item',
  588. formatter: '{a} <br/>{b}: {c} ({d}%)'
  589. },
  590. // 系列列表。每个系列通过 type 决定自己的图表类型
  591. series: [{
  592. // 系列名称,用于tooltip的显示,legend 的图例筛选,在 setOption 更新数据和配置项时用于指定对应的系列。
  593. name: '任务进度',
  594. type: 'pie',
  595. // 饼图的半径,数组的第一项是内半径,第二项是外半径
  596. radius: ['80%', '70%'],
  597. // 是否启用防止标签重叠策略,默认开启
  598. avoidLabelOverlap: false,
  599. hoverAnimation: false,
  600. // 标签的视觉引导线样式,在 label 位置 设置为'outside'的时候会显示视觉引导线
  601. labelLine: {
  602. normal: {
  603. show: false
  604. }
  605. },
  606. data: [{
  607. value: chartLine_data.data1, // 数据值
  608. name: '完成率', // 数据项名称
  609. selected: false, // 该数据项是否被选中
  610. // 单个扇区的标签配置
  611. label: {
  612. normal: {
  613. show: true, // 是显示标签
  614. position: 'center',
  615. fontSize: 20,
  616. // 标签内容格式器,支持字符串模板和回调函数两种形式,字符串模板与回调函数返回的字符串均支持用 \n 换行
  617. formatter: '{b}\n{d}%'
  618. }
  619. }
  620. }, {
  621. value: chartLine_data.data2 - chartLine_data.data1,
  622. label: {
  623. normal: {
  624. show: false
  625. }
  626. }
  627. }]
  628. }],
  629. color: ['#409EFF', '#B7DBFF']
  630. }
  631. this.row2.chart1.chartLine.setOption(option)
  632. window.onresize = function() {
  633. this.row2.chart1.chartLine.resize()
  634. }
  635. },
  636. // 今日计划统计-完成重量
  637. roadRow1ChartLine2(chartLine_data) {
  638. if (this.row2.chart2.chartLine != null) {
  639. this.row2.chart2.chartLine.dispose()
  640. }
  641. this.row2.chart2.chartLine = echarts.init(document.getElementById('row2chartLine2'))
  642. var option = {
  643. // 标题组件,包含主标题和副标题
  644. title: {
  645. show: true,
  646. x: 'center',
  647. textStyle: {
  648. fontSize: '15',
  649. color: 'green',
  650. fontWeight: 'bold'
  651. }
  652. },
  653. // 提示框组件
  654. tooltip: {
  655. // 是否显示提示框组件,包括提示框浮层和 axisPointe
  656. show: false,
  657. // 触发类型: item:数据项触发,axis:坐标轴触发
  658. trigger: 'item',
  659. formatter: '{a} <br/>{b}: {c} ({d}%)'
  660. },
  661. // 系列列表。每个系列通过 type 决定自己的图表类型
  662. series: [{
  663. // 系列名称,用于tooltip的显示,legend 的图例筛选,在 setOption 更新数据和配置项时用于指定对应的系列。
  664. name: '任务进度',
  665. type: 'pie',
  666. // 饼图的半径,数组的第一项是内半径,第二项是外半径
  667. radius: ['80%', '70%'],
  668. // 是否启用防止标签重叠策略,默认开启
  669. avoidLabelOverlap: false,
  670. hoverAnimation: false,
  671. // 标签的视觉引导线样式,在 label 位置 设置为'outside'的时候会显示视觉引导线
  672. labelLine: {
  673. normal: {
  674. show: false
  675. }
  676. },
  677. data: [{
  678. value: chartLine_data.data1, // 数据值
  679. name: '完成率', // 数据项名称
  680. selected: false, // 该数据项是否被选中
  681. // 单个扇区的标签配置
  682. label: {
  683. normal: {
  684. show: true, // 是显示标签
  685. position: 'center',
  686. fontSize: 20,
  687. // 标签内容格式器,支持字符串模板和回调函数两种形式,字符串模板与回调函数返回的字符串均支持用 \n 换行
  688. formatter: '{b}\n{d}%'
  689. }
  690. }
  691. }, {
  692. value: chartLine_data.data2 - chartLine_data.data1,
  693. label: {
  694. normal: {
  695. show: false
  696. }
  697. }
  698. }]
  699. }],
  700. color: ['#409EFF', '#B7DBFF']
  701. }
  702. this.row2.chart2.chartLine.setOption(option)
  703. window.onresize = function() {
  704. this.row2.chart2.chartLine.resize()
  705. }
  706. },
  707. // 今日执行计划监控
  708. getRow2List1() {
  709. this.row2.listLoading2 = true
  710. GetDataByName(this.row2.getdataListParmList).then(response => {
  711. if (response.data.list !== null) {
  712. response.data.list = [
  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搅拌机' },
  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搅拌机2' },
  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搅拌机3' },
  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搅拌机4' },
  721. { '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' },
  722. { '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' },
  723. { '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' }
  724. ]
  725. for (let i = 0; i < response.data.list.length; i++) {
  726. this.$set(response.data.list[i], 'color', '#fff')
  727. this.$set(response.data.list[i], 'background', '#7ac3ec')
  728. }
  729. this.row2.list = response.data.list
  730. this.row2.carLength = response.data.total
  731. } else {
  732. this.carLength = 0
  733. }
  734. setTimeout(() => {
  735. this.row2.listLoading2 = false
  736. }, 100)
  737. })
  738. },
  739. handleTable(item) {
  740. console.log(item)
  741. if (item == 'row3chartLine1') {
  742. console.log('计划统计表格')
  743. this.row3.chart1.isTable = true
  744. this.row3.chart1.isChart = false
  745. } else if (item == 'row3chartLine2') {
  746. console.log('泌乳牛采食量表格')
  747. this.row3.chart2.isTable = true
  748. this.row3.chart2.isChart = false
  749. } else if (item == 'row4chartLine1') {
  750. console.log('成本统计表格')
  751. this.row4.chart1.isTable = true
  752. this.row4.chart1.isChart = false
  753. } else if (item == 'row4chartLine2') {
  754. console.log('混料实际重量统计表格')
  755. this.row4.chart2.isTable = true
  756. this.row4.chart2.isChart = false
  757. }
  758. },
  759. handleChart(item) {
  760. console.log(item)
  761. // 显示切换图表
  762. if (item == 'row3chartLine1') {
  763. console.log('计划统计图表')
  764. this.row3.chart1.isTable = false
  765. this.row3.chart1.isChart = true
  766. } else if (item == 'row3chartLine2') {
  767. console.log('泌乳牛采食量图表')
  768. this.row3.chart2.isTable = false
  769. this.row3.chart2.isChart = true
  770. } else if (item == 'row4chartLine1') {
  771. console.log('成本统计图表')
  772. this.row4.chart1.isTable = false
  773. this.row4.chart1.isChart = true
  774. } else if (item == 'row4chartLine2') {
  775. console.log('混料实际重量统计图表')
  776. this.row4.chart2.isTable = false
  777. this.row4.chart2.isChart = true
  778. }
  779. },
  780. handleExport(item) {
  781. console.log(item)
  782. // 显示切换图表
  783. if (item == 'row3chartLine1') {
  784. console.log('计划统计')
  785. var excelDatasTabChart1 = [
  786. {
  787. tHeader: ['日期', '计划执行重量(kg)', '配方理论重量(kg)', '计划准确率', '计划取消重量(kg)', '计划准确率(去除取消重量)', '计划正确数', '计划数', '计划正确率'],
  788. filterVal: ['日期', '实际量', '理论量', 'field1', '计划取消重量', 'field3', '正确数', '计划数', 'field2'],
  789. tableDatas: this.row3.chart1.table.list,
  790. sheetName: '计划统计'
  791. }
  792. ]
  793. json2excel(excelDatasTabChart1, '计划统计', true, 'xlsx')
  794. }
  795. },
  796. // 计划统计
  797. getRow3List1() {
  798. this.row3.chart1.listLoading = true
  799. GetReportform(this.row3.chart1.getdataListParm).then(response => {
  800. console.log('计划统计', response.data.list)
  801. if (response.data.list !== null) {
  802. this.row3.chart1.table.list = response.data.data
  803. this.row3.chart1.chartLine_data = response.data.list
  804. this.row3.chart1.chartLine_data = {
  805. 'data1': ['1牧', '2牧', '3牧', '4牧', '5牧', '6牧', '7牧', '8牧', '9牧', '10牧', '11牧', '12牧'], // x轴
  806. '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], // 计划准确率
  807. 'data3': [2.6, 5.9, 9.0, 30, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3], // 计划正确率
  808. '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]// 计划准确率(去除取消重量)
  809. }
  810. this.row3.chart1.total = response.data.total
  811. this.roadRow3ChartLine1(this.row3.chart1.chartLine_data)
  812. } else {
  813. this.row3.chart1.list = []
  814. }
  815. setTimeout(() => {
  816. this.row3.chart1.listLoading = false
  817. }, 100)
  818. })
  819. },
  820. roadRow3ChartLine1(chartLine_data) {
  821. if (this.row3.chart1.chartLine != null) {
  822. this.row3.chart1.chartLine.dispose()
  823. }
  824. this.row3.chart1.chartLine = echarts.init(document.getElementById('row3chartLine1'))
  825. var option = {
  826. tooltip: {
  827. trigger: 'axis',
  828. axisPointer: {
  829. type: 'cross',
  830. crossStyle: {
  831. color: '#999'
  832. }
  833. }
  834. },
  835. legend: {
  836. data: ['计划准确率', '计划正确率', '计划准确率(去除取消重量)']
  837. },
  838. xAxis: [{ type: 'category', data: chartLine_data.data1, axisPointer: { type: 'shadow' }}],
  839. yAxis: [{ type: 'value', name: '百分比', min: 0, max: 100, interval: 20, axisLabel: { formatter: '{value}' }}],
  840. series: [{ name: '计划准确率', type: 'bar', itemStyle: { normal: { color: '#7ecf51' }},
  841. data: chartLine_data.data2,
  842. markLine: {
  843. data: [{ type: 'average' }],
  844. symbol: ['none', 'none'],
  845. position: 'insideTopCenter',
  846. itemStyle: {
  847. normal: {
  848. lineStyle: { type: 'dotted', width: 3 },
  849. label: { show: true, position: 'middle', formatter: '' }
  850. }
  851. },
  852. large: true,
  853. effect: { show: false, loop: true, period: 0, scaleSize: 2, color: null, shadowColor: null, shadowBlur: null }
  854. }
  855. },
  856. {
  857. name: '计划正确率',
  858. type: 'bar',
  859. itemStyle: {
  860. normal: {
  861. color: '#ff6600'
  862. }
  863. },
  864. data: chartLine_data.data3,
  865. markLine: {
  866. data: [{ type: 'average' }],
  867. symbol: ['none', 'none'],
  868. position: 'insideTopCenter',
  869. itemStyle: {
  870. normal: {
  871. lineStyle: { type: 'dotted', width: 3 },
  872. label: { show: true, position: 'middle', formatter: '' }
  873. }
  874. },
  875. large: true,
  876. effect: { show: false, loop: true, period: 0, scaleSize: 2, color: null, shadowColor: null, shadowBlur: null }
  877. }
  878. },
  879. {
  880. name: '计划准确率(去除取消重量)',
  881. type: 'bar',
  882. itemStyle: {
  883. normal: {
  884. color: '#61a5e8'
  885. }
  886. },
  887. data: chartLine_data.data4,
  888. markLine: {
  889. data: [{ type: 'average' }],
  890. symbol: ['none', 'none'],
  891. position: 'insideTopCenter',
  892. itemStyle: {
  893. normal: {
  894. lineStyle: { type: 'dotted', width: 3 },
  895. label: { show: true, position: 'middle', formatter: '' }
  896. }
  897. },
  898. large: true,
  899. effect: { show: false, loop: true, period: 0, scaleSize: 2, color: null, shadowColor: null, shadowBlur: null }
  900. }
  901. }
  902. ]
  903. }
  904. this.row3.chart1.chartLine.setOption(option)
  905. window.onresize = function() {
  906. this.row3.chart1.chartLine.resize()
  907. }
  908. },
  909. // 泌乳牛干物质采食量
  910. getRow3List2() {
  911. this.row3.chart2.listLoading = true
  912. GetReportform(this.row3.chart2.getdataListParm).then(response => {
  913. console.log('泌乳牛采食量数据', response.data.list)
  914. if (response.data.list !== null) {
  915. this.row3.chart2.table.list = response.data.data
  916. this.row3.chart2.chartLine_data = response.data.list
  917. this.row3.chart2.chartLine_data = {
  918. data1: ['1牧', '2牧', '3牧'], // 折线
  919. data2: ['12/01', '12/02', '12/03'], // X轴
  920. data3: [
  921. { data: [1.5, 1.2, 1.7, 1.2] },
  922. { data: [1.7, 0.8, 1.2, 1.8] },
  923. { data: [1.3, 2.2, 1.9, 1.4] }
  924. ]// 折线对应数据
  925. }
  926. this.row3.chart2.total = response.data.total
  927. this.roadRow3ChartLine2(this.row3.chart2.chartLine_data)
  928. } else {
  929. this.row3.chart2.list = []
  930. }
  931. setTimeout(() => {
  932. this.row3.chart2.listLoading = false
  933. }, 100)
  934. })
  935. },
  936. roadRow3ChartLine2(chartLine_data) {
  937. if (this.row3.chart2.chartLine != null) {
  938. this.row3.chart2.chartLine.dispose()
  939. }
  940. this.row3.chart2.chartLine = echarts.init(document.getElementById('row3chartLine2'))
  941. var option = {
  942. title: {
  943. text: ''
  944. },
  945. tooltip: {
  946. trigger: 'axis'
  947. },
  948. legend: {
  949. data: chartLine_data.data1,
  950. right: 10
  951. },
  952. grid: {
  953. top: '20%',
  954. left: '5%',
  955. right: '8%',
  956. containLabel: true
  957. },
  958. toolbox: {
  959. show: true,
  960. right: '2%',
  961. feature: {}
  962. },
  963. xAxis: { type: 'category', boundaryGap: false, data: chartLine_data.data2, name: '日期' },
  964. yAxis: {
  965. type: 'value', name: 'kg', axisLabel: { formatter: '{value}' }
  966. },
  967. series: (function() {
  968. var serie = []
  969. for (var i = 0; i < chartLine_data.data3.length; i++) {
  970. var item = {
  971. name: chartLine_data.data1[i],
  972. type: 'line',
  973. data: chartLine_data.data3[i].data
  974. }
  975. serie.push(item)
  976. }
  977. return serie
  978. }())
  979. }
  980. this.row3.chart2.chartLine.setOption(option)
  981. window.onresize = function() {
  982. this.row3.chart2.chartLine.resize()
  983. }
  984. },
  985. // 成本统计
  986. getRow4List1() {
  987. this.row4.chart1.listLoading = true
  988. GetReportform(this.row4.chart1.getdataListParm).then(response => {
  989. console.log('成本统计数据', response.data.list)
  990. if (response.data.list !== null) {
  991. this.row4.chart1.table.list = response.data.data
  992. this.row4.chart1.chartLine_data = response.data.list
  993. this.row4.chart1.chartLine_data = {
  994. data1: ['1牧', '2牧', '3牧'], // 折线
  995. data2: ['12/01', '12/02', '12/03'], // X轴
  996. data3: [
  997. { data: [1.5, 1.2, 1.7, 1.2] },
  998. { data: [1.7, 0.8, 1.2, 1.8] },
  999. { data: [1.3, 2.2, 1.9, 1.4] }
  1000. ]// 折线对应数据
  1001. }
  1002. this.row4.chart1.total = response.data.total
  1003. this.roadRow4ChartLine1(this.row4.chart1.chartLine_data)
  1004. } else {
  1005. this.row4.chart1.list = []
  1006. }
  1007. setTimeout(() => {
  1008. this.row4.chart1.listLoading = false
  1009. }, 100)
  1010. })
  1011. },
  1012. roadRow4ChartLine1(chartLine_data) {
  1013. if (this.row4.chart1.chartLine != null) {
  1014. this.row4.chart1.chartLine.dispose()
  1015. }
  1016. this.row4.chart1.chartLine = echarts.init(document.getElementById('row4chartLine1'))
  1017. var option = {
  1018. title: {
  1019. text: ''
  1020. },
  1021. tooltip: {
  1022. trigger: 'axis'
  1023. },
  1024. legend: {
  1025. data: chartLine_data.data1,
  1026. right: 10
  1027. },
  1028. grid: {
  1029. top: '20%',
  1030. left: '5%',
  1031. right: '8%',
  1032. containLabel: true
  1033. },
  1034. toolbox: {
  1035. show: true,
  1036. right: '2%',
  1037. feature: {}
  1038. },
  1039. xAxis: { type: 'category', boundaryGap: false, data: chartLine_data.data2, name: '日期' },
  1040. yAxis: {
  1041. type: 'value', name: 'kg', axisLabel: { formatter: '{value}' }
  1042. },
  1043. series: (function() {
  1044. var serie = []
  1045. for (var i = 0; i < chartLine_data.data3.length; i++) {
  1046. var item = {
  1047. name: chartLine_data.data1[i],
  1048. type: 'line',
  1049. data: chartLine_data.data3[i].data
  1050. }
  1051. serie.push(item)
  1052. }
  1053. return serie
  1054. }())
  1055. }
  1056. this.row4.chart1.chartLine.setOption(option)
  1057. window.onresize = function() {
  1058. this.row4.chart1.chartLine.resize()
  1059. }
  1060. },
  1061. // 混料实际重量统计
  1062. getRow4List2() {
  1063. this.row4.chart2.listLoading = true
  1064. GetReportform(this.row4.chart2.getdataListParm).then(response => {
  1065. console.log('混料实际重量统计数据', response.data.list)
  1066. if (response.data.list !== null) {
  1067. this.row4.chart2.table.list = response.data.data
  1068. this.row4.chart2.chartLine_data = response.data.list
  1069. // this.row4.chart2.chartLine_data = {
  1070. // data1: ['1牧', '2牧', '3牧'], // 折线
  1071. // data2: ['12/01', '12/02', '12/03'], // X轴
  1072. // data3: [
  1073. // { data: [1.5, 1.2, 1.7, 1.2] },
  1074. // { data: [1.7, 0.8, 1.2, 1.8] },
  1075. // { data: [1.3, 2.2, 1.9, 1.4] }
  1076. // ]// 折线对应数据
  1077. // }
  1078. this.row4.chart2.total = response.data.total
  1079. this.roadRow4ChartLine2(this.row4.chart2.chartLine_data)
  1080. } else {
  1081. this.row4.chart2.list = []
  1082. }
  1083. setTimeout(() => {
  1084. this.row4.chart2.listLoading = false
  1085. }, 100)
  1086. })
  1087. },
  1088. roadRow4ChartLine2(chartLine_data) {
  1089. if (this.row4.chart2.chartLine != null) {
  1090. this.row4.chart2.chartLine.dispose()
  1091. }
  1092. this.row4.chart2.chartLine = echarts.init(document.getElementById('row4chartLine2'))
  1093. var option = {
  1094. title: {
  1095. text: ''
  1096. },
  1097. tooltip: {
  1098. trigger: 'axis'
  1099. },
  1100. legend: {
  1101. data: chartLine_data.data1,
  1102. right: 10
  1103. },
  1104. grid: {
  1105. top: '20%',
  1106. left: '5%',
  1107. right: '8%',
  1108. containLabel: true
  1109. },
  1110. toolbox: {
  1111. show: true,
  1112. right: '2%',
  1113. feature: {}
  1114. },
  1115. xAxis: { type: 'category', boundaryGap: false, data: chartLine_data.data2, name: '日期' },
  1116. yAxis: {
  1117. type: 'value', name: 'kg', axisLabel: { formatter: '{value}' }
  1118. },
  1119. series: (function() {
  1120. var serie = []
  1121. for (var i = 0; i < chartLine_data.data3.length; i++) {
  1122. var item = {
  1123. name: chartLine_data.data1[i],
  1124. type: 'line',
  1125. data: chartLine_data.data3[i].data
  1126. }
  1127. serie.push(item)
  1128. }
  1129. return serie
  1130. }())
  1131. }
  1132. this.row4.chart2.chartLine.setOption(option)
  1133. window.onresize = function() {
  1134. this.row4.chart2.chartLine.resize()
  1135. }
  1136. },
  1137. getRow4List3() {
  1138. this.row4.table.listLoading = true
  1139. GetDataByName(this.row4.table.getdataListParm).then(response => {
  1140. console.log('库存预警table数据', response.data.list)
  1141. if (response.data.list !== null) {
  1142. this.row4.table.list = response.data.list
  1143. this.row4.table.total = response.data.total
  1144. } else {
  1145. this.row4.table.list = []
  1146. }
  1147. setTimeout(() => {
  1148. this.row4.table.listLoading = false
  1149. }, 100)
  1150. })
  1151. }
  1152. }
  1153. }
  1154. </script>
  1155. <style lang="scss" scoped>
  1156. .Title{
  1157. 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;
  1158. }
  1159. .dashboard-editor-container {
  1160. background-color: #F4F4F4;
  1161. min-height: 100vh;
  1162. }
  1163. .bottom{
  1164. padding:0 30px;
  1165. h4{text-align: right;}
  1166. .grid-content{
  1167. background: #fff;height: 125px;
  1168. border-radius: 10px;
  1169. }
  1170. .one{
  1171. border: 1px solid #82CBB3;height: 125px;
  1172. .Left{
  1173. float: left;
  1174. width: 65px;
  1175. text-align: center;
  1176. i{font-size: 36px;color:#82CBB3;line-height: 125px;}
  1177. }
  1178. .Right{
  1179. float: left;
  1180. margin-top:15px;
  1181. height: 60px;
  1182. font-weight: 600;
  1183. font-size: 14px;
  1184. line-height: 30px;
  1185. span{
  1186. display: inline-block;
  1187. width: 130px;
  1188. text-align: right;
  1189. }
  1190. }
  1191. }
  1192. .two{
  1193. border: 1px solid #FF9900;
  1194. .Left{
  1195. float: left;
  1196. width: 65px;
  1197. text-align: center;
  1198. i{font-size: 36px;color:#FF9900;line-height: 125px;}
  1199. }
  1200. .Right{
  1201. float: left;
  1202. margin-top:15px;
  1203. height: 60px;
  1204. font-weight: 600;
  1205. font-size: 14px;
  1206. line-height: 30px;
  1207. span{
  1208. display: inline-block;
  1209. width: 130px;
  1210. text-align: right;
  1211. }
  1212. }
  1213. }
  1214. .three{
  1215. border: 1px solid #0099FF;
  1216. .Left{
  1217. float: left;
  1218. width: 65px;
  1219. text-align: center;
  1220. i{font-size: 36px;color:#0099FF;line-height: 125px;}
  1221. }
  1222. .Right{
  1223. float: left;
  1224. height: 60px;
  1225. font-weight: 600;
  1226. font-size: 14px;
  1227. line-height: 30px;
  1228. margin-top:15px;
  1229. span{
  1230. display: inline-block;
  1231. width: 130px;
  1232. text-align: right;
  1233. }
  1234. }
  1235. }
  1236. .four{
  1237. border: 1px solid #FF5C5C;
  1238. .Left{
  1239. float: left;
  1240. width: 55px;
  1241. text-align: center;
  1242. i{font-size: 36px;color:#FF5C5C;line-height: 125px;}
  1243. }
  1244. .Right{
  1245. float: left;
  1246. flex: 1;
  1247. height: 60px;
  1248. font-weight: 600;
  1249. font-size: 14px;
  1250. line-height: 30px;
  1251. margin-top:15px;
  1252. span{
  1253. display: inline-block;
  1254. width: 150px;
  1255. text-align: right;
  1256. }
  1257. }
  1258. }
  1259. .car{
  1260. width:95%;height:150px;margin: 0 auto;
  1261. display:flex;
  1262. display: -webkit-flex;
  1263. -webkit-flex-direction:row;
  1264. i{font-size: 50px;width:50px;display: block;line-height: 150px;}
  1265. .carList{
  1266. flex:1;height: 130px;
  1267. .list{
  1268. height: 130px;color: #fff;margin-bottom: 20px;
  1269. // box-shadow: #000 0px 0px 10px;
  1270. // border-radius: 10px;
  1271. .list-l{
  1272. p{
  1273. padding-left:10px;font-size:13px;line-height: 16px; text-overflow: ellipsis;white-space:nowrap; overflow:hidden;
  1274. }
  1275. }
  1276. .list-r{
  1277. p{
  1278. font-size:13px;line-height: 16px;text-overflow: ellipsis;white-space:nowrap; overflow:hidden;
  1279. }
  1280. }
  1281. }
  1282. }
  1283. }
  1284. }
  1285. </style>