report.vue 11 KB

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