index.js 1.9 KB

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