微信小程序
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. // pages/finance/voucher/voucher.js
  2. import * as UTIL from '../../../utils/util.js';
  3. import * as API from '../../../utils/API.js';
  4. const app = getApp();
  5. Page({
  6. /**
  7. * 页面的初始数据
  8. */
  9. data: {
  10. isIPX: app.globalData.isIPX,
  11. voucher:{}
  12. },
  13. /**
  14. * 生命周期函数--监听页面加载
  15. */
  16. onLoad(options) {
  17. var that = this ;
  18. var id = options.id;
  19. // 对账状态字典查询
  20. UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'archive_status', {method:'GET'}, {
  21. success: (res) => {
  22. that.setData({
  23. archiveStatusOptions:res.data,
  24. })
  25. }
  26. })
  27. // 凭证字典查询
  28. UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'voucher_word', {method:'GET'}, {
  29. success: (res) => {
  30. that.setData({
  31. voucherWordOptions:res.data,
  32. })
  33. }
  34. })
  35. UTIL.httpRequest(API.URL_GET_GETVOUCHERDETAIL, {method:'GET',id:id}, {
  36. success: (res) => {
  37. console.log(res);
  38. let moneyCount = 0;
  39. for (let i = 0; i < res.data.detailList.length; i++) {
  40. moneyCount += res.data.detailList[i].jieAmount;
  41. }
  42. res.data.voucherWordText = UTIL.getTransform(res.data.voucherWord,that.data.voucherWordOptions);
  43. UTIL.httpRequest(API.URL_GET_BOOKLISTBYDEPTID, {method:'GET'}, {
  44. success: (res2) => {
  45. let bookName = res2.rows.filter(function (e) { return e.id == res.data.bookId; })[0].bookName;
  46. that.setData({
  47. bookName:bookName
  48. })
  49. }
  50. })
  51. that.setData({
  52. voucher:res.data,
  53. moneyCount:UTIL.ToChinese(parseFloat(moneyCount).toFixed(2)),
  54. listLength:res.data.detailList.length
  55. })
  56. }
  57. })
  58. },
  59. back:function(){
  60. wx.navigateBack({
  61. delta: 1
  62. })
  63. },
  64. /**
  65. * 生命周期函数--监听页面初次渲染完成
  66. */
  67. onReady() {
  68. },
  69. /**
  70. * 生命周期函数--监听页面显示
  71. */
  72. onShow() {
  73. },
  74. /**
  75. * 生命周期函数--监听页面隐藏
  76. */
  77. onHide() {
  78. },
  79. /**
  80. * 生命周期函数--监听页面卸载
  81. */
  82. onUnload() {
  83. },
  84. /**
  85. * 页面相关事件处理函数--监听用户下拉动作
  86. */
  87. onPullDownRefresh() {
  88. },
  89. /**
  90. * 页面上拉触底事件的处理函数
  91. */
  92. onReachBottom() {
  93. },
  94. /**
  95. * 用户点击右上角分享
  96. */
  97. onShareAppMessage() {
  98. }
  99. })