shelfOrder.vue 4.6 KB

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