fix: BUG修改

This commit is contained in:
kun 2024-03-30 18:07:37 +08:00
parent f71c40e551
commit 3642e32445
3 changed files with 223 additions and 145 deletions

View File

@ -10,11 +10,16 @@ export const getSystemUserBySnApi = data => post('xmgl/systemUser/getSystemUser
// 新用户审核 // 新用户审核
// 列表 // 列表
export const getUserAuditListApi = data => get('xmgl/xzRegistry/page', data); //根据企业或项目SN查找账号列表 export const getUserAuditListApi = data => get('xmgl/xzRegistry/page', data);
// 审核 // 审核
export const userAuditApi = data => post('xmgl/xzRegistry/approval', data); //根据企业或项目SN查找账号列表 export const userAuditApi = data => post('xmgl/xzRegistry/approval', data);
// 删除 // 删除
export const userDeleteApi = data => post('xmgl/xzRegistry/delete', data); //根据企业或项目SN查找账号列表 export const userDeleteApi = data => post('xmgl/xzRegistry/delete', data);
// 用户管理列表 // 用户管理
export const getUserManagerApi = data => post('xmgl/systemUser/getTenantListBySn', data); //根据企业或项目SN查找账号列表 // 列表
export const getUserManagerApi = data => post('xmgl/systemUser/getTenantListBySn', data);
// 回显所选组织
export const getSelectedGroupApi = data => post('xmgl/company/getOrgSnListByUserId', data);
// 调整组织
export const updateUserManagerApi = data => post('xmgl/company/updateTenantOrg', data);

View File

@ -119,10 +119,10 @@
<el-table-column <el-table-column
:label="$t('message.deviceManage.operation')" :label="$t('message.deviceManage.operation')"
align="center" align="center"
width="400px" width="420px"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<div class="tableBtns" style="margin-left: 35%"> <div class="tableBtns">
<div <div
v-if="!treeSelectData.projectName" v-if="!treeSelectData.projectName"
@click="configAccountFn(scope.row, 'yi')" @click="configAccountFn(scope.row, 'yi')"
@ -231,6 +231,14 @@
label="注册时间" label="注册时间"
align="center" align="center"
></el-table-column> ></el-table-column>
<el-table-column
label="审核状态"
align="center"
>
<template slot-scope="scope">
<span :style="{color: scope.row.approvalProcess == 1?'#F7A20B':scope.row.approvalProcess == 2?'#1BA331':'#D53941'}">{{scope.row.approvalProcess == 1?'未审核':scope.row.approvalProcess == 2?'审核通过':'审核拒绝'}}</span>
</template>
</el-table-column>
<el-table-column label="授权配置" align="center"> <el-table-column label="授权配置" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<div <div
@ -258,22 +266,33 @@
</el-table> </el-table>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="用户管理" name="four"> <el-tab-pane label="用户管理" name="four">
<el-button
type="primary"
size="medium"
@click="configAccountFn(treeSelectData, 'project')"
v-if="treeSelectData.projectName"
>权限配置</el-button
>
<el-table class="tables" :data="userManageList"> <el-table class="tables" :data="userManageList">
<el-table-column <el-table-column
prop="realName" prop="account"
align="center" align="center"
:label="'姓名'" label="账号"
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
prop="account" prop="showPassword"
:label="'登录账号'" label="密码"
align="center" align="center"
></el-table-column> ></el-table-column>
<el-table-column prop="userTel" :label="'手机号'" align="center">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="jobName" prop="email"
:label="'所属岗位'" label="电子邮箱"
align="center"
></el-table-column>
<el-table-column
prop="registryTime"
label="注册时间"
align="center" align="center"
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
@ -281,21 +300,15 @@
align="center" align="center"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<div style="display: flex;align-items:center;justify-content: space-between;"> <div class="operation-style">
<div <div @click="editGroup(scope.row)" class="operationText" style="margin-right: 10px;">
@click="configAccountFn(scope.row, 'yi')"
class="operationText"
>
<i class="el-icon-setting"></i>
<span>权限配置</span>
</div>
<div @click="editGroup(scope.row)" class="operationText">
<i class="el-icon-s-operation"></i> <i class="el-icon-s-operation"></i>
<span>调整组织</span> <span>调整组织</span>
</div> </div>
<div <div
@click="deleteAccountFn(scope.row)" @click="deleteAccountFn(scope.row)"
class="operationText" class="operationText"
style="margin-right: 10px;"
> >
<img <img
src="@/assets/images/icon-delete.png" src="@/assets/images/icon-delete.png"
@ -1103,61 +1116,75 @@
</el-dialog> </el-dialog>
<!-- 调整组织 --> <!-- 调整组织 -->
<el-dialog <el-dialog
class="auditDialog"
title="调整组织" title="调整组织"
:visible.sync="editGroupDialog" :visible.sync="editGroupDialog"
:modal-append-to-body="false" :modal-append-to-body="false"
width="667px" width="600px"
> >
<div class="dialog_content"> <div class="dialog_content">
<el-form <div class="dialog_content-part">
size="medium" <div class="dialog-search" style="margin-top: 20px;">
:model="editGroupForm" <el-input
ref="editGroupForm" placeholder="请输入组织名称搜索"
label-width="110px" suffix-icon="el-icon-search"
> style="flex: 1;"
<el-form-item label="调整至" prop="groupId"> v-model="filterText"
<div class="select-content"> size="small"
<div class="tip-text" @click="isSelectCompany = !isSelectCompany"> >
<span>{{ selectTree.label || "请选择" }}</span> </el-input>
<i class="el-icon-arrow-down" v-show="!isSelectCompany"></i> </div>
<i class="el-icon-arrow-up" v-show="isSelectCompany"></i> <div class="dialog-tree">
</div> <el-tree
<div class="select-list" v-if="isSelectCompany"> :data="level1CompanyData"
<el-input :filter-node-method="filterNode"
placeholder="输入关键字进行过滤" :highlight-current="true"
v-model="filterText" :check-on-click-node="false"
style="width: 98%;margin: 0 5px;" show-checkbox
:props="defaultProps"
node-key="itemId"
ref="groupTree"
>
<span class="custom-tree-node" slot-scope="{ node, data }">
<span
style="
width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
display: inline-block;
"
:class="
data.videoName
? 'videoName'
: data.projectName
? 'projectName'
: data.companyType == 2
? 'companyName2'
: ''
"
:title="node.label"
>{{ node.label }}</span
> >
</el-input> </span>
<el-tree </el-tree>
:data="treeData" </div>
:props="selectTreeProps" </div>
node-key="id" <div class="dialog-footer relative-group">
ref="tree"
:filter-node-method="filterNode"
:highlight-current="true"
:check-on-click-node="true"
@node-click="treeClick"
style="margin:10px 5px;"
></el-tree>
</div>
</div>
</el-form-item>
</el-form>
<div class="dialog-footer">
<el-button <el-button
class="cancleBtn" class="cancleBtn"
@click="editGroupDialog = false" @click="editGroupDialog = false"
icon="el-icon-circle-close" icon="el-icon-circle-close"
size="medium" size="medium"
>{{ $t("message.companyDiagram.cancel") }} plain
>取消
</el-button> </el-button>
<el-button <el-button
type="primary" type="primary"
icon="el-icon-circle-check" icon="el-icon-circle-check"
@click="saveAccountFn" @click="transformGroup"
size="medium" size="medium"
>{{ $t("message.companyDiagram.determine") }} >确定
</el-button> </el-button>
</div> </div>
</div> </div>
@ -1270,7 +1297,9 @@ import {
getUserAuditListApi, getUserAuditListApi,
userAuditApi, userAuditApi,
userDeleteApi, userDeleteApi,
getUserManagerApi getUserManagerApi,
updateUserManagerApi,
getSelectedGroupApi
} from "@/assets/js/api/account.js"; } from "@/assets/js/api/account.js";
import { import {
getProjectListApi, getProjectListApi,
@ -2209,7 +2238,7 @@ export default {
handleTabClick(tab, event) { handleTabClick(tab, event) {
if(!this.treeSelectData.name) return; if(!this.treeSelectData.name) return;
if(this.tabActiveName == 'third'){ if(this.tabActiveName == 'third'){
this.getUserAuditListApi(); this.getUserAuditListApiFunc();
} else if(this.tabActiveName == 'four'){ } else if(this.tabActiveName == 'four'){
this.getUserManageListApi(); this.getUserManageListApi();
} }
@ -2993,8 +3022,12 @@ export default {
type: "warning", type: "warning",
} }
).then(() => { ).then(() => {
userAuditApi({ id: item.id, approvalProcess:3, xzRegistry: item }).then((res) => { userAuditApi({ id: item.id, approvalProcess:3 }).then((res) => {
this.getUserAuditListApi(); if(res.success){
this.$message.error("审核拒绝");
this.relativeGroupDialog = false;
this.getUserAuditListApiFunc();
}
}); });
}); });
}, },
@ -3006,62 +3039,101 @@ export default {
const checkedArr = this.transfrom(checked); const checkedArr = this.transfrom(checked);
const halfCheckedArr = this.transfrom(halfChecked); const halfCheckedArr = this.transfrom(halfChecked);
const concatArr = checkedArr.concat(halfCheckedArr); const concatArr = checkedArr.concat(halfCheckedArr);
console.log(concatArr) const companySnArr = new Set([]);
// this.$confirm( const projectSnArr = new Set([]);
// `{${item.account}}!`, if(concatArr.length == 0){
// this.$t("message.companyDiagram.Tips"), this.$message.error("请先选择关联组织");
// { return;
// confirmButtonText: this.$t( }
// "message.companyDiagram.confirmButtonText" concatArr.map(item => {
// ), // if(item.companySn){
// cancelButtonText: this.$t("message.companyDiagram.cancelButtonText"), // companySnArr.add(item.companySn)
// type: "warning", }
// } if(item.projectSn){
// ).then(() => { projectSnArr.add(item.projectSn)
// userAuditApi({ id: item.id, approvalProcess:2, xzRegistry: item }).then((res) => { }
// this.getUserAuditListApi(); })
// }); this.$confirm(
// }); `账号{${item.account}}审批通过后将会发送【注册成功提醒】到注册人邮箱!`,
this.$t("message.companyDiagram.Tips"),
{
confirmButtonText: this.$t(
"message.companyDiagram.confirmButtonText"
), //
cancelButtonText: this.$t("message.companyDiagram.cancelButtonText"), //
type: "warning",
}
).then(() => {
userAuditApi({ id: item.id, approvalProcess:2, companySns: [...companySnArr].join(','), projectSns: [...projectSnArr].join(',') }).then((res) => {
if(res.success){
this.$message.success("审核通过");
this.relativeGroupDialog = false;
this.getUserAuditListApiFunc();
}
});
});
}, },
transfrom(arr) { transfrom(arr) {
const result = []; const result = [];
console.log(arr);
return arr return arr
.map(item => { .map(item => {
if (arr.children && Array.isArray(arr.children)) { // if (arr.children && Array.isArray(arr.children)) {
result.concat(transfrom(arr.children)); // result.concat(transfrom(arr.children));
} // }
return { return {
authorityId: item.name, companySn: item.companySn,
menuType: item.type projectSn: item.projectSn,
name: item.name
}; };
}) })
.concat(result); .concat(result);
}, },
// keys // keys
getRelativeKeys(arr){ getRelativeKeys(arr){
let keysArr = []; let keysArr = arr;
arr.map(item => {
if (item.menuType == 0 && item.children == 0) {
keysArr.push(item.authorityId);
}
if (item.menuType == 1 && item.children == 0) {
keysArr.push(item.authorityId);
}
if (item.menuType != 0 && item.type != 1 && !item.children) {
keysArr.push(item.authorityId);
}
});
return keysArr; return keysArr;
}, },
// //
relativeGroupFn(item) { relativeGroupFn(item) {
this.selectRowObj = item; this.selectRowObj = item;
this.relativeGroupDialog = true; this.relativeGroupDialog = true;
// },
// nextTick(() => { transformGroup(){
// this.$refs.relativeTree.setCheckedKeys(getRelativeKeys(res.result)); let item = this.selectRowObj;
// }); const checked = this.$refs.relativeTree.getCheckedNodes();
const halfChecked = this.$refs.relativeTree.getHalfCheckedNodes();
const checkedArr = this.transfrom(checked);
const halfCheckedArr = this.transfrom(halfChecked);
const concatArr = checkedArr.concat(halfCheckedArr);
const companySnArr = new Set([]);
const projectSnArr = new Set([]);
concatArr.map(item => {
if(item.companySn){
companySnArr.add(item.companySn)
}
if(item.projectSn){
projectSnArr.add(item.projectSn)
}
})
this.$confirm(
`账号{${item.account}}审批通过后将会发送【注册成功提醒】到注册人邮箱!`,
this.$t("message.companyDiagram.Tips"),
{
confirmButtonText: this.$t(
"message.companyDiagram.confirmButtonText"
), //
cancelButtonText: this.$t("message.companyDiagram.cancelButtonText"), //
type: "warning",
}
).then(() => {
userAuditApi({ id: item.id, approvalProcess:2, companySns: [...companySnArr].join(','), projectSns: [...projectSnArr].join(',') }).then((res) => {
if(res.success){
this.$message.success("调整完成");
this.editGroupDialog = false;
this.getUserAuditListApiFunc();
}
});
});
}, },
// //
deleteUserFn(item) { deleteUserFn(item) {
@ -3080,7 +3152,7 @@ export default {
} }
).then(() => { ).then(() => {
userDeleteApi({ id: item.id }).then((res) => { userDeleteApi({ id: item.id }).then((res) => {
this.getUserAuditListApi(); this.getUserAuditListApiFunc();
this.$message.success( this.$message.success(
this.$t("message.companyDiagram.deleteSuccess") this.$t("message.companyDiagram.deleteSuccess")
); //! ); //!
@ -3141,8 +3213,14 @@ export default {
}); });
}, },
// //
editGroup() { async editGroup(row) {
this.editGroupDialog = true; this.editGroupDialog = true;
//
const res = await getSelectedGroupApi({ userId: row.userId });
//
this.$nextTick(() => {
this.$refs.groupTree.setCheckedKeys(this.getRelativeKeys(res.result));
});
}, },
// //
editAccountFn(item) { editAccountFn(item) {
@ -3215,16 +3293,16 @@ export default {
// //
getUserManageListApi(){ getUserManageListApi(){
let data = this.treeSelectData; let data = this.treeSelectData;
let sn = data.projectSn ? data.projectSn : data.companySn; let sn = data.projectSn ? data.projectSn : "";
getUserManagerApi({ sn: sn, pageNo: -1, pageSize: -1 }).then((res) => { getUserManagerApi({ projectSn: sn, pageNo: -1, pageSize: -1 }).then((res) => {
this.userManageList = res.result.records; this.userManageList = res.result;
}); });
}, },
// //
getUserAuditListApi(){ getUserAuditListApiFunc(){
let data = this.treeSelectData; let data = this.treeSelectData;
let sn = data.projectSn ? data.projectSn : data.companySn; let sn = data.projectSn ? data.projectSn : data.companySn;
getUserAuditListApi({ sn: sn }).then((res) => { getUserAuditListApi({ sn: sn, accountType: 1 }).then((res) => {
this.userAuditList = res.result.records; this.userAuditList = res.result.records;
}); });
}, },
@ -3734,32 +3812,10 @@ export default {
margin-top: -6px; margin-top: -6px;
cursor: pointer; cursor: pointer;
} }
// /deep/.el-select__tags{ .operation-style{
// width: 350px; .flex();
// top: 58%; justify-content: center;
// overflow: auto; }
// height: 100px;
// // display: flex;
// // align-items: flex-end;
// // flex-wrap: wrap;
// }
// /deep/.el-input--medium .el-input__inner{
// // height: 32px !important;
// }
// /deep/ .el-input--suffix .el-input__inner{
// padding-right:250px ;
// // padding-top: 10px;
// // padding-bottom: 10px;
// // padding-top:80px ;
// // padding-bottom:80px;
// }
// /deep/.el-select__tags::-webkit-scrollbar{
// background-color: #f7f5f5;
// width: 1px;
// }
// /deep/.el-select__tags::-webkit-scrollbar-thumb{
// background-color: #fbfbfc;
// }
.add { .add {
display: flex; display: flex;
align-items: center; align-items: center;

View File

@ -481,8 +481,9 @@ export default {
pw: [ pw: [
{ {
required: true, required: true,
message: "请输入", message: "请输入正确的密码格式",
trigger: "blur", trigger: "blur",
pattern: /(?=.*[0-9])(?=.*[a-zA-Z])(?=.*[^0-9a-zA-Z]).{8,30}/
}, },
], ],
companyName: [ companyName: [
@ -492,6 +493,14 @@ export default {
trigger: "blur", trigger: "blur",
}, },
], ],
email: [
{
type: "email",
required: true,
message: "请输入正确的邮箱格式",
trigger: "blur",
},
]
}, },
systemInfo: { systemInfo: {
loginBackgroundImage: "", loginBackgroundImage: "",
@ -704,7 +713,7 @@ export default {
}, },
loginFn() { loginFn() {
// 12345 6 7 // 12345 6 7
if (this.loginType == 1) { if (this.loginType == 1 || this.loginType == 2) {
this.$nextTick(() => { this.$nextTick(() => {
if (this.projectType == "zjsj") { if (this.projectType == "zjsj") {
this.$refs["LoginInfo"].$refs["form"].validate((valid) => { this.$refs["LoginInfo"].$refs["form"].validate((valid) => {
@ -807,8 +816,8 @@ export default {
delete requestData.enterpriseName delete requestData.enterpriseName
} }
if (valid) { if (valid) {
newRegisterApi(this.registerForm).then((res) => { newRegisterApi({...this.registerForm, headquartersSn: this.headquartersSnData, accountType:this.registerType}).then((res) => {
this.$message.success('注册成功待审核'); this.$message.success('注册成功');
this.goLogin(); this.goLogin();
}); });
} else { } else {
@ -943,8 +952,12 @@ export default {
console.log("arr2", arr2); console.log("arr2", arr2);
// 访 // 访
if (!arr2.length) { if (!arr2.length) {
this.$router.push("/projectIndex"); if(this.loginType == 1){
// this.$router.push("/supplierIndex"); // this.$router.push("/projectIndex");
this.$router.push("/workSpace");
} else {
this.$router.push("/supplierIndex");
}
} else { } else {
this.$router.push(arr2[0].modulePath); this.$router.push(arr2[0].modulePath);
} }
@ -954,8 +967,12 @@ export default {
(data.styleType != 2 && data.styleType != 3) || (data.styleType != 2 && data.styleType != 3) ||
!data.styleType !data.styleType
) { ) {
this.$router.push("/projectIndex"); if(this.loginType == 1){
// this.$router.push("/supplierIndex"); // this.$router.push("/projectIndex");
this.$router.push("/workSpace");
} else {
this.$router.push("/supplierIndex");
}
} else if (data.styleType == 2) { } else if (data.styleType == 2) {
this.$router.push("/projectV2/taskList"); this.$router.push("/projectV2/taskList");
} else { } else {