list.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <template>
  2. <u-cell-group>
  3. <u-cell
  4. center
  5. isLink
  6. v-for="item in list"
  7. :key="item.id"
  8. :title="item.allocationLinkageOutNo"
  9. @click="toStockOut(item)"
  10. >
  11. <view slot="label">
  12. <view class="u-kh">{{item.putTenantName}}</view>
  13. <view class="u-time">调拨类型:{{item.allocationTypeDictValue}}</view>
  14. <view class="u-time">创建时间:{{item.createDate}}</view>
  15. </view>
  16. <view slot="value">
  17. <text v-if="item.state=='WAIT_OUT_WAREHOUSE'" class="u-text" :style="{color:'#00aaff'}">出库拣货</text>
  18. <text v-else class="u-text" :style="{color: '#999'}">{{item.stateDictValue}}</text>
  19. </view>
  20. </u-cell>
  21. <view v-if="list.length==0&&status != 'loading'">
  22. <u-empty :iconSize="60" text="暂无连锁调出单" :marginTop="100" mode="history"></u-empty>
  23. </view>
  24. <view style="padding: 30rpx 0;">
  25. <u-loadmore :status="status" />
  26. </view>
  27. </u-cell-group>
  28. </template>
  29. <script>
  30. import { allocLinkageOutList } from '@/config/api.js'
  31. export default{
  32. data(){
  33. return {
  34. list: [],
  35. pageSize: 10,
  36. pageNo: 1,
  37. total: 0,
  38. status: 'loadmore'
  39. }
  40. },
  41. onLoad() {
  42. this.getList()
  43. },
  44. onShow() {
  45. if(this.$store.state.vuex_isRefash){
  46. this.pageNo = 1
  47. this.getList()
  48. this.$store.state.vuex_isRefash = false
  49. }
  50. },
  51. methods:{
  52. getList(){
  53. this.status = 'loading'
  54. allocLinkageOutList({pageSize:this.pageSize,pageNo:this.pageNo, state: 'WAIT_OUT_WAREHOUSE'}).then(res => {
  55. if(res.status == 200){
  56. const list = res.data.list
  57. this.total = res.data.count
  58. if(this.pageNo == 1){
  59. this.list = list
  60. }else{
  61. this.list = this.list.concat(list)
  62. }
  63. if(this.list.length < this.total){
  64. this.status = 'loadmore'
  65. }else{
  66. this.status = 'nomore'
  67. }
  68. }
  69. })
  70. },
  71. // 出库
  72. toStockOut(item){
  73. // 待出库
  74. if(item.state=='WAIT_OUT_WAREHOUSE'){
  75. uni.navigateTo({
  76. url: "/pages/stockOut/chainTransferOut/index?id="+item.id+"&allocationLinkageOutSn="+item.allocationLinkageOutSn
  77. })
  78. }else{
  79. // 查看详情
  80. uni.navigateTo({
  81. url:"/pages/stockOut/chainTransferOut/viewDetail?allocationLinkageOutSn="+item.allocationLinkageOutSn+"&id="+item.id
  82. })
  83. }
  84. },
  85. onReachBottom(){
  86. const pageNums = Math.ceil(this.total / this.pageSize)
  87. if(this.pageNo <= pageNums){
  88. this.pageNo = this.pageNo + 1
  89. this.getList()
  90. }else{
  91. this.status = 'nomore'
  92. }
  93. }
  94. }
  95. }
  96. </script>
  97. <style lang="scss">
  98. .u-time{
  99. color: $uni-text-color-grey;
  100. font-size: 30upx;
  101. }
  102. .u-kh{
  103. font-size: 34upx;
  104. }
  105. </style>