12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- <template>
- <view class="sales-list-wrap">
- <u-dropdown>
- <u-dropdown-item v-model="billStatus" title="业务状态" :options="billStatusOpt"></u-dropdown-item>
- </u-dropdown>
- </view>
- </template>
- <script>
- import { getLookUpItem } from '@/api/data'
- import { salesList } from '@/api/sales'
- export default{
- data(){
- return{
- listData: [],
- pageNo: 1,
- pageSize: 6,
- totalNum: 0,
- noDataText: '暂无数据',
- billStatus: undefined,
- financialStatus: undefined,
- billStatusOpt: [],
- financialStatusOpt: [],
- }
- },
- onLoad() {
- this.getLookUpItem('SALES_BILL_STATUS')
- this.getLookUpItem('FINANCIAL_RECEIVE_STATUS')
- this.getList()
- },
- methods: {
- // 列表
- getList(pageNo){
- const _this = this
- if (pageNo) {
- this.pageNo = pageNo
- }
- salesList({ pageNo: this.pageNo, pageSize: this.pageSize }).then(res => {
- if (res.status == 200) {
- if(this.pageNo>1){
- this.listData = this.listData.concat(res.data.list || [])
- }else{
- this.listData = res.data.list || []
- }
- this.totalNum = res.data.count || 0
- } else {
- this.listData = []
- this.totalNum = 0
- this.noDataText = res.message
- }
- })
- },
- // scroll-view到底部加载更多
- onreachBottom() {
- if(this.listData.length < this.totalNum){
- this.pageNo += 1
- this.getList()
- }
- },
- handleChange(){},
- // 配送方式
- 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
- })
- 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>
- </style>
|