123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164 |
- <template>
- <view class="sales-list-wrap">
- <u-dropdown class="search-top-box" id="tjCons">
- <u-dropdown-item v-model="searchForm.billStatus" @change="handleChange('bill')" title="业务状态"
- :options="billStatusOpt"></u-dropdown-item>
- <u-dropdown-item v-model="searchForm.financialStatus" @change="handleChange('financial')" title="财务状态"
- :options="(pageType&&pageType=='onlinePagOrder')?onlinePagStatusOpt:financialStatusOpt"></u-dropdown-item>
- </u-dropdown>
-
- <view class="list-box">
- <listComponent ref="salesList" :height="listHeight" :params="searchForm" />
- </view>
-
- <salesSearch ref="searchBox" :openModal="openModal" :defaultParams="searchForm" @refresh="refresh"
- @close="openModal=false" />
- </view>
- </template>
- <script>
- import ListComponent from './listComponent.vue'
- import SalesSearch from './salesSearch.vue'
- import {
- getLookUpItem
- } from '@/api/data'
- import {
- salesList
- } from '@/api/sales'
- export default {
- components: {
- ListComponent,
- SalesSearch
- },
- data() {
- return {
- listData: [],
- pageNo: 1,
- pageSize: 6,
- totalNum: 0,
- noDataText: '暂无数据',
- billStatusOpt: [],
- financialStatusOpt: [],
- onlinePagStatusOpt:[],
- searchForm: {
- billStatus: null,
- financialStatus: null,
- payOnlineFlag:null
- },
- listHeight: 200,
- openModal: false,
- pageType:null
- }
- },
- onNavigationBarButtonTap(e) {
- this.openModal = true
- },
- onBackPress() {
- if (this.openModal) {
- this.$refs.searchBox.closeBox()
- this.openModal = false
- return true
- }
- },
- onReady() {
- const query = uni.createSelectorQuery().in(this);
- query.select('#tjCons').boundingClientRect(data => {
- this.listHeight = Math.floor(data.height + 5)
- }).exec();
- },
- onLoad(options) {
- const _this = this
- this.getLookUpItem('SALES_BILL_STATUS')
- this.getLookUpItem('FINANCIAL_RECEIVE_STATUS')
- this.getLookUpItem('FINANCIAL_ONLINE_RECEIVE_STATUS')
- this.$nextTick(function() {
-
- uni.$on('refreshSalesBL', function(data) {
- _this.$refs.salesList.getList(1)
- })
- })
- this.searchForm.payOnlineFlag=options?(options.pageType&&options.pageType=='onlinePagOrder')?1:0:0
- if (options&&options.pageType&&options.pageType=='onlinePagOrder') {
- this.pageType = options.pageType
- uni.setNavigationBarTitle({
- title: '线上支付订单'
- });
- }
- },
- onUnload() {
- uni.$off('refreshSalesBL')
- },
- methods: {
-
- refresh(params) {
- const _this = this
- const data = params ? Object.assign(this.searchForm, params) : {
- billStatus: null,
- financialStatus: null
- }
- data.beginDate = data.beginDate ? (data.beginDate + ' 00:00:00') : ''
- data.endDate = data.endDate ? (data.endDate + ' 23:59:59') : ''
- this.searchForm = data
- this.$nextTick(function() {
- _this.$refs.salesList.refash()
- })
- },
-
- handleChange(type) {
- this.$refs.salesList.refash()
- },
-
- getLookUpItem(type) {
- getLookUpItem({
- lookupCode: type,
- pageNo: 1,
- pageSize: 1000
- }).then(res => {
- if (res.status == 200 && res.data && res.data.list) {
- res.data.list.map(item => {
- item.label = item.dispName
- item.value = item.code
- })
- res.data.list.splice(0, 0, {
- label: '全部',
- value: null
- })
- if (type == 'SALES_BILL_STATUS') {
- if(this.pageType =='onlinePagOrder'){
- this.billStatusOpt = res.data.list.filter(item=>item.code!='WAIT_SUBMIT'&&item.code!='SUPERIOR_CHANGE')
- }else{
- this.billStatusOpt = res.data.list
- }
- } else if (type == 'FINANCIAL_RECEIVE_STATUS') {
- this.financialStatusOpt = res.data.list
- }else if(type=='FINANCIAL_ONLINE_RECEIVE_STATUS'){
- this.onlinePagStatusOpt = res.data.list
- }
- } else {
- if (type == 'SALES_BILL_STATUS') {
- this.billStatusOpt = []
- } else if (type == 'FINANCIAL_RECEIVE_STATUS') {
- this.financialStatusOpt = []
- }else if(type=='FINANCIAL_ONLINE_RECEIVE_STATUS'){
- this.onlinePagStatusOpt = []
- }
- }
- })
- }
- }
- }
- </script>
- <style lang="scss">
- .sales-list-wrap {
- width: 100%;
- .search-top-box {
- background-color: #fff;
- }
- .list-box {
- padding: 0 25upx;
- }
- }
- </style>
|