equipmentInfo.vue 14 KB

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