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

169 行
4.3 KiB

  1. // pages/handle/liist.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. pageNums:1,
  12. scrollHeight:"",
  13. financeList:[],
  14. index:0,
  15. array:["收支明细公开"],
  16. userInfoObj:[],
  17. date: UTIL.formatDates(new Date),
  18. data:{},
  19. bookId : '',
  20. deptId : '',
  21. },
  22. onConfirmReviewTime(e){
  23. let data = e.detail.value;
  24. this.setData({
  25. 'date':data,
  26. 'pageNums':1});
  27. this.getList();
  28. },
  29. paging(){
  30. this.setData({
  31. pageNums:this.data.pageNums+1,
  32. })
  33. this.getList();
  34. },
  35. getList:function(){
  36. let params = {
  37. pageNum:this.data.pageNums,
  38. pageSize:10,
  39. startNY:this.data.date,
  40. all:false,
  41. bookId : this.data.bookId,
  42. deptId : this.data.deptId,
  43. }
  44. UTIL.httpRequest(API.URL_GET_FINANCIALLIST,params,{
  45. success: (res) => {
  46. if(res.code == 200){
  47. res.summary.syjc=Number(res.summary.syjc ).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, ($0, $1) => {
  48. return $1 + ","; }).replace(/\.$/, "")
  49. res.summary.dai=Number(res.summary.dai ).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, ($0, $1) => {
  50. return $1 + ","; }).replace(/\.$/, "")
  51. res.summary.jie=Number(res.summary.jie ).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, ($0, $1) => {
  52. return $1 + ","; }).replace(/\.$/, "")
  53. res.summary.byjc=Number(res.summary.byjc ).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, ($0, $1) => {
  54. return $1 + ","; }).replace(/\.$/, "")
  55. this.setData({'data':res.summary})
  56. if(this.data.pageNums!=1&&this.data.financeList.length<res.total){
  57. res.rows.map(rr => {
  58. rr.jieAmount = Number(rr.jieAmount ).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, ($0, $1) => {
  59. return $1 + ","; }).replace(/\.$/, "")
  60. rr.daiAmount = Number(rr.daiAmount ).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, ($0, $1) => {
  61. return $1 + ","; }).replace(/\.$/, "")
  62. })
  63. let lists = this.data.financeList.concat(res.rows)
  64. this.setData({financeList:lists})
  65. }else if(this.data.pageNums==1){
  66. res.rows.map(rr => {
  67. rr.jieAmount = Number(rr.jieAmount ).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, ($0, $1) => {
  68. return $1 + ","; }).replace(/\.$/, "")
  69. rr.daiAmount = Number(rr.daiAmount ).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, ($0, $1) => {
  70. return $1 + ","; }).replace(/\.$/, "")
  71. })
  72. this.setData({financeList:res.rows})
  73. }
  74. }else{
  75. UTIL.showToastNoneIcon(res.msg);
  76. }
  77. }
  78. })
  79. },
  80. /**
  81. * 生命周期函数--监听页面加载
  82. */
  83. onLoad: function (options) {
  84. var that = this;
  85. let qu = wx.createSelectorQuery()
  86. qu.select("#top_view1").boundingClientRect()
  87. qu.select("#top_view2").boundingClientRect()
  88. qu.exec(res => {
  89. that.setData({
  90. scrollHeight:wx.getSystemInfoSync().windowHeight-res[0].height-res[0].top-res[1].height-res[1].left*2
  91. })
  92. })
  93. that.setData({
  94. date : options.date,
  95. bookId : options.bookId,
  96. deptId : options.deptId,
  97. })
  98. this.getList()
  99. },
  100. bindPickerChange:function(e){
  101. this.setData({index:e.detail.value});
  102. },
  103. switchTab:function(e){
  104. this.setData({
  105. active:e.currentTarget.dataset.gid
  106. })
  107. },
  108. goDetail:function(e){
  109. wx.navigateTo({
  110. url: 'voucher/voucher?id='+e.currentTarget.dataset.id,
  111. })
  112. },
  113. back:function(){
  114. wx.navigateBack({
  115. delta: 1
  116. })
  117. },
  118. /**
  119. * 生命周期函数--监听页面初次渲染完成
  120. */
  121. onReady: function () {
  122. },
  123. /**
  124. * 生命周期函数--监听页面显示
  125. */
  126. onShow: function () {
  127. },
  128. /**
  129. * 生命周期函数--监听页面隐藏
  130. */
  131. onHide: function () {
  132. },
  133. /**
  134. * 生命周期函数--监听页面卸载
  135. */
  136. onUnload: function () {
  137. },
  138. /**
  139. * 页面相关事件处理函数--监听用户下拉动作
  140. */
  141. onPullDownRefresh: function () {
  142. },
  143. /**
  144. * 页面上拉触底事件的处理函数
  145. */
  146. onReachBottom: function () {
  147. },
  148. /**
  149. * 用户点击右上角分享
  150. */
  151. onShareAppMessage: function () {
  152. }
  153. })