|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <div class="h-full flex flex-col teamstyle">
|
|
|
+ <div class="h-full flex flex-col teamstyle overflow-hidden">
|
|
|
<!-- 头部 -->
|
|
|
<div class="bg-white flex justify-between team-header">
|
|
|
<div class="flex items-center">
|
|
@@ -10,7 +10,8 @@
|
|
|
<span class="textSpan">共 0 人</span>
|
|
|
</div>
|
|
|
<div class="teamForm flex items-center">
|
|
|
- <el-input v-model="teamForm.keyword" style="max-width: 650px" size="default" placeholder="请输入姓名搜索" class="mr-6">
|
|
|
+ <el-input v-model="teamForm.keyword" style="max-width: 650px" size="default" placeholder="请输入姓名搜索" class="mr-6"
|
|
|
+ clearable @clear="getTableData()" @keyup.enter.native="getTableData()">
|
|
|
<template #prepend>
|
|
|
<el-select v-model="teamForm.matchingType" style="width: 80px">
|
|
|
<el-option label="姓名" :value="0" />
|
|
@@ -19,19 +20,21 @@
|
|
|
</el-select>
|
|
|
</template>
|
|
|
<template #append>
|
|
|
- <el-button :icon="Search" />
|
|
|
+ <el-button :icon="Search" @click="getTableData()" />
|
|
|
</template>
|
|
|
</el-input>
|
|
|
|
|
|
<div class="formItem mr-6 flex items-center">
|
|
|
<div class="text-nowrap">状态:</div>
|
|
|
- <el-select v-model="teamForm.status" placeholder="请选择" size="default" style="width: 100px">
|
|
|
+ <el-select v-model="teamForm.status" placeholder="请选择" size="default" style="width: 100px"
|
|
|
+ @change="getTableData()">
|
|
|
<el-option v-for="item in stateOptions" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
</el-select>
|
|
|
</div>
|
|
|
<div class="formItem mr-6 flex items-center">
|
|
|
<div class="text-nowrap">角色:</div>
|
|
|
- <el-select v-model="teamForm.roleId" placeholder="请选择" size="default" style="width: 150px">
|
|
|
+ <el-select v-model="teamForm.roleId" placeholder="请选择" size="default" style="width: 150px" clearable
|
|
|
+ @change="getTableData()">
|
|
|
<el-option v-for="item in roleList" :key="item.id" :label="item.rolename" :value="item.id" />
|
|
|
</el-select>
|
|
|
</div>
|
|
@@ -42,11 +45,9 @@
|
|
|
</el-button>
|
|
|
<template #dropdown>
|
|
|
<el-dropdown-menu>
|
|
|
- <el-dropdown-item @click="addPersone(false)">添加人员</el-dropdown-item>
|
|
|
- <el-dropdown-item>导出人员</el-dropdown-item>
|
|
|
- <el-dropdown-item>批量导入</el-dropdown-item>
|
|
|
- <el-dropdown-item>导入薪资</el-dropdown-item>
|
|
|
- <el-dropdown-item>自定义配置</el-dropdown-item>
|
|
|
+ <el-dropdown-item @click="addPersone(false)" v-permission="['teamAdd']">添加人员</el-dropdown-item>
|
|
|
+ <el-dropdown-item @click="transitionOperation('exportUser', '')" v-permission="['teamExport']">导出人员</el-dropdown-item>
|
|
|
+ <el-dropdown-item @click="transitionOperation('importUser', '')" v-permission="['teamImport']">批量导入</el-dropdown-item>
|
|
|
</el-dropdown-menu>
|
|
|
</template>
|
|
|
</el-dropdown>
|
|
@@ -54,7 +55,7 @@
|
|
|
</div>
|
|
|
<!-- 内容 -->
|
|
|
<div class="flex-1 flex">
|
|
|
- <div class="p-5 w-80 pr-0">
|
|
|
+ <div class="p-4 w-80 pr-0">
|
|
|
<div class="bg-white w-full h-full shadow-md rounded-md flex flex-col">
|
|
|
<div class="flex-1 overflow-y-auto const-left">
|
|
|
<el-tree style="max-width: 600px" :data="deptList" :props="treeProps" @node-click="treeNode">
|
|
@@ -75,45 +76,53 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="flex-1 p-5 overflow-auto">
|
|
|
- <div class="bg-white w-full h-full shadow-md rounded-md flex flex-col">
|
|
|
- <div class="flex-1 p-3">
|
|
|
+ <div class="flex-1 p-4 overflow-auto">
|
|
|
+ <div class="bg-white w-full h-full shadow-md rounded-md flex flex-col overflow-hidden pt-2 pl-2 pr-2">
|
|
|
+ <div class="flex-1">
|
|
|
<el-table ref="multipleTableRef" :data="tableData" v-loading="loadingFrom.tableLoading"
|
|
|
- style="width: 100%;height: 100%;">
|
|
|
+ @selection-change="changeBatch" style="width: 100%;height: 100%;">
|
|
|
<el-table-column type="selection" width="55" />
|
|
|
<el-table-column label="姓名" property="name" width="150"></el-table-column>
|
|
|
- <el-table-column label="手机" property="phone" ></el-table-column>
|
|
|
+ <el-table-column label="手机" property="phone"></el-table-column>
|
|
|
<el-table-column label="工号" property="jobNumber"></el-table-column>
|
|
|
<el-table-column label="部门" property="departmentName"></el-table-column>
|
|
|
<el-table-column label="角色" property="roleName"></el-table-column>
|
|
|
<el-table-column label="创建时间" property="createTime"></el-table-column>
|
|
|
- <el-table-column label="操作" width="150" fixed="right">
|
|
|
+ <el-table-column label="操作" width="200" fixed="right">
|
|
|
<template #default="scope">
|
|
|
- <el-button :size="'small'">重置</el-button>
|
|
|
+ <el-button :size="'small'" @click="resetPwd(scope.row)">重置</el-button>
|
|
|
<el-button type="primary" :size="'small'" @click="addPersone(scope.row)">编辑</el-button>
|
|
|
+ <el-button :size="'small'" @click="transitionOperation('disable', scope.row)"
|
|
|
+ v-if="scope.row.isActive == 1">停用</el-button>
|
|
|
+ <el-button type="success" :size="'small'" @click="enableUser(scope.row)"
|
|
|
+ v-if="scope.row.isActive == 0">启用</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
</div>
|
|
|
- <div class="flex items-center justify-between p-3 bg-slate-100">
|
|
|
+ <div class="flex justify-between pb-2 pt-2 pl-3 pr-3">
|
|
|
<div class="flex">
|
|
|
- <el-button size="default">取消</el-button>
|
|
|
+ <el-button size="default" @click="changeBatch(false)"
|
|
|
+ :disabled="batchTableData.length == 0">取消</el-button>
|
|
|
<el-dropdown class="ml-3">
|
|
|
<el-button type="primary">
|
|
|
更多操作<el-icon class="el-icon--right"><arrow-down /></el-icon>
|
|
|
</el-button>
|
|
|
<template #dropdown>
|
|
|
<el-dropdown-menu>
|
|
|
- <el-dropdown-item>批量修改部门</el-dropdown-item>
|
|
|
- <el-dropdown-item>批量修改角色</el-dropdown-item>
|
|
|
- <el-dropdown-item>修正工时所属部门</el-dropdown-item>
|
|
|
- <el-dropdown-item>批量启用员工</el-dropdown-item>
|
|
|
+ <el-dropdown-item @click="batchItem('批量修改部门', 'dept', deptList)"
|
|
|
+ :disabled="batchTableData.length == 0">批量修改部门</el-dropdown-item>
|
|
|
+ <el-dropdown-item @click="batchItem('批量修改角色', 'role', roleList)"
|
|
|
+ :disabled="batchTableData.length == 0">批量修改角色</el-dropdown-item>
|
|
|
+ <el-dropdown-item @click="batchEnableItem"
|
|
|
+ :disabled="batchTableData.length == 0">批量启用员工</el-dropdown-item>
|
|
|
</el-dropdown-menu>
|
|
|
</template>
|
|
|
</el-dropdown>
|
|
|
</div>
|
|
|
<div class="pr-4">
|
|
|
- <el-pagination layout="total, prev, pager, next, sizes" :total="totalTable" :hide-on-single-page="true" />
|
|
|
+ <el-pagination layout="total, prev, pager, next, sizes" :total="totalTable" :page-size="teamForm.pageSize"
|
|
|
+ @size-change="handleSizeChange" @current-change="handleCurrentChange" />
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -121,10 +130,21 @@
|
|
|
</div>
|
|
|
|
|
|
<!-- 新增部门 -->
|
|
|
- <el-dialog v-model="dialogFrom.addDeptDialogVisible" :title="deptListItem.label || '创建部门'" width="500"
|
|
|
- :before-close="handleClose">
|
|
|
- <div>
|
|
|
- <el-form ref="deptRuleFormRef" style="max-width: 500px" :model="deptForm" :rules="deptRules" label-width="auto"
|
|
|
+ <el-dialog v-model="dialogFrom.addDeptDialogVisible" width="600" :show-close="false" :before-close="handleClose">
|
|
|
+ <template #header="{ close, titleId, titleClass }">
|
|
|
+ <div class="flex justify-between items-center border-b pb-3 dialog-header">
|
|
|
+ <h4 :id="titleId">{{ deptListItem.label || '创建部门' }}</h4>
|
|
|
+ <div class="flex">
|
|
|
+ <el-button @click="dialogFrom.addDeptDialogVisible = false">取消</el-button>
|
|
|
+ <el-button type="primary" @click="createDepartment(deptRuleFormRef)"
|
|
|
+ v-bind:loading="loadingFrom.deptDialogVisibleLoading">
|
|
|
+ 确定
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <div class="pt-5">
|
|
|
+ <el-form ref="deptRuleFormRef" style="max-width: 500px" :model="deptForm" :rules="deptRules" label-width="140px"
|
|
|
size="large" status-icon>
|
|
|
<el-form-item label="部门名称" prop="name">
|
|
|
<el-input v-model="deptForm.name" placeholder="请输入部门名称" clearable />
|
|
@@ -141,15 +161,75 @@
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</div>
|
|
|
- <template #footer>
|
|
|
- <div class="dialog-footer">
|
|
|
- <el-button @click="dialogFrom.addDeptDialogVisible = false">取消</el-button>
|
|
|
- <el-button type="primary" @click="createDepartment(deptRuleFormRef)"
|
|
|
- v-bind:loading="loadingFrom.deptDialogVisibleLoading">
|
|
|
- 确定
|
|
|
- </el-button>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <!-- 停用 -->
|
|
|
+ <el-dialog v-model="dialogFrom.resignationVisible" width="600" :show-close="false" :before-close="handleClose">
|
|
|
+ <template #header="{ close, titleId, titleClass }">
|
|
|
+ <div class="flex justify-between items-center border-b pb-3 dialog-header">
|
|
|
+ <h4 :id="titleId">离职停用员工</h4>
|
|
|
+ <div class="flex">
|
|
|
+ <el-button @click="dialogFrom.resignationVisible = false">取消</el-button>
|
|
|
+ <el-button type="primary" @click="resignation" v-bind:loading="loadingFrom.resignationLoading">
|
|
|
+ 确定
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</template>
|
|
|
+ <div class="pt-4 pb-2">
|
|
|
+ <div class="flex items-center justify-center">
|
|
|
+ <div class="pr-2">员工离职日期:</div>
|
|
|
+ <el-date-picker v-model="resignationDate" type="date" placeholder="请选择日期" value-format="YYYY-MM-DD"
|
|
|
+ :clearable="false" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <!-- 导出人员列表 -->
|
|
|
+ <el-dialog v-model="dialogFrom.exportUserVisible" width="600" :show-close="false" :before-close="handleClose">
|
|
|
+ <template #header="{ close, titleId, titleClass }">
|
|
|
+ <div class="flex justify-between items-center border-b pb-3 dialog-header">
|
|
|
+ <h4 :id="titleId">导出人员列表</h4>
|
|
|
+ <div class="flex">
|
|
|
+ <el-button @click="dialogFrom.exportUserVisible = false">取消</el-button>
|
|
|
+ <el-button type="primary" @click="exportUser" v-bind:loading="loadingFrom.exportUserLoading">
|
|
|
+ 导出
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <div class="pt-4 pb-2">
|
|
|
+ <div class="flex items-center justify-center">
|
|
|
+ <div class="pr-2">导出:</div>
|
|
|
+ <el-radio-group v-model="exportRadio" class="ml-4">
|
|
|
+ <el-radio value="1" size="large">全部人员</el-radio>
|
|
|
+ <el-radio value="0" size="large">仅在职人员</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <!-- 人员导入 -->
|
|
|
+ <el-dialog v-model="dialogFrom.importVisible" width="680" :show-close="false" top="10vh">
|
|
|
+ <template #header="{ close, titleId, titleClass }">
|
|
|
+ <div class="flex justify-between items-center border-b pb-3 dialog-header">
|
|
|
+ <h4 :id="titleId">人员批量导入</h4>
|
|
|
+ <div class="flex">
|
|
|
+ <el-button class="mr-3" @click="dialogFrom.importVisible = false">取消</el-button>
|
|
|
+ <el-upload ref="importUserRef" class="upload-demo" :limit="1" :show-file-list="false" accept=".xlsx"
|
|
|
+ :http-request="importUser">
|
|
|
+ <el-button type="primary" :loading="loadingFrom.importLoading">导入</el-button>
|
|
|
+ </el-upload>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <div class="p-8">
|
|
|
+ <div class="ml-4 mr-4">
|
|
|
+ <div class="flex items-center">1、点击下载 <el-link type="primary"
|
|
|
+ @click="downloadFile('/upload/人员导入模板.xlsx', '人员导入模板.xlsx')">人员导入模板.xlsx</el-link></div>
|
|
|
+ <div class="mt-4">2、填写excel模板,并上传</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</el-dialog>
|
|
|
|
|
|
<!-- 新增人员 -->
|
|
@@ -159,21 +239,28 @@
|
|
|
roleList: roleList,
|
|
|
personnelFromData: personnelFromData
|
|
|
}" @closeModal="closeModal" @personnelModalConfirm="personnelModalConfirm" />
|
|
|
+
|
|
|
+ <!-- 批量操作 -->
|
|
|
+ <BatchOperation :batchData="visibleData" :batchNode="batchTableData" :visibleText="allText.batchText"
|
|
|
+ :popup="visibleType" :batchOperationVisible="dialogFrom.batchOperationVisible" @close="closeModal" />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
import { ref, reactive, onMounted, onBeforeMount, inject } from 'vue';
|
|
|
-import { dayjs } from 'element-plus'
|
|
|
+import { UploadRequestOptions, dayjs } from 'element-plus'
|
|
|
import { Search, CirclePlusFilled, Edit, CirclePlus, Delete } from '@element-plus/icons-vue'
|
|
|
import { FormInstance, FormRules, ElMessageBox } from 'element-plus'
|
|
|
import { useStore } from '@/store/index'
|
|
|
-import { GET_DATA_LIST, DETELE_DEPT, MOD, GET_USERINFO, GET_ROUTELIST, GET_DEPTLIST, GET_USERLIST, GET_ADDDEPT, ADD_USER } from './api'
|
|
|
-import { post } from "@/utils/request";
|
|
|
-import { getFromValue, updateDepTreeData, resetFromValue } from '@/utils/tools'
|
|
|
+import { GET_DATA_LIST, DETELE_DEPT, MOD, GET_USERINFO, GET_ROUTELIST, DEACTIVEUSER, SETACTIVE, GET_DEPTLIST, BACTHSERROLE, GET_USERLIST, GET_ADDDEPT, ADD_USER, SETRESETPWD, EXPOERTUSER } from './api'
|
|
|
+import { post, uploadFile } from "@/utils/request";
|
|
|
+import { getFromValue, updateDepTreeData, resetFromValue, confirmAction, downloadFile } from '@/utils/tools'
|
|
|
|
|
|
// 导入页面
|
|
|
import AddPersonnelModal from './module/AddPersonnelModal.vue'
|
|
|
+import BatchOperation from './module/BatchOperation.vue'
|
|
|
+import { formatDate } from '@/utils/times';
|
|
|
+import { URL_IMPORTTHREAD } from '../thread/constant';
|
|
|
|
|
|
const { getFunctionList, getUserInfoVal } = useStore()
|
|
|
const globalPopup = inject<GlobalPopup>('globalPopup')
|
|
@@ -190,24 +277,44 @@ interface deptRuleForm { // 部门表单类型
|
|
|
// 固定数据
|
|
|
const stateOptions = [{ value: '3', label: '全部' }, { value: '1', label: '在职' }, { value: '0', label: '停用' }]
|
|
|
|
|
|
+// ref
|
|
|
+const importUserRef = ref<any>()
|
|
|
+
|
|
|
// 定义变量
|
|
|
+const transitiondata = ref<any>() // 过度数据(针对二次弹窗)
|
|
|
const pagePermission: any = ref([]) // 功能权限
|
|
|
const loadingFrom = reactive({ // 所有加载状态
|
|
|
tableLoading: false,
|
|
|
- deptDialogVisibleLoading: false
|
|
|
+ deptDialogVisibleLoading: false,
|
|
|
+ resignationLoading: false,
|
|
|
+ exportUserLoading: false,
|
|
|
+ importLoading: false
|
|
|
})
|
|
|
const dialogFrom: any = reactive({ // 所有弹窗状态
|
|
|
addDeptDialogVisible: false,
|
|
|
- addPersonnelDialogVisible: false
|
|
|
+ addPersonnelDialogVisible: false,
|
|
|
+ batchOperationVisible: false,
|
|
|
+ resignationVisible: false,
|
|
|
+ exportUserVisible: false,
|
|
|
+ importVisible: false,
|
|
|
});
|
|
|
+const allText = reactive({
|
|
|
+ batchText: '批量操作'
|
|
|
+})
|
|
|
+const visibleType = ref<batchOperationType>('dept') // 弹窗类型
|
|
|
+const visibleData = ref<any>([]) // 批量弹窗数据源
|
|
|
const totalTable = ref(0) // 表格总数
|
|
|
const tableData: any = ref([]) // 表格数据
|
|
|
const roleList: any = ref([]) // 角色列表
|
|
|
const userList: any = ref([]) // 用户列表
|
|
|
const deptList: any = ref([]) // 部门数据
|
|
|
+const batchTableData: any = ref([]) // 批量数据
|
|
|
+const multipleTableRef: any = ref()
|
|
|
const deptListUntreated: any = ref([]) // 部门数据(未处理)
|
|
|
const deptListItem: any = ref({}) // 选中的部门数据
|
|
|
const personnelFromData = ref({}) // 人员表单数据
|
|
|
+const resignationDate = ref(formatDate(new Date())) // 员工离职日期
|
|
|
+const exportRadio = ref('1') // 导出人员列表
|
|
|
const teamForm = reactive({ // 筛选条件表单
|
|
|
matchingType: 0,
|
|
|
keyword: '',
|
|
@@ -237,17 +344,99 @@ const deptRules = reactive<FormRules<typeof deptForm>>({ // 部门表单校验
|
|
|
})
|
|
|
|
|
|
// 定义方法
|
|
|
+async function importUser(param: UploadRequestOptions) {
|
|
|
+ loadingFrom.importLoading = true
|
|
|
+ const formData = new FormData();
|
|
|
+ formData.append('file', param.file)
|
|
|
+ const res = await uploadFile(URL_IMPORTTHREAD, formData).finally(() => {
|
|
|
+ importUserRef.value.clearFiles()
|
|
|
+ loadingFrom.importLoading = false
|
|
|
+ })
|
|
|
+ loadingFrom.importLoading = false
|
|
|
+ if (res.code == 'ok') {
|
|
|
+ globalPopup?.showSuccess('导入成功' || '')
|
|
|
+ closeModal('importVisible')
|
|
|
+ getTableData()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ globalPopup?.showError(res.msg || '')
|
|
|
+}
|
|
|
+
|
|
|
+function exportUser() {
|
|
|
+ loadingFrom.exportUserLoading = true
|
|
|
+ post(EXPOERTUSER, { containInvalid: exportRadio.value }).then((res) => {
|
|
|
+ downloadFile(`${res.data}`, '人员列表.xlsx')
|
|
|
+ globalPopup?.showSuccess('导出成功')
|
|
|
+ closeModal('exportUserVisible')
|
|
|
+ }).finally(() => {
|
|
|
+ loadingFrom.exportUserLoading = false
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+function enableUser(row: any) {
|
|
|
+ const id = row.id
|
|
|
+ post(SETACTIVE, { id, isActive: 1 }).then(() => {
|
|
|
+ globalPopup?.showSuccess('启用成功')
|
|
|
+ getTableData()
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+function resignation() {
|
|
|
+ const id = transitiondata.value.id || ''
|
|
|
+ loadingFrom.resignationLoading = true
|
|
|
+ post(DEACTIVEUSER, { id, inactiveDate: resignationDate.value }).then(() => {
|
|
|
+ globalPopup?.showSuccess('停用成功')
|
|
|
+ getTableData()
|
|
|
+ closeModal('resignationVisible')
|
|
|
+ }).finally(() => {
|
|
|
+ loadingFrom.resignationLoading = false
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+function resetPwd(row: any) {
|
|
|
+ const userId = row.id
|
|
|
+ confirmAction(`确定要为${row.name}重置密码吗?`, '重置密码').then(() => {
|
|
|
+ post(SETRESETPWD, { userId }).then(() => {
|
|
|
+ globalPopup?.showSuccess('密码已重置为000000,请通知员工及时修改')
|
|
|
+ }).catch((err) => {
|
|
|
+ globalPopup?.showError(err.msg)
|
|
|
+ })
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+function batchEnableItem() {
|
|
|
+ const userIds = batchTableData.value.map((item: any) => item.id)
|
|
|
+ post(BACTHSERROLE, { ids: JSON.stringify(userIds), isActive: 1 }).then(() => {
|
|
|
+ globalPopup?.showSuccess('操作成功')
|
|
|
+ changeBatch(false)
|
|
|
+ getTableData()
|
|
|
+ }).catch((err) => {
|
|
|
+ globalPopup?.showError(err.msg)
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+function changeBatch(flag: boolean = true) {
|
|
|
+ if (flag) {
|
|
|
+ batchTableData.value = multipleTableRef.value && multipleTableRef.value.getSelectionRows()
|
|
|
+ } else {
|
|
|
+ batchTableData.value = []
|
|
|
+ multipleTableRef.value && multipleTableRef.value.clearSelection()
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
function addPersone(item: any) {
|
|
|
console.log(item)
|
|
|
- if(!item) {
|
|
|
+ if (!item) {
|
|
|
+ personnelFromData.value = {}
|
|
|
dialogFrom.addPersonnelDialogVisible = true
|
|
|
return
|
|
|
- }
|
|
|
+ }
|
|
|
post(GET_USERINFO, { userId: item.id }).then(res => {
|
|
|
const { id, name, phone, jobNumber, roleId, departmentCascade, inductionDate } = res.data
|
|
|
- let newData = { id, name, phone, jobNumber, roleId, departmentId:
|
|
|
- departmentCascade && departmentCascade.split(',').map(Number).reverse(),
|
|
|
- inductionDate
|
|
|
+ let newData = {
|
|
|
+ id, name, phone, jobNumber, roleId, departmentId:
|
|
|
+ departmentCascade && departmentCascade.split(',').map(Number).reverse(),
|
|
|
+ inductionDate
|
|
|
}
|
|
|
personnelFromData.value = newData
|
|
|
dialogFrom.addPersonnelDialogVisible = true
|
|
@@ -382,17 +571,54 @@ function dialogFromCli(type: string, data: any = {}, flag: boolean = false) {
|
|
|
dialogFrom[type] = true
|
|
|
}
|
|
|
|
|
|
+function handleSizeChange(val: number) {
|
|
|
+ teamForm.pageIndex = 1
|
|
|
+ teamForm.pageSize = val
|
|
|
+ getTableData()
|
|
|
+}
|
|
|
+
|
|
|
+function handleCurrentChange(val: number) {
|
|
|
+ teamForm.pageIndex = val
|
|
|
+ getTableData()
|
|
|
+}
|
|
|
+
|
|
|
function resetDialog() {
|
|
|
let newDeptForm = resetFromValue(deptForm)
|
|
|
Object.assign(deptForm, newDeptForm)
|
|
|
}
|
|
|
|
|
|
+function batchItem(text: string, type: batchOperationType, data: any) {
|
|
|
+ allText.batchText = text,
|
|
|
+ visibleType.value = type
|
|
|
+ visibleData.value = data
|
|
|
+ dialogFrom.batchOperationVisible = true
|
|
|
+}
|
|
|
+
|
|
|
function handleClose(done: any) {
|
|
|
done()
|
|
|
}
|
|
|
|
|
|
-function closeModal(modelType: string) {
|
|
|
+function transitionOperation(type: string, data: any) {
|
|
|
+ if (type == 'disable') { // 停用
|
|
|
+ resignationDate.value = formatDate(new Date())
|
|
|
+ console.log(resignationDate.value, '<==== 离职')
|
|
|
+ dialogFrom.resignationVisible = true
|
|
|
+ } else if (type == 'exportUser') { // 导出
|
|
|
+ exportRadio.value = '1'
|
|
|
+ dialogFrom.exportUserVisible = true
|
|
|
+ } else if (type == 'importUser') { // 导入
|
|
|
+ dialogFrom.importVisible = true
|
|
|
+ }
|
|
|
+
|
|
|
+ transitiondata.value = data
|
|
|
+}
|
|
|
+
|
|
|
+function closeModal(modelType: string, flag: boolean = false) {
|
|
|
dialogFrom[modelType] = false
|
|
|
+ if (flag) {
|
|
|
+ changeBatch(false)
|
|
|
+ getTableData()
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
onBeforeMount(() => {
|
|
@@ -411,6 +637,7 @@ onMounted(() => {
|
|
|
.teamstyle {
|
|
|
.team-header {
|
|
|
padding: 0.75rem 1.25rem;
|
|
|
+ box-sizing: border-box
|
|
|
}
|
|
|
|
|
|
.textFont {
|
|
@@ -449,6 +676,7 @@ onMounted(() => {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
.operation {
|
|
|
cursor: pointer;
|
|
|
}
|