index.js 2.2 KB

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