report.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421
  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 = "https://liangxin.zthymaoyi.com/map.html?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(Number(res.data.data[i].total).toFixed(0))
  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": 20,
  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 =Number(res.data.data[i].biViewInfoList[0].count)
  218. this.inventoryValue =Number(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( Number(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. "padding": [
  242. 15,
  243. 15,
  244. 20,
  245. 5
  246. ],
  247. "rotate": false,
  248. "errorReload": true,
  249. "fontSize": 13,
  250. "fontColor": "#666666",
  251. "enableScroll": false,
  252. "touchMoveLimit": 60,
  253. "enableMarkLine": false,
  254. "dataLabel": true,
  255. "dataPointShape": true,
  256. "dataPointShapeType": "solid",
  257. "legend": {
  258. "show": false,
  259. },
  260. "xAxis": {
  261. "disabled": false,
  262. "axisLine": true,
  263. "axisLineColor": "#CCCCCC",
  264. "calibration": false,
  265. "fontColor": "#666666",
  266. "fontSize": 13,
  267. "itemCount": 5,
  268. "boundaryGap": "center",
  269. "disableGrid": true,
  270. "gridColor": "#CCCCCC",
  271. "gridType": "solid",
  272. "dashLength": 4,
  273. "gridEval": 1,
  274. "scrollShow": false,
  275. "scrollAlign": "left",
  276. "scrollColor": "#A6A6A6",
  277. "scrollBackgroundColor": "#EFEBEF",
  278. "rotateLabel": true,
  279. },
  280. "yAxis": {
  281. "disabled": false,
  282. "disableGrid": false,
  283. "splitNumber": 5,
  284. "gridType": "solid",
  285. "dashLength": 8,
  286. "gridColor": "#CCCCCC",
  287. "padding": 10,
  288. "showTitle": false,
  289. "data": [{
  290. "type": "value",
  291. "position": "left",
  292. "disabled": false,
  293. "axisLine": false,
  294. "axisLineColor": "#CCCCCC",
  295. "calibration": false,
  296. "fontColor": "#666666",
  297. "fontSize": 13,
  298. "textAlign": "right",
  299. "titleFontSize": 13,
  300. "titleFontColor": "#666666",
  301. }]
  302. },
  303. "extra": {
  304. "column": {
  305. "type": "group",
  306. "width": 30,
  307. "seriesGap": 2,
  308. "categoryGap": 3,
  309. "barBorderCircle": false,
  310. "linearType": "none",
  311. "linearOpacity": 1,
  312. "colorStop": 0,
  313. "meterBorder": 1,
  314. "meterFillColor": "#FFFFFF",
  315. "activeBgColor": "#000000",
  316. "activeBgOpacity": 0.08,
  317. "meterBorde": 1
  318. },
  319. "tooltip": {
  320. "showBox": true,
  321. "showArrow": true,
  322. "showCategory": false,
  323. "borderWidth": 0,
  324. "borderRadius": 0,
  325. "borderColor": "#000000",
  326. "borderOpacity": 0.7,
  327. "bgColor": "#000000",
  328. "bgOpacity": 0.7,
  329. "gridType": "solid",
  330. "dashLength": 4,
  331. "gridColor": "#CCCCCC",
  332. "fontColor": "#FFFFFF",
  333. "splitLine": true,
  334. "horizentalLine": false,
  335. "xAxisLabel": false,
  336. "yAxisLabel": false,
  337. "labelBgColor": "#FFFFFF",
  338. "labelBgOpacity": 0.7,
  339. "labelFontColor": "#666666"
  340. }
  341. }
  342. }
  343. } else if (i == 9) {
  344. }
  345. }
  346. this.chartlist = _list
  347. })
  348. },
  349. getdata(e) {
  350. console.log(e)
  351. }
  352. }
  353. }
  354. </script>
  355. <style scoped lang="scss">
  356. .map {
  357. top: 90rpx;
  358. height: 60vh;
  359. width: 100%;
  360. border: 0;
  361. }
  362. .title {
  363. background: black;
  364. color: white;
  365. text-align: center;
  366. font-size: 1.25rem;
  367. padding: 0.625rem;
  368. }
  369. .content {
  370. background: black;
  371. padding-bottom: 100rpx;
  372. }
  373. .charts-box {
  374. // background: black;
  375. position: relative;
  376. // top: 70vh;
  377. }
  378. .content2 .row,
  379. .content4 .row {
  380. display: flex;
  381. justify-content: space-around;
  382. background: #24262d;
  383. padding: 40rpx 20rpx;
  384. .item-top,
  385. .item-bottom {
  386. color: #d5d5d5;
  387. }
  388. .item-bottom {
  389. display: flex;
  390. align-items: center;
  391. }
  392. }
  393. .bottom-tip {
  394. position: absolute;
  395. z-index: 11;
  396. color: #8c8c8d;
  397. right: 10px;
  398. bottom: 10px;
  399. }
  400. .title-margin {
  401. bottom: 120rpx;
  402. }
  403. </style>