index.js 2.2 KB

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