list.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <template>
  2. <view>
  3. <u-cell-group>
  4. <u-cell
  5. center
  6. isLink
  7. v-for="item in list"
  8. :key="item.id"
  9. @click="toEdit(item)"
  10. >
  11. <view slot="label">
  12. <view class="u-kh">
  13. <view>
  14. {{item.purchaseBillNo}}
  15. </view>
  16. </view>
  17. <view class="u-time">
  18. 发货单号: {{item.sendBillNo}}
  19. </view>
  20. <view class="u-time">创建时间:{{item.createDate}}</view>
  21. <view class="u-time" v-if="item.stockPutTime">入库时间:{{item.stockPutTime}}</view>
  22. </view>
  23. <view slot="value">
  24. <text class="u-text" :style="{color: (item.auditState == 'PUT_WAREHOUSE_AUDIT_REJECT'|| item.auditState == 'WAIT_PUT_WAREHOUSE') ? '#00aaff' : '#999'}">{{item.auditStateDictValue}}</text>
  25. </view>
  26. </u-cell>
  27. <view v-if="list.length==0&&status != 'loading'">
  28. <u-empty :iconSize="60" text="暂无数据" :marginTop="100"></u-empty>
  29. </view>
  30. <view style="padding: 30rpx 0;">
  31. <u-loadmore :status="status" />
  32. </view>
  33. </u-cell-group>
  34. <chooseWarehouse :openPick="openPick" @close="openPick=false" @change="changeWarehouse"></chooseWarehouse>
  35. </view>
  36. </template>
  37. <script>
  38. import { receivingStockList } from '@/config/api.js'
  39. import chooseWarehouse from './chooseWarehouse.vue'
  40. export default{
  41. components: { chooseWarehouse },
  42. data(){
  43. return {
  44. list: [],
  45. pageSize: 10,
  46. pageNo: 1,
  47. total: 0,
  48. status: 'loadmore',
  49. warehouseList: [],
  50. openPick: false,
  51. editRow: null
  52. }
  53. },
  54. onLoad() {
  55. var _this = this
  56. this.status = 'loading'
  57. this.getList()
  58. },
  59. onShow() {
  60. if(this.$store.state.vuex_isRefash){
  61. this.pageNo = 1
  62. this.getList()
  63. this.$store.state.vuex_isRefash = false
  64. }
  65. },
  66. methods:{
  67. getList(){
  68. receivingStockList({pageSize:this.pageSize,pageNo:this.pageNo}).then(res => {
  69. if(res.status == 200){
  70. const list = res.data.list
  71. this.total = res.data.count
  72. if(this.pageNo == 1){
  73. this.list = list
  74. }else{
  75. this.list = this.list.concat(list)
  76. }
  77. if(this.list.length < this.total){
  78. this.status = 'loadmore'
  79. }else{
  80. this.status = 'nomore'
  81. }
  82. }
  83. })
  84. },
  85. toEdit(item){
  86. // 入库
  87. if(item.auditState == 'PUT_WAREHOUSE_AUDIT_REJECT' || item.auditState == 'WAIT_PUT_WAREHOUSE'){
  88. this.editRow = item
  89. this.openPick = true
  90. }
  91. },
  92. changeWarehouse(e){
  93. console.log(e)
  94. this.$store.state.vuex_tempData = e
  95. this.openPick = false
  96. uni.navigateTo({
  97. url:"/pages/purchasing/index?receivingBillSn="+this.editRow.receivingBillSn+"&id="+this.editRow.id
  98. })
  99. },
  100. onReachBottom(){
  101. const pageNums = Math.ceil(this.total / this.pageSize)
  102. if(this.pageNo < pageNums){
  103. this.pageNo = this.pageNo + 1
  104. this.status = 'loading'
  105. this.getList()
  106. }else{
  107. this.status = 'nomore'
  108. }
  109. }
  110. }
  111. }
  112. </script>
  113. <style lang="scss">
  114. .u-time{
  115. color: $uni-text-color-grey;
  116. font-size: 30upx;
  117. }
  118. .u-kh{
  119. font-size: 34upx;
  120. display: flex;
  121. }
  122. .u-text{
  123. font-size: 30upx;
  124. }
  125. </style>