45e80388fba22265123a2d584953c0e35e9de0ed.svn-base 59 KB

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