Browse Source

项目商机新建联系人

zhaoxiaohai 3 years ago
parent
commit
9b71dc4a41

+ 5 - 2
app.json

@@ -113,7 +113,10 @@
                 "work/detail",
                 "select/selectActivity/index",
                 "select/contract/select",
-                "saleClue/translate"
+                "saleClue/translate",
+                "project/modules/contacts/quickly/index",
+                "project/modules/contacts/add/index",
+                "project/modules/contacts/select/index"
             ]
         }
     ],
@@ -126,7 +129,7 @@
         }
     },
     "usingComponents": {
-        "My_Empty":"/components/My_empty/index",
+        "My_Empty": "/components/My_empty/index",
         "Yl_Files": "/components/Yl_Files/index",
         "Yl_Tabbar": "/components/Yl_Tabbar/index",
         "Yl-tags": "/pages/tags/modules/Yl-tags/index",

+ 1 - 38
packageA/project/detail.js

@@ -75,7 +75,7 @@ Page({
                 label: "报备驳回(退回)"
             }].concat(tabbarList);
 
-            
+
 
             if (isLeader || this.data.isAdmin) tabbarList = tabbarList.concat([{
                 icon: "icon-bianji",
@@ -460,42 +460,5 @@ Page({
     //更新团队成员
     getGroup() {
         this.selectComponent("#Group").getList();
-    },
-    /* 处理新增联系人 */
-    handleSelectContacts(contactsids) {
-        let that = this;
-        wx.showModal({
-            title: '提示',
-            content: '是否确认添加联系人',
-            complete: ({
-                confirm
-            }) => {
-                if (confirm) {
-                    _Http.basic({
-                        "id": 20221111131104,
-                        "content": {
-                            "sa_project_contactsid": 0,
-                            contactsids,
-                            "sa_projectid": that.data.sa_projectid,
-                            "remarks": ""
-                        }
-                    }).then(res => {
-                        console.log("项目添加联系人", res)
-                        if (res.msg != '成功') return wx.showToast({
-                            title: res.data,
-                            icon: "none"
-                        });
-                        wx.showToast({
-                            title: '添加成功',
-                            icon: "none"
-                        });
-                        setTimeout(() => {
-                            wx.navigateBack();
-                            that.partialRenewal(true);
-                        }, 300)
-                    })
-                }
-            }
-        })
     }
 })

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

@@ -0,0 +1,246 @@
+const _Http = getApp().globalData.http;
+Page({
+    data: {
+        sys_phonebookid: null, //是否为快捷选择创建的账号
+        fromShowAll: false,
+        form: [{
+            label: "姓名",
+            error: false,
+            errMsg: "",
+            type: "text",
+            value: "",
+            placeholder: "联系人名称",
+            valueName: "name",
+            required: true,
+            checking: "base"
+        }, {
+            label: "手机号",
+            error: false,
+            errMsg: "",
+            type: "number",
+            value: "",
+            placeholder: "联系人手机号码",
+            valueName: "phonenumber",
+            required: true,
+            checking: "phone"
+        }, {
+            label: "部门",
+            error: false,
+            errMsg: "",
+            type: "text",
+            value: "",
+            placeholder: "联系人所属部门",
+            valueName: "depname",
+            required: false,
+            checking: "base"
+        }, {
+            label: "单位",
+            error: false,
+            errMsg: "",
+            type: "route",
+            url: "/packageA/project/modules/contacts/select/index",
+            value: "",
+            placeholder: "选择单位",
+            valueName: "sys_enterpriseid",
+            required: true,
+            checking: "base",
+        }, {
+            label: "职位",
+            error: false,
+            errMsg: "",
+            type: "text",
+            value: "",
+            placeholder: "联系人职位",
+            valueName: "position",
+            required: false,
+            checking: "base"
+        }, {
+            label: "性别",
+            error: false,
+            errMsg: "",
+            type: "sex",
+            value: "",
+            placeholder: "联系人性别",
+            valueName: "sex",
+            required: false,
+            checking: "base"
+        }, {
+            label: "生日",
+            error: false,
+            errMsg: "",
+            type: "date",
+            value: "",
+            placeholder: "联系人生日",
+            valueName: "birthday",
+            required: false
+        }, {
+            label: "邮箱",
+            error: false,
+            errMsg: "",
+            type: "textarea",
+            value: "",
+            placeholder: "请填写",
+            valueName: "email",
+            required: false,
+            checking: "mail"
+        }, {
+            label: "地区",
+            error: false,
+            errMsg: "",
+            type: "region",
+            value: [],
+            placeholder: "省,市,区",
+            valueName: "region",
+            required: false
+        }, {
+            label: "详细地址",
+            error: false,
+            errMsg: "",
+            type: "textarea",
+            value: "",
+            placeholder: "例: 科创园11栋1103室",
+            valueName: "address",
+            required: false,
+            checking: "base"
+        }, {
+            label: "备注",
+            error: false,
+            errMsg: "",
+            type: "textarea",
+            value: "",
+            placeholder: "请填写",
+            valueName: "remarks",
+            required: false,
+            checking: "base"
+        }],
+        disabled: true,
+        "content": {
+            "contactsid": 0, //地址id
+            "sa_projectid": 0, //绑定数据
+            "isleader": 0, //默认0
+            "workaddress": 0,
+            "isdefault": 0, //是否默认地址
+            "isprimary": 0 //是否为主地址
+        }
+    },
+    onLoad(options) {
+        this.setData({
+            "content.sa_projectid": options.sa_projectid
+        });
+        if (options.data) {
+            let item = JSON.parse(options.data),
+                disabled = false,
+                form = this.data.form.map(v => {
+                    if (v.valueName == 'region') {
+                        v.value = item.province ? [item.province, item.city, item.county] : []
+                    } else if (v.valueName == 'sys_enterpriseid') {
+                        if (item.sys_enterpriseid) {
+                            v.value = [item.enterprisename, [item.sys_enterpriseid]]
+                        } else {
+                            v.value = "";
+                            disabled = true;
+                        }
+                    } else {
+                        v.value = Object.hasOwn(item, v.valueName) ? item[v.valueName] : v.value;
+                    }
+                    return v
+                });
+            this.setData({
+                form,
+                disabled,
+                "content.contactsid": item.contactsid
+            });
+            if (item.sys_phonebookid) this.setData({
+                sys_phonebookid: item.sys_phonebookid
+            })
+        };
+    },
+    /* 提交数据 */
+    submit() {
+        let data = this.selectComponent("#Form").submit();
+        if (!data || this.data.disabled) return;
+        data.sys_enterpriseid = data.sys_enterpriseid[1][0]
+        const content = {
+            ...this.data.content,
+            ...data,
+            "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
+        }).then(res => {
+            console.log("编辑联系人", res)
+            if (res.msg != '成功') return wx.showToast({
+                title: res.data,
+                icon: "none"
+            });
+            let that = this;
+            let page = getCurrentPages()[getCurrentPages().length - 2];
+            _Http.basic({
+                "id": 20221111131104,
+                "content": {
+                    "sa_project_contactsid": 0,
+                    contactsids: [res.data.contactsid],
+                    "sa_projectid": page.data.sa_projectid,
+                    "remarks": ""
+                }
+            }).then(res => {
+                console.log("项目添加联系人", res)
+                if (res.msg != '成功') return wx.showToast({
+                    title: res.data,
+                    icon: "none"
+                });
+                wx.showToast({
+                    title: '添加成功',
+                    icon: "none"
+                });
+                setTimeout(() => {
+                    wx.navigateBack();
+                    let model = page.selectComponent("#Contacts")
+                    model.getList(model.data.sa_projectid, true)
+                }, 300)
+            })
+            wx.showToast({
+                title: '保存成功',
+                icon: "none"
+            });
+        });
+    },
+    /* 表单是否填写完成 */
+    onConfirm({
+        detail
+    }) {
+        this.setData({
+            disabled: detail
+        })
+    },
+    /* 是否显示全部 */
+    changefromShowAll({
+        detail
+    }) {
+        this.setData({
+            fromShowAll: detail
+        })
+    },
+})

+ 4 - 0
packageA/project/modules/contacts/add/index.json

@@ -0,0 +1,4 @@
+{
+    "usingComponents": {},
+    "navigationBarTitleText": "联系人"
+}

+ 26 - 0
packageA/project/modules/contacts/add/index.scss

@@ -0,0 +1,26 @@
+// @import "/packageA/setclient/modules/address/head.scss";
+
+
+.footer {
+    display: flex;
+    align-items: center;
+    justify-content: flex-end;
+    position: fixed;
+    width: 750rpx;
+    height: 130rpx;
+    background: #FFFFFF;
+    box-shadow: 0px -4rpx 16rpx 2rpx rgba(150, 157, 165, 0.16);
+    bottom: 0;
+
+    .but {
+        width: 156rpx;
+        height: 90rpx;
+        background: #3874F6;
+        border-radius: 8rpx;
+        font-size: 28rpx;
+        font-family: PingFang SC-Bold, PingFang SC;
+        font-weight: bold;
+        color: #FFFFFF;
+        margin-right: 30rpx;
+    }
+}

+ 6 - 0
packageA/project/modules/contacts/add/index.wxml

@@ -0,0 +1,6 @@
+<Yl_Headline title='基本信息' type='switch' switchLabel='仅显示必填项' switch='{{fromShowAll}}' bind:callBack='changefromShowAll' />
+<Yl_field id='Form' showAll='{{!fromShowAll}}' form="{{form}}" bind:onConfirm='onConfirm' />
+
+<view class="footer">
+    <van-button custom-class='but' disabled='{{disabled}}' bindtap="submit">确定</van-button>
+</view>

+ 3 - 20
packageA/project/modules/contacts/index.js

@@ -5,6 +5,7 @@ Component({
         disabled: Boolean
     },
     data: {
+        "sa_projectid": 1,
         "content": {
             "nocache": true,
             "sa_projectid": 1,
@@ -36,30 +37,12 @@ Component({
                     "content.pageNumber": res.pageNumber + 1,
                     "content.pageSize": res.pageSize,
                     "content.pageTotal": res.pageTotal,
+                    "content.sa_projectid": id,
                     "content.total": res.total,
-                    sa_projectid: id
+                    sa_projectid: id,
                 })
             })
         },
-        addContacts() {
-            wx.navigateTo({
-                url: `/packageA/select/contacts/select?params=${
-                    JSON.stringify({ 
-                        id: 20221111130704,
-                        content: {
-                            nocache: true,
-                            sa_projectid: this.data.content.sa_projectid,
-                            pageSize: 20,
-                            pageNumber: 1,
-                            pageTotal: 1,
-                            "where": {
-                                "condition": ""
-                            }
-                        }
-                    })
-                }`,
-            })
-        },
         /* 修改总数 */
         changeTotal() {
             this.setData({

+ 3 - 3
packageA/project/modules/contacts/index.wxml

@@ -1,10 +1,10 @@
 <view class="head">
     <view class="count">总共{{content.total}}个</view>
     <view class="expand">
-        <navigator url="/packageA/project/modules/contacts/search/index?sa_projectid={{sa_projectid}}" class="but" bindtap="toSearch">
+        <!-- <navigator url="/packageA/project/modules/contacts/quickly/index?sa_projectid={{sa_projectid}}" class="but" bindtap="toSearch">
             <van-icon name="search" />
-        </navigator>
-        <navigator wx:if="{{disabled}}" url="#" class="but" bindtap="addContacts">
+        </navigator> -->
+        <navigator wx:if="{{disabled}}" url="/packageA/project/modules/contacts/quickly/index?sa_projectid={{sa_projectid}}" class="but">
             <van-icon name="plus" />
         </navigator>
     </view>

+ 88 - 0
packageA/project/modules/contacts/quickly/index.js

@@ -0,0 +1,88 @@
+const _Http = getApp().globalData.http;
+
+Page({
+    data: {
+        active: 0,
+        content: {
+            sa_projectid: "",
+            nocache: true,
+            pageNumber: 1,
+            pageSize: 20,
+            pageTotal: 1,
+            total: 0,
+            where: {
+                "condition": "",
+            }
+        },
+        list: [],
+    },
+    getList(init = false) {
+        const content = this.data.content;
+        if (init) content.pageNumber = 1;
+        if (content.pageNumber > content.pageTotal) return;
+        _Http.basic({
+            id: this.data.active == 0 ? 20221219161202 : 20221219201402,
+            content
+        }).then(res => {
+            console.log("通讯录列表", res)
+
+            if (res.msg != '成功') return wx.showToast({
+                title: res.data,
+                icon: "none"
+            });
+
+            content.pageNumber = res.pageNumber + 1;
+            content.pageTotal = res.pageTotal;
+            content.total = res.total;
+
+            this.setData({
+                list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data),
+                content
+            })
+        })
+    },
+    onChange(e) {
+        this.setData({
+            active: e.detail.index
+        });
+        this.getList(true);
+    },
+    onLoad(options) {
+        if (options.sa_projectid) this.setData({
+            'content.sa_projectid': options.sa_projectid
+        });
+        this.getList();
+    },
+    /* 默认添加 */
+    created() {
+        wx.redirectTo({
+            url: '/packageA/project/modules/contacts/add/index?sa_projectid=' + this.data.content.sa_projectid,
+        })
+    },
+    onClick(e) {
+        const {
+            item
+        } = e.currentTarget.dataset;
+        delete(item.tag1)
+        wx.redirectTo({
+            url: `/packageA/project/modules/contacts/add/index?sa_projectid=${this.data.content.sa_projectid}&data=${JSON.stringify(item)}`,
+        })
+    },
+    onSearch({
+        detail
+    }) {
+        this.setData({
+            'parems.content.where.condition': detail ? detail : ""
+        });
+        this.getList(true);
+    },
+    onClear() {
+        this.setData({
+            'parems.content.where.condition': ""
+        });
+        this.getList(true);
+    },
+    onReachBottom() {
+        this.getList();
+    },
+})

+ 7 - 0
packageA/project/modules/contacts/quickly/index.json

@@ -0,0 +1,7 @@
+{
+    "usingComponents": {
+        "van-radio": "@vant/weapp/radio/index",
+        "van-radio-group": "@vant/weapp/radio-group/index"
+    },
+    "navigationBarTitleText": "选择联系人"
+}

+ 98 - 0
packageA/project/modules/contacts/quickly/index.scss

@@ -0,0 +1,98 @@
+.search{
+	border-top: 1rpx solid #ddd !important;
+}
+.box {
+	width: 100vw;
+	background-color: #fff;
+	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;
+
+					.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;
+
+							.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;
+							}
+					}
+			}
+
+	}
+}
+
+.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;
+
+	.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;
+	}
+
+	.confirm {
+			background: #3874F6;
+			font-size: 28rpx;
+			font-family: PingFang SC-Bold, PingFang SC;
+			font-weight: bold;
+			color: #FFFFFF;
+			padding: 0;
+	}
+}

