index.js 1.9 KB

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