Przeglądaj źródła

客户联系人标签外挂到plm_unit表

xiaohaizhao 2 lat temu
rodzic
commit
982e9df6c3

+ 1 - 1
packageA/contacts/details.wxml

@@ -14,7 +14,7 @@
             {{contacts.name}}
         </view>
         <view class="tag">
-            <Yl-tags wx:if="{{contacts.groupname=='客户联系人'}}" id="Tags" add ownertable='sys_enterprise_contacts' ownerid='{{contacts.contactsid}}' />
+            <Yl-tags wx:if="{{contacts.groupname=='客户联系人'}}" id="Tags" add ownertable='plm_unit' ownerid='{{contacts.contactsid}}' />
             <Yl-tags wx:elif="{{contacts.groupname=='项目联系人'}}" id="Tags" add ownertable='sa_project_contacts' ownerid='{{contacts.contactsid}}' />
             <Yl-tags wx:else id="Tags" add ownertable='sys_phonebook' ownerid='{{contacts.sys_phonebookid}}' />
         </view>

+ 1 - 1
packageA/contacts/list.js

@@ -30,7 +30,7 @@ Page({
                 };
                 switch (options.groupname) {
                     case '客户联系人':
-                        param.content.ownertable = 'sys_enterprise_contacts';
+                        param.content.ownertable = 'plm_unit';
                         break;
                     case '项目联系人':
                         param.content.ownertable = 'sa_project_contacts';

+ 91 - 81
packageA/setclient/modules/contacts/list/index.js

@@ -1,84 +1,94 @@
 const _Http = getApp().globalData.http;
 Component({
-	options: {
-		addGlobalClass: true
-	},
-	properties: {
-		list: {type:Array},
-		changeTotal: {type:Function},
-		disabled: {type:Boolean},
-		enterprisename: {type:String},
-		sys_enterpriseid: {type:String}
-	},
-	data: {},
-	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: '提示',
-						content: `是否确认删除"${item.name}"`,
-						complete: (res) => {
-							if (res.confirm) _Http.basic({
-								"id": "20221018145502",
-								"content": {
-									"contactsid": item.contactsid,
-									"sys_enterpriseid": item.sys_enterpriseid
-								}
-							}).then(res => {
-								console.log("删除联系人", res)
-								if (res.msg != '成功') return wx.showToast({
-									title: res.data,
-									icon: "none"
-								});
-								that.triggerEvent("changeTotal")
-								wx.showToast({
-									title: `删除成功!`,
-									icon: "none"
-								})
-								getCurrentPages().forEach(v => {
-									if (v.__route__ == "packageA/setclient/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.contactsid != item.contactsid)
-										});
-										// model.changeTotal();
-									} else if (v.__route__ == "packageA/setclient/modules/contacts/search/index") {
-										v.setData({
-											list: v.data.list.filter(value => value.contactsid != item.contactsid)
-										});
-									} else if (v.__route__ == "packageA/setclient/modules/contacts/detail/index") {
-										wx.navigateBack()
-									}
-								})
-							})
-						}
-					})
-					break;
-				case "edit":
-					wx.navigateTo({
-						url: `/packageA/setclient/modules/contacts/add/index?data=${JSON.stringify(item)}&enterprisename=${this.data.enterprisename}&sys_enterpriseid=${this.data.sys_enterpriseid}&contactsid=${item.contactsid}`
-					})
-					break;
-			}
-		},
-		toDetail(e) {
-			const {
-				item
-			} = e.currentTarget.dataset;
-			wx.navigateTo({
-				url: '/packageA/setclient/modules/contacts/detail/index?contactsid=' + item.contactsid
-			})
-		},
-	}
+    options: {
+        addGlobalClass: true
+    },
+    properties: {
+        list: {
+            type: Array
+        },
+        changeTotal: {
+            type: Function
+        },
+        disabled: {
+            type: Boolean
+        },
+        enterprisename: {
+            type: String
+        },
+        sys_enterpriseid: {
+            type: String
+        }
+    },
+    data: {},
+    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: '提示',
+                        content: `是否确认删除"${item.name}"`,
+                        complete: (res) => {
+                            if (res.confirm) _Http.basic({
+                                "id": "20221018145502",
+                                "content": {
+                                    "contactsid": item.contactsid,
+                                    "sys_enterpriseid": item.sys_enterpriseid
+                                }
+                            }).then(res => {
+                                console.log("删除联系人", res)
+                                if (res.msg != '成功') return wx.showToast({
+                                    title: res.data,
+                                    icon: "none"
+                                });
+                                that.triggerEvent("changeTotal")
+                                wx.showToast({
+                                    title: `删除成功!`,
+                                    icon: "none"
+                                })
+                                getCurrentPages().forEach(v => {
+                                    if (v.__route__ == "packageA/setclient/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.contactsid != item.contactsid)
+                                        });
+                                        // model.changeTotal();
+                                    } else if (v.__route__ == "packageA/setclient/modules/contacts/search/index") {
+                                        v.setData({
+                                            list: v.data.list.filter(value => value.contactsid != item.contactsid)
+                                        });
+                                    } else if (v.__route__ == "packageA/setclient/modules/contacts/detail/index") {
+                                        wx.navigateBack()
+                                    }
+                                })
+                            })
+                        }
+                    })
+                    break;
+                case "edit":
+                    wx.navigateTo({
+                        url: `/packageA/setclient/modules/contacts/add/index?data=${JSON.stringify(item)}&enterprisename=${this.data.enterprisename}&sys_enterpriseid=${this.data.sys_enterpriseid}&contactsid=${item.contactsid}`
+                    })
+                    break;
+            }
+        },
+        toDetail(e) {
+            const {
+                item
+            } = e.currentTarget.dataset;
+            wx.navigateTo({
+                url: '/packageA/setclient/modules/contacts/detail/index?contactsid=' + item.contactsid + "&ownertable=plm_unit"
+            })
+        },
+    }
 })