|
|
@@ -158,6 +158,15 @@
|
|
|
v-hasPermi="['store:user:export']"
|
|
|
>导出</el-button>
|
|
|
</el-col>
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ type="_blank"
|
|
|
+ icon="el-icon-brush"
|
|
|
+ size="mini"
|
|
|
+ @click="handleUnbind"
|
|
|
+ v-hasPermi="['his:user:unbind']"
|
|
|
+ >解绑会员</el-button>
|
|
|
+ </el-col>
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
</el-row>
|
|
|
|
|
|
@@ -381,7 +390,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import {listUserByProject, getUser, addUser, updateUser, exportUser, delUserCompanyUser,exportListProject} from "@/api/his/user";
|
|
|
+import {listUserByProject, getUser, addUser, updateUser, exportUser, delUserCompanyUser,exportListProject, batchUnbindUser} from "@/api/his/user";
|
|
|
import { getCompanyUserList, changeCompanyUser, getCompanyList } from '@/api/company/companyUser';
|
|
|
import userDetailsByNew from '@/views/his/user/userDetails.vue'
|
|
|
export default {
|
|
|
@@ -710,6 +719,43 @@ export default {
|
|
|
this.download(response.msg);
|
|
|
}).catch(function() {});
|
|
|
},
|
|
|
+
|
|
|
+ // 解绑会员
|
|
|
+ handleUnbind() {
|
|
|
+ // 检查是否有勾选列表行
|
|
|
+ if (this.selectedUser.length > 0) {
|
|
|
+ // 有勾选行,获取选中的userId列表
|
|
|
+ const userIds = this.selectedUser.map(item => item.userId);
|
|
|
+ this.$confirm('确定要解绑当前选中的' + this.selectedUser.length + '个会员吗?', "警告", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(() => {
|
|
|
+ console.log('解绑选中会员,用户ID:', userIds);
|
|
|
+ return batchUnbindUser(userIds);
|
|
|
+ }).then(() => {
|
|
|
+ this.msgSuccess("解绑成功");
|
|
|
+ this.getList();
|
|
|
+ }).catch(function() {
|
|
|
+ this.$message.error('解绑失败');
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ // 没有勾选行,提示用户是否解绑当前筛选条件下的所有会员
|
|
|
+ this.$confirm('没有勾选列表项,将解绑当前筛选条件下的所有会员,请确认是否操作?', "警告", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(() => {
|
|
|
+ const userIds = this.userList.map(item => item.userId);
|
|
|
+ return batchUnbindUser(userIds);
|
|
|
+ }).then(() => {
|
|
|
+ this.msgSuccess("解绑成功");
|
|
|
+ this.getList();
|
|
|
+ }).catch(function() {
|
|
|
+ this.$message.error('解绑失败');
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
handleShow(row){
|
|
|
var that=this;
|
|
|
that.show.open=true;
|