index.js 2.3 KB

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