|
@@ -19,7 +19,7 @@
|
|
<input type="text" v-model="searchQuery" placeholder="搜索学校" class="table_find" @keyup.enter="ajax_school_name(searchQuery, school.type)" />
|
|
<input type="text" v-model="searchQuery" placeholder="搜索学校" class="table_find" @keyup.enter="ajax_school_name(searchQuery, school.type)" />
|
|
<i class="el-icon-search" @click="ajax_school_name(searchQuery, school.type)"></i>
|
|
<i class="el-icon-search" @click="ajax_school_name(searchQuery, school.type)"></i>
|
|
<el-form :model="school" ref="form" style="float: left;margin-left: 10px;width: 200px;height: 30px;margin-top: 1px;">
|
|
<el-form :model="school" ref="form" style="float: left;margin-left: 10px;width: 200px;height: 30px;margin-top: 1px;">
|
|
- <el-select v-model="school.type" placeholder="请选择组织" class="custom-select">
|
|
|
|
|
|
+ <el-select v-model="school.OrgId" placeholder="请选择组织" class="custom-select">
|
|
<!-- 动态生成 <el-option> -->
|
|
<!-- 动态生成 <el-option> -->
|
|
<el-option
|
|
<el-option
|
|
v-for="(org, index) in organizations"
|
|
v-for="(org, index) in organizations"
|
|
@@ -41,8 +41,8 @@
|
|
<!-- 学校名称,显示 school.name -->
|
|
<!-- 学校名称,显示 school.name -->
|
|
<a>{{ school.name }}</a>
|
|
<a>{{ school.name }}</a>
|
|
</label>
|
|
</label>
|
|
- <!-- 单选框,使用 v-model 绑定到一个变量 -->
|
|
|
|
- <input type="radio" class="checkbox_input_org" name="school_selection" :value="school.name" v-model="selectedSchool">
|
|
|
|
|
|
+ <!-- 单选框,使用 v-model 绑定到一个变量 -->
|
|
|
|
+ <input type="radio" class="checkbox_input_org" name="school_selection" :value="school.name" v-model="selectedSchool">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -258,16 +258,16 @@
|
|
<a @click="showstop" :style="{ color: stop ? 'black' : 'rgb(179, 179, 179)' }">已停用({{ tableData_stop.length }})</a>
|
|
<a @click="showstop" :style="{ color: stop ? 'black' : 'rgb(179, 179, 179)' }">已停用({{ tableData_stop.length }})</a>
|
|
</div>
|
|
</div>
|
|
<!-- 启用中区域 -->
|
|
<!-- 启用中区域 -->
|
|
- <div v-if="open_content" style="margin-top: -80px;">
|
|
|
|
|
|
+ <div v-if="open_content" style="margin-top: -80px;width: 100%;float: left;">
|
|
<el-table :data="paginatedData" border style="width: 94%; margin-top: 90px; margin-left: 80px;" stripe :header-cell-style="headerCellStyle">
|
|
<el-table :data="paginatedData" border style="width: 94%; margin-top: 90px; margin-left: 80px;" stripe :header-cell-style="headerCellStyle">
|
|
- <el-table-column show-overflow-tooltip prop="company_name" label="组织名称" width="350" header-align="center" align="center" />
|
|
|
|
- <el-table-column show-overflow-tooltip prop="company_number" label="组织编号" width="350" header-align="center" align="center" />
|
|
|
|
- <el-table-column show-overflow-tooltip prop="name" label="姓名" width="350" header-align="center" align="center" />
|
|
|
|
- <el-table-column show-overflow-tooltip prop="account" label="账户" width="350" header-align="center" align="center" />
|
|
|
|
- <el-table-column fixed="right" label="操作" width="250" header-align="center">
|
|
|
|
|
|
+ <el-table-column show-overflow-tooltip prop="company_name" label="组织名称" width="300" header-align="center" align="center" />
|
|
|
|
+ <el-table-column show-overflow-tooltip prop="company_number" label="组织编号" width="300" header-align="center" align="center" />
|
|
|
|
+ <el-table-column show-overflow-tooltip prop="name" label="姓名" width="300" header-align="center" align="center" />
|
|
|
|
+ <el-table-column show-overflow-tooltip prop="account" label="账户" width="300" header-align="center" align="center" />
|
|
|
|
+ <el-table-column label="操作" width="300" header-align="center" align="center">
|
|
<template slot-scope="{ row }">
|
|
<template slot-scope="{ row }">
|
|
<el-button link type="text" size="small" @click="ajax__open_stop(row.userid)">停用</el-button>
|
|
<el-button link type="text" size="small" @click="ajax__open_stop(row.userid)">停用</el-button>
|
|
- <el-button link type="text" size="small" @click="run()">移动</el-button>
|
|
|
|
|
|
+ <el-button link type="text" size="small" @click="run(row.userid)">移动</el-button>
|
|
<el-button
|
|
<el-button
|
|
link
|
|
link
|
|
type="text"
|
|
type="text"
|
|
@@ -326,6 +326,7 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
+import { API_CONFIG } from '@/common/apiConfig';
|
|
export default {
|
|
export default {
|
|
name: 'HelloWorld',
|
|
name: 'HelloWorld',
|
|
components: {
|
|
components: {
|
|
@@ -398,8 +399,11 @@ export default {
|
|
searchQuery: "", // 用来存储输入框的值
|
|
searchQuery: "", // 用来存储输入框的值
|
|
dialogVisible: true,
|
|
dialogVisible: true,
|
|
school: {
|
|
school: {
|
|
- type: '', // 选择的组织 id
|
|
|
|
|
|
+ OrgId: null, // 初始化 OrgId 为 null 或适当的默认值
|
|
},
|
|
},
|
|
|
|
+ // 用来存储传递的参数
|
|
|
|
+ ajaxParams: null,
|
|
|
|
+ check_user_id: "", // 存放当前选择的用户的ID
|
|
};
|
|
};
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
@@ -417,8 +421,10 @@ export default {
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
// 移动按钮,将isOrgFormVisible区域显示
|
|
// 移动按钮,将isOrgFormVisible区域显示
|
|
- run() {
|
|
|
|
- this.isOrgFormVisible = true;
|
|
|
|
|
|
+ run(userid) {
|
|
|
|
+ this.check_user_id = userid; // 将选中的userid存储到check_user_id中
|
|
|
|
+ this.isOrgFormVisible = true; // 显示区域
|
|
|
|
+ console.log("选中的用户ID:", this.check_user_id); // 打印出当前的选中用户ID
|
|
},
|
|
},
|
|
// 移动关闭按钮
|
|
// 移动关闭按钮
|
|
close_table() {
|
|
close_table() {
|
|
@@ -435,7 +441,7 @@ export default {
|
|
},
|
|
},
|
|
//新增组织关闭
|
|
//新增组织关闭
|
|
close_add_org(){
|
|
close_add_org(){
|
|
- this.add_button_content = false;
|
|
|
|
|
|
+ this.add_org_dialog = false;
|
|
},
|
|
},
|
|
//新增学校关闭
|
|
//新增学校关闭
|
|
close_add_school(){
|
|
close_add_school(){
|
|
@@ -501,15 +507,8 @@ export default {
|
|
},
|
|
},
|
|
// 已启用
|
|
// 已启用
|
|
ajax_user_open() {
|
|
ajax_user_open() {
|
|
- let params = [
|
|
|
|
- {
|
|
|
|
- functionName: "select_user_type1", // 调用存储过程的名称
|
|
|
|
- u_type: 1,
|
|
|
|
- },
|
|
|
|
- ];
|
|
|
|
-
|
|
|
|
- this.$ajax
|
|
|
|
- .post("http://10.3.16.166:7003/api/pbl/localPost", params)
|
|
|
|
|
|
+ const params = [API_CONFIG.ajaxstart]; // 使用配置中的接口参数
|
|
|
|
+ this.$ajax.post(API_CONFIG.baseUrl, params)
|
|
.then((res) => {
|
|
.then((res) => {
|
|
// 假设 res.data[0] 是返回的用户数据数组
|
|
// 假设 res.data[0] 是返回的用户数据数组
|
|
this.tableData = res.data[0].map(user => ({
|
|
this.tableData = res.data[0].map(user => ({
|
|
@@ -535,16 +534,8 @@ export default {
|
|
},
|
|
},
|
|
//停用
|
|
//停用
|
|
ajax_user_stop() {
|
|
ajax_user_stop() {
|
|
- let params = [
|
|
|
|
- {
|
|
|
|
- //全部
|
|
|
|
- functionName: "select_user_type1", // 调用存储过程的名称
|
|
|
|
- u_type: 0,
|
|
|
|
- },
|
|
|
|
- ];
|
|
|
|
-
|
|
|
|
- this.$ajax
|
|
|
|
- .post("http://10.3.16.166:7003/api/pbl/localPost", params)
|
|
|
|
|
|
+ const params = [API_CONFIG.ajaxend]; // 使用配置中的接口参数
|
|
|
|
+ this.$ajax.post(API_CONFIG.baseUrl, params)
|
|
.then((res) => {
|
|
.then((res) => {
|
|
// 假设 res.data[0] 是返回的用户数据数组
|
|
// 假设 res.data[0] 是返回的用户数据数组
|
|
this.tableData_stop = res.data[0].map(user => ({
|
|
this.tableData_stop = res.data[0].map(user => ({
|
|
@@ -565,49 +556,46 @@ export default {
|
|
},
|
|
},
|
|
// 停用或者启用
|
|
// 停用或者启用
|
|
ajax__open_stop(userid) {
|
|
ajax__open_stop(userid) {
|
|
- const isOpenArea = this.open_content; // 判断是否在启用区域
|
|
|
|
-
|
|
|
|
- const actionMessage = isOpenArea ? '停用该条数据' : '启用该条数据';
|
|
|
|
- const successMessage = isOpenArea ? '停用成功!' : '启用成功!';
|
|
|
|
- const cancelMessage = isOpenArea ? '已取消停用' : '已取消启用';
|
|
|
|
-
|
|
|
|
- let params = [
|
|
|
|
- {
|
|
|
|
- functionName: "update_user_state", // 调用存储过程的名称
|
|
|
|
- u_id: userid, // 将传入的userid设置为 u_id
|
|
|
|
- },
|
|
|
|
- ];
|
|
|
|
- // 弹窗提示确认
|
|
|
|
- this.$confirm(`此操作将会${actionMessage}, 是否继续?`, '提示', {
|
|
|
|
- confirmButtonText: '确定',
|
|
|
|
- cancelButtonText: '取消',
|
|
|
|
- type: 'warning'
|
|
|
|
- }).then(() => {
|
|
|
|
- // 在用户点击确定后,发起 AJAX 请求
|
|
|
|
- this.$ajax
|
|
|
|
- .post("http://10.3.16.166:7003/api/pbl/localPost", params)
|
|
|
|
- .then(() => {
|
|
|
|
- // 提示操作成功
|
|
|
|
- this.$message({
|
|
|
|
- type: 'success',
|
|
|
|
- message: successMessage
|
|
|
|
|
|
+ const isOpenArea = this.open_content; // 判断是否在启用区域
|
|
|
|
+ const actionMessage = isOpenArea ? '停用该条数据' : '启用该条数据';
|
|
|
|
+ const successMessage = isOpenArea ? '停用成功!' : '启用成功!';
|
|
|
|
+ const cancelMessage = isOpenArea ? '已取消停用' : '已取消启用';
|
|
|
|
+ let params = [
|
|
|
|
+ {
|
|
|
|
+ functionName: API_CONFIG.userstate.functionName, // 调用存储过程的名称
|
|
|
|
+ u_id: userid, // 将传入的userid设置为 u_id
|
|
|
|
+ },
|
|
|
|
+ ];
|
|
|
|
+ // 弹窗提示确认
|
|
|
|
+ this.$confirm(`此操作将会${actionMessage}, 是否继续?`, '提示', {
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
+ type: 'warning'
|
|
|
|
+ }).then(() => {
|
|
|
|
+ // 在用户点击确定后,发起 AJAX 请求
|
|
|
|
+ this.$ajax.post(API_CONFIG.baseUrl, params)
|
|
|
|
+ .then(() => {
|
|
|
|
+ // 提示操作成功
|
|
|
|
+ this.$message({
|
|
|
|
+ type: 'success',
|
|
|
|
+ message: successMessage
|
|
|
|
+ });
|
|
|
|
+ // 调用停用和启用用户的函数
|
|
|
|
+ this.ajax_user_stop();
|
|
|
|
+ this.ajax_user_open();
|
|
|
|
+ })
|
|
|
|
+ .catch((err) => {
|
|
|
|
+ // 处理失败的响应
|
|
|
|
+ this.$message.error("处理失败");
|
|
|
|
+ console.error("请求失败,错误信息:", err); // 打印详细错误信息
|
|
});
|
|
});
|
|
- // 调用停用和启用用户的函数
|
|
|
|
- this.ajax_user_stop();
|
|
|
|
- this.ajax_user_open();
|
|
|
|
- })
|
|
|
|
- .catch((err) => {
|
|
|
|
- // 处理失败的响应
|
|
|
|
- this.$message.error("处理失败");
|
|
|
|
- console.error("请求失败,错误信息:", err); // 打印详细错误信息
|
|
|
|
|
|
+ }).catch(() => {
|
|
|
|
+ // 取消操作后提示
|
|
|
|
+ this.$message({
|
|
|
|
+ type: 'info',
|
|
|
|
+ message: cancelMessage
|
|
});
|
|
});
|
|
- }).catch(() => {
|
|
|
|
- // 取消操作后提示
|
|
|
|
- this.$message({
|
|
|
|
- type: 'info',
|
|
|
|
- message: cancelMessage
|
|
|
|
});
|
|
});
|
|
- });
|
|
|
|
},
|
|
},
|
|
//设置管理员
|
|
//设置管理员
|
|
ajax_admin(userid, role) {
|
|
ajax_admin(userid, role) {
|
|
@@ -625,15 +613,14 @@ export default {
|
|
// 发送请求时的参数
|
|
// 发送请求时的参数
|
|
let params = [
|
|
let params = [
|
|
{
|
|
{
|
|
- functionName: "update_user_admin", // 存储过程的名称
|
|
|
|
- u_id: userid, // 用��ID
|
|
|
|
|
|
+ functionName: API_CONFIG.ajax_admin.functionName, // 存储过程的名称
|
|
|
|
+ u_id: userid,
|
|
},
|
|
},
|
|
];
|
|
];
|
|
|
|
|
|
- this.$ajax
|
|
|
|
- .post("http://10.3.16.166:7003/api/pbl/localPost", params)
|
|
|
|
|
|
+ this.$ajax.post(API_CONFIG.baseUrl, params)
|
|
.then((res) => {
|
|
.then((res) => {
|
|
- // 直接假设返回的数据格式正确,直接执行
|
|
|
|
|
|
+ // 假设返回的数据格式正确,直接执行
|
|
this.tableData = res.data[0].map(user => {
|
|
this.tableData = res.data[0].map(user => {
|
|
return {
|
|
return {
|
|
company_name: user.name || '暂无',
|
|
company_name: user.name || '暂无',
|
|
@@ -644,20 +631,31 @@ export default {
|
|
userid: user.userid,
|
|
userid: user.userid,
|
|
};
|
|
};
|
|
});
|
|
});
|
|
- // console.log("返回信息为:", res.data);
|
|
|
|
- this.ajax_user_stop();
|
|
|
|
- this.ajax_user_open();
|
|
|
|
|
|
+ console.log("返回的数据为:",res.data);
|
|
// 获取返回的信息
|
|
// 获取返回的信息
|
|
- let updatedMessage = res.data[0][0].message; // 这里假设res.data[0][0]是正确的
|
|
|
|
|
|
+ let updatedMessage = res.data[0][0].message; // 假设 res.data[0][0] 是正确的
|
|
|
|
+
|
|
if (updatedMessage == 2) {
|
|
if (updatedMessage == 2) {
|
|
|
|
+ // 如果返回信息是2,提示用户不是老师类型
|
|
this.$message.error("该用户不是老师类型,无法设置为管理员");
|
|
this.$message.error("该用户不是老师类型,无法设置为管理员");
|
|
} else {
|
|
} else {
|
|
|
|
+ // 如果更新成功,显示成功提示并调用 ajax_user_stop 和 ajax_user_open
|
|
this.$message({
|
|
this.$message({
|
|
type: 'success',
|
|
type: 'success',
|
|
message: '已成功执行!',
|
|
message: '已成功执行!',
|
|
});
|
|
});
|
|
|
|
+ // // 只有在成功执行时调用这两个函数
|
|
|
|
+ // this.ajax_user_stop();
|
|
|
|
+ // this.ajax_user_open();
|
|
}
|
|
}
|
|
- })
|
|
|
|
|
|
+ }).catch((error) => {
|
|
|
|
+ // 请求失败的处理
|
|
|
|
+ console.error("请求失败:", error);
|
|
|
|
+ this.$message({
|
|
|
|
+ type: 'error',
|
|
|
|
+ message: '操作失败,请稍后再试',
|
|
|
|
+ });
|
|
|
|
+ });
|
|
}).catch(() => {
|
|
}).catch(() => {
|
|
// 取消操作时的提示
|
|
// 取消操作时的提示
|
|
this.$message({
|
|
this.$message({
|
|
@@ -668,21 +666,15 @@ export default {
|
|
},
|
|
},
|
|
// 学校查询
|
|
// 学校查询
|
|
ajax_school() {
|
|
ajax_school() {
|
|
- let params = [
|
|
|
|
- {
|
|
|
|
- functionName: "select_school_cn", // 调用存储过程的名称
|
|
|
|
- },
|
|
|
|
- ];
|
|
|
|
-
|
|
|
|
- this.$ajax
|
|
|
|
- .post("http://10.3.16.166:7003/api/pbl/localPost", params)
|
|
|
|
|
|
+ const params = [API_CONFIG.ajax_school]; // 使用配置中的接口参数
|
|
|
|
+ this.$ajax.post(API_CONFIG.baseUrl, params)
|
|
.then((res) => {
|
|
.then((res) => {
|
|
// console.log("返回的数据为:", res.data); // 检查返回的数据
|
|
// console.log("返回的数据为:", res.data); // 检查返回的数据
|
|
if (res.data && Array.isArray(res.data[0])) {
|
|
if (res.data && Array.isArray(res.data[0])) {
|
|
// 将 name 和 org 都存入 cn_school 数组中
|
|
// 将 name 和 org 都存入 cn_school 数组中
|
|
this.cn_school = res.data[0].map(item => ({
|
|
this.cn_school = res.data[0].map(item => ({
|
|
name: item.name,
|
|
name: item.name,
|
|
- org: item.org
|
|
|
|
|
|
+ id: item.id
|
|
}));
|
|
}));
|
|
}
|
|
}
|
|
})
|
|
})
|
|
@@ -693,14 +685,8 @@ export default {
|
|
},
|
|
},
|
|
//组织查询
|
|
//组织查询
|
|
ajax_org() {
|
|
ajax_org() {
|
|
- let params = [
|
|
|
|
- {
|
|
|
|
- functionName: "select_organization", // 调用存储过程的名称
|
|
|
|
- },
|
|
|
|
- ];
|
|
|
|
-
|
|
|
|
- this.$ajax
|
|
|
|
- .post("http://10.3.16.166:7003/api/pbl/localPost", params)
|
|
|
|
|
|
+ const params = [API_CONFIG.ajax_org]; // 使用配置中的接口参数
|
|
|
|
+ this.$ajax.post(API_CONFIG.baseUrl, params)
|
|
.then((res) => {
|
|
.then((res) => {
|
|
// console.log("返回的数据为:", res.data); // 检查返回的数据
|
|
// console.log("返回的数据为:", res.data); // 检查返回的数据
|
|
if (res.data && Array.isArray(res.data[0])) {
|
|
if (res.data && Array.isArray(res.data[0])) {
|
|
@@ -718,10 +704,9 @@ export default {
|
|
});
|
|
});
|
|
},
|
|
},
|
|
//关键词查询
|
|
//关键词查询
|
|
- ajax_school_name(searchQuery, orgId) {
|
|
|
|
- // console.log('搜索关键词:', searchQuery); // 打印搜索关键词
|
|
|
|
- // console.log('选中的组织ID:', orgId); // 打印选中的组织 ID
|
|
|
|
-
|
|
|
|
|
|
+ ajax_school_name(searchQuery) {
|
|
|
|
+ // 获取选择的组织ID
|
|
|
|
+ const orgId = this.school.OrgId || ""; // 如果没有选择组织,则为空字符串
|
|
// 检查 searchQuery 是否为空
|
|
// 检查 searchQuery 是否为空
|
|
if (!searchQuery) {
|
|
if (!searchQuery) {
|
|
this.$message.warning('请输入搜索内容');
|
|
this.$message.warning('请输入搜索内容');
|
|
@@ -730,14 +715,13 @@ export default {
|
|
|
|
|
|
let params = [
|
|
let params = [
|
|
{
|
|
{
|
|
- functionName: "select_school_name", // 调用存储过程的名称
|
|
|
|
|
|
+ functionName: API_CONFIG.ajax_school_name.functionName, // 调用存储过程的名称
|
|
u_name: searchQuery, // 用户输入的搜索关键词
|
|
u_name: searchQuery, // 用户输入的搜索关键词
|
|
u_org: orgId // 传入的组织 ID
|
|
u_org: orgId // 传入的组织 ID
|
|
}
|
|
}
|
|
];
|
|
];
|
|
|
|
|
|
- this.$ajax
|
|
|
|
- .post("http://10.3.16.166:7003/api/pbl/localPost", params)
|
|
|
|
|
|
+ this.$ajax.post(API_CONFIG.baseUrl, params)
|
|
.then((res) => {
|
|
.then((res) => {
|
|
// console.log('返回的学校数据:', res.data); // 打印返回的数据
|
|
// console.log('返回的学校数据:', res.data); // 打印返回的数据
|
|
|
|
|
|
@@ -746,7 +730,7 @@ export default {
|
|
// 只有在查询到学校数据且数组不为空时才更新 cn_school
|
|
// 只有在查询到学校数据且数组不为空时才更新 cn_school
|
|
this.cn_school = res.data[0].map(item => ({
|
|
this.cn_school = res.data[0].map(item => ({
|
|
name: item.name,
|
|
name: item.name,
|
|
- org: item.org
|
|
|
|
|
|
+ id: item.id
|
|
}));
|
|
}));
|
|
// 查询成功且更新后,显示成功消息
|
|
// 查询成功且更新后,显示成功消息
|
|
this.$message.success('成功查询到了学校');
|
|
this.$message.success('成功查询到了学校');
|
|
@@ -778,7 +762,7 @@ export default {
|
|
// 构建请求参数
|
|
// 构建请求参数
|
|
let params = [
|
|
let params = [
|
|
{
|
|
{
|
|
- functionName: "insert_school", // 调用存储过程的名称
|
|
|
|
|
|
+ functionName: API_CONFIG.ajax_add_school.functionName, // 调用存储过程的名称
|
|
u_name: this.sch_name, // 学校名称,绑定到 orgName
|
|
u_name: this.sch_name, // 学校名称,绑定到 orgName
|
|
u_org: this.school.parentOrgId || "", // 选择的组织的 ID,绑定到 school.parentOrgId,如果没有选择则为空
|
|
u_org: this.school.parentOrgId || "", // 选择的组织的 ID,绑定到 school.parentOrgId,如果没有选择则为空
|
|
u_dest: this.region || "", // 地区,绑定到 region,如果为空则传空字符串
|
|
u_dest: this.region || "", // 地区,绑定到 region,如果为空则传空字符串
|
|
@@ -789,8 +773,7 @@ export default {
|
|
];
|
|
];
|
|
|
|
|
|
// 发起请求
|
|
// 发起请求
|
|
- this.$ajax
|
|
|
|
- .post("http://10.3.16.166:7003/api/pbl/localPost", params)
|
|
|
|
|
|
+ this.$ajax.post(API_CONFIG.baseUrl, params)
|
|
.then(() => {
|
|
.then(() => {
|
|
this.$message({
|
|
this.$message({
|
|
type: 'success',
|
|
type: 'success',
|
|
@@ -830,7 +813,7 @@ export default {
|
|
// 构造请求参数
|
|
// 构造请求参数
|
|
let params = [
|
|
let params = [
|
|
{
|
|
{
|
|
- functionName: "insert_org", // 调用存储过程的名称
|
|
|
|
|
|
+ functionName: API_CONFIG.ajax_add_org.functionName, // 调用存储过程的名称
|
|
u_name: orgName, // 组织名称
|
|
u_name: orgName, // 组织名称
|
|
u_create: "0", // u_create 固定为0
|
|
u_create: "0", // u_create 固定为0
|
|
u_code: randomCode, // 随机码(可以为空)
|
|
u_code: randomCode, // 随机码(可以为空)
|
|
@@ -839,8 +822,7 @@ export default {
|
|
];
|
|
];
|
|
|
|
|
|
// 发起请求
|
|
// 发起请求
|
|
- this.$ajax
|
|
|
|
- .post("http://10.3.16.166:7003/api/pbl/localPost", params)
|
|
|
|
|
|
+ this.$ajax.post(API_CONFIG.baseUrl, params)
|
|
.then(() => {
|
|
.then(() => {
|
|
this.$message({
|
|
this.$message({
|
|
type: 'success',
|
|
type: 'success',
|
|
@@ -861,25 +843,45 @@ export default {
|
|
});
|
|
});
|
|
},
|
|
},
|
|
//确认移动
|
|
//确认移动
|
|
- ajax_confirm(userid,orgId) {
|
|
|
|
|
|
+ ajax_confirm() {
|
|
|
|
+ // 获取选择的组织ID,确保 orgId 在调用之前已经定义
|
|
|
|
+ const orgId = this.school.OrgId || ""; // 如果没有选择组织,则为空字符串
|
|
|
|
+
|
|
|
|
+ // 获取选中的学校对象
|
|
|
|
+ const selectedSchoolObject = this.cn_school.find(school => school.name === this.selectedSchool);
|
|
|
|
+
|
|
|
|
+ // 判断学校ID是否为空
|
|
|
|
+ if (!selectedSchoolObject || !selectedSchoolObject.id) {
|
|
|
|
+ this.$message({
|
|
|
|
+ type: 'warning',
|
|
|
|
+ message: '请选择你要移动的学校!',
|
|
|
|
+ });
|
|
|
|
+ return; // 学校ID为空时,阻止后续操作
|
|
|
|
+ }
|
|
|
|
+
|
|
// 构造请求参数
|
|
// 构造请求参数
|
|
let params = [
|
|
let params = [
|
|
{
|
|
{
|
|
- functionName: "updata_user_o_s", // 调用存储过程的名称
|
|
|
|
- u_id: userid, // 用户id
|
|
|
|
- o_id: orgId, // 组织id
|
|
|
|
- s_id: 1 // 学校id
|
|
|
|
|
|
+ functionName: API_CONFIG.ajax_confirm.functionName, // 调用存储过程的名称
|
|
|
|
+ u_id: this.check_user_id, // 使用this.check_user_id来获取用户id
|
|
|
|
+ o_id: orgId || "", // 选择的组织的 ID,绑定到 school.parentOrgId,如果没有选择则为空
|
|
|
|
+ s_id: selectedSchoolObject.id // 选中的学校的id
|
|
}
|
|
}
|
|
];
|
|
];
|
|
|
|
|
|
// 发起请求
|
|
// 发起请求
|
|
- this.$ajax
|
|
|
|
- .post("http://10.3.16.166:7003/api/pbl/localPost", params)
|
|
|
|
|
|
+ this.$ajax.post(API_CONFIG.baseUrl, params)
|
|
.then(() => {
|
|
.then(() => {
|
|
this.$message({
|
|
this.$message({
|
|
- type: 'success',
|
|
|
|
- message: '移动成功!',
|
|
|
|
- });
|
|
|
|
|
|
+ type: 'success',
|
|
|
|
+ message: '移动成功!',
|
|
|
|
+ });
|
|
|
|
+ this.isOrgFormVisible = false; // 隐藏区域
|
|
|
|
+ // 在此之后再进行输出
|
|
|
|
+ console.log("选择的用户id为:", this.check_user_id);
|
|
|
|
+ console.log("选择的组织id为:", orgId);
|
|
|
|
+ console.log("选择的学校id为:", selectedSchoolObject.id);
|
|
|
|
+ this.ajax_user_open(); // 如果是在启用区域,停用
|
|
})
|
|
})
|
|
.catch((err) => {
|
|
.catch((err) => {
|
|
this.$message.error("移动失败");
|
|
this.$message.error("移动失败");
|
|
@@ -914,7 +916,7 @@ body{
|
|
}
|
|
}
|
|
/* 内容区域 */
|
|
/* 内容区域 */
|
|
.content{
|
|
.content{
|
|
- width: 1760px;
|
|
|
|
|
|
+ width: auto;
|
|
height: auto;
|
|
height: auto;
|
|
/* border: 1px solid red; */
|
|
/* border: 1px solid red; */
|
|
float: left;
|
|
float: left;
|
|
@@ -946,6 +948,10 @@ body{
|
|
float: right;
|
|
float: right;
|
|
margin-right: 30px;
|
|
margin-right: 30px;
|
|
}
|
|
}
|
|
|
|
+/* 表单移动弹窗 */
|
|
|
|
+.el-table--scrollable-x .el-table__body-wrapper {
|
|
|
|
+ overflow-x: hidden;
|
|
|
|
+}
|
|
/* 表单头高度 */
|
|
/* 表单头高度 */
|
|
.el-table .el-table__header th {
|
|
.el-table .el-table__header th {
|
|
height: 60px; /* 设置表头行高 */
|
|
height: 60px; /* 设置表头行高 */
|
|
@@ -966,15 +972,13 @@ body{
|
|
/* 添加账户的按钮 */
|
|
/* 添加账户的按钮 */
|
|
.add-button {
|
|
.add-button {
|
|
display: flex;
|
|
display: flex;
|
|
- align-items: center;
|
|
|
|
- background-color: transparent;
|
|
|
|
border: none;
|
|
border: none;
|
|
cursor: pointer;
|
|
cursor: pointer;
|
|
font-size: 18px;
|
|
font-size: 18px;
|
|
color: black;
|
|
color: black;
|
|
font-weight: bold;
|
|
font-weight: bold;
|
|
- margin-left: -900px;
|
|
|
|
- margin-top: 35px;
|
|
|
|
|
|
+ margin-left: -1450px;
|
|
|
|
+ margin-top: 375px;
|
|
float: left;
|
|
float: left;
|
|
}
|
|
}
|
|
/* +号图标 */
|
|
/* +号图标 */
|