index.js 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. const _Http = getApp().globalData.http;
  2. Component({
  3. options: {
  4. addGlobalClass: true
  5. },
  6. data: {
  7. sys_enterpriseid: 0,
  8. list: [],
  9. content: {
  10. "nacache": true,
  11. "pageNumber": 1,
  12. "pageSize": 15,
  13. "pageTotal": 1,
  14. "total": null,
  15. "where": {
  16. "condition": "",
  17. "workaddress": 1
  18. }
  19. }
  20. },
  21. methods: {
  22. changeTotal() {
  23. this.setData({
  24. "content.total": this.data.content.total - 1
  25. })
  26. },
  27. /* 获取地址列表 */
  28. getList(id, init) {
  29. let content = this.data.content;
  30. content.sys_enterpriseid = id;
  31. if (init) {
  32. content.pageNumber = 1
  33. content.pageTotal = 1
  34. }
  35. _Http.basic({
  36. "id": "20221022165503",
  37. content
  38. }).then(res => {
  39. console.log("地址列表", res)
  40. if (res.msg != '成功') return wx.showToast({
  41. title: res.data,
  42. icon: "none"
  43. })
  44. this.setData({
  45. list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data),
  46. "content.pageNumber": res.pageNumber + 1,
  47. "content.pageSize": res.pageSize,
  48. "content.pageTotal": res.pageTotal,
  49. "content.total": res.total,
  50. sys_enterpriseid: id
  51. })
  52. setTimeout(() => {
  53. this.selectComponent("#List").initRadio();
  54. }, 300)
  55. })
  56. },
  57. toSearch() {
  58. wx.navigateTo({
  59. url: '/packageA/setclient/modules/address/search/index?perams=' + JSON.stringify({
  60. sys_enterpriseid: this.data.sys_enterpriseid,
  61. "nacache": true,
  62. "pageNumber": 1,
  63. "pageSize": 20,
  64. "pageTotal": 1,
  65. "total": 0,
  66. "where": {
  67. "condition": "",
  68. "workaddress": 1
  69. }
  70. }),
  71. })
  72. }
  73. }
  74. })