Sfoglia il codice sorgente

疑似重复问题

xiaohaizhao 2 anni fa
parent
commit
7c700c0a7c

+ 18 - 1
packageA/opponent/detail.js

@@ -178,7 +178,7 @@ Page({
                 list2,
                 tabbarList
             });
-/*  */            //获取标签
+            //获取标签
             this.getTags();
             this.partialRenewal();
         });
@@ -249,4 +249,21 @@ Page({
     onReachBottom() {
         this.partialRenewal();
     },
+    onUnload() {
+        const page = getCurrentPages().find(v => v.__route__ == 'packageA/opponent/index');
+        if (!page) return;
+        let content = JSON.parse(JSON.stringify(page.data.content));
+        content.pageSize = (content.pageNumber - 1) * content.pageSize;
+        content.pageNumber = 1;
+        _Http.basic({
+            id: 20221018164302,
+            content
+        }).then(res => {
+            console.log("更新竞争对手列表", res);
+            if (res.msg == '成功') {
+                page.data.content.total = res.total;
+                page.getTags();
+            }
+        })
+    }
 })

+ 34 - 23
packageA/project/detail.js

@@ -432,10 +432,15 @@ Page({
                         title: res.msg,
                         icon: "none"
                     });
-                    if (res.data.length == 0) return wx.showToast({
-                        title: '未查询到重复数据',
-                        icon: "none"
-                    });
+                    if (res.data.length == 0) {
+                        wx.showToast({
+                            title: '未查询到重复数据',
+                            icon: "none"
+                        });
+                        this.getTags()
+                    } else {
+                        this.setTags();
+                    }
                     this.setData({
                         repetitionList: res.data,
                         repetitionShow: true
@@ -475,25 +480,7 @@ Page({
             }) => {
                 if (confirm) {
                     that.onRecover(true)
-                    /* let {
-                        datatag,
-                        systemtag
-                    } = this.selectComponent("#Tags").returnTags();
-                    if (!systemtag.some(v => v == '疑似重复')) {
-                        systemtag.push("疑似重复")
-                        _Http.basic({
-                            "id": 20220929090901,
-                            "content": {
-                                "ownertable": "sa_project",
-                                "ownerid": that.data.sa_projectid,
-                                datatag,
-                                systemtag
-                            }
-                        }).then(res => {
-                            console.log("绑定疑似重复标签", res)
-                            if (res.msg == '成功') that.getTags();
-                        })
-                    } */
+                    that.setTags();
                 }
             }
         });
@@ -502,6 +489,30 @@ Page({
             isRecover: false
         })
     },
+    /* setTags */
+    setTags() {
+        let {
+            datatag,
+            systemtag
+        } = this.selectComponent("#Tags").returnTags();
+        if (!systemtag.some(v => v == '疑似重复')) {
+            systemtag.push("疑似重复")
+            _Http.basic({
+                "id": 20220929090901,
+                "content": {
+                    "ownertable": "sa_project",
+                    "ownerid": this.data.sa_projectid,
+                    datatag,
+                    systemtag
+                }
+            }).then(res => {
+                console.log("绑定疑似重复标签", res)
+                if (res.msg == '成功') this.getTags();
+            })
+        } else {
+            this.getTags();
+        }
+    },
     /* 1提交报备,2报备审核,3报备驳回(退回) */
     handleReport(type) {
         _Http.basic({

+ 6 - 7
packageA/project/modules/contacts/add/index.js

@@ -157,7 +157,6 @@ Page({
         this.data.content.sa_projectid = options.sa_projectid;
         if (options.data) {
             let item = JSON.parse(options.data),
-                disabled = false,
                 arr = item.phonenumber.split("-");
             console.log(item)
             item.sys_enterpriseid = item.enterprisename ? [item.enterprisename, [item.sys_enterpriseid]] : "";
@@ -190,10 +189,10 @@ Page({
                         v.value = Object.hasOwn(item, v.valueName) ? item[v.valueName] : v.value;
                     }
                     return v
-                }),
-                disabled
+                })
             });
             this.data.content = item;
+            this.selectComponent("#Form").confirm();
             if (item.sys_phonebookid) this.setData({
                 sys_phonebookid: item.sys_phonebookid
             })
@@ -302,10 +301,10 @@ Page({
                         "sa_projectid": page.data.sa_projectid,
                         "remarks": ""
                     }
-                }).then(res => {
-                    console.log("项目添加联系人", res)
-                    if (res.msg != '成功') return wx.showToast({
-                        title: res.data,
+                }).then(s => {
+                    console.log("项目添加联系人", s)
+                    if (s.msg != '成功') return wx.showToast({
+                        title: s.data,
                         icon: "none"
                     });
                     wx.showToast({