瀏覽代碼

联系人修改

xiaohaizhao 1 年之前
父節點
當前提交
2c6b07ae64

+ 21 - 33
packageA/contacts/detail.js

@@ -6,6 +6,7 @@ Page({
         detail: {},
     },
     onLoad(options) {
+        console.log("options", options)
         options.sys_phonebookid = options.id;
         options.nocache = true;
         this.data.content = options;
@@ -58,23 +59,8 @@ Page({
                 title: res.msg,
                 icon: "none"
             })
-            let ownertable = "sys_phonebook",
-                ownerid = res.data.sys_phonebookid || 0;
-
-            switch (res.data.groupname) {
-                case "客户联系人":
-                    ownertable = "sys_enterprise_contacts";
-                    ownerid = res.data.contactsid || 0;
-                    break;
-                case "项目联系人":
-                    ownertable = "sa_project_contacts"
-                    ownerid = res.data.sa_project_contactsid || 0
-                    break;
-            }
             this.setData({
-                detail: res.data,
-                ownertable,
-                ownerid
+                detail: res.data
             })
             if (this.data.auth.isdatatag) this.getTags()
             if (this.data.auth.isdatateam) this.getGroup()
@@ -101,8 +87,8 @@ Page({
             case "更换负责人":
                 wx.navigateTo({
                     url: `/pages/group/select?data=${JSON.stringify({
-                                             ownertable:this.data.ownertable,
-                                             ownerid:this.data.ownerid,
+                                             ownertable:'sys_phonebook',
+                                             ownerid:this.data.detail.sys_phonebookid,
                                         })}&radio=true&principal=true`,
                 })
                 break;
@@ -135,7 +121,6 @@ Page({
     /* 删除 */
     deleteData() {
         const contacts = this.data.detail;
-        console.log(contacts.groupname == '项目联系人' ? '20221111130904' : contacts.groupname == '客户联系人' ? "20221018145502" : "20220831164703")
         wx.showModal({
             title: "提示",
             content: `是否确认删除${contacts.name ||contacts.NAME}`,
@@ -143,13 +128,10 @@ Page({
                 confirm
             }) {
                 if (confirm) _Http.basic({
-                    "id": contacts.groupname == '项目联系人' ? '20221111130904' : contacts.groupname == '客户联系人' ? "20221018145502" : "20220831164703",
+                    "id": "20220831164703",
                     "version": 1,
                     "content": {
-                        "sys_phonebookid": contacts.sys_phonebookid,
-                        "sa_project_contactsids": [contacts.sa_project_contactsid],
-                        "contactsid": contacts.contactsid,
-                        "sys_enterpriseid": contacts.sys_enterpriseid
+                        "sys_phonebookid": contacts.sys_phonebookid
                     }
                 }).then(res => {
                     console.log("删除", res)
@@ -178,12 +160,12 @@ Page({
             }],
             editdataleader = isLeader;
         if (!isLeader) {
-            let res = await getApp().agentOrNot(this.data.ownertable, this.data.ownerid),
+            let res = await getApp().agentOrNot('sys_phonebook', this.data.detail.sys_phonebookid),
                 data = res.msg == '成功' ? res.data : {
                     editable: 0,
                     editdataleader: 0
                 }
-            if (this.data.appAuth.isdatateam) isLeader = this.selectComponent("#Group").data.editable == 1;
+            if (this.data.auth.isdatateam) isLeader = this.selectComponent("#Group").data.editable == 1;
             if (!isLeader) isLeader = data.editable == 1;
             editdataleader = data.editdataleader;
         }
@@ -196,7 +178,7 @@ Page({
             label: "更换负责人"
         })
         if (!isLeader) {
-            let s = await getApp().agentOrNot(this.data.ownertable, this.data.ownerid);
+            let s = await getApp().agentOrNot('sys_phonebook', this.data.detail.sys_phonebookid);
             isLeader = s.data.editable == 1;
         }
         if (isLeader) tabbarList = tabbarList.concat({
@@ -219,6 +201,9 @@ Page({
             }, {
                 label: "联系方式",
                 value: item.phonenumber || item.telephone || '--'
+            }, {
+                label: "分级",
+                value: item.grade || '--'
             }, {
                 label: "性别",
                 value: item.sex || '--'
@@ -249,6 +234,12 @@ Page({
             }, {
                 label: "群组",
                 value: item.groupname || '--'
+            }, {
+                label: "偏好",
+                value: item.preference || '--'
+            }, {
+                label: "爱好",
+                value: item.hobby || '--'
             }, {
                 label: "备注",
                 value: item.remarks || '--'
@@ -307,10 +298,7 @@ Page({
                     pageNumber,
                     pageTotal
                 } = Component.data.content,
-                id = this.data.ownerid;
-            if (model == '#Client') id = this.data.detail.sys_enterpriseid || 0;
-            if (model == '#Project') id = this.data.detail.sa_projectid || 0;
-
+                id = this.data.detail.sys_phonebookid;
             if (total == null || init) {
                 Component.getList(id, init);
             } else if (pageNumber <= pageTotal) {
@@ -336,8 +324,8 @@ Page({
                         _Http.basic({
                             "id": 20220930103701,
                             "content": {
-                                ownertable: that.data.ownertable,
-                                ownerid: that.data.ownerid,
+                                ownertable: 'sys_phonebook',
+                                ownerid: that.data.detail.sys_phonebookid,
                                 userid: arr[0],
                                 isaddoldleader: s.confirm ? 1 : 0
                             }

+ 7 - 6
packageA/contacts/detail.wxml

@@ -6,14 +6,15 @@
         <view class="content">
             <view class="name">{{detail.NAME||detail.name}}</view>
             <view class="tag-box" wx:if="{{auth.isdatatag}}">
-                <Yl-tags id="Tags" add='{{isLeader}}' ownertable='{{ownertable=="sys_enterprise_contacts"?"plm_unit":ownertable}}' ownerid='{{ownerid}}' />
+                <Yl-tags id="Tags" add='{{isLeader}}' ownertable='sys_phonebook' ownerid='{{detail.sys_phonebookid}}' />
             </view>
         </view>
     </view>
     <view class="exp">联系方式:{{detail.phonenumber || detail.telephone||'--'}}</view>
+    <view class="exp">分级:{{detail.grade||'--'}}</view>
     <view class="exp">群组:{{detail.groupname||'--'}}</view>
     <view class="exp">最近跟进时间:{{detail.followupdate||'--'}}</view>
-    <Yl-group id='Group' wx:if="{{auth.isdatateam}}" slot='bottom' add='{{true}}' ownertable='{{ownertable}}' ownerid='{{ownerid}}' />
+    <Yl-group id='Group' wx:if="{{auth.isdatateam}}" slot='bottom' add='{{true}}' ownertable='sys_phonebook' ownerid='{{detail.sys_phonebookid}}' />
 </view>
 
 <!-- 功能 -->
@@ -21,10 +22,10 @@
     <Preview slot='详细信息' list1='{{list1}}' list2='{{list2}}' />
     <Project slot='关联项目' id="Project" />
     <Client slot='关联客户' id="Client" />
-    <Trace slot='跟进动态' id='Trace' ownertable='{{ownertable}}' ownerid='{{ownerid}}' />
-    <Work slot='任务' id='Work' ownertable='{{ownertable}}' ownerid='{{ownerid}}' disabled="{{true}}" />
-    <Record slot='操作记录' id="Record" ownertable='{{ownertable}}' ownerid='{{ownerid}}' />
-    <Files slot='附件' id="Files" ownertable='{{ownertable}}' ownerid='{{ownerid}}' />
+    <Trace slot='跟进动态' id='Trace' ownertable='sys_phonebook' ownerid='{{detail.sys_phonebookid}}' />
+    <Work slot='任务' id='Work' ownertable='sys_phonebook' ownerid='{{detail.sys_phonebookid}}' disabled="{{true}}" />
+    <Record slot='操作记录' id="Record" ownertable='sys_phonebook' ownerid='{{detail.sys_phonebookid}}' />
+    <Files slot='附件' id="Files" ownertable='sys_phonebook' ownerid='{{detail.sys_phonebookid}}' />
     <view style="height: 140rpx;" />
 </Yl_FunTabs>
 

+ 19 - 1
packageA/contacts/insert.js

@@ -141,6 +141,24 @@ Page({
             required: false,
             checking: "base",
             interrupt: false
+        }, {
+            label: "偏好",
+            error: false,
+            errMsg: "",
+            type: "text",
+            value: "",
+            valueName: "preference",
+            required: false,
+            checking: "base"
+        }, {
+            label: "爱好",
+            error: false,
+            errMsg: "",
+            type: "text",
+            value: "",
+            valueName: "hobby",
+            required: false,
+            checking: "base"
         }, {
             label: "备注",
             error: false,
@@ -301,7 +319,7 @@ Page({
                 form
             })
         } else if (data.label == '群组') {
-            console.log(data,form)
+            console.log(data, form)
         }
     },
     /* 表单是否填写完成 */

+ 1 - 0
packageA/contacts/insert.scss

@@ -11,6 +11,7 @@
     background: #FFFFFF;
     box-shadow: 0px -4rpx 16rpx 2rpx rgba(150, 157, 165, 0.16);
     bottom: 0;
+    z-index: 999999999;
 
     .but {
         width: 156rpx;

+ 1 - 1
packageA/contacts/modules/client/index.js

@@ -16,7 +16,7 @@ Component({
         getList(id, init = false) {
             if (id == 0) return;
             let content = this.data.content;
-            content.sys_enterpriseid = id;
+            content.sys_phonebookid = id;
             if (init) content.pageNumber = 1
             _Http.basic({
                 id: "20231215134204",

+ 5 - 4
packageA/contacts/modules/list/index.js

@@ -110,11 +110,11 @@ Component({
         toDetail(e) {
             let {
                 sys_phonebookid,
-                sa_project_contactsid,
-                contactsid,
+                groupname
             } = e.currentTarget.dataset.item;
+            console.log("groupname", groupname)
             wx.navigateTo({
-                url: `/packageA/contacts/detail?id=${sys_phonebookid||0}&sa_project_contactsid=${sa_project_contactsid||0}&contactsid=${contactsid||0}`,
+                url: `/packageA/contacts/detail?id=${sys_phonebookid||0}&groupname=${groupname||'默认分组'}`,
             });
             this.updateList()
         },
@@ -130,7 +130,8 @@ Component({
                 }).then(res => {
                     console.log("更新联系人列表", res)
                     this.setData({
-                        list: res.data
+                        list: res.data,
+                        total: res.total
                     })
                 })
             }

+ 1 - 1
packageA/contacts/modules/project/index.js

@@ -16,7 +16,7 @@ Component({
         getList(id, init = false) {
             if (id == 0) return;
             let content = this.data.content;
-            content.sa_projectid = id;
+            content.sys_phonebookid = id;
             if (init) content.pageNumber = 1
             _Http.basic({
                 id: "20231215134304",

+ 20 - 0
packageA/project/modules/contacts/add/index.js

@@ -132,6 +132,26 @@ Page({
             valueName: "address",
             required: false,
             checking: "base"
+        }, {
+            label: "偏好",
+            error: false,
+            errMsg: "",
+            type: "textarea",
+            value: "",
+            placeholder: "请填写",
+            valueName: "preference",
+            required: false,
+            checking: "base"
+        }, {
+            label: "爱好",
+            error: false,
+            errMsg: "",
+            type: "textarea",
+            value: "",
+            placeholder: "请填写",
+            valueName: "hobby",
+            required: false,
+            checking: "base"
         }, {
             label: "备注",
             error: false,

+ 1 - 1
packageA/project/modules/contacts/list/index.wxml

@@ -1,5 +1,5 @@
 <view class="item" wx:for="{{list}}" wx:key="changeuserid">
-    <navigator url="/packageA/contacts/detail?id=0&contactsid={{item.contactsid}}&sa_project_contactsid={{item.sa_project_contactsid}}" class="content">
+    <navigator url="/packageA/contacts/detail?id={{item.sys_phonebookid}}&groupname=项目联系人" class="content">
         <view class="user">
             <view class="portrait">
                 {{item.name[0]}}

+ 18 - 0
packageA/setclient/modules/contacts/add/index.js

@@ -120,6 +120,24 @@ Page({
             valueName: "address",
             required: false,
             checking: "base"
+        }, {
+            label: "偏好",
+            error: false,
+            errMsg: "",
+            type: "textarea",
+            value: "",
+            placeholder: "请填写",
+            valueName: "preference",
+            required: false
+        }, {
+            label: "爱好",
+            error: false,
+            errMsg: "",
+            type: "textarea",
+            value: "",
+            placeholder: "请填写",
+            valueName: "hobby",
+            required: false
         }, {
             label: "备注",
             error: false,

+ 5 - 9
packageA/setclient/modules/contacts/list/index.js

@@ -21,7 +21,11 @@ Component({
         },
         sa_customersid: {
             type: String
-        }
+        },
+        groupname: {
+            type: String,
+            value: "客户联系人"
+        },
     },
     data: {},
     methods: {
@@ -85,13 +89,5 @@ Component({
                     break;
             }
         },
-        toDetail(e) {
-            const {
-                item
-            } = e.currentTarget.dataset;
-            wx.navigateTo({
-                url: '/packageA/contacts/detail?id=0&contactsid=' + item.contactsid + "&sa_project_contactsid=0"
-            })
-        },
     }
 })

+ 1 - 1
packageA/setclient/modules/contacts/list/index.wxml

@@ -1,5 +1,5 @@
 <view class="item" wx:for="{{list}}" wx:key="changeuserid">
-    <navigator url="#" class="content" data-item="{{item}}" bindtap="toDetail">
+    <navigator url="/packageA/contacts/detail?id={{item.sys_phonebookid}}&groupname=客户联系人" class="content">
         <view class="user">
             <view class="portrait">
                 {{item.name[0]}}

+ 14 - 0
project.private.config.json

@@ -8,6 +8,20 @@
     "condition": {
         "miniprogram": {
             "list": [
+                {
+                    "name": "我的客户详情",
+                    "pathName": "packageA/setclient/detail",
+                    "query": "id=4465",
+                    "launchMode": "default",
+                    "scene": null
+                },
+                {
+                    "name": "lxr",
+                    "pathName": "packageA/contacts/index",
+                    "query": "",
+                    "launchMode": "default",
+                    "scene": null
+                },
                 {
                     "name": "项目详情",
                     "pathName": "packageA/project/detail",