Browse Source

成员选择

zhaoxiaohai 3 years ago
parent
commit
4bc0050dfd
1 changed files with 11 additions and 29 deletions
  1. 11 29
      packageA/group/select.js

+ 11 - 29
packageA/group/select.js

@@ -4,8 +4,8 @@ Page({
     data: {
         radio: false, //是否为单选
         content: {
-            "ownertable": "sa_itemgroup",
-            "ownerid": 11,
+            ownertable: null,
+            ownerid: null,
             pageSize: 20,
             pageNumber: 1,
             pageTotal: 1,
@@ -21,41 +21,23 @@ Page({
         if (options.radio) this.setData({
             radio: true
         })
-        if (options.ownertable) {
+        if (options.data) {
+            let {
+                ownertable,
+                ownerid
+            } = JSON.parse(options.data);
             this.setData({
-                "content.ownertable": options.ownertable,
-                "content.ownerid": options.ownerid,
+                "content.ownertable": ownertable,
+                "content.ownerid": ownerid,
             });
             this.getList();
-            console.log(this.data.content)
         };
     },
     submit() {
         let result = this.data.result;
         if (result.length == 0) return;
-        console.log(result)
-        _Http.basic({
-            "id": 20220930103601,
-            "content": {
-                "ownertable": this.data.content.ownertable,
-                "ownerid": this.data.content.ownerid,
-                "userids": result
-            }
-        }).then(res => {
-            if (res.msg != '成功') return wx.showToast({
-                title: res.data,
-                icon: "none"
-            });
-            wx.showToast({
-                title: '保存成功',
-                icon: "none"
-            });
-            setTimeout(() => {
-                const pages = getCurrentPages();
-                pages[pages.length - 2].selectComponent("#Group").getList();
-                wx.navigateBack();
-            }, 300)
-        })
+        let pages = getCurrentPages();
+        pages[pages.length - 2].handelSubmit(result);
     },
     /* 选中 */
     onChange(e) {