|
@@ -4,7 +4,10 @@ Page({
|
|
|
data: {
|
|
|
radio: false, //是否为单选
|
|
|
obj: false, //是否返回数组对象
|
|
|
+ model: "", //提交上一级组件中的事件
|
|
|
+ principal: false, //是否为更换负责人
|
|
|
content: {
|
|
|
+ nocache: true,
|
|
|
ownertable: null,
|
|
|
ownerid: null,
|
|
|
pageSize: 20,
|
|
@@ -26,6 +29,19 @@ Page({
|
|
|
if (options.obj) this.setData({
|
|
|
obj: true
|
|
|
});
|
|
|
+ //调用上一级组件中的提交事件
|
|
|
+ if (options.model) this.setData({
|
|
|
+ model: options.model
|
|
|
+ });
|
|
|
+ //是否为更换负责人
|
|
|
+ if (options.principal) {
|
|
|
+ this.setData({
|
|
|
+ principal: true
|
|
|
+ })
|
|
|
+ wx.setNavigationBarTitle({
|
|
|
+ title: '更换负责人'
|
|
|
+ })
|
|
|
+ }
|
|
|
if (options.data) {
|
|
|
let {
|
|
|
ownertable,
|
|
@@ -48,8 +64,12 @@ Page({
|
|
|
let result = this.data.result;
|
|
|
if (result.length == 0) return;
|
|
|
let pages = getCurrentPages();
|
|
|
- let list = this.data.obj ? result.map(id => this.data.list.find(v => v.userid == id)) : result
|
|
|
- pages[pages.length - 2].handelSubmit(list);
|
|
|
+ let list = this.data.obj ? result.map(id => this.data.list.find(v => v.userid == id)) : result;
|
|
|
+ if (this.data.model) {
|
|
|
+ pages[pages.length - 2].selectComponent("#" + this.data.model).handelSubmit(list);
|
|
|
+ } else {
|
|
|
+ pages[pages.length - 2].handelSubmit(list);
|
|
|
+ }
|
|
|
},
|
|
|
/* 选中 */
|
|
|
onChange(e) {
|
|
@@ -79,17 +99,35 @@ Page({
|
|
|
content.pageNumber = 1
|
|
|
}
|
|
|
if (content.pageNumber > content.pageTotal) return;
|
|
|
- _Http.basic({
|
|
|
- "id": 20221018122201,
|
|
|
- content
|
|
|
- }).then(res => {
|
|
|
- console.log("数据团队列表", res)
|
|
|
- this.setData({
|
|
|
- list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data),
|
|
|
- "content.pageTotal": res.pageTotal,
|
|
|
- "content.pageNumber": res.pageNumber + 1,
|
|
|
+ if (this.data.principal) {
|
|
|
+
|
|
|
+ _Http.basic({
|
|
|
+ "id": 20220930103501,
|
|
|
+ content
|
|
|
+ }).then(res => {
|
|
|
+ console.log("团队成员列表", res)
|
|
|
+ if (res.msg != '成功') return wx.showToast({
|
|
|
+ title: res.data,
|
|
|
+ icon: "none"
|
|
|
+ })
|
|
|
+ let data = res.data.find(v => v.ismyteam == 1);
|
|
|
+ this.setData({
|
|
|
+ list: data.team.filter(v => v.userid != data.teamleader[0].userid)
|
|
|
+ })
|
|
|
})
|
|
|
- })
|
|
|
+ } else {
|
|
|
+ _Http.basic({
|
|
|
+ "id": 20221018122201,
|
|
|
+ content
|
|
|
+ }).then(res => {
|
|
|
+ console.log("数据团队列表", res)
|
|
|
+ this.setData({
|
|
|
+ list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data),
|
|
|
+ "content.pageTotal": res.pageTotal,
|
|
|
+ "content.pageNumber": res.pageNumber + 1,
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
onReachBottom() {
|
|
|
this.getList();
|