zhaoxiaohai před 3 roky
rodič
revize
202b57700d
2 změnil soubory, kde provedl 110 přidání a 1 odebrání
  1. 6 0
      packageA/publicCustomer/pond/index.js
  2. 104 1
      packageA/setclient/detail.js

+ 6 - 0
packageA/publicCustomer/pond/index.js

@@ -16,6 +16,9 @@ Page({
                 result: item.value.length ? item.value[1] : []
             })
         };
+        if (options.params) this.setData({
+            params: JSON.parse(options.params),
+        })
         this.getList();
     },
     /* 提交 */
@@ -33,6 +36,9 @@ Page({
                 //判断是否上级页面中的组件调用
                 let page = pages[pages.length - 2].selectComponent(this.data.params.model);
                 page.handleSelectContacts(result, list)
+            } else if (this.data.params.name) {
+                let page = pages[pages.length - 2];
+                page.handleTransfer(result, list, this.data.params.name)
             } else {
                 //上级页面调用
                 pages[pages.length - 2].handleSelectContacts(result, list)

+ 104 - 1
packageA/setclient/detail.js

@@ -30,6 +30,15 @@ Page({
         list1: [], //基本信息
         list2: [], //系统信息
         tabbarList: [{
+            icon: "icon-dibu-fenxiang",
+            label: "分享"
+        }, {
+            icon: "icon-dibu-chehui",
+            label: "退回"
+        }, {
+            icon: "icon-dibu-tuihui",
+            label: "回收"
+        }, {
             icon: "icon-genjin",
             label: "跟进"
         }, {
@@ -53,8 +62,70 @@ Page({
     tabbarOnClick({
         detail
     }) {
-        let data = this.data.detail;
+        let data = this.data.detail,
+            that = this;
         switch (detail.label) {
+            case "分享":
+                wx.navigateTo({
+                    url: `/packageA/publicCustomer/pond/index?params=${JSON.stringify({
+                        "id": 20221206195102,
+                        name:"分享",
+                        "content": {
+                            "pageNumber": 1,
+                            "pageSize": 20,
+                            "where": {
+                                "condition": ""
+                            }
+                        }
+                    })}`,
+                })
+                break;
+            case "退回":
+                wx.showModal({
+                    title: '提示',
+                    content: `是否确定将${data.enterprisename}退回到公海客户`,
+                    complete: (res) => {
+                        console.log(data)
+                        if (res.confirm) _Http.basic({
+                            "id": 20221014102602,
+                            "content": {
+                                "sa_customerpoolid": data.sa_customerpoolid_source,
+                                "sa_customersids": [data.sa_customersid]
+                            }
+                        }).then(res => {
+                            console.log("公海线索退回", res)
+                            wx.showToast({
+                                title: res.msg == '成功' ? '退回成功' : res.msg,
+                                icon: "none"
+                            });
+                            if (res.msg == '成功') setTimeout(() => {
+                                let page = getCurrentPages().find(v => v.__route__ == 'packageA/setclient/index');
+                                if (page) page.setData({
+                                    list: page.data.list.filter(v => v.sa_customersid != data.sa_customersid)
+                                });
+                                wx.redirectTo({
+                                    url: '/packageA/publicCustomer/detail?id' + data.sa_customersid,
+                                })
+                            }, 300)
+                        })
+                    }
+                });
+                break;
+            case "回收":
+                wx.navigateTo({
+                    url: `/packageA/publicCustomer/pond/index?params=${JSON.stringify({
+                        "id": 20221206195102,
+                        name:"回收",
+                        "content": {
+                            "pageNumber": 1,
+                            "pageSize": 20,
+                            "where": {
+                                "condition": ""
+                            }
+                        }
+                    })}`,
+                })
+                break;
             case "跟进":
                 wx.navigateTo({
                     url: `/packageA/setclient/modules/trace/add/index?ownertable=sa_customers&ownerid=${data.sa_customersid}`,
@@ -86,6 +157,38 @@ Page({
                 break;
         }
     },
+    handleTransfer(ids, list, name) {
+        console.log(ids, list, name)
+        wx.showModal({
+            title: '提示',
+            content: `是否确定将客户${name}至${list[0].poolname}?`,
+            complete: (res) => {
+                if (res.confirm) _Http.basic({
+                    "id": name == '回收' ? 20221014165602 : 20221014102502,
+                    "content": {
+                        "sa_customerpoolid": ids[0], //公海池id
+                        "sa_customersids": [this.data.detail.sa_customersid]
+                    },
+                }).then(res => {
+                    console.log(name, res)
+                    wx.showToast({
+                        title: res.data == '成功' ? `${name}成功` : res.msg,
+                        icon: "none"
+                    });
+                    if (res.data == '成功') setTimeout(() => {
+                        wx.navigateBack()
+                        let page = getCurrentPages().find(v => v.__route__ == 'packageA/setclient/index');
+                        if (page) page.setData({
+                            list: page.data.list.filter(v => v.sa_customersid != this.data.detail.sa_customersid)
+                        });
+                        wx.redirectTo({
+                            url: '/packageA/publicCustomer/detail?id=' + this.data.detail.sa_customersid,
+                        })
+                    }, 300)
+                })
+            }
+        })
+    },
     /* 更换负责人 */
     handelSubmit(arr) {
         const that = this;