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

3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. // pages/apply/index.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. show:false,
  12. accountList:[],
  13. approvalItemsOptions:[],
  14. bookName:''
  15. },
  16. /**
  17. * 生命周期函数--监听页面加载
  18. */
  19. onLoad: function (options) {
  20. },
  21. //跳转支出申请
  22. swichPaymentApply:function(e){
  23. console.log(e.currentTarget.dataset.current);
  24. // let cur = e.currentTarget.dataset.current;
  25. // if (this.data.currentTaB == cur) {
  26. // return false;
  27. // }else{
  28. // wx.navigateTo({
  29. // url: '../inCome/index?id=' + id,
  30. // })
  31. // }
  32. wx.navigateTo({
  33. url: '/pages/apply/paymentTemplate/add/add',
  34. })
  35. },
  36. openBox:function(){
  37. var that = this ;
  38. that.setData({
  39. show: true,
  40. })
  41. },
  42. closeBox:function(){
  43. var that = this ;
  44. that.setData({
  45. show: false,
  46. })
  47. },
  48. goTemplate:function(e){
  49. wx.navigateTo({
  50. url: 'paymentTemplate/add/add?id='+e.currentTarget.dataset.id+'&type=template'
  51. })
  52. },
  53. updateMoney:function(e){
  54. UTIL.showLoadingHaveMask('正在查询');
  55. UTIL.httpRequest(API.URL_GET_GETBALANCEENQUIRY+e.currentTarget.dataset.id, {method:'GET'}, {
  56. success: (res) => {
  57. if (res.code == API.SUCCESS_CODE) {
  58. this.setData({
  59. ["accountList["+e.currentTarget.dataset.index+"].balance"]:res.msg
  60. })
  61. UTIL.hideLoadingHaveMask();
  62. wx.showToast({
  63. title: '查询成功',
  64. icon: 'success',
  65. duration: 2000,
  66. })
  67. }else{
  68. UTIL.hideLoadingHaveMask();
  69. wx.showToast({
  70. title: '查询失败',
  71. icon: 'error',
  72. duration: 2000,
  73. })
  74. }
  75. }
  76. })
  77. },
  78. back:function(){
  79. wx.navigateBack({
  80. delta: 1
  81. })
  82. },
  83. /**
  84. * 生命周期函数--监听页面初次渲染完成
  85. */
  86. onReady: function () {
  87. },
  88. /**
  89. * 生命周期函数--监听页面显示
  90. */
  91. onShow: function () {
  92. var that = this;
  93. var sendData = {
  94. pageNum:'1',
  95. pageSize:'100',
  96. accountName:'',
  97. bankAccountNumber:'',
  98. status:'N',
  99. method:'GET',
  100. accountType:102
  101. }
  102. UTIL.httpRequest(API.URL_GET_GETINFO, {method:'GET'}, {
  103. success: (res) => {
  104. if (res.code == API.SUCCESS_CODE) {
  105. this.setData({bookName:res.user.bookName})
  106. }
  107. }
  108. })
  109. UTIL.httpRequest(API.URL_GET_APPROVALITEMSLIST, {method:'GET',dataType:'1'}, {
  110. success: (res) => {
  111. if (res.code == API.SUCCESS_CODE) {
  112. that.setData({
  113. approvalItemsOptions : res.rows
  114. })
  115. }
  116. }
  117. })
  118. UTIL.httpRequest(API.URL_GET_ACCOUNTLIST, sendData,{
  119. success: (res) => {
  120. for (let i = 0; i < res.rows.length; i++) {
  121. if(res.rows[i].bankAccountNumber==null){continue;}
  122. res.rows[i].bankAccountNumber = res.rows[i].bankAccountNumber.replace(/(\d{4})(?=\d)/g, "$1 ")
  123. }
  124. console.log(res.rows)
  125. that.setData({
  126. accountList:res.rows
  127. })
  128. }
  129. })
  130. },
  131. delete(e){
  132. console.log(e);
  133. var that = this;
  134. UTIL.httpRequest(API.URL_GET_REMOVEAPPROVAL + e.currentTarget.dataset.id, {method:'GET'},{
  135. success: (res) => {
  136. if (res.code == API.SUCCESS_CODE) {
  137. that.data.approvalItemsOptions.splice(e.currentTarget.dataset.index, 1);
  138. wx.showToast({
  139. title: '删除成功!',
  140. icon: 'success',
  141. duration: 2000
  142. })
  143. that.setData({
  144. approvalItemsOptions : that.data.approvalItemsOptions
  145. })
  146. }
  147. }
  148. })
  149. },
  150. getMr(e){
  151. var that = this;
  152. UTIL.httpRequest(API.URL_GET_GETSETDEFAULTVALUES + e.currentTarget.dataset.id, {method:'GET'},{
  153. success: (res) => {
  154. if (res.code == API.SUCCESS_CODE) {
  155. UTIL.httpRequest(API.URL_GET_APPROVALITEMSLIST, {method:'GET',dataType:'1'}, {
  156. success: (res) => {
  157. if (res.code == API.SUCCESS_CODE) {
  158. wx.showToast({
  159. title: '设置成功!',
  160. icon: 'success',
  161. duration: 2000
  162. })
  163. that.setData({
  164. approvalItemsOptions : res.rows
  165. })
  166. }
  167. }
  168. })
  169. }
  170. }
  171. })
  172. },
  173. /**
  174. * 生命周期函数--监听页面隐藏
  175. */
  176. onHide: function () {
  177. },
  178. /**
  179. * 生命周期函数--监听页面卸载
  180. */
  181. onUnload: function () {
  182. },
  183. /**
  184. * 页面相关事件处理函数--监听用户下拉动作
  185. */
  186. onPullDownRefresh: function () {
  187. },
  188. /**
  189. * 页面上拉触底事件的处理函数
  190. */
  191. onReachBottom: function () {
  192. },
  193. /**
  194. * 用户点击右上角分享
  195. */
  196. onShareAppMessage: function () {
  197. }
  198. })