report.vue 11 KB

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