investigationInfo.js 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. const app = getApp()
  2. const util = require("../../../utils/util");
  3. const api = require('../../../api/api.js');
  4. const user = require('../../../utils/user.js');
  5. import moment from 'moment'
  6. Page({
  7. data: {
  8. backInvestigateState:'',
  9. signPersonState:'',
  10. signPersonUrl:'',
  11. // signTime:'',
  12. },
  13. /**
  14. * 生命周期函数--监听页面加载
  15. */
  16. onLoad: function (options) {
  17. },
  18. onReachBottom() {
  19. },
  20. /**
  21. * 生命周期函数--监听页面初次渲染完成
  22. */
  23. onReady: function () {
  24. },
  25. /**
  26. * 生命周期函数--监听页面显示
  27. */
  28. onShow: function () {
  29. this.getState();
  30. },
  31. getState(){
  32. let userInfo = wx.getStorageSync('userInfo');
  33. wx.showLoading({
  34. title: '加载中...',
  35. });
  36. util.request(api.findInvestigation, {
  37. workerNo:userInfo.workerNo
  38. }, 'GET').then(res=> {
  39. wx.hideLoading();
  40. if (res.errno === 0) {
  41. this.setData({
  42. backInvestigateState:res.data.backInvestigateState,
  43. signPersonState:res.data.signPersonState,
  44. signPersonUrl:res.data.signPersonUrl,
  45. // signTime:moment(res.data.signTime).format('YYYY-MM-DD HH:mm:ss'),
  46. });
  47. console.log(this.data);
  48. }
  49. }).catch(err=>{
  50. });
  51. },
  52. signContract(){
  53. wx.showLoading({
  54. title: '加载中...',
  55. });
  56. let userInfo = wx.getStorageSync('userInfo');
  57. util.request(api.singGerenxinxisouquan, {
  58. workerNo:userInfo.workerNo
  59. }, 'GET').then(res=> {
  60. wx.hideLoading();
  61. if (res.errno === 0) {
  62. this.getSignUrl(res.data);
  63. }else{
  64. wx.showToast({
  65. title: res.errmsg,
  66. icon:'none'
  67. })
  68. }
  69. }).catch(err=>{
  70. });
  71. },
  72. getSignUrl(id){
  73. wx.showLoading({
  74. title: '加载中...',
  75. });
  76. util.request(api.selectContractSignUrl, {
  77. procedureId:id
  78. }, 'GET').then(res=> {
  79. if (res.errno === 0) {
  80. wx.hideLoading();
  81. app.globalData.webViewUrl=res.data;
  82. wx.navigateTo({
  83. url: '/pages/upgrade/webView/webView',
  84. });
  85. }else{
  86. wx.showToast({
  87. title: res.errmsg,
  88. icon:'none'
  89. })
  90. }
  91. }).catch(err=>{
  92. });
  93. },
  94. viewContract(){
  95. app.globalData.webViewUrl=this.data.signPersonUrl;
  96. wx.navigateTo({
  97. url: '/pages/upgrade/webView/webView',
  98. })
  99. },
  100. onHide: function () {
  101. },
  102. onUnload: function () {
  103. },
  104. /**
  105. * 页面相关事件处理函数--监听用户下拉动作
  106. */
  107. onPullDownRefresh: function () {
  108. },
  109. /**
  110. * 页面上拉触底事件的处理函数
  111. */
  112. onReachBottom: function () {
  113. },
  114. /**
  115. * 用户点击右上角分享
  116. */
  117. onShareAppMessage: function () {
  118. },
  119. })