Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

198 строки
4.1 KiB

  1. const config = require('../../config/config.js')
  2. const Http = require('../../utils/HttpBasics.js')
  3. const util = require('../../utils/util.js')
  4. const app = getApp();
  5. Page({
  6. /**
  7. * 页面的初始数据
  8. */
  9. data: {
  10. // organizationType:null,
  11. obj: {},//=> item.applymentState
  12. },
  13. submit() {
  14. Http.post({
  15. url: config.api.applyment,
  16. data: {
  17. id: this.data.obj.id
  18. }
  19. }).then(res => {
  20. let this_ = this
  21. wx.showToast({
  22. title: '提交成功',
  23. icon: "none",
  24. })
  25. setTimeout(() => {
  26. this_.getReceiverApply()
  27. }, 2000)
  28. }).catch(err => {
  29. wx.hideLoading();
  30. wx.showToast({
  31. title: err.message,
  32. icon: "none",
  33. })
  34. })
  35. },
  36. cut() {
  37. let this_ = this;
  38. //
  39. wx.showModal({
  40. title: '提示',
  41. content: '更改主体类型后,将清空部分已填写的资料,请确认是否更改?',
  42. success(res) {
  43. if (res.confirm) {
  44. console.log('用户点击确定')
  45. this_.setData({
  46. obj: {}
  47. })
  48. } else if (res.cancel) {
  49. console.log('用户点击取消')
  50. }
  51. }
  52. })
  53. },
  54. go(e) {
  55. let type = e.currentTarget.dataset.type
  56. let url = ""
  57. if (type == 1) {
  58. url = "/pages/warehouse/detail/subjectFirm/subjectFirm?id=" + this.data.obj.id + '&organizationType=' + this.data.obj.organizationType
  59. } else if (type == 2) {
  60. url = "/pages/warehouse/detail/manageFirm/manageFirm?id=" + this.data.obj.id + '&organizationType=' + this.data.obj.organizationType
  61. } else if (type == 3) {
  62. url = "/pages/warehouse/detail/industryFirm/industryFirm?id=" + this.data.obj.id + '&organizationType=' + this.data.obj.organizationType
  63. } else if (type == 4) {
  64. url = "/pages/warehouse/detail/clearingFirm/clearingFirm?id=" + this.data.obj.id + '&organizationType=' + this.data.obj.organizationType
  65. } else if (type == 5) {
  66. url = "/pages/warehouse/detail/adminFirm/adminFirm?id=" + this.data.obj.id + '&organizationType=' + this.data.obj.organizationType
  67. }
  68. wx.navigateTo({
  69. url: url,
  70. })
  71. },
  72. goLook() {
  73. wx.navigateTo({
  74. url: `/pages/warehouse/lookStatus/lookStatus?id=${this.data.obj.id}`,
  75. })
  76. },
  77. getReceiverApply() {
  78. wx.showLoading({
  79. title: '加载中...',
  80. })
  81. Http.get({
  82. url: config.api.getReceiverApply,
  83. data: {
  84. merchantId: app.globalData.merchant.merchant_id
  85. }
  86. }).then(res => {
  87. if (res.data && res.data.organizationType) {
  88. console.log(res.data, '获取的用户数据');
  89. this.setData({
  90. obj: res.data
  91. })
  92. }
  93. wx.hideLoading();
  94. }).catch(err => {
  95. wx.hideLoading();
  96. wx.showToast({
  97. title: err.message,
  98. icon: "none",
  99. duration: 2000
  100. })
  101. })
  102. },
  103. setReceiver(e) {
  104. let type = e.currentTarget.dataset.type
  105. Http.post({
  106. url: config.api.receiverAdd,
  107. data: {
  108. merchantId: app.globalData.merchant.merchant_id,
  109. organizationType: type
  110. }
  111. }).then(res => {
  112. this.getReceiverApply()
  113. }).catch(err => {
  114. wx.showToast({
  115. title: err.message,
  116. icon: "none"
  117. })
  118. })
  119. },
  120. /**
  121. * 生命周期函数--监听页面加载
  122. */
  123. onLoad: function (options) {
  124. // console.log(options.organizationType, "options.organizationType")
  125. // this.setData({
  126. // organizationType: options.organizationType
  127. // })
  128. },
  129. /**
  130. * 生命周期函数--监听页面初次渲染完成
  131. */
  132. onReady: function () {
  133. },
  134. /**
  135. * 生命周期函数--监听页面显示
  136. */
  137. onShow: function () {
  138. this.getReceiverApply()
  139. },
  140. /**
  141. * 生命周期函数--监听页面隐藏
  142. */
  143. onHide: function () {
  144. },
  145. /**
  146. * 生命周期函数--监听页面卸载
  147. */
  148. onUnload: function () {
  149. },
  150. /**
  151. * 页面相关事件处理函数--监听用户下拉动作
  152. */
  153. onPullDownRefresh: function () {
  154. },
  155. /**
  156. * 页面上拉触底事件的处理函数
  157. */
  158. onReachBottom: function () {
  159. },
  160. /**
  161. * 用户点击右上角分享
  162. */
  163. onShareAppMessage: function () {
  164. }
  165. })