inspectionRecord.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313
  1. <template>
  2. <view>
  3. <u-navbar title="检验记录"></u-navbar>
  4. <view class="container">
  5. <view class="main">
  6. <view class="list-item" v-for="(item,index) in inspectionRecordDeviceList"
  7. :key="index">
  8. <!--信息 -->
  9. <view class="list-infos">
  10. <view class="infos-head">
  11. <view class="name">
  12. {{item.deviceInfo.title}}
  13. </view>
  14. <view class="state" @click="ckInfo(item)">
  15. 查看设备
  16. </view>
  17. </view>
  18. <view class="infos">
  19. <view class="infos-1">
  20. <view class="infos-item">
  21. <view class="item-name">
  22. 型号:
  23. </view>
  24. <view class="item-value">
  25. {{item.deviceInfo.model}}
  26. </view>
  27. </view>
  28. </view>
  29. <view class="infos-2">
  30. <view class="infos-item">
  31. <view class="item-name">
  32. 设备编号:
  33. </view>
  34. <view class="item-value">
  35. {{item.deviceInfo.code}}
  36. </view>
  37. </view>
  38. </view>
  39. </view>
  40. </view>
  41. <!-- 检验结果 -->
  42. <view class="result">
  43. <view class="title">
  44. 检验结果
  45. </view>
  46. <view :class="item.status==1?'value':'value2'">
  47. {{item.status==1?'合格':'不合格'}}
  48. </view>
  49. </view>
  50. <!-- 备注 -->
  51. <view class="remark">
  52. <view class="title">
  53. 备注说明:
  54. </view>
  55. <view class="value">
  56. {{item.remark?item.remark:'未填写'}}
  57. </view>
  58. </view>
  59. <!-- 图片 -->
  60. <view class="image" v-if="item.imgUrls" >
  61. <view class="img-box" v-for="(img,index2) in item.imgUrls.split(',')" :key="index2" >
  62. <!-- src="@/assets/img/image.png"-->
  63. <img :src="img" alt="">
  64. </view>
  65. </view>
  66. </view>
  67. </view>
  68. </view>
  69. </view>
  70. </template>
  71. <script>
  72. import * as API from '@/apis/pagejs/storeManagement.js'
  73. export default {
  74. data() {
  75. return {
  76. show: false,
  77. inspectionRecordDeviceList:[]
  78. };
  79. },
  80. onLoad(op){
  81. this.id=op.id
  82. this.getInfo()
  83. },
  84. methods: {
  85. ckInfo(item) {
  86. var url = "/pages/otherFunctions/equipmentRetrieval/equipmentInfo?id=" + item.deviceId;
  87. uni.navigateTo({
  88. url: url,
  89. })
  90. },
  91. getInfo(bl){
  92. uni.showLoading({
  93. title: "加载中",
  94. mask: true,
  95. })
  96. API.inspectionDetails({
  97. recordId:this.id,
  98. }).then((res) => {
  99. uni.hideLoading();
  100. this.inspectionRecordDeviceList=res.data.inspectionRecordDeviceList;
  101. }).catch(error => {
  102. uni.showToast({
  103. title: error,
  104. icon: "none"
  105. })
  106. })
  107. },
  108. changeShow() {
  109. this.show = !this.show
  110. }
  111. },
  112. };
  113. </script>
  114. <style scoped lang="scss">
  115. .head {
  116. background-color: #fff;
  117. padding: 32rpx;
  118. .title {
  119. color: rgba(51, 51, 51, 1);
  120. font-size: 36rpx;
  121. margin-bottom: 16rpx;
  122. }
  123. .item {
  124. display: flex;
  125. color: #777777;
  126. margin-top: 16rpx;
  127. .name,
  128. .value {
  129. font-weight: bold;
  130. }
  131. .unfold {
  132. margin-left: auto;
  133. position: relative;
  134. color: #929EA5;
  135. font-family: Microsoft Yahei;
  136. /deep/.uicon-arrow-down {
  137. margin-left: 8rpx;
  138. }
  139. }
  140. .options {
  141. width: 120rpx;
  142. height: 60rpx;
  143. line-height: 60rpx;
  144. text-align: center;
  145. background-color: #fff;
  146. color: rgba(65, 80, 88, 1);
  147. font-family: Microsoft Yahei;
  148. position: absolute;
  149. top: 320rpx;
  150. right: 24rpx;
  151. box-shadow: 5px 5px 10px gray;
  152. }
  153. }
  154. }
  155. .container {
  156. padding-bottom: 60px;
  157. .main {
  158. padding: 0 24rpx;
  159. .list-item {
  160. border-radius: 8px;
  161. padding: 24rpx;
  162. background-color: #fff;
  163. margin-top: 24rpx;
  164. }
  165. // 信息
  166. .list-infos {
  167. padding-bottom: 24rpx;
  168. border-bottom: 1px solid rgba(232, 232, 232, 1);
  169. .infos-head {
  170. display: flex;
  171. justify-content: space-between;
  172. align-items: center;
  173. margin-bottom: 24rpx;
  174. .name {
  175. color: rgba(51, 51, 51, 1);
  176. font-size: 32rpx;
  177. }
  178. .state {
  179. border: 1px solid rgba(69, 186, 69, 1);
  180. border-radius: 4px;
  181. color: rgba(69, 186, 69, 1);
  182. font-size: 24rpx;
  183. line-height: 48rpx;
  184. width: 160rpx;
  185. text-align: center;
  186. text {
  187. img {
  188. vertical-align: middle;
  189. margin-right: 4rpx;
  190. }
  191. }
  192. }
  193. }
  194. .infos {
  195. margin-top: 16rpx;
  196. display: flex;
  197. justify-content: space-between;
  198. color: #777777;
  199. font-size: 24rpx;
  200. .infos-item {
  201. display: flex;
  202. margin-bottom: 8rpx;
  203. .item-value {
  204. //width: 200rpx;
  205. max-width: 200rpx;
  206. overflow: hidden;
  207. white-space: nowrap;
  208. text-overflow: ellipsis;
  209. }
  210. }
  211. }
  212. }
  213. // 结果
  214. .result{
  215. display: flex;
  216. justify-content: space-between;
  217. margin-top: 24rpx;
  218. .title{
  219. color:#333333;
  220. font-weight: bold;
  221. }
  222. .value{
  223. color: #0EB01D;
  224. }
  225. .value2{
  226. color: red;
  227. }
  228. }
  229. // 备注
  230. .remark{
  231. display: flex;
  232. color:#777777;
  233. margin-top: 24rpx;
  234. }
  235. // 图片
  236. .image{
  237. margin-top: 24rpx;
  238. display: flex;
  239. flex-wrap: wrap;
  240. .img-box{
  241. border-radius: 4px;
  242. overflow: hidden;
  243. margin-bottom: 16rpx;
  244. img{
  245. width: 100%;
  246. height: 100%;
  247. }
  248. }
  249. @media screen and(max-width:375px) {
  250. .img-box{
  251. width: 154rpx;
  252. height: 154rpx;
  253. margin-left: 12rpx;
  254. }
  255. }
  256. @media screen and(min-width:375px) {
  257. .img-box{
  258. width: 154rpx;
  259. height: 154rpx;
  260. margin-left:8rpx;
  261. }
  262. }
  263. }
  264. }
  265. }
  266. </style>