Browse Source

通讯录修改

xiaohaizhao 1 năm trước cách đây
mục cha
commit
793ff86ec2

+ 3 - 3
components/Yl_Filtrate1/index.js

@@ -62,9 +62,9 @@ Component({
         periodstart: "",
         periodend: "",
     },
-    lifetimes: {
-        ready() {
-            getHeight('.head', this).then(res => this.setData({
+    observers: {
+        "show"(newVal) {
+            if (newVal) getHeight('.head', this).then(res => this.setData({
                 listHeight: res - this.data.minus
             }));
         }

+ 1 - 1
packageA/contacts/detail.wxml

@@ -13,7 +13,7 @@
     <view class="exp">联系方式:{{detail.phonenumber || detail.telephone||'--'}}</view>
     <view class="exp">群组:{{detail.groupname||'--'}}</view>
     <view class="exp">最近跟进时间:{{detail.followupdate||'--'}}</view>
-    <Yl-group id='Group' slot='bottom' add='{{isLeader}}' ownertable='{{ownertable}}' ownerid='{{ownerid}}' />
+    <Yl-group id='Group' slot='bottom' add='{{true}}' ownertable='{{ownertable}}' ownerid='{{ownerid}}' />
 </view>
 
 <!-- 功能 -->

+ 5 - 1
packageA/contacts/index.js

@@ -2,7 +2,7 @@ const _Http = getApp().globalData.http;
 import Dialog from '@vant/weapp/dialog/dialog';
 Page({
     data: {
-        active: "联系人",
+        active: "群组",
         allGroup: [],
         defaultGroup: [],
         myGroup: [],
@@ -12,6 +12,9 @@ Page({
         }
     },
     onLoad(options) {
+        this.setData({
+            active: "联系人"
+        })
         this.getList(true);
         this.getGroup(true);
         _Http.getGroup = this.getGroup.bind(this);
@@ -110,6 +113,7 @@ Page({
     },
     onChange(e) {
         const active = e.detail.name;
+        if (active == this.data.active) return;
         this.setData({
             active
         });

+ 2 - 2
packageA/contacts/index.scss

@@ -38,14 +38,14 @@ page {
     }
 }
 
-.label {
+.group-label {
     font-size: 30rpx;
     font-weight: bold;
     color: #333333;
     padding: 24rpx 30rpx;
 }
 
-.group {
+.group-box {
     display: flex;
     align-items: center;
     width: 750rpx;

+ 4 - 4
packageA/contacts/index.wxml

@@ -13,10 +13,10 @@
                 <text class="iconfont icon-a-wodetiaozhuan" />
             </navigator>
             <block wx:if="{{defaultGroup.length}}">
-                <view class="label">
+                <view class="group-label">
                     系统群组
                 </view>
-                <navigator class="group" url="/packageA/contacts/group?id={{item.sys_phonebookgroupid}}&name={{item.groupname}}" wx:for="{{defaultGroup}}" wx:key="rowindex">
+                <navigator class="group-box" url="/packageA/contacts/group?id={{item.sys_phonebookgroupid}}&name={{item.groupname}}" wx:for="{{defaultGroup}}" wx:key="rowindex">
                     <view class="icon-box" style="background-color: #FA8C16;">
                         <text class="iconfont icon-xiaochengxu_qunzu" />
                     </view>
@@ -29,12 +29,12 @@
             </block>
 
             <block wx:if="{{myGroup.length}}">
-                <view class="label">
+                <view class="group-label">
                     自定义群组
                 </view>
                 <van-swipe-cell wx:for="{{myGroup}}" wx:key="rowindex" right-width="{{ 120 }}">
                     <van-cell-group>
-                        <navigator class="group" url="/packageA/contacts/group?id={{item.sys_phonebookgroupid}}&name={{item.groupname}}">
+                        <navigator class="group-box" url="/packageA/contacts/group?id={{item.sys_phonebookgroupid}}&name={{item.groupname}}">
                             <view class="icon-box" style="background-color: #52C41A;">
                                 <text class="iconfont icon-xiaochengxu_qunzu" />
                             </view>

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

@@ -52,7 +52,8 @@ Component({
             }, {
                 tag: "支持者"
             }]
-        }]
+        }],
+        total: 0
     },
     methods: {
         getList(init = false) {
@@ -94,7 +95,8 @@ Component({
                     content.pageNumber = res.pageNumber + 1;
                     this.setData({
                         content,
-                        list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data)
+                        list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data),
+                        total: res.total
                     })
                 })
             })

+ 10 - 0
packageA/contacts/modules/list/index.scss

@@ -68,4 +68,14 @@
     }
 
 
+}
+
+.total {
+    height: 64rpx;
+    line-height: 64rpx;
+    font-size: 24rpx;
+    font-family: PingFang SC-Regular, PingFang SC;
+    color: #666666;
+    background: #F4F5F7;
+    padding-left: 30rpx;
 }

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

@@ -1,7 +1,7 @@
 <Yl_nav search list='{{navList}}' bind:onClick='navClick' bind:onSearch='onSearch' />
 <view class="head" />
 <Yl_ListBox id='ListBox' bind:getlist='getList'>
-    <view style="height: 20rpx;" />
+    <view class="total">总计:{{total}}</view>
     <navigator class="item-box" url="#" wx:for="{{list}}" wx:key="sys_phonebookid" data-item="{{item}}" bindtap="toDetail">
         <view class="item">
             <view class="head-portrait">
@@ -21,5 +21,5 @@
     <My_empty wx:if="{{list.length==0}}" />
 </Yl_ListBox>
 <van-action-sheet show="{{ classShow }}" actions="{{ classActions }}" cancel-text="取消" bind:click-overlay='classClose' bind:cancel="classClose" bind:select="classSelect" />
-<Yl_Filtrate1 show='{{filterShow}}' list="{{filtratelist}}" dateRange bindhandle="handleFilter" />
+<Yl_Filtrate1 show='{{filterShow}}' list="{{filtratelist}}" dateRange minus='{{groupname?"80":"120"}}' bindhandle="handleFilter" />
 <Yl_FloatingButton wx:if="{{groupname!='客户联系人'&&groupname!='项目联系人'}}" bindtap="insertRows" />

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

@@ -261,7 +261,7 @@ Page({
             content.phonenumber = content.telephone.join("-");
             delete(content.telephone)
         }
-        content.oldcontactsid = content.contactsid;
+        // content.oldcontactsid = content.contactsid;
         if (this.data.sys_phonebookid == null) {
             this.handleSubmit(content);
         } else {

+ 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/setclient/modules/contacts/detail/index?contactsid={{item.contactsid}}&ownertable=sa_project_contacts" class="content">
+    <navigator url="/packageA/contacts/detail?id=0&contactsid={{item.contactsid}}&sa_project_contactsid={{item.sa_project_contactsid}}" class="content">
         <view class="user">
             <view class="portrait">
                 {{item.name[0]}}

+ 84 - 82
packageA/project/modules/contacts/quickly/index.scss

@@ -1,98 +1,100 @@
-.search{
-	border-top: 1rpx solid #ddd !important;
+.search {
+    border-top: 1rpx solid #ddd !important;
 }
+
 .box {
-	width: 100vw;
-	background-color: #fff;
-	box-sizing: border-box;
+    width: 100vw;
+    background-color: #fff;
+    box-sizing: border-box;
 
-	.item {
-			display: flex;
-			width: 100%;
-			padding-left: 30rpx;
-			box-sizing: border-box;
+    .item {
+        display: flex;
+        width: 100%;
+        padding-left: 30rpx;
+        box-sizing: border-box;
 
-			.user {
-					display: flex;
-					align-items: center;
-					width: 100%;
-					height: 120rpx;
-					border-bottom: 1px solid #ddd;
-					box-sizing: border-box;
+        .user {
+            display: flex;
+            align-items: center;
+            width: 100%;
+            height: 120rpx;
+            border-bottom: 1px solid #ddd;
+            box-sizing: border-box;
 
-					.portrait {
-							width: 80rpx;
-							height: 80rpx;
-							background: #3874F6;
-							border-radius: 50%;
-							text-align: center;
-							line-height: 80rpx;
-							font-size: 28rpx;
-							font-family: PingFang SC-Regular, PingFang SC;
-							color: #FFFFFF;
-							flex-shrink: 0;
-					}
+            .portrait {
+                width: 80rpx;
+                height: 80rpx;
+                background: #3874F6;
+                border-radius: 50%;
+                text-align: center;
+                line-height: 80rpx;
+                font-size: 28rpx;
+                font-family: PingFang SC-Regular, PingFang SC;
+                color: #FFFFFF;
+                flex-shrink: 0;
+            }
 
-					.exp {
-							width: 100%;
-							margin-left: 20rpx;
+            .exp {
+                width: 0;
+                flex: 1;
+                margin-left: 20rpx;
 
-							.line-1 {
-									height: 42rpx;
-									font-size: 30rpx;
-									font-family: PingFang SC-Regular, PingFang SC;
-									color: #333333;
-							}
+                .line-1 {
+                    height: 42rpx;
+                    font-size: 30rpx;
+                    font-family: PingFang SC-Regular, PingFang SC;
+                    color: #333333;
+                }
 
-							.phone {
-									font-size: 24rpx;
-									font-family: PingFang SC-Regular, PingFang SC;
-									color: #999999;
-									margin-top: 4rpx;
-							}
-					}
-			}
+                .phone {
+                    font-size: 24rpx;
+                    font-family: PingFang SC-Regular, PingFang SC;
+                    color: #999999;
+                    margin-top: 4rpx;
+                }
+            }
+        }
 
-	}
+    }
 }
 
 .footer {
-	width: 750rpx;
-	height: 130rpx;
-	display: flex;
-	align-items: center;
-	justify-content: flex-end;
-	box-sizing: border-box;
-	position: fixed;
-	background: #FFFFFF;
-	box-shadow: 0px -4rpx 16rpx 2rpx rgba(150, 157, 165, 0.16);
-	bottom: 0;
-	padding-right: 30rpx;
+    width: 750rpx;
+    height: 130rpx;
+    display: flex;
+    align-items: center;
+    justify-content: flex-end;
+    box-sizing: border-box;
+    position: fixed;
+    background: #FFFFFF;
+    box-shadow: 0px -4rpx 16rpx 2rpx rgba(150, 157, 165, 0.16);
+    bottom: 0;
+    padding-right: 30rpx;
 
-	.base {
-			width: 156rpx;
-			height: 90rpx;
-			border-radius: 8rpx;
-			box-sizing: border-box;
-	}
+    .base {
+        width: 156rpx;
+        height: 90rpx;
+        border-radius: 8rpx;
+        box-sizing: border-box;
+    }
 
-	.add {
-			background: #FFFFFF;
-			border-radius: 8rpx;
-			border: 2rpx solid #CCCCCC;
-			font-size: 28rpx;
-			font-family: PingFang SC-Bold, PingFang SC;
-			font-weight: bold;
-			color: #666666;
-			margin-right: 20rpx;
-	}
+    .add {
+        background: #FFFFFF;
+        border-radius: 8rpx;
+        border: 2rpx solid #CCCCCC;
+        font-size: 28rpx;
+        font-family: PingFang SC-Bold, PingFang SC;
+        font-weight: bold;
+        color: #666666;
+        margin-right: 20rpx;
+    }
 
-	.confirm {
-			background: #3874F6;
-			font-size: 28rpx;
-			font-family: PingFang SC-Bold, PingFang SC;
-			font-weight: bold;
-			color: #FFFFFF;
-			padding: 0;
-	}
+    .confirm {
+        background: #3874F6;
+        font-size: 28rpx;
+        font-family: PingFang SC-Bold, PingFang SC;
+        font-weight: bold;
+        color: #FFFFFF;
+        padding: 0;
+    }
 }

+ 7 - 5
packageA/project/modules/contacts/quickly/index.wxml

@@ -1,9 +1,11 @@
-<van-tabs active="{{ active }}" bind:change="onChange" title-active-color='var(--assist)' color='var(--assist)'>
-    <van-tab title="我的联系人" />
-    <van-tab title="企业联系人" />
-</van-tabs>
+<view style="position: sticky; top: 0;">
+    <van-tabs active="{{ active }}" bind:change="onChange" title-active-color='var(--assist)' color='var(--assist)'>
+        <van-tab title="我的联系人" />
+        <van-tab title="企业联系人" />
+    </van-tabs>
+    <van-search custom-class='search' value="{{ value }}" shape="round" background="#fff" placeholder="搜索姓名、手机号" bind:search='onSearch' bind:clear='onClear' />
+</view>
 
-<van-search custom-class='search' value="{{ value }}" shape="round" background="#fff" placeholder="搜索姓名、手机号" bind:search='onSearch' bind:clear='onClear' />
 <view style="height: 20rpx;" />
 <view class="box">
     <navigator url="#" class="item" wx:for="{{list}}" wx:key="index" data-item="{{item}}" bindtap="onClick">

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

@@ -90,7 +90,7 @@ Component({
                 item
             } = e.currentTarget.dataset;
             wx.navigateTo({
-                url: '/packageA/setclient/modules/contacts/detail/index?contactsid=' + item.contactsid + "&ownertable=plm_unit"
+                url: '/packageA/contacts/detail?id=0&contactsid=' + item.contactsid + "&sa_project_contactsid=0"
             })
         },
     }

+ 4 - 2
packageA/setclient/modules/contacts/quickly/index.scss

@@ -1,6 +1,7 @@
-.search{
+.search {
     border-top: 1rpx solid #ddd !important;
 }
+
 .box {
     width: 100vw;
     background-color: #fff;
@@ -34,7 +35,8 @@
             }
 
             .exp {
-                width: 100%;
+                width: 0;
+                flex: 1;
                 margin-left: 20rpx;
 
                 .line-1 {

+ 7 - 5
packageA/setclient/modules/contacts/quickly/index.wxml

@@ -1,9 +1,11 @@
-<van-tabs active="{{ active }}" bind:change="onChange" title-active-color='var(--assist)' color='var(--assist)'>
-    <van-tab title="我的联系人" />
-    <van-tab title="企业联系人" />
-</van-tabs>
+<view style="position: sticky; top: 0;">
+    <van-tabs active="{{ active }}" bind:change="onChange" title-active-color='var(--assist)' color='var(--assist)'>
+        <van-tab title="我的联系人" />
+        <van-tab title="企业联系人" />
+    </van-tabs>
+    <van-search custom-class='search' value="{{ value }}" shape="round" background="#fff" placeholder="搜索姓名、手机号" bind:search='onSearch' bind:clear='onClear' />
+</view>
 
-<van-search custom-class='search' value="{{ value }}" shape="round" background="#fff" placeholder="搜索姓名、手机号" bind:search='onSearch' bind:clear='onClear' />
 <view style="height: 20rpx;" />
 <view class="box">
     <navigator url="#" class="item" wx:for="{{list}}" wx:key="index" data-item="{{item}}" bindtap="onClick">

+ 24 - 39
packageA/setclient/modules/trace/add/index.js

@@ -1,7 +1,6 @@
 const _Http = getApp().globalData.http;
 Page({
     data: {
-        isNew: false, //是否为新增
         ownerid: null,
         ownertable: null,
         sys_datafollowupid: 0, //数据ID
@@ -50,21 +49,27 @@ Page({
                 })
             })
         } else {
-            this.initTemplate()
+            // this.initTemplate()
         }
+
+        //getFiles
     },
+
     /* 绑定媒体 */
     insertImgEdit({
         detail
     }) {
+        this.handleFileLink(detail)
+    },
+    handleFileLink(attachmentids, ownertable = "temporary", ownerid = 1, data) {
         _Http.basic({
             "classname": "system.attachment.Attachment",
             "method": "createFileLink",
             "content": {
-                "ownertable": "sys_datafollowup",
-                "ownerid": this.data.sys_datafollowupid,
-                "usetype": "default",
-                "attachmentids": detail
+                ownertable,
+                ownerid,
+                usetype: 'default',
+                attachmentids
             }
         }).then(res => {
             console.log('跟进记录绑定附件', res)
@@ -72,25 +77,15 @@ Page({
                 title: res.msg,
                 icon: "none"
             })
-            this.selectComponent("#Yl_files").handleFiles(res.data)
-        })
-    },
-    /* 初始化模板 */
-    initTemplate() {
-        _Http.basic({
-            "id": 20220930121601,
-            content: {
-                type: "",
-                content: this.data.content,
-                ownerid: this.data.ownerid,
-                ownertable: this.data.ownertable,
-                sys_datafollowupid: this.data.sys_datafollowupid
+            if (ownertable == 'temporary') {
+                this.selectComponent("#Yl_files").handleFiles(res.data)
+            } else {
+                if (res.data.length) data.attinfos = res.data;
+                // this.changeItem(data)
+                /*   setTimeout(() => {
+                      wx.navigateBack()
+                  }, 500) */
             }
-        }).then(res => {
-            this.setData({
-                sys_datafollowupid: res.data.sys_datafollowupid,
-                isNew: true
-            })
         })
     },
     //开始选择跟进方式
@@ -129,6 +124,7 @@ Page({
             sys_datafollowupid: this.data.sys_datafollowupid
         };
         if (!content.content) return;
+        console.log(this.selectComponent("#Yl_files").getFiles())
         _Http.basic({
             "id": 20220930121601,
             content
@@ -140,11 +136,11 @@ Page({
             });
             wx.showToast({
                 title: '保存成功',
-                icon: "none"
+                icon: "none",
+                mask: true
             });
-            this.setData({
-                isNew: false
-            })
+            let attachmentids = this.selectComponent("#Yl_files").getFiles().attachmentids;
+            if (attachmentids.length) this.handleFileLink(attachmentids, 'sys_datafollowup', res.data.sys_datafollowupid, res.data);
             setTimeout(() => {
                 getCurrentPages().forEach(v => {
                     //详情界面更新数据
@@ -181,16 +177,5 @@ Page({
                 });
             }, 300)
         })
-    },
-    onUnload() {
-        if (this.data.isNew) _Http.basic({
-            "id": 20220930121701,
-            "content": {
-                "sys_datafollowupid": this.data.sys_datafollowupid,
-                "deletereason": "系统删除"
-            }
-        }).then(res => {
-            console.log("初始化模板后未保存删除", res)
-        })
     }
 })

+ 15 - 0
packageA/work/detail.js

@@ -81,6 +81,21 @@ Page({
                             url: url + "?id=" + detail.ownerid,
                         })
                         break;
+                    case "sys_phonebook":
+                        wx.navigateTo({
+                            url: `/packageA/contacts/detail?id=${detail.ownerid}&contactsid=0&sa_project_contactsid=0`,
+                        })
+                        break;
+                    case "sys_enterprise_contacts":
+                        wx.navigateTo({
+                            url: `/packageA/contacts/detail?id=0&contactsid=${detail.ownerid}&sa_project_contactsid=0`,
+                        })
+                        break;
+                    case "sa_project_contacts":
+                        wx.navigateTo({
+                            url: `/packageA/contacts/detail?id=0&contactsid=0&sa_project_contactsid=${detail.ownerid}`,
+                        })
+                        break;
                     default:
                         let data = authComparison.find(s => (s.objectname || "") == detail.ownertable);
                         if (data) wx.navigateTo({

+ 12 - 0
pages/tabbar/message/details.js

@@ -33,6 +33,18 @@ Page({
                 item.name = '';
                 this.salesforecastbill(item.objectid)
                 break;
+            case "sys_phonebook":
+                item.name = '联系人';
+                item.path = '/packageA/contacts/detail'
+                break;
+            case "sys_enterprise_contacts":
+                item.name = '客户联系人';
+                item.path = '/packageA/contacts/detail'
+                break;
+            case "sa_project_contacts":
+                item.name = '项目联系人';
+                item.path = '/packageA/contacts/detail'
+                break;
         }
         //修改跳转页面
         if (item.path) {

+ 14 - 0
project.private.config.json

@@ -62,6 +62,20 @@
                     "query": "id=3648",
                     "launchMode": "default",
                     "scene": null
+                },
+                {
+                    "name": "",
+                    "pathName": "packageA/setclient/detail",
+                    "query": "id=3768",
+                    "launchMode": "default",
+                    "scene": null
+                },
+                {
+                    "name": "",
+                    "pathName": "packageA/project/detail",
+                    "query": "id=6353",
+                    "launchMode": "default",
+                    "scene": null
                 }
             ]
         }