list.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  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&&options.pageType&&options.pageType=='onlinePagOrder') {
  81. this.pageType = options.pageType
  82. uni.setNavigationBarTitle({
  83. title: '线上支付订单' // 页面标题为“新的页面标题”
  84. });
  85. }
  86. },
  87. onUnload() {
  88. uni.$off('refreshSalesBL')
  89. },
  90. methods: {
  91. // 获取查询参数 刷新列表
  92. refresh(params) {
  93. const _this = this
  94. const data = params ? Object.assign(this.searchForm, params) : {
  95. billStatus: null,
  96. financialStatus: null
  97. }
  98. data.beginDate = data.beginDate ? (data.beginDate + ' 00:00:00') : ''
  99. data.endDate = data.endDate ? (data.endDate + ' 23:59:59') : ''
  100. this.searchForm = data
  101. this.$nextTick(function() {
  102. _this.$refs.salesList.refash()
  103. })
  104. },
  105. // 状态 change
  106. handleChange(type) {
  107. this.$refs.salesList.refash()
  108. },
  109. // 配送方式
  110. getLookUpItem(type) {
  111. getLookUpItem({
  112. lookupCode: type,
  113. pageNo: 1,
  114. pageSize: 1000
  115. }).then(res => {
  116. if (res.status == 200 && res.data && res.data.list) {
  117. res.data.list.map(item => {
  118. item.label = item.dispName
  119. item.value = item.code
  120. })
  121. res.data.list.splice(0, 0, {
  122. label: '全部',
  123. value: null
  124. })
  125. if (type == 'SALES_BILL_STATUS') {
  126. if(this.pageType =='onlinePagOrder'){
  127. this.billStatusOpt = res.data.list.filter(item=>item.code!='WAIT_SUBMIT'&&item.code!='SUPERIOR_CHANGE')
  128. }else{
  129. this.billStatusOpt = res.data.list
  130. }
  131. } else if (type == 'FINANCIAL_RECEIVE_STATUS') {
  132. this.financialStatusOpt = res.data.list
  133. }else if(type=='FINANCIAL_ONLINE_RECEIVE_STATUS'){
  134. this.onlinePagStatusOpt = res.data.list
  135. }
  136. } else {
  137. if (type == 'SALES_BILL_STATUS') {
  138. this.billStatusOpt = []
  139. } else if (type == 'FINANCIAL_RECEIVE_STATUS') {
  140. this.financialStatusOpt = []
  141. }else if(type=='FINANCIAL_ONLINE_RECEIVE_STATUS'){
  142. this.onlinePagStatusOpt = []
  143. }
  144. }
  145. })
  146. }
  147. }
  148. }
  149. </script>
  150. <style lang="scss">
  151. .sales-list-wrap {
  152. width: 100%;
  153. .search-top-box {
  154. background-color: #fff;
  155. }
  156. .list-box {
  157. padding: 0 25upx;
  158. }
  159. }
  160. </style>