detail.js 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. const _Http = getApp().globalData.http;
  2. Page({
  3. data: {
  4. tabsActive: 2,
  5. sa_invoiceapplyid: "",
  6. tabsList: [{
  7. label: "详细信息",
  8. icon: "icon-tabchanpin"
  9. }, {
  10. label: "开票单位",
  11. icon: "icon-tabchanpin"
  12. }, {
  13. label: "开票明细",
  14. icon: "icon-tabchanpin",
  15. model: "#DetailLine"
  16. }]
  17. },
  18. onLoad(options) {
  19. this.setData({
  20. sa_invoiceapplyid: options.id
  21. });
  22. this.getDetail();
  23. },
  24. getDetail() {
  25. _Http.basic({
  26. "id": "20221216143003",
  27. "version": 1,
  28. "content": {
  29. "sa_invoiceapplyid": this.data.sa_invoiceapplyid
  30. }
  31. }).then(res => {
  32. console.log("开票单详情", res)
  33. if (res.msg != '成功') return wx.showToast({
  34. title: res.msg,
  35. icon: "none"
  36. })
  37. this.setData({
  38. detail: res.data
  39. });
  40. this.setPreview();
  41. this.partialRenewal();
  42. })
  43. },
  44. /* 设置显示信息 */
  45. setPreview() {
  46. let item = this.data.detail;
  47. let list1 = [{
  48. label: "申请单号",
  49. value: item.billno
  50. }, {
  51. label: "发票限额",
  52. value: item.quota
  53. }, {
  54. label: "是否手工单",
  55. value: item.byhand ? '是' : '否'
  56. }, {
  57. label: "发票种类",
  58. value: item.invoiceline
  59. }, {
  60. label: "发票收款人",
  61. value: item.invoicepayee
  62. }, {
  63. label: "开票员",
  64. value: item.invoiceclerk
  65. }, {
  66. label: "发票复核人",
  67. value: item.invoicechecker
  68. }, {
  69. label: "提交人",
  70. value: item.submitby
  71. }, {
  72. label: "提交日期",
  73. value: item.submitdate
  74. }, {
  75. label: "备注",
  76. value: item.remarks
  77. }];
  78. let list2 = [{
  79. label: "状态",
  80. value: item.status
  81. }, {
  82. label: "创建人",
  83. value: item.createby
  84. }, {
  85. label: "创建时间",
  86. value: item.createdate
  87. }, {
  88. label: "审核人",
  89. value: item.checkby
  90. }, {
  91. label: "审核时间",
  92. value: item.checkdate
  93. }, {
  94. label: "修改人",
  95. value: item.changeby
  96. }, {
  97. label: "修改时间",
  98. value: item.changedate
  99. }, ];
  100. let riseLine = [{
  101. label: "抬头",
  102. value: item.enterprisename
  103. }, {
  104. label: "税号",
  105. value: item.taxno
  106. }, {
  107. label: "开户行",
  108. value: item.bank
  109. }, {
  110. label: "开户账号",
  111. value: item.bankcardno
  112. }, {
  113. label: "开票地址",
  114. value: item.address
  115. }, {
  116. label: "联系方式",
  117. value: item.phonenumber
  118. }];
  119. this.setData({
  120. list1,
  121. list2,
  122. riseLine
  123. })
  124. },
  125. //局部数据更新 tabs
  126. partialRenewal(init = false) {
  127. let model = this.data.tabsList[this.data.tabsActive].model;
  128. if (model) {
  129. let Component = this.selectComponent(model),
  130. {
  131. total,
  132. pageNumber,
  133. pageTotal
  134. } = Component.data.content,
  135. id = this.data.sa_invoiceapplyid;
  136. if (total == null || init) {
  137. Component.getList(id, init);
  138. } else if (pageNumber < pageTotal) {
  139. Component.getList(id, false);
  140. }
  141. }
  142. },
  143. onReachBottom() {
  144. this.partialRenewal();
  145. },
  146. onUnload() {
  147. },
  148. })