index.js 1.5 KB

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