const _Http = getApp().globalData.http; Component({ properties: {}, data: { list: [], sa_projectid: "", "content": { "nocache": true, "pageNumber": 1, "pageTotal": 1, "total": null, "type": 1, "where": { "condition": "" } } }, methods: { getList(id, init) { let content = this.data.content; content.sa_projectid = id; if (init) content.pageNumber = 1 _Http.basic({ "id": 20221027165402, content }).then(res => { console.log("项目竞争对手", res) if (res.msg != '成功') return wx.showToast({ title: res.data, icon: "none" }) this.setData({ list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data), "content.pageNumber": res.pageNumber + 1, "content.pageSize": res.pageSize, "content.pageTotal": res.pageTotal, "content.total": res.total, sa_projectid: id }); }) }, add() { console.log(123) wx.navigateTo({ url: '/packageA/select/setclient/select?params=' + JSON.stringify({ "content": { model: "#Opponent", "isExport": false, "pageNumber": 1, "pageSize": 20, "where": { "condition": "", "tablefilter": {}, "sa_projectid": this.data.sa_projectid //不传差全部,传过滤掉对应项目中的数据 } }, "id": 20221018164302, }) + '&radio=true', }) }, handleSelectProject(arr, list) { console.log(arr, list) let that = this; wx.showModal({ title: '提示', content: `是否将"${list[0].enterprisename}"添加到竞争对手`, complete: ({ confirm }) => { if (confirm) _Http.basic({ "id": 20221019165802, "content": { ...list[0], sa_project_competeid: 0, "sa_projectid": that.data.sa_projectid, //工程项目表ID "important": 0, //主要威胁 0/1 } }).then(res => { console.log("添加竞争对手", res) wx.showToast({ title: res.msg == '成功' ? '添加成功' : res.msg, icon: "none" }) if (res.msg == '成功') setTimeout(() => { wx.navigateBack(); that.getList(that.data.sa_projectid, true) }, 300) }) } }) }, /* 修改总数 */ changeTotal() { this.setData({ "content.total": this.data.content.total - 1 }) } } })