equipmentInfo.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582
  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. <ujp-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)"></ujp-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. import ujpAlertTips from "@/pages/otherFunctions/components/u-alert-tips.vue"
  235. export default {
  236. components:{
  237. ujpAlertTips
  238. },
  239. data() {
  240. return {
  241. info:{},
  242. inspectionRecordDeviceListShow:false,
  243. inspectionRecordDeviceList:[],
  244. outRecordListShow:false,
  245. outRecordList:[],
  246. //description: '下次检验时间:2023/03/30',
  247. list: [{
  248. name: '设备信息'
  249. }, {
  250. name: '设备位置'
  251. }
  252. // , {
  253. // name: '检验记录',
  254. // },{
  255. // name:'出入库记录'
  256. // },
  257. ],
  258. id:"",
  259. current: 0,
  260. title:""
  261. }
  262. },
  263. computed:{
  264. description(){
  265. var key=''
  266. if(this.info.experimentPeriod&&this.info.experimentLastTime){
  267. key='1'
  268. //'下次检验时间'+ parseUnixTime(afterTimeStamp(this.info.experimentPeriod,newDate(this.info.experimentLastTime)),'{y}-{m}-{d}')
  269. }
  270. return key
  271. }
  272. },
  273. methods: {
  274. onLoad(op){
  275. console.log(op)
  276. if(op.q){
  277. this.getCode(this.takeCodeJp(decodeURIComponent(op.q)))
  278. }else{
  279. this.id=op.id
  280. this.getInfo()
  281. }
  282. },
  283. getCode(val) {
  284. uni.showLoading({
  285. title: "加载中",
  286. mask: true,
  287. })
  288. API.queryDeviceByCode({
  289. code: val,
  290. }).then((res) => {
  291. uni.hideLoading();
  292. var info =res.data.deviceInfo
  293. this.id=info.id
  294. this.getInfo()
  295. }).catch(error => {
  296. uni.showToast({
  297. title: error,
  298. icon: "none"
  299. })
  300. })
  301. },
  302. getInfo(){
  303. uni.showLoading({
  304. title: "加载中",
  305. mask: true,
  306. })
  307. API.deviceDetails({
  308. id:this.id
  309. }).then((res) => {
  310. uni.hideLoading();
  311. this.info=res.data.deviceInfo;
  312. this.inspectionRecordDeviceList=res.data.inspectionRecordDeviceList
  313. this.outRecordList=res.data.outRecordList
  314. }).catch(error => {
  315. uni.showToast({
  316. title: error,
  317. icon: "none"
  318. })
  319. })
  320. },
  321. change(index) {
  322. this.current = index;
  323. }
  324. }
  325. }
  326. </script>
  327. <style lang="scss" scoped>
  328. page{
  329. padding-bottom:100px;
  330. }
  331. /deep/.u-line-1{
  332. overflow: inherit;
  333. }
  334. // 图片
  335. .picture{
  336. width: 100%;
  337. height: 400rpx;
  338. overflow: hidden;
  339. position: relative;
  340. img{
  341. width: 100%;
  342. height: 100%;
  343. }
  344. .amount{
  345. width: 108rpx;
  346. height: 48rpx;
  347. line-height: 48rpx;
  348. border-radius: 4px;
  349. background-color: rgba(0, 0, 0, 1);
  350. color: rgba(255, 255, 255, 1);
  351. font-size: 28rpx;
  352. text-align: center;
  353. font-family: Arial;
  354. position: absolute;
  355. bottom: 48rpx;
  356. right: 32rpx;
  357. }
  358. }
  359. // 信息
  360. .main{
  361. border-radius: 16px 16px 0px 0px;
  362. background-color: #ffffff;
  363. padding-top: 24rpx;
  364. margin-top:-24rpx;
  365. // z-index: 999;
  366. position: relative;
  367. .title{
  368. color: rgba(51, 51, 51, 1);
  369. font-size: 36rpx;
  370. margin-bottom: 24rpx;
  371. padding:0 32rpx;
  372. }
  373. // 标签
  374. .tabs{
  375. position: sticky;
  376. top: 0;
  377. z-index: 9999;
  378. /deep/.u-tab-bar{
  379. background-color: #2A8EFB !important;
  380. bottom:-8rpx;
  381. }
  382. }
  383. .content{
  384. border-top: 1px solid #B7BDBF;
  385. .infos{
  386. padding: 32rpx;
  387. }
  388. .name{
  389. font-size: 32rpx;
  390. margin-bottom: 16rpx;
  391. display: flex;
  392. align-items: center;
  393. color: rgba(51, 51, 51, 1);
  394. .icon{
  395. width: 32rpx;
  396. height: 32rpx;
  397. margin-right: 8rpx;
  398. img{
  399. width: 100%;
  400. height: 100%;
  401. }
  402. }
  403. .text{
  404. line-height: 50rpx;
  405. }
  406. }
  407. .all{
  408. margin-left: auto;
  409. color: rgba(119, 119, 119, 1);
  410. font-size: 24rpx;
  411. }
  412. // 提示
  413. .hint{
  414. /deep/.u-alert-desc{
  415. // color: rgba(255, 121, 0, 1);
  416. font-size: 28rpx
  417. }
  418. }
  419. .details{
  420. border-radius: 8px;
  421. background-color: rgba(245, 246, 249, 1);
  422. padding: 24rpx 24rpx 8rpx 24rpx;
  423. display: flex;
  424. justify-content: space-between;
  425. flex-wrap: wrap;
  426. .item{
  427. display: flex;
  428. margin-bottom: 16rpx;
  429. font-size: 24rpx;
  430. width: 45%;
  431. .item-title{
  432. width: 96rpx;
  433. color: rgba(119, 119, 119, 1);
  434. }
  435. @media screen and (max-width: 375px) {
  436. .item-title{
  437. width: 120rpx;
  438. }
  439. }
  440. @media screen and (max-width: 300px) {
  441. .item-title{
  442. width: 130rpx;
  443. }
  444. }
  445. .item-value{
  446. flex: 1;
  447. color: rgba(51, 51, 51, 1);
  448. margin-left: 16rpx;
  449. white-space: nowrap;
  450. overflow: hidden;
  451. text-overflow: ellipsis;
  452. }
  453. }
  454. .location{
  455. color: rgba(51, 51, 51, 1);
  456. padding-bottom: 8rpx;
  457. }
  458. }
  459. }
  460. .inspection-contents{
  461. border-radius: 8px;
  462. background-color: rgba(245, 246, 249, 1);
  463. padding: 24rpx ;
  464. margin-top: 16rpx;
  465. .inspection-title{
  466. display: flex;
  467. justify-content: space-between;
  468. align-items: center;
  469. font-weight: bold;
  470. color: rgba(51, 51, 51, 1);
  471. .state{
  472. width: 80rpx;
  473. height: 48rpx;
  474. line-height: 48rpx;
  475. border-radius: 4px;
  476. background-color: rgba(255, 255, 255, 1);
  477. color: rgba(0, 185, 98, 1);
  478. font-size: 24rpx;
  479. text-align: center;
  480. font-family: Microsoft Yahei;
  481. border: 1px solid rgba(141, 217, 181, 1);
  482. }
  483. .state2{
  484. width: 80rpx;
  485. height: 48rpx;
  486. line-height: 48rpx;
  487. border-radius: 4px;
  488. background-color: rgba(255, 255, 255, 1);
  489. color: red;
  490. font-size: 24rpx;
  491. text-align: center;
  492. font-family: Microsoft Yahei;
  493. border: 1px solid red;
  494. }
  495. }
  496. .inspection-infos{
  497. display: flex;
  498. justify-content: space-between;
  499. align-items: center;
  500. font-size: 24rpx;
  501. margin-top: 8rpx;
  502. line-height: 36rpx;
  503. .inspection-personnel{
  504. display: flex;
  505. align-items: center;
  506. color: rgba(119, 119, 119, 1);
  507. };
  508. .date{
  509. color: rgba(119, 119, 119, 1);
  510. }
  511. }
  512. }
  513. // 出入库记录
  514. .records{
  515. border-radius: 8px;
  516. background-color: rgba(245, 246, 249, 1);
  517. padding: 24rpx 24rpx 8rpx 24rpx ;
  518. margin-top: 16rpx;
  519. .records-title{
  520. font-weight: bold;
  521. color: #333333;
  522. }
  523. .records-infos{
  524. display: flex;
  525. flex-wrap: wrap;
  526. margin-top: 16rpx;
  527. .item{
  528. font-size: 24rpx;
  529. width: 300rpx;
  530. display: flex;
  531. margin-bottom: 16rpx;
  532. color: rgba(119, 119, 119, 1);
  533. }
  534. }
  535. }
  536. }
  537. .highlight{
  538. color:#E60012
  539. }
  540. </style>