Explorar el Código

客户联系人

zhaoxiaohai hace 2 años
padre
commit
59a2abf762

+ 23 - 1
packageA/setclient/modules/contacts/add/index.js

@@ -1,6 +1,7 @@
 const _Http = getApp().globalData.http;
 Page({
     data: {
+        sys_phonebookid: null, //是否为快捷选择创建的账号
         fromShowAll: true,
         form: [{
             label: "姓名",
@@ -119,7 +120,7 @@ Page({
             let item = JSON.parse(options.data),
                 form = this.data.form.map(v => {
                     if (v.valueName == 'region') {
-                        v.value = [item.province, item.city, item.county]
+                        v.value = item.province ? [item.province, item.city, item.county] : []
                     } else {
                         v.value = Object.hasOwn(item, v.valueName) ? item[v.valueName] : v.value;
                     }
@@ -129,6 +130,9 @@ Page({
                 form,
                 "disabled": false,
                 "content.contactsid": item.contactsid
+            });
+            if (item.sys_phonebookid) this.setData({
+                sys_phonebookid: item.sys_phonebookid
             })
         };
     },
@@ -142,8 +146,26 @@ Page({
             "province": data.region[0] || "",
             "city": data.region[1] || "",
             "county": data.region[2] || "",
+            sys_phonebookid: ""
         };
         delete(content.region);
+        if (this.data.sys_phonebookid == null) {
+            this.handleSubmit(content);
+        } else {
+            let that = this;
+            wx.showModal({
+                title: '提示',
+                content: '是否删除原通讯录联系人信息',
+                complete({
+                    confirm
+                }) {
+                    content.sys_phonebookid = confirm ? that.data.sys_phonebookid : "";
+                    that.handleSubmit(content);
+                }
+            })
+        }
+    },
+    handleSubmit(content) {
         _Http.basic({
             "id": "20221018141802",
             content

+ 5 - 14
packageA/setclient/modules/contacts/detail/index.js

@@ -10,9 +10,6 @@ Page({
         }, {
             label: "跟进动态",
             num: 132
-        }, {
-            label: "地址",
-            num: 132
         }],
     },
     onLoad(options) {
@@ -36,18 +33,15 @@ Page({
             this.setData({
                 detail: item,
                 briefs: [{
+                    label: "单位",
+                    value: item.enterprisename
+                }, {
                     label: "手机号码",
                     value: item.phonenumber
-                }, {
-                    label: "性别",
-                    value: item.sex
-                }, {
-                    label: "生日",
-                    value: item.birthday
-                }, {
+                }/* , {
                     label: "最近跟进时间",
                     value: ""
-                }],
+                } */],
                 list1: [{
                     label: "手机号码",
                     value: item.phonenumber
@@ -91,9 +85,6 @@ Page({
             case "跟进动态":
                 model = "#Trace"
                 break;
-            case "地址":
-                model = "#Address"
-                break;
         };
         if (model) {
             // 确定好模块ID total = null 是第一次加载 加载数据

+ 0 - 2
packageA/setclient/modules/contacts/detail/index.json

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

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

@@ -21,8 +21,10 @@
 <view style="height: 20rpx;" />
 <!-- 功能 -->
 <Yl_FunTabs list='{{tabsList}}' active='{{tabsActive}}' bind:onChenge="tabsChange">
-    <Preview slot='详细信息' list1='{{list1}}' list2='{{list2}}' />
+    <view slot='详细信息'>
+        <Yl_Headline title='基本信息' type='switch' switchLabel='仅显示已填信息' switch='{{showAll}}' bind:callBack='onChange' />
+        <Yl_ReportForms showAll='{{!showAll}}' list='{{list1}}' />
+    </view>
     <Trace slot='跟进动态' id='Trace' ownertable='sys_enterprise_contacts' ownerid='{{detail.contactsid}}' />
-    <Address slot='地址' id='Address' />
     <view style="height: 140rpx;" />
 </Yl_FunTabs>

+ 3 - 0
packageA/setclient/modules/contacts/index.js

@@ -3,6 +3,7 @@ Component({
     properties: {},
     data: {
         list: [],
+        sys_enterpriseid: "",
         content: {
             "nacache": true,
             "pageNumber": 1,
@@ -19,6 +20,7 @@ Component({
         getList(id, init) {
             let content = this.data.content;
             content.sys_enterpriseid = id;
+            console.log("id",id)
             if (init) {
                 content.pageNumber = 1
                 content.pageTotal = 1
@@ -42,6 +44,7 @@ Component({
                 })
             })
         },
+        /* 修改总数 */
         changeTotal() {
             this.setData({
                 "content.total": this.data.content.total - 1

+ 2 - 2
packageA/setclient/modules/contacts/index.wxml

@@ -6,10 +6,10 @@
         <navigator url="#" class="but">
             <van-icon name="search" />
         </navigator>
-        <navigator url="/packageA/setclient/modules/contacts/add/index?sys_enterpriseid={{sys_enterpriseid}}" class="but">
+        <navigator url="/packageA/setclient/modules/contacts/quickly/index?sys_enterpriseid={{sys_enterpriseid}}" class="but">
             <van-icon name="plus" />
         </navigator>
     </view>
 </view>
 
-<list list='{{list}}' contactsid='{{item.contactsid}}' sys_enterpriseid='{{item.sys_enterpriseid}}' bindchangeTotal="changeTotal" />
+<list list='{{list}}' bindchangeTotal="changeTotal" />

+ 0 - 2
packageA/setclient/modules/contacts/list/index.js

@@ -5,8 +5,6 @@ Component({
     },
     properties: {
         list: Array,
-        contactsid: String,
-        sys_enterpriseid: String,
         changeTotal: Function
     },
     data: {},