feat: 组织机构管理功能添加
This commit is contained in:
parent
9d88831502
commit
86e5d0ae7c
@ -54,4 +54,11 @@ export const deleteNoticeRemindSoundApi = data => post('xmgl/noticeRemindSound/d
|
||||
//列表查询通知提示音信息
|
||||
export const selectNoticeRemindSoundApi = data => post('xmgl/noticeRemindSound/list', data);
|
||||
|
||||
// 组织机构管理
|
||||
export const getTreeGroupApi = data => get('xmgl/xzProjectOrg/tree/list', data);
|
||||
export const addTreeGroupApi = data => post('xmgl/xzProjectOrg/add', data);
|
||||
export const editTreeGroupApi = data => post('xmgl/xzProjectOrg/edit', data);
|
||||
export const deleteTreeGroupApi = data => post('xmgl/xzProjectOrg/delete', data);
|
||||
|
||||
|
||||
|
||||
|
||||
@ -41,7 +41,7 @@
|
||||
v-if="$route.path.indexOf('/firm/') == -1 && company != 'nanchang'"
|
||||
@click="changeArea(-1)"
|
||||
>{{
|
||||
$store.state.currentProDetail.name ? systemInfo.platformName + " - " + $store.state.currentProDetail.name : headerName
|
||||
$store.state.currentProDetail && $store.state.currentProDetail.name ? systemInfo.platformName + " - " + $store.state.currentProDetail.name : headerName
|
||||
}}</span
|
||||
>
|
||||
<span
|
||||
|
||||
@ -842,7 +842,14 @@ const routes2 = [
|
||||
component: (resolve) =>
|
||||
require(["@/views/companyAdmin/operationLog.vue"], resolve),
|
||||
},
|
||||
|
||||
{
|
||||
path: "/project/configManage/groupStructureManagement",
|
||||
name: "系统管理_人员权限1",
|
||||
component: (resolve) =>
|
||||
require([
|
||||
"@/views/projectFront/configManage/groupStructureManagement.vue",
|
||||
], resolve),
|
||||
},
|
||||
{
|
||||
path: "/project/towerCrane/home", //塔吊管理 首页
|
||||
name: "塔吊管理_首页2",
|
||||
|
||||
591
src/views/projectFront/configManage/groupStructureManagement.vue
Normal file
591
src/views/projectFront/configManage/groupStructureManagement.vue
Normal file
@ -0,0 +1,591 @@
|
||||
<template>
|
||||
<div class="fullHeight">
|
||||
<div class="searchBox whiteBlock">
|
||||
<el-form :inline="true" size="medium">
|
||||
<el-form-item label="组织名称">
|
||||
<el-input
|
||||
v-model="queryInfo.name"
|
||||
placeholder="请输入"
|
||||
clearable
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态">
|
||||
<el-select v-model="queryInfo.status" placeholder="请选择" clearable>
|
||||
<el-option
|
||||
v-for="item in statusList"
|
||||
:key="item.value"
|
||||
:label="item.name"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<!-- 查询-->
|
||||
<el-button type="primary" plain @click="query">{{
|
||||
$t("message.alarmWarning.query")
|
||||
}}</el-button>
|
||||
<!-- //刷新-->
|
||||
<el-button type="warning" plain @click="refresh">{{
|
||||
$t("message.alarmValueSet.refresh")
|
||||
}}</el-button>
|
||||
<!-- 新增-->
|
||||
<el-button type="primary" @click="add">{{
|
||||
$t("message.videoManage.add")
|
||||
}}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<div class="table_wrap whiteBlock">
|
||||
<vue-scroll style="height: 70%">
|
||||
<el-table
|
||||
class="tables"
|
||||
:data="List"
|
||||
row-key="id"
|
||||
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
|
||||
>
|
||||
<el-table-column
|
||||
prop="deptName"
|
||||
label="组织名称"
|
||||
align="center"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="orderNum"
|
||||
label="排序"
|
||||
align="center"
|
||||
></el-table-column>
|
||||
<el-table-column label="状态" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.status === 0">正常</el-tag>
|
||||
<el-tag type="danger" v-else>停用</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="createTime"
|
||||
label="创建时间"
|
||||
align="center"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
width="600px"
|
||||
:label="$t('message.alarmValueSet.operation')"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<div class="tableBtns">
|
||||
<div @click="addChildrenGroup(scope.row)" class="operationText">
|
||||
<i
|
||||
class="el-icon-plus"
|
||||
style="width: 15px;height: 15px;color: #3F93FF;margin-right: 2px;"
|
||||
></i>
|
||||
<span>新增</span>
|
||||
</div>
|
||||
<div @click="edit(scope.row)" class="operationText">
|
||||
<img
|
||||
src="@/assets/images/icon-edit.png"
|
||||
width="15px"
|
||||
height="15px"
|
||||
/>
|
||||
<span>{{ $t("message.alarmValueSet.edit") }}</span>
|
||||
</div>
|
||||
<div @click="deleteDev(scope.row)" class="operationText">
|
||||
<img
|
||||
src="@/assets/images/icon-delete.png"
|
||||
width="15px"
|
||||
height="15px"
|
||||
/>
|
||||
<span>{{ $t("message.alarmValueSet.delete") }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</vue-scroll>
|
||||
<!-- <el-pagination
|
||||
class="pagerBox"
|
||||
@size-change="SizeChange"
|
||||
@current-change="CurrentChange"
|
||||
:current-page="pagInfo.pageNo"
|
||||
:page-sizes="$store.state.PAGESIZRS"
|
||||
:page-size="pagInfo.pageSize"
|
||||
layout="total, sizes, prev, pager, next"
|
||||
:total="pagInfo.total"
|
||||
background
|
||||
></el-pagination> -->
|
||||
</div>
|
||||
<el-dialog
|
||||
:modal-append-to-body="false"
|
||||
:title="title"
|
||||
:visible.sync="groupDialogVisible"
|
||||
width="667px"
|
||||
>
|
||||
<div class="dialog_content">
|
||||
<el-form
|
||||
size="medium"
|
||||
:model="addEditForm"
|
||||
ref="addEditForm"
|
||||
label-width="80px"
|
||||
class="dialogFormBox"
|
||||
:rules="formRules"
|
||||
>
|
||||
<el-form-item
|
||||
v-if="title == '添加子组织' || addEditForm.parentId !='0'"
|
||||
label="选择父级"
|
||||
prop="parentId"
|
||||
>
|
||||
<el-select
|
||||
v-model="selectVal"
|
||||
placeholder="请选择"
|
||||
>
|
||||
<el-option style="height:auto" :value="[]">
|
||||
<el-tree
|
||||
:data="List"
|
||||
node-key="id"
|
||||
ref="groupTree"
|
||||
highlight-current
|
||||
:default-expanded-keys="defaultExpandArr"
|
||||
:props="defaultProps"
|
||||
:default-expand-all="false"
|
||||
@node-click="treeClick"
|
||||
>
|
||||
</el-tree>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<div class="row-flex">
|
||||
<el-form-item label="组织名称" prop="deptName">
|
||||
<el-input
|
||||
v-model="addEditForm.deptName"
|
||||
placeholder="请输入"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="显示排序" prop="orderNum">
|
||||
<el-input-number
|
||||
v-model="addEditForm.orderNum"
|
||||
controls-position="right"
|
||||
:max="100"
|
||||
></el-input-number>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div class="row-flex">
|
||||
<el-form-item label="负责人" prop="leader">
|
||||
<el-input
|
||||
v-model="addEditForm.leader"
|
||||
placeholder="请输入"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="联系电话" prop="phone">
|
||||
<el-input
|
||||
v-model="addEditForm.phone"
|
||||
placeholder="请输入"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div class="row-flex">
|
||||
<el-form-item label="邮箱" prop="email">
|
||||
<el-input
|
||||
v-model="addEditForm.email"
|
||||
placeholder="请输入"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="组织状态" prop="status">
|
||||
<el-radio-group v-model="addEditForm.status">
|
||||
<el-radio :label="0">正常</el-radio>
|
||||
<el-radio :label="1">停用</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div class="dialog-footer">
|
||||
<el-button
|
||||
class="cancleBtn"
|
||||
@click="groupDialogVisible = false"
|
||||
icon="el-icon-circle-close"
|
||||
size="medium"
|
||||
>{{ $t("message.alarmValueSet.cancel") }}
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-circle-check"
|
||||
@click="submitAdd"
|
||||
size="medium"
|
||||
>{{ $t("message.alarmValueSet.save") }}
|
||||
</el-button>
|
||||
</div>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {
|
||||
addProjectUserApi,
|
||||
editProjectUserApi,
|
||||
getProjectChilderSystemUserListApi,
|
||||
getTreeGroupApi,
|
||||
addTreeGroupApi,
|
||||
editTreeGroupApi,
|
||||
deleteTreeGroupApi,
|
||||
} from "@/assets/js/api/configManage";
|
||||
import {
|
||||
getEnterpriseInfoList,
|
||||
ufaceDevList,
|
||||
} from "@/assets/js/api/laborPerson";
|
||||
import { deleteSystemUserApi } from "@/assets/js/api/account";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
defaultExpandArr: [],
|
||||
selectVal: "",
|
||||
selectTreeData: {},
|
||||
dateList: [], // 遍历用
|
||||
value1: [], // select绑定的值
|
||||
// 对应的字段
|
||||
defaultProps: {
|
||||
children: "children",
|
||||
label: "deptName",
|
||||
},
|
||||
groupDialogVisible: false,
|
||||
title: "添加组织",
|
||||
statusList: [
|
||||
{ name: "正常", value: 0 },
|
||||
{ name: "停用", value: 1 },
|
||||
],
|
||||
workerName: "",
|
||||
addEditForm: {
|
||||
deptName: "",
|
||||
orderNum: 0,
|
||||
leader: "",
|
||||
phone: "",
|
||||
email: "",
|
||||
status: 0,
|
||||
parentId: "",
|
||||
},
|
||||
formRules: {
|
||||
parentId: [
|
||||
{
|
||||
required: true,
|
||||
message: "请选择",
|
||||
trigger: "change",
|
||||
},
|
||||
],
|
||||
deptName: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
orderNum: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
phone: [
|
||||
{
|
||||
message: "请输入正确的手机号码",
|
||||
trigger: "blur",
|
||||
pattern: /^1(3|4|5|6|7|8|9)\d{9}$/,
|
||||
},
|
||||
],
|
||||
email: [
|
||||
{
|
||||
type: "email",
|
||||
message: "请输入正确的邮箱格式",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
},
|
||||
List: [],
|
||||
Popup: {
|
||||
type: "add",
|
||||
show: false,
|
||||
},
|
||||
queryInfo: {
|
||||
name: "",
|
||||
status: null,
|
||||
},
|
||||
pagInfo: {
|
||||
pageNo: 1, //页数
|
||||
pageSize: 10, //条数
|
||||
total: 0, //总条数
|
||||
},
|
||||
personList: [],
|
||||
roleList: [],
|
||||
enterpriseListData: [],
|
||||
selectCompanyData: [],
|
||||
companyDialog: false,
|
||||
checkAll: false,
|
||||
isIndeterminate: false,
|
||||
editComapnyDataId: "",
|
||||
//配置可查看或管理的设备相关参数
|
||||
allUfaceDev: [],
|
||||
allVideoDev: [],
|
||||
configDevDialog: false,
|
||||
configDevType: 1, //1人脸设备,2视频监控
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
// 树形控件点击
|
||||
treeClick(data) {
|
||||
console.log(data);
|
||||
this.selectVal = data.deptName;
|
||||
this.selectTreeData = data;
|
||||
this.addEditForm.parentId = data.id;
|
||||
this.$refs.addEditForm.validateField("parentId");
|
||||
},
|
||||
//获取企业 || 劳务公司 列表
|
||||
getProjectList() {
|
||||
let data = {
|
||||
projectSn: this.$store.state.projectSn,
|
||||
// enterpriseName: this.enterpriseName,
|
||||
};
|
||||
getEnterpriseInfoList(data).then((res) => {
|
||||
this.enterpriseListData = res.result;
|
||||
// console.log(res.result);
|
||||
});
|
||||
},
|
||||
//获取所有的闸机设备
|
||||
getMachineList() {
|
||||
ufaceDevList({ projectSn: this.$store.state.projectSn }).then((list) => {
|
||||
this.allUfaceDev = list.result;
|
||||
});
|
||||
},
|
||||
handle(type, show) {
|
||||
//打开弹窗前的统一处理
|
||||
this.Popup = {
|
||||
type: type,
|
||||
show: show,
|
||||
};
|
||||
},
|
||||
query() {
|
||||
console.log("查询的参数", this.queryInfo);
|
||||
this.getList();
|
||||
},
|
||||
add() {
|
||||
this.title = "添加组织";
|
||||
this.selectVal = "";
|
||||
this.selectTreeData = {};
|
||||
this.addEditForm = {
|
||||
deptName: "",
|
||||
orderNum: 0,
|
||||
leader: "",
|
||||
phone: "",
|
||||
email: "",
|
||||
status: 0,
|
||||
parentId: "",
|
||||
}
|
||||
this.groupDialogVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addEditForm.clearValidate();
|
||||
});
|
||||
},
|
||||
// 添加子组织
|
||||
addChildrenGroup(obj) {
|
||||
this.title = "添加子组织";
|
||||
this.selectVal = "";
|
||||
this.selectTreeData = {};
|
||||
this.addEditForm = {
|
||||
deptName: "",
|
||||
orderNum: 0,
|
||||
leader: "",
|
||||
phone: "",
|
||||
email: "",
|
||||
status: 0,
|
||||
parentId: "",
|
||||
}
|
||||
this.groupDialogVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addEditForm.clearValidate();
|
||||
});
|
||||
},
|
||||
edit(obj) {
|
||||
console.log("编辑", obj);
|
||||
this.title = "编辑组织";
|
||||
this.addEditForm = JSON.parse(JSON.stringify(obj));
|
||||
if (this.addEditForm.parentObj) {
|
||||
this.selectTreeData = JSON.parse(this.addEditForm.parentObj);
|
||||
this.selectVal = this.selectTreeData.deptName;
|
||||
this.defaultExpandArr = [this.selectTreeData.id];
|
||||
} else {
|
||||
this.selectTreeData = {};
|
||||
this.selectVal = "";
|
||||
this.defaultExpandArr = [];
|
||||
}
|
||||
this.groupDialogVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addEditForm.clearValidate();
|
||||
if (this.addEditForm.parentObj) {
|
||||
this.$refs.groupTree.setCurrentKey(this.addEditForm.parentId);
|
||||
}
|
||||
});
|
||||
},
|
||||
deleteDev(obj) {
|
||||
console.log("删除", obj);
|
||||
this.$confirm(
|
||||
this.$t("message.personnelPosition.beaconManage.table.confirmText") +
|
||||
"【" +
|
||||
obj.deptName +
|
||||
"】?",
|
||||
this.$t("message.personnelPosition.beaconManage.table.Tips"),
|
||||
{
|
||||
confirmButtonText: this.$t(
|
||||
"message.personnelPosition.confirmButtonText"
|
||||
),
|
||||
cancelButtonText: this.$t(
|
||||
"message.personnelPosition.cancelButtonText"
|
||||
),
|
||||
type: "warning",
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
deleteTreeGroupApi({ id: obj.id }).then((result) => {
|
||||
if (result.success) {
|
||||
this.$message.success(result.message);
|
||||
this.getList();
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
submitAdd() {
|
||||
this.$refs["addEditForm"].validate((valid) => {
|
||||
if (valid) {
|
||||
let params = this.addEditForm;
|
||||
// params.alarmPushWorkerId = this.addEditForm.alarmPushWorkerId.join(',');
|
||||
params.projectSn = this.$store.state.projectSn;
|
||||
if (this.title == "添加子组织") {
|
||||
params.parentObj = JSON.stringify(this.selectTreeData);
|
||||
}
|
||||
if (this.title == "添加组织" || this.title == "添加子组织") {
|
||||
addTreeGroupApi(params).then((result) => {
|
||||
if (result.success) {
|
||||
this.$message.success(result.message);
|
||||
this.getList();
|
||||
this.groupDialogVisible = false;
|
||||
}
|
||||
});
|
||||
} else if (this.title == "编辑组织" || this.title == "编辑子组织") {
|
||||
console.log("编辑信息", this.addEditForm);
|
||||
editTreeGroupApi(params).then((result) => {
|
||||
if (result.success) {
|
||||
this.$message.success(result.message);
|
||||
this.getList();
|
||||
this.groupDialogVisible = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
console.log("error submit!!");
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
refresh() {
|
||||
this.workerName = "";
|
||||
this.getList();
|
||||
},
|
||||
getList() {
|
||||
getTreeGroupApi({
|
||||
projectSn: this.$store.state.projectSn,
|
||||
deptName: this.queryInfo.name,
|
||||
status: this.queryInfo.status,
|
||||
}).then((result) => {
|
||||
if (result.success) {
|
||||
this.List = result.result;
|
||||
console.log("列表", result);
|
||||
}
|
||||
});
|
||||
},
|
||||
close() {
|
||||
this.addEditForm = {};
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addEditForm.clearValidate();
|
||||
});
|
||||
},
|
||||
SizeChange(val) {
|
||||
this.pagInfo.pageSize = val;
|
||||
this.getList();
|
||||
},
|
||||
CurrentChange(val) {
|
||||
this.pagInfo.pageNo = val;
|
||||
this.getList();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.flex() {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
// 添加/编辑组织弹框样式
|
||||
.dialog_content {
|
||||
padding: 0px;
|
||||
.dialogFormBox {
|
||||
width: 100%;
|
||||
.el-input {
|
||||
width: 100% !important;
|
||||
}
|
||||
.el-input-number {
|
||||
/deep/.el-input {
|
||||
width: 100% !important;
|
||||
}
|
||||
}
|
||||
.el-select {
|
||||
width: 100% !important;
|
||||
/deep/.el-input {
|
||||
width: 100% !important;
|
||||
}
|
||||
}
|
||||
.row-flex {
|
||||
.flex();
|
||||
justify-content: space-between;
|
||||
.el-form-item {
|
||||
width: 49%;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.el-checkbox-group {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
overflow: auto;
|
||||
}
|
||||
.el-checkbox-widthOne {
|
||||
width: 260px;
|
||||
height: 50px;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
.el-checkbox-width {
|
||||
width: 250px;
|
||||
white-space: pre-wrap;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.el-checkbox-widthTwo {
|
||||
width: 260px;
|
||||
height: 50px;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
.searchBox > div {
|
||||
margin-right: 15px;
|
||||
}
|
||||
|
||||
.tableBtns {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
::v-deep .el-checkbox__label {
|
||||
width: 260px;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
padding-left: 22px;
|
||||
line-height: 15px;
|
||||
}
|
||||
</style>
|
||||
@ -192,6 +192,29 @@
|
||||
:placeholder="$t('message.companyDiagram.PleaseEnter')"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="选择组织"
|
||||
prop="xzProjectOrgId"
|
||||
>
|
||||
<el-select
|
||||
v-model="selectVal"
|
||||
placeholder="请选择"
|
||||
>
|
||||
<el-option style="height:auto" :value="[]">
|
||||
<el-tree
|
||||
:data="treeList"
|
||||
node-key="id"
|
||||
ref="groupTree"
|
||||
highlight-current
|
||||
:default-expanded-keys="defaultExpandArr"
|
||||
:props="defaultProps"
|
||||
:default-expand-all="false"
|
||||
@node-click="treeClick"
|
||||
>
|
||||
</el-tree>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
:label="$t('message.personnelAccess.Labjuese')"
|
||||
prop="roleId"
|
||||
@ -394,6 +417,7 @@ import {
|
||||
selectUserDevAuthorityByUserIdApi,
|
||||
addOrEditUserDevAuthorityApi,
|
||||
selecAllVideoListApi,
|
||||
getTreeGroupApi,
|
||||
} from "@/assets/js/api/configManage";
|
||||
import {
|
||||
getEnterpriseInfoList,
|
||||
@ -408,13 +432,24 @@ export default {
|
||||
this.loadPersonList();
|
||||
this.getList();
|
||||
this.getProjectList();
|
||||
this.getTreeList();
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
defaultExpandArr: [],
|
||||
// 对应的字段
|
||||
defaultProps: {
|
||||
children: "children",
|
||||
label: "deptName",
|
||||
},
|
||||
treeList: [],
|
||||
selectVal: "",
|
||||
selectTreeData: {},
|
||||
workerName: '',
|
||||
addEditForm: {
|
||||
account: "",
|
||||
password: "",
|
||||
xzProjectOrgId: "",
|
||||
roleId: "",
|
||||
userId: "",
|
||||
externalAccount: "",
|
||||
@ -500,6 +535,22 @@ export default {
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
getTreeList() {
|
||||
getTreeGroupApi({
|
||||
projectSn: this.$store.state.projectSn
|
||||
}).then((result) => {
|
||||
if (result.success) {
|
||||
this.treeList = result.result;
|
||||
}
|
||||
});
|
||||
},
|
||||
// 树形控件点击
|
||||
treeClick(data) {
|
||||
console.log(data);
|
||||
this.selectVal = data.deptName;
|
||||
this.selectTreeData = data;
|
||||
this.addEditForm.xzProjectOrgId = data.id;
|
||||
},
|
||||
configFn(item) {
|
||||
this.companyDialog = true;
|
||||
this.addEditForm = JSON.parse(JSON.stringify(item));
|
||||
@ -704,7 +755,21 @@ export default {
|
||||
.split(",")
|
||||
.map(Number);
|
||||
}
|
||||
if (this.addEditForm.xzProjectOrgObj) {
|
||||
this.selectTreeData = JSON.parse(this.addEditForm.xzProjectOrgObj);
|
||||
this.selectVal = this.selectTreeData.deptName;
|
||||
this.defaultExpandArr = [this.selectTreeData.id];
|
||||
} else {
|
||||
this.selectTreeData = {};
|
||||
this.selectVal = "";
|
||||
this.defaultExpandArr = [];
|
||||
}
|
||||
this.handle("edit", true);
|
||||
this.$nextTick(() => {
|
||||
if (this.addEditForm.xzProjectOrgObj) {
|
||||
this.$refs.groupTree.setCurrentKey(this.addEditForm.xzProjectOrgId);
|
||||
}
|
||||
});
|
||||
},
|
||||
deleteDev(obj) {
|
||||
console.log("删除", obj);
|
||||
@ -740,6 +805,9 @@ export default {
|
||||
let params = this.addEditForm;
|
||||
// params.alarmPushWorkerId = this.addEditForm.alarmPushWorkerId.join(',');
|
||||
params.sn = this.$store.state.projectSn;
|
||||
if(this.selectVal){
|
||||
params.xzProjectOrgObj = JSON.stringify(this.selectTreeData);
|
||||
}
|
||||
if (this.Popup.type === "add") {
|
||||
addProjectUserApi(params).then((result) => {
|
||||
if (result.success) {
|
||||
@ -799,7 +867,7 @@ export default {
|
||||
<style lang="less" scoped>
|
||||
.dialog_content {
|
||||
width: 600px;
|
||||
height: 500px;
|
||||
height: auto;
|
||||
}
|
||||
.el-checkbox-group {
|
||||
display: flex;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user