2025-06-13 18:06:27 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<!--自定义的tag标签-->
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<div class="myInput" @click="onClick">
|
2025-08-21 09:19:57 +08:00
|
|
|
|
<el-input
|
|
|
|
|
|
:value="childValueUp"
|
|
|
|
|
|
clearable
|
|
|
|
|
|
readonly
|
|
|
|
|
|
placeholder="请选择(可多选)"
|
|
|
|
|
|
>
|
2025-06-13 18:06:27 +08:00
|
|
|
|
<template v-slot:suffix>
|
|
|
|
|
|
<i class="el-icon-circle-close" @click.stop="onClear"></i>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</el-input>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<!-- 新增 -->
|
2025-08-21 09:19:57 +08:00
|
|
|
|
<el-dialog
|
|
|
|
|
|
:visible.sync="dealShow"
|
2025-08-30 17:32:28 +08:00
|
|
|
|
width="1440px"
|
2025-08-21 09:19:57 +08:00
|
|
|
|
append-to-body
|
|
|
|
|
|
:title="dealTitle"
|
|
|
|
|
|
>
|
2025-06-13 18:06:27 +08:00
|
|
|
|
<div class="dialog_main">
|
|
|
|
|
|
<div class="treeBox">
|
|
|
|
|
|
<vue-scroll v-if="treeList.length > 0">
|
|
|
|
|
|
<el-tree
|
|
|
|
|
|
:data="treeList"
|
|
|
|
|
|
@node-click="handleNodeClick"
|
|
|
|
|
|
:props="defaultProps"
|
|
|
|
|
|
default-expand-all
|
|
|
|
|
|
node-key="id"
|
|
|
|
|
|
ref="tree"
|
|
|
|
|
|
>
|
|
|
|
|
|
<span class="custom-tree-node" slot-scope="{ node, data }">
|
|
|
|
|
|
<span
|
|
|
|
|
|
style="
|
|
|
|
|
|
width: 160px;
|
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
|
display: inline-block;
|
|
|
|
|
|
"
|
|
|
|
|
|
:title="node.label"
|
|
|
|
|
|
>{{ node.label }}</span
|
|
|
|
|
|
>
|
|
|
|
|
|
</span>
|
|
|
|
|
|
</el-tree>
|
|
|
|
|
|
</vue-scroll>
|
|
|
|
|
|
<div class="placeholderBox" v-else>
|
|
|
|
|
|
<img src="@/assets/images/noData2.png" alt="" srcset="" />
|
|
|
|
|
|
<p>{{ $t("message.videoManage.empty") }}</p>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="table_main">
|
|
|
|
|
|
<el-form
|
|
|
|
|
|
ref="dealForm"
|
|
|
|
|
|
:model="dealForm"
|
|
|
|
|
|
size="medium"
|
|
|
|
|
|
class="dealForm"
|
|
|
|
|
|
:inline="true"
|
|
|
|
|
|
>
|
|
|
|
|
|
<el-form-item label="姓名" prop="realName">
|
2025-08-21 09:19:57 +08:00
|
|
|
|
<el-input
|
|
|
|
|
|
v-model="dealForm.realName"
|
|
|
|
|
|
placeholder="请输入"
|
|
|
|
|
|
></el-input>
|
2025-06-13 18:06:27 +08:00
|
|
|
|
</el-form-item>
|
2025-08-30 17:32:28 +08:00
|
|
|
|
<el-form-item label="角色" prop="roleId">
|
|
|
|
|
|
<!-- <el-input
|
|
|
|
|
|
v-model="dealForm.roleName"
|
|
|
|
|
|
placeholder="请输入"
|
|
|
|
|
|
></el-input> -->
|
|
|
|
|
|
<el-select
|
|
|
|
|
|
v-model="dealForm.roleId"
|
|
|
|
|
|
filterable
|
|
|
|
|
|
clearable
|
|
|
|
|
|
:placeholder="$t('message.personnelAccess.juese')"
|
|
|
|
|
|
>
|
|
|
|
|
|
<el-option
|
|
|
|
|
|
v-for="item in roleList"
|
|
|
|
|
|
:key="item.roleId"
|
|
|
|
|
|
:label="item.roleName"
|
|
|
|
|
|
:value="item.roleId"
|
|
|
|
|
|
>
|
|
|
|
|
|
</el-option>
|
|
|
|
|
|
</el-select>
|
2025-06-13 18:06:27 +08:00
|
|
|
|
</el-form-item>
|
2025-08-30 17:32:28 +08:00
|
|
|
|
<el-form-item label="班组/部门" prop="departmentTeamId">
|
|
|
|
|
|
<!-- <el-input
|
2025-06-13 18:06:27 +08:00
|
|
|
|
v-model="dealForm.departmentTeamName"
|
|
|
|
|
|
placeholder="请输入"
|
2025-08-30 17:32:28 +08:00
|
|
|
|
></el-input> -->
|
|
|
|
|
|
<el-select
|
|
|
|
|
|
v-model="dealForm.departmentTeamId"
|
|
|
|
|
|
filterable
|
|
|
|
|
|
placeholder="请选择班组/部门"
|
|
|
|
|
|
clearable
|
|
|
|
|
|
>
|
|
|
|
|
|
<el-option
|
|
|
|
|
|
v-for="item in teamInfoList"
|
|
|
|
|
|
:key="item.id"
|
|
|
|
|
|
:label="item.name"
|
|
|
|
|
|
:value="item.id"
|
|
|
|
|
|
></el-option>
|
|
|
|
|
|
</el-select>
|
|
|
|
|
|
</el-form-item>
|
2025-06-13 18:06:27 +08:00
|
|
|
|
<el-form-item>
|
2025-08-21 09:19:57 +08:00
|
|
|
|
<el-button type="primary" plain @click="handleQuery"
|
|
|
|
|
|
>查询</el-button
|
|
|
|
|
|
>
|
|
|
|
|
|
<el-button type="warning" plain @click="handleRefresh"
|
|
|
|
|
|
>刷新</el-button
|
|
|
|
|
|
>
|
2025-06-13 18:06:27 +08:00
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-form>
|
|
|
|
|
|
<!-- <div class="check_box">
|
|
|
|
|
|
<div>
|
|
|
|
|
|
已选{{
|
|
|
|
|
|
$refs.selectedPersonnelAccountTable
|
|
|
|
|
|
? $refs.selectedPersonnelAccountTable.selection.length
|
|
|
|
|
|
: 0
|
|
|
|
|
|
}}项
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<el-button @click="toggleSelection(false)" type="text" style="color: #f76c6c"
|
|
|
|
|
|
>取消</el-button
|
|
|
|
|
|
>
|
|
|
|
|
|
<el-button @click="toggleSelection(true)" type="text">全选</el-button>
|
|
|
|
|
|
</div> -->
|
|
|
|
|
|
<el-table
|
|
|
|
|
|
ref="selectedPersonnelAccountTable"
|
|
|
|
|
|
:data="tableData"
|
|
|
|
|
|
:row-key="propUserType.id"
|
|
|
|
|
|
:height="440"
|
|
|
|
|
|
class="tables"
|
|
|
|
|
|
@select="handleSelectChange"
|
|
|
|
|
|
@select-all="handleSelectChangeAll"
|
|
|
|
|
|
>
|
2025-08-21 09:19:57 +08:00
|
|
|
|
<el-table-column
|
|
|
|
|
|
type="selection"
|
|
|
|
|
|
align="center"
|
|
|
|
|
|
width="55"
|
|
|
|
|
|
></el-table-column>
|
|
|
|
|
|
<el-table-column prop="enterpriseName" label="所属企业">
|
|
|
|
|
|
</el-table-column>
|
2025-06-13 18:06:27 +08:00
|
|
|
|
<el-table-column align="center" prop="realName" label="姓名">
|
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
|
{{ scope.row.realName ? scope.row.realName : "--" }}({{
|
|
|
|
|
|
scope.row.account
|
|
|
|
|
|
}})
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
<el-table-column align="center" prop="roleName" label="角色">
|
|
|
|
|
|
</el-table-column>
|
2025-08-21 09:19:57 +08:00
|
|
|
|
<el-table-column
|
|
|
|
|
|
align="center"
|
|
|
|
|
|
prop="enterpriseName"
|
|
|
|
|
|
label="所属班组/部门"
|
|
|
|
|
|
>
|
2025-06-13 18:06:27 +08:00
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
|
{{ scope.row.departmentTeamName }}
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
</el-table>
|
|
|
|
|
|
<pagination
|
|
|
|
|
|
v-show="dealForm.total > 0"
|
|
|
|
|
|
:total="Number(dealForm.total)"
|
|
|
|
|
|
:page.sync="dealForm.pageNo"
|
|
|
|
|
|
:limit.sync="dealForm.pageSize"
|
|
|
|
|
|
@pagination="getUpdatePersonListFn"
|
|
|
|
|
|
:pageSizes="[...$store.state.PAGESIZRS, 100, 200, 500, 1000]"
|
|
|
|
|
|
layout="total,sizes, prev, pager, next, jumper"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="selected_point">
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<div>已选人员</div>
|
|
|
|
|
|
<div @click="onRiskEmpty">清空</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="selected_point_scroll">
|
|
|
|
|
|
<el-tag
|
|
|
|
|
|
v-for="tag in selectedList"
|
|
|
|
|
|
:key="tag.id"
|
2025-08-21 09:19:57 +08:00
|
|
|
|
:type="tag.userId === selectedInfo.userId ? '' : 'info'"
|
2025-06-13 18:06:27 +08:00
|
|
|
|
@close="onRiskDelete(tag)"
|
|
|
|
|
|
@click="onRiskClick(tag)"
|
|
|
|
|
|
closable
|
|
|
|
|
|
>
|
|
|
|
|
|
{{ tag.realName ? tag.realName : "--" }}({{ tag.account }})
|
|
|
|
|
|
</el-tag>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div slot="footer" style="text-align: center">
|
2025-08-21 09:19:57 +08:00
|
|
|
|
<el-button
|
|
|
|
|
|
icon="el-icon-circle-close"
|
|
|
|
|
|
size="medium"
|
|
|
|
|
|
@click="dealFormCancel"
|
|
|
|
|
|
>取消</el-button
|
|
|
|
|
|
>
|
|
|
|
|
|
<el-button
|
|
|
|
|
|
icon="el-icon-circle-check"
|
|
|
|
|
|
size="medium"
|
|
|
|
|
|
type="primary"
|
|
|
|
|
|
@click="submitDealForm"
|
|
|
|
|
|
>确定</el-button
|
|
|
|
|
|
>
|
2025-06-13 18:06:27 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
|
import {
|
|
|
|
|
|
getWorkerInfoList,
|
|
|
|
|
|
selectHierarchyEnterpriseListApi,
|
|
|
|
|
|
} from "@/assets/js/api/laborPerson.js";
|
|
|
|
|
|
import {
|
|
|
|
|
|
getProjectChilderSystemUserPageListApi,
|
|
|
|
|
|
getProjectChilderSystemUserListApi,
|
2025-08-30 17:32:28 +08:00
|
|
|
|
getBaseRoleListApi,
|
2025-06-13 18:06:27 +08:00
|
|
|
|
} from "@/assets/js/api/configManage.js";
|
2025-08-30 17:32:28 +08:00
|
|
|
|
import { getDepartmentAndTeamListApi } from "@/assets/js/api/operationManagement";
|
2025-06-13 18:06:27 +08:00
|
|
|
|
export default {
|
|
|
|
|
|
name: "selectedPersonnelAccount",
|
|
|
|
|
|
props: {
|
|
|
|
|
|
value: {
|
2025-08-21 17:57:40 +08:00
|
|
|
|
type: [Array, String, Number],
|
|
|
|
|
|
default: () => [], //类型
|
2025-06-13 18:06:27 +08:00
|
|
|
|
},
|
|
|
|
|
|
enterpriseIds: {
|
|
|
|
|
|
type: Array,
|
2025-08-21 17:57:40 +08:00
|
|
|
|
default: () => [],
|
2025-06-13 18:06:27 +08:00
|
|
|
|
}, // 企业id数组,用于过滤人员列表,
|
|
|
|
|
|
enterpriseFlag: {
|
|
|
|
|
|
type: Boolean,
|
|
|
|
|
|
default: true,
|
|
|
|
|
|
}, // 是否显示企业选择器
|
|
|
|
|
|
},
|
|
|
|
|
|
data() {
|
|
|
|
|
|
return {
|
|
|
|
|
|
childValue: [],
|
|
|
|
|
|
treeList: [],
|
|
|
|
|
|
// 对应的字段
|
|
|
|
|
|
defaultProps: {
|
|
|
|
|
|
children: "children",
|
|
|
|
|
|
label: "enterpriseName",
|
|
|
|
|
|
},
|
|
|
|
|
|
dealShow: false,
|
|
|
|
|
|
dealForm: {
|
|
|
|
|
|
realName: "",
|
|
|
|
|
|
roleName: "",
|
2025-08-30 17:32:28 +08:00
|
|
|
|
roleId: "",
|
2025-06-13 18:06:27 +08:00
|
|
|
|
departmentTeamName: "",
|
2025-08-30 17:32:28 +08:00
|
|
|
|
departmentTeamId: "",
|
2025-06-13 18:06:27 +08:00
|
|
|
|
pageNo: 1,
|
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
|
total: 0,
|
|
|
|
|
|
},
|
|
|
|
|
|
dealTitle: "人员选择器",
|
|
|
|
|
|
tableData: [],
|
|
|
|
|
|
treeListDetail: {},
|
|
|
|
|
|
selectedList: [],
|
|
|
|
|
|
selectedListValue: [],
|
|
|
|
|
|
propUserType: {
|
|
|
|
|
|
id: "userId",
|
|
|
|
|
|
},
|
|
|
|
|
|
selectedInfo: {},
|
2025-08-30 17:32:28 +08:00
|
|
|
|
teamInfoList: [],
|
|
|
|
|
|
roleList: [],
|
2025-06-13 18:06:27 +08:00
|
|
|
|
};
|
|
|
|
|
|
},
|
|
|
|
|
|
watch: {
|
|
|
|
|
|
"$props.value": {
|
|
|
|
|
|
handler(val) {
|
|
|
|
|
|
console.log(112233, val);
|
|
|
|
|
|
this.childValue = val;
|
|
|
|
|
|
this.selectedListValue = [];
|
|
|
|
|
|
this.getProjectChilderSystemUserList();
|
|
|
|
|
|
},
|
|
|
|
|
|
immediate: true,
|
|
|
|
|
|
deep: true,
|
|
|
|
|
|
},
|
|
|
|
|
|
},
|
|
|
|
|
|
computed: {
|
|
|
|
|
|
childValueUp() {
|
2025-08-21 09:19:57 +08:00
|
|
|
|
return this.selectedListValue instanceof Array &&
|
|
|
|
|
|
this.selectedListValue.length > 0
|
2025-06-13 18:06:27 +08:00
|
|
|
|
? this.selectedListValue
|
|
|
|
|
|
.map((item) => (item.realName ? item.realName : item.account))
|
|
|
|
|
|
.join(",")
|
|
|
|
|
|
: this.selectedListValue;
|
|
|
|
|
|
},
|
|
|
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
|
|
|
handleNodeClick(data) {
|
|
|
|
|
|
console.log(data);
|
|
|
|
|
|
this.selectedInfo = {};
|
|
|
|
|
|
this.treeListDetail = data;
|
2025-08-30 17:32:28 +08:00
|
|
|
|
this.getTeamInfoList();
|
2025-06-13 18:06:27 +08:00
|
|
|
|
this.handleQuery();
|
|
|
|
|
|
},
|
|
|
|
|
|
initDealForm() {
|
|
|
|
|
|
this.dealForm = {
|
|
|
|
|
|
realName: "",
|
|
|
|
|
|
roleName: "",
|
2025-08-30 17:32:28 +08:00
|
|
|
|
roleId: "",
|
|
|
|
|
|
departmentTeamId: "",
|
2025-06-13 18:06:27 +08:00
|
|
|
|
departmentTeamName: "",
|
|
|
|
|
|
pageNo: 1,
|
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
|
total: 0,
|
|
|
|
|
|
};
|
|
|
|
|
|
},
|
|
|
|
|
|
submitDealForm() {
|
|
|
|
|
|
this.selectedListValue = [...this.selectedList];
|
2025-08-21 09:19:57 +08:00
|
|
|
|
this.childValue = this.selectedListValue.map(
|
|
|
|
|
|
(item) => item[this.propUserType.id]
|
|
|
|
|
|
);
|
2025-06-13 18:06:27 +08:00
|
|
|
|
console.log(1122334455, this.childValue);
|
|
|
|
|
|
this.$emit("input", this.childValue);
|
|
|
|
|
|
this.dealShow = false;
|
|
|
|
|
|
},
|
|
|
|
|
|
onClear() {
|
|
|
|
|
|
this.selectedListValue = [];
|
2025-08-21 09:19:57 +08:00
|
|
|
|
this.childValue = this.selectedListValue.map(
|
|
|
|
|
|
(item) => item[this.propUserType.id]
|
|
|
|
|
|
);
|
2025-06-13 18:06:27 +08:00
|
|
|
|
this.$emit("input", this.childValue);
|
|
|
|
|
|
},
|
|
|
|
|
|
dealFormCancel() {
|
|
|
|
|
|
this.initDealForm();
|
|
|
|
|
|
this.dealShow = false;
|
|
|
|
|
|
},
|
|
|
|
|
|
// 单选表单选择框
|
|
|
|
|
|
handleSelectChange(selection, row) {
|
|
|
|
|
|
console.log(selection, row);
|
|
|
|
|
|
const findIndex = this.selectedList.findIndex(
|
|
|
|
|
|
(item) => item[this.propUserType.id] === row[this.propUserType.id]
|
|
|
|
|
|
);
|
|
|
|
|
|
if (findIndex !== -1) {
|
|
|
|
|
|
this.selectedList.splice(findIndex, 1);
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.selectedList.push(row);
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
// 全选表单选择框
|
|
|
|
|
|
handleSelectChangeAll(selection) {
|
|
|
|
|
|
console.log(selection);
|
|
|
|
|
|
this.tableData.forEach((ele) => {
|
|
|
|
|
|
const findIndex = this.selectedList.findIndex(
|
|
|
|
|
|
(item) => item[this.propUserType.id] === ele[this.propUserType.id]
|
|
|
|
|
|
);
|
|
|
|
|
|
if (selection.length > 0) {
|
|
|
|
|
|
if (findIndex == -1) {
|
|
|
|
|
|
this.selectedList.push(ele);
|
|
|
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
|
|
|
if (findIndex !== -1) {
|
|
|
|
|
|
this.selectedList.splice(findIndex, 1);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
},
|
|
|
|
|
|
onClick() {
|
|
|
|
|
|
console.log("点击了");
|
|
|
|
|
|
if (!this.enterpriseFlag && this.enterpriseIds.length == 0)
|
|
|
|
|
|
return this.$message.warning("请选择企业后再进行操作!");
|
|
|
|
|
|
this.getTreeList();
|
|
|
|
|
|
this.initDealForm();
|
|
|
|
|
|
this.dealTitle = "人员选择器";
|
|
|
|
|
|
this.dealShow = true;
|
|
|
|
|
|
},
|
|
|
|
|
|
toggleSelection(flag) {
|
|
|
|
|
|
if (flag) {
|
|
|
|
|
|
// this.$refs.selectedPersonnelAccountTable.toggleAllSelection(true)
|
|
|
|
|
|
this.toggleSelectionAll(this.tableData);
|
|
|
|
|
|
// 全选
|
|
|
|
|
|
this.handleSelectChangeAll(this.tableData);
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.$refs.selectedPersonnelAccountTable.clearSelection();
|
|
|
|
|
|
// 取消全选
|
|
|
|
|
|
this.handleSelectChangeAll([]);
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
// 全选和取消全选
|
|
|
|
|
|
toggleSelectionAll(dataList, isExpandAll = null) {
|
|
|
|
|
|
console.log(112233, dataList, isExpandAll);
|
|
|
|
|
|
dataList.forEach((item) => {
|
|
|
|
|
|
if (isExpandAll == null) {
|
2025-08-21 09:19:57 +08:00
|
|
|
|
this.$refs.selectedPersonnelAccountTable.toggleRowSelection(
|
|
|
|
|
|
item,
|
|
|
|
|
|
true
|
|
|
|
|
|
);
|
2025-06-13 18:06:27 +08:00
|
|
|
|
} else {
|
2025-08-21 09:19:57 +08:00
|
|
|
|
this.$refs.selectedPersonnelAccountTable.toggleRowExpansion(
|
|
|
|
|
|
item,
|
|
|
|
|
|
isExpandAll
|
|
|
|
|
|
);
|
2025-06-13 18:06:27 +08:00
|
|
|
|
}
|
|
|
|
|
|
if (item.children instanceof Array && item.children.length > 0) {
|
|
|
|
|
|
this.toggleSelectionAll(item.children, isExpandAll);
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
},
|
|
|
|
|
|
onRiskClick(row) {
|
2025-08-21 09:19:57 +08:00
|
|
|
|
if (row.userId == this.selectedInfo.userId) {
|
2025-06-13 18:06:27 +08:00
|
|
|
|
this.selectedInfo = {};
|
|
|
|
|
|
this.$refs.tree.setCurrentKey(this.treeList[0].id); // 默认选中节点第一个
|
|
|
|
|
|
this.treeListDetail = this.treeList[0];
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.selectedInfo = row;
|
|
|
|
|
|
const find = this.treeList.find((item) => item.id === row.enterpriseId);
|
2025-08-21 09:19:57 +08:00
|
|
|
|
if (find) {
|
2025-06-13 18:06:27 +08:00
|
|
|
|
this.$refs.tree.setCurrentKey(find.id); // 默认选中节点第一个
|
|
|
|
|
|
this.treeListDetail = find;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
this.getUpdatePersonListFn();
|
|
|
|
|
|
},
|
|
|
|
|
|
onRiskDelete(row) {
|
|
|
|
|
|
const findIndex = this.selectedList.findIndex(
|
|
|
|
|
|
(item) => item[this.propUserType.id] === row[this.propUserType.id]
|
|
|
|
|
|
);
|
|
|
|
|
|
if (findIndex !== -1) {
|
|
|
|
|
|
this.selectedList.splice(findIndex, 1);
|
|
|
|
|
|
}
|
|
|
|
|
|
const find = this.tableData.find(
|
|
|
|
|
|
(item) => item[this.propUserType.id] === row[this.propUserType.id]
|
|
|
|
|
|
);
|
|
|
|
|
|
if (find) {
|
2025-08-21 09:19:57 +08:00
|
|
|
|
this.$refs.selectedPersonnelAccountTable.toggleRowSelection(
|
|
|
|
|
|
find,
|
|
|
|
|
|
false
|
|
|
|
|
|
);
|
2025-06-13 18:06:27 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
onRiskEmpty() {
|
|
|
|
|
|
this.selectedList = [];
|
|
|
|
|
|
this.$refs.selectedPersonnelAccountTable.clearSelection();
|
|
|
|
|
|
},
|
|
|
|
|
|
// 默认选中已选风险点 表格回显
|
|
|
|
|
|
defaultToggleSelection() {
|
|
|
|
|
|
this.tableData.forEach((ele) => {
|
|
|
|
|
|
const findIndex = this.selectedList.findIndex(
|
|
|
|
|
|
(item) => item[this.propUserType.id] === ele[this.propUserType.id]
|
|
|
|
|
|
);
|
|
|
|
|
|
if (findIndex !== -1) {
|
2025-08-21 09:19:57 +08:00
|
|
|
|
this.$refs.selectedPersonnelAccountTable.toggleRowSelection(
|
|
|
|
|
|
ele,
|
|
|
|
|
|
true
|
|
|
|
|
|
);
|
2025-06-13 18:06:27 +08:00
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
},
|
2025-08-30 17:32:28 +08:00
|
|
|
|
//获取所有角色
|
|
|
|
|
|
getRoleList() {
|
|
|
|
|
|
getBaseRoleListApi({
|
|
|
|
|
|
projectSn: this.$store.state.projectSn,
|
|
|
|
|
|
}).then((res) => {
|
|
|
|
|
|
if (res.code == 200) {
|
|
|
|
|
|
this.roleList = res.result;
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
},
|
|
|
|
|
|
getTeamInfoList() {
|
|
|
|
|
|
let data = {
|
|
|
|
|
|
projectSn: this.$store.state.projectSn,
|
|
|
|
|
|
enterpriseIds: this.selectedInfo.enterpriseId
|
|
|
|
|
|
? this.selectedInfo.enterpriseId
|
|
|
|
|
|
: this.treeListDetail.id,
|
|
|
|
|
|
};
|
|
|
|
|
|
// getTeamInfoListApi(data).then((res)=>{
|
|
|
|
|
|
getDepartmentAndTeamListApi(data).then((res) => {
|
|
|
|
|
|
if (res.code == 200) {
|
|
|
|
|
|
this.teamInfoList = res.result;
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
},
|
2025-06-13 18:06:27 +08:00
|
|
|
|
// 分页获取人员列表信息
|
|
|
|
|
|
getUpdatePersonListFn() {
|
2025-08-30 17:32:28 +08:00
|
|
|
|
const departmentTeamId = this.dealForm.departmentTeamId ? [this.dealForm.departmentTeamId] : "";
|
2025-06-13 18:06:27 +08:00
|
|
|
|
let data = {
|
|
|
|
|
|
projectSn: this.$store.state.projectSn,
|
|
|
|
|
|
// enterpriseId: this.treeListDetail.id,
|
|
|
|
|
|
userId: this.selectedInfo.userId,
|
2025-08-21 09:19:57 +08:00
|
|
|
|
enterpriseIds: this.selectedInfo.enterpriseId
|
|
|
|
|
|
? this.selectedInfo.enterpriseId
|
|
|
|
|
|
: this.treeListDetail.id,
|
2025-06-13 18:06:27 +08:00
|
|
|
|
pageNo: this.dealForm.pageNo,
|
|
|
|
|
|
pageSize: this.dealForm.pageSize,
|
|
|
|
|
|
realName: this.dealForm.realName,
|
|
|
|
|
|
roleName: this.dealForm.roleName,
|
|
|
|
|
|
departmentTeamName: this.dealForm.departmentTeamName,
|
2025-08-30 17:32:28 +08:00
|
|
|
|
roleId: this.dealForm.roleId,
|
|
|
|
|
|
teamIdList: departmentTeamId,
|
|
|
|
|
|
departmentIdList: departmentTeamId,
|
2025-06-13 18:06:27 +08:00
|
|
|
|
};
|
|
|
|
|
|
getProjectChilderSystemUserPageListApi(data).then((res) => {
|
2025-08-21 17:57:40 +08:00
|
|
|
|
console.log(res, this.childValue);
|
2025-06-13 18:06:27 +08:00
|
|
|
|
if (res.code == 200) {
|
|
|
|
|
|
this.tableData = res.result.records;
|
|
|
|
|
|
this.dealForm.total = res.result.total;
|
|
|
|
|
|
this.$nextTick(() => {
|
2025-08-21 09:19:57 +08:00
|
|
|
|
if (this.childValue.length > 0) {
|
|
|
|
|
|
// 默认选中已选风险点
|
|
|
|
|
|
this.defaultToggleSelection();
|
|
|
|
|
|
console.log(this.selectedList);
|
|
|
|
|
|
}
|
2025-06-13 18:06:27 +08:00
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
},
|
|
|
|
|
|
// 查询
|
|
|
|
|
|
handleQuery() {
|
|
|
|
|
|
this.dealForm.pageNo = 1;
|
|
|
|
|
|
this.getUpdatePersonListFn();
|
|
|
|
|
|
},
|
|
|
|
|
|
// 刷新
|
|
|
|
|
|
handleRefresh() {
|
|
|
|
|
|
this.dealForm.pageNo = 1;
|
|
|
|
|
|
this.dealForm.realName = "";
|
|
|
|
|
|
this.dealForm.roleName = "";
|
|
|
|
|
|
this.dealForm.departmentTeamName = "";
|
2025-08-30 17:32:28 +08:00
|
|
|
|
this.dealForm.roleId = "";
|
|
|
|
|
|
this.dealForm.departmentTeamId = "";
|
2025-06-13 18:06:27 +08:00
|
|
|
|
this.getUpdatePersonListFn();
|
|
|
|
|
|
},
|
|
|
|
|
|
// 获取树状企业
|
|
|
|
|
|
getTreeList() {
|
2025-08-26 09:11:25 +08:00
|
|
|
|
this.treeList = [];
|
2025-06-13 18:06:27 +08:00
|
|
|
|
selectHierarchyEnterpriseListApi({
|
|
|
|
|
|
projectSn: this.$store.state.projectSn,
|
2025-08-21 09:19:57 +08:00
|
|
|
|
enterpriseIds:
|
|
|
|
|
|
this.enterpriseIds.length > 0 ? this.enterpriseIds.join(",") : "",
|
2025-06-13 18:06:27 +08:00
|
|
|
|
}).then((result) => {
|
|
|
|
|
|
if (result.success) {
|
|
|
|
|
|
this.treeList = [
|
|
|
|
|
|
{
|
2025-08-30 17:32:28 +08:00
|
|
|
|
id:
|
|
|
|
|
|
this.enterpriseIds.length > 0
|
|
|
|
|
|
? this.enterpriseIds.join(",")
|
|
|
|
|
|
: "",
|
2025-06-13 18:06:27 +08:00
|
|
|
|
enterpriseName: "全部",
|
|
|
|
|
|
regionCode: "",
|
|
|
|
|
|
regionName: "",
|
|
|
|
|
|
},
|
|
|
|
|
|
...result.result,
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
|
this.$refs.tree.setCurrentKey(this.treeList[0].id); // 默认选中节点第一个
|
|
|
|
|
|
this.treeListDetail = this.treeList[0];
|
2025-08-30 17:32:28 +08:00
|
|
|
|
this.getTeamInfoList();
|
|
|
|
|
|
this.getRoleList();
|
2025-06-13 18:06:27 +08:00
|
|
|
|
this.getUpdatePersonListFn();
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
},
|
|
|
|
|
|
// 获取已选人员列表
|
|
|
|
|
|
getProjectChilderSystemUserList() {
|
|
|
|
|
|
const userIds =
|
2025-08-21 09:19:57 +08:00
|
|
|
|
this.childValue instanceof Array
|
|
|
|
|
|
? this.childValue.join(",")
|
|
|
|
|
|
: this.childValue;
|
2025-08-30 17:32:28 +08:00
|
|
|
|
if (!userIds) return (this.selectedList = []);
|
2025-06-13 18:06:27 +08:00
|
|
|
|
let data = {
|
|
|
|
|
|
projectSn: this.$store.state.projectSn,
|
|
|
|
|
|
userIds: userIds,
|
|
|
|
|
|
};
|
|
|
|
|
|
getProjectChilderSystemUserListApi(data).then((res) => {
|
|
|
|
|
|
if (res.code == 200) {
|
|
|
|
|
|
this.selectedList = res.result;
|
|
|
|
|
|
this.selectedListValue = res.result;
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
},
|
|
|
|
|
|
},
|
|
|
|
|
|
};
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style lang="less" scoped>
|
|
|
|
|
|
.el-icon-circle-close {
|
|
|
|
|
|
display: none;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.myInput:hover {
|
|
|
|
|
|
.el-icon-circle-close {
|
|
|
|
|
|
display: inline-block;
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
.el-form-item {
|
|
|
|
|
|
margin-bottom: 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
.dialog_main {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
height: 540px;
|
|
|
|
|
|
.treeBox {
|
|
|
|
|
|
width: 220px;
|
|
|
|
|
|
height: calc(100%);
|
|
|
|
|
|
background-color: rgba(216, 216, 216, 0.2);
|
|
|
|
|
|
padding-top: 10px;
|
|
|
|
|
|
position: relative;
|
|
|
|
|
|
.treeStyle();
|
|
|
|
|
|
}
|
|
|
|
|
|
.table_main {
|
|
|
|
|
|
padding: 0 16px;
|
|
|
|
|
|
flex: 1;
|
2025-08-30 17:32:28 +08:00
|
|
|
|
.el-input,
|
|
|
|
|
|
.el-select {
|
|
|
|
|
|
// width: 180px;
|
|
|
|
|
|
width: 162px;
|
2025-06-13 18:06:27 +08:00
|
|
|
|
}
|
|
|
|
|
|
.tables {
|
|
|
|
|
|
min-height: initial;
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
// margin-top: 20px;
|
|
|
|
|
|
}
|
|
|
|
|
|
.check_box {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
|
> .el-button {
|
|
|
|
|
|
padding: 0;
|
|
|
|
|
|
margin-left: 10px;
|
|
|
|
|
|
}
|
|
|
|
|
|
> .el-button:first-child {
|
|
|
|
|
|
color: #eb4047;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
/deep/ .pagination-container {
|
|
|
|
|
|
padding: 20px 16px;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
.selected_point {
|
|
|
|
|
|
width: 268px;
|
2025-08-21 09:19:57 +08:00
|
|
|
|
> div:first-child {
|
2025-06-13 18:06:27 +08:00
|
|
|
|
display: flex;
|
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
> div:last-child {
|
2025-08-21 09:19:57 +08:00
|
|
|
|
color: #2f6bef;
|
2025-06-13 18:06:27 +08:00
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
.selected_point_scroll {
|
|
|
|
|
|
height: calc(100% - 20px - 10px);
|
|
|
|
|
|
border-radius: 0px 0px 0px 0px;
|
|
|
|
|
|
margin-top: 10px;
|
2025-08-21 09:19:57 +08:00
|
|
|
|
border: 2px solid #f3f5fc;
|
2025-06-13 18:06:27 +08:00
|
|
|
|
padding: 6px 10px 10px 10px;
|
2025-08-30 17:32:28 +08:00
|
|
|
|
overflow: auto;
|
2025-06-13 18:06:27 +08:00
|
|
|
|
.el-tag {
|
|
|
|
|
|
margin-left: 4px;
|
|
|
|
|
|
margin-top: 4px;
|
|
|
|
|
|
background-color: transparent;
|
|
|
|
|
|
}
|
|
|
|
|
|
.risk_point {
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
margin-top: 6px;
|
|
|
|
|
|
> div {
|
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
.treeStyle() {
|
|
|
|
|
|
/deep/.el-tree {
|
|
|
|
|
|
font-size: 15px;
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
background-color: transparent;
|
|
|
|
|
|
.el-tree-node {
|
|
|
|
|
|
white-space: normal;
|
|
|
|
|
|
&:focus > .el-tree-node__content {
|
|
|
|
|
|
background-color: transparent;
|
|
|
|
|
|
}
|
|
|
|
|
|
&.is-current > .el-tree-node__content {
|
|
|
|
|
|
background-color: rgba(81, 129, 246, 0.14);
|
|
|
|
|
|
color: #5181f6;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
.el-tree-node__content {
|
|
|
|
|
|
// height: 32px;
|
|
|
|
|
|
padding: 7px 0;
|
|
|
|
|
|
height: auto;
|
|
|
|
|
|
line-height: 16px;
|
|
|
|
|
|
position: relative;
|
|
|
|
|
|
// margin-bottom: 7px;
|
|
|
|
|
|
&:hover {
|
|
|
|
|
|
background-color: rgba(81, 129, 246, 0.14);
|
|
|
|
|
|
color: #5181f6;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.videoName {
|
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
|
}
|
|
|
|
|
|
.projectName {
|
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
|
width: calc(100% - 55px);
|
|
|
|
|
|
display: inline-block;
|
|
|
|
|
|
}
|
|
|
|
|
|
.companyName2 {
|
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
|
display: inline-block;
|
|
|
|
|
|
width: 192px;
|
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
.el-tree-node__expand-icon {
|
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
|
padding: 0 6px;
|
|
|
|
|
|
&.is-leaf {
|
|
|
|
|
|
color: transparent !important;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
.treeTitle {
|
|
|
|
|
|
background-color: #f7f7f7;
|
|
|
|
|
|
margin-bottom: 10px;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
</style>
|