shelfOrder.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. <template>
  2. <view class="sales-list-wrap">
  3. <view class="head-info" id="tjCons">
  4. <view class="search-top-box" @click="openShlefModal=true">
  5. <text>{{searchForm.shelfSnList.length?('已选'+searchForm.shelfSnList.length+'个货架'):'全部货架'}}</text>
  6. <u-icon name="arrow-right"></u-icon>
  7. </view>
  8. <view class="countData" v-if="countData">
  9. <view>总款数:<text>{{countData.productCategory}}</text>;</view>
  10. <view>总数量:<text>{{countData.totalQty}}</text>;</view>
  11. <view>总结算金额:<text>¥{{countData.settleAmount}}</text>;</view>
  12. </view>
  13. </view>
  14. <!-- 销售单列表 -->
  15. <view class="list-box">
  16. <listComponent ref="salesList" :height="listHeight" :params="searchParams" />
  17. </view>
  18. <!-- 查询右侧弹框 -->
  19. <search :openModal="openModal" :billStatusOpt="billStatusOpt" :defaultParams="searchForm" @refresh="refresh" @close="openModal=false" />
  20. <!-- 选择货架 -->
  21. <chooseShelf :openModal="openShlefModal" :defaultParams="searchForm.shelfSnList" @refresh="refreshList" @close="openShlefModal=false" />
  22. </view>
  23. </template>
  24. <script>
  25. import ListComponent from './listComponent.vue'
  26. import search from './search.vue'
  27. import chooseShelf from './chooseShelf.vue'
  28. import { getLookUpItem } from '@/api/data'
  29. import { orderBillQueryPage, orderBillQueryCount } from '@/api/shelf'
  30. export default{
  31. components: { ListComponent, search, chooseShelf },
  32. data(){
  33. return{
  34. listData: [],
  35. pageNo: 1,
  36. pageSize: 15,
  37. totalNum: 0,
  38. noDataText: '暂无数据',
  39. billStatusOpt: [],
  40. searchForm: {
  41. shelfSnList: []
  42. },
  43. searchParams: {},
  44. listHeight: 200,
  45. openModal: false,
  46. openShlefModal: false,
  47. countData: null
  48. }
  49. },
  50. onNavigationBarButtonTap(e){ // 标题栏 按钮操作
  51. this.openModal = true
  52. },
  53. onReady() {
  54. const query = uni.createSelectorQuery().in(this);
  55. query.select('#tjCons').boundingClientRect(data => {
  56. this.listHeight = Math.floor(data.height + 10)
  57. }).exec();
  58. },
  59. onLoad() {
  60. const _this = this
  61. this.getLookUpItem('ORDER_BILL_STATE')
  62. this.$nextTick(function(){
  63. // 监听整改完成后刷新事件
  64. uni.$on('refreshSalesBL', function(data){
  65. _this.$refs.salesList.getList(1)
  66. _this.getCount()
  67. })
  68. })
  69. this.getCount()
  70. },
  71. onUnload() {
  72. uni.$off('refreshSalesBL')
  73. },
  74. methods: {
  75. getCount(){
  76. orderBillQueryCount(this.searchParams).then(res => {
  77. this.countData = res.data || null
  78. })
  79. },
  80. // 获取查询参数 刷新列表
  81. refresh(params){
  82. const _this = this
  83. this.searchParams = Object.assign(this.searchForm,params)
  84. this.searchParams.orderStartDate = params&&params.orderStartDate ? (params.orderStartDate + ' 00:00:00') : ''
  85. this.searchParams.orderEndDate = params&&params.orderEndDate ? (params.orderEndDate + ' 23:59:59') : ''
  86. this.$nextTick(function(){
  87. _this.$refs.salesList.refash()
  88. _this.getCount()
  89. })
  90. },
  91. refreshList(data){
  92. this.searchForm.shelfSnList = data
  93. this.refresh(this.searchForm)
  94. },
  95. // 状态 change
  96. handleChange(type){
  97. this.$refs.salesList.refash()
  98. this.getCount()
  99. },
  100. // 配送方式
  101. getLookUpItem (type) {
  102. getLookUpItem({ lookupCode: type, pageNo: 1, pageSize: 1000 }).then(res => {
  103. if (res.status == 200 && res.data && res.data.list) {
  104. res.data.list.map(item => {
  105. item.label = item.dispName
  106. item.value = item.code
  107. })
  108. this.billStatusOpt = res.data.list
  109. } else {
  110. this.billStatusOpt = []
  111. }
  112. })
  113. }
  114. }
  115. }
  116. </script>
  117. <style lang="scss">
  118. .sales-list-wrap{
  119. width: 100%;
  120. .head-info{
  121. .search-top-box{
  122. background-color: #fff;
  123. text-align: center;
  124. padding-bottom: 20rpx;
  125. }
  126. .countData{
  127. background: #fff;
  128. margin: 20upx 20upx 0;
  129. display: flex;
  130. padding: 15upx;
  131. border-radius: 15rpx;
  132. text{
  133. color: #ffb355;
  134. }
  135. font-size: 24rpx;
  136. }
  137. }
  138. .list-box{
  139. padding: 0 25upx;
  140. }
  141. }
  142. </style>