lendLedger.vue 7.5 KB

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