|
@@ -45,10 +45,23 @@
|
|
|
v-if="!user.fsUserId"
|
|
v-if="!user.fsUserId"
|
|
|
>绑定会员</el-button>
|
|
>绑定会员</el-button>
|
|
|
|
|
|
|
|
- <div v-if="user.fsUserId" style="margin-top: 10px;">
|
|
|
|
|
|
|
+ <div v-if="user.fsUserIdArray && user.fsUserIdArray.length > 0" style="margin-top: 10px;">
|
|
|
<el-tag type="success">已绑定会员</el-tag>
|
|
<el-tag type="success">已绑定会员</el-tag>
|
|
|
- <div style="margin-top: 5px; font-size: 12px; color: #666;">
|
|
|
|
|
- 会员ID: {{ user.fsUserId }}
|
|
|
|
|
|
|
+ <div style="margin-top: 10px;">
|
|
|
|
|
+ <div
|
|
|
|
|
+ v-for="(fsUserId, index) in user.fsUserIdArray"
|
|
|
|
|
+ :key="index" style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px;"
|
|
|
|
|
+ >
|
|
|
|
|
+ <span style="font-size: 12px; color: #666;">会员ID: {{ fsUserId }}</span>
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ type="danger"
|
|
|
|
|
+ icon="el-icon-delete"
|
|
|
|
|
+ @click="handleUnbindSpecificMember(fsUserId)"
|
|
|
|
|
+ >
|
|
|
|
|
+ 解绑
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -172,7 +185,7 @@
|
|
|
import userAvatar from "./userAvatar";
|
|
import userAvatar from "./userAvatar";
|
|
|
import userInfo from "./userInfo";
|
|
import userInfo from "./userInfo";
|
|
|
import resetPwd from "./resetPwd";
|
|
import resetPwd from "./resetPwd";
|
|
|
-import { getUserProfile,getSaleBindUserList, bindSaleAndFsUser } from "@/api/company/companyUser";
|
|
|
|
|
|
|
+import { getUserProfile,getSaleBindUserList, bindSaleAndFsUser, unbindSaleAndFsUser } from "@/api/company/companyUser";
|
|
|
import { getWechatBindQrcode, checkWechatBindStatus } from "@/api/wechat";
|
|
import { getWechatBindQrcode, checkWechatBindStatus } from "@/api/wechat";
|
|
|
export default {
|
|
export default {
|
|
|
name: "Profile",
|
|
name: "Profile",
|
|
@@ -220,6 +233,12 @@ export default {
|
|
|
this.user = response.data;
|
|
this.user = response.data;
|
|
|
this.roleGroup = response.roleGroup;
|
|
this.roleGroup = response.roleGroup;
|
|
|
this.postGroup = response.postGroup;
|
|
this.postGroup = response.postGroup;
|
|
|
|
|
+ // 将 fsUserId 字符串拆分为数组
|
|
|
|
|
+ if (this.user.fsUserId) {
|
|
|
|
|
+ this.user.fsUserIdArray = this.user.fsUserId.split(',').map(id => id.trim());
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.user.fsUserIdArray = [];
|
|
|
|
|
+ }
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
/**
|
|
/**
|
|
@@ -240,6 +259,44 @@ export default {
|
|
|
this.getMemberList();
|
|
this.getMemberList();
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 解绑指定会员
|
|
|
|
|
+ * @param {string} fsUserId - 要解绑的会员ID
|
|
|
|
|
+ */
|
|
|
|
|
+ handleUnbindSpecificMember(fsUserId) {
|
|
|
|
|
+ // 弹出确认框
|
|
|
|
|
+ this.$confirm(`确定要解除与会员 ${fsUserId} 的绑定吗?`, "提示", {
|
|
|
|
|
+ confirmButtonText: "确定",
|
|
|
|
|
+ cancelButtonText: "取消",
|
|
|
|
|
+ type: "warning"
|
|
|
|
|
+ })
|
|
|
|
|
+ .then(() => {
|
|
|
|
|
+ // 构造解绑参数
|
|
|
|
|
+ const unbindData = {
|
|
|
|
|
+ companyUserId: this.user.userId, // 销售ID
|
|
|
|
|
+ userId: fsUserId // 会员ID
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ // 调用解绑接口
|
|
|
|
|
+ unbindSaleAndFsUser(unbindData)
|
|
|
|
|
+ .then(response => {
|
|
|
|
|
+ if (response.code === 200) {
|
|
|
|
|
+ this.$message.success("解绑成功");
|
|
|
|
|
+ // 刷新用户信息
|
|
|
|
|
+ this.getUser();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$message.error(response.msg || "解绑失败");
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(error => {
|
|
|
|
|
+ console.error("解绑失败:", error);
|
|
|
|
|
+ this.$message.error("解绑失败");
|
|
|
|
|
+ });
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(() => {
|
|
|
|
|
+ this.$message.info("已取消解绑");
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
/**
|
|
/**
|
|
|
* 获取会员列表
|
|
* 获取会员列表
|
|
|
*/
|
|
*/
|