23b83aeddd495a73800ef649a69c073de4411e0f.svn-base 51 KB

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