gaoshp
2024-05-09 79383f55b0ae100df4abdec46be73ca3a1bfe5a3
src/views/master/person/main/personPerson.vue
@@ -1,9 +1,9 @@
<!--
 * @Author: lzhe lzhe@example.com
 * @Date: 2024-03-26 10:28:33
 * @LastEditors: lzhe lzhe@example.com
 * @LastEditTime: 2024-04-10 15:37:41
 * @FilePath: /smart-web/src/views/master/person/main/index.vue
 * @LastEditors: Sneed
 * @LastEditTime: 2024-05-09 21:01:06
 * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/master/person/main/personPerson.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
@@ -18,9 +18,11 @@
         </div>
         <div class="person-tree">
            <!-- 部门 -->
            <el-tree style="max-width: 600px" :data="titleList" :expand-on-click-node="false" default-expand-all :props="{label: 'name', children: 'children'}" class="treeActive" @node-click="titleListNode" />
            <el-tree style="max-width: 600px" :data="titleList" :expand-on-click-node="false" default-expand-all
               :props="{ label: 'name', children: 'children' }" class="treeActive" @node-click="titleListNode" />
            <!-- 岗位 -->
            <div v-for="(item,index) in titleList" :data-id="item.id" v-if="!leftActive" :class="{treeActive: item.active}" @click="selectbtn(index)">{{item.postName}}</div>
            <div v-for="(item, index) in titleList" :data-id="item.id" v-if="!leftActive"
               :class="{ treeActive: item.active }" @click="selectbtn(index)">{{ item.postName }}</div>
         </div>
      </div>
      <div class="person-person-right">
@@ -28,7 +30,8 @@
            <div class="right-title"><span v-if="leftActive">部门:千文科技</span></div>
            <div>
               <el-select v-model="searchData.status" placeholder="状态" class="searchStatus">
                  <el-option v-for="item in statusList" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey" size="small"/>
                  <el-option v-for="item in statusList" :key="item.dictKey" :label="item.dictValue"
                     :value="item.dictKey" size="small" />
               </el-select>
               <el-input v-model="searchData.keywords" style="width: 200px" size="small" placeholder="请输入关键字进行过滤">
                  <template #append>
@@ -47,7 +50,8 @@
            <el-button type="danger" plain @click="delPerson">删除</el-button>
         </div>
         <div class="right-table">
            <el-table ref="multipleTableRef" :data="tableData" border style="width: 100%" class="multipleTableRef" @selection-change="handleSelectionChange">
            <el-table ref="multipleTableRef" :data="tableData" border style="width: 100%" class="multipleTableRef"
               @selection-change="handleSelectionChange">
               <el-table-column type="selection" width="55" />
               <el-table-column prop="name" label="姓名" width="150"></el-table-column>
               <el-table-column prop="jobNumber" label="工号" width="150"></el-table-column>
@@ -79,37 +83,38 @@
               </el-table-column>
               <el-table-column fixed="right" label="操作" width="140">
                  <template #default="scope">
                     <el-button type="text" size="small" @click="table_edit(scope.row, scope.$index)">编辑</el-button>
                     <el-button text type="primary" size="small" @click="table_del(scope.row, scope.$index)">删除</el-button>
                     <el-button type="text" size="small"
                        @click="table_edit(scope.row, scope.$index)">编辑</el-button>
                     <el-button text type="primary" size="small"
                        @click="table_del(scope.row, scope.$index)">删除</el-button>
                  </template>
               </el-table-column>
            </el-table>
            <el-pagination
               @size-change="handleSizeChange"
               @current-change="handleCurrentChange"
               :current-page="currentPage4"
               :page-sizes="[15, 50, 100]"
               :page-size="15"
               layout="total, sizes, prev, pager, next, jumper"
               :total="total">
            <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
               :current-page="currentPage4" :page-sizes="[15, 50, 100]" :page-size="15"
               layout="total, sizes, prev, pager, next, jumper" :total="total">
            </el-pagination>
         </div>
      </div>
   </div>
   <el-dialog title="部门调整" v-model="departmentVisible" :width="400" destroy-on-close>
      <el-form :model="departmentFrom" :rules="departmentVisibleRules" :disabled="mode=='show'" ref="dialogForm" label-width="80px" label-position="center">
      <el-form :model="departmentFrom" :rules="departmentVisibleRules" :disabled="mode == 'show'" ref="dialogForm"
         label-width="80px" label-position="center">
         <el-row>
            <el-col :span="24">
               <el-form-item label="部门" prop="parentId">
                  <el-tree-select @change= "parentIdChange" v-model="departmentFrom.parentId" clearable placeholder="部门" default-expand-all check-on-click-nod :data="titleList" check-strictly :props="{ label: 'name' }" node-key="id" ref="parentTree" />
                  <el-tree-select @change="parentIdChange" v-model="departmentFrom.parentId" clearable
                     placeholder="部门" default-expand-all check-on-click-nod :data="titleList" check-strictly
                     :props="{ label: 'name' }" node-key="id" ref="parentTree" />
               </el-form-item>
            </el-col>
         </el-row>
      </el-form>
      <template #footer>
         <el-button @click="departmentVisible=false" >取 消</el-button>
         <el-button v-if="mode!='show'" type="primary" :loading="isSaveing" @click="departmentSubmit()">保 存</el-button>
         <el-button v-if="mode != 'show'" type="primary" :loading="isSaveing" @click="departmentSubmit()">保
            存</el-button>
      </template>
   </el-dialog>
   <!-- 删除 -->
