list.vue 2.4 KB

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