index.js 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. // pages/audit/index/index.js
  2. import {
  3. checkMeeting,
  4. checkMeetingInService,
  5. checkTurnMeeting,
  6. checkContinueMeeting,
  7. appointmentDateRecordList
  8. } from '../../../utils/api/meeting'
  9. Page({
  10. /**
  11. * 页面的初始数据
  12. */
  13. data: {
  14. type: '',
  15. item: {},
  16. form: {
  17. status: 2,
  18. },
  19. statusList: [{
  20. name: '同意',
  21. id: 2
  22. },
  23. {
  24. name: '拒绝',
  25. id: 3
  26. },
  27. ],
  28. },
  29. getValue(e) {
  30. let type = e.currentTarget.dataset.type
  31. this.setData({
  32. [`form.${type}`]: e.detail
  33. });
  34. },
  35. async auditFun() {
  36. let res ={}
  37. let {
  38. type,
  39. item,
  40. form
  41. } = this.data
  42. if (form.status == 3 && !form.refuseReason) {
  43. wx.showToast({
  44. icon: 'none',
  45. title: '请填写完整',
  46. })
  47. return
  48. }
  49. if (type == 'subscribe-audit') {
  50. form.meetingRecordId = item.meetingRecordId
  51. res = await checkMeeting(form)
  52. }
  53. if (type == 'order-audit') {
  54. form.meetingInServiceId = item.meetingInServiceId
  55. res = await checkMeetingInService(form)
  56. }
  57. if (type == 'transfer-audit') {
  58. form.meetingTurnRecordId = item.meetingTurnRecordId
  59. if(form.status==2){
  60. res.code=200
  61. }else{
  62. res = await checkTurnMeeting(form)
  63. }
  64. }
  65. if (type == 'renewalContract-audit') {
  66. form.meetingContinueRecordId = item.meetingContinueRecordId
  67. res = await checkContinueMeeting(form)
  68. }
  69. if (res.code == 200) {
  70. wx.showToast({
  71. title: '操作成功',
  72. icon: 'none',
  73. duration: 800,
  74. mask: true,
  75. success: function () {
  76. if (type == 'transfer-audit' && form.status == 2) {
  77. setTimeout(function () {
  78. item.meetingRecordVo.meetingRoomVo.meetingRoomId = item.meetingRecordVo.meetingRoomId
  79. let itemData = Object.assign(item.meetingRecordVo, item.meetingRecordVo.meetingRoomVo,form)
  80. wx.navigateTo({
  81. url: '/pages/meeting/subscribe/index?type=' + type + '&itemData=' + JSON.stringify(itemData) + '&endDate=' + itemData.appointmentDate + '&subscribeYear=' + itemData.appointmentDate
  82. })
  83. }, 800)
  84. } else {
  85. setTimeout(function () {
  86. wx.navigateBack({
  87. delta: 2,
  88. })
  89. }, 800)
  90. }
  91. }
  92. })
  93. }
  94. },
  95. /**
  96. * 生命周期函数--监听页面加载
  97. */
  98. onLoad(options) {
  99. if (options.item) {
  100. let item = JSON.parse(options.item)
  101. this.setData({
  102. type: options.type,
  103. item,
  104. })
  105. }
  106. },
  107. /**
  108. * 生命周期函数--监听页面初次渲染完成
  109. */
  110. onReady() {
  111. },
  112. /**
  113. * 生命周期函数--监听页面显示
  114. */
  115. onShow() {
  116. },
  117. /**
  118. * 生命周期函数--监听页面隐藏
  119. */
  120. onHide() {
  121. },
  122. /**
  123. * 生命周期函数--监听页面卸载
  124. */
  125. onUnload() {
  126. },
  127. /**
  128. * 页面相关事件处理函数--监听用户下拉动作
  129. */
  130. onPullDownRefresh() {
  131. },
  132. /**
  133. * 页面上拉触底事件的处理函数
  134. */
  135. onReachBottom() {
  136. },
  137. /**
  138. * 用户点击右上角分享
  139. */
  140. onShareAppMessage() {
  141. }
  142. })