list.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. <template>
  2. <view class="sales-list-wrap">
  3. <u-dropdown class="search-top-box" id="tjCons">
  4. <u-dropdown-item v-model="searchForm.billStatus" @change="handleChange('bill')" title="业务状态"
  5. :options="billStatusOpt"></u-dropdown-item>
  6. <u-dropdown-item v-model="searchForm.financialStatus" @change="handleChange('financial')" title="财务状态"
  7. :options="(pageType&&pageType=='onlinePagOrder')?onlinePagStatusOpt:financialStatusOpt"></u-dropdown-item>
  8. </u-dropdown>
  9. <!-- 销售单列表 -->
  10. <view class="list-box">
  11. <listComponent ref="salesList" :height="listHeight" :params="searchForm" />
  12. </view>
  13. <!-- 查询右侧弹框 -->
  14. <salesSearch ref="searchBox" :openModal="openModal" :defaultParams="searchForm" @refresh="refresh"
  15. @close="openModal=false" />
  16. </view>
  17. </template>
  18. <script>
  19. import ListComponent from './listComponent.vue'
  20. import SalesSearch from './salesSearch.vue'
  21. import {
  22. getLookUpItem
  23. } from '@/api/data'
  24. import {
  25. salesList
  26. } from '@/api/sales'
  27. export default {
  28. components: {
  29. ListComponent,
  30. SalesSearch
  31. },
  32. data() {
  33. return {
  34. listData: [],
  35. pageNo: 1,
  36. pageSize: 6,
  37. totalNum: 0,
  38. noDataText: '暂无数据',
  39. billStatusOpt: [],
  40. financialStatusOpt: [],
  41. onlinePagStatusOpt:[],
  42. searchForm: {
  43. billStatus: null,
  44. financialStatus: null,
  45. payOnlineFlag:null//1线上支付订单 0 支付订单
  46. },
  47. listHeight: 200,
  48. openModal: false,
  49. pageType:null
  50. }
  51. },
  52. onNavigationBarButtonTap(e) { // 标题栏 按钮操作
  53. this.openModal = true
  54. },
  55. onBackPress() {
  56. if (this.openModal) {
  57. this.$refs.searchBox.closeBox()
  58. this.openModal = false
  59. return true
  60. }
  61. },
  62. onReady() {
  63. const query = uni.createSelectorQuery().in(this);
  64. query.select('#tjCons').boundingClientRect(data => {
  65. this.listHeight = Math.floor(data.height + 5)
  66. }).exec();
  67. },
  68. onLoad(options) {
  69. const _this = this
  70. this.getLookUpItem('SALES_BILL_STATUS')
  71. this.getLookUpItem('FINANCIAL_RECEIVE_STATUS')
  72. this.getLookUpItem('FINANCIAL_ONLINE_RECEIVE_STATUS')
  73. this.$nextTick(function() {
  74. // 监听整改完成后刷新事件
  75. uni.$on('refreshSalesBL', function(data) {
  76. _this.$refs.salesList.getList(1)
  77. })
  78. })
  79. this.searchForm.payOnlineFlag=options?(options.pageType&&options.pageType=='onlinePagOrder')?1:0:0
  80. if (options) {
  81. this.pageType = options.pageType
  82. uni.setNavigationBarTitle({
  83. title: '线上支付订单' // 页面标题为“新的页面标题”
  84. });
  85. }
  86. console.log('111111:',this.searchForm.payOnlineFlag)
  87. },
  88. onUnload() {
  89. uni.$off('refreshSalesBL')
  90. },
  91. methods: {
  92. // 获取查询参数 刷新列表
  93. refresh(params) {
  94. const _this = this
  95. const data = params ? Object.assign(this.searchForm, params) : {
  96. billStatus: null,
  97. financialStatus: null
  98. }
  99. data.beginDate = data.beginDate ? (data.beginDate + ' 00:00:00') : ''
  100. data.endDate = data.endDate ? (data.endDate + ' 23:59:59') : ''
  101. this.searchForm = data
  102. this.$nextTick(function() {
  103. _this.$refs.salesList.refash()
  104. })
  105. },
  106. // 状态 change
  107. handleChange(type) {
  108. this.$refs.salesList.refash()
  109. },
  110. // 配送方式
  111. getLookUpItem(type) {
  112. getLookUpItem({
  113. lookupCode: type,
  114. pageNo: 1,
  115. pageSize: 1000
  116. }).then(res => {
  117. if (res.status == 200 && res.data && res.data.list) {
  118. res.data.list.map(item => {
  119. item.label = item.dispName
  120. item.value = item.code
  121. })
  122. res.data.list.splice(0, 0, {
  123. label: '全部',
  124. value: null
  125. })
  126. if (type == 'SALES_BILL_STATUS') {
  127. if(this.pageType =='onlinePagOrder'){
  128. this.billStatusOpt = res.data.list.filter(item=>item.code!='WAIT_SUBMIT'&&item.code!='SUPERIOR_CHANGE')
  129. }else{
  130. this.billStatusOpt = res.data.list
  131. }
  132. } else if (type == 'FINANCIAL_RECEIVE_STATUS') {
  133. this.financialStatusOpt = res.data.list
  134. }else if(type=='FINANCIAL_ONLINE_RECEIVE_STATUS'){
  135. this.onlinePagStatusOpt = res.data.list
  136. }
  137. } else {
  138. if (type == 'SALES_BILL_STATUS') {
  139. this.billStatusOpt = []
  140. } else if (type == 'FINANCIAL_RECEIVE_STATUS') {
  141. this.financialStatusOpt = []
  142. }else if(type=='FINANCIAL_ONLINE_RECEIVE_STATUS'){
  143. this.onlinePagStatusOpt = []
  144. }
  145. }
  146. })
  147. }
  148. }
  149. }
  150. </script>
  151. <style lang="scss">
  152. .sales-list-wrap {
  153. width: 100%;
  154. .search-top-box {
  155. background-color: #fff;
  156. }
  157. .list-box {
  158. padding: 0 25upx;
  159. }
  160. }
  161. </style>