equipmentInfo.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573
  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-for="(item,index) in inspectionRecordDeviceList"
  136. v-show="index<3||inspectionRecordDeviceListShow"
  137. :key="index" >
  138. <view class="inspection-title">
  139. <!-- <view class="text">
  140. 巡检内容名称
  141. </view> -->
  142. <view v-if="item.status=='1'" class="state">
  143. 合格
  144. </view>
  145. <view v-else class="state2">
  146. 不合格
  147. </view>
  148. </view>
  149. <view class="inspection-infos">
  150. <view class="inspection-personnel">
  151. <view class="inspection-name">
  152. 巡检人:
  153. </view>
  154. <view class="value">
  155. {{item.inspectionUserName}}
  156. </view>
  157. </view>
  158. <view class="inspection-date">
  159. {{item.createTime}}
  160. </view>
  161. </view>
  162. </view>
  163. </view>
  164. </view>
  165. <!-- 出入库记录 -->
  166. <view class="content" >
  167. <view class="infos">
  168. <view class="name">
  169. <view class="icon"><img src="@/assets/img/riLine-todo-line@1x.png" alt=""></view>
  170. <view class="text">
  171. 出入库记录
  172. </view>
  173. <view class="all" v-if="outRecordList.length>3"
  174. @click="outRecordListShow=!outRecordListShow"
  175. >
  176. {{outRecordListShow?'收起':'展开'}}
  177. <u-icon :name="outRecordListShow?'arrow-up':'arrow-down'"></u-icon>
  178. </view>
  179. </view>
  180. <view class="records" v-for="(item,index) in outRecordList"
  181. v-show="index<3||outRecordListShow"
  182. :key="index">
  183. <view class="records-title">
  184. {{item.projectName}}
  185. </view>
  186. <view class="records-infos">
  187. <!-- <view class="item">
  188. <view class="item-title">
  189. 借用数量:
  190. </view>
  191. <view class="item-value">
  192. 4
  193. </view>
  194. </view> -->
  195. <view class="item" style="width: 100%;" >
  196. <view class="item-title">
  197. 借出时间:
  198. </view>
  199. <view class="item-value">
  200. {{item.recordTime}}
  201. </view>
  202. </view>
  203. <view class="item" style="width: 100%;" >
  204. <view class="item-title">
  205. 借用人:
  206. </view>
  207. <view class="item-value">
  208. {{item.userName}}
  209. </view>
  210. </view>
  211. <view class="item" v-if="false">
  212. <view class="item-title">
  213. 归还时间:
  214. </view>
  215. <view class="item-value highlight">
  216. 未归还
  217. </view>
  218. </view>
  219. </view>
  220. </view>
  221. </view>
  222. </view>
  223. </view>
  224. </view>
  225. </template>
  226. <script>
  227. import * as API from '@/apis/pagejs/index.js'
  228. export default {
  229. data() {
  230. return {
  231. info:{},
  232. inspectionRecordDeviceListShow:false,
  233. inspectionRecordDeviceList:[],
  234. outRecordListShow:false,
  235. outRecordList:[],
  236. //description: '下次巡检时间:2023/03/30',
  237. list: [{
  238. name: '设备信息'
  239. }, {
  240. name: '设备位置'
  241. }
  242. // , {
  243. // name: '巡检记录',
  244. // },{
  245. // name:'出入库记录'
  246. // },
  247. ],
  248. id:"",
  249. current: 0,
  250. title:""
  251. }
  252. },
  253. computed:{
  254. description(){
  255. var key=''
  256. if(this.info.experimentPeriod&&this.info.experimentLastTime){
  257. key='1'
  258. //'下次巡检时间'+ parseUnixTime(afterTimeStamp(this.info.experimentPeriod,newDate(this.info.experimentLastTime)),'{y}-{m}-{d}')
  259. }
  260. return key
  261. }
  262. },
  263. methods: {
  264. onLoad(op){
  265. console.log(op)
  266. if(op.q){
  267. this.getCode(this.takeCodeJp(decodeURIComponent(op.q)))
  268. }else{
  269. this.id=op.id
  270. this.getInfo()
  271. }
  272. },
  273. getCode(val) {
  274. uni.showLoading({
  275. title: "加载中",
  276. mask: true,
  277. })
  278. API.queryDeviceByCode({
  279. code: val,
  280. }).then((res) => {
  281. uni.hideLoading();
  282. var info =res.data.deviceInfo
  283. this.id=info.id
  284. this.getInfo()
  285. }).catch(error => {
  286. uni.showToast({
  287. title: error,
  288. icon: "none"
  289. })
  290. })
  291. },
  292. getInfo(){
  293. uni.showLoading({
  294. title: "加载中",
  295. mask: true,
  296. })
  297. API.deviceDetails({
  298. id:this.id
  299. }).then((res) => {
  300. uni.hideLoading();
  301. this.info=res.data.deviceInfo;
  302. this.inspectionRecordDeviceList=res.data.inspectionRecordDeviceList
  303. this.outRecordList=res.data.outRecordList
  304. }).catch(error => {
  305. uni.showToast({
  306. title: error,
  307. icon: "none"
  308. })
  309. })
  310. },
  311. change(index) {
  312. this.current = index;
  313. }
  314. }
  315. }
  316. </script>
  317. <style lang="scss" scoped>
  318. page{
  319. padding-bottom:100px;
  320. }
  321. /deep/.u-line-1{
  322. overflow: inherit;
  323. }
  324. // 图片
  325. .picture{
  326. width: 100%;
  327. height: 400rpx;
  328. overflow: hidden;
  329. position: relative;
  330. img{
  331. width: 100%;
  332. height: 100%;
  333. }
  334. .amount{
  335. width: 108rpx;
  336. height: 48rpx;
  337. line-height: 48rpx;
  338. border-radius: 4px;
  339. background-color: rgba(0, 0, 0, 1);
  340. color: rgba(255, 255, 255, 1);
  341. font-size: 28rpx;
  342. text-align: center;
  343. font-family: Arial;
  344. position: absolute;
  345. bottom: 48rpx;
  346. right: 32rpx;
  347. }
  348. }
  349. // 信息
  350. .main{
  351. border-radius: 16px 16px 0px 0px;
  352. background-color: #ffffff;
  353. padding-top: 24rpx;
  354. margin-top:-24rpx;
  355. // z-index: 999;
  356. position: relative;
  357. .title{
  358. color: rgba(51, 51, 51, 1);
  359. font-size: 36rpx;
  360. margin-bottom: 24rpx;
  361. padding:0 32rpx;
  362. }
  363. // 标签
  364. .tabs{
  365. position: sticky;
  366. top: 0;
  367. z-index: 9999;
  368. /deep/.u-tab-bar{
  369. background-color: #2A8EFB !important;
  370. bottom:-8rpx;
  371. }
  372. }
  373. .content{
  374. border-top: 1px solid #B7BDBF;
  375. .infos{
  376. padding: 32rpx;
  377. }
  378. .name{
  379. font-size: 32rpx;
  380. margin-bottom: 16rpx;
  381. display: flex;
  382. align-items: center;
  383. color: rgba(51, 51, 51, 1);
  384. .icon{
  385. width: 32rpx;
  386. height: 32rpx;
  387. margin-right: 8rpx;
  388. img{
  389. width: 100%;
  390. height: 100%;
  391. }
  392. }
  393. .text{
  394. line-height: 50rpx;
  395. }
  396. }
  397. .all{
  398. margin-left: auto;
  399. color: rgba(119, 119, 119, 1);
  400. font-size: 24rpx;
  401. }
  402. // 提示
  403. .hint{
  404. /deep/.u-alert-desc{
  405. // color: rgba(255, 121, 0, 1);
  406. font-size: 28rpx
  407. }
  408. }
  409. .details{
  410. border-radius: 8px;
  411. background-color: rgba(245, 246, 249, 1);
  412. padding: 24rpx 24rpx 8rpx 24rpx;
  413. display: flex;
  414. justify-content: space-between;
  415. flex-wrap: wrap;
  416. .item{
  417. display: flex;
  418. margin-bottom: 16rpx;
  419. font-size: 24rpx;
  420. width: 45%;
  421. .item-title{
  422. width: 96rpx;
  423. color: rgba(119, 119, 119, 1);
  424. }
  425. @media screen and (max-width: 375px) {
  426. .item-title{
  427. width: 120rpx;
  428. }
  429. }
  430. @media screen and (max-width: 300px) {
  431. .item-title{
  432. width: 130rpx;
  433. }
  434. }
  435. .item-value{
  436. flex: 1;
  437. color: rgba(51, 51, 51, 1);
  438. margin-left: 16rpx;
  439. white-space: nowrap;
  440. overflow: hidden;
  441. text-overflow: ellipsis;
  442. }
  443. }
  444. .location{
  445. color: rgba(51, 51, 51, 1);
  446. padding-bottom: 8rpx;
  447. }
  448. }
  449. }
  450. .inspection-contents{
  451. border-radius: 8px;
  452. background-color: rgba(245, 246, 249, 1);
  453. padding: 24rpx ;
  454. margin-top: 16rpx;
  455. .inspection-title{
  456. display: flex;
  457. justify-content: space-between;
  458. align-items: center;
  459. font-weight: bold;
  460. color: rgba(51, 51, 51, 1);
  461. .state{
  462. width: 80rpx;
  463. height: 48rpx;
  464. line-height: 48rpx;
  465. border-radius: 4px;
  466. background-color: rgba(255, 255, 255, 1);
  467. color: rgba(0, 185, 98, 1);
  468. font-size: 24rpx;
  469. text-align: center;
  470. font-family: Microsoft Yahei;
  471. border: 1px solid rgba(141, 217, 181, 1);
  472. }
  473. .state2{
  474. width: 80rpx;
  475. height: 48rpx;
  476. line-height: 48rpx;
  477. border-radius: 4px;
  478. background-color: rgba(255, 255, 255, 1);
  479. color: red;
  480. font-size: 24rpx;
  481. text-align: center;
  482. font-family: Microsoft Yahei;
  483. border: 1px solid red;
  484. }
  485. }
  486. .inspection-infos{
  487. display: flex;
  488. justify-content: space-between;
  489. align-items: center;
  490. font-size: 24rpx;
  491. margin-top: 8rpx;
  492. line-height: 36rpx;
  493. .inspection-personnel{
  494. display: flex;
  495. align-items: center;
  496. color: rgba(119, 119, 119, 1);
  497. };
  498. .date{
  499. color: rgba(119, 119, 119, 1);
  500. }
  501. }
  502. }
  503. // 出入库记录
  504. .records{
  505. border-radius: 8px;
  506. background-color: rgba(245, 246, 249, 1);
  507. padding: 24rpx 24rpx 8rpx 24rpx ;
  508. margin-top: 16rpx;
  509. .records-title{
  510. font-weight: bold;
  511. color: #333333;
  512. }
  513. .records-infos{
  514. display: flex;
  515. flex-wrap: wrap;
  516. margin-top: 16rpx;
  517. .item{
  518. font-size: 24rpx;
  519. width: 300rpx;
  520. display: flex;
  521. margin-bottom: 16rpx;
  522. color: rgba(119, 119, 119, 1);
  523. }
  524. }
  525. }
  526. }
  527. .highlight{
  528. color:#E60012
  529. }
  530. </style>