index.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. const _Http = getApp().globalData.http;
  2. Component({
  3. properties: {
  4. disabled: {
  5. type: Boolean
  6. }
  7. },
  8. data: {
  9. sys_enterpriseid: 0,
  10. content: {
  11. "nacache": true,
  12. "pageNumber": 1,
  13. "pageSize": 20,
  14. "pageTotal": 1,
  15. "total": null,
  16. "where": {
  17. "condition": ""
  18. }
  19. },
  20. list: []
  21. },
  22. lifetimes: {
  23. attached: function () {
  24. getApp().globalData.Language.getLanguagePackage(this)
  25. }
  26. },
  27. methods: {
  28. changeTotal() {
  29. this.setData({
  30. "content.total": this.data.content.total - 1
  31. })
  32. },
  33. getList(id, init) {
  34. let content = this.data.content;
  35. content.sys_enterpriseid = id;
  36. if (init) {
  37. content.pageNumber = 1
  38. content.pageTotal = 1
  39. }
  40. _Http.basic({
  41. "id": "20230214163402",
  42. content
  43. }).then(res => {
  44. console.log("客户合同信息", res)
  45. if (res.code != '1') return wx.showToast({
  46. title: res.data,
  47. icon: "none"
  48. })
  49. this.setData({
  50. list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data),
  51. "content.pageNumber": res.pageNumber + 1,
  52. "content.pageSize": res.pageSize,
  53. "content.pageTotal": res.pageTotal,
  54. "content.total": res.total,
  55. sys_enterpriseid: id
  56. })
  57. })
  58. }
  59. }
  60. })