report.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437
  1. <template>
  2. <view class="content">
  3. <view class="title">库点流向分布</view>
  4. <iframe id="mainIframe" ref="mainIframe" name="mainIframe" :src="url" class="map"></iframe>
  5. <view class="charts-box" v-for="(item,index) in chartlist" :key='index'>
  6. <div class="bottom-tip" v-if='index==0||index==3'>统计单位:吨</div>
  7. <div class="bottom-tip" v-if='index!=0&&index!=3' :class='index==2?"title-margin":""'>统计单位:元</div>
  8. <view v-if="index==0" class="title">采购合同完成进度</view>
  9. <qiun-data-charts type="ring" :opts='item.ringoptions' :chartData="item.Ring" background="#24262D" />
  10. <view v-if="index==2" class="title">销售合同完成进度</view>
  11. </view>
  12. <view class="content2">
  13. <view class="title">在途信息统计</view>
  14. <view class="row">
  15. <view class="item">
  16. <view class="item-top">在途车辆</view>
  17. <view class="item-bottom">
  18. <view style="color: #50cad4;font-size: 50rpx;">{{carCount1}} </view>台
  19. </view>
  20. </view>
  21. <view class="item">
  22. <view class="item-top">装车车辆</view>
  23. <view class="item-bottom">
  24. <view style="color: rgb(255, 165, 35);font-size: 50rpx;">{{carCount2}}</view>台
  25. </view>
  26. </view>
  27. <view class="item">
  28. <view class="item-top">卸货车辆</view>
  29. <view class="item-bottom">
  30. <view style="color: rgb(36, 131, 255);font-size: 50rpx;">{{carCount3}}</view>台
  31. </view>
  32. </view>
  33. </view>
  34. </view>
  35. <view class="content3">
  36. <view class="title">粮食总储量</view>
  37. <qiun-data-charts type="column" :chartData="chartData" :opts='ringoptions' background="none" />
  38. </view>
  39. <view class="content4">
  40. <view class="title">库存成本</view>
  41. <view class="row">
  42. <view class="item">
  43. <view class="item-top">总库存量</view>
  44. <view class="item-bottom">
  45. <view style="color: #50cad4;font-size: 50rpx;">{{inventoryCost}}</view>吨
  46. </view>
  47. </view>
  48. <view class="item">
  49. <view class="item-top">库存价值</view>
  50. <view class="item-bottom">
  51. <view style="color: rgb(255, 165, 35);font-size: 50rpx;">{{inventoryValue}}</view>元
  52. </view>
  53. </view>
  54. </view>
  55. </view>
  56. </view>
  57. </template>
  58. <script>
  59. export default {
  60. data() {
  61. return {
  62. chartlist: [],
  63. carCount1: '',
  64. carCount2: '',
  65. carCount3: '',
  66. inventoryCost: '',
  67. inventoryValue: '',
  68. ZChart: {},
  69. // url:"https://datav.aliyuncs.com/share/235518097ffd673bc1eb05011b9a02b6",
  70. url: 'http://192.168.1.116:8011',
  71. flag: true,
  72. chartData: {},
  73. ringoptions: {},
  74. }
  75. },
  76. onLoad: function(option) {
  77. uni.showLoading({
  78. title: "加载中",
  79. mask: true
  80. })
  81. if (option.url) {
  82. this.url = option.url;
  83. uni.setNavigationBarTitle({
  84. title: "库点监控"
  85. })
  86. this.flag = false
  87. }
  88. this.init()
  89. },
  90. methods: {
  91. init() {
  92. this.$api.doRequest('get', '/biInfoController/selectBiInfo').then(res => {
  93. console.log(res)
  94. uni.hideLoading()
  95. let _list = []
  96. for (let i = 0; i < res.data.data.length; i++) {
  97. let _obj = {}
  98. let _color = []
  99. let _title = ""
  100. let _subtitle = ''
  101. let _name = ''
  102. let _count = ''
  103. let _data = []
  104. switch (i) {
  105. case 0:
  106. _color = ['#75d1f4', '#3a3b40'];
  107. _title = '总量合计'
  108. _data = [{
  109. name: '已完成量',
  110. data: Number(res.data.data[i].biViewInfoList[0].count)
  111. }, {
  112. name: '待完成量',
  113. data: Number(res.data.data[i].biViewInfoList[1].count)
  114. }]
  115. break;
  116. case 1:
  117. _color = ['#247ef4', '#3a3b40'];
  118. _title = '开票合计'
  119. _data = [{
  120. name: '已开票',
  121. data: Number(res.data.data[i].biViewInfoList[0].count)
  122. }, {
  123. name: '待开票',
  124. data: Number(res.data.data[i].biViewInfoList[1].count)
  125. }]
  126. break;
  127. case 2:
  128. _color = ['#f49f23', '#3a3b40'];
  129. _title = '付款合计'
  130. _data = [{
  131. name: '已付款',
  132. data: Number(res.data.data[i].biViewInfoList[0].count)
  133. }, {
  134. name: '待付款',
  135. data: Number(res.data.data[i].biViewInfoList[1].count)
  136. }]
  137. break;
  138. case 3:
  139. _color = ['#75d1f4', '#3a3b40'];
  140. _title = '总量合计'
  141. _data = [{
  142. name: '已完成量',
  143. data: Number(res.data.data[i].biViewInfoList[0].count)
  144. }, {
  145. name: '待完成量',
  146. data: Number(res.data.data[i].biViewInfoList[1].count)
  147. }]
  148. break;
  149. case 4:
  150. _color = ['#247ef4', '#3a3b40'];
  151. _title = '开票合计'
  152. _data = [{
  153. name: '已开票',
  154. data: Number(res.data.data[i].biViewInfoList[0].count)
  155. }, {
  156. name: '待开票',
  157. data: Number(res.data.data[i].biViewInfoList[1].count)
  158. }]
  159. break;
  160. case 5:
  161. _color = ['#f49f23', '#3a3b40'];
  162. _title = '付款合计'
  163. _data = [{
  164. name: '待付款',
  165. data: Number(res.data.data[i].biViewInfoList[0].count)
  166. }, {
  167. name: '待完成量',
  168. data: Number(res.data.data[i].biViewInfoList[1].count)
  169. }]
  170. break;
  171. }
  172. if (i < 6) {
  173. _subtitle = Number(res.data.data[i].total)
  174. _obj.ringoptions = {
  175. "type": "ring",
  176. "animation": true,
  177. "timing": "easeOut",
  178. "duration": 1000,
  179. "color": _color,
  180. "fontSize": 13,
  181. "fontColor": "#666666",
  182. "legend": {
  183. "show": true,
  184. "position": "top",
  185. "padding": 5,
  186. "margin": 5,
  187. "backgroundColor": "rgba(0,0,0,0)",
  188. "borderColor": "rgba(0,0,0,0)",
  189. "fontSize": 13,
  190. "fontColor": "#CECECE",
  191. "hiddenColor": "#CECECE",
  192. },
  193. "title": {
  194. "name": _title,
  195. "fontSize": 15,
  196. "color": "#fff",
  197. },
  198. "subtitle": {
  199. "name": _subtitle,
  200. "fontSize": 25,
  201. "color": "#fff",
  202. },
  203. "extra": {
  204. "ring": {
  205. "ringWidth": 15,
  206. "centerColor": "#24262D",
  207. "activeOpacity": 0.5,
  208. "activeRadius": 10,
  209. "borderColor": "#24262D",
  210. "linearType": "none"
  211. },
  212. }
  213. },
  214. _obj.Ring = {
  215. "series": _data
  216. }
  217. _list.push(_obj)
  218. } else if (i == 6) {
  219. this.carCount1 = res.data.data[i].biViewInfoList[0].count
  220. this.carCount2 = res.data.data[i].biViewInfoList[1].count
  221. this.carCount3 = res.data.data[i].biViewInfoList[2].count
  222. } else if (i == 7) {
  223. this.inventoryCost = res.data.data[i].biViewInfoList[0].count
  224. this.inventoryValue = res.data.data[i].biViewInfoList[1].count
  225. } else if (i == 8) {
  226. let _x = []
  227. let _y = []
  228. for (let k = 0; k < res.data.data[i].biViewInfoList.length; k++) {
  229. _x.push(res.data.data[i].biViewInfoList[k].name)
  230. _y.push(res.data.data[i].biViewInfoList[k].count)
  231. }
  232. this.chartData = {
  233. categories: _x,
  234. series: [{
  235. "name": '储量',
  236. "data": _y
  237. }]
  238. }
  239. this.ringoptions = {
  240. "type": "column",
  241. "canvasId": "",
  242. "canvas2d": false,
  243. "background": "none",
  244. "animation": true,
  245. "timing": "easeOut",
  246. "duration": 1000,
  247. "color": [
  248. "#1890FF",
  249. "#91CB74",
  250. "#FAC858",
  251. "#EE6666",
  252. "#73C0DE",
  253. "#3CA272",
  254. "#FC8452",
  255. "#9A60B4",
  256. "#ea7ccc"
  257. ],
  258. "padding": [
  259. 15,
  260. 15,
  261. 0,
  262. 5
  263. ],
  264. "rotate": false,
  265. "errorReload": true,
  266. "fontSize": 13,
  267. "fontColor": "#666666",
  268. "enableScroll": false,
  269. "touchMoveLimit": 60,
  270. "enableMarkLine": false,
  271. "dataLabel": true,
  272. "dataPointShape": true,
  273. "dataPointShapeType": "solid",
  274. "tapLegend": true,
  275. "xAxis": {
  276. "disabled": false,
  277. "axisLine": true,
  278. "axisLineColor": "#CCCCCC",
  279. "calibration": false,
  280. "fontColor": "#666666",
  281. "fontSize": 13,
  282. "itemCount": 5,
  283. "boundaryGap": "center",
  284. "disableGrid": true,
  285. "gridColor": "#CCCCCC",
  286. "gridType": "solid",
  287. "dashLength": 4,
  288. "gridEval": 1,
  289. "scrollShow": false,
  290. "scrollAlign": "left",
  291. "scrollColor": "#A6A6A6",
  292. "scrollBackgroundColor": "#EFEBEF",
  293. "rotateLabel": true,
  294. },
  295. "yAxis": {
  296. "disabled": false,
  297. "disableGrid": false,
  298. "splitNumber": 5,
  299. "gridType": "solid",
  300. "dashLength": 8,
  301. "gridColor": "#CCCCCC",
  302. "padding": 10,
  303. "showTitle": false,
  304. "data": [{
  305. "type": "value",
  306. "position": "left",
  307. "disabled": false,
  308. "axisLine": false,
  309. "axisLineColor": "#CCCCCC",
  310. "calibration": false,
  311. "fontColor": "#666666",
  312. "fontSize": 13,
  313. "textAlign": "right",
  314. "titleFontSize": 13,
  315. "titleFontColor": "#666666",
  316. }]
  317. },
  318. "extra": {
  319. "column": {
  320. "type": "group",
  321. "width": 30,
  322. "seriesGap": 2,
  323. "categoryGap": 3,
  324. "barBorderCircle": false,
  325. "linearType": "none",
  326. "linearOpacity": 1,
  327. "colorStop": 0,
  328. "meterBorder": 1,
  329. "meterFillColor": "#FFFFFF",
  330. "activeBgColor": "#000000",
  331. "activeBgOpacity": 0.08,
  332. "meterBorde": 1
  333. },
  334. "tooltip": {
  335. "showBox": true,
  336. "showArrow": true,
  337. "showCategory": false,
  338. "borderWidth": 0,
  339. "borderRadius": 0,
  340. "borderColor": "#000000",
  341. "borderOpacity": 0.7,
  342. "bgColor": "#000000",
  343. "bgOpacity": 0.7,
  344. "gridType": "solid",
  345. "dashLength": 4,
  346. "gridColor": "#CCCCCC",
  347. "fontColor": "#FFFFFF",
  348. "splitLine": true,
  349. "horizentalLine": false,
  350. "xAxisLabel": false,
  351. "yAxisLabel": false,
  352. "labelBgColor": "#FFFFFF",
  353. "labelBgOpacity": 0.7,
  354. "labelFontColor": "#666666"
  355. }
  356. }
  357. }
  358. } else if (i == 9) {
  359. document.getElementById('mainIframe').contentWindow.postMessage(res.data.data[i], '*')
  360. }
  361. }
  362. this.chartlist = _list
  363. })
  364. },
  365. getdata(e) {
  366. console.log(e)
  367. }
  368. }
  369. }
  370. </script>
  371. <style scoped lang="scss">
  372. .map {
  373. top: 90rpx;
  374. height: 60vh;
  375. width: 100%;
  376. border: 0;
  377. }
  378. .title {
  379. background: black;
  380. color: white;
  381. text-align: center;
  382. font-size: 1.25rem;
  383. padding: 0.625rem;
  384. }
  385. .content {
  386. background: black;
  387. padding-bottom: 100rpx;
  388. }
  389. .charts-box {
  390. // background: black;
  391. position: relative;
  392. // top: 70vh;
  393. }
  394. .content2 .row,
  395. .content4 .row {
  396. display: flex;
  397. justify-content: space-around;
  398. background: #24262d;
  399. padding: 40rpx 20rpx;
  400. .item-top,
  401. .item-bottom {
  402. color: #d5d5d5;
  403. }
  404. .item-bottom {
  405. display: flex;
  406. align-items: center;
  407. }
  408. }
  409. .bottom-tip {
  410. position: absolute;
  411. z-index: 11;
  412. color: #8c8c8d;
  413. right: 10px;
  414. bottom: 10px;
  415. }
  416. .title-margin {
  417. bottom: 120rpx;
  418. }
  419. </style>