list.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <template>
  2. <view class="sales-list-wrap">
  3. <!-- 标题 -->
  4. <u-navbar title="销售单" :safeAreaInsetTop="false" :border-bottom="true">
  5. <view class="u-nav-slot" slot="right" style="padding-right: 20rpx;">
  6. <u-icon name="search" color="#999" size="28" @click="openModal=true"></u-icon>查询
  7. </view>
  8. </u-navbar>
  9. <u-dropdown class="search-top-box">
  10. <u-dropdown-item v-model="searchForm.billStatus" @change="handleChange('bill')" title="业务状态" :options="billStatusOpt"></u-dropdown-item>
  11. <u-dropdown-item v-model="searchForm.financialStatus" @change="handleChange('financial')" title="财务状态" :options="financialStatusOpt"></u-dropdown-item>
  12. </u-dropdown>
  13. <!-- 销售单列表 -->
  14. <view class="list-box">
  15. <listComponent ref="salesList" height="80" :params="searchParams" />
  16. </view>
  17. <!-- 查询右侧弹框 -->
  18. <salesSearch :openModal="openModal" :defaultParams="searchForm" @refresh="refresh" @close="openModal=false" />
  19. </view>
  20. </template>
  21. <script>
  22. import ListComponent from './listComponent.vue'
  23. import SalesSearch from './salesSearch.vue'
  24. import { getLookUpItem } from '@/api/data'
  25. import { salesList } from '@/api/sales'
  26. export default{
  27. components: { ListComponent, SalesSearch },
  28. data(){
  29. return{
  30. listData: [],
  31. pageNo: 1,
  32. pageSize: 6,
  33. totalNum: 0,
  34. noDataText: '暂无数据',
  35. billStatusOpt: [],
  36. financialStatusOpt: [],
  37. searchForm: {
  38. billStatus: null,
  39. financialStatus: null
  40. },
  41. searchParams: {},
  42. openModal: false
  43. }
  44. },
  45. onLoad() {
  46. this.getLookUpItem('SALES_BILL_STATUS')
  47. this.getLookUpItem('FINANCIAL_RECEIVE_STATUS')
  48. },
  49. methods: {
  50. // 获取查询参数 刷新列表
  51. refresh(params){
  52. const _this = this
  53. this.searchParams = Object.assign(params, this.searchForm)
  54. this.$nextTick(function(){
  55. _this.$refs.salesList.getList(1)
  56. })
  57. },
  58. // 状态 change
  59. handleChange(type){
  60. if(type == 'bill'){
  61. this.searchParams.billStatus = this.searchForm.billStatus
  62. }else if(type == 'financial'){
  63. this.searchParams.financialStatus = this.searchForm.financialStatus
  64. }
  65. this.$refs.salesList.getList(1)
  66. },
  67. // 配送方式
  68. getLookUpItem (type) {
  69. getLookUpItem({ lookupCode: type, pageNo: 1, pageSize: 1000 }).then(res => {
  70. if (res.status == 200 && res.data && res.data.list) {
  71. res.data.list.map(item => {
  72. item.label = item.dispName
  73. item.value = item.code
  74. })
  75. res.data.list.splice(0, 0, { label: '全部', value: null })
  76. if(type == 'SALES_BILL_STATUS'){
  77. this.billStatusOpt = res.data.list
  78. }else if(type == 'FINANCIAL_RECEIVE_STATUS'){
  79. this.financialStatusOpt = res.data.list
  80. }
  81. } else {
  82. if(type == 'SALES_BILL_STATUS'){
  83. this.billStatusOpt = []
  84. }else if(type == 'FINANCIAL_RECEIVE_STATUS'){
  85. this.financialStatusOpt = []
  86. }
  87. }
  88. })
  89. }
  90. }
  91. }
  92. </script>
  93. <style lang="scss">
  94. .sales-list-wrap{
  95. width: 100%;
  96. .search-top-box{
  97. background-color: #fff;
  98. }
  99. .list-box{
  100. padding: 20upx 20upx;
  101. }
  102. }
  103. </style>