| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- const _Http = getApp().globalData.http;
- Component({
- properties: {
- disabled: Boolean
- },
- 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() {
- wx.navigateTo({
- url: '/packageA/select/setclient/select?params=' + JSON.stringify({
- "content": {
- "isExport": false,
- "where": {
- "condition": "",
- "tablefilter": {},
- "sa_projectid": this.data.sa_projectid
- }
- },
- "id": 20221018164302,
- }) + '&radio=true&idname=sa_competitorid',
- });
- getApp().globalData.handleSelect = this.handleSelect.bind(this);
- },
- handleSelect({item}) {
- let that = this;
- wx.showModal({
- title: '提示',
- content: `是否添加"${item.enterprisename}"为竞争对手`,
- complete: ({
- confirm
- }) => {
- if (confirm) _Http.basic({
- "id": 20221019165802,
- "content": {
- sa_project_competeid: 0,
- "sa_projectid": that.data.sa_projectid, //工程项目表ID
- "sa_competitorid":item.sa_competitorid, //竞争对手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
- })
- }
- }
- })
|