detail.js 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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. sumWidth: 0,
  60. "content": {
  61. "pageNumber": 1,
  62. "pageSize": 30,
  63. "dataid": "4222", // 按业务员时 传userid 按客户时传 sa_customersid
  64. "querytype": "1", //0按业务员 1按客户
  65. "point": "全部", //入账节点
  66. "where": {
  67. "condition": ""
  68. }
  69. }
  70. },
  71. onLoad(options) {
  72. let content = JSON.parse(options.content);
  73. content.pageNumber = 1;
  74. content.pageTotal = 1;
  75. this.data.content = content;
  76. this.setData({
  77. sumWidth: this.data.table.reduce((prev, cur) => {
  78. return prev.width ? prev.width + cur.width : prev + cur.width
  79. })
  80. })
  81. this.getList()
  82. getApp().globalData.Language.getLanguagePackage(this, 'E-订单');
  83. },
  84. getList(init = false) {
  85. if (init.detail != undefined) init = init.detail;
  86. let content = this.data.content;
  87. if (init) content.pageNumber = 1;
  88. if (content.pageNumber > content.pageTotal) return;
  89. _Http.basic({
  90. "id": 202400321085104,
  91. content
  92. }).then(res => {
  93. this.setListHeight()
  94. this.selectComponent('#ListBox').RefreshToComplete();
  95. console.log("逾期账款明细", res)
  96. let list = res.data.map(v => {
  97. v.amount = CNY(v.amount)
  98. v.overdueamount = CNY(v.overdueamount)
  99. return v
  100. })
  101. this.setData({
  102. list: res.pageNumber == 1 ? list : this.data.list.concat(list),
  103. "content.pageNumber": res.pageNumber + 1,
  104. "content.pageTotal": res.pageTotal,
  105. "content.total": res.total,
  106. })
  107. })
  108. },
  109. onReady() {
  110. this.setListHeight()
  111. },
  112. /* 设置页面高度 */
  113. setListHeight() {
  114. this.selectComponent("#ListBox").setHeight(".roof", this);
  115. },
  116. })