qiyemore.js 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  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: '',
  19. orgCode: '',
  20. enterpriseCode:'',
  21. officeAddress: '',
  22. businessAddress: '',
  23. supervisor: '',
  24. tradeDept: '',
  25. deptId: '',
  26. mainPerson: '',
  27. mainPersonPhone: '',
  28. headSecurity: '',
  29. headSecurityPhone: '',
  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.enterpriseCode = 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.enterpriseCode']: 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.enterpriseCode)
  87. console.log("@@@1",this.data)
  88. let obj = new Object()
  89. obj.enterpriseCode=this.data.form.enterpriseCode
  90. obj.latitude = this.data.form.latitude
  91. obj.longitude = this.data.form.longitude
  92. obj.businessName = this.data.form.businessName
  93. obj.orgCode = this.data.form.orgCode
  94. obj.officeAddress = this.data.form.officeAddress
  95. obj.businessAddress = this.data.form.businessAddress
  96. obj.supervisor = this.data.form.supervisor
  97. obj.tradeDept = this.data.form.tradeDept
  98. obj.mainPerson = this.data.form.mainPerson
  99. obj.mainPersonPhone = this.data.form.mainPersonPhone
  100. obj.headSecurity = this.data.form.headSecurity
  101. obj.headSecurityPhone = this.data.form.headSecurityPhone
  102. console.log("@@@@",obj)
  103. http.post("/system/AppEnterpriseController/addEnterprise", obj, this.addEnterpriseSuccess)
  104. },
  105. addEnterpriseSuccess(e) {
  106. wx.showToast({
  107. title: e.msg,
  108. icon: "none"
  109. })
  110. if(e.code == 200){
  111. // wx.navigateTo({
  112. // url: '../qiye/qiye',
  113. // })
  114. wx.navigateBack()
  115. }
  116. },
  117. getLocation() {
  118. let that = this
  119. wx.getLocation({
  120. type: 'wgs84', //返回可以用于wx.openLocation的经纬度
  121. success: function (res) {
  122. that.setData({
  123. ['form.longitude']: res.longitude,
  124. ['form.latitude']: res.latitude
  125. })
  126. },
  127. })
  128. },
  129. /**
  130. * 生命周期函数--监听页面加载
  131. */
  132. onLoad(options) {
  133. },
  134. /**
  135. * 生命周期函数--监听页面初次渲染完成
  136. */
  137. onReady() {
  138. },
  139. /**
  140. * 生命周期函数--监听页面显示
  141. */
  142. onShow() {
  143. },
  144. /**
  145. * 生命周期函数--监听页面隐藏
  146. */
  147. onHide() {
  148. },
  149. /**
  150. * 生命周期函数--监听页面卸载
  151. */
  152. onUnload() {
  153. },
  154. /**
  155. * 页面相关事件处理函数--监听用户下拉动作
  156. */
  157. onPullDownRefresh() {
  158. },
  159. /**
  160. * 页面上拉触底事件的处理函数
  161. */
  162. onReachBottom() {
  163. },
  164. /**
  165. * 用户点击右上角分享
  166. */
  167. onShareAppMessage() {
  168. }
  169. })