xiaohaizhao 1 год назад
Родитель
Сommit
6c2ed8ef0c
26 измененных файлов с 1144 добавлено и 8 удалено
  1. 4 1
      app.json
  2. 3 0
      packageA/contacts/insert.js
  3. 9 5
      packageA/saleClue/detail.js
  4. 2 1
      packageA/saleClue/detail.json
  5. 1 1
      packageA/saleClue/detail.scss
  6. 1 0
      packageA/saleClue/detail.wxml
  7. 322 0
      packageA/saleClue/modules/contacts/add/index.js
  8. 4 0
      packageA/saleClue/modules/contacts/add/index.json
  9. 26 0
      packageA/saleClue/modules/contacts/add/index.scss
  10. 6 0
      packageA/saleClue/modules/contacts/add/index.wxml
  11. 136 0
      packageA/saleClue/modules/contacts/detail/index.js
  12. 7 0
      packageA/saleClue/modules/contacts/detail/index.json
  13. 37 0
      packageA/saleClue/modules/contacts/detail/index.scss
  14. 35 0
      packageA/saleClue/modules/contacts/detail/index.wxml
  15. 67 0
      packageA/saleClue/modules/contacts/index.js
  16. 6 0
      packageA/saleClue/modules/contacts/index.json
  17. 1 0
      packageA/saleClue/modules/contacts/index.scss
  18. 13 0
      packageA/saleClue/modules/contacts/index.wxml
  19. 99 0
      packageA/saleClue/modules/contacts/list/index.js
  20. 6 0
      packageA/saleClue/modules/contacts/list/index.json
  21. 82 0
      packageA/saleClue/modules/contacts/list/index.scss
  22. 25 0
      packageA/saleClue/modules/contacts/list/index.wxml
  23. 115 0
      packageA/saleClue/modules/contacts/quickly/index.js
  24. 7 0
      packageA/saleClue/modules/contacts/quickly/index.json
  25. 100 0
      packageA/saleClue/modules/contacts/quickly/index.scss
  26. 30 0
      packageA/saleClue/modules/contacts/quickly/index.wxml

+ 4 - 1
app.json

@@ -170,7 +170,10 @@
                 "expenseBreakdown/insertion",
                 "expenseBreakdown/edit",
                 "contract/modules/contacts/quickly",
-                "opponent/modules/aAD/insert"
+                "opponent/modules/aAD/insert",
+                "saleClue/modules/contacts/add/index",
+                "saleClue/modules/contacts/detail/index",
+                "saleClue/modules/contacts/quickly/index"
             ]
         }
     ],

+ 3 - 0
packageA/contacts/insert.js

@@ -292,6 +292,9 @@ Page({
                             } else if (v.__route__ == 'packageA/setclient/detail') {
                                 let model = v.selectComponent("#Contacts");
                                 if (model) model.getList(model.data.sys_enterpriseid, true)
+                            } else if (v.__route__ == 'packageA/saleClue/detail') {
+                                let model = v.selectComponent("#Contacts");
+                                if (model) model.getList(model.data.sat_orderclueid, true)
                             }
                         })
                         setTimeout(() => {

+ 9 - 5
packageA/saleClue/detail.js

@@ -33,6 +33,10 @@ Page({
             label: "来源线索",
             icon: "icon-tabxiansuo",
             model: "#Clue"
+        }, {
+            label: "联系人",
+            icon: "icon-tablianxiren",
+            model: "#Contacts"
         }, {
             label: "操作",
             icon: "icon-tabcaozuojilu1",
@@ -146,11 +150,11 @@ Page({
             }, {
                 label: '分配状态',
                 value: res.data.allocationstatus,
-                style:`color:${this.data.sColors[res.data.allocationstatus]}`
+                style: `color:${this.data.sColors[res.data.allocationstatus]}`
             }, {
                 label: '跟进状态',
                 value: getApp().globalData.Language.getMapText(res.data.status),
-                style:`color:${this.data.sColors[res.data.status]}`
+                style: `color:${this.data.sColors[res.data.status]}`
             }];
             if (wx.getStorageSync('userMsg').siteid == 'HY') list1 = list1.filter(v => !["项目预算(万元)", "总投资额(万元)", "造价(万元)"].includes(v.label))
 
@@ -175,11 +179,11 @@ Page({
                 }, {
                     label: '分配状态',
                     value: res.data.allocationstatus,
-                    style:`color:${this.data.sColors[res.data.allocationstatus]}`
+                    style: `color:${this.data.sColors[res.data.allocationstatus]}`
                 }, {
                     label: '跟进状态',
                     value: getApp().globalData.Language.getMapText(res.data.status),
-                    style:`color:${this.data.sColors[res.data.status]}`
+                    style: `color:${this.data.sColors[res.data.status]}`
                 }, {
                     label: '跟进次数',
                     value: res.data.followcount || '0'
@@ -438,7 +442,7 @@ Page({
                 break;
             case "跟进":
                 wx.navigateTo({
-                    url: `/packageA/publicClue/modules/follow/insert?sat_orderclueid=` + this.data.detail.sat_orderclueid +'&resource=销售线索'
+                    url: `/packageA/publicClue/modules/follow/insert?sat_orderclueid=` + this.data.detail.sat_orderclueid + '&resource=销售线索'
                 })
                 _Http.changeItem = this.updateFollowList.bind(this)
                 break;

+ 2 - 1
packageA/saleClue/detail.json

@@ -8,7 +8,8 @@
         "Work": "/packageA/public/work/index",
         "Files": "/packageA/public/files/index",
         "ShiftSite": "/packageA/publicClue/modules/shiftSite/index",
-        "Clue": "./modules/clue/index"
+        "Clue": "./modules/clue/index",
+        "Contacts":"./modules/contacts/index"
     },
     "navigationBarTitleText": "线索详情"
 }

+ 1 - 1
packageA/saleClue/detail.scss

@@ -7,7 +7,7 @@
     margin-bottom: -16rpx;
 
     .title {
-        height: 40rpx;
+        line-height: 40rpx;
         font-size: 28rpx;
         font-family: PingFang SC-Bold, PingFang SC;
         font-weight: bold;

+ 1 - 0
packageA/saleClue/detail.wxml

@@ -17,6 +17,7 @@
     <Record slot='操作' id="Record" ownertable='sat_orderclue' ownerid='{{sat_orderclueid}}' />
     <Trace resource='销售线索' slot='跟进动态' id='Trace' ownertable='sat_orderclue' ownerid='{{sat_orderclueid}}' />
     <Files slot="附件" id="Files" ownertable="sat_orderclue" ownerid="{{detail.sat_orderclueid}}" />
+    <Contacts slot="联系人" id='Contacts' ownertable="sat_orderclue" ownerid="{{detail.sat_orderclueid}}" disabled path='/packageA/saleClue/modules/contacts/quickly/index' />
 </Yl_FunTabs>
 <!-- 底部 -->
 <Yl_Tabbar wx:if="{{tabbarList.length!=0}}" list='{{tabbarList}}' bind:callback="tabbarOnClick" />

+ 322 - 0
packageA/saleClue/modules/contacts/add/index.js

@@ -0,0 +1,322 @@
+const _Http = getApp().globalData.http;
+Page({
+    data: {
+        sat_orderclue_contactsid: null, //是否为快捷选择创建的账号
+        fromShowAll: false,
+        form: [{
+            label: "姓名",
+            error: false,
+            errMsg: "",
+            type: "text",
+            value: "",
+            placeholder: "联系人名称",
+            valueName: "name",
+            required: true,
+            checking: "base"
+        }, {
+            label: "联系方式",
+            error: false,
+            errMsg: "",
+            hint: "",
+            type: "radio",
+            value: "0",
+            radioList: [{
+                id: '0',
+                name: '手机号'
+            }, {
+                id: '1',
+                name: '座机电话'
+            }],
+            valueName: "isTelephone", //绑定的字段名称
+            required: true, //必填
+            interrupt: true,
+            checking: `true`,
+            phonenumber: "",
+            telephone: ["", ""]
+        }, {
+            label: "手机号",
+            error: false,
+            errMsg: "",
+            type: "number",
+            value: "",
+            placeholder: "联系人手机号码",
+            valueName: "phonenumber",
+            required: true,
+            checking: "phone"
+        }, {
+            label: "微信",
+            error: false,
+            errMsg: "",
+            type: "text",
+            value: "",
+            placeholder: "联系人微信",
+            valueName: "wechatnum",
+            required: false
+        }, {
+            label: "邮箱",
+            error: false,
+            errMsg: "",
+            type: "textarea",
+            value: "",
+            placeholder: "请填写",
+            valueName: "email",
+            required: false,
+            checking: "mail"
+        }, {
+            label: "传真",
+            error: false,
+            errMsg: "",
+            type: "textarea",
+            value: "",
+            placeholder: "请填写",
+            valueName: "fax",
+            required: false,
+        }, {
+            label: "部门",
+            error: false,
+            errMsg: "",
+            type: "text",
+            value: "",
+            placeholder: "联系人所属部门",
+            valueName: "depname",
+            required: true,
+            checking: "base"
+        }, {
+            label: "职位",
+            error: false,
+            errMsg: "",
+            type: "text",
+            value: "",
+            placeholder: "联系人职位",
+            valueName: "position",
+            required: true,
+            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: "homeaddress",
+            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,
+            errMsg: "",
+            type: "textarea",
+            value: "",
+            placeholder: "请填写",
+            valueName: "remarks",
+            required: false,
+            checking: "base"
+        }],
+        disabled: true,
+        "content": {
+            "sat_orderclueid": 0, //绑定数据
+            "isleader": 0, //默认0
+            "isdefault": 0, //是否默认地址
+            sys_phonebookid: 0,
+            "isprimary": 0 //是否为主地址
+        }
+    },
+    onLoad(options) {
+        getApp().globalData.Language.getLanguagePackage(this, '联系人');
+        if (options.sat_orderclueid) this.data.content.sat_orderclueid = options.sat_orderclueid;
+        if (options.enterprisename) this.data.content.enterprisename = options.enterprisename;
+        if (options.data) {
+            let item = JSON.parse(options.data),
+                arr = item.phonenumber.split("-");
+            this.data.content.sat_orderclue_contactsid = item.sat_orderclue_contactsid;
+            item.isTelephone = arr.length == 2 ? "1" : "0";
+            if (options.enterprisename) {
+                item.sat_orderclueid = [options.enterprisename, [options.sat_orderclueid]]
+            } else if (item.enterprisename) {
+                item.sat_orderclueid = [item.enterprisename, [item.sat_orderclueid]]
+            }
+            this.data.content.enterprisename = item.enterprisename;
+            this.data.sat_orderclue_contactsid = item.sat_orderclue_contactsid || 0;
+            this.data.content.sys_phonebookid = item.sys_phonebookid || 0;
+            this.setData({
+                form: this.data.form.map(v => {
+                    if (v.valueName == 'phonenumber') {
+                        v = arr.length == 2 ? {
+                            label: "电话",
+                            error: false,
+                            errMsg: "",
+                            type: "telephone",
+                            value: arr,
+                            placeholder: "联系人手机号码",
+                            valueName: "telephone",
+                            required: true,
+                            checking: "telephone"
+                        } : {
+                            label: "手机号",
+                            error: false,
+                            errMsg: "",
+                            type: "number",
+                            value: arr[0],
+                            placeholder: "联系人手机号码",
+                            valueName: "phonenumber",
+                            required: true,
+                            checking: "phone"
+                        }
+                    } else {
+                        v.value = item[v.valueName] || v.value || '';
+                    }
+                    return v
+                })
+            });
+            this.selectComponent("#Form").confirm();
+        } else {
+
+            this.setData({
+                form: this.data.form
+            })
+        }
+    },
+    /* 打断 */
+    interrupt({
+        detail
+    }) {
+        let {
+            data,
+            form
+        } = detail;
+        if (data.label == '联系方式') {
+            if (data.value == 0) {
+                data.telephone = form[2].value;
+                form[2] = {
+                    label: "手机号",
+                    error: false,
+                    errMsg: "",
+                    type: "number",
+                    value: data.phonenumber,
+                    placeholder: "联系人手机号码",
+                    valueName: "phonenumber",
+                    required: true,
+                    checking: "phone"
+                }
+            } else {
+                data.phonenumber = form[2].value;
+                form[2] = {
+                    label: "电话",
+                    error: false,
+                    errMsg: "",
+                    type: "telephone",
+                    value: data.telephone,
+                    placeholder: "联系人手机号码",
+                    valueName: "telephone",
+                    required: true,
+                    checking: "telephone"
+                }
+            };
+            this.setData({
+                form
+            })
+        }
+    },
+    /* 提交数据 */
+    submit() {
+        let data = this.selectComponent("#Form").submit();
+        if (!data || this.data.disabled) return;
+        const content = {
+            ...this.data.content,
+            ...data,
+        };
+        if (content.telephone) {
+            content.phonenumber = content.telephone.join("-");
+            delete(content.telephone)
+        }
+        content.sat_orderclueid = this.data.content.sat_orderclueid;
+        this.handleSubmit(content);
+    },
+    handleSubmit(content) {
+        _Http.basic({
+            "id": "2025042110003902",
+            content
+        }).then(res => {
+            console.log("编辑联系人", res)
+            wx.showToast({
+                title: res.code != '1' ? res.msg : getApp().globalData.Language.getMapText('保存成功'),
+                icon: "none",
+                mask: true
+            });
+            if (res.code == '1') setTimeout(() => {
+                wx.navigateBack()
+                getCurrentPages().forEach(v => {
+                    if (v.__route__ == 'packageA/saleClue/modules/contacts/detail/index' || v.__route__ == 'packageA/contacts/detail' || v.__route__ == "packageA/publicCustomer/detail") {
+                        v.getDetail();
+                    } else if (v.selectComponent("#Contacts")) {
+                        let page = v.selectComponent("#Contacts");
+                        let index = page.data.list.findIndex(value => value.sat_orderclue_contactsid == res.data.sat_orderclue_contactsid);
+                        if (index != -1) page.setData({
+                            [`list[${index}]`]: res.data
+                        })
+
+                    } else if (v.__route__ == 'packageA/project/modules/contacts/search/index') {
+                        let index = v.data.list.findIndex(value => value.sat_orderclue_contactsid == res.data.sat_orderclue_contactsid);
+                        if (index != -1) v.setData({
+                            [`list[${index}]`]: res.data
+                        })
+                    }
+                });
+            }, 500)
+
+        });
+    },
+    /* 表单是否填写完成 */
+    onConfirm({
+        detail
+    }) {
+        this.setData({
+            disabled: detail
+        })
+    },
+    /* 是否显示全部 */
+    changefromShowAll({
+        detail
+    }) {
+        this.setData({
+            fromShowAll: detail
+        })
+    },
+})

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

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

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

@@ -0,0 +1,26 @@
+@import "../../../../setclient/modules/address/add/index.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;
+    z-index: 99999999999;
+
+    .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/saleClue/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' bind:interrupt='interrupt' />
+<view style="height: 140rpx;" />
+<view class="footer">
+	<van-button custom-class='but' disabled='{{disabled}}' bindtap="submit">{{language['确定']||'确定'}}</van-button>
+</view>

+ 136 - 0
packageA/saleClue/modules/contacts/detail/index.js

@@ -0,0 +1,136 @@
+const _Http = getApp().globalData.http;
+
+Page({
+    data: {
+        ownertable: "sys_phonebook",
+        sys_phonebookid: 0,
+        tabsActive: 0, //tabs 选中项
+        tabsList: [{
+            label: "详细信息",
+            icon: "icon-tabxiangxixinxi1"
+        }, {
+            label: "跟进动态",
+            icon: "icon-tabgenjinjilu"
+        }],
+    },
+    onLoad(options) {
+        console.log(options)
+        if (options.sys_phonebookid) {
+            this.setData({
+                sys_phonebookid: options.sys_phonebookid,
+                ownertable: options.ownertable || "sys_phonebook"
+            });
+            this.getDetail();
+        }
+    },
+    /* 获取详情信息 */
+    getDetail() {
+        _Http.basic({
+            "id": 20221026110602,
+            "content": {
+                "sys_phonebookid": this.data.sys_phonebookid
+            }
+        }).then(res => {
+            console.log("联系人详情", res)
+            const item = res.data;
+            this.setData({
+                detail: item,
+                briefs: [{
+                    label: "单位",
+                    value: item.enterprisename
+                }, {
+                    label: "联系方式",
+                    value: item.phonenumber
+                }],
+                list1: [{
+                    label: "姓名",
+                    value: item.name
+                }, {
+                    label: "联系方式",
+                    value: item.phonenumber
+                }, {
+                    label: "性别",
+                    value: item.sex
+                }, {
+                    label: "家庭住址",
+                    value: item.address
+                }, {
+                    label: "微信",
+                    value: item.wechatnum
+                }, {
+                    label: "邮箱",
+                    value: item.email
+                }, {
+                    label: "传真",
+                    value: item.fax
+                }, {
+                    label: "单位",
+                    value: item.enterprisename
+                }, {
+                    label: "部门",
+                    value: item.depname
+                }, {
+                    label: "职位",
+                    value: item.position
+                }, {
+                    label: "备注",
+                    value: item.remarks
+                }],
+                list2: [{
+                    label: "创建人",
+                    value: item.createby
+                }, {
+                    label: "创建时间",
+                    value: item.createdate
+                }]
+            });
+            this.getTags()
+        })
+    },
+    //tabs 切换
+    tabsChange({
+        detail
+    }) {
+        this.setData({
+            tabsActive: detail
+        });
+        this.partialRenewal();
+    },
+    //局部数据更新 tabs
+    partialRenewal(init = false) {
+        const id = this.data.detail.sys_phonebookid;
+        let model = '';
+        let name = this.data.tabsList[this.data.tabsActive].label;
+        switch (name) {
+            case "跟进动态":
+                model = "#Trace"
+                break;
+        };
+        if (model) {
+            // 确定好模块ID total = null 是第一次加载 加载数据
+            // init是新增或修改需要清数据
+            let Component = this.selectComponent(model);
+            const {
+                total,
+                pageNumber,
+                pageTotal
+            } = Component.data.content;
+            if (total == null || init) {
+                Component.getList(id, init);
+            } else if (pageNumber <= pageTotal) {
+                Component.getList(id, false);
+            }
+        }
+    },
+    //更新标签
+    getTags() {
+        this.selectComponent("#Tags").getTags();
+    },
+    //更新团队成员
+    getGroup() {
+        this.selectComponent("#Group").getList();
+    },
+    onReachBottom() {
+        this.partialRenewal();
+    }
+})

+ 7 - 0
packageA/saleClue/modules/contacts/detail/index.json

@@ -0,0 +1,7 @@
+{
+    "usingComponents": {
+        "Trace": "../../../../../packageA/setclient/modules/trace/index",
+        "preview": "../../../../../packageA/setclient/modules/preview/index"
+    },
+    "navigationBarTitleText": "联系人详情"
+}

+ 37 - 0
packageA/saleClue/modules/contacts/detail/index.scss

@@ -0,0 +1,37 @@
+.box {
+	width: 100vw;
+	background-color: #ffffff;
+	box-sizing: border-box;
+	padding: 20rpx 0 0rpx 30rpx;
+
+	.head {
+		display: flex;
+
+		.portrait {
+			display: flex;
+			align-items: center;
+			justify-content: center;
+			width: 96rpx;
+			height: 96rpx;
+			background: #3874F6;
+			border-radius: 50%;
+			font-size: 28rpx;
+			font-family: PingFang SC-Regular, PingFang SC;
+			color: #FFFFFF;
+			margin-right: 20rpx;
+			flex-shrink: 0;
+		}
+
+		.content {
+			.title {
+				font-size: 30rpx;
+				font-family: PingFang SC-Regular, PingFang SC;
+				color: #333333;
+			}
+
+			.tag {
+				margin-top: 16rpx;
+			}
+		}
+	}
+}

+ 35 - 0
packageA/saleClue/modules/contacts/detail/index.wxml

@@ -0,0 +1,35 @@
+<view class="box">
+    <view class="head">
+        <view class="portrait">
+            {{detail.name[0]}}
+        </view>
+        <view class="content">
+            <view class="title">
+                {{detail.name}}
+            </view>
+            <view class="tag">
+                <Yl-tags id="Tags" add ownertable='{{ownertable}}' ownerid='{{detail.sys_phonebookid}}' />
+            </view>
+        </view>
+    </view>
+</view>
+<!-- 简介 -->
+<Yl_Detail list="{{briefs}}">
+    <!-- 团队管理 -->
+    <Yl-group id='Group' slot='bottom' add ownertable='{{ownertable}}' ownerid='{{detail.sys_phonebookid}}' />
+</Yl_Detail>
+<view style="height: 20rpx;" />
+<!-- 功能 -->
+<Yl_FunTabs list='{{tabsList}}' active='{{tabsActive}}' bind:onChenge="tabsChange">
+    <view slot='详细信息'>
+        <!-- <Yl_Headline title='基本信息' type='switch' switchLabel='仅显示已填信息' switch='{{showAll}}' bind:callBack='onChange' /> -->
+        <preview showAll='{{!showAll}}' list1='{{list1}}' list2='{{list2}}' />
+
+
+
+
+        <!--  <Yl_Headline title='系统信息' />
+        <Yl_ReportForms showAll='{{!showAll}}' list='{{list2}}' /> -->
+    </view>
+    <Trace resource='联系人' slot='跟进动态' id='Trace' ownertable='{{ownertable}}' ownerid='{{detail.sys_phonebookid}}' />
+</Yl_FunTabs>

+ 67 - 0
packageA/saleClue/modules/contacts/index.js

@@ -0,0 +1,67 @@
+const _Http = getApp().globalData.http;
+Component({
+    properties: {
+        disabled: {
+            type: Boolean
+        },
+        path: {
+            type: String
+        },
+        enterprisename: {
+            type: String
+        },
+        sa_customersid: {
+            type: String
+        }
+    },
+    data: {
+        list: [],
+        sat_orderclueid: "",
+        content: {
+            "nacache": true,
+            "pageNumber": 1,
+            "pageSize": 20,
+            "pageTotal": 1,
+            "total": null,
+            "where": {
+                "condition": "",
+            }
+        },
+    },
+    lifetimes: {
+        attached: function () {
+            getApp().globalData.Language.getLanguagePackage(this)
+        }
+    },
+    methods: {
+        getList(id, init) {
+            let content = this.data.content;
+            content.sat_orderclueid = id;
+            if (init) content.pageNumber = 1;
+            _Http.basic({
+                "id": "2025042110014402",
+                content
+            }).then(res => {
+                console.log("联系人", res)
+                if (res.code != '1') return wx.showToast({
+                    title: res.data,
+                    icon: "none"
+                })
+                this.setData({
+                    list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data),
+                    "content.pageNumber": res.pageNumber + 1,
+                    "content.pageSize": res.pageSize,
+                    "content.pageTotal": res.pageTotal,
+                    "content.total": res.total,
+                    sat_orderclueid: id
+                })
+            })
+        },
+        /* 修改总数 */
+        changeTotal() {
+            this.setData({
+                "content.total": this.data.content.total - 1
+            })
+        }
+    }
+})

+ 6 - 0
packageA/saleClue/modules/contacts/index.json

@@ -0,0 +1,6 @@
+{
+    "component": true,
+    "usingComponents": {
+        "list": "./list/index"
+    }
+}

+ 1 - 0
packageA/saleClue/modules/contacts/index.scss

@@ -0,0 +1 @@
+@import "../../../setclient/modules/address/head.scss";

+ 13 - 0
packageA/saleClue/modules/contacts/index.wxml

@@ -0,0 +1,13 @@
+<view class="head">
+    <view class="count">
+        <text wx:if="{{language['总共']}}">{{language['总共']}}:{{content.total}}</text>
+        <text wx:else>总共{{content.total}}个</text>
+    </view>
+    <view class="expand">
+        <navigator wx:if="{{disabled}}" url="{{path+'?sat_orderclueid='+sat_orderclueid+'&enterprisename='+enterprisename+'&sa_customersid='+sa_customersid}}" class="but">
+            <van-icon name="plus" />
+        </navigator>
+    </view>
+</view>
+
+<list list='{{list}}' disabled='{{disabled}}' enterprisename='{{enterprisename}}' sat_orderclueid='{{sat_orderclueid}}' sa_customersid='{{sa_customersid}}' bindchangeTotal="changeTotal" />

+ 99 - 0
packageA/saleClue/modules/contacts/list/index.js

@@ -0,0 +1,99 @@
+const _Http = getApp().globalData.http;
+Component({
+    options: {
+        addGlobalClass: true
+    },
+    properties: {
+        list: {
+            type: Array
+        },
+        changeTotal: {
+            type: Function
+        },
+        disabled: {
+            type: Boolean
+        },
+        enterprisename: {
+            type: String
+        },
+        sat_orderclueid: {
+            type: String
+        },
+        sa_customersid: {
+            type: String
+        },
+        groupname: {
+            type: String,
+            value: "客户联系人"
+        },
+    },
+    lifetimes: {
+        attached: function () {
+            getApp().globalData.Language.getLanguagePackage(this)
+        }
+    },
+    methods: {
+        handleItem(e) {
+            const {
+                name,
+                item
+            } = e.target.dataset,
+                that = this;
+            switch (name) {
+                case "call":
+                    wx.makePhoneCall({
+                        phoneNumber: item.phonenumber,
+                    })
+                    break;
+                case "delete":
+                    wx.showModal({
+                        title: getApp().globalData.Language.getMapText('提示'),
+                        content: getApp().globalData.Language.getMapText('是否确认删除') + `"${item.name}"`,
+                        cancelText: getApp().globalData.Language.getMapText('取消'),
+                        confirmText: getApp().globalData.Language.getMapText('确定'),
+                        complete: (res) => {
+                            if (res.confirm) _Http.basic({
+                                "id": "2025042110012902",
+                                "content": {
+                                    "sat_orderclue_contactsid": item.sat_orderclue_contactsid
+                                }
+                            }).then(res => {
+                                console.log("删除联系人", res)
+                                if (res.code != '1') return wx.showToast({
+                                    title: res.data,
+                                    icon: "none"
+                                });
+                                that.triggerEvent("changeTotal")
+                                wx.showToast({
+                                    title: getApp().globalData.Language.getMapText('删除成功') + '!',
+                                    icon: "none"
+                                })
+                                getCurrentPages().forEach(v => {
+                                    if (v.__route__ == "packageA/saleClue/detail" || v.__route__ == "packageA/opponent/detail" || v.__route__ == "packageA/publicCustomer/detail") {
+                                        let model = v.selectComponent("#Contacts");
+                                        model.setData({
+                                            list: model.data.list.filter(value => value.sat_orderclue_contactsid != item.sat_orderclue_contactsid)
+                                        });
+                                    } else if (v.__route__ == "packageA/saleClue/modules/contacts/search/index") {
+                                        v.setData({
+                                            list: v.data.list.filter(value => value.sat_orderclue_contactsid != item.sat_orderclue_contactsid)
+                                        });
+                                    } else if (v.__route__ == "packageA/saleClue/modules/contacts/detail/index") {
+                                        wx.navigateBack()
+                                    } else if (v.__route__ == "packageA/publicCustomer/detail" || v.__route__ == "packageA/saleClue/detail") {
+                                        v.getDetail()
+                                    }
+                                })
+                            })
+                        }
+                    })
+                    break;
+                case "edit":
+                    wx.navigateTo({
+                        url: `/packageA/saleClue/modules/contacts/add/index?data=${JSON.stringify(item)}&enterprisename=${this.data.enterprisename}&sa_customersid=${this.data.sa_customersid}&sat_orderclueid=${this.data.sat_orderclueid}&sat_orderclue_contactsid=${item.sat_orderclue_contactsid}`
+                    })
+                    break;
+            }
+        },
+    }
+})

+ 6 - 0
packageA/saleClue/modules/contacts/list/index.json

@@ -0,0 +1,6 @@
+{
+    "component": true,
+    "usingComponents": {
+        "van-action-sheet": "@vant/weapp/action-sheet/index"
+    }
+}

+ 82 - 0
packageA/saleClue/modules/contacts/list/index.scss

@@ -0,0 +1,82 @@
+.item {
+	width: 100vw;
+	background-color: #ffffff;
+	margin-bottom: 20rpx;
+
+	.content {
+			padding: 20rpx 0;
+			padding-left: 30rpx;
+			border-bottom: 1px solid #DDD;
+			box-sizing: border-box;
+
+			.user {
+					display: flex;
+					width: 100%;
+
+					.portrait {
+							width: 64rpx;
+							height: 64rpx;
+							text-align: center;
+							line-height: 64rpx;
+							background: #3874F6;
+							border-radius: 50%;
+							margin-top: 12rpx;
+							margin-right: 16rpx;
+							flex-shrink: 0;
+							font-size: 24rpx;
+							font-family: PingFang SC-Regular, PingFang SC;
+							color: #FFFFFF;
+					}
+
+					.right {
+							flex: 1;
+
+							.title {
+									height: 42rpx;
+									line-height: 42rpx;
+									font-size: 30rpx;
+									font-family: PingFang SC-Regular, PingFang SC;
+									color: #333333;
+
+									text {
+											margin-left: 20rpx;
+											font-size: 24rpx;
+											font-family: PingFang SC-Regular, PingFang SC;
+											color: #999999;
+									}
+							}
+
+							.exp {
+									font-size: 24rpx;
+									font-family: PingFang SC-Regular, PingFang SC;
+									color: #333333;
+							}
+					}
+			}
+
+
+	}
+
+	.editor {
+			display: flex;
+			justify-content: space-between;
+			align-items: center;
+			width: 100%;
+			height: 80rpx;
+
+			.icon-but {
+					padding-right: 30rpx;
+
+					navigator {
+							display: inline-block;
+							width: 60rpx;
+							height: 60rpx;
+							line-height: 60rpx;
+							text-align: center;
+							margin-left: 30rpx;
+							width: 32px;
+							color: #707070;
+					}
+			}
+	}
+}

+ 25 - 0
packageA/saleClue/modules/contacts/list/index.wxml

@@ -0,0 +1,25 @@
+<view class="item" wx:for="{{list}}" wx:key="changeuserid">
+    <navigator url="/packageA/contacts/detail?id={{item.sys_phonebookid}}&groupname=线索联系人" class="content">
+        <view class="user">
+            <view class="portrait">
+                {{item.name[0]}}
+            </view>
+            <view class="right">
+                <view class="title">
+                    {{item.name}}<text>{{language[item.position]||item.position}}</text>
+                </view>
+                <view class="exp" style="margin-top: 10rpx;">{{language['联系方式']||'联系方式'}}:{{item.phonenumber || ' --'}}</view>
+            </view>
+        </view>
+    </navigator>
+    <view class="editor">
+        <view />
+        <view class="icon-but" bindtap="handleItem">
+            <navigator url="#" data-item="{{item}}" data-name="call" class="iconfont icon-bodadianhua" />
+            <navigator url="#" data-item="{{item}}" wx:if="{{disabled}}" data-name="edit" class="iconfont icon-bianji" />
+            <navigator url="#" data-item="{{item}}" wx:if="{{disabled}}" data-name="delete" class="iconfont icon-shanchu" />
+        </view>
+    </view>
+
+</view>
+<My_empty wx:if="{{list.length==0}}" />

+ 115 - 0
packageA/saleClue/modules/contacts/quickly/index.js

@@ -0,0 +1,115 @@
+const _Http = getApp().globalData.http;
+
+Page({
+    data: {
+        content: {
+            nocache: true,
+            pageNumber: 1,
+            pageSize: 20,
+            pageTotal: 1,
+            total: 0,
+            where: {
+                "condition": "",
+            }
+        },
+        list: [],
+        sa_customersid: 0,
+        loading: false
+    },
+    getList(init = false) {
+        _Http.init(this.data.content, init).then(content => {
+            _Http.basic({
+                "id": 2025042110061502,
+                content
+            }).then(res => {
+                this.selectComponent('#ListBox').RefreshToComplete();
+                console.log("通讯录列表", res)
+                if (res.code != '1') return wx.showToast({
+                    title: res.data,
+                    icon: "none"
+                });
+                this.setData({
+                    list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data),
+                    content: _Http.paging(content, res),
+                })
+            })
+        })
+    },
+    onLoad(options) {
+        if (options.sat_orderclueid) this.setData({
+            'content.ownertable': 'sat_orderclue',
+            'content.ownerid': options.sat_orderclueid,
+            'content.sa_customersid': options.sat_orderclueid,
+            enterprisename: options.enterprisename,
+            sa_customersid: options.sa_customersid
+        });
+        this.getList();
+        getApp().globalData.Language.getLanguagePackage(this, '选择联系人');
+    },
+    /* 默认添加 */
+    created() {
+        wx.redirectTo({
+            url: '/packageA/saleClue/modules/contacts/add/index?sat_orderclueid=' + this.data.content.ownerid + "&enterprisename=" + this.data.enterprisename + "&sa_customersid=" + this.data.sa_customersid,
+        })
+    },
+    onClick(e) {
+        if (this.data.loading) return;
+        const {
+            item
+        } = e.currentTarget.dataset;
+        delete(item.tag1)
+        item.sat_orderclueid = this.data.content.ownerid;
+        this.data.loading = true;
+        _Http.basic({
+            "id": "2025042110003902",
+            content: item
+        }).then(res => {
+            console.log("编辑联系人", res)
+            this.data.loading = false;
+            wx.showToast({
+                title: res.code != '1' ? res.msg : getApp().globalData.Language.getMapText('添加成功'),
+                icon: "none",
+                mask: true
+            });
+            if (res.code == '1') setTimeout(() => {
+                wx.navigateBack()
+                getCurrentPages().forEach(v => {
+                    if (v.__route__ == 'packageA/saleClue/modules/contacts/detail/index' || v.__route__ == 'packageA/contacts/detail') {
+                        v.getDetail();
+                    } else if (v.selectComponent("#Contacts")) {
+                        let page = v.selectComponent("#Contacts");
+                        page.getList(page.data.content.sat_orderclueid, true)
+                    } else if (v.__route__ == 'packageA/project/modules/contacts/search/index') {
+                        let index = v.data.list.findIndex(value => value.sat_orderclue_contactsid == res.data.sat_orderclue_contactsid);
+                        if (index != -1) v.setData({
+                            [`list[${index}]`]: res.data
+                        })
+                    }
+                });
+            }, 500)
+
+        });
+
+        return;
+        wx.redirectTo({
+            url: `/packageA/saleClue/modules/contacts/add/index?sat_orderclueid=${this.data.content.ownerid}&enterprisename=${this.data.enterprisename}&sa_customersid=${this.data.sa_customersid}&data=${JSON.stringify(item)}`,
+        })
+    },
+    onSearch({
+        detail
+    }) {
+        this.setData({
+            'content.where.condition': detail ? detail : ""
+        });
+        this.getList(true);
+    },
+    onClear() {
+        this.setData({
+            'content.where.condition': ""
+        });
+        this.getList(true);
+    },
+    onReachBottom() {
+        this.getList();
+    },
+})

+ 7 - 0
packageA/saleClue/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": "选择联系人"
+}

+ 100 - 0
packageA/saleClue/modules/contacts/quickly/index.scss

@@ -0,0 +1,100 @@
+.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: 0;
+							flex: 1;
+							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;
+	}
+}

+ 30 - 0
packageA/saleClue/modules/contacts/quickly/index.wxml

@@ -0,0 +1,30 @@
+<view style="position: sticky; top: 0;">
+    <van-search custom-class='search' value="{{ value }}" shape="round" background="#fff" placeholder="{{language['搜索姓名、手机号']||'搜索姓名、手机号'}}" bind:search='onSearch' bind:clear='onClear' />
+</view>
+<view style="height: 20rpx;" />
+<Yl_ListBox id='ListBox' bind:getlist='getList'>
+    <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">
+                        {{language[item.position]||item.position}}
+                        {{item.phonenumber}}
+                    </view>
+                </view>
+            </view>
+        </navigator>
+    </view>
+    <My_empty wx:if="{{list.length==0}}" />
+    <view style="height: 120rpx;" />
+</Yl_ListBox>
+<view class="footer">
+    <van-button custom-class='base add' bindtap="created">{{language['创建联系人']||'创建联系人'}}</van-button>
+</view>