index.js 2.1 KB

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