1380f8f49f370770763fc8cf4a9b23784186c105.svn-base 59 KB

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