微信小程序
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.

170 lines
4.4 KiB

  1. // pages/mainBody/detail/detail.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. // 主体类别字典
  12. statisticsTypeIdOptions: [],
  13. // 示范社类型字典
  14. modelSocietyTypeOptions: [],
  15. // 经营状态字典
  16. registrationStatusOptions: [],
  17. // 企业类型字典
  18. enterpriseTypeOptions: [],
  19. //产业分类字典项
  20. industryClassificationTypeOptions: [],
  21. // 审核状态字典
  22. reviewStatusOptions: [],
  23. },
  24. back:function(){
  25. wx.navigateBack({
  26. delta: 1
  27. })
  28. },
  29. /**
  30. * 生命周期函数--监听页面加载
  31. */
  32. onLoad(options) {
  33. var that = this;
  34. UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'newBusinessEntity_statistics_project', {method:'GET'}, {
  35. success: (res) => {
  36. that.setData({
  37. statisticsTypeIdOptions:res.data,
  38. })
  39. }
  40. })
  41. UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'model_society_type', {method:'GET'}, {
  42. success: (res) => {
  43. that.setData({
  44. modelSocietyTypeOptions:res.data,
  45. })
  46. }
  47. })
  48. UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'registration_status', {method:'GET'}, {
  49. success: (res) => {
  50. that.setData({
  51. registrationStatusOptions:res.data,
  52. })
  53. }
  54. })
  55. UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'enterprise_type', {method:'GET'}, {
  56. success: (res) => {
  57. that.setData({
  58. enterpriseTypeOptions:res.data,
  59. })
  60. }
  61. })
  62. UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'Industrial_classification_type', {method:'GET'}, {
  63. success: (res) => {
  64. that.setData({
  65. industryClassificationTypeOptions:res.data,
  66. })
  67. }
  68. })
  69. UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'sys_yes_no', {method:'GET'}, {
  70. success: (res) => {
  71. that.setData({
  72. reviewStatusOptions:res.data,
  73. })
  74. }
  75. })
  76. let data = {
  77. method: 'GET'
  78. }
  79. UTIL.httpRequest(API.URL_GET_ENTITYDETAIL + options.id ,data,{
  80. success: (res) => {
  81. if (res.code == API.SUCCESS_CODE) {
  82. res.data.statisticsTypeIdText = UTIL.getTransform(res.data.statisticsTypeId,that.data.statisticsTypeIdOptions);
  83. res.data.industryClassificationTypeText = UTIL.getTransform(res.data.industryClassificationType,that.data.industryClassificationTypeOptions);
  84. res.data.modelSocietyTypeText = UTIL.getTransform(res.data.modelSocietyType,that.data.modelSocietyTypeOptions);
  85. res.data.registrationStatusText = UTIL.getTransform(res.data.registrationStatus,that.data.registrationStatusOptions);
  86. res.data.enterpriseTypeText = UTIL.getTransform(res.data.enterpriseType,that.data.enterpriseTypeOptions);
  87. UTIL.httpRequest('/system/dept/treeselectByDeptId', {deptId: res.data.serviceDeptId,method:'GET'}, {
  88. success: (res2) => {
  89. res.data.serviceDeptIdName = res2.data[0].label;
  90. }
  91. })
  92. let fileList = res.data.masterMap.split(',');
  93. let fileImg = []
  94. fileList.map((rr,index) => {
  95. fileImg.push({
  96. url: wx.getStorageSync('dressCode') + rr,
  97. name: '图片' + index,
  98. isImage: true,
  99. });
  100. })
  101. res.data.fileImg = fileImg;
  102. console.log(fileImg);
  103. UTIL.httpRequest('/finance/book/list', {deptId: 0,method:'GET'}, {
  104. success: (res2) => {
  105. console.log(res2.rows.filter(function (e) { return e.id == res.data.bookId; })[0]);
  106. res.data.bookName = res2.rows.filter(function (e) { return e.id == res.data.bookId; })[0].bookName;
  107. this.setData({
  108. detail:res.data,
  109. })
  110. }
  111. })
  112. }
  113. }
  114. })
  115. },
  116. /**
  117. * 生命周期函数--监听页面初次渲染完成
  118. */
  119. onReady() {
  120. },
  121. /**
  122. * 生命周期函数--监听页面显示
  123. */
  124. onShow() {
  125. },
  126. /**
  127. * 生命周期函数--监听页面隐藏
  128. */
  129. onHide() {
  130. },
  131. /**
  132. * 生命周期函数--监听页面卸载
  133. */
  134. onUnload() {
  135. },
  136. /**
  137. * 页面相关事件处理函数--监听用户下拉动作
  138. */
  139. onPullDownRefresh() {
  140. },
  141. /**
  142. * 页面上拉触底事件的处理函数
  143. */
  144. onReachBottom() {
  145. },
  146. /**
  147. * 用户点击右上角分享
  148. */
  149. onShareAppMessage() {
  150. }
  151. })