transferRecord.vue 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350
  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 0rpx;"></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 class="del_btn_card center_in" v-if="item.status == 3 || item.status == 4"
  37. @click.stop="delAllocation(item)">
  38. 删除
  39. </view>
  40. <view class="orange_btn_card center_in" v-if="item.status == 1" @click.stop="cancelAllocation(item)">
  41. 取消调拨
  42. </view>
  43. </view>
  44. </view>
  45. <view style="margin-top: 40%;" v-else>
  46. <u-empty mode="list" text="暂无调拨记录"></u-empty>
  47. </view>
  48. <u-popup :show="innerCodeShow" round="10" @close="close">
  49. <view style="display: flex;flex-direction: column;touch-action: none;">
  50. <view class="headlinetitle">
  51. <view class="title_head_code">单位内编号</view>
  52. <span>总数: {{innerCodeData.length}}</span>
  53. </view>
  54. <view style="max-height: 800rpx;overflow-y: auto;overscroll-behavior: none;">
  55. <view class="card_inner_item" v-for="(item,index) in innerCodeData" :key="index">
  56. <view class="title_index_item">{{index + 1}}</view>
  57. <view>{{item}}</view>
  58. </view>
  59. </view>
  60. </view>
  61. </u-popup>
  62. </view>
  63. </template>
  64. <script>
  65. import {
  66. flowStep
  67. } from '@/static/js/blockSort.js'
  68. export default {
  69. data() {
  70. return {
  71. lineBg: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAOCAYAAABdC15GAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAFxSURBVHgBzZNRTsJAEIb/WTW+lpiY+FZPIDew3ABP4GJ8hxsI9zBpOYHeQDwBPQI+mRiRvpLojtPdYhCorQqF/6GdbGd2vvwzBXZcNAt4oj1ANeUoAT5iqkUjbEFLHNmhD1YPEvpZ3ghkGlVDCkc94/BmHMq998I5ONiY1ZBfpKAyuOtgAc5yOEDmYEWNh32BHF91sGHZHmwW4azciN9aQwnz3SJEgOmte+R2tdLprTYoa50mvuomlLpD4Y3oQZnov6D2RzCqI93bWOHaEmAGqQUyRBlZR1WfarcD/EJ2z8DtzDGvsMCwpm8XOCfDUsVOCYhiqRxI/CTQo4UOvjzO7Pow18vfywneuUHHUUxLn55lLw5JFpZ8bEUcY8oXdOLWiHLTxvoGpLqoUmy6dBT15o/ox3znpoycAmxUsiJTbs1cmxeVKp+0zmFIS7bGWiVghC7Vwse8jFKAX9eljh4ggKLLv7uaQvG9/F59Oo2SouxPu7OTCxN/s8wAAAAASUVORK5CYII=',
  72. list4: [{
  73. name: '我调拨的',
  74. }, {
  75. name: '我接收的'
  76. }],
  77. belowStandard: 0,
  78. bottleList: [{
  79. name: '全部',
  80. }, {
  81. name: '调拨中',
  82. }, {
  83. name: '已完成'
  84. }, {
  85. name: '已取消'
  86. }, {
  87. name: '超时取消'
  88. }],
  89. tabNumber: 0,
  90. // allot-我调拨的 accept-我签收的
  91. myType: 'allot',
  92. list: [],
  93. Pagination: {
  94. PageIndex: 1,
  95. PageSize: 20,
  96. Total: 0,
  97. },
  98. loadingMore: true,
  99. innerCodeShow: false,
  100. innerCodeData: [],
  101. }
  102. },
  103. onReachBottom() {
  104. if (!this.loadingMore) {
  105. this.getList()
  106. }
  107. },
  108. onShow() {
  109. this.Pagination.PageIndex = 1
  110. this.list = []
  111. this.getList()
  112. },
  113. methods: {
  114. getList() {
  115. uni.showLoading({
  116. mask: true,
  117. });
  118. let statusNum = ''
  119. if (this.tabNumber != 0) {
  120. statusNum = this.tabNumber
  121. }
  122. this.loadingMore = true
  123. this.$api.get('/api/gas-cylinder-allot', {
  124. my: this.myType,
  125. status: statusNum,
  126. page: this.Pagination.PageIndex,
  127. pageSize: this.Pagination.PageSize,
  128. }).then(res => {
  129. if (res.code == 200) {
  130. const data = res.data.list
  131. if (this.loadingMore == true && data) {
  132. this.list = this.list.concat(data);
  133. }
  134. if (data.length < this.Pagination.PageSize) {
  135. this.loadingMore = true
  136. } else {
  137. this.loadingMore = false
  138. this.Pagination.PageIndex++
  139. }
  140. }
  141. uni.hideLoading();
  142. }).catch(() => {
  143. uni.hideLoading();
  144. })
  145. },
  146. // 点击查看
  147. clickToView(value) {
  148. this.innerCodeShow = true
  149. this.innerCodeData = value.innerCodeList
  150. },
  151. getstatus(value) {
  152. if (value == 1) {
  153. return '调拨中'
  154. } else if (value == 2) {
  155. return '已完成'
  156. } else if (value == 3) {
  157. return '已取消'
  158. } else if (value == 4) {
  159. return '超时取消'
  160. }
  161. },
  162. // 调拨状态
  163. bottleClick(event) {
  164. this.tabNumber = event.index
  165. this.Pagination.PageIndex = 1
  166. this.list = []
  167. this.getList()
  168. },
  169. // 我调拨的/我接收的
  170. standardClick(event) {
  171. // console.log(event,326)
  172. this.belowStandard = event.index
  173. if (event.index == 0) {
  174. this.bottleList[1].name = '调拨中'
  175. this.myType = 'allot'
  176. } else {
  177. this.bottleList[1].name = '接收'
  178. this.myType = 'accept'
  179. }
  180. this.Pagination.PageIndex = 1
  181. this.list = []
  182. this.getList()
  183. },
  184. // 详情
  185. recordParticulars(value) {
  186. uni.setStorageSync('transferData', JSON.stringify(value));
  187. uni.navigateTo({
  188. url: '/pages/information/transferDetails?type=' + this.belowStandard
  189. });
  190. },
  191. getColor(value) {
  192. if (value == 1) {
  193. return '#3c9cff'
  194. } else if (value == 2) {
  195. return '#5ac725'
  196. } else if (value == 3) {
  197. return '#909399'
  198. } else if (value == 4) {
  199. return '#909399'
  200. }
  201. },
  202. getFlowStep(value) {
  203. let array = flowStep()
  204. const filteredArray = array.filter(item => item.value === value)
  205. if (filteredArray.length > 0) {
  206. return filteredArray[0].label
  207. }
  208. },
  209. // 删除调拨记录
  210. delAllocation(event) {
  211. this.$api.delete('/api/gas-cylinder-allot', {
  212. id: event.id,
  213. }).then(res => {
  214. if (res.code == 200) {
  215. this.Pagination.PageIndex = 1
  216. this.list = []
  217. this.getList()
  218. uni.$u.toast(res.msg)
  219. } else {
  220. uni.$u.toast(res.data.msg)
  221. }
  222. })
  223. },
  224. cancelAllocation(event) {
  225. this.$api.post('/api/gas-cylinder-allot/cancel', {
  226. id: event.id,
  227. }).then(res => {
  228. if (res.code == 200) {
  229. uni.$u.toast(res.msg)
  230. this.Pagination.PageIndex = 1
  231. this.list = []
  232. this.getList()
  233. } else {
  234. uni.$u.toast(res.data.msg)
  235. }
  236. })
  237. },
  238. close() {
  239. this.innerCodeShow = false
  240. }
  241. }
  242. }
  243. </script>
  244. <style lang="scss">
  245. page {
  246. background-color: #f4f4f5;
  247. }
  248. .tabs_card_bg {
  249. background-color: #fff;
  250. }
  251. .transfer_card_item {
  252. position: relative;
  253. background-color: #fff;
  254. margin: 30rpx;
  255. padding: 30rpx;
  256. border-radius: 10rpx;
  257. }
  258. .title_status {
  259. position: absolute;
  260. right: 20rpx;
  261. top: 20rpx;
  262. display: flex;
  263. justify-content: flex-end;
  264. font-size: 28rpx;
  265. }
  266. .item_title_record1 {
  267. font-size: 30rpx;
  268. span {
  269. font-size: 28rpx;
  270. color: #909399;
  271. }
  272. .examine_title {
  273. cursor: pointer;
  274. color: #2979ff;
  275. }
  276. }
  277. .item_title_record {
  278. font-size: 30rpx;
  279. margin-top: 10rpx;
  280. span {
  281. font-size: 28rpx;
  282. color: #909399;
  283. }
  284. .examine_title {
  285. cursor: pointer;
  286. color: #2979ff;
  287. }
  288. }
  289. .title_index_item {
  290. color: #909399;
  291. margin-right: 20rpx;
  292. }
  293. .headlinetitle {
  294. display: flex;
  295. justify-content: space-between;
  296. align-items: center;
  297. padding: 30rpx;
  298. border-bottom: 1rpx solid #d7d7d7;
  299. span {
  300. color: #2979ff;
  301. }
  302. }
  303. .title_head_code {
  304. font-size: 34rpx;
  305. font-weight: 600;
  306. }
  307. .card_inner_item {
  308. display: flex;
  309. align-items: center;
  310. padding: 30rpx;
  311. border-bottom: 1rpx solid #d7d7d7;
  312. }
  313. .del_btn_card {
  314. margin-top: 20rpx;
  315. background-color: #f56c6c;
  316. width: 100%;
  317. height: 66rpx;
  318. border-radius: 10rpx;
  319. color: #fff;
  320. font-size: 26rpx;
  321. }
  322. .orange_btn_card {
  323. margin-top: 20rpx;
  324. background-color: #ff9900;
  325. width: 100%;
  326. height: 66rpx;
  327. border-radius: 10rpx;
  328. color: #fff;
  329. font-size: 26rpx;
  330. }
  331. </style>