deliveriedList.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370
  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. {{item.statusN}}: <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="itemLine">
  89. <span class="text">
  90. 设备编号:
  91. </span>
  92. <span class="number" >
  93. {{item2.deviceCode}}
  94. </span>
  95. <span class="view" @click="ckInfo(item2)" >
  96. 查看设备
  97. </span>
  98. </view>
  99. </view>
  100. </view>
  101. </view>
  102. <u-divider v-if="list.length==recordsTotal" border-color="#CFD2D5">已经到底了</u-divider>
  103. </view>
  104. </template>
  105. <script>
  106. import * as API from '@/apis/pagejs/projectDepartment.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: 10,
  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. ckInfo(item) {
  133. var url = "/pages/otherFunctions/equipmentRetrieval/equipmentInfo?id=" + item.deviceId;
  134. uni.navigateTo({
  135. url: url,
  136. })
  137. },
  138. getList(){
  139. uni.showLoading({
  140. title: "加载中",
  141. mask: true,
  142. })
  143. API.outRecordDeviceById({
  144. recordId:this.id,
  145. pageSize:this.listFrom.pageSize,
  146. pageIndex:this.listFrom.pageIndex,
  147. }).then((res) => {
  148. uni.hideLoading();
  149. if (this.listFrom.pageIndex == 1) {
  150. this.list = res.data.data;
  151. } else {
  152. this.list = [
  153. ...this.list,
  154. ...res.data.data
  155. ];
  156. }
  157. this.recordsTotal=res.data.recordsTotal;
  158. }).catch(error => {
  159. uni.showToast({
  160. title: error,
  161. icon: "none"
  162. })
  163. })
  164. },
  165. myLoadmore(){
  166. this.listFrom.pageIndex += 1;
  167. this.getList();
  168. },
  169. changeShow(item) {
  170. if (item.show) {
  171. item.show = false;
  172. } else {
  173. item.show = true;
  174. }
  175. this.$forceUpdate()
  176. }
  177. }
  178. }
  179. </script>
  180. <style scoped lang="scss">
  181. page{
  182. padding-bottom: 100px;
  183. }
  184. .u-navbar {
  185. display: flex;
  186. font-size: 36rpx;
  187. align-items: center;
  188. justify-content: center;
  189. flex: 1;
  190. position: absolute;
  191. left: 0;
  192. right: 0;
  193. height: 60rpx;
  194. text-align: center;
  195. flex-shrink: 0;
  196. left: 237rpx;
  197. right: 107rpx;
  198. width: 300rpx;
  199. .title {
  200. line-height: 60rpx;
  201. font-size: 36rpx;
  202. flex: 1;
  203. text {
  204. color: #2A8EFB
  205. }
  206. }
  207. }
  208. .list {
  209. background-color: #fff;
  210. margin: 24rpx;
  211. padding: 22rpx 32rpx;
  212. // 清单信息
  213. .list-infos {
  214. border-radius: 8px;
  215. .infos-head {
  216. display: flex;
  217. justify-content: space-between;
  218. align-items: center;
  219. margin-bottom: 24rpx;
  220. .name {
  221. color: rgba(51, 51, 51, 1);
  222. font-size: 32rpx;
  223. }
  224. .qr-code {
  225. border-radius: 4px;
  226. background: linear-gradient(180deg, rgba(22, 119, 255, 1) 0%, rgba(16, 98, 213, 1) 100%);
  227. color: rgba(255, 255, 255, 1);
  228. font-size: 24rpx;
  229. width: 160rpx;
  230. text-align: center;
  231. line-height: 64rpx;
  232. text {
  233. img {
  234. vertical-align: middle;
  235. }
  236. }
  237. }
  238. }
  239. .infos {
  240. margin-top: 16rpx;
  241. display: flex;
  242. color: #777777;
  243. font-size: 24rpx;
  244. .infos-1 {
  245. margin-right: 68rpx;
  246. }
  247. .infos-item {
  248. display: flex;
  249. margin-bottom: 8rpx;
  250. .item-value{
  251. max-width: 200rpx;
  252. }
  253. }
  254. }
  255. .address,.remark {
  256. display: flex;
  257. color: #777777;
  258. font-size: 24rpx;
  259. margin-bottom: 8rpx;
  260. }
  261. }
  262. .prepare-out {
  263. padding: 24rpx;
  264. margin-top: 40rpx;
  265. border-radius: 8px;
  266. background-color: rgba(245, 246, 249, 1);
  267. .head {
  268. display: flex;
  269. justify-content: space-between;
  270. align-items: center;
  271. margin-bottom: 24rpx;
  272. .amount {
  273. display: flex;
  274. color: rgba(0, 81, 255, 1);
  275. font-size: 32rpx;
  276. }
  277. .unfold {
  278. color: rgba(146, 158, 165, 1);
  279. font-size: 24rpx;
  280. position: relative;
  281. .u-icon--right {
  282. margin-left: 8rpx;
  283. }
  284. }
  285. .option {
  286. width: 160rpx;
  287. height: 32rpx;
  288. background-color: #fff;
  289. position: absolute;
  290. top: 30rpx;
  291. right: 0;
  292. }
  293. }
  294. // 编号
  295. .serial-number {
  296. display: flex;
  297. justify-content: space-between;
  298. align-items: center;
  299. margin-top: 16rpx;
  300. color: rgba(51, 51, 51, 1);
  301. font-weight: bold;
  302. .itemLine{
  303. width: 100%;
  304. .view {
  305. float: right;
  306. color: #0051ff;
  307. }
  308. }
  309. .item {
  310. display: flex;
  311. }
  312. }
  313. }
  314. }
  315. </style>