@@ -126,7 +131,8 @@
      </template>
   </el-dialog>
   
   <save-dialog v-if="dialog.save" ref="saveDialog" @success="personHandleSuccess" @closed="dialog.save=false"></save-dialog>
   <save-dialog v-if="dialog.save" ref="saveDialog" @success="personHandleSuccess"
      @closed="dialog.save = false"></save-dialog>
</template>
<script>
   import importTable from '@/layout/components/importTable.vue'
@@ -381,6 +387,7 @@
      box-shadow: 0 2px 4px 0 rgba(0,0,0,.12), 0 0 6px 0 rgba(0,0,0,.04);
      display: flex;
   }
   .person-person-left {
      background-color: #fff;
      width: 300px;
@@ -390,6 +397,7 @@
      border-radius: 4px;
      padding: 8px;
   }
   .person-person-right {
      background-color: #fff;
      flex: 1;
@@ -400,11 +408,13 @@
      padding-top: 8px;
      padding-bottom: 8px;
   }
   .person-left-title {
      text-align: center;
      vertical-align: middle;
      padding-left: 8px;
   }
   .person-left-title div {
      display: inline-block;
      width: 55px;
@@ -413,33 +423,40 @@
      border: 1px solid #dcdfe6;
      cursor: pointer;
   }
   .person-left-title div:nth-child(1) {
      border-top-left-radius: 4px;
      border-bottom-left-radius: 4px;
      border-right: 0px;
   }
   .person-left-title div:nth-child(2) {
      border-top-right-radius: 4px;
      border-bottom-right-radius: 4px;
      border-left: 0px;
   }
   .person-left-active {
      background-color: #3b8e8e;
      color: #fff;
   }
   .person-left-search {
      padding-top: 8px;
      padding-bottom: 8px;
   }
   .person-tree {
      font-size: 14px;
      font-weight: 400;
   }
   .person-tree div {
      margin-bottom: 8px;
      padding: 4px 18px;
      cursor: pointer;
   }
   .right-top {
      display: flex;
      justify-content: space-between;
@@ -448,6 +465,7 @@
      padding-left: 8px;
      padding-right: 8px;
   }
   .right-title {
      font-size: 18px;
      font-weight: bold;
@@ -455,27 +473,33 @@
      margin-bottom: 8px;
      height: 37px;
   }
   .searchStatus {
      margin-right: 6px;
      width: 200px;
   }
   .right-bottom {
      padding-left: 8px;
      padding-right: 8px;
      margin-bottom: 8px;
   }
   .right-table {
      padding-left: 8px;
      padding-right: 8px;
      margin-bottom: 8px;
      
   }
   .multipleTableRef {
      margin-bottom: 8px;
   }
   .footerDiv {
      text-align: center;
   }
   .delBtn {
       color: #fff;
       width: 112px;
@@ -488,14 +512,17 @@
       line-height: 32px;
       cursor: pointer;
   }
   .delBtn:nth-child(1) {
      margin-right:4px;
   }
   .delBtn:hover {
      background-color: #f34d5b;
       border-color: #f34d5b;
       color: #fff;
   }
   .delIcon {
      color: #fff;
       background: red;
@@ -508,6 +535,7 @@
       line-height: 20px;
       margin-right: 6px;
   }
   .exportBtn {
      margin-left:8px;
      margin-right:8px;