|
@@ -643,6 +643,17 @@
|
|
|
<el-button slot="append" icon="el-icon-search" @click="queryFsUserByPhone">查询</el-button>
|
|
<el-button slot="append" icon="el-icon-search" @click="queryFsUserByPhone">查询</el-button>
|
|
|
</el-input>
|
|
</el-input>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
|
+ <el-form-item label="用户ID">
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-model="bindUserForm.userId"
|
|
|
|
|
+ placeholder="请输入用户 ID(完全匹配)"
|
|
|
|
|
+ clearable
|
|
|
|
|
+ style="width: 300px;"
|
|
|
|
|
+ @keyup.enter.native="queryFsUserByUserId"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-button slot="append" icon="el-icon-search" @click="queryFsUserByUserId">查询</el-button>
|
|
|
|
|
+ </el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
</el-form>
|
|
</el-form>
|
|
|
|
|
|
|
|
<!-- 已绑定用户信息 -->
|
|
<!-- 已绑定用户信息 -->
|
|
@@ -671,7 +682,7 @@
|
|
|
<el-table-column prop="phone" label="电话" align="center"></el-table-column>
|
|
<el-table-column prop="phone" label="电话" align="center"></el-table-column>
|
|
|
</el-table>
|
|
</el-table>
|
|
|
</div>
|
|
</div>
|
|
|
- <div v-else-if="bindUserForm.phone && !bindUserLoading" style="text-align: center; padding: 20px; color: #909399;">
|
|
|
|
|
|
|
+ <div v-else-if="(bindUserForm.phone || bindUserForm.userId) && !bindUserLoading" style="text-align: center; padding: 20px; color: #909399;">
|
|
|
暂无查询结果
|
|
暂无查询结果
|
|
|
</div>
|
|
</div>
|
|
|
<div v-if="bindUserLoading" style="text-align: center; padding: 20px;">
|
|
<div v-if="bindUserLoading" style="text-align: center; padding: 20px;">
|
|
@@ -704,6 +715,7 @@ import {
|
|
|
updateCompanyUserAreaList,
|
|
updateCompanyUserAreaList,
|
|
|
isAllowedAllRegister, unBindDoctorId, bindDoctorId,updateBatchUserRoles,
|
|
isAllowedAllRegister, unBindDoctorId, bindDoctorId,updateBatchUserRoles,
|
|
|
queryFsUserByPhone,
|
|
queryFsUserByPhone,
|
|
|
|
|
+ queryFsUserByUserId,
|
|
|
batchBindCompanyUserId,
|
|
batchBindCompanyUserId,
|
|
|
getBoundUsers
|
|
getBoundUsers
|
|
|
} from "@/api/company/companyUser";
|
|
} from "@/api/company/companyUser";
|
|
@@ -938,6 +950,7 @@ export default {
|
|
|
},
|
|
},
|
|
|
bindUserForm: {
|
|
bindUserForm: {
|
|
|
phone: '',
|
|
phone: '',
|
|
|
|
|
+ userId: '',
|
|
|
companyUserId: null
|
|
companyUserId: null
|
|
|
},
|
|
},
|
|
|
fsUserList: [],
|
|
fsUserList: [],
|
|
@@ -1714,6 +1727,7 @@ export default {
|
|
|
handleBindUser(row) {
|
|
handleBindUser(row) {
|
|
|
this.bindUserForm.companyUserId = row.userId;
|
|
this.bindUserForm.companyUserId = row.userId;
|
|
|
this.bindUserForm.phone = '';
|
|
this.bindUserForm.phone = '';
|
|
|
|
|
+ this.bindUserForm.userId = '';
|
|
|
this.fsUserList = [];
|
|
this.fsUserList = [];
|
|
|
this.selectedFsUserIds = [];
|
|
this.selectedFsUserIds = [];
|
|
|
this.boundUsersList = [];
|
|
this.boundUsersList = [];
|
|
@@ -1750,27 +1764,52 @@ export default {
|
|
|
|
|
|
|
|
this.bindUserLoading = true;
|
|
this.bindUserLoading = true;
|
|
|
queryFsUserByPhone(this.bindUserForm.phone).then(response => {
|
|
queryFsUserByPhone(this.bindUserForm.phone).then(response => {
|
|
|
|
|
+ this.handleBindUserQueryResponse(response);
|
|
|
|
|
+ }).catch(() => {
|
|
|
this.bindUserLoading = false;
|
|
this.bindUserLoading = false;
|
|
|
- if (response.code === 200) {
|
|
|
|
|
- if (response.data) {
|
|
|
|
|
- // 如果返回的是单个对象,转换为数组
|
|
|
|
|
- this.fsUserList = Array.isArray(response.data) ? response.data : [response.data];
|
|
|
|
|
- if (this.fsUserList.length === 0) {
|
|
|
|
|
- this.$message.info('未找到匹配的用户');
|
|
|
|
|
- }
|
|
|
|
|
- } else {
|
|
|
|
|
- this.fsUserList = [];
|
|
|
|
|
|
|
+ this.fsUserList = [];
|
|
|
|
|
+ this.$message.error('查询失败');
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ /** 根据用户ID查询fs_user */
|
|
|
|
|
+ queryFsUserByUserId() {
|
|
|
|
|
+ const userId = Number(this.bindUserForm.userId);
|
|
|
|
|
+ if (!this.bindUserForm.userId) {
|
|
|
|
|
+ this.$message.warning('请输入用户ID');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!Number.isInteger(userId) || userId <= 0) {
|
|
|
|
|
+ this.$message.error('请输入大于0的用户ID');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ this.bindUserLoading = true;
|
|
|
|
|
+ queryFsUserByUserId(userId).then(response => {
|
|
|
|
|
+ this.handleBindUserQueryResponse(response);
|
|
|
|
|
+ }).catch(() => {
|
|
|
|
|
+ this.bindUserLoading = false;
|
|
|
|
|
+ this.fsUserList = [];
|
|
|
|
|
+ this.$message.error('查询失败');
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ /** 处理绑定用户查询响应 */
|
|
|
|
|
+ handleBindUserQueryResponse(response) {
|
|
|
|
|
+ this.bindUserLoading = false;
|
|
|
|
|
+ if (response.code === 200) {
|
|
|
|
|
+ if (response.data) {
|
|
|
|
|
+ // 如果返回的是单个对象,转换为数组
|
|
|
|
|
+ this.fsUserList = Array.isArray(response.data) ? response.data : [response.data];
|
|
|
|
|
+ if (this.fsUserList.length === 0) {
|
|
|
this.$message.info('未找到匹配的用户');
|
|
this.$message.info('未找到匹配的用户');
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
this.fsUserList = [];
|
|
this.fsUserList = [];
|
|
|
- this.$message.error(response.msg || '查询失败');
|
|
|
|
|
|
|
+ this.$message.info('未找到匹配的用户');
|
|
|
}
|
|
}
|
|
|
- }).catch(error => {
|
|
|
|
|
- this.bindUserLoading = false;
|
|
|
|
|
|
|
+ } else {
|
|
|
this.fsUserList = [];
|
|
this.fsUserList = [];
|
|
|
- this.$message.error('查询失败');
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ this.$message.error(response.msg || '查询失败');
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
/** 处理fs_user选择变化 */
|
|
/** 处理fs_user选择变化 */
|
|
|
handleFsUserSelectionChange(selection) {
|
|
handleFsUserSelectionChange(selection) {
|
|
@@ -1804,6 +1843,7 @@ export default {
|
|
|
resetBindUserForm() {
|
|
resetBindUserForm() {
|
|
|
this.bindUserForm = {
|
|
this.bindUserForm = {
|
|
|
phone: '',
|
|
phone: '',
|
|
|
|
|
+ userId: '',
|
|
|
companyUserId: null
|
|
companyUserId: null
|
|
|
};
|
|
};
|
|
|
this.fsUserList = [];
|
|
this.fsUserList = [];
|