equipmentInfo.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578
  1. <template>
  2. <view>
  3. <u-navbar :title="info.title"></u-navbar>
  4. <!-- 图片 -->
  5. <view class="picture">
  6. <img :src="info.imgUrl" alt="">
  7. <view class="amount" v-if="false">
  8. <text>1</text>/
  9. <text>5</text>
  10. </view>
  11. </view>
  12. <!-- 信息 -->
  13. <view class="main">
  14. <view class="title">
  15. {{info.title}}
  16. <span style="float: right;">{{info.code}}</span>
  17. </view>
  18. <!-- 标签 -->
  19. <view class="tabs " v-if="false">
  20. <u-tabs bar-width="120" inactive-color="#999999" active-color="#000000" :list="list" :is-scroll="false" :current="current" @change="change"></u-tabs>
  21. </view>
  22. <view class="content">
  23. <!-- 提示 -->
  24. <view class="hint" v-if="description">
  25. <u-alert-tips icon="bell-fill" :type="info.healthStatus==1?'success':info.healthStatus==6?'error':'warning'"
  26. :show-icon="true" :title="title" :description="descriptionKey(info,true)"></u-alert-tips>
  27. </view>
  28. <!-- 设备信息 -->
  29. <view class="infos">
  30. <view class="name">
  31. <view class="icon"><img src="@/assets/img/riLine-robot-line@1x.png" alt=""></view>
  32. <view class="text">
  33. 设备信息
  34. </view>
  35. </view>
  36. <view class="details">
  37. <view class="item">
  38. <view class="item-title">
  39. 规格
  40. </view>
  41. <view class="item-value">
  42. {{info.specifications}}
  43. </view>
  44. </view>
  45. <view class="item">
  46. <view class="item-title">
  47. 型号
  48. </view>
  49. <view class="item-value">
  50. {{info.model}}
  51. </view>
  52. </view>
  53. <view class="item" >
  54. <view class="item-title">
  55. 单位
  56. </view>
  57. <view class="item-value">
  58. {{info.unit}}
  59. </view>
  60. </view>
  61. <view class="item" >
  62. <view class="item-title">
  63. 制造厂家
  64. </view>
  65. <view class="item-value">
  66. {{info.manufactor}}
  67. </view>
  68. </view>
  69. <view class="item" style="width: 100%;" >
  70. <view class="item-title">
  71. 购置时间
  72. </view>
  73. <view class="item-value">
  74. {{info.buyTime}}
  75. </view>
  76. </view>
  77. <view class="item" style="width: 100%;" >
  78. <view class="item-title">
  79. 上次巡检
  80. </view>
  81. <view class="item-value">
  82. {{info.experimentLastTime}}
  83. </view>
  84. </view>
  85. <view class="item" >
  86. <view class="item-title">
  87. 巡检周期
  88. </view>
  89. <view class="item-value">
  90. {{info.experimentPeriod?info.experimentPeriod+'天':''}}
  91. </view>
  92. </view>
  93. <!-- <view class="item" >
  94. <view class="item-title">
  95. 单价
  96. </view>
  97. <view class="item-value">
  98. {{info.unitPrice?info.unitPrice+'元':'无'}}
  99. </view>
  100. </view> -->
  101. </view>
  102. </view>
  103. </view>
  104. <!-- 存放地点 -->
  105. <view class="content">
  106. <view class="infos">
  107. <view class="name">
  108. <view class="icon"><img src="@/assets/img/riLine-robot-line@1x.png" alt=""></view>
  109. <view class="text">
  110. 存放地点
  111. </view>
  112. </view>
  113. <view class="details">
  114. <view class="location">
  115. {{info.addressId?info.addressId:'未录入'}}
  116. </view>
  117. </view>
  118. </view>
  119. </view>
  120. <!-- 巡检记录 -->
  121. <view class="content">
  122. <view class="infos">
  123. <view class="name">
  124. <view class="icon"><img src="@/assets/img/riLine-device-recover-line@1x.png" alt=""></view>
  125. <view class="text">
  126. 巡检记录
  127. </view>
  128. <view class="all" v-if="inspectionRecordDeviceList.length>3"
  129. @click="inspectionRecordDeviceListShow=!inspectionRecordDeviceListShow"
  130. >
  131. {{inspectionRecordDeviceListShow?'收起':'展开'}}
  132. <u-icon :name="inspectionRecordDeviceListShow?'arrow-up':'arrow-down'"></u-icon>
  133. </view>
  134. </view>
  135. <view class="inspection-contents" v-if="inspectionRecordDeviceList.length==0">
  136. 暂无
  137. </view>
  138. <view class="inspection-contents" v-for="(item,index) in inspectionRecordDeviceList"
  139. v-show="index<3||inspectionRecordDeviceListShow"
  140. :key="index" >
  141. <view class="inspection-title">
  142. <!-- <view class="text">
  143. 巡检内容名称
  144. </view> -->
  145. <view v-if="item.status=='1'" class="state">
  146. 合格
  147. </view>
  148. <view v-else class="state2">
  149. 不合格
  150. </view>
  151. </view>
  152. <view class="inspection-infos">
  153. <view class="inspection-personnel">
  154. <view class="inspection-name">
  155. 巡检人:
  156. </view>
  157. <view class="value">
  158. {{item.inspectionUserName}}
  159. </view>
  160. </view>
  161. <view class="inspection-date">
  162. {{item.createTime}}
  163. </view>
  164. </view>
  165. </view>
  166. </view>
  167. </view>
  168. <!-- 出入库记录 -->
  169. <view class="content" >
  170. <view class="infos">
  171. <view class="name">
  172. <view class="icon"><img src="@/assets/img/riLine-todo-line@1x.png" alt=""></view>
  173. <view class="text">
  174. 出入库记录
  175. </view>
  176. <view class="all" v-if="outRecordList.length>3"
  177. @click="outRecordListShow=!outRecordListShow"
  178. >
  179. {{outRecordListShow?'收起':'展开'}}
  180. <u-icon :name="outRecordListShow?'arrow-up':'arrow-down'"></u-icon>
  181. </view>
  182. </view>
  183. <view class="records" v-if="outRecordList.length==0">
  184. 暂无
  185. </view>
  186. <view class="records" v-for="(item,index) in outRecordList"
  187. v-show="index<3||outRecordListShow"
  188. :key="index">
  189. <view class="records-title">
  190. {{item.projectName}}
  191. </view>
  192. <view class="records-infos">
  193. <!-- <view class="item">
  194. <view class="item-title">
  195. 借用数量:
  196. </view>
  197. <view class="item-value">
  198. 4
  199. </view>
  200. </view> -->
  201. <view class="item" style="width: 100%;" >
  202. <view class="item-title">
  203. 借出时间:
  204. </view>
  205. <view class="item-value">
  206. {{item.recordTime}}
  207. </view>
  208. </view>
  209. <view class="item" style="width: 100%;" >
  210. <view class="item-title">
  211. 借用人:
  212. </view>
  213. <view class="item-value">
  214. {{item.userName}}
  215. </view>
  216. </view>
  217. <view class="item" v-if="false">
  218. <view class="item-title">
  219. 归还时间:
  220. </view>
  221. <view class="item-value highlight">
  222. 未归还
  223. </view>
  224. </view>
  225. </view>
  226. </view>
  227. </view>
  228. </view>
  229. </view>
  230. </view>
  231. </template>
  232. <script>
  233. import * as API from '@/apis/pagejs/index.js'
  234. export default {
  235. data() {
  236. return {
  237. info:{},
  238. inspectionRecordDeviceListShow:false,
  239. inspectionRecordDeviceList:[],
  240. outRecordListShow:false,
  241. outRecordList:[],
  242. //description: '下次巡检时间:2023/03/30',
  243. list: [{
  244. name: '设备信息'
  245. }, {
  246. name: '设备位置'
  247. }
  248. // , {
  249. // name: '巡检记录',
  250. // },{
  251. // name:'出入库记录'
  252. // },
  253. ],
  254. id:"",
  255. current: 0,
  256. title:""
  257. }
  258. },
  259. computed:{
  260. description(){
  261. var key=''
  262. if(this.info.experimentPeriod&&this.info.experimentLastTime){
  263. key='1'
  264. //'下次巡检时间'+ parseUnixTime(afterTimeStamp(this.info.experimentPeriod,newDate(this.info.experimentLastTime)),'{y}-{m}-{d}')
  265. }
  266. return key
  267. }
  268. },
  269. methods: {
  270. onLoad(op){
  271. console.log(op)
  272. if(op.q){
  273. this.getCode(this.takeCodeJp(decodeURIComponent(op.q)))
  274. }else{
  275. this.id=op.id
  276. this.getInfo()
  277. }
  278. },
  279. getCode(val) {
  280. uni.showLoading({
  281. title: "加载中",
  282. mask: true,
  283. })
  284. API.queryDeviceByCode({
  285. code: val,
  286. }).then((res) => {
  287. uni.hideLoading();
  288. var info =res.data.deviceInfo
  289. this.id=info.id
  290. this.getInfo()
  291. }).catch(error => {
  292. uni.showToast({
  293. title: error,
  294. icon: "none"
  295. })
  296. })
  297. },
  298. getInfo(){
  299. uni.showLoading({
  300. title: "加载中",
  301. mask: true,
  302. })
  303. API.deviceDetails({
  304. id:this.id
  305. }).then((res) => {
  306. uni.hideLoading();
  307. this.info=res.data.deviceInfo;
  308. this.inspectionRecordDeviceList=res.data.inspectionRecordDeviceList
  309. this.outRecordList=res.data.outRecordList
  310. }).catch(error => {
  311. uni.showToast({
  312. title: error,
  313. icon: "none"
  314. })
  315. })
  316. },
  317. change(index) {
  318. this.current = index;
  319. }
  320. }
  321. }
  322. </script>
  323. <style lang="scss" scoped>
  324. page{
  325. padding-bottom:100px;
  326. }
  327. /deep/.u-line-1{
  328. overflow: inherit;
  329. }
  330. // 图片
  331. .picture{
  332. width: 100%;
  333. height: 400rpx;
  334. overflow: hidden;
  335. position: relative;
  336. img{
  337. width: 100%;
  338. height: 100%;
  339. }
  340. .amount{
  341. width: 108rpx;
  342. height: 48rpx;
  343. line-height: 48rpx;
  344. border-radius: 4px;
  345. background-color: rgba(0, 0, 0, 1);
  346. color: rgba(255, 255, 255, 1);
  347. font-size: 28rpx;
  348. text-align: center;
  349. font-family: Arial;
  350. position: absolute;
  351. bottom: 48rpx;
  352. right: 32rpx;
  353. }
  354. }
  355. // 信息
  356. .main{
  357. border-radius: 16px 16px 0px 0px;
  358. background-color: #ffffff;
  359. padding-top: 24rpx;
  360. margin-top:-24rpx;
  361. // z-index: 999;
  362. position: relative;
  363. .title{
  364. color: rgba(51, 51, 51, 1);
  365. font-size: 36rpx;
  366. margin-bottom: 24rpx;
  367. padding:0 32rpx;
  368. }
  369. // 标签
  370. .tabs{
  371. position: sticky;
  372. top: 0;
  373. z-index: 9999;
  374. /deep/.u-tab-bar{
  375. background-color: #2A8EFB !important;
  376. bottom:-8rpx;
  377. }
  378. }
  379. .content{
  380. border-top: 1px solid #B7BDBF;
  381. .infos{
  382. padding: 32rpx;
  383. }
  384. .name{
  385. font-size: 32rpx;
  386. margin-bottom: 16rpx;
  387. display: flex;
  388. align-items: center;
  389. color: rgba(51, 51, 51, 1);
  390. .icon{
  391. width: 32rpx;
  392. height: 32rpx;
  393. margin-right: 8rpx;
  394. img{
  395. width: 100%;
  396. height: 100%;
  397. }
  398. }
  399. .text{
  400. line-height: 50rpx;
  401. }
  402. }
  403. .all{
  404. margin-left: auto;
  405. color: rgba(119, 119, 119, 1);
  406. font-size: 24rpx;
  407. }
  408. // 提示
  409. .hint{
  410. /deep/.u-alert-desc{
  411. // color: rgba(255, 121, 0, 1);
  412. font-size: 28rpx
  413. }
  414. }
  415. .details{
  416. border-radius: 8px;
  417. background-color: rgba(245, 246, 249, 1);
  418. padding: 24rpx 24rpx 8rpx 24rpx;
  419. display: flex;
  420. justify-content: space-between;
  421. flex-wrap: wrap;
  422. .item{
  423. display: flex;
  424. margin-bottom: 16rpx;
  425. font-size: 24rpx;
  426. width: 45%;
  427. .item-title{
  428. width: 96rpx;
  429. color: rgba(119, 119, 119, 1);
  430. }
  431. @media screen and (max-width: 375px) {
  432. .item-title{
  433. width: 120rpx;
  434. }
  435. }
  436. @media screen and (max-width: 300px) {
  437. .item-title{
  438. width: 130rpx;
  439. }
  440. }
  441. .item-value{
  442. flex: 1;
  443. color: rgba(51, 51, 51, 1);
  444. margin-left: 16rpx;
  445. white-space: nowrap;
  446. overflow: hidden;
  447. text-overflow: ellipsis;
  448. }
  449. }
  450. .location{
  451. color: rgba(51, 51, 51, 1);
  452. padding-bottom: 8rpx;
  453. }
  454. }
  455. }
  456. .inspection-contents{
  457. border-radius: 8px;
  458. background-color: rgba(245, 246, 249, 1);
  459. padding: 24rpx ;
  460. margin-top: 16rpx;
  461. .inspection-title{
  462. display: flex;
  463. justify-content: space-between;
  464. align-items: center;
  465. font-weight: bold;
  466. color: rgba(51, 51, 51, 1);
  467. .state{
  468. width: 80rpx;
  469. height: 48rpx;
  470. line-height: 48rpx;
  471. border-radius: 4px;
  472. background-color: rgba(255, 255, 255, 1);
  473. color: rgba(0, 185, 98, 1);
  474. font-size: 24rpx;
  475. text-align: center;
  476. font-family: Microsoft Yahei;
  477. border: 1px solid rgba(141, 217, 181, 1);
  478. }
  479. .state2{
  480. width: 80rpx;
  481. height: 48rpx;
  482. line-height: 48rpx;
  483. border-radius: 4px;
  484. background-color: rgba(255, 255, 255, 1);
  485. color: red;
  486. font-size: 24rpx;
  487. text-align: center;
  488. font-family: Microsoft Yahei;
  489. border: 1px solid red;
  490. }
  491. }
  492. .inspection-infos{
  493. display: flex;
  494. justify-content: space-between;
  495. align-items: center;
  496. font-size: 24rpx;
  497. margin-top: 8rpx;
  498. line-height: 36rpx;
  499. .inspection-personnel{
  500. display: flex;
  501. align-items: center;
  502. color: rgba(119, 119, 119, 1);
  503. };
  504. .date{
  505. color: rgba(119, 119, 119, 1);
  506. }
  507. }
  508. }
  509. // 出入库记录
  510. .records{
  511. border-radius: 8px;
  512. background-color: rgba(245, 246, 249, 1);
  513. padding: 24rpx 24rpx 8rpx 24rpx ;
  514. margin-top: 16rpx;
  515. .records-title{
  516. font-weight: bold;
  517. color: #333333;
  518. }
  519. .records-infos{
  520. display: flex;
  521. flex-wrap: wrap;
  522. margin-top: 16rpx;
  523. .item{
  524. font-size: 24rpx;
  525. width: 300rpx;
  526. display: flex;
  527. margin-bottom: 16rpx;
  528. color: rgba(119, 119, 119, 1);
  529. }
  530. }
  531. }
  532. }
  533. .highlight{
  534. color:#E60012
  535. }
  536. </style>