deliveriedList.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350
  1. <template>
  2. <view>
  3. <u-navbar >
  4. <view class="u-navbar " >
  5. <view class="title" >
  6. 出库设备清单<text>({{recordsTotal}})</text>
  7. </view>
  8. </view>
  9. </u-navbar>
  10. <view class="list" v-for="(item,index) in list" :key="index">
  11. <!-- 清单信息 -->
  12. <view class="list-infos" >
  13. <view class="infos-head">
  14. <view class="name">
  15. {{item.deviceName}}
  16. </view>
  17. <view class="state">
  18. {{recordItemStatus(item.status)}}: <text>{{item.needCount}}</text>
  19. </view>
  20. </view>
  21. <view class="infos">
  22. <view class="infos-1">
  23. <view class="infos-item">
  24. <view class="item-name">
  25. 厂家:
  26. </view>
  27. <view class="item-value">
  28. {{item.deviceInfo.manufactor}}
  29. </view>
  30. </view>
  31. <view class="infos-item">
  32. <view class="item-name">
  33. 单位:
  34. </view>
  35. <view class="item-value">
  36. {{item.deviceInfo.unit}}
  37. </view>
  38. </view>
  39. </view>
  40. <view class="infos-2">
  41. <view class="infos-item">
  42. <view class="item-name">
  43. 规格:
  44. </view>
  45. <view class="item-value">
  46. {{item.deviceInfo.specifications}}
  47. </view>
  48. </view>
  49. <view class="infos-item">
  50. <view class="item-name">
  51. 型号:
  52. </view>
  53. <view class="item-value">
  54. {{item.deviceInfo.model}}
  55. </view>
  56. </view>
  57. </view>
  58. </view>
  59. </view>
  60. <!-- 备注 -->
  61. <view class="remark" v-if="item.remark" >
  62. <view class="name">
  63. 备注:
  64. </view>
  65. <view class="value">
  66. {{item.remark}}
  67. </view>
  68. </view>
  69. <view class="prepare-out" v-if="item.realDeviceList&&item.realDeviceList.length" >
  70. <view class="head">
  71. <view class="amount">
  72. <view class="title">
  73. 实际领用:
  74. </view>
  75. <view class="value">
  76. {{item.realDeviceList.length}}
  77. </view>
  78. </view>
  79. <view class="unfold" v-show="item.realDeviceList.length>2" @click="changeShow(item)">
  80. {{item.show?'收起':'展开'}}<u-icon name="arrow-down"></u-icon>
  81. <!-- <view class="option" v-if="show==true">
  82. </view> -->
  83. </view>
  84. </view>
  85. <!-- 编号 -->
  86. <view class="serial-number" v-for="(item2,j) in item.realDeviceList"
  87. v-show="j<2||item.show" :key="j">
  88. <view class="item">
  89. <view class="text">
  90. 设备编号:
  91. </view>
  92. <view class="number" >
  93. {{item2.deviceCode}}
  94. </view>
  95. </view>
  96. </view>
  97. </view>
  98. </view>
  99. <u-divider v-if="list.length==recordsTotal" border-color="#CFD2D5">已经到底了</u-divider>
  100. </view>
  101. </template>
  102. <script>
  103. import * as API from '@/apis/pagejs/projectDepartment.js'
  104. import {
  105. recordItemStatus
  106. } from '@/apis/status.js'
  107. export default {
  108. data() {
  109. return {
  110. show: false,
  111. list:[],
  112. id:"",
  113. recordsTotal: 0,
  114. listFrom:{
  115. pageIndex: 1,
  116. pageSize: 5,
  117. }
  118. }
  119. },
  120. onReachBottom() {
  121. if (this.list.length < this.recordsTotal) {
  122. this.myLoadmore();
  123. }
  124. },
  125. onLoad(op){
  126. this.id=op.id
  127. this.getList()
  128. },
  129. onReady(){
  130. },
  131. methods: {
  132. recordItemStatus,
  133. getList(){
  134. uni.showLoading({
  135. title: "加载中",
  136. mask: true,
  137. })
  138. API.outRecordDeviceById({
  139. recordId:this.id,
  140. pageSize:this.listFrom.pageSize,
  141. pageIndex:this.listFrom.pageIndex,
  142. }).then((res) => {
  143. uni.hideLoading();
  144. if (this.listFrom.pageIndex == 1) {
  145. this.list = res.data.data;
  146. } else {
  147. this.list = [
  148. ...this.list,
  149. ...res.data.data
  150. ];
  151. }
  152. this.recordsTotal=res.data.recordsTotal;
  153. }).catch(error => {
  154. uni.showToast({
  155. title: error,
  156. icon: "none"
  157. })
  158. })
  159. },
  160. myLoadmore(){
  161. this.listFrom.pageIndex += 1;
  162. this.getList();
  163. },
  164. changeShow(item) {
  165. if (item.show) {
  166. item.show = false;
  167. } else {
  168. item.show = true;
  169. }
  170. this.$forceUpdate()
  171. }
  172. }
  173. }
  174. </script>
  175. <style scoped lang="scss">
  176. page{
  177. padding-bottom: 100px;
  178. }
  179. .u-navbar {
  180. display: flex;
  181. font-size: 36rpx;
  182. align-items: center;
  183. justify-content: center;
  184. flex: 1;
  185. position: absolute;
  186. left: 0;
  187. right: 0;
  188. height: 60rpx;
  189. text-align: center;
  190. flex-shrink: 0;
  191. left: 237rpx;
  192. right: 107rpx;
  193. width: 300rpx;
  194. .title {
  195. line-height: 60rpx;
  196. font-size: 36rpx;
  197. flex: 1;
  198. text {
  199. color: #2A8EFB
  200. }
  201. }
  202. }
  203. .list {
  204. background-color: #fff;
  205. margin: 24rpx;
  206. padding: 22rpx 32rpx;
  207. // 清单信息
  208. .list-infos {
  209. border-radius: 8px;
  210. .infos-head {
  211. display: flex;
  212. justify-content: space-between;
  213. align-items: center;
  214. margin-bottom: 24rpx;
  215. .name {
  216. color: rgba(51, 51, 51, 1);
  217. font-size: 32rpx;
  218. }
  219. .qr-code {
  220. border-radius: 4px;
  221. background: linear-gradient(180deg, rgba(22, 119, 255, 1) 0%, rgba(16, 98, 213, 1) 100%);
  222. color: rgba(255, 255, 255, 1);
  223. font-size: 24rpx;
  224. width: 160rpx;
  225. text-align: center;
  226. line-height: 64rpx;
  227. text {
  228. img {
  229. vertical-align: middle;
  230. }
  231. }
  232. }
  233. }
  234. .infos {
  235. margin-top: 16rpx;
  236. display: flex;
  237. color: #777777;
  238. font-size: 24rpx;
  239. .infos-1 {
  240. margin-right: 68rpx;
  241. }
  242. .infos-item {
  243. display: flex;
  244. margin-bottom: 8rpx;
  245. }
  246. }
  247. .address,.remark {
  248. display: flex;
  249. color: #777777;
  250. font-size: 24rpx;
  251. margin-bottom: 8rpx;
  252. }
  253. }
  254. .prepare-out {
  255. padding: 24rpx;
  256. margin-top: 40rpx;
  257. border-radius: 8px;
  258. background-color: rgba(245, 246, 249, 1);
  259. .head {
  260. display: flex;
  261. justify-content: space-between;
  262. align-items: center;
  263. margin-bottom: 24rpx;
  264. .amount {
  265. display: flex;
  266. color: rgba(0, 81, 255, 1);
  267. font-size: 32rpx;
  268. }
  269. .unfold {
  270. color: rgba(146, 158, 165, 1);
  271. font-size: 24rpx;
  272. position: relative;
  273. .u-icon--right {
  274. margin-left: 8rpx;
  275. }
  276. }
  277. .option {
  278. width: 160rpx;
  279. height: 32rpx;
  280. background-color: #fff;
  281. position: absolute;
  282. top: 30rpx;
  283. right: 0;
  284. }
  285. }
  286. // 编号
  287. .serial-number {
  288. display: flex;
  289. justify-content: space-between;
  290. align-items: center;
  291. margin-top: 16rpx;
  292. color: rgba(51, 51, 51, 1);
  293. font-weight: bold;
  294. .item {
  295. display: flex;
  296. }
  297. }
  298. }
  299. }
  300. </style>