stationInfo.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556
  1. <template>
  2. <view>
  3. <u-navbar title="场站主页" ></u-navbar>
  4. <view class="gradient-header">
  5. <view class="jpback">
  6. </view>
  7. </view>
  8. <view class="panel main1_panel">
  9. <view class="name">
  10. <view class="p1">
  11. {{info.name}}
  12. </view>
  13. <view class="p2">
  14. 地址:{{info.address}}
  15. </view>
  16. </view>
  17. <view class="body">
  18. <view class="span">
  19. <image class="img" src="@/assets/img/station/item2.svg" mode=""></image>
  20. 在用
  21. <span>{{info.gunWorkNum}}</span>
  22. </view>
  23. <view class="span">
  24. <image class="img" src="@/assets/img/station/item3.svg" mode=""></image>
  25. 空闲
  26. <span>{{info.gunFreeNum}}</span>
  27. </view>
  28. <view class="span">
  29. <image class="img" src="@/assets/img/station/item1.svg" mode=""></image>
  30. 故障
  31. <span>{{info.gunFaultNum}}</span>
  32. </view>
  33. <view class="span">
  34. <image class="img" src="@/assets/img/station/item4.svg" mode=""></image>
  35. 离线
  36. <span>{{info.gunOfflineNum}}</span>
  37. </view>
  38. </view>
  39. </view>
  40. <view class="panel main2_panel">
  41. <view class="p1" @click="gotoUrl('/pages/inspection/add?stationId='+id)" >
  42. <view class="na-img">
  43. <image class="img" src="@/assets/img/station/index2.svg" mode=""></image>
  44. </view>
  45. <view class="na-text ">
  46. 设备巡检
  47. </view>
  48. </view>
  49. <view class="p2">
  50. </view>
  51. <view class="p1" @click="gotoUrl('/pages/task/addTask?stationId='+id)">
  52. <view class="na-img">
  53. <image class="img" src="@/assets/img/station/index1.svg" mode=""></image>
  54. </view>
  55. <view class="na-text ">
  56. 故障上报
  57. </view>
  58. </view>
  59. </view>
  60. <view class="panel main3_panel">
  61. <view class="title">
  62. <view class="icon">
  63. <image class="img" src="@/assets/img/circleCopy1@1x.png" mode=""></image>
  64. </view>
  65. <view class="text">
  66. <view>故障提醒</view>
  67. <view class="check-all" @click="gotoUrl('/pages/task/listTask')" >查看全部<u-icon name="arrow-right"></u-icon></view>
  68. </view>
  69. </view>
  70. <view class="body">
  71. <view class="line" v-for="(item,index) in errList"
  72. @click="gotoUrl('/pages/task/maintenanceTaks?id='+item.id)"
  73. :key="index">
  74. <view class="p1">
  75. <view class="name">
  76. {{item.errorCodeText}}
  77. </view>
  78. <view class="time" v-if="item.status==0">
  79. 上报时间:{{item.errorReportTime}}
  80. </view>
  81. <view class="time" v-if="item.status==1">
  82. 处理时间:{{item.repairTime}}
  83. </view>
  84. </view>
  85. <view class="p2">
  86. <view class="tag " :class="'tag'+item.status">
  87. {{item.statusN}}
  88. </view>
  89. <u-icon name="arrow-right" color="#D4D4D4" ></u-icon>
  90. </view>
  91. </view>
  92. <u-divider :isnone="errList.length==0" v-if="errListTotal==0|errListTotal>5"
  93. nonetext="没有找到相关内容" border-color="#CFD2D5">{{errListTotal>5?'最多显示5条':'已经到底了'}}</u-divider>
  94. </view>
  95. </view>
  96. <view class="panel main4_panel">
  97. <view class="title">
  98. <view class="icon">
  99. <image class="img" src="@/assets/img/circleCopy1@1x.png" mode=""></image>
  100. </view>
  101. <view class="text">
  102. <view>巡检记录</view>
  103. <view class="check-all" @click="gotoUrl('/pages/inspection/list')" >查看全部<u-icon name="arrow-right"></u-icon></view>
  104. </view>
  105. </view>
  106. <view class="body">
  107. <view class="line" v-for="(item,index) in recordList"
  108. @click="gotoUrl('/pages/inspection/info?id='+item.id)"
  109. :key="index" >
  110. <view class="p1">
  111. 巡检
  112. </view>
  113. <view class="p2">
  114. {{item.inspectionUserName}}
  115. </view>
  116. <view class="p3">
  117. {{lastChargeTime(item.inspectionTime)}}
  118. </view>
  119. <u-icon name="arrow-right" color="#D4D4D4" ></u-icon>
  120. </view>
  121. <u-divider :isnone="recordList.length==0" v-if="recordListTotal==0|recordListTotal>5"
  122. nonetext="没有找到相关内容" border-color="#CFD2D5">{{recordListTotal>5?'最多显示5条':'已经到底了'}}</u-divider>
  123. </view>
  124. </view>
  125. <view class="panel main5_panel">
  126. <view class="title">
  127. <view class="icon">
  128. <image class="img" src="@/assets/img/circleCopy1@1x.png" mode=""></image>
  129. </view>
  130. <view class="text">
  131. <view>设备信息</view>
  132. <view class="check-all" v-if="false" >查看全部<u-icon name="arrow-right"></u-icon></view>
  133. </view>
  134. </view>
  135. <view class="body">
  136. <view class="line lineT">
  137. <view class="p1">
  138. 设备名称
  139. </view>
  140. <view class="p2">
  141. 设备型号
  142. </view>
  143. <view class="p3">
  144. 最后充电时间
  145. </view>
  146. <u-icon name="arrow-right" color="#FFF" ></u-icon>
  147. </view>
  148. <view class="line" v-for="(item,index) in gunList" :key="index">
  149. <view class="p1">
  150. 充电枪
  151. </view>
  152. <view class="p2">
  153. {{item.gunNo}}
  154. </view>
  155. <view class="p3">
  156. {{lastChargeTime(item.lastChargeTime)}}
  157. </view>
  158. <u-icon name="arrow-right" color="#D4D4D4" ></u-icon>
  159. </view>
  160. <u-divider :isnone="gunList.length==0"
  161. nonetext="没有找到相关内容" border-color="#CFD2D5">{{'已经到底了'}}</u-divider>
  162. </view>
  163. </view>
  164. </view>
  165. </template>
  166. <script>
  167. import * as API from '@/apis/pagejs/pagesStation.js'
  168. export default {
  169. data() {
  170. return {
  171. id:"",
  172. info:{},
  173. gunList:[],
  174. recordList:[],
  175. recordListTotal:0,
  176. errList:[],
  177. errListTotal:0,
  178. };
  179. },
  180. onLoad(op) {
  181. this.id = op.id
  182. },
  183. onShow() {
  184. this.details()
  185. this.geterrList()
  186. this.getrecordList()
  187. },
  188. methods: {
  189. getrecordList(){
  190. API.recordList({
  191. pageIndex:1,
  192. pageSize:5,
  193. stationId:this.id,
  194. status:1
  195. }).then((response) => {
  196. this.recordList=response.data.data
  197. this.recordListTotal=response.data.recordsTotal
  198. }).catch(error => {
  199. uni.showToast({
  200. title: error,
  201. icon: "none"
  202. })
  203. })
  204. },
  205. geterrList(){
  206. API.errList({
  207. pageIndex:1,
  208. pageSize:5,
  209. stationId:this.id
  210. }).then((response) => {
  211. this.errList=response.data.data
  212. this.errListTotal=response.data.recordsTotal
  213. }).catch(error => {
  214. uni.showToast({
  215. title: error,
  216. icon: "none"
  217. })
  218. })
  219. },
  220. lastChargeTime(time){
  221. if(time){
  222. return time.split(" ")[0]
  223. }else{
  224. return ''
  225. }
  226. },
  227. details() {
  228. uni.showLoading({
  229. title: "加载中",
  230. mask: true,
  231. })
  232. API.stationDetails({
  233. stationId: this.id
  234. }).then((res) => {
  235. this.info = res.data.station
  236. this.gunList=res.data.gunList
  237. uni.hideLoading();
  238. }).catch(error => {
  239. uni.hideLoading();
  240. uni.showToast({
  241. title: error,
  242. icon: "none"
  243. })
  244. })
  245. },
  246. }
  247. }
  248. </script>
  249. <style lang="scss">
  250. .gradient-header {
  251. height: 0px;
  252. }
  253. .jpback {
  254. height: 400rpx;
  255. background: linear-gradient(180deg, rgba(22, 119, 255, 1) 20%, rgba(121, 177, 255, 1) 100%);
  256. }
  257. .panel{
  258. border-radius: 16rpx;
  259. background-color: rgba(255, 255, 255, 1);
  260. box-shadow: 0px 2rpx 12rpx 0px rgba(0, 59, 142, 0.05);
  261. margin: 24rpx 32rpx;
  262. padding: 40rpx;
  263. .title {
  264. display: flex;
  265. align-items: center;
  266. margin-bottom: 32rpx;
  267. font-weight: bold;
  268. .img {
  269. width: 36rpx;
  270. height: 36rpx;
  271. vertical-align: middle;
  272. border-radius: 999px;
  273. }
  274. .change {
  275. display: flex;
  276. align-items: center;
  277. .change-img {
  278. width: 32rpx;
  279. height: 32rpx;
  280. vertical-align: middle;
  281. }
  282. text {
  283. margin-left: 8rpx;
  284. }
  285. }
  286. .text {
  287. color: rgba(16, 16, 16, 1);
  288. font-size: 36rpx;
  289. margin-left: 16rpx;
  290. display: flex;
  291. justify-content: space-between;
  292. align-items: center;
  293. width: 100%;
  294. .tag {
  295. border-radius: 8rpx;
  296. border: 2rpx solid rgba(187, 187, 187, 1);
  297. color: rgba(51, 51, 51, 1);
  298. font-size: 24rpx;
  299. padding: 2rpx 8rpx;
  300. margin-left: 8rpx;
  301. }
  302. }
  303. .change {
  304. margin-left: 16rpx;
  305. font-size: 24rpx;
  306. color: #838383;
  307. }
  308. .check-all {
  309. margin-left: auto;
  310. color: rgba(131, 131, 131, 1);
  311. font-size: 24rpx;
  312. }
  313. }
  314. }
  315. .main1_panel{
  316. padding: 40rpx 0;
  317. .name{
  318. padding: 0 40rpx 24rpx 40rpx;
  319. border-bottom: 2rpx solid #F5F5F5 ;
  320. .p1{
  321. color: rgba(51,51,51,1);
  322. font-size: 36rpx;
  323. font-weight: bold;
  324. }
  325. .p2{
  326. color: rgba(51,51,51,1);
  327. font-size: 28rpx;
  328. }
  329. }
  330. .body{
  331. padding: 26rpx 40rpx 0 40rpx;
  332. display: flex;
  333. justify-content: space-between;
  334. .img{
  335. width: 28rpx;
  336. height: 28rpx;
  337. margin-right: 8rpx;
  338. }
  339. .span{
  340. display: flex;
  341. align-items: center;
  342. span{
  343. margin-left: 8rpx;
  344. }
  345. }
  346. }
  347. }
  348. .main2_panel{
  349. margin-top: 32rpx;
  350. display: flex;
  351. justify-content: space-around;
  352. align-items: center;
  353. padding: 24rpx 0 20rpx 0;
  354. .p2 {
  355. border-left: 2rpx solid rgba(187, 187, 187, 0.43);
  356. height: 70rpx;
  357. }
  358. .p1 {
  359. width: 48%;
  360. text-align: center;
  361. .na-img {
  362. display: flex;
  363. justify-content: center;
  364. margin-bottom: 8rpx;
  365. .img {
  366. width: 56rpx;
  367. height: 56rpx;
  368. }
  369. }
  370. }
  371. }
  372. .main3_panel{
  373. .body{
  374. .line{
  375. //border-bottom:2rpx solid rgba(232,232,232,1);
  376. padding: 12rpx 0;
  377. display: flex;
  378. justify-content: space-between;
  379. .p1{
  380. .name{
  381. font-weight: 600;
  382. color: rgba(51,51,51,1);
  383. font-size: 28rpx;
  384. }
  385. .time{
  386. color: rgba(119,119,119,1);
  387. font-size: 24rpx;
  388. }
  389. }
  390. .p2{
  391. display: flex;
  392. align-items: center;
  393. }
  394. }
  395. .line:not(:first-child){
  396. //background-color: red;
  397. border-top:1px solid rgba(232,232,232,1);
  398. }
  399. .tag{
  400. background-color: rgba(255,255,255,1);
  401. color: rgba(255,61,0,1);
  402. font-size: 24rpx;
  403. height: 40rpx;
  404. line-height: 40rpx;
  405. padding: 0 4rpx;
  406. border-radius: 8rpx;
  407. border: 2rpx solid rgba(255,61,0,1);
  408. display: flex;
  409. }
  410. .tag0{
  411. color: rgba(255,61,0,1);
  412. border: 2rpx solid rgba(255,61,0,1);
  413. }
  414. .tag1{
  415. color: #00B962;
  416. border: 2rpx solid #00B962;
  417. }
  418. }
  419. }
  420. .main4_panel,.main5_panel{
  421. .body{
  422. .line{
  423. padding: 18rpx 0;
  424. display: flex;
  425. justify-content: space-between;
  426. }
  427. .p1{
  428. font-weight: 600;
  429. color: rgba(51,51,51,1);
  430. font-size: 28rpx;
  431. }
  432. .p2{
  433. width: 300rpx;
  434. overflow: hidden;
  435. text-overflow: ellipsis;
  436. white-space: nowrap;
  437. }
  438. .line:not(:first-child) {
  439. border-top:2rpx solid rgba(232,232,232,1);
  440. }
  441. }
  442. }
  443. .main5_panel{
  444. .p1{
  445. width: 140rpx;
  446. }
  447. .p2{
  448. width: 270rpx !important;
  449. }
  450. .p3{
  451. width: 180rpx !important;
  452. }
  453. .lineT{
  454. font-weight: bold;
  455. }
  456. }
  457. </style>