index.js 2.2 KB

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