123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138 |
- <template>
- <view class="sales-list-wrap">
- <u-dropdown class="search-top-box">
- <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="financialStatusOpt"></u-dropdown-item>
- </u-dropdown>
- <!-- 销售单列表 -->
- <view class="list-box">
- <listComponent ref="salesList" height="100" :params="searchParams" />
- </view>
- <!-- 查询右侧弹框 -->
- <salesSearch :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: [],
- searchForm: {
- billStatus: null,
- financialStatus: null
- },
- searchParams: {},
- openModal: false
- }
- },
- onNavigationBarButtonTap(e){ // 标题栏 按钮操作
- this.openModal = true
- },
- onLoad() {
- const _this = this
- this.getLookUpItem('SALES_BILL_STATUS')
- this.getLookUpItem('FINANCIAL_RECEIVE_STATUS')
- this.$nextTick(function(){
- // 监听整改完成后刷新事件
- uni.$on('refreshBL', function(data){
- _this.$refs.salesList.getList(1)
- })
- })
- },
- onUnload() {
- uni.$off('refreshBL')
- },
- methods: {
- // 获取查询参数 刷新列表
- refresh(params){
- const _this = this
- const data = {}
- if(this.searchForm.billStatus){
- data.billStatus = this.searchForm.billStatus
- }
- if(this.searchForm.financialStatus){
- data.financialStatus = this.searchForm.financialStatus
- }
- if(params.beginDate){
- data.beginDate = params.beginDate
- }
- if(params.endDate){
- data.endDate = params.endDate
- }
- if(params.buyerName){
- data.buyerName = params.buyerName
- }
- if(params.salesBillNo){
- data.salesBillNo = params.salesBillNo
- }
- if(params.purchaseBillNo){
- data.purchaseBillNo = params.purchaseBillNo
- }
- if(params.settleStyleSn){
- data.settleStyleSn = params.settleStyleSn
- }
- this.searchParams = data
- console.log(this.searchParams,'this.searchParams')
- this.$nextTick(function(){
- _this.$refs.salesList.getList(1)
- })
- },
- // 状态 change
- handleChange(type){
- if(type == 'bill'){
- this.searchParams.billStatus = this.searchForm.billStatus
- }else if(type == 'financial'){
- this.searchParams.financialStatus = this.searchForm.financialStatus
- }
- this.$refs.salesList.getList(1)
- },
- // 配送方式
- 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'){
- this.billStatusOpt = res.data.list
- }else if(type == 'FINANCIAL_RECEIVE_STATUS'){
- this.financialStatusOpt = res.data.list
- }
- } else {
- if(type == 'SALES_BILL_STATUS'){
- this.billStatusOpt = []
- }else if(type == 'FINANCIAL_RECEIVE_STATUS'){
- this.financialStatusOpt = []
- }
- }
- })
- }
- }
- }
- </script>
- <style lang="scss">
- .sales-list-wrap{
- width: 100%;
- .search-top-box{
- background-color: #fff;
- }
- .list-box{
- padding: 20upx 20upx 0;
- }
- }
- </style>
|