index.js 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. const _Http = getApp().globalData.http;
  2. Component({
  3. properties: {
  4. disabled: {
  5. type: Boolean
  6. },
  7. path: {
  8. type: String
  9. },
  10. enterprisename: {
  11. type: String
  12. },
  13. sa_customersid: {
  14. type: String
  15. }
  16. },
  17. data: {
  18. list: [],
  19. sys_enterpriseid: "",
  20. content: {
  21. "nacache": true,
  22. "pageNumber": 1,
  23. "pageSize": 10,
  24. "pageTotal": 1,
  25. "total": null,
  26. "where": {
  27. "condition": "",
  28. "workaddress": 0
  29. }
  30. },
  31. },
  32. methods: {
  33. getList(id, init) {
  34. let content = this.data.content;
  35. content.sys_enterpriseid = id;
  36. if (init) content.pageNumber = 1;
  37. console.log(content)
  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. })
  56. },
  57. toSearch() {
  58. wx.navigateTo({
  59. url: '/packageA/setclient/modules/contacts/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": 0
  69. }
  70. }),
  71. })
  72. },
  73. /* 修改总数 */
  74. changeTotal() {
  75. this.setData({
  76. "content.total": this.data.content.total - 1
  77. })
  78. }
  79. }
  80. })