+ 32 - 0
packageA/project/modules/contacts/quickly/index.wxml

@@ -0,0 +1,32 @@
+<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 style="height: 20rpx;" />
+<view class="box">
+    <navigator url="#" class="item" wx:for="{{list}}" wx:key="index" data-item="{{item}}" bindtap="onClick">
+        <view class="user">
+            <view class="portrait">
+                {{item.name[0]}}
+            </view>
+            <view class="exp">
+                <view class="line-1">
+                    {{item.name}}
+                    <text class="phone">{{item.enterprisename}}</text>
+                </view>
+                <view class="phone">
+                    {{item.position}}
+                    {{item.phonenumber}}
+                </view>
+            </view>
+        </view>
+    </navigator>
+</view>
+
+<My_empty wx:if="{{list.length==0}}" />
+<view style="height: 130rpx;" />
+<view class="footer">
+    <van-button custom-class='base add' bindtap="created">创建\n联系人</van-button>
+</view>

+ 118 - 0
packageA/project/modules/contacts/select/index.js

@@ -0,0 +1,118 @@
+const _Http = getApp().globalData.http,
+    getHeight = require("../../../../../utils/getRheRemainingHeight");
+Page({
+    data: {
+        active: 0,
+        item: null,
+        radio: true,
+        content: {
+            pageNumber: 1,
+            pageTotal: 1,
+            total: null,
+            where: {
+                condition: "",
+                type: 5,
+                sa_projectid: 1
+            }
+        }
+    },
+    onLoad(options) {
+        /* 从表单组件进入进入 */
+        if (options.item) {
+            let item = JSON.parse(options.item);
+            this.setData({
+                item
+            })
+        };
+        this.getList()
+    },
+    onChange(e) {
+        this.setData({
+            active: e.detail.index
+        });
+        this.getList(true);
+    },
+    getList(init = false) {
+        //init 用于初始化分页
+        if (init.detail != undefined) init = init.detail;
+        let content = this.data.content;
+        if (init) content.pageNumber = 1;
+        if (content.pageNumber > content.pageTotal) return;
+        content.where.type = this.data.active == 0 ? 6 : 5
+        if (this.data)
+            _Http.basic({
+                id: 20220920083901,
+                content
+            }).then(res => {
+                console.log("选择客户列表", res)
+                this.selectComponent('#ListBox').RefreshToComplete();
+                if (res.msg != '成功') return wx.showToast({
+                    title: res.data,
+                    icon: "none"
+                })
+                this.setData({
+                    'content.pageNumber': res.pageNumber + 1,
+                    'content.pageTotal': res.pageTotal,
+                    'content.total': res.total,
+                    list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data)
+                })
+                this.getTags();
+            })
+    },
+    /* 获取列表标签 */
+    getTags() {
+        let list = this.data.list,
+            ownerids = list.map(v => v.sys_enterpriseid)
+        _Http.basic({
+            "id": 20221018102001,
+            "content": {
+                "ownertable": "sa_customers",
+                ownerids
+            }
+        }).then(res => {
+            for (let key in res.data) {
+                let index = list.findIndex(v => v.sys_enterpriseid == key);
+                list[index].tags = res.data[key]
+            };
+            this.setData({
+                list
+            })
+        })
+    },
+    /* 选中 */
+    changeResult(e) {
+        const {
+            id
+        } = e.currentTarget.dataset;
+
+        let pages = getCurrentPages();
+        let page = pages[pages.length - 2].selectComponent("#Form"),
+            item = this.data.item,
+            data = this.data.list.find(v => v.sys_enterpriseid == id);
+        item.value = [data.enterprisename, [id]];
+        page.handleRoute(item, [data]);
+    },
+    /* 开始搜索 */
+    startSearch({
+        detail
+    }) {
+        let condition = this.data.content ? this.data.content.where.condition : this.data.content.where.condition;
+        if (detail == condition) return;
+        this.setData({
+            'content.where.condition': detail
+        });
+        this.getList(true);
+    },
+    /* 取消搜索 */
+    onClear() {
+        this.setData({
+            'content.where.condition': ""
+        });
+        this.getList(true);
+    },
+    onReady() {
+        getHeight.getHeight('.total', this).then(res => this.setData({
+            listHeight: res
+        }));
+    }
+})

