qiyemore.js 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. // pages/qiyemore/qiyemore.js
  2. import http from '../../base/httputil'
  3. const app = getApp()
  4. Page({
  5. onLoad() {
  6. // console.log("@@","load")
  7. //this.getLocation()
  8. },
  9. /**
  10. * 页面的初始数据
  11. */
  12. data: {
  13. host: app.globalData.host,
  14. longitude: Number,
  15. form: {
  16. longitude: Number,
  17. latitude: Number,
  18. businessName: null,
  19. orgCode: null,
  20. qrCode:null,
  21. officeAddress: null,
  22. businessAddress: null,
  23. supervisor: null,
  24. tradeDept: null,
  25. deptId: null,
  26. mainPerson: null,
  27. mainPersonPhone: null,
  28. headSecurity: null,
  29. headSecurityPhone: null,
  30. }
  31. },
  32. //-------------------------------表单数据绑定方法---------------------------------------
  33. get_businessName(e) {
  34. this.data.form.businessName = e.detail.value
  35. },
  36. get_orgCode(e) {
  37. this.data.form.orgCode = e.detail.value
  38. },
  39. get_qrCode(e) {
  40. this.data.form.qrCode = e.detail.value
  41. },
  42. get_officeAddress(e) {
  43. this.data.form.officeAddress = e.detail.value
  44. },
  45. get_businessAddress(e) {
  46. this.data.form.businessAddress = e.detail.value
  47. },
  48. get_supervisor(e) {
  49. this.data.form.supervisor = e.detail.value
  50. },
  51. get_tradeDept(e) {
  52. this.data.form.tradeDept = e.detail.value
  53. },
  54. get_mainPerson(e) {
  55. this.data.form.mainPerson = e.detail.value
  56. },
  57. get_mainPersonPhone(e) {
  58. this.data.form.mainPersonPhone = e.detail.value
  59. },
  60. get_headSecurity(e) {
  61. this.data.form.headSecurity = e.detail.value
  62. },
  63. headSecurityPhone(e) {
  64. this.data.form.headSecurityPhone = e.detail.value
  65. },
  66. //----------------------------------------------------------------------------
  67. saoyisao(){
  68. wx.scanCode({
  69. onlyFromCamera: true,
  70. success: (res) => {
  71. console.log("$$$",res);
  72. //this.data.form.qrCode=res.result
  73. this.setData({
  74. ['form.qrCode']: res.result
  75. })
  76. },
  77. fail: (res) => {
  78. wx.showToast({
  79. title: '扫描失败请手动输入',
  80. icon:'none'
  81. })
  82. }
  83. })
  84. },
  85. addEnterprise(e) {
  86. console.log("###1",this.data.form.qrCode)
  87. let obj = new Object()
  88. obj.enterpriseCode=this.data.form.qrCode
  89. obj.latitude = this.data.form.latitude
  90. obj.longitude = this.data.form.longitude
  91. obj.businessName = this.data.form.businessName
  92. obj.orgCode = this.data.form.orgCode
  93. obj.officeAddress = this.data.form.officeAddress
  94. obj.businessAddress = this.data.form.businessAddress
  95. obj.supervisor = this.data.form.supervisor
  96. obj.tradeDept = this.data.form.tradeDept
  97. obj.mainPerson = this.data.form.mainPerson
  98. obj.mainPersonPhone = this.data.form.mainPersonPhone
  99. obj.headSecurity = this.data.form.headSecurity
  100. obj.headSecurityPhone = this.data.form.headSecurityPhone
  101. console.log("@@@@",obj)
  102. http.post("/system/AppEnterpriseController/addEnterprise", obj, this.addEnterpriseSuccess)
  103. },
  104. addEnterpriseSuccess(e) {
  105. wx.showToast({
  106. title: e.msg,
  107. icon: "none"
  108. })
  109. if(e.code == 200){
  110. // wx.navigateTo({
  111. // url: '../qiye/qiye',
  112. // })
  113. wx.navigateBack()
  114. }
  115. },
  116. getLocation() {
  117. let that = this
  118. wx.getLocation({
  119. type: 'wgs84', //返回可以用于wx.openLocation的经纬度
  120. success: function (res) {
  121. that.setData({
  122. ['form.longitude']: res.longitude,
  123. ['form.latitude']: res.latitude
  124. })
  125. },
  126. })
  127. },
  128. /**
  129. * 生命周期函数--监听页面加载
  130. */
  131. onLoad(options) {
  132. },
  133. /**
  134. * 生命周期函数--监听页面初次渲染完成
  135. */
  136. onReady() {
  137. },
  138. /**
  139. * 生命周期函数--监听页面显示
  140. */
  141. onShow() {
  142. },
  143. /**
  144. * 生命周期函数--监听页面隐藏
  145. */
  146. onHide() {
  147. },
  148. /**
  149. * 生命周期函数--监听页面卸载
  150. */
  151. onUnload() {
  152. },
  153. /**
  154. * 页面相关事件处理函数--监听用户下拉动作
  155. */
  156. onPullDownRefresh() {
  157. },
  158. /**
  159. * 页面上拉触底事件的处理函数
  160. */
  161. onReachBottom() {
  162. },
  163. /**
  164. * 用户点击右上角分享
  165. */
  166. onShareAppMessage() {
  167. }
  168. })