Parcourir la source

关联企业修改

xiaohaizhao il y a 1 an
Parent
commit
cddd68c6c5

+ 7 - 4
packageA/project/modules/contacts/add/index.js

@@ -81,9 +81,9 @@ Page({
                 query: "&radio=true",
                 placeholder: "选择关联企业",
                 valueName: "sys_enterpriseid",
-                required: false,
+                required: true,
                 checking: "base",
-            },  {
+            }, {
                 label: "部门",
                 error: false,
                 errMsg: "",
@@ -185,11 +185,11 @@ Page({
         }
     },
     onLoad(options) {
-        console.log(options)
         if (options.sa_projectid) this.data.content.sa_projectid = options.sa_projectid;
         if (options.data) {
             let item = JSON.parse(options.data),
                 arr = item.phonenumber.split("-");
+            console.log("item", item)
             if (item.sys_enterpriseid == 0) this.data.form = this.data.form.filter(v => v.valueName != 'sys_enterpriseid');
             item.sys_enterpriseid = item.enterprisename ? [item.enterprisename, [item.sys_enterpriseid]] : '';
             item.isTelephone = arr.length == 2 ? "1" : "0";
@@ -224,7 +224,10 @@ Page({
                     } else {
                         // v.value = Object.hasOwn(item, v.valueName) ? item[v.valueName] : v.value;
                         v.value = item[v.valueName] || v.value || '';
-                        if (v.valueName == 'sys_enterpriseid') v.disabled = true || item.enterprisename
+                        if (v.valueName == 'sys_enterpriseid') {
+                            v.query = v.query + ('&sys_phonebookid=' + (options.sys_phonebookid ? options.sys_phonebookid : item.sys_phonebookid || 0))
+                            console.log(v)
+                        }
                     }
                     return v
                 })

+ 5 - 4
packageA/project/modules/contacts/quickly/index.js

@@ -62,6 +62,10 @@ Page({
             item
         } = e.currentTarget.dataset;
         delete(item.tag1)
+        return wx.redirectTo({
+            url: `/packageA/project/modules/contacts/add/index?sa_projectid=${this.data.content.sa_projectid}&data=${JSON.stringify(item)}&sys_phonebookid=${item.sys_phonebookid}`,
+        })
+
         item.sa_project_contactsid = 0;
         item.sa_projectid = this.data.content.sa_projectid;
         item.ownertable = "sa_project";
@@ -88,10 +92,7 @@ Page({
                 });
             }, 500)
         })
-        return
-        wx.redirectTo({
-            url: `/packageA/project/modules/contacts/add/index?sa_projectid=${this.data.content.sa_projectid}&data=${JSON.stringify(item)}`,
-        })
+       
     },
     onSearch({
         detail