+ 4 - 0
packageA/project/modules/contacts/select/index.json

@@ -0,0 +1,4 @@
+{
+    "usingComponents": {},
+    "navigationBarTitleText": "选择客户"
+}

+ 124 - 0
packageA/project/modules/contacts/select/index.scss

@@ -0,0 +1,124 @@
+page {
+    height: 100vh;
+    overflow: hidden;
+}
+
+.total {
+    height: 60rpx;
+    line-height: 60rpx;
+    font-size: 24rpx;
+    font-family: PingFang SC-Regular, PingFang SC;
+    color: #666666;
+    padding-left: 30rpx;
+}
+
+.footer {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    padding: 0 30rpx;
+    position: fixed;
+    width: 100vw;
+    height: 130rpx;
+    background: #FFFFFF;
+    box-shadow: 0px -4rpx 16rpx 2rpx rgba(150, 157, 165, 0.16);
+    bottom: 0;
+    box-sizing: border-box;
+
+    .count {
+        font-size: 28rpx;
+        font-family: PingFang SC-Regular, PingFang SC;
+        color: #333333;
+    }
+
+    .but {
+        width: 156rpx;
+        height: 90rpx;
+        background: #3874F6;
+        border-radius: 8rpx;
+        font-size: 28rpx;
+        font-family: PingFang SC-Bold, PingFang SC;
+        font-weight: bold;
+        color: #FFFFFF;
+    }
+}
+
+.setclient-list-item {
+    width: 100vw;
+    padding-left: 30rpx;
+    background-color: #fff;
+    box-sizing: border-box;
+
+    .con {
+        display: flex;
+        width: 100%;
+        min-height: 136rpx;
+        border-bottom: 1px solid #EFEFEF;
+        box-sizing: border-box;
+        padding-top: 20rpx;
+
+        .portrait {
+            width: 96rpx;
+            height: 96rpx;
+            background: #E7EEFF;
+            border-radius: 16rpx;
+            font-size: 24rpx;
+            font-family: PingFang SC-Regular, PingFang SC;
+            color: #3874F6;
+            padding: 16rpx 24rpx;
+            box-sizing: border-box;
+            margin-right: 20rpx;
+            flex-shrink: 0;
+        }
+
+        .min-portrait {
+            display: flex;
+            align-items: center;
+            padding: 0 !important;
+            justify-content: center;
+        }
+
+        .mian {
+            flex: 1;
+            width: 0;
+            padding-right: 20rpx;
+            box-sizing: border-box;
+
+            .label {
+                font-size: 28rpx;
+                font-family: PingFang SC-Bold, PingFang SC;
+                font-weight: bold;
+                color: #333333;
+                height: 40rpx;
+                line-height: 40rpx;
+            }
+
+            .tag-box {
+                margin-top: 10rpx;
+
+                .tag {
+                    height: 40rpx;
+                    font-size: 20rpx;
+                    font-family: PingFang SC-Regular, PingFang SC;
+                    padding: 0 12rpx;
+                    margin-right: 10rpx;
+                }
+            }
+        }
+
+        .checkbox {
+            display: flex;
+            align-items: center;
+            margin-top: -20rpx;
+            margin-right: 10rpx;
+        }
+
+        .extend {
+            display: flex;
+            height: 116rpx;
+            width: 48rpx;
+            margin-right: 30rpx;
+            flex-shrink: 0;
+        }
+    }
+}

