9fda7ad3e0354ef4f2b21ad24e17628a5ad8b55f.svn-base 59 KB

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