shelfOrder.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  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. console.log(opts)
  72. const _this = this
  73. uni.setNavigationBarColor({
  74. frontColor: '#ffffff',
  75. backgroundColor: this.$config('primaryColor')
  76. })
  77. this.getLookUpItem('ORDER_BILL_STATE')
  78. // 从消息页面过来
  79. if(opts.bizType == 'SHELF_WARN'&&opts.shelfSn){
  80. this.searchForm.shelfSnList = [opts.shelfSn]
  81. this.searchParams.shelfSnList = [opts.shelfSn]
  82. this.curShelfName = opts.shelfName
  83. }
  84. this.$nextTick(function(){
  85. this.$refs.salesList.getList(1)
  86. this.getCount()
  87. })
  88. // 监听整改完成后刷新事件
  89. uni.$on('refreshSalesBL', function(data){
  90. _this.$refs.salesList.getList(1)
  91. _this.getCount()
  92. })
  93. },
  94. onUnload() {
  95. uni.$off('refreshSalesBL')
  96. },
  97. methods: {
  98. getCount(){
  99. orderBillQueryCount(this.searchParams).then(res => {
  100. this.countData = res.data || null
  101. })
  102. },
  103. // 获取查询参数 刷新列表
  104. refresh(params){
  105. const _this = this
  106. this.searchParams = {shelfSnList:this.searchForm.shelfSnList,...params}
  107. this.searchParams.orderStartDate = params&&params.orderStartDate ? (params.orderStartDate + ' 00:00:00') : ''
  108. this.searchParams.orderEndDate = params&&params.orderEndDate ? (params.orderEndDate + ' 23:59:59') : ''
  109. console.log(this.searchParams)
  110. this.$nextTick(function(){
  111. _this.$refs.salesList.refash()
  112. _this.getCount()
  113. })
  114. },
  115. refreshList(data, shelfName){
  116. this.searchForm.shelfSnList = data
  117. this.curShelfName = shelfName
  118. this.refresh(this.searchForm)
  119. },
  120. // 状态 change
  121. handleChange(type){
  122. this.$refs.salesList.refash()
  123. this.getCount()
  124. },
  125. // 配送方式
  126. getLookUpItem (type) {
  127. getLookUpItem({ lookupCode: type, pageNo: 1, pageSize: 1000 }).then(res => {
  128. if (res.status == 200 && res.data && res.data.list) {
  129. res.data.list.map(item => {
  130. item.label = item.dispName
  131. item.value = item.code
  132. })
  133. this.billStatusOpt = res.data.list
  134. } else {
  135. this.billStatusOpt = []
  136. }
  137. })
  138. }
  139. }
  140. }
  141. </script>
  142. <style lang="scss">
  143. .sales-list-wrap{
  144. width: 100%;
  145. .head-info{
  146. .search-top-box{
  147. background-color: #fff;
  148. text-align: center;
  149. padding: 20rpx 0;
  150. }
  151. .countData{
  152. background: #fff;
  153. margin: 20upx 20upx 0;
  154. display: flex;
  155. padding: 15upx;
  156. border-radius: 15rpx;
  157. text{
  158. color: #ff5500;
  159. }
  160. font-size: 24rpx;
  161. }
  162. }
  163. .list-box{
  164. padding: 0 25upx;
  165. }
  166. }
  167. </style>