+ 50 - 0
packageA/project/modules/contacts/select/index.wxml

@@ -0,0 +1,50 @@
+<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 class="search" value="{{ content.where.condition }}" shape="round" placeholder="请输入搜索关键词" bind:search='startSearch' bind:clear='onClear' />
+<My_listBox id='ListBox' height="{{listHeight}}" bind:getlist='getList'>
+    <view class="total">共{{content.total}}个</view>
+    <navigator class="setclient-list-item" url="#" wx:for="{{list}}" wx:key="item.sys_enterpriseid" data-id="{{item.sys_enterpriseid}}" bindtap="changeResult">
+        <view class="con">
+            <view class="portrait {{item.enterprisename <=2?'min-portrait':''}}">
+                {{handle.getName(item.enterprisename)}}
+            </view>
+            <view class="mian">
+                <view class="label line-1">{{item.enterprisename}}</view>
+                <view class="tag-box">
+                    <van-tag custom-class='tag' wx:if="{{item.type}}" wx:for-item='tag' color='#FA8C16' text-color='#fff' round>{{item.type}}</van-tag>
+                    <van-tag custom-class='tag' wx:for="{{item.tags.systemtag}}" wx:for-item='tag' color='#FA8C16' text-color='#fff' round>{{tag}}</van-tag>
+                    <van-tag custom-class='tag' wx:for="{{item.tags.datatag}}" wx:for-item='tag' color='#FAAB16' text-color='#fff' round>{{tag}}</van-tag>
+                </view>
+            </view>
+            <view class="checkbox" wx:if="{{!radio}}">
+                <van-checkbox value='{{handle.isCheck(item.sys_enterpriseid,result)}}' />
+            </view>
+        </view>
+    </navigator>
+    <view style="height: 230rpx;" />
+    <My_empty wx:if="{{!list.length}}" />
+</My_listBox>
+<block wx:if="{{!radio}}">
+    <view style="height: 130rpx;" />
+    <view class="footer">
+        <view class="count">
+            已选:{{result.length}}
+        </view>
+        <van-button custom-class='but' disabled='{{result.length==0}}' bind:click="submit">确定</van-button>
+    </view>
+</block>
+
+<wxs module="handle">
+    module.exports = {
+        getName: function (name) {
+            return name.substring(0, 4)
+        },
+        isCheck: function (id, list) {
+            return list.some(function (v) {
+                return v == id
+            });
+        },
+    }
+</wxs>

+ 1 - 1
project.private.config.json

@@ -102,5 +102,5 @@
             ]
         }
     },
-    "libVersion": "2.26.2"
+    "libVersion": "2.28.1"
 }