bea53c410a35799af4e11f71eb2e994f2e5905e9.svn-base 54 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370
  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. }
  879. },
  880. // 计划统计
  881. getRow3List1() {
  882. this.row3.chart1.listLoading = true
  883. console.log(this.row3.chart1.getdataListParm.name, '计划统计接口')
  884. GetReportform(this.row3.chart1.getdataListParm).then(response => {
  885. if (response.data !== null && response.data.list !== null) {
  886. this.row3.chart1.table.list = response.data.data
  887. this.row3.chart1.chartLine_data = response.data.list
  888. this.row3.chart1.total = response.data.total
  889. console.log('计划统计图数据', this.row3.chart1.chartLine_data)
  890. console.log('计划统计表数据', this.row3.chart1.table.list)
  891. } else {
  892. this.row3.chart1.table.list = []
  893. this.row3.chart1.chartLine_data = {}
  894. }
  895. this.roadRow3ChartLine1(this.row3.chart1.chartLine_data)
  896. setTimeout(() => {
  897. this.row3.chart1.listLoading = false
  898. }, 100)
  899. })
  900. },
  901. roadRow3ChartLine1(chartLine_data) {
  902. if (this.row3.chart1.chartLine != null) {
  903. this.row3.chart1.chartLine.dispose()
  904. }
  905. this.row3.chart1.chartLine = echarts.init(document.getElementById('row3chartLine1'))
  906. var option = {
  907. tooltip: { trigger: 'axis', axisPointer: { type: 'cross', crossStyle: { color: '#999' }}},
  908. legend: { data: ['计划准确率', '计划正确率', '计划准确率(去除取消重量)'] },
  909. xAxis: [{ type: 'category', data: chartLine_data.data1, axisPointer: { type: 'shadow' }}],
  910. yAxis: [{ type: 'value', name: '百分比', min: 0, max: 100, interval: 20, axisLabel: { formatter: '{value}' }}],
  911. series: [
  912. { 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 }}},
  913. { 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 }}},
  914. { 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 }}}
  915. ]
  916. }
  917. this.row3.chart1.chartLine.setOption(option)
  918. window.onresize = function() {
  919. this.row3.chart1.chartLine.resize()
  920. }
  921. },
  922. // 泌乳牛干物质采食量
  923. getRow3List2() {
  924. this.row3.chart2.listLoading = true
  925. GetReportform(this.row3.chart2.getdataListParm).then(response => {
  926. if (response.data !== null && response.data.list !== null) {
  927. console.log('泌乳牛干物质采食量数据', response)
  928. for (let i = 0; i < response.data.data.length; i++) {
  929. if (response.data.data[i].field1 !== '' && response.data.data[i].field1 !== undefined) {
  930. response.data.data[i].field1 = parseFloat(response.data.data[i].field1)
  931. }
  932. if (response.data.data[i].field2 !== '' && response.data.data[i].field2 !== undefined) {
  933. response.data.data[i].field2 = parseFloat(response.data.data[i].field2)
  934. }
  935. }
  936. this.row3.chart2.table.list = response.data.data
  937. this.row3.chart2.chartLine_data = response.data.list
  938. this.row3.chart2.total = response.data.total
  939. if (this.row3.chart2.chartLine_data.data1.length == 0) {
  940. this.row3.chart2.chartLine_data.title = '暂无数据'
  941. } else {
  942. this.row3.chart2.chartLine_data.title = ''
  943. }
  944. this.roadRow3ChartLine2(this.row3.chart2.chartLine_data)
  945. } else {
  946. this.row3.chart2.list = []
  947. }
  948. setTimeout(() => {
  949. this.row3.chart2.listLoading = false
  950. }, 100)
  951. })
  952. },
  953. roadRow3ChartLine2(chartLine_data) {
  954. if (this.row3.chart2.chartLine != null) {
  955. this.row3.chart2.chartLine.dispose()
  956. }
  957. this.row3.chart2.chartLine = echarts.init(document.getElementById('row3chartLine2'))
  958. var option = {
  959. title: {
  960. text: ''
  961. },
  962. tooltip: {
  963. trigger: 'axis'
  964. },
  965. legend: {
  966. data: chartLine_data.data1,
  967. right: 10
  968. },
  969. grid: {
  970. top: '20%',
  971. left: '3%',
  972. right: '8%',
  973. containLabel: true
  974. },
  975. toolbox: {
  976. show: true,
  977. right: '2%',
  978. feature: {}
  979. },
  980. xAxis: { type: 'category', boundaryGap: false, data: chartLine_data.data2, name: '日期' },
  981. yAxis: {
  982. type: 'value', name: 'kg', axisLabel: { formatter: '{value}' }
  983. },
  984. series: (function() {
  985. if (chartLine_data.data3 !== undefined) {
  986. var serie = []
  987. for (var i = 0; i < chartLine_data.data3.length; i++) {
  988. var item = {
  989. name: chartLine_data.data1[i],
  990. type: 'line',
  991. data: chartLine_data.data3[i].data
  992. }
  993. serie.push(item)
  994. }
  995. return serie
  996. }
  997. }())
  998. }
  999. this.row3.chart2.chartLine.setOption(option)
  1000. window.onresize = function() {
  1001. this.row3.chart2.chartLine.resize()
  1002. }
  1003. },
  1004. // 成本统计
  1005. getRow4List1() {
  1006. this.row4.chart1.listLoading = true
  1007. console.log(this.row4.chart1.getdataListParm.name)
  1008. GetReportform(this.row4.chart1.getdataListParm).then(response => {
  1009. if (response.data !== null && response.data.list !== null) {
  1010. console.log('成本统计数据', response.data.list)
  1011. this.row4.chart1.table.list = response.data.data
  1012. this.row4.chart1.chartLine_data = response.data.list
  1013. this.row4.chart1.total = response.data.total
  1014. } else {
  1015. this.row4.chart1.list = []
  1016. this.row4.chart1.chartLine_data = {}
  1017. }
  1018. this.roadRow4ChartLine1(this.row4.chart1.chartLine_data)
  1019. setTimeout(() => {
  1020. this.row4.chart1.listLoading = false
  1021. }, 100)
  1022. })
  1023. },
  1024. roadRow4ChartLine1(chartLine_data) {
  1025. console.log(chartLine_data, '成本统计chartLine_data')
  1026. if (this.row4.chart1.chartLine != null) {
  1027. this.row4.chart1.chartLine.dispose()
  1028. }
  1029. this.row4.chart1.chartLine = echarts.init(document.getElementById('row4chartLine1'))
  1030. var option = {
  1031. title: {
  1032. text: ''
  1033. },
  1034. tooltip: {
  1035. trigger: 'axis'
  1036. },
  1037. legend: {
  1038. data: chartLine_data.data1,
  1039. right: 10
  1040. },
  1041. grid: {
  1042. top: '20%',
  1043. left: '5%',
  1044. right: '8%',
  1045. containLabel: true
  1046. },
  1047. toolbox: {
  1048. show: true,
  1049. right: '2%',
  1050. feature: {}
  1051. },
  1052. xAxis: { type: 'category', boundaryGap: false, data: chartLine_data.data2, name: '日期' },
  1053. yAxis: {
  1054. type: 'value', name: 'kg', axisLabel: { formatter: '{value}' }
  1055. },
  1056. series: (function() {
  1057. if (chartLine_data.data3 !== undefined) {
  1058. var serie = []
  1059. for (var i = 0; i < chartLine_data.data3.length; i++) {
  1060. var item = {
  1061. name: chartLine_data.data1[i],
  1062. type: 'line',
  1063. data: chartLine_data.data3[i].data
  1064. }
  1065. serie.push(item)
  1066. }
  1067. return serie
  1068. }
  1069. }())
  1070. }
  1071. this.row4.chart1.chartLine.setOption(option)
  1072. window.onresize = function() {
  1073. this.row4.chart1.chartLine.resize()
  1074. }
  1075. },
  1076. // 混料实际重量统计
  1077. getRow4List2() {
  1078. this.row4.chart2.listLoading = true
  1079. GetReportform(this.row4.chart2.getdataListParm).then(response => {
  1080. if (response.data !== null && response.data.list !== null) {
  1081. console.log('混料实际重量统计数据', response.data.list)
  1082. this.row4.chart2.table.list = response.data.data
  1083. this.row4.chart2.chartLine_data = response.data.list
  1084. this.row4.chart2.total = response.data.total
  1085. } else {
  1086. this.row4.chart2.list = []
  1087. this.row4.chart2.chartLine_data = {}
  1088. }
  1089. this.roadRow4ChartLine2(this.row4.chart2.chartLine_data)
  1090. setTimeout(() => {
  1091. this.row4.chart2.listLoading = false
  1092. }, 100)
  1093. })
  1094. },
  1095. roadRow4ChartLine2(chartLine_data) {
  1096. if (this.row4.chart2.chartLine != null) {
  1097. this.row4.chart2.chartLine.dispose()
  1098. }
  1099. this.row4.chart2.chartLine = echarts.init(document.getElementById('row4chartLine2'))
  1100. var option = {
  1101. title: {
  1102. text: ''
  1103. },
  1104. tooltip: {
  1105. trigger: 'axis'
  1106. },
  1107. legend: {
  1108. data: chartLine_data.data1,
  1109. right: 10
  1110. },
  1111. grid: {
  1112. top: '20%',
  1113. left: '5%',
  1114. right: '8%',
  1115. containLabel: true
  1116. },
  1117. toolbox: {
  1118. show: true,
  1119. right: '2%',
  1120. feature: {}
  1121. },
  1122. xAxis: { type: 'category', boundaryGap: false, data: chartLine_data.data2, name: '日期' },
  1123. yAxis: {
  1124. type: 'value', name: 'kg', axisLabel: { formatter: '{value}' }
  1125. },
  1126. series: (function() {
  1127. if (chartLine_data.data3 !== undefined) {
  1128. var serie = []
  1129. for (var i = 0; i < chartLine_data.data3.length; i++) {
  1130. var item = {
  1131. name: chartLine_data.data1[i],
  1132. type: 'line',
  1133. data: chartLine_data.data3[i].data
  1134. }
  1135. serie.push(item)
  1136. }
  1137. return serie
  1138. }
  1139. }())
  1140. }
  1141. this.row4.chart2.chartLine.setOption(option)
  1142. window.onresize = function() {
  1143. this.row4.chart2.chartLine.resize()
  1144. }
  1145. },
  1146. getRow4List3() {
  1147. this.row4.table.listLoading = true
  1148. GetDataByName(this.row4.table.getdataListParm).then(response => {
  1149. if (response.data.list !== null) {
  1150. console.log('库存预警table数据', response.data.list)
  1151. this.row4.table.list = response.data.list
  1152. this.row4.table.total = response.data.total
  1153. } else {
  1154. this.row4.table.list = []
  1155. }
  1156. setTimeout(() => {
  1157. this.row4.table.listLoading = false
  1158. }, 100)
  1159. })
  1160. }
  1161. }
  1162. }
  1163. </script>
  1164. <style>
  1165. .app-main{background:#f5f5f5;}
  1166. </style>
  1167. <style lang="scss" scoped>
  1168. .dashboard-editor-container{padding-left: 10px;background: #f5f5f5;padding-bottom: 10px;}
  1169. // 公共
  1170. .img-t{position: absolute;left: 0;right: 0;margin: 30px auto;width: 31%;height: 31%;background-size: 100% 100%;}
  1171. .row1-c-l-c{
  1172. margin: 20px auto;border: 1px solid #eee;height: 40%;width: 50%;border-radius: 50%;text-align: center;display:table;
  1173. span{
  1174. height:100%;display:table-cell;vertical-align: middle;font-size:14px;color: #009C69;
  1175. b{padding-bottom: 10px;font-size: 16px;overflow: hidden;width: 100%;}
  1176. }
  1177. }
  1178. .row1-c-l-b{
  1179. width: 100%;text-align: center;display:table;font-size: 12px;
  1180. // div{
  1181. // font-size: 12px;height:100%;display:table-cell;vertical-align: middle;color: #323232;padding: 0 10px;width: 100%;
  1182. // span{text-align: right;width: 75%;display: block;float: left;}
  1183. // b{float: left;display: block;width: 25%;}
  1184. // }
  1185. }
  1186. .title{
  1187. height: 36px;padding-top: 7px;line-height: 36px;position: relative;
  1188. .img-title{
  1189. position: absolute;top: 10px; right:10px;bottom:0;left:20px;width: 30px;height: 30px;background: url(../../../assets/images/index/row-bg3.png) no-repeat;
  1190. }
  1191. .content{font-size: 18px;position: absolute;top: 7px;left: 55px;}
  1192. }
  1193. .title1{
  1194. height: 36px;padding-top: 7px;line-height: 36px;position: relative;
  1195. .img-title{
  1196. position: absolute;top: 10px; right:10px;bottom:0;left:10px;
  1197. width: 25px;height: 25px;
  1198. img{width: 25px;height: 25px;}
  1199. }
  1200. .content{font-size: 16px;position: absolute;top: 7px;left: 40px;}
  1201. }
  1202. .button{
  1203. height: 30px;
  1204. .exportTable{float: right;margin-right: 5px;}
  1205. }
  1206. .dashboard{
  1207. display: flex;margin-top: 10px;
  1208. .dashboard-l{
  1209. // width: 540px;
  1210. width: 30%;
  1211. .row1{
  1212. height: 520px;
  1213. .row1-t{
  1214. background: #fff; height: 50px; color: #f28b46;
  1215. .row1-t-l{
  1216. .img-l{float:left;padding: 16px 0 16px 10px;width: 100px;height: 18px;}
  1217. .content{float:left;width: 68%;font-size: 14px;margin-top: 5px;}
  1218. }
  1219. .row1-t-r{padding-right: 20px;text-align: right;line-height: 50px;}
  1220. }
  1221. .row1-c{
  1222. display: flex; flex-direction: row; flex-wrap: wrap; justify-content: space-between;margin-top: 10px;
  1223. .row1-c-l{
  1224. background: #fff;width:49%;height:225px;border-radius:3px;margin-right: 1%;position: relative;
  1225. .img-t{width:49%;height:38%;background: url(../../../assets/images/index/t1.png) no-repeat; background-size: 100% 100%;}
  1226. }
  1227. .row1-c-r{
  1228. background: #fff;width:49%;height:225px;border-radius:3px;position: relative;
  1229. .img-t{width:49%;height:38%;background: url(../../../assets/images/index/t2.png) no-repeat; background-size: 100% 100%;}
  1230. }
  1231. }
  1232. .row1-b{
  1233. display: flex; flex-direction: row; flex-wrap: wrap; justify-content: space-between;margin-top: 10px;
  1234. .row1-b-l{
  1235. background: #fff;width:49%;height:225px;border-radius:3px;margin-right:1%;position: relative;
  1236. .img-t{width:49%;height:38%;background: url(../../../assets/images/index/t4.png) no-repeat; background-size: 100% 100%;}
  1237. }
  1238. .row1-b-r{
  1239. background: #fff;width:49%;height:225px;border-radius:3px;position: relative;
  1240. .img-t{width:49%;height:38%;background: url(../../../assets/images/index/t3.png) no-repeat; background-size: 100% 100%;}
  1241. }
  1242. }
  1243. }
  1244. .row2{
  1245. margin-top:10px;height: 375px;background: #fff;
  1246. .img-title{background-position: 0 0;}
  1247. .todayPlan{
  1248. display: flex; flex-direction: row;margin-top: 10px;
  1249. div{
  1250. flex: 1;position: relative;
  1251. .bottom{
  1252. width: 99%;height: 70px;background: #f9f9f9;margin: 30px auto 5px;display: flex; flex-direction: row;
  1253. div{
  1254. flex: 1;height: 42px;color: #333333;
  1255. }
  1256. .bottom-l{
  1257. border-right: 1px solid #e0e0e0;margin-top: 15px;width: 100%;text-align: center;
  1258. .bottom-l-t{
  1259. height: 30px;
  1260. b{font-size: 18px;}
  1261. }
  1262. .bottom-l-b{font-size: 12px;}
  1263. }
  1264. .bottom-r{
  1265. margin-top: 15px;width: 100%;text-align: center;
  1266. .bottom-r-t{height: 30px;padding-left: 10px;}
  1267. .bottom-r-b{padding-left: 10px;font-size: 12px;}
  1268. }
  1269. }
  1270. }
  1271. }
  1272. }
  1273. .row3{
  1274. margin-top:10px;height: 375px;background: #fff;
  1275. .img-title{background-position: 0 -90px;}
  1276. }
  1277. }
  1278. .dashboard-r{
  1279. margin-left: 10px;flex:1;
  1280. .row1{
  1281. height: 520px;background: #fff;
  1282. .row1Title{float: right;height: 50px;line-height: 50px;margin-right: 50px;}
  1283. .img-title{background-position: 0 -240px;}
  1284. #row2chartLine3{height: 270px;margin-top: 10px;}
  1285. .carsLength{
  1286. padding: 13px 0 0 22px;line-height: 38px;font-size: 18px;font-weight: 700;
  1287. }
  1288. .car{
  1289. clear: both;
  1290. .carList{
  1291. padding:0 30px;overflow: auto;width: 100%;height: 470px;
  1292. .listW{
  1293. background: #f3f9f7; float: left;margin: 5px 5px;width: 32%;height: 120px;
  1294. .list{
  1295. width: 100%;height: 100%;border-radius: 5px;border:1px solid #000;
  1296. .list-t{
  1297. display: flex;
  1298. border-bottom: 1px solid #f1f1f1;
  1299. .list-t-t{
  1300. flex: 1 1;
  1301. width: 0;font-size: 12px;line-height: 22px;padding: 25px 5px 15px;text-align: center;
  1302. span{ display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  1303. }
  1304. }
  1305. .list-b{
  1306. display: flex; text-align: center;margin-top: 14px;color: #323232;
  1307. .list-b-l{
  1308. flex: 1;width: 0; height: 40px; position: relative;
  1309. .left{
  1310. .num{
  1311. font-size: 12px;
  1312. b{font-size: 12px;}
  1313. }
  1314. .weight{font-size: 12px;}
  1315. }
  1316. .right{
  1317. height: 30px;width: 1px;background: #e0e0e0;position: absolute;right: 0;top: 0;bottom: 0;margin-top:auto;margin-bottom:auto
  1318. }
  1319. }
  1320. }
  1321. }
  1322. }
  1323. }
  1324. }
  1325. }
  1326. .row2{
  1327. margin-top:10px;height: 375px;
  1328. display: flex; flex-direction: row;
  1329. .row2-l{
  1330. margin-right: 10px; background: #fff;height:375px;border-radius:3px;flex: 1;
  1331. .img-title{background-position: 0 -30px;}
  1332. }
  1333. .row2-r{
  1334. background: #fff;height:375px;border-radius:3px;flex: 1;
  1335. .img-title{background-position: 0 -60px;}
  1336. }
  1337. }
  1338. .row3{
  1339. margin-top:10px;height: 375px;
  1340. display: flex; flex-direction: row;
  1341. .row3-l{
  1342. margin-right: 10px; background: #fff;height:375px;border-radius:3px;flex: 1;
  1343. .img-title{background-position: 0 -120px;}
  1344. }
  1345. .row3-r{
  1346. background: #fff;height:375px;border-radius:3px;flex: 1;
  1347. .img-title{background-position: 0 -150px;}
  1348. }
  1349. }
  1350. }
  1351. }
  1352. </style>