detail.js 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. const _Http = getApp().globalData.http;
  2. import currency from "../../utils/currency";
  3. let CNY = value => currency(value, {
  4. symbol: "",
  5. precision: 2
  6. }).format();
  7. Page({
  8. data: {
  9. table: [{
  10. title: '客户名',
  11. width: 330,
  12. key: 'enterprisename',
  13. fun: 'toDetail'
  14. }, {
  15. title: '业务员',
  16. width: 200,
  17. key: 'name'
  18. }, {
  19. title: '订单号',
  20. width: 300,
  21. key: 'sonum'
  22. }, {
  23. title: '审核时间',
  24. width: 300,
  25. key: 'checkdate'
  26. }, {
  27. title: '订单行号',
  28. width: 200,
  29. key: 'rowno'
  30. }, {
  31. title: '商品编码',
  32. width: 300,
  33. key: 'itemno'
  34. }, {
  35. title: '商品名称',
  36. width: 300,
  37. key: 'itemname'
  38. }, {
  39. title: '型号',
  40. width: 200,
  41. key: 'model'
  42. }, {
  43. title: '规格',
  44. width: 200,
  45. key: 'spec'
  46. }, {
  47. title: '数量',
  48. width: 200,
  49. key: 'qty'
  50. }, {
  51. title: '金额',
  52. width: 200,
  53. key: 'amount'
  54. }, {
  55. title: '逾期金额',
  56. width: 200,
  57. key: 'overdueamount'
  58. }, {
  59. title: '逾期说明',
  60. width: 400,
  61. key: 'overdueexplanation'
  62. }],
  63. sumWidth: 0,
  64. "content": {
  65. "pageNumber": 1,
  66. "pageSize": 30,
  67. "dataid": "4222", // 按业务员时 传userid 按客户时传 sa_customersid
  68. "querytype": "1", //0按业务员 1按客户
  69. "point": "全部", //入账节点
  70. "where": {
  71. "condition": ""
  72. }
  73. }
  74. },
  75. onLoad(options) {
  76. let content = JSON.parse(options.content);
  77. content.pageNumber = 1;
  78. content.pageTotal = 1;
  79. this.data.content = content;
  80. this.setData({
  81. sumWidth: this.data.table.reduce((prev, cur) => {
  82. return prev.width ? prev.width + cur.width : prev + cur.width
  83. })
  84. })
  85. this.getList()
  86. getApp().globalData.Language.getLanguagePackage(this, 'E-订单');
  87. },
  88. getList(init = false) {
  89. if (init.detail != undefined) init = init.detail;
  90. let content = this.data.content;
  91. if (init) content.pageNumber = 1;
  92. if (content.pageNumber > content.pageTotal) return;
  93. _Http.basic({
  94. "id": 202400321085104,
  95. content
  96. }).then(res => {
  97. this.setListHeight()
  98. this.selectComponent('#ListBox').RefreshToComplete();
  99. console.log("逾期账款明细", res)
  100. let list = res.data.map(v => {
  101. v.amount = CNY(v.amount)
  102. v.overdueamount = CNY(v.overdueamount)
  103. return v
  104. })
  105. this.setData({
  106. list: res.pageNumber == 1 ? list : this.data.list.concat(list),
  107. "content.pageNumber": res.pageNumber + 1,
  108. "content.pageTotal": res.pageTotal,
  109. "content.total": res.total,
  110. })
  111. })
  112. },
  113. onReady() {
  114. this.setListHeight()
  115. },
  116. /* 设置页面高度 */
  117. setListHeight() {
  118. this.selectComponent("#ListBox").setHeight(".roof", this);
  119. },
  120. })