123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- const _Http = getApp().globalData.http;
- import currency from "../../utils/currency";
- let CNY = value => currency(value, {
- symbol: "",
- precision: 2
- }).format();
- Page({
- data: {
- table: [{
- title: '客户名',
- width: 330,
- key: 'enterprisename',
- fun: 'toDetail'
- }, {
- title: '业务员',
- width: 200,
- key: 'name'
- }, {
- title: '订单号',
- width: 300,
- key: 'sonum'
- }, {
- title: '审核时间',
- width: 300,
- key: 'checkdate'
- }, {
- title: '订单行号',
- width: 200,
- key: 'rowno'
- }, {
- title: '商品编码',
- width: 300,
- key: 'itemno'
- }, {
- title: '商品名称',
- width: 300,
- key: 'itemname'
- }, {
- title: '型号',
- width: 200,
- key: 'model'
- }, {
- title: '规格',
- width: 200,
- key: 'spec'
- }, {
- title: '数量',
- width: 200,
- key: 'qty'
- }, {
- title: '金额',
- width: 200,
- key: 'amount'
- }, {
- title: '逾期金额',
- width: 200,
- key: 'overdueamount'
- }],
- sumWidth: 0,
- "content": {
- "pageNumber": 1,
- "pageSize": 30,
- "dataid": "4222", // 按业务员时 传userid 按客户时传 sa_customersid
- "querytype": "1", //0按业务员 1按客户
- "point": "全部", //入账节点
- "where": {
- "condition": ""
- }
- }
- },
- onLoad(options) {
- let content = JSON.parse(options.content);
- content.pageNumber = 1;
- content.pageTotal = 1;
- this.data.content = content;
- this.setData({
- sumWidth: this.data.table.reduce((prev, cur) => {
- return prev.width ? prev.width + cur.width : prev + cur.width
- })
- })
- this.getList()
- 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;
- _Http.basic({
- "id": 202400321085104,
- content
- }).then(res => {
- this.setListHeight()
- this.selectComponent('#ListBox').RefreshToComplete();
- console.log("逾期账款明细", res)
- let list = res.data.map(v => {
- v.amount = CNY(v.amount)
- v.overdueamount = CNY(v.overdueamount)
- return v
- })
- this.setData({
- list: res.pageNumber == 1 ? list : this.data.list.concat(list),
- "content.pageNumber": res.pageNumber + 1,
- "content.pageTotal": res.pageTotal,
- "content.total": res.total,
- })
- })
- },
- onReady() {
- this.setListHeight()
- },
- /* 设置页面高度 */
- setListHeight() {
- this.selectComponent("#ListBox").setHeight(".roof", this);
- },
- })
|