微信小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

135 lines
2.9 KiB

  1. // pages/handle/expenditureAudit/expenditureAudit.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. form:[]
  12. },
  13. /**
  14. * 生命周期函数--监听页面加载
  15. */
  16. onLoad: function (options) {
  17. var that = this;
  18. that.setData({
  19. id:options.id,
  20. typeid:options.typeid
  21. })
  22. wx.showLoading({
  23. title: '正在加载模板',
  24. mask:true
  25. })
  26. //所属银行
  27. UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'bank_type', {method:'GET'}, {
  28. success: (res) => {
  29. this.setData({
  30. bankTypeOptions:res.data
  31. });
  32. }
  33. })
  34. UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'resource_farming_type', {method:'GET'}, {
  35. success: (res) => {
  36. that.setData({
  37. farmingTypeOptions:res.data,
  38. })
  39. }
  40. })
  41. UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'resources_build_type', {method:'GET'}, {
  42. success: (res) => {
  43. that.setData({
  44. buildTypeOptions:res.data,
  45. })
  46. }
  47. })
  48. UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'resources_unused_type', {method:'GET'}, {
  49. success: (res) => {
  50. that.setData({
  51. unusedTypeOptions:res.data,
  52. })
  53. }
  54. })
  55. /**使用情况 字典 1:自用 2:闲置 3:出租或外借 4:其他*/
  56. UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'use_type', {method:'GET'}, {
  57. success: (res) => {
  58. that.setData({
  59. useTypeOptions:res.data,
  60. })
  61. }
  62. })
  63. setTimeout(function(){
  64. //详情
  65. UTIL.httpRequest(API.URL_GET_GETRESOURCEGET + options.id, {method:'GET'}, {
  66. success: (res) => {
  67. res.data.resourceSortText = UTIL.getTransform(res.data.resourceSort,that.data.typeid == 1 ? that.data.farmingTypeOptions : that.data.typeid == 2 ? that.data.buildTypeOptions : that.data.typeid == 3 ? that.data.unusedTypeOptions : '');
  68. res.data.useTypeText = UTIL.getTransform(res.data.useType,that.data.useTypeOptions);
  69. that.setData({
  70. form:res.data
  71. })
  72. }
  73. })
  74. })
  75. wx.hideLoading()
  76. },
  77. /**
  78. * 生命周期函数--监听页面初次渲染完成
  79. */
  80. onReady: function () {
  81. },
  82. /**
  83. * 生命周期函数--监听页面显示
  84. */
  85. onShow: function () {
  86. },
  87. back:function(){
  88. wx.navigateBack({
  89. delta: 1
  90. })
  91. },
  92. /**
  93. * 生命周期函数--监听页面隐藏
  94. */
  95. onHide: function () {
  96. },
  97. /**
  98. * 生命周期函数--监听页面卸载
  99. */
  100. onUnload: function () {
  101. },
  102. /**
  103. * 页面相关事件处理函数--监听用户下拉动作
  104. */
  105. onPullDownRefresh: function () {
  106. },
  107. /**
  108. * 页面上拉触底事件的处理函数
  109. */
  110. onReachBottom: function () {
  111. },
  112. /**
  113. * 用户点击右上角分享
  114. */
  115. onShareAppMessage: function () {
  116. }
  117. })