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 getUserManagerApi = data => post('xmgl/systemUser/getTenantListBySn', data); //根据企业或项目SN查找账号列表
export const userDeleteApi = data => post('xmgl/xzRegistry/delete', data);
// 用户管理
// 列表
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
:label="$t('message.deviceManage.operation')"
align="center"
width="400px"
width="420px"
>
<template slot-scope="scope">
<div class="tableBtns" style="margin-left: 35%">
<div class="tableBtns">
<div
v-if="!treeSelectData.projectName"
@click="configAccountFn(scope.row, 'yi')"
@ -231,6 +231,14 @@
label="注册时间"
align="center"
></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">
<template slot-scope="scope">
<div
@ -258,22 +266,33 @@
</el-table>
</el-tab-pane>
<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-column
prop="realName"
prop="account"
align="center"
:label="'姓名'"
label="账号"
></el-table-column>
<el-table-column
prop="account"
:label="'登录账号'"
prop="showPassword"
label="密码"
align="center"
></el-table-column>
<el-table-column prop="userTel" :label="'手机号'" align="center">
</el-table-column>
<el-table-column
prop="jobName"
:label="'所属岗位'"
prop="email"
label="电子邮箱"
align="center"
></el-table-column>
<el-table-column
prop="registryTime"
label="注册时间"
align="center"
></el-table-column>
<el-table-column
@ -281,21 +300,15 @@
align="center"
>
<template slot-scope="scope">
<div style="display: flex;align-items:center;justify-content: space-between;">
<div
@click="configAccountFn(scope.row, 'yi')"
class="operationText"
>
<i class="el-icon-setting"></i>
<span>权限配置</span>
</div>
<div @click="editGroup(scope.row)" class="operationText">
<div class="operation-style">
<div @click="editGroup(scope.row)" class="operationText" style="margin-right: 10px;">
<i class="el-icon-s-operation"></i>
<span>调整组织</span>
</div>
<div
@click="deleteAccountFn(scope.row)"
class="operationText"
style="margin-right: 10px;"
>
<img
src="@/assets/images/icon-delete.png"
@ -1103,61 +1116,75 @@
</el-dialog>
<!-- 调整组织 -->
<el-dialog
class="auditDialog"
title="调整组织"
:visible.sync="editGroupDialog"
:modal-append-to-body="false"
width="667px"
width="600px"
>
<div class="dialog_content">
<el-form
size="medium"
:model="editGroupForm"
ref="editGroupForm"
label-width="110px"
>
<el-form-item label="调整至" prop="groupId">
<div class="select-content">
<div class="tip-text" @click="isSelectCompany = !isSelectCompany">
<span>{{ selectTree.label || "请选择" }}</span>
<i class="el-icon-arrow-down" v-show="!isSelectCompany"></i>
<i class="el-icon-arrow-up" v-show="isSelectCompany"></i>
</div>
<div class="select-list" v-if="isSelectCompany">
<el-input
placeholder="输入关键字进行过滤"
v-model="filterText"
style="width: 98%;margin: 0 5px;"
<div class="dialog_content-part">
<div class="dialog-search" style="margin-top: 20px;">
<el-input
placeholder="请输入组织名称搜索"
suffix-icon="el-icon-search"
style="flex: 1;"
v-model="filterText"
size="small"
>
</el-input>
</div>
<div class="dialog-tree">
<el-tree
:data="level1CompanyData"
:filter-node-method="filterNode"
:highlight-current="true"
:check-on-click-node="false"
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>
<el-tree
:data="treeData"
:props="selectTreeProps"
node-key="id"
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">
</span>
</el-tree>
</div>
</div>
<div class="dialog-footer relative-group">
<el-button
class="cancleBtn"
@click="editGroupDialog = false"
icon="el-icon-circle-close"
size="medium"
>{{ $t("message.companyDiagram.cancel") }}
plain
>取消
</el-button>
<el-button
type="primary"
icon="el-icon-circle-check"
@click="saveAccountFn"
@click="transformGroup"
size="medium"
>{{ $t("message.companyDiagram.determine") }}
>确定
</el-button>
</div>
</div>
@ -1270,7 +1297,9 @@ import {
getUserAuditListApi,
userAuditApi,
userDeleteApi,
getUserManagerApi
getUserManagerApi,
updateUserManagerApi,
getSelectedGroupApi
} from "@/assets/js/api/account.js";
import {
getProjectListApi,
@ -2209,7 +2238,7 @@ export default {
handleTabClick(tab, event) {
if(!this.treeSelectData.name) return;
if(this.tabActiveName == 'third'){
this.getUserAuditListApi();
this.getUserAuditListApiFunc();
} else if(this.tabActiveName == 'four'){
this.getUserManageListApi();
}
@ -2993,8 +3022,12 @@ export default {
type: "warning",
}
).then(() => {
userAuditApi({ id: item.id, approvalProcess:3, xzRegistry: item }).then((res) => {
this.getUserAuditListApi();
userAuditApi({ id: item.id, approvalProcess:3 }).then((res) => {
if(res.success){
this.$message.error("审核拒绝");
this.relativeGroupDialog = false;
this.getUserAuditListApiFunc();
}
});
});
},
@ -3006,62 +3039,101 @@ export default {
const checkedArr = this.transfrom(checked);
const halfCheckedArr = this.transfrom(halfChecked);
const concatArr = checkedArr.concat(halfCheckedArr);
console.log(concatArr)
// 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, xzRegistry: item }).then((res) => {
// this.getUserAuditListApi();
// });
// });
const companySnArr = new Set([]);
const projectSnArr = new Set([]);
if(concatArr.length == 0){
this.$message.error("请先选择关联组织");
return;
}
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.relativeGroupDialog = false;
this.getUserAuditListApiFunc();
}
});
});
},
transfrom(arr) {
const result = [];
console.log(arr);
return arr
.map(item => {
if (arr.children && Array.isArray(arr.children)) {
result.concat(transfrom(arr.children));
}
// if (arr.children && Array.isArray(arr.children)) {
// result.concat(transfrom(arr.children));
// }
return {
authorityId: item.name,
menuType: item.type
companySn: item.companySn,
projectSn: item.projectSn,
name: item.name
};
})
.concat(result);
},
// keys
getRelativeKeys(arr){
let keysArr = [];
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);
}
});
let keysArr = arr;
return keysArr;
},
//
relativeGroupFn(item) {
this.selectRowObj = item;
this.relativeGroupDialog = true;
//
// nextTick(() => {
// this.$refs.relativeTree.setCheckedKeys(getRelativeKeys(res.result));
// });
},
transformGroup(){
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) {
@ -3080,7 +3152,7 @@ export default {
}
).then(() => {
userDeleteApi({ id: item.id }).then((res) => {
this.getUserAuditListApi();
this.getUserAuditListApiFunc();
this.$message.success(
this.$t("message.companyDiagram.deleteSuccess")
); //!
@ -3141,8 +3213,14 @@ export default {
});
},
//
editGroup() {
async editGroup(row) {
this.editGroupDialog = true;
//
const res = await getSelectedGroupApi({ userId: row.userId });
//
this.$nextTick(() => {
this.$refs.groupTree.setCheckedKeys(this.getRelativeKeys(res.result));
});
},
//
editAccountFn(item) {
@ -3215,16 +3293,16 @@ export default {
//
getUserManageListApi(){
let data = this.treeSelectData;
let sn = data.projectSn ? data.projectSn : data.companySn;
getUserManagerApi({ sn: sn, pageNo: -1, pageSize: -1 }).then((res) => {
this.userManageList = res.result.records;
let sn = data.projectSn ? data.projectSn : "";
getUserManagerApi({ projectSn: sn, pageNo: -1, pageSize: -1 }).then((res) => {
this.userManageList = res.result;
});
},
//
getUserAuditListApi(){
getUserAuditListApiFunc(){
let data = this.treeSelectData;
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;
});
},
@ -3734,32 +3812,10 @@ export default {
margin-top: -6px;
cursor: pointer;
}
// /deep/.el-select__tags{
// width: 350px;
// top: 58%;
// 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;
// }
.operation-style{
.flex();
justify-content: center;
}
.add {
display: flex;
align-items: center;

View File

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