539e9f4e149a16088437b902d8a5a978127b5b3a.svn-base 55 KB

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