+
+
+
![]()
+
+
+
+ {{ item.aliasName || item.userName }}
+
+
+
+ @{{ agencyInfo.fullName }}
+
+
+
+
{{ item.teamName }}({{ item.userNum }})
-
@@ -115,6 +142,7 @@
export default {
data() {
return {
+ memberList: [],
teamList: [],
currentId: "",
currentParentId: "",
@@ -126,6 +154,7 @@ export default {
editNameValue: "",
deleteShow: false,
deleteLoading: false,
+ agencyInfo: uni.getStorageSync("agencyInfo"),
};
},
onLoad(options) {
@@ -138,12 +167,57 @@ export default {
});
},
onShow() {
- this.initData();
+ this.getList();
},
methods: {
- initData() {
- let childs = uni.getStorageSync("childGroup_childs") || [];
- this.teamList = childs;
+ compare(a, b) {
+ let sortList = ["创建人", "管理员", "成员"];
+ if (sortList.includes(a) && sortList.includes(b)) {
+ return sortList.indexOf(a) - sortList.indexOf(b);
+ } else if (sortList.includes(a)) {
+ return -1;
+ } else if (sortList.includes(b)) {
+ return 1;
+ } else {
+ return a.localeCompare(b);
+ }
+ },
+ getDisplayRoles(roles) {
+ if (!roles || roles.length <= 2) {
+ return (roles || []).filter(role => role && role.trim());
+ }
+ const filteredRoles = (roles || []).filter(role => role && role.trim());
+ if (filteredRoles.length <= 3) {
+ return filteredRoles;
+ }
+ return [...filteredRoles.slice(0, 3), '...'];
+ },
+ getList() {
+ let that = this;
+ uni.showLoading({
+ title: "加载中...",
+ });
+ that.G.Post('/yishoudan/agency/team/list', {}, (teamRes) => {
+ let currentChild = that.findChildById(teamRes.list, that.currentId);
+ that.teamList = currentChild ? (currentChild.childs || []) : [];
+
+ that.G.Get(that.api.order_peopleList, {
+ pageSize: 500,
+ agencyTeamIds: that.currentId,
+ }, (res) => {
+ that.memberList = res.recordList || [];
+ that.memberList.forEach((item) => {
+ item.agencyRoleNameList = item.agencyRoleName.split(";");
+ item.agencyRoleNameList = item.agencyRoleNameList.sort(that.compare);
+ });
+ uni.hideLoading();
+ });
+ });
+ },
+ editMember(_item) {
+ uni.navigateTo({
+ url: "/root/merchantManagement/addOrUpdataMember?info=" + JSON.stringify(_item),
+ });
},
goChildGroup(item) {
uni.setStorageSync("childGroup_childs", item.childs || []);
@@ -192,7 +266,7 @@ export default {
uni.setNavigationBarTitle({
title: this.pageTitle,
});
- this.refreshList();
+ this.getList();
}, (err) => {
this.editNameLoading = false;
});
@@ -200,7 +274,7 @@ export default {
submitDelete() {
if (this.deleteLoading) return;
this.deleteLoading = true;
- this.G.Post(`/yishoudan/agency/team/del/${this.currentId}`, {}, (res) => {
+ this.G.Get(`/yishoudan/agency/team/del/${this.currentId}`, {}, (res) => {
this.deleteLoading = false;
uni.showToast({
title: "删除成功",
@@ -211,15 +285,6 @@ export default {
this.deleteLoading = false;
});
},
- refreshList() {
- this.G.Post('/yishoudan/agency/team/list', {}, (res) => {
- let currentChild = this.findChildById(res.list, this.currentId);
- if (currentChild) {
- this.teamList = currentChild.childs || [];
- uni.setStorageSync("childGroup_childs", this.teamList);
- }
- });
- },
findChildById(list, id) {
for (let item of list) {
if (String(item.id) === String(id)) {
@@ -237,4 +302,22 @@ export default {
diff --git a/root/merchantManagement/teamManage.vue b/root/merchantManagement/teamManage.vue
index 0a4afff..86e520f 100644
--- a/root/merchantManagement/teamManage.vue
+++ b/root/merchantManagement/teamManage.vue
@@ -200,7 +200,10 @@ export default {
console.log('部门列表:', teamRes.list)
// 成员列表
- this.G.Get(this.api.order_peopleList, { pageSize: 500 }, (res) => {
+ this.G.Get(this.api.order_peopleList, {
+ pageSize: 500,
+ agencyTeamIds:-1
+ }, (res) => {
console.log("成员列表:", res);
that.memberList = res.recordList;
that.memberList.forEach((item) => {