report2.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438
  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 @click='skipContent(index)' 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. uni.onWindowResize((res) => {
  84. console.log('变化后的窗口宽度=' + res.size.windowWidth)
  85. console.log('变化后的窗口高度=' + res.size.windowHeight)
  86. this.init()
  87. })
  88. },
  89. methods: {
  90. skipContent(index){
  91. console.log(index)
  92. if(index<2){
  93. uni.navigateTo({
  94. url:'/pages/user/contractLook/purchaseContract'
  95. })
  96. }else if(index>2&&index<6){
  97. uni.navigateTo({
  98. url:'/pages/user/contractLook/salesContract'
  99. })
  100. }
  101. },
  102. init() {
  103. this.$api.doRequest('get', '/biInfoController/selectBiInfo?compId='+uni.getStorageSync('pcUserInfo').compId).then(res => {
  104. console.log(res)
  105. uni.hideLoading()
  106. let _list = []
  107. for (let i = 0; i < res.data.data.length; i++) {
  108. let _obj = {}
  109. let _color = []
  110. let _title = ""
  111. let _subtitle = ''
  112. let _name = ''
  113. let _count = ''
  114. let _data = []
  115. switch (i) {
  116. case 0:
  117. _color = ['#75d1f4', '#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 1:
  128. _color = ['#247ef4', '#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 2:
  139. _color = ['#f49f23', '#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 3:
  150. _color = ['#75d1f4', '#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 4:
  161. _color = ['#247ef4', '#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. case 5:
  172. _color = ['#f49f23', '#3a3b40'];
  173. _title = '付款合计'
  174. _data = [{
  175. name: '待付款',
  176. data: Number(res.data.data[i].biViewInfoList[0].count)
  177. }, {
  178. name: '待完成量',
  179. data: Number(res.data.data[i].biViewInfoList[1].count)
  180. }]
  181. break;
  182. }
  183. if (i < 6) {
  184. _subtitle = Number(Number(res.data.data[i].total).toFixed(0))
  185. _obj.ringoptions = {
  186. "type": "ring",
  187. "animation": true,
  188. "timing": "easeOut",
  189. "duration": 1000,
  190. "color": _color,
  191. "fontSize": 13,
  192. "fontColor": "#666666",
  193. "legend": {
  194. "show": true,
  195. "position": "top",
  196. "padding": 5,
  197. "margin": 5,
  198. "backgroundColor": "rgba(0,0,0,0)",
  199. "borderColor": "rgba(0,0,0,0)",
  200. "fontSize": 13,
  201. "fontColor": "#CECECE",
  202. "hiddenColor": "#CECECE",
  203. },
  204. "title": {
  205. "name": _title,
  206. "fontSize": 15,
  207. "color": "#fff",
  208. },
  209. "subtitle": {
  210. "name": _subtitle,
  211. "fontSize": 20,
  212. "color": "#fff",
  213. },
  214. "extra": {
  215. "ring": {
  216. "ringWidth": 15,
  217. "centerColor": "#24262D",
  218. "activeOpacity": 0.5,
  219. "activeRadius": 10,
  220. "borderColor": "#24262D",
  221. "linearType": "none"
  222. },
  223. }
  224. },
  225. _obj.Ring = {
  226. "series": _data
  227. }
  228. _list.push(_obj)
  229. } else if (i == 6) {
  230. this.carCount1 = res.data.data[i].biViewInfoList[0].count
  231. this.carCount2 = res.data.data[i].biViewInfoList[1].count
  232. this.carCount3 = res.data.data[i].biViewInfoList[2].count
  233. } else if (i == 7) {
  234. this.inventoryCost =Number(res.data.data[i].biViewInfoList[0].count)
  235. this.inventoryValue =Number(res.data.data[i].biViewInfoList[1].count)
  236. } else if (i == 8) {
  237. let _x = []
  238. let _y = []
  239. for (let k = 0; k < res.data.data[i].biViewInfoList.length; k++) {
  240. _x.push(res.data.data[i].biViewInfoList[k].name)
  241. _y.push( Number(res.data.data[i].biViewInfoList[k].count))
  242. }
  243. this.chartData = {
  244. categories: _x,
  245. series: [{
  246. "name": '储量',
  247. "data": _y
  248. }]
  249. }
  250. this.ringoptions = {
  251. "type": "column",
  252. "canvasId": "",
  253. "canvas2d": false,
  254. "background": "none",
  255. "animation": true,
  256. "timing": "easeOut",
  257. "duration": 1000,
  258. "padding": [
  259. 15,
  260. 15,
  261. 20,
  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. "legend": {
  275. "show": false,
  276. },
  277. "xAxis": {
  278. "disabled": false,
  279. "axisLine": true,
  280. "axisLineColor": "#CCCCCC",
  281. "calibration": false,
  282. "fontColor": "#666666",
  283. "fontSize": 13,
  284. "itemCount": 5,
  285. "boundaryGap": "center",
  286. "disableGrid": true,
  287. "gridColor": "#CCCCCC",
  288. "gridType": "solid",
  289. "dashLength": 4,
  290. "gridEval": 1,
  291. "scrollShow": false,
  292. "scrollAlign": "left",
  293. "scrollColor": "#A6A6A6",
  294. "scrollBackgroundColor": "#EFEBEF",
  295. "rotateLabel": true,
  296. },
  297. "yAxis": {
  298. "disabled": false,
  299. "disableGrid": false,
  300. "splitNumber": 5,
  301. "gridType": "solid",
  302. "dashLength": 8,
  303. "gridColor": "#CCCCCC",
  304. "padding": 10,
  305. "showTitle": false,
  306. "data": [{
  307. "type": "value",
  308. "position": "left",
  309. "disabled": false,
  310. "axisLine": false,
  311. "axisLineColor": "#CCCCCC",
  312. "calibration": false,
  313. "fontColor": "#666666",
  314. "fontSize": 13,
  315. "textAlign": "right",
  316. "titleFontSize": 13,
  317. "titleFontColor": "#666666",
  318. }]
  319. },
  320. "extra": {
  321. "column": {
  322. "type": "group",
  323. "width": 30,
  324. "seriesGap": 2,
  325. "categoryGap": 3,
  326. "barBorderCircle": false,
  327. "linearType": "none",
  328. "linearOpacity": 1,
  329. "colorStop": 0,
  330. "meterBorder": 1,
  331. "meterFillColor": "#FFFFFF",
  332. "activeBgColor": "#000000",
  333. "activeBgOpacity": 0.08,
  334. "meterBorde": 1
  335. },
  336. "tooltip": {
  337. "showBox": true,
  338. "showArrow": true,
  339. "showCategory": false,
  340. "borderWidth": 0,
  341. "borderRadius": 0,
  342. "borderColor": "#000000",
  343. "borderOpacity": 0.7,
  344. "bgColor": "#000000",
  345. "bgOpacity": 0.7,
  346. "gridType": "solid",
  347. "dashLength": 4,
  348. "gridColor": "#CCCCCC",
  349. "fontColor": "#FFFFFF",
  350. "splitLine": true,
  351. "horizentalLine": false,
  352. "xAxisLabel": false,
  353. "yAxisLabel": false,
  354. "labelBgColor": "#FFFFFF",
  355. "labelBgOpacity": 0.7,
  356. "labelFontColor": "#666666"
  357. }
  358. }
  359. }
  360. } else if (i == 9) {
  361. }
  362. }
  363. this.chartlist = _list
  364. })
  365. },
  366. getdata(e) {
  367. console.log(e)
  368. }
  369. }
  370. }
  371. </script>
  372. <style scoped lang="scss">
  373. .map {
  374. top: 90rpx;
  375. height: 60vh;
  376. width: 100%;
  377. border: 0;
  378. }
  379. .title {
  380. background: black;
  381. color: white;
  382. text-align: center;
  383. font-size: 1.25rem;
  384. padding: 0.625rem;
  385. }
  386. .content {
  387. background: black;
  388. padding-bottom: 100rpx;
  389. }
  390. .charts-box {
  391. // background: black;
  392. position: relative;
  393. // top: 70vh;
  394. }
  395. .content2 .row,
  396. .content4 .row {
  397. display: flex;
  398. justify-content: space-around;
  399. background: #24262d;
  400. padding: 40rpx 20rpx;
  401. .item-top,
  402. .item-bottom {
  403. color: #d5d5d5;
  404. }
  405. .item-bottom {
  406. display: flex;
  407. align-items: center;
  408. }
  409. }
  410. .bottom-tip {
  411. position: absolute;
  412. z-index: 11;
  413. color: #8c8c8d;
  414. right: 10px;
  415. bottom: 10px;
  416. }
  417. .title-margin {
  418. bottom: 120rpx;
  419. }
  420. </style>