const _Http = getApp().globalData.http, currency = require("../../utils/currency"), CNY = value => currency(value, { symbol: "¥", precision: 2 }).format(); Page({ data: { loading: true, active: "新建", "content": { nocache: true, "pageNumber": 1, "pageTotal": 1, "pageSize": 20, total: 0, "where": { "condition": "", }, sort: [] } }, onLoad(options) { this.getList(true) this.setData({ userrole: wx.getStorageSync('userrole') }) getApp().globalData.Language.getLanguagePackage(this, 'E-订单'); }, getList(init = false) { if (init.detail != undefined) init = init.detail; let content = this.data.content; if (init) content.pageNumber = 1; if (content.pageNumber > content.pageTotal) return; content.where.status = this.data.active; _Http.basic({ "id": 20221216143103, //20221216143103 "version": 1, content }).then(res => { console.log("开票申请列表", res) this.selectComponent('#ListBox').RefreshToComplete(); res.data = res.data.map(v => { v.redamount = CNY(v.redamount) return v }) this.setData({ list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data), "content.pageNumber": res.pageNumber + 1, "content.pageTotal": res.pageTotal, "content.sort": res.sort, "content.total": res.total, loading: false }) }) }, /* 去新增 */ toAdd() { wx.navigateTo({ url: '/packageA/invoice/update' }) }, /* 搜索 */ onSearch({ detail }) { this.setData({ "content.where.condition": detail }); this.getList(true) }, /* 切换tabs */ tabsChange(e) { this.setData({ active: e.detail.name }); this.getList(true); }, onReady() { this.setListHeight() }, /* 设置页面高度 */ setListHeight() { this.selectComponent("#ListBox").setHeight(".total", this); }, })