daYiReservation.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653
  1. <!-- 数据看板-大仪预约 -->
  2. <template>
  3. <view class="daYiReservation">
  4. <view class="chart">
  5. <view class="chart-t">
  6. <viwe class="chart-t-l">
  7. <text>设备总数:</text>
  8. <text>{{deviceTotal}}</text>
  9. </viwe>
  10. </view>
  11. <view class="chart-b">
  12. <qiun-data-charts type="ring" :opts="opts" :echartsH5="true" :chartData="chartData" />
  13. </view>
  14. </view>
  15. <view class="small-title">
  16. <view class="small-title-l">预约使用排行TOP10</view>
  17. <viwe class="chart-tab-tow">
  18. <view class="chart-tab-li" :class="chartTabIndexTow==index?'tab-A':'tab-B'"
  19. v-for="(item,index) in chartTabListTow" :key="index" @click="chartTabClickTow(index)">{{item}}
  20. </view>
  21. </viwe>
  22. </view>
  23. <!-- -->
  24. <view class="table">
  25. <uni-card>
  26. <view style="height: 200px">
  27. <zb-table :columns="column" :stripe="false" :border="false" :data="dataList"></zb-table>
  28. </view>
  29. </uni-card>
  30. </view>
  31. <!-- -->
  32. <view class="small-title">
  33. <view class="small-title-l">大仪预约排行</view>
  34. </view>
  35. <view class="table-tow">
  36. <uni-card>
  37. <view style="height: 200px">
  38. <zb-table :columns="column2" :stripe="false" :border="false" :data="dataList2"></zb-table>
  39. </view>
  40. </uni-card>
  41. </view>
  42. <view class="small-title">
  43. <view class="small-title-l">隐患实验室统计</view>
  44. <viwe class="chart-tab-tow">
  45. <view class="chart-tab-li" :class="chartTabIndexThree==index?'tab-A':'tab-B'"
  46. v-for="(item,index) in chartTabListThree" :key="index" @click="chartTabClickThree(index)">{{item}}
  47. </view>
  48. </viwe>
  49. </view>
  50. <view class="chart-tow">
  51. <view class="chart-tow-b">
  52. <qiun-data-charts type="radar" :opts="optsTow" :echartsH5="true" :chartData="chartDataTow" />
  53. </view>
  54. </view>
  55. </view>
  56. </template>
  57. <script>
  58. import {
  59. config
  60. } from '@/api/request/config.js'
  61. import {
  62. reportAppletReportBsEquipStatusList,
  63. reportAppletReportApiEquipRankTopList,
  64. reportAppletReportBsEquipAppointTopList,
  65. } from '@/pages/api/index.js'
  66. export default {
  67. name: "daYiReservation",
  68. components: {
  69. },
  70. data() {
  71. return {
  72. opts: {
  73. rotate: false,
  74. rotateLock: false,
  75. color: ["#10C139", "#FF8400", "#0183FA", "#EE6666", "#73C0DE", "#3CA272", ],
  76. padding: [5, 65, 5, 5],
  77. dataLabel: true,
  78. enableScroll: false,
  79. legend: {
  80. show: true,
  81. position: "right",
  82. fontColor: '#fff',
  83. },
  84. title: {
  85. name: "",
  86. },
  87. subtitle: {
  88. name: "",
  89. },
  90. extra: {
  91. ring: {
  92. ringWidth: 15,
  93. centerColor: '#3E414F',
  94. activeOpacity: 0.5,
  95. activeRadius: 20,
  96. offsetAngle: 0,
  97. labelWidth: 15,
  98. border: true,
  99. borderWidth: 3,
  100. borderColor: "#3E414F"
  101. }
  102. }
  103. },
  104. chartData: {},
  105. optsTow: {
  106. color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
  107. "#ea7ccc"
  108. ],
  109. padding: [5, 5, 5, 5],
  110. dataLabel: false,
  111. enableScroll: false,
  112. legend: {
  113. show: false,
  114. position: "right",
  115. lineHeight: 25
  116. },
  117. extra: {
  118. radar: {
  119. gridType: "radar",
  120. gridColor: "#CCCCCC",
  121. gridCount: 3,
  122. opacity: 0.2,
  123. max: 200,
  124. labelShow: true,
  125. border: true,
  126. labelColor: '#fff',
  127. }
  128. }
  129. },
  130. chartDataTow: {},
  131. chartTabList: ['日', '月', '年'],
  132. chartTabIndex: 0,
  133. chartTabListTow: ['按资费', '按机时', '按样品'],
  134. chartTabIndexTow: 0,
  135. chartTabListThree: ['年度', '季度', '月度'],
  136. chartTabIndexThree: 0,
  137. // 查询参数
  138. queryParams: {
  139. page: 1,
  140. pageSize: 10,
  141. },
  142. column: [{
  143. type: 'index',
  144. label: '排行',
  145. fixed: true,
  146. width: 60,
  147. align: 'center',
  148. },
  149. {
  150. name: 'deviceName',
  151. label: '设备名称',
  152. fixed: true,
  153. width: 80,
  154. align: 'center',
  155. },
  156. {
  157. name: 'useTimeStr',
  158. label: '使用机时',
  159. align: 'center',
  160. },
  161. {
  162. name: 'appointFee',
  163. label: '使用费用',
  164. align: 'center',
  165. },
  166. {
  167. name: 'testSample',
  168. label: '测试样品',
  169. align: 'center',
  170. },
  171. ],
  172. column2: [{
  173. type: 'index',
  174. label: '排行',
  175. fixed: true,
  176. width: 60,
  177. align: 'center',
  178. },
  179. {
  180. name: 'deviceName',
  181. label: '设备名称',
  182. fixed: true,
  183. width: 80,
  184. align: 'center',
  185. },
  186. {
  187. name: 'orderDuration',
  188. label: '预约时长',
  189. align: 'center',
  190. },
  191. {
  192. name: 'orderNum',
  193. label: '预约次数',
  194. align: 'center',
  195. },
  196. ],
  197. dataList: [],
  198. dataList2: [],
  199. total: 0,
  200. type:1,//type为1 按费用,2.按照机时,3.按照样品
  201. deviceTotal:0,
  202. }
  203. },
  204. created() {
  205. },
  206. beforeMount() {
  207. },
  208. mounted() {
  209. this.reportAppletReportBsEquipStatusList()
  210. this.reportAppletReportApiEquipRankTopList()
  211. this.reportAppletReportBsEquipAppointTopList()
  212. //this.getServerData()
  213. this.getServerDataTow()
  214. },
  215. methods: {
  216. //设备总数
  217. async reportAppletReportBsEquipStatusList() {
  218. let self = this;
  219. const {
  220. data
  221. } = await reportAppletReportBsEquipStatusList();
  222. if (data.code == 200) {
  223. let list=[];
  224. data.data.forEach(function(item,index){
  225. if(index<6){
  226. list.push({
  227. "name": item.name,
  228. "value":item.value,
  229. "labelShow": false,
  230. })
  231. self.deviceTotal+=item.value
  232. }
  233. })
  234. let res = {
  235. series: [{
  236. data: list
  237. }]
  238. };
  239. this.chartData = JSON.parse(JSON.stringify(res));
  240. }
  241. },
  242. //预约使用排行
  243. async reportAppletReportApiEquipRankTopList() {
  244. let self = this;
  245. const {
  246. data
  247. } = await reportAppletReportApiEquipRankTopList({type:this.type});
  248. if (data.code == 200) {
  249. this.$set(this,'dataList',data.data)
  250. }
  251. },
  252. //大仪预约排行
  253. async reportAppletReportBsEquipAppointTopList() {
  254. let self = this;
  255. const {
  256. data
  257. } = await reportAppletReportBsEquipAppointTopList();
  258. if (data.code == 200) {
  259. this.$set(this,'dataList2',data.data)
  260. }
  261. },
  262. getServerData() {
  263. //模拟从服务器获取数据时的延时
  264. setTimeout(() => {
  265. //模拟服务器返回数据,如果数据格式和标准格式不同,需自行按下面的格式拼接
  266. let res = {
  267. series: [{
  268. data: [{
  269. "name": "预约",
  270. "value": 50,
  271. "labelShow": false
  272. }, {
  273. "name": "空闲",
  274. "value": 30,
  275. "labelShow": false
  276. }, {
  277. "name": "锁定",
  278. "value": 20,
  279. "labelShow": false
  280. }, ]
  281. }]
  282. };
  283. this.chartData = JSON.parse(JSON.stringify(res));
  284. }, 500);
  285. },
  286. getServerDataTow() {
  287. //模拟从服务器获取数据时的延时
  288. setTimeout(() => {
  289. //模拟服务器返回数据,如果数据格式和标准格式不同,需自行按下面的格式拼接
  290. let res = {
  291. categories: ["测定仪", "色谱仪", "分析仪", "光度计", "离子色谱仪"],
  292. series: [{
  293. name: "",
  294. data: [90, 110, 165, 195, 187]
  295. },
  296. ]
  297. };
  298. this.chartDataTow = JSON.parse(JSON.stringify(res));
  299. }, 500);
  300. },
  301. chartTabClick(index) {
  302. this.chartTabIndex = index;
  303. },
  304. chartTabClickTow(index) {
  305. this.chartTabIndexTow = index;
  306. this.type = index+1;
  307. this.reportAppletReportApiEquipRankTopList();
  308. },
  309. chartTabClickThree(index) {
  310. this.chartTabIndexThree = index;
  311. this.type = index+1;
  312. this.reportAppletReportApiEquipRankTopList();
  313. },
  314. },
  315. }
  316. </script>
  317. <style lang="stylus" scoped>
  318. .daYiReservation {
  319. height: 100%;
  320. width: 100%;
  321. background: #363744;
  322. padding: 20rpx 0rpx 0;
  323. box-sizing: border-box;
  324. .chart {
  325. width: 690rpx;
  326. height: 380rpx;
  327. background: #3E414F;
  328. border-radius: 20rpx 20rpx 20rpx 20rpx;
  329. overflow: hidden;
  330. margin: 0 30rpx;
  331. .chart-t {
  332. display: flex;
  333. justify-content: space-between;
  334. align-items: center;
  335. height: 50rpx;
  336. margin-top: 30rpx;
  337. padding: 0 24rpx 0 42rpx;
  338. box-sizing: border-box;
  339. .chart-t-l {
  340. >text {
  341. font-weight: 400;
  342. font-size: 30rpx;
  343. color: #FFFFFF;
  344. line-height: 42rpx;
  345. }
  346. >text:nth-of-type(1) {
  347. color: #FFFFFF;
  348. }
  349. >text:nth-of-type(2) {
  350. color: #0183FA;
  351. }
  352. }
  353. .chart-tab {
  354. width: 120rpx;
  355. height: 50rpx;
  356. border-radius: 10rpx;
  357. overflow: hidden;
  358. border: 1rpx solid #52545F;
  359. display: flex;
  360. justify-content: flex-start;
  361. .chart-tab-li {
  362. width: 60rpx;
  363. font-weight: 400;
  364. font-size: 28rpx;
  365. color: #999999;
  366. line-height: 50rpx;
  367. text-align: center;
  368. }
  369. .chart-tab-li:nth-of-type(1) {
  370. border-right: 1rpx solid #52545F;
  371. }
  372. .chart-tab-li:nth-of-type(2) {
  373. border-right: 1rpx solid #52545F;
  374. }
  375. .tab-A {
  376. color: #FFFFFF;
  377. background: #0183FA;
  378. }
  379. .tab-B {
  380. color: #999999;
  381. background: none;
  382. }
  383. }
  384. }
  385. .chart-b {
  386. width: 690rpx;
  387. height: 300rpx;
  388. }
  389. }
  390. .statistics {
  391. width: 750rpx;
  392. height: 120rpx;
  393. background: #3E414F;
  394. margin-top: 20rpx;
  395. .statistics-b {
  396. display: flex;
  397. justify-content: space-between;
  398. align-items: center;
  399. .statistics-b-li {
  400. flex: 1;
  401. text-align: center;
  402. .statistics-b-li-t {
  403. margin-top: 10rpx;
  404. >text {
  405. font-weight: 400;
  406. font-size: 36rpx;
  407. line-height: 50rpx;
  408. }
  409. >text:nth-of-type(1) {
  410. font-size: 36rpx;
  411. }
  412. >text:nth-of-type(2) {
  413. font-size: 24rpx;
  414. }
  415. }
  416. .statistics-b-li-b {
  417. font-weight: 400;
  418. font-size: 24rpx;
  419. color: #FFFFFF;
  420. line-height: 34rpx;
  421. margin-top: 9rpx;
  422. }
  423. }
  424. .line {
  425. width: 2rpx;
  426. height: 30rpx;
  427. background: #D8D8D8;
  428. }
  429. }
  430. .color-A {
  431. color: #0183FA;
  432. }
  433. .color-B {
  434. color: #05FFE6;
  435. }
  436. .color-C {
  437. color: #FFAA00;
  438. }
  439. }
  440. .small-title {
  441. width: 690rpx;
  442. height: 50rpx;
  443. display: flex;
  444. justify-content: space-between;
  445. align-items: center;
  446. margin: 24rpx 30rpx;
  447. .small-title-l {
  448. font-weight: 400;
  449. font-size: 32rpx;
  450. color: #FFFFFF;
  451. line-height: 45rpx;
  452. }
  453. .chart-tab-tow {
  454. width: 300rpx;
  455. height: 50rpx;
  456. border-radius: 25rpx;
  457. overflow: hidden;
  458. border: 1rpx solid #52545F;
  459. display: flex;
  460. justify-content: flex-start;
  461. .chart-tab-li {
  462. width: 100rpx;
  463. font-weight: 400;
  464. font-size: 28rpx;
  465. color: #999999;
  466. line-height: 50rpx;
  467. text-align: center;
  468. }
  469. .chart-tab-li:nth-of-type(1) {
  470. border-right: 1rpx solid #52545F;
  471. }
  472. .chart-tab-li:nth-of-type(2) {
  473. border-right: 1rpx solid #52545F;
  474. }
  475. .tab-A {
  476. color: #FFFFFF;
  477. background: #0183FA;
  478. }
  479. .tab-B {
  480. color: #999999;
  481. background: none;
  482. }
  483. }
  484. }
  485. .table {
  486. width: 690rpx;
  487. margin-top: 20rpx;
  488. border-radius: 20rpx 20rpx 0 0;
  489. overflow: hidden;
  490. margin-left: 30rpx;
  491. }
  492. .sortOne {
  493. display: inline-block;
  494. width: 40rpx;
  495. height: 40rpx;
  496. padding: 4rpx;
  497. box-sizing: border-box;
  498. background: rgba(255, 0, 0, 0.2);
  499. font-weight: 400;
  500. font-size: 28rpx;
  501. color: #FF0000;
  502. line-height: 40rpx;
  503. text-align: center;
  504. border-radius: 20rpx;
  505. }
  506. .sortTow {
  507. display: inline-block;
  508. width: 40rpx;
  509. height: 40rpx;
  510. padding: 4rpx;
  511. box-sizing: border-box;
  512. background: rgba(255, 153, 0, 0.2);
  513. font-weight: 400;
  514. font-size: 28rpx;
  515. color: #FF9900;
  516. line-height: 40rpx;
  517. text-align: center;
  518. border-radius: 20rpx;
  519. }
  520. .sortThree {
  521. display: inline-block;
  522. width: 40rpx;
  523. height: 40rpx;
  524. padding: 4rpx;
  525. box-sizing: border-box;
  526. background: rgba(255, 242, 0, 0.2);
  527. font-weight: 400;
  528. font-size: 28rpx;
  529. color: #FFF200;
  530. line-height: 40rpx;
  531. text-align: center;
  532. border-radius: 20rpx;
  533. }
  534. .sortFive {
  535. display: inline-block;
  536. width: 40rpx;
  537. height: 40rpx;
  538. padding: 4rpx;
  539. box-sizing: border-box;
  540. background: rgba(1, 131, 250, 0.2);
  541. font-weight: 400;
  542. font-size: 28rpx;
  543. color: #0183FA;
  544. line-height: 40rpx;
  545. text-align: center;
  546. border-radius: 20rpx;
  547. }
  548. .table-tow {
  549. width: 690rpx;
  550. margin-top: 20rpx;
  551. border-radius: 20rpx 20rpx 0 0;
  552. overflow: hidden;
  553. margin-left: 30rpx;
  554. }
  555. .small-title-tow {
  556. width: 750rpx;
  557. height: 80rpx;
  558. background: #3E414F;
  559. display: flex;
  560. justify-content: space-between;
  561. align-items: center;
  562. padding: 0 20rpx 0 30rpx;
  563. box-sizing: border-box;
  564. margin-top: 2rpx;
  565. .small-title-tow-l {
  566. flex: 1;
  567. font-weight: 400;
  568. font-size: 30rpx;
  569. color: #FFFFFF;
  570. line-height: 42rpx;
  571. overflow: hidden;
  572. text-overflow: ellipsis;
  573. white-space: nowrap;
  574. }
  575. .small-title-tow-r {
  576. width: 14rpx;
  577. height: 8rpx;
  578. }
  579. }
  580. .chart-tow {
  581. width: 690rpx;
  582. height: 480rpx;
  583. background: #3E414F;
  584. border-radius: 20rpx 20rpx 20rpx 30rpx;
  585. margin: 26rpx 30rpx 0;
  586. .chart-tow-b {
  587. width: 690rpx;
  588. height: 480rpx;
  589. }
  590. }
  591. }
  592. </style>