list.vue 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <template>
  2. <view class="sales-list-wrap">
  3. <u-dropdown>
  4. <u-dropdown-item v-model="billStatus" title="业务状态" :options="billStatusOpt"></u-dropdown-item>
  5. </u-dropdown>
  6. </view>
  7. </template>
  8. <script>
  9. import { getLookUpItem } from '@/api/data'
  10. import { salesList } from '@/api/sales'
  11. export default{
  12. data(){
  13. return{
  14. listData: [],
  15. pageNo: 1,
  16. pageSize: 6,
  17. totalNum: 0,
  18. noDataText: '暂无数据',
  19. billStatus: undefined,
  20. financialStatus: undefined,
  21. billStatusOpt: [],
  22. financialStatusOpt: [],
  23. }
  24. },
  25. onLoad() {
  26. this.getLookUpItem('SALES_BILL_STATUS')
  27. this.getLookUpItem('FINANCIAL_RECEIVE_STATUS')
  28. this.getList()
  29. },
  30. methods: {
  31. // 列表
  32. getList(pageNo){
  33. const _this = this
  34. if (pageNo) {
  35. this.pageNo = pageNo
  36. }
  37. salesList({ pageNo: this.pageNo, pageSize: this.pageSize }).then(res => {
  38. if (res.status == 200) {
  39. if(this.pageNo>1){
  40. this.listData = this.listData.concat(res.data.list || [])
  41. }else{
  42. this.listData = res.data.list || []
  43. }
  44. this.totalNum = res.data.count || 0
  45. } else {
  46. this.listData = []
  47. this.totalNum = 0
  48. this.noDataText = res.message
  49. }
  50. })
  51. },
  52. // scroll-view到底部加载更多
  53. onreachBottom() {
  54. if(this.listData.length < this.totalNum){
  55. this.pageNo += 1
  56. this.getList()
  57. }
  58. },
  59. handleChange(){},
  60. // 配送方式
  61. getLookUpItem (type) {
  62. getLookUpItem({ lookupCode: type, pageNo: 1, pageSize: 1000 }).then(res => {
  63. if (res.status == 200 && res.data && res.data.list) {
  64. res.data.list.map(item => {
  65. item.label = item.dispName
  66. item.value = item.code
  67. })
  68. if(type == 'SALES_BILL_STATUS'){
  69. this.billStatusOpt = res.data.list
  70. }else if(type == 'FINANCIAL_RECEIVE_STATUS'){
  71. this.financialStatusOpt = res.data.list
  72. }
  73. } else {
  74. if(type == 'SALES_BILL_STATUS'){
  75. this.billStatusOpt = []
  76. }else if(type == 'FINANCIAL_RECEIVE_STATUS'){
  77. this.financialStatusOpt = []
  78. }
  79. }
  80. })
  81. }
  82. }
  83. }
  84. </script>
  85. <style>
  86. </style>