transferRecord.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  1. <template>
  2. <!-- 调拨记录 -->
  3. <view>
  4. <u-navbar title="调拨记录" autoBack placeholder></u-navbar>
  5. <view class="tabs_card_bg">
  6. <u-tabs :list="list4" :current="belowStandard" lineWidth="20" :scrollable="false" lineHeight="7"
  7. :lineColor="`url(${lineBg}) 100% 100%`" @click="standardClick"
  8. itemStyle="padding-left: 15px; padding-right: 15px; height: 34px;">
  9. </u-tabs>
  10. <u-tabs :current="tabNumber" :list="bottleList" lineWidth="40" :scrollable="false" @click="bottleClick"
  11. itemStyle="padding: 15rpx;"></u-tabs>
  12. </view>
  13. <view style="padding-bottom: 30rpx;" v-if="list.length > 0">
  14. <view class="transfer_card_item" v-for="(item,index) in list" :key="index" @click="recordParticulars(item)">
  15. <view class="title_status" :style="{color:getColor(item.status)}">{{ getstatus(item.status) }}</view>
  16. <view class="item_title_record1" v-if="getFlowStep(item.optType)">
  17. <span>流转步骤:</span>
  18. {{getFlowStep(item.optType)}}
  19. </view>
  20. <view class="item_title_record1">
  21. <span>调拨人:</span>
  22. {{item.allotUser.nickName}}
  23. </view>
  24. <view class="item_title_record">
  25. <span>接收人:</span>
  26. {{item.acceptUser.nickName}}
  27. </view>
  28. <view class="item_title_record">
  29. <span>调拨时间:</span>
  30. {{item.createdAt}}
  31. </view>
  32. <view class="item_title_record">
  33. <span>单位内编号:</span>
  34. <span class="examine_title" @click.stop="clickToView(item)">点击查看</span>
  35. </view>
  36. </view>
  37. </view>
  38. <view style="margin-top: 40%;" v-else>
  39. <u-empty mode="list" text="暂无调拨记录"></u-empty>
  40. </view>
  41. <u-popup :show="innerCodeShow" round="10" @close="close">
  42. <view style="display: flex;flex-direction: column;touch-action: none;">
  43. <view class="headlinetitle">
  44. <view class="title_head_code">单位内编号</view>
  45. <span>总数: {{innerCodeData.length}}</span>
  46. </view>
  47. <view style="max-height: 800rpx;overflow-y: auto;overscroll-behavior: none;">
  48. <view class="card_inner_item" v-for="(item,index) in innerCodeData" :key="index">
  49. <view class="title_index_item">{{index + 1}}</view>
  50. <view>{{item}}</view>
  51. </view>
  52. </view>
  53. </view>
  54. </u-popup>
  55. </view>
  56. </template>
  57. <script>
  58. import {
  59. flowStep
  60. } from '@/static/js/blockSort.js'
  61. export default {
  62. data() {
  63. return {
  64. lineBg: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAOCAYAAABdC15GAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAFxSURBVHgBzZNRTsJAEIb/WTW+lpiY+FZPIDew3ABP4GJ8hxsI9zBpOYHeQDwBPQI+mRiRvpLojtPdYhCorQqF/6GdbGd2vvwzBXZcNAt4oj1ANeUoAT5iqkUjbEFLHNmhD1YPEvpZ3ghkGlVDCkc94/BmHMq998I5ONiY1ZBfpKAyuOtgAc5yOEDmYEWNh32BHF91sGHZHmwW4azciN9aQwnz3SJEgOmte+R2tdLprTYoa50mvuomlLpD4Y3oQZnov6D2RzCqI93bWOHaEmAGqQUyRBlZR1WfarcD/EJ2z8DtzDGvsMCwpm8XOCfDUsVOCYhiqRxI/CTQo4UOvjzO7Pow18vfywneuUHHUUxLn55lLw5JFpZ8bEUcY8oXdOLWiHLTxvoGpLqoUmy6dBT15o/ox3znpoycAmxUsiJTbs1cmxeVKp+0zmFIS7bGWiVghC7Vwse8jFKAX9eljh4ggKLLv7uaQvG9/F59Oo2SouxPu7OTCxN/s8wAAAAASUVORK5CYII=',
  65. list4: [{
  66. name: '我调拨的',
  67. }, {
  68. name: '我接收的'
  69. }],
  70. belowStandard: 0,
  71. bottleList: [{
  72. name: '全部',
  73. }, {
  74. name: '调拨中',
  75. }, {
  76. name: '已完成'
  77. }, {
  78. name: '已取消'
  79. }, {
  80. name: '超时取消'
  81. }],
  82. tabNumber: 0,
  83. // allot-我调拨的 accept-我签收的
  84. myType: 'allot',
  85. list: [],
  86. Pagination: {
  87. PageIndex: 1,
  88. PageSize: 20,
  89. Total: 0,
  90. },
  91. loadingMore: true,
  92. innerCodeShow: false,
  93. innerCodeData: [],
  94. }
  95. },
  96. onReachBottom() {
  97. if (!this.loadingMore) {
  98. this.getList()
  99. }
  100. },
  101. onShow() {
  102. this.Pagination.PageIndex = 1
  103. this.list = []
  104. this.getList()
  105. },
  106. methods: {
  107. getList() {
  108. uni.showLoading({
  109. mask: true,
  110. });
  111. let statusNum = ''
  112. if (this.tabNumber != 0) {
  113. statusNum = this.tabNumber
  114. }
  115. this.loadingMore = true
  116. this.$api.get('/api/gas-cylinder-allot', {
  117. my: this.myType,
  118. status: statusNum,
  119. page: this.Pagination.PageIndex,
  120. pageSize: this.Pagination.PageSize,
  121. }).then(res => {
  122. if (res.code == 200) {
  123. const data = res.data.list
  124. if (this.loadingMore == true && data) {
  125. this.list = this.list.concat(data);
  126. }
  127. if (data.length < this.Pagination.PageSize) {
  128. this.loadingMore = true
  129. } else {
  130. this.loadingMore = false
  131. this.Pagination.PageIndex++
  132. }
  133. }
  134. uni.hideLoading();
  135. }).catch(() => {
  136. uni.hideLoading();
  137. })
  138. },
  139. // 点击查看
  140. clickToView(value) {
  141. this.innerCodeShow = true
  142. this.innerCodeData = value.innerCodeList
  143. },
  144. getstatus(value) {
  145. if (value == 1) {
  146. return '调拨中'
  147. } else if (value == 2) {
  148. return '已完成'
  149. } else if (value == 3) {
  150. return '已取消'
  151. } else if (value == 4) {
  152. return '超时取消'
  153. }
  154. },
  155. // 调拨状态
  156. bottleClick(event) {
  157. this.tabNumber = event.index
  158. this.Pagination.PageIndex = 1
  159. this.list = []
  160. this.getList()
  161. },
  162. // 我调拨的/我接收的
  163. standardClick(event) {
  164. this.belowStandard = event.index
  165. if (event.index == 0) {
  166. this.myType = 'allot'
  167. } else {
  168. this.myType = 'accept'
  169. }
  170. this.Pagination.PageIndex = 1
  171. this.list = []
  172. this.getList()
  173. },
  174. // 详情
  175. recordParticulars(value) {
  176. uni.setStorageSync('transferData', JSON.stringify(value));
  177. uni.navigateTo({
  178. url: '/pages/information/transferDetails?type=' + this.belowStandard
  179. });
  180. },
  181. getColor(value) {
  182. if (value == 1) {
  183. return '#3c9cff'
  184. } else if (value == 2) {
  185. return '#5ac725'
  186. } else if (value == 3) {
  187. return '#909399'
  188. } else if (value == 4) {
  189. return '#909399'
  190. }
  191. },
  192. getFlowStep(value) {
  193. let array = flowStep()
  194. const filteredArray = array.filter(item => item.value === value)
  195. if(filteredArray.length > 0){
  196. return filteredArray[0].label
  197. }
  198. },
  199. close() {
  200. this.innerCodeShow = false
  201. }
  202. }
  203. }
  204. </script>
  205. <style lang="scss">
  206. page {
  207. background-color: #f4f4f5;
  208. }
  209. .tabs_card_bg {
  210. background-color: #fff;
  211. }
  212. .transfer_card_item {
  213. position: relative;
  214. background-color: #fff;
  215. margin: 30rpx;
  216. padding: 30rpx;
  217. border-radius: 10rpx;
  218. }
  219. .title_status {
  220. position: absolute;
  221. right: 20rpx;
  222. top: 20rpx;
  223. display: flex;
  224. justify-content: flex-end;
  225. font-size: 28rpx;
  226. }
  227. .item_title_record1 {
  228. font-size: 30rpx;
  229. span {
  230. font-size: 28rpx;
  231. color: #909399;
  232. }
  233. .examine_title {
  234. cursor: pointer;
  235. color: #2979ff;
  236. }
  237. }
  238. .item_title_record {
  239. font-size: 30rpx;
  240. margin-top: 10rpx;
  241. span {
  242. font-size: 28rpx;
  243. color: #909399;
  244. }
  245. .examine_title {
  246. cursor: pointer;
  247. color: #2979ff;
  248. }
  249. }
  250. .title_index_item {
  251. color: #909399;
  252. margin-right: 20rpx;
  253. }
  254. .headlinetitle {
  255. display: flex;
  256. justify-content: space-between;
  257. align-items: center;
  258. padding: 30rpx;
  259. border-bottom: 1rpx solid #d7d7d7;
  260. span {
  261. color: #2979ff;
  262. }
  263. }
  264. .title_head_code {
  265. font-size: 34rpx;
  266. font-weight: 600;
  267. }
  268. .card_inner_item {
  269. display: flex;
  270. align-items: center;
  271. padding: 30rpx;
  272. border-bottom: 1rpx solid #d7d7d7;
  273. }
  274. </style>