index.js 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. const _Http = getApp().globalData.http;
  2. Component({
  3. properties: {
  4. disabled: Boolean
  5. },
  6. data: {
  7. list: [],
  8. sys_enterpriseid: "",
  9. "content": {
  10. "version": 1,
  11. "nocache": true,
  12. "pageNumber": 1,
  13. "pageTotal": 1,
  14. "total": null,
  15. "type": 1,
  16. "where": {
  17. "condition": ""
  18. }
  19. }
  20. },
  21. methods: {
  22. getList(id, init) {
  23. let content = this.data.content;
  24. content.sys_enterpriseid = id;
  25. if (init) content.pageNumber = 1
  26. _Http.basic({
  27. "id": "20221018102103",
  28. content
  29. }).then(res => {
  30. console.log("报价单", res)
  31. if (res.msg != '成功') return wx.showToast({
  32. title: res.data,
  33. icon: "none"
  34. })
  35. this.setData({
  36. list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data),
  37. "content.pageNumber": res.pageNumber + 1,
  38. "content.pageSize": res.pageSize,
  39. "content.pageTotal": res.pageTotal,
  40. "content.total": res.total,
  41. sys_enterpriseid: id
  42. });
  43. })
  44. },
  45. addOffers() {
  46. const {
  47. enterprisename,
  48. sys_enterpriseid
  49. } = getCurrentPages().find(v => ['packageA/setclient/detail', 'packageA/publicCustomer/detail'].includes(v.__route__)).data.detail;
  50. wx.navigateTo({
  51. url: `/packageA/offers/addSetclientOffer?data=${JSON.stringify({
  52. sys_enterpriseid:[enterprisename,[sys_enterpriseid]]
  53. })}`,
  54. })
  55. },
  56. /* 修改总数 */
  57. changeTotal() {
  58. this.setData({
  59. "content.total": this.data.content.total - 1
  60. })
  61. }
  62. }
  63. })