|
|
@@ -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
|
|
|
}
|