index.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. const _Http = getApp().globalData.http;
  2. Component({
  3. properties: {
  4. sa_projectid: String,
  5. disabled: Boolean
  6. },
  7. data: {
  8. typeShow: false,
  9. typeList: [{
  10. name: '项目协议',
  11. route: 'type2'
  12. }, {
  13. name: '居间协议',
  14. route: 'type4'
  15. }],
  16. "sa_projectid": 1,
  17. "content": {
  18. "nocache": true,
  19. "sa_projectid": 1,
  20. pageNumbe: 1,
  21. pageTotal: 1,
  22. total: null,
  23. "where": {
  24. "conditino": ""
  25. }
  26. }
  27. },
  28. methods: {
  29. /* 获取地址列表 */
  30. getList(id, init) {
  31. let content = this.data.content;
  32. content.sa_projectid = id;
  33. if (init) content.pageNumber = 1
  34. _Http.basic({
  35. "id": "20221223102102",
  36. content
  37. }).then(res => {
  38. console.log("关联联系人列表", res)
  39. if (res.msg != '成功') return wx.showToast({
  40. title: res.data,
  41. icon: "none"
  42. })
  43. this.setData({
  44. list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data),
  45. "content.pageNumber": res.pageNumber + 1,
  46. "content.pageSize": res.pageSize,
  47. "content.pageTotal": res.pageTotal,
  48. "content.sa_projectid": id,
  49. "content.total": res.total,
  50. sa_projectid: id,
  51. })
  52. })
  53. },
  54. /* 修改总数 */
  55. changeTotal() {
  56. this.setData({
  57. "content.total": this.data.content.total - 1
  58. })
  59. },
  60. /* 去添加 */
  61. openType() {
  62. this.setData({
  63. typeShow: true
  64. })
  65. },
  66. typeCancel() {
  67. this.setData({
  68. typeShow: false
  69. })
  70. },
  71. /* 选择添加报价形式 */
  72. typeSelect({
  73. detail
  74. }) {
  75. let type = 'type4';
  76. let page = getCurrentPages()[getCurrentPages().length - 1];
  77. if (detail.name != '居间协议') type = page.selectComponent("#Tags").data.systemtag.some(v => v == '直销') ? 'type3' : 'type2';
  78. wx.navigateTo({
  79. url: `/packageA/contract/add/${type}/index?project=${JSON.stringify(page.data.detail)}`,
  80. })
  81. this.typeCancel();
  82. },
  83. }
  84. })