From 76302992e7bcb60682ee6d3ae9de6619b477b968 Mon Sep 17 00:00:00 2001
From: liding <756868258@qq.com>
Date: 星期二, 09 六月 2026 10:26:48 +0800
Subject: [PATCH] feat:联系人管理,基本信息修改
---
src/views/CNAS/personnel/personnelInfo/index.vue | 286 --------------------------------------------------------
1 files changed, 3 insertions(+), 283 deletions(-)
diff --git a/src/views/CNAS/personnel/personnelInfo/index.vue b/src/views/CNAS/personnel/personnelInfo/index.vue
index 5793240..b2c039c 100644
--- a/src/views/CNAS/personnel/personnelInfo/index.vue
+++ b/src/views/CNAS/personnel/personnelInfo/index.vue
@@ -1,326 +1,46 @@
<template>
<div class="main">
- <div class="main_left">
- <el-row>
- <el-col :span="20">
- <el-input
- v-model="search"
- class="div_left_input"
- clearable
- placeholder="杈撳叆鍏抽敭瀛楄繘琛屾悳绱�"
- size="small"
- suffix-icon="el-icon-search"
- @blur="searchFilter"
- @clear="searchFilter"
- @keyup.enter.native="searchFilter"
- ></el-input>
- </el-col>
- <el-col :span="4" style="text-align: center;line-height: 30px; margin-top: 14px">
- <el-button circle icon="el-icon-plus" size="mini" type="primary" @click="handleAdd"></el-button>
- </el-col>
- </el-row>
- <el-tree
- ref="tree"
- :data="list"
- :default-expanded-keys="[22]"
- :expand-on-click-node="false"
- :filter-node-method="filterNode"
- :props="{ children: 'children', label: 'name' }"
- highlight-current
- node-key="id"
- style="height:calc(100% - 70px);overflow-y: scroll;scrollbar-width: none;"
- @node-click="handleNodeClick"
- @node-expand="nodeOpen"
- @node-collapse="nodeClose"
- >
- <div slot-scope="{ node, data }" class="custom-tree-node">
- <el-row style="width: 100%;">
- <el-col :span="22" style="text-align: left;">
- <span><i
- :class="`node_i ${data.children != undefined&&data.children.length>0 ? 'el-icon-folder-opened' : 'el-icon-tickets'}`"></i>
- {{ data.name }}</span>
- </el-col>
- <el-col v-if="node.level>1 && data.id !== null" :span="2" style="text-align: right;">
- <el-button size="mini" type="text" @click.stop="remove(node, data)">
- <i class="el-icon-delete"></i>
- </el-button>
- </el-col>
- </el-row>
- </div>
- </el-tree>
- </div>
- <div class="main_right">
+ <div class="main_right" style="width: 100%;">
<el-tabs v-model="activeName" :lazy="true" type="border-card">
<el-tab-pane label="鍩烘湰淇℃伅" name="鍩烘湰淇℃伅">
- <PersonnelList v-if="activeName === '鍩烘湰淇℃伅' && isShowAll" ref="personnelList" :currentCompaniesList="currentCompaniesList"
- :departId="departId" @refreshTree="refreshTree"
- @updatePerson="updatePerson"></PersonnelList>
- <personnelInformation v-if="activeName === '鍩烘湰淇℃伅' && !isShowAll" :clickNodeVal="clickNodeVal"></personnelInformation>
+ <PersonnelList v-if="activeName === '鍩烘湰淇℃伅'" ref="personnelList"></PersonnelList>
</el-tab-pane>
-<!-- <el-tab-pane label="鍩硅璁″垝" name="鍩硅璁″垝">-->
-<!-- <PersonnelTraining v-if="activeName === '鍩硅璁″垝'" ref="personnelTraining"-->
-<!-- :departId="departId" :isDepartment="isDepartment"></PersonnelTraining>-->
-<!-- </el-tab-pane>-->
-<!-- <el-tab-pane label="宀椾綅鑱岃矗" name="宀椾綅鑱岃矗">-->
-<!-- <job-responsibilities v-if="activeName === '宀椾綅鑱岃矗'" ref="jobResponsibilities"-->
-<!-- :departId="departId"-->
-<!-- :isDepartment="isDepartment"></job-responsibilities>-->
-<!-- </el-tab-pane>-->
-<!-- <el-tab-pane label="濂栨儵璁板綍" name="濂栨儵璁板綍">-->
-<!-- <rewardPunishmentRecord v-if="activeName === '濂栨儵璁板綍'"-->
-<!-- :departId="departId" :isDepartment="isDepartment"></rewardPunishmentRecord>-->
-<!-- </el-tab-pane>-->
-<!-- <el-tab-pane label="鍩硅璁板綍" name="鍩硅璁板綍">-->
-<!-- <training-record v-if="activeName === '鍩硅璁板綍'" ref="trainingRecord"-->
-<!-- :departId="departId"-->
-<!-- :isDepartment="isDepartment"></training-record>-->
-<!-- </el-tab-pane>-->
-<!-- <el-tab-pane label="浠昏亴鎺堟潈璁板綍" name="浠昏亴鎺堟潈璁板綍">-->
-<!-- <Mandate v-if="activeName === '浠昏亴鎺堟潈璁板綍'" ref="manDateRef" :departId="departId" :isDepartment="isDepartment"></Mandate>-->
-<!-- </el-tab-pane>-->
-<!-- <el-tab-pane label="浜哄憳鑳藉姏" name="浜哄憳鑳藉姏">-->
-<!-- <personnel-capacity v-if="activeName === '浜哄憳鑳藉姏'" ref="personnelCapacity"-->
-<!-- :departId="departId"-->
-<!-- :isDepartment="isDepartment"></personnel-capacity>-->
-<!-- </el-tab-pane>-->
-<!-- <el-tab-pane label="娌熼�氳褰�" name="娌熼�氳褰�">-->
-<!-- <Communicate v-if="activeName === '娌熼�氳褰�'" ref="communicateRef" :departId="departId" :isDepartment="isDepartment"></Communicate>-->
-<!-- </el-tab-pane>-->
</el-tabs>
</div>
- <el-dialog :visible.sync="addDia" title="鏋舵瀯鏂板" width="400px">
- <div class="body">
- <el-row style="line-height: 50px;">
- <el-col :span="6" style="text-align: right;">
- <span class="required-span">* </span>鏋舵瀯鍚嶇О锛�
- </el-col>
- <el-col :offset="1" :span="16">
- <el-input v-model="addOb.name" clearable placeholder="璇疯緭鍏ユ灦鏋勫悕绉�" size="small" @keyup.enter.native="addStandardTree"></el-input>
- </el-col>
- </el-row>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="addDia = false">鍙� 娑�</el-button>
- <el-button type="primary" @click="addStandardTree">纭� 瀹�</el-button>
- </span>
- </el-dialog>
</div>
</template>
<script>
import PersonnelList from './tabs/personnel-list.vue'
-import personnelInformation from './tabs/personnel-information.vue'
-import PersonnelTraining from './tabs/personnelTraining';
-import JobResponsibilities from './tabs/job-responsibilities.vue';
-import rewardPunishmentRecord from "./tabs/reward-punishment-record.vue";
-import TrainingRecord from './tabs/training-record.vue';
-import Mandate from './tabs/mandate.vue';
-import PersonnelCapacity from './tabs/personnel-capacity.vue';
-import Communicate from './tabs/communicate.vue'
-import {addDepartmentLims, delDepartmentLims, selectCNSAPersonTree} from "@/api/cnas/personal/personalList";
export default {
name: 'PersonnelInfo',
components: {
- PersonnelList, personnelInformation, PersonnelTraining, JobResponsibilities, rewardPunishmentRecord, TrainingRecord, Mandate, PersonnelCapacity, Communicate
+ PersonnelList,
},
data() {
return {
- isShowAll: true, // 鏄惁灞曠ず鏍囩鏍�
activeName: '鍩烘湰淇℃伅',
- departId: 1,
- list: [],
- addDia: false,
- addOb: {
- name: '',
- fatherId: ''
- },
- search: '',
- clickNodeVal: {},
- addUserForm: {
- name: ''
- },
- currentCompaniesList: [],
- entity: {
- name: '',
- departLimsId: '',
- orderBy: {
- field: 'id',
- order: 'asc'
- }
- },
- overallRecord: '浜哄憳鍒楄〃',
- isDepartment: false,
};
},
mounted() {
this.activeName = this.$route.query.activeName || '鍩烘湰淇℃伅'
- this.geList();
},
- methods: {
- remove(node, data) {
- this.$confirm("鏄惁鍒犻櫎璇ュ眰绾�", "鎻愮ず", {
- type: "error"
- }).then(() => {
- delDepartmentLims({
- id: data.id
- }).then(res => {
- this.$message.success('宸插垹闄�')
- this.geList();
- })
- }).catch(e => {})
- },
- addStandardTree() {
- if (this.addOb.name == null || this.addOb.factory == '') {
- this.$message.error('鏋勬灦鍚嶇О鏄繀濉」')
- return
- }
- addDepartmentLims(this.addOb).then(res => {
- this.$message.success('娣诲姞鎴愬姛')
- this.addDia = false
- this.geList();
- this.addOb.name = ''
- this.addOb.fatherId = ''
- })
- },
- handleAdd() {
- if (this.addOb.fatherId) {
- this.addDia = true;
- } else {
- this.$message.error('璇烽�夋嫨涓�涓灦鏋勫眰绾�')
- }
- },
- // 浜哄憳鍒楄〃缂栬緫
- updatePerson(row) {
- const node = this.findNodeById(this.list, row.name);
- if (node) {
- this.handleNodeClick(node);
- } else {
- this.$message.warning('鏈壘鍒拌浜哄憳');
- }
- },
- // 鏂板缓浜哄憳鍚庡埛鏂版爲
- refreshTree () {
- this.geList()
- },
- findNodeById(treeData, name) {
- for (let i = 0; i < treeData.length; i++) {
- if (treeData[i].name === name) {
- return treeData[i]; // 鎵惧埌鑺傜偣锛岃繑鍥炶鑺傜偣
- }
- if (treeData[i].children && treeData[i].children.length > 0) {
- const foundNode = this.findNodeById(treeData[i].children, name);
- if (foundNode) {
- return foundNode; // 鍦ㄥ瓙鑺傜偣涓壘鍒帮紝杩斿洖璇ヨ妭鐐�
- }
- }
- }
- return null; // 娌℃湁鎵惧埌鑺傜偣锛岃繑鍥瀗ull
- },
- searchFilter() {
- this.$refs.tree.filter(this.search);
- },
- // 鑾峰彇鏍�
- geList() {
- selectCNSAPersonTree().then(res => {
- this.list = res.data;
- if(this.list.length > 0) {
- this.isDepartment = true;
- }
- });
- },
- filterNode(value, data) {
- if (!value) return true;
- return data.name.indexOf(value) !== -1;
- },
- nodeClose(data, node, el) {
- $($(el.$el).find('.node_i')[0]).attr('class', 'node_i el-icon-folder');
- },
- nodeOpen(data, node, el) {
- $($(el.$el).find('.node_i')[0]).attr('class', 'node_i el-icon-folder-opened');
- },
- handleNodeClick(val, node, el) {
- //鏍戠殑鍊�
- this.clickNodeVal = val;
- // 瀛樺偍鐖剁骇鑺傜偣绾ф暟
- if (node) {
- this.getNodeParent(node);
- this.clickNodeVal.level = node.level;
- this.clickNodeVal.parent = node.parent.data;
- }
- this.entity.departLimsId = val.id;
- this.addOb.fatherId = val.id;
- // 鏄惁鏄剧ず璁惧璇︽儏
- this.isShowAll = val.id !== null;
- if (val.id) { // 濡傛灉鏄疄楠屽
- this.departId = val.id;
- this.isDepartment = true;
- }
- if (val.userId) { // 鏄汉鍛�
- this.departId = val.userId;
- this.isDepartment = false
- }
- },
- getNodeParent(val) {
- if (val.parent != null) {
- this.currentCompaniesList[val.level - 1] = val.data.id;
- this.selectTree += ' - ' + val.label;
- this.getNodeParent(val.parent);
- }
- }
- }
};
</script>
<style scoped>
-.node_i {
- color: orange;
- font-size: 18px;
-}
-.custom-tree-node {
- width: 80%;
- line-height: 32px;
-}
-.custom-tree-node .el-icon-delete {
- color: #3A7BFA;
- opacity: 0;
- font-size: 15px;
-}
-
-.custom-tree-node:hover .el-icon-delete {
- opacity: 1;
-}
-
.main {
- display: flex;
padding: 15px 0;
}
-
-.main_left {
- background: #ffffff;
- text-align: center;
- height: calc(100vh - 8em);
- width: 270px;
- border-radius: 15px;
-}
-
.main_right {
- width: calc(100% - 288px);
border-radius: 15px;
}
-
-.div_left_input {
- margin: 15px 0;
- width: 90%;
-}
-
>>> .el-tabs--border-card > .el-tabs__header .el-tabs__item {
border: 0 none;
}
-
>>> .el-tabs--border-card > .el-tabs__header .el-tabs__item.is-active {
color: black;
}
-
>>> .el-tabs--border-card > .el-tabs__header {
border-bottom: none;
}
--
Gitblit v1.9.3