Parcourir la source

客户与公海客户支持线索

zhaoxiaohai il y a 3 ans
Parent
commit
71779ea13c

+ 8 - 1
packageA/publicCustomer/detail.js

@@ -8,6 +8,9 @@ Page({
         tabsList: [{
         tabsList: [{
             label: "详细信息",
             label: "详细信息",
             num: 132
             num: 132
+        }, {
+            label: "线索",
+            num: 132
         }, {
         }, {
             label: "跟进动态",
             label: "跟进动态",
             num: 132
             num: 132
@@ -346,13 +349,17 @@ Page({
     },
     },
     //局部数据更新 tabs
     //局部数据更新 tabs
     partialRenewal(init = false) {
     partialRenewal(init = false) {
-        const id = this.data.detail.sys_enterpriseid;
+        let id = this.data.detail.sys_enterpriseid;
         let model = '';
         let model = '';
         let name = this.data.tabsList[this.data.tabsActive].label;
         let name = this.data.tabsList[this.data.tabsActive].label;
         switch (name) {
         switch (name) {
             case "跟进动态":
             case "跟进动态":
                 model = "#Trace"
                 model = "#Trace"
                 break;
                 break;
+            case "线索":
+                id = this.data.detail.sa_customersid;
+                model = "#Clue"
+                break;
             case "客户地址":
             case "客户地址":
                 model = "#Address"
                 model = "#Address"
                 break;
                 break;

+ 2 - 1
packageA/publicCustomer/detail.json

@@ -6,7 +6,8 @@
         "Address": "../setclient/modules/address/index",
         "Address": "../setclient/modules/address/index",
         "Contacts": "../setclient/modules/contacts/index",
         "Contacts": "../setclient/modules/contacts/index",
         "Financing": "../setclient/modules/financing/index",
         "Financing": "../setclient/modules/financing/index",
-        "Offers": "../setclient/modules/offers/index"
+        "Offers": "../setclient/modules/offers/index",
+        "Clue": "../setclient/modules/clue/index"
     },
     },
     "navigationBarTitleText": "客户详情"
     "navigationBarTitleText": "客户详情"
 }
 }

+ 1 - 0
packageA/publicCustomer/detail.wxml

@@ -20,6 +20,7 @@
 <Yl_FunTabs list='{{tabsList}}' active='{{tabsActive}}' bind:onChenge="tabsChange">
 <Yl_FunTabs list='{{tabsList}}' active='{{tabsActive}}' bind:onChenge="tabsChange">
     <Trace slot='跟进动态' id='Trace' ownertable='sa_customers' ownerid='{{detail.sa_customersid}}' />
     <Trace slot='跟进动态' id='Trace' ownertable='sa_customers' ownerid='{{detail.sa_customersid}}' />
     <Preview slot='详细信息' list1='{{list1}}' list2='{{list2}}' />
     <Preview slot='详细信息' list1='{{list1}}' list2='{{list2}}' />
+    <Clue slot='线索' id='Clue' />
     <Address slot='客户地址' id='Address' />
     <Address slot='客户地址' id='Address' />
     <Contacts slot='联系人' id='Contacts' />
     <Contacts slot='联系人' id='Contacts' />
     <Offers slot='报价单' id='Offers' />
     <Offers slot='报价单' id='Offers' />

+ 13 - 14
packageA/saleClue/addClue.js

@@ -77,7 +77,7 @@ Page({
         }],
         }],
         "content": {
         "content": {
             "sat_orderclueid": 0,
             "sat_orderclueid": 0,
-            "enterprisename":"",
+            "enterprisename": "",
             "name": "",
             "name": "",
             "phonenumber": "",
             "phonenumber": "",
             "province": "",
             "province": "",
@@ -86,15 +86,14 @@ Page({
             "address": "",
             "address": "",
             "notes": "",
             "notes": "",
             "cluesource": "",
             "cluesource": "",
-            "sat_orderclueid":0,//活动id,当活动id大于0是默认业务员创建
-            "isprivate":1//0表示公海,1表示私域
+            "sat_orderclueid": 0, //活动id,当活动id大于0是默认业务员创建
+            "isprivate": 1 //0表示公海,1表示私域
         },
         },
         disabled: true
         disabled: true
     },
     },
     onLoad(options) {
     onLoad(options) {
-        if (options.sat_orderclueid) {
-            this.data.form.sat_orderclueid = options.sat_orderclueid
-        }
+        if (options.sat_orderclueid) this.data.content.sat_orderclueid = options.sat_orderclueid;
+        if (options.sa_customersid) this.data.content.sa_customersid = options.sa_customersid; //关联客户ID
         if (options.rowData) {
         if (options.rowData) {
             // wx.setNavigationBarTitle({
             // wx.setNavigationBarTitle({
             //   title: 'title',
             //   title: 'title',
@@ -111,8 +110,9 @@ Page({
                     }
                     }
                     return v
                     return v
                 }),
                 }),
-                'form[0].value':data.enterprisename_customer,
-                'content.sat_orderclueid':data.sat_orderclueid
+                'form[0].value': data.enterprisename_customer,
+                'content.sat_orderclueid': data.sat_orderclueid,
+                'content.sa_customersid': data.sa_customersid
             })
             })
         }
         }
     },
     },
@@ -121,15 +121,13 @@ Page({
             ...this.data.content,
             ...this.data.content,
             ...this.selectComponent("#Form").submit()
             ...this.selectComponent("#Form").submit()
         };
         };
-        content.sat_orderclueid = this.data.content.sat_orderclueid
         if (content.province.length > 0) {
         if (content.province.length > 0) {
             content.city = content.province[1]
             content.city = content.province[1]
             content.county = content.province[2]
             content.county = content.province[2]
             content.province = content.province[0]
             content.province = content.province[0]
         }
         }
-        
         _Http.basic({
         _Http.basic({
-            "id":"20221205162402",
+            "id": "20221205162402",
             content
             content
         }).then(res => {
         }).then(res => {
             console.log("添加线索", res)
             console.log("添加线索", res)
@@ -141,11 +139,12 @@ Page({
             setTimeout(() => {
             setTimeout(() => {
                 wx.navigateBack();
                 wx.navigateBack();
                 getCurrentPages().forEach(v => {
                 getCurrentPages().forEach(v => {
-                    console.log(v,'路径');
-                    if(v.__route__=='packageA/saleClue/detail'){
+                    if (v.__route__ == 'packageA/saleClue/detail') {
                         v.getDetail();
                         v.getDetail();
-                    }else if(v.__route__=='packageA/saleClue/index'){
+                    } else if (v.__route__ == 'packageA/saleClue/index') {
                         v.getList(true);
                         v.getList(true);
+                    } else if (['packageA/setclient/detail', 'packageA/publicCustomer/detail'].includes(v.__route__)) {
+                        v.selectComponent("#Clue").getList(this.data.content.sa_customersid, true)
                     }
                     }
                 })
                 })
             }, 300)
             }, 300)

+ 8 - 1
packageA/setclient/detail.js

@@ -11,6 +11,9 @@ Page({
         }, {
         }, {
             label: "详细信息",
             label: "详细信息",
             num: 132
             num: 132
+        }, {
+            label: "线索",
+            num: 132
         }, {
         }, {
             label: "客户地址",
             label: "客户地址",
             num: 132
             num: 132
@@ -276,13 +279,17 @@ Page({
     },
     },
     //局部数据更新 tabs
     //局部数据更新 tabs
     partialRenewal(init = false) {
     partialRenewal(init = false) {
-        const id = this.data.detail.sys_enterpriseid;
+        let id = this.data.detail.sys_enterpriseid;
         let model = '';
         let model = '';
         let name = this.data.tabsList[this.data.tabsActive].label;
         let name = this.data.tabsList[this.data.tabsActive].label;
         switch (name) {
         switch (name) {
             case "跟进动态":
             case "跟进动态":
                 model = "#Trace"
                 model = "#Trace"
                 break;
                 break;
+            case "线索":
+                id = this.data.detail.sa_customersid;
+                model = "#Clue"
+                break;
             case "客户地址":
             case "客户地址":
                 model = "#Address"
                 model = "#Address"
                 break;
                 break;

+ 2 - 1
packageA/setclient/detail.json

@@ -6,7 +6,8 @@
         "Address": "./modules/address/index",
         "Address": "./modules/address/index",
         "Contacts": "./modules/contacts/index",
         "Contacts": "./modules/contacts/index",
         "Financing": "./modules/financing/index",
         "Financing": "./modules/financing/index",
-        "Offers": "./modules/offers/index"
+        "Offers": "./modules/offers/index",
+        "Clue": "./modules/clue/index"
     },
     },
     "navigationBarTitleText": "客户详情"
     "navigationBarTitleText": "客户详情"
 }
 }

+ 1 - 0
packageA/setclient/detail.wxml

@@ -23,6 +23,7 @@
 <Yl_FunTabs list='{{tabsList}}' active='{{tabsActive}}' bind:onChenge="tabsChange">
 <Yl_FunTabs list='{{tabsList}}' active='{{tabsActive}}' bind:onChenge="tabsChange">
     <Trace slot='跟进动态' id='Trace' ownertable='sa_customers' ownerid='{{detail.sa_customersid}}' />
     <Trace slot='跟进动态' id='Trace' ownertable='sa_customers' ownerid='{{detail.sa_customersid}}' />
     <Preview slot='详细信息' list1='{{list1}}' list2='{{list2}}' />
     <Preview slot='详细信息' list1='{{list1}}' list2='{{list2}}' />
+    <Clue slot='线索' id='Clue' />
     <Address slot='客户地址' id='Address' />
     <Address slot='客户地址' id='Address' />
     <Contacts slot='联系人' id='Contacts' />
     <Contacts slot='联系人' id='Contacts' />
     <Offers slot='报价单' id='Offers' />
     <Offers slot='报价单' id='Offers' />

+ 57 - 0
packageA/setclient/modules/clue/index.js

@@ -0,0 +1,57 @@
+const _Http = getApp().globalData.http;
+Component({
+    properties: {},
+    data: {
+        list: [],
+        sa_customersid: "",
+        content: {
+            "nacache": true,
+            "pageNumber": 1,
+            "pageSize": 10,
+            "pageTotal": 1,
+            "total": null,
+            "where": {
+                "condition": "",
+            }
+        },
+    },
+    methods: {
+        getList(id, init) {
+            let content = this.data.content;
+            content.sa_customersid = id;
+            if (init) {
+                content.pageNumber = 1
+                content.pageTotal = 1
+            }
+            _Http.basic({
+                "id": "20221208163302",
+                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_customersid: id
+                })
+            })
+        },
+        /* 修改总数 */
+        changeTotal() {
+            this.setData({
+                "content.total": this.data.content.total - 1
+            })
+        },
+        toAdd(e) {
+            wx.navigateTo({
+                url: '/packageA/saleClue/addClue?sa_customersid=' + this.data.sa_customersid,
+            });
+        }
+    }
+})

+ 6 - 0
packageA/setclient/modules/clue/index.json

@@ -0,0 +1,6 @@
+{
+    "component": true,
+    "usingComponents": {
+        "list": "../../../saleClue/modules/list/list"
+    }
+}

+ 8 - 0
packageA/setclient/modules/clue/index.scss

@@ -0,0 +1,8 @@
+@import "../address/head.scss";
+
+.exp {
+    margin-top: 8rpx;
+    font-size: 24rpx;
+    font-family: PingFang SC-Regular, PingFang SC;
+    color: #333333;
+}

+ 11 - 0
packageA/setclient/modules/clue/index.wxml

@@ -0,0 +1,11 @@
+<view class="head">
+    <view class="count">
+        总共{{content.total}}个
+    </view>
+    <view class="expand">
+        <navigator url="#" class="but" bindtap="toAdd">
+            <van-icon name="plus" />
+        </navigator>
+    </view>
+</view>
+<list list='{{list}}' />

+ 7 - 0
project.private.config.json

@@ -56,6 +56,13 @@
                     "query": "sa_quotedpriceid=159",
                     "query": "sa_quotedpriceid=159",
                     "launchMode": "default",
                     "launchMode": "default",
                     "scene": null
                     "scene": null
+                },
+                {
+                    "name": "客户详情",
+                    "pathName": "packageA/setclient/detail",
+                    "query": "id=170",
+                    "launchMode": "default",
+                    "scene": null
                 }
                 }
             ]
             ]
         }
         }