zhaoxiaohai 3 лет назад
Родитель
Сommit
a335218ca0

+ 37 - 0
packageA/project/detail.js

@@ -194,6 +194,43 @@ 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)
+                    })
+                }
+            }
+        })
+    },
     //局部数据更新 tabs
     partialRenewal(init = false) {
         const id = this.data.detail.sa_projectid;

+ 19 - 0
packageA/project/modules/contacts/index.js

@@ -40,6 +40,25 @@ Component({
                 })
             })
         },
+        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({

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

@@ -4,7 +4,7 @@
         <navigator url="/packageA/project/modules/contacts/search/index?sa_projectid={{sa_projectid}}" class="but" bindtap="toSearch">
             <van-icon name="search" />
         </navigator>
-        <navigator url="/packageA/project/modules/contacts/select/index?sa_projectid={{sa_projectid}}" class="but">
+        <navigator url="#" class="but" bindtap="addContacts">
             <van-icon name="plus" />
         </navigator>
     </view>

+ 23 - 1
packageA/project/modules/treaty/index.js

@@ -102,13 +102,35 @@ Component({
                     })
                     break;
                 case 'change':
-                    
+
                     break;
                 default:
 
                     console.log(detail.name)
                     break;
             }
+        },
+        /* 添加关联 */
+        submit(content = false) {
+            if (!content) return;
+            _Http.basic({
+                "id": 20221111102902,
+                content
+            }).then(res => {
+                console.log("批量添加客户", res)
+                if (res.msg != '成功') return wx.showToast({
+                    title: res.data,
+                    icon: "none"
+                });
+                wx.showToast({
+                    title: '添加成功',
+                    icon: "none"
+                })
+                setTimeout(() => {
+                    this.getList(content.sa_projectid, true);
+                    wx.navigateBack();
+                }, 300)
+            })
         }
     }
 })