transferRecord.vue 9.8 KB

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