Ver Fonte

联系人详情

zhaoxiaohai há 3 anos atrás
pai
commit
a2f93ea9ec

+ 49 - 0
packageA/setclient/modules/contacts/detail/index.js

@@ -73,5 +73,54 @@ Page({
             });
         })
     },
+    //tabs 切换
+    tabsChange({
+        detail
+    }) {
+        this.setData({
+            tabsActive: detail
+        });
+        this.partialRenewal();
+    },
+    //局部数据更新 tabs
+    partialRenewal(init = false) {
+        const id = this.data.detail.contactsid;
+        let model = '';
+        let name = this.data.tabsList[this.data.tabsActive].label;
+        switch (name) {
+            case "跟进动态":
+                model = "#Trace"
+                break;
+            case "地址":
+                model = "#Address"
+                break;
+        };
+        if (model) {
+            // 确定好模块ID total = null 是第一次加载 加载数据
+            // init是新增或修改需要清数据
+            let Component = this.selectComponent(model);
+            const {
+                total,
+                pageNumber,
+                pageTotal
+            } = Component.data.content;
+            if (total == null || init) {
+                Component.getList(id, init);
+            } else if (pageNumber <= pageTotal) {
+                Component.getList(id, false);
+            }
+        }
+    },
+    //更新标签
+    getTags() {
+        this.selectComponent("#Tags").getTags();
+    },
+    //更新团队成员
+    getGroup() {
+        this.selectComponent("#Group").getList();
+    },
+    onReachBottom() {
+        this.partialRenewal();
+    },
     onShareAppMessage() {}
 })

+ 3 - 1
packageA/setclient/modules/contacts/detail/index.json

@@ -1,6 +1,8 @@
 {
     "usingComponents": {
-        "Preview": "../../preview/index"
+        "Preview": "../../preview/index",
+        "Address": "../../address/index",
+        "Trace": "../../trace/index"
     },
     "navigationBarTitleText": "联系人详情"
 }

+ 4 - 4
packageA/setclient/modules/contacts/detail/index.wxml

@@ -8,7 +8,7 @@
                 {{detail.name}}
             </view>
             <view class="tag">
-                <Yl-tags id="Tags" add ownertable='sa_customers' ownerid='{{detail.sa_customersid}}' />
+                <Yl-tags id="Tags" add ownertable='sys_enterprise_contacts' ownerid='{{detail.contactsid}}' />
             </view>
         </view>
     </view>
@@ -16,13 +16,13 @@
 <!-- 简介 -->
 <Yl_Detail list="{{briefs}}">
     <!-- 团队管理 -->
-    <Yl-group id='Group' slot='bottom' add ownertable='sa_customers' ownerid='{{detail.sa_customersid}}' />
+    <Yl-group id='Group' slot='bottom' add ownertable='sys_enterprise_contacts' ownerid='{{detail.contactsid}}' />
 </Yl_Detail>
 
 <!-- 功能 -->
 <Yl_FunTabs list='{{tabsList}}' active='{{tabsActive}}' bind:onChenge="tabsChange">
-    <Trace slot='跟进动态' id='Trace' ownertable='sa_customers' ownerid='{{detail.sa_customersid}}' />
     <Preview slot='详细信息' list1='{{list1}}' list2='{{list2}}' />
-    <Address slot='客户地址' id='Address' />
+    <Trace slot='跟进动态' id='Trace' ownertable='sys_enterprise_contacts' ownerid='{{detail.contactsid}}' />
+    <Address slot='地址' id='Address' />
     <view style="height: 140rpx;" />
 </Yl_FunTabs>