d35f0ca6d48f1a61fcc96f4683d360ec5c72c676.svn-base 60 KB

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