b06bf1ef683a56408f6be48060a1b064cfbc961e.svn-base 55 KB

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