This commit is contained in:
zmj 2024-05-23 13:57:27 +08:00
parent 7cbfbd79ba
commit 29b8b1bef7
10 changed files with 921 additions and 173 deletions

View File

@ -0,0 +1,32 @@
import request from "@/utils/request";
// 人事调动部门记录表列表
export function apiOaDepartmentChangeLists(params: any) {
return request.get({ url: "/works.rlzy.oa_department_change/lists", params });
}
// 添加人事调动部门记录表
export function apiOaDepartmentChangeAdd(params: any) {
return request.post({ url: "/works.rlzy.oa_department_change/add", params });
}
// 编辑人事调动部门记录表
export function apiOaDepartmentChangeEdit(params: any) {
return request.post({ url: "/works.rlzy.oa_department_change/edit", params });
}
// 删除人事调动部门记录表
export function apiOaDepartmentChangeDelete(params: any) {
return request.post({
url: "/works.rlzy.oa_department_change/delete",
params,
});
}
// 人事调动部门记录表详情
export function apiOaDepartmentChangeDetail(params: any) {
return request.get({
url: "/works.rlzy.oa_department_change/detail",
params,
});
}

View File

@ -0,0 +1,26 @@
import request from "@/utils/request";
// 人事离职记录表列表
export function apiOaPersonalQuitLists(params: any) {
return request.get({ url: "/works.rlzy.oa_personal_quit/lists", params });
}
// 添加人事离职记录表
export function apiOaPersonalQuitAdd(params: any) {
return request.post({ url: "/works.rlzy.oa_personal_quit/add", params });
}
// 编辑人事离职记录表
export function apiOaPersonalQuitEdit(params: any) {
return request.post({ url: "/works.rlzy.oa_personal_quit/edit", params });
}
// 删除人事离职记录表
export function apiOaPersonalQuitDelete(params: any) {
return request.post({ url: "/works.rlzy.oa_personal_quit/delete", params });
}
// 人事离职记录表详情
export function apiOaPersonalQuitDetail(params: any) {
return request.get({ url: "/works.rlzy.oa_personal_quit/detail", params });
}

View File

@ -563,6 +563,10 @@ const submituser = (e: any) => {
formData[value] = e.id
showDialog.value = false
}
defineExpose({
open,
setFormData,

View File

@ -1,123 +1,116 @@
<template>
<div>
<el-card class="!border-none mb-4" shadow="never">
<el-form class="mb-[-16px]" :model="queryParams" inline>
<el-form-item label="车辆名称" prop="title">
<el-input class="w-[280px]" v-model="queryParams.title" clearable placeholder="请输入车辆名称" />
</el-form-item>
<el-form-item label="车辆号码" prop="name">
<el-input class="w-[280px]" v-model="queryParams.name" clearable placeholder="请输入车辆号码" />
</el-form-item>
<el-form-item label="状态" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable class="!flex-1">
<el-option label="禁用" :value="0" />
<el-option label="启用" :value="1" />
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="resetPage">查询</el-button>
<el-button @click="resetParams">重置</el-button>
</el-form-item>
</el-form>
</el-card>
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
<el-button v-perms="['works.xzgl.oa_car_cate/add']" type="primary" @click="handleAdd">
<template #icon>
<icon name="el-icon-Plus" />
</template>
新增
</el-button>
<el-button v-perms="['works.xzgl.oa_car_cate/delete']" :disabled="!selectData.length"
@click="handleDelete(selectData)">
删除
</el-button>
<div class="mt-4">
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" />
<el-table-column label="车辆名称" prop="title" show-overflow-tooltip />
<el-table-column label="车辆号码" prop="name" show-overflow-tooltip />
<el-table-column label="状态" prop="status_text" show-overflow-tooltip />
<el-table-column label="操作" width="120" fixed="right">
<template #default="{ row }">
<el-button v-perms="['works.xzgl.oa_car_cate/edit']" type="primary" link
@click="handleEdit(row)">
编辑
</el-button>
<el-button v-perms="['works.xzgl.oa_car_cate/delete']" type="danger" link
@click="handleDelete(row.id)">
删除
</el-button>
</template>
</el-table-column>
</el-table>
<el-calendar v-model="now">
<template #dateCell="{ data }">
<div class="content" @click="hdClick(data)">
{{ data.day.split('-').slice(1).join('-') }}
<div class="task-li" v-for="item in formData">
<!-- <el-tooltip effect="dark" :content="item.title" placement="top-start"> -->
<span v-if="item.date.includes(data.day)">
{{ item.title }}
</span>
<!-- </el-tooltip> -->
</div>
</div>
<div class="flex mt-4 justify-end">
<pagination v-model="pager" @change="getLists" />
</div>
</el-card>
<edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" />
</div>
</template>
</el-calendar>
<!-- <el-dialog :visible.sync=" dialogVisible" :title="dialogTitle" width="50%" @close="handleClose">
<el-form :model="form" ref="form" label-width="80px">
<el-form-item label="日期" prop="date">
<el-input v-model="form.date" readonly></el-input>
</el-form-item>
<el-form-item label="内容" prop="content">
<el-input v-model="form.content"></el-input>
</el-form-item>
</el-form>
</el-dialog> -->
</template>
<script lang="ts" setup name="oaCarCateLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiOaCarCateLists, apiOaCarCateDelete } from '@/api/oa_car_cate'
import { timeFormat } from '@/utils/util'
import feedback from '@/utils/feedback'
import EditPopup from './edit.vue'
<script setup>
const now = ref(new Date())
const dialogVisible = ref(true)
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
//
const showEdit = ref(false)
const hdClick = (data) => {
console.log(data)
}
let data = [
{
"id": 13,
"type": "4",
"remind_type": 0,
"backgroundColor": "#CCEBCC",
"borderColor": "#99CC99",
"title": "综合系统售后工单删除失败",
"start": "2024-05-15 09:00:00",
"end": "2024-05-31 12:00:00"
},
{
"id": 14,
"type": "4",
"remind_type": 0,
"backgroundColor": "#CCEBCC",
"borderColor": "#99CC99",
"title": "1212",
"start": "2024-05-25 09:00:00",
"end": "2024-05-28 18:00:00"
}
]
function getDatesBetween(startDate, endDate) {
const dates = [];
let currentDate = new Date(startDate);
while (currentDate <= new Date(endDate)) {
dates.push(new Date(currentDate));
currentDate.setDate(currentDate.getDate() + 1);
}
let list = dates.map(item => {
return item.toISOString().split('T')[0];
})
return list
}
//
const queryParams = reactive({
title: '',
name: '',
status: ''
let formData = data.map(item => {
return {
id: item.id,
title: item.title,
date: getDatesBetween(item.start, item.end),
}
})
//
const selectData = ref<any[]>([])
console.log(formData)
//
const handleSelectionChange = (val: any[]) => {
selectData.value = val.map(({ id }) => id)
}
//
const { dictData } = useDictData('')
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiOaCarCateLists,
params: queryParams
})
//
const handleAdd = async () => {
showEdit.value = true
await nextTick()
editRef.value?.open('add')
}
//
const handleEdit = async (data: any) => {
showEdit.value = true
await nextTick()
editRef.value?.open('edit')
editRef.value?.setFormData(data)
}
//
const handleDelete = async (id: number | any[]) => {
await feedback.confirm('确定要删除?')
await apiOaCarCateDelete({ id })
getLists()
}
getLists()
</script>
<style lang="scss" scoped>
// ::v-deep .el-calendar-day {
// padding: 0
// }
.content {
height: 100%;
overflow: hidden;
overflow-y: auto; //
-ms-overflow-style: none;
scrollbar-width: none;
&::-webkit-scrollbar {
display: none;
}
.task-li {
background-color: #2D8CF0;
color: white;
border-radius: 10px;
margin-bottom: 5px;
box-sizing: border-box;
padding: 0 15px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
</style>

View File

@ -0,0 +1,123 @@
<template>
<div>
<el-card class="!border-none mb-4" shadow="never">
<el-form class="mb-[-16px]" :model="queryParams" inline>
<el-form-item label="车辆名称" prop="title">
<el-input class="w-[280px]" v-model="queryParams.title" clearable placeholder="请输入车辆名称" />
</el-form-item>
<el-form-item label="车辆号码" prop="name">
<el-input class="w-[280px]" v-model="queryParams.name" clearable placeholder="请输入车辆号码" />
</el-form-item>
<el-form-item label="状态" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable class="!flex-1">
<el-option label="禁用" :value="0" />
<el-option label="启用" :value="1" />
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="resetPage">查询</el-button>
<el-button @click="resetParams">重置</el-button>
</el-form-item>
</el-form>
</el-card>
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
<el-button v-perms="['works.xzgl.oa_car_cate/add']" type="primary" @click="handleAdd">
<template #icon>
<icon name="el-icon-Plus" />
</template>
新增
</el-button>
<el-button v-perms="['works.xzgl.oa_car_cate/delete']" :disabled="!selectData.length"
@click="handleDelete(selectData)">
删除
</el-button>
<div class="mt-4">
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" />
<el-table-column label="车辆名称" prop="title" show-overflow-tooltip />
<el-table-column label="车辆号码" prop="name" show-overflow-tooltip />
<el-table-column label="状态" prop="status_text" show-overflow-tooltip />
<el-table-column label="操作" width="120" fixed="right">
<template #default="{ row }">
<el-button v-perms="['works.xzgl.oa_car_cate/edit']" type="primary" link
@click="handleEdit(row)">
编辑
</el-button>
<el-button v-perms="['works.xzgl.oa_car_cate/delete']" type="danger" link
@click="handleDelete(row.id)">
删除
</el-button>
</template>
</el-table-column>
</el-table>
</div>
<div class="flex mt-4 justify-end">
<pagination v-model="pager" @change="getLists" />
</div>
</el-card>
<edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" />
</div>
</template>
<script lang="ts" setup name="oaCarCateLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiOaCarCateLists, apiOaCarCateDelete } from '@/api/oa_car_cate'
import { timeFormat } from '@/utils/util'
import feedback from '@/utils/feedback'
import EditPopup from './edit.vue'
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
//
const showEdit = ref(false)
//
const queryParams = reactive({
title: '',
name: '',
status: ''
})
//
const selectData = ref<any[]>([])
//
const handleSelectionChange = (val: any[]) => {
selectData.value = val.map(({ id }) => id)
}
//
const { dictData } = useDictData('')
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiOaCarCateLists,
params: queryParams
})
//
const handleAdd = async () => {
showEdit.value = true
await nextTick()
editRef.value?.open('add')
}
//
const handleEdit = async (data: any) => {
showEdit.value = true
await nextTick()
editRef.value?.open('edit')
editRef.value?.setFormData(data)
}
//
const handleDelete = async (id: number | any[]) => {
await feedback.confirm('确定要删除?')
await apiOaCarCateDelete({ id })
getLists()
}
getLists()
</script>

View File

@ -1,63 +0,0 @@
<template>
<el-calendar v-model="now">
<template #dateCell="{ data }">
<p class="content" :class="data.isSelected ? 'is-selected' : ''" @click="hdClick(data)">
{{ data.day.split('-').slice(1).join('-') }}
{{ data.isSelected ? '✔️' : '' }}
<!-- <div style="background-color: red;">选中</div>
<div style="background-color: pink;">选中</div>
<div style="background-color: green;">选中</div>
<div style="background-color: blue;">选中</div> -->
</p>
</template>
</el-calendar>
<!-- <el-dialog :visible.sync=" dialogVisible" :title="dialogTitle" width="50%" @close="handleClose">
<el-form :model="form" ref="form" label-width="80px">
<el-form-item label="日期" prop="date">
<el-input v-model="form.date" readonly></el-input>
</el-form-item>
<el-form-item label="内容" prop="content">
<el-input v-model="form.content"></el-input>
</el-form-item>
</el-form>
</el-dialog> -->
</template>
<script setup>
const now = ref(new Date())
const dialogVisible = ref(true)
const formData = reactive({
date: '',
content: ''
})
const hdClick = (data) => {
console.log(data)
// formData.date = data.day
// dialogVisible.value = true
}
</script>
<style lang="scss" scoped>
// ::v-deep .el-calendar-day {
// padding: 0
// }
.content {
height: 100%;
overflow: hidden;
overflow-y: auto; //
-ms-overflow-style: none;
scrollbar-width: none;
&::-webkit-scrollbar {
display: none;
}
}
</style>

View File

@ -0,0 +1,175 @@
<template>
<div class="edit-popup">
<popup ref="popupRef" :title="popupTitle" :async="true" width="550px" @confirm="handleSubmit" @close="handleClose">
<el-form ref="formRef" :model="formData" label-width="90px" :rules="formRules">
<el-form-item label="调动员工" prop="uid_name">
<el-input v-model="formData.uid_name" clearable placeholder="点击选择员工" @click="userclick('uid')" />
</el-form-item>
<el-form-item label="调出部门">
<el-select v-model="formData.from_did" placeholder="系统自动获取" disabled class="flex-1">
<el-option :label="item.name" :value="item.id" v-for="item in deptList">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="调动日期" prop="move_time">
<el-date-picker v-model="formData.move_time" value-format="YYYY-MM-DD" placeholder="选择日期"
class="!flex flex-1"></el-date-picker>
</el-form-item>
<el-form-item label="调入部门" prop="to_did">
<el-select v-model="formData.to_did" placeholder="请选择调入部门" class="flex-1">
<el-option :label="item.name" :value="item.id" v-for="item in deptList">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="状态">
<el-switch v-model="formData.status" :active-value="1" :inactive-value="0" />
</el-form-item>
<el-form-item label="调动描述">
<el-input v-model="formData.remark" type="textarea" clearable placeholder="请输入备注" />
</el-form-item>
</el-form>
<div v-if="showDialog">
<personnelselector ref="personnel" @confirm="submituser" type="1">
</personnelselector>
</div>
</popup>
</div>
</template>
<script lang="ts" setup name="oaDepartmentChangeEdit">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { apiOaDepartmentChangeAdd, apiOaDepartmentChangeEdit, apiOaDepartmentChangeDetail } from '@/api/oa_department_change'
import { timeFormat } from '@/utils/util'
import type { PropType } from 'vue'
defineProps({
dictData: {
type: Object as PropType<Record<string, any[]>>,
default: () => ({})
},
deptList: Array
})
const emit = defineEmits(['success', 'close'])
const formRef = shallowRef<FormInstance>()
const popupRef = shallowRef<InstanceType<typeof Popup>>()
const mode = ref('add')
const showDialog = ref(false)
const personnel = ref(null)
//
const popupTitle = computed(() => {
return mode.value == 'edit' ? '编辑人事调动部门记录表' : '新增人事调动部门记录表'
})
//
const formData = reactive({
id: '',
uid: '',
uid_name: '',
from_did: '',
to_did: '',
remark: '',
// admin_id: '',
status: '',
move_time: '',
})
let value;
const userclick = async (val) => {
showDialog.value = true
value = val
await nextTick()
personnel.value.open()
}
const submituser = (e: any) => {
formData[value + '_name'] = e.name
formData[value] = e.id
// formData.
console.log(e)
showDialog.value = false
}
//
const formRules = reactive<any>({
uid_name: [{
required: true,
message: '请输入用户ID',
trigger: ['blur']
}],
from_did: [{
required: true,
message: '请输入原部门id',
trigger: ['blur']
}],
to_did: [{
required: true,
message: '请输入调到部门id',
trigger: ['blur']
}],
admin_id: [{
required: true,
message: '请输入创建人',
trigger: ['blur']
}],
move_time: [{
required: true,
message: '请输入调动时间',
trigger: ['blur']
}]
})
//
const setFormData = async (data: Record<any, any>) => {
for (const key in formData) {
if (data[key] != null && data[key] != undefined) {
//@ts-ignore
formData[key] = data[key]
}
}
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiOaDepartmentChangeDetail({
id: row.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
await formRef.value?.validate()
const data = { ...formData, }
mode.value == 'edit'
? await apiOaDepartmentChangeEdit(data)
: await apiOaDepartmentChangeAdd(data)
popupRef.value?.close()
emit('success')
}
//
const open = (type = 'add') => {
mode.value = type
popupRef.value?.open()
}
//
const handleClose = () => {
emit('close')
}
defineExpose({
open,
setFormData,
getDetail
})
</script>

View File

@ -0,0 +1,129 @@
<template>
<div>
<el-card class="!border-none mb-4" shadow="never">
<el-form class="mb-[-16px]" :model="queryParams" inline>
<el-form-item label="调动员工" prop="uid">
<el-input class="w-[280px]" v-model="queryParams.uid_name" clearable placeholder="请输入调动员工" />
</el-form-item>
<el-form-item label="调动时间" prop="move_time">
<el-date-picker v-model="queryParams.move_time" value-format="YYYY-MM-DD" placeholder="选择日期"
class="!flex flex-1"></el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="resetPage">查询</el-button>
<el-button @click="resetParams">重置</el-button>
</el-form-item>
</el-form>
</el-card>
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
<el-button v-perms="['works.rlzy.oa_department_change/add']" type="primary" @click="handleAdd">
<template #icon>
<icon name="el-icon-Plus" />
</template>
新增
</el-button>
<el-button v-perms="['works.rlzy.oa_department_change/delete']" :disabled="!selectData.length"
@click="handleDelete(selectData)">
删除
</el-button>
<div class="mt-4">
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" />
<el-table-column label="调动员工" prop="uid_name" show-overflow-tooltip />
<el-table-column label="调出部门" prop="from_did_text" show-overflow-tooltip />
<el-table-column label="调入部门" prop="to_did_text" show-overflow-tooltip />
<el-table-column label="调动时间" prop="move_time" show-overflow-tooltip />
<el-table-column label="状态" prop="status_text" show-overflow-tooltip />
<el-table-column label="操作" width="120" fixed="right">
<template #default="{ row }">
<el-button v-perms="['works.rlzy.oa_department_change/edit']" type="primary" link
@click="handleEdit(row)">
编辑
</el-button>
<el-button v-perms="['works.rlzy.oa_department_change/delete']" type="danger" link
@click="handleDelete(row.id)">
删除
</el-button>
</template>
</el-table-column>
</el-table>
</div>
<div class="flex mt-4 justify-end">
<pagination v-model="pager" @change="getLists" />
</div>
</el-card>
<edit-popup :deptList="deptList" v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists"
@close="showEdit = false" />
</div>
</template>
<script lang="ts" setup name="oaDepartmentChangeLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiOaDepartmentChangeLists, apiOaDepartmentChangeDelete } from '@/api/oa_department_change'
import { deptLists } from "@/api/org/department";
import feedback from '@/utils/feedback'
import EditPopup from './edit.vue'
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
//
const showEdit = ref(false)
//
const queryParams = reactive({
uid: '',
from_did: '',
to_did: '',
status: '',
move_time: ''
})
//
const selectData = ref<any[]>([])
//
const handleSelectionChange = (val: any[]) => {
selectData.value = val.map(({ id }) => id)
}
//
const { dictData } = useDictData('')
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiOaDepartmentChangeLists,
params: queryParams
})
//
const handleAdd = async () => {
showEdit.value = true
await nextTick()
editRef.value?.open('add')
}
//
const handleEdit = async (data: any) => {
showEdit.value = true
await nextTick()
editRef.value?.open('edit')
editRef.value?.setFormData(data)
}
//
const handleDelete = async (id: number | any[]) => {
await feedback.confirm('确定要删除?')
await apiOaDepartmentChangeDelete({ id })
getLists()
}
const deptList = ref([])
const getDeptList = async () => {
const res = await deptLists()
deptList.value = res.lists
}
getDeptList()
getLists()
</script>

View File

@ -0,0 +1,205 @@
<template>
<div class="edit-popup">
<popup ref="popupRef" :title="popupTitle" :async="true" width="550px" @confirm="handleSubmit" @close="handleClose">
<el-form ref="formRef" :model="formData" label-width="110px" :rules="formRules">
<el-form-item label="离职员工" prop="uid">
<el-input v-model="formData.uid_name" clearable placeholder="点击选择" @click="userclick('uid', 1)" />
</el-form-item>
<el-form-item label="离职日期" prop="quit_time">
<el-date-picker v-model="formData.quit_time" value-format="YYYY-MM-DD" placeholder="选择日期"
class="!flex flex-1"></el-date-picker>
</el-form-item>
<el-form-item label="部门负责人" prop="lead_admin_id">
<el-input v-model="formData.lead_admin_name" clearable placeholder="点击选择"
@click="userclick('lead_admin', 1)" />
</el-form-item>
<el-form-item label="资料交接人" prop="connect_id">
<el-input v-model="formData.connect_name" clearable placeholder="点击选择"
@click="userclick('connect', 1)" />
</el-form-item>
<el-form-item label="资料交接时间" prop="connect_time">
<el-date-picker v-model="formData.connect_time" value-format="YYYY-MM-DD" placeholder="请选择资料交接时间"
class="!flex flex-1"></el-date-picker>
</el-form-item>
<el-form-item label="参与交接人" prop="connect_uids">
<el-input v-model="formData.connect_names" clearable placeholder="点击选择"
@click="userclick('connect_uids', 2)" />
</el-form-item>
<el-form-item label="离职原因">
<el-input v-model="formData.remark" type="textarea" clearable placeholder="请输入备注" />
</el-form-item>
<el-form-item label="状态">
<el-switch v-model="formData.status" :active-value="1" :inactive-value="0" />
</el-form-item>
</el-form>
<div v-if="showDialog">
<personnelselector ref="personnel" @confirm="submituser" :type="personnelType">
</personnelselector>
</div>
</popup>
</div>
</template>
<script lang="ts" setup name="oaPersonalQuitEdit">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { apiOaPersonalQuitAdd, apiOaPersonalQuitEdit, apiOaPersonalQuitDetail } from '@/api/oa_personal_quit'
import { timeFormat } from '@/utils/util'
import type { PropType } from 'vue'
defineProps({
dictData: {
type: Object as PropType<Record<string, any[]>>,
default: () => ({})
}
})
const emit = defineEmits(['success', 'close'])
const formRef = shallowRef<FormInstance>()
const popupRef = shallowRef<InstanceType<typeof Popup>>()
const mode = ref('add')
const showDialog = ref(false)
const personnel = ref(null)
//
const popupTitle = computed(() => {
return mode.value == 'edit' ? '编辑人事离职记录表' : '新增人事离职记录表'
})
//
const formData = reactive({
id: '',
uid: '',
uid_name: '',
remark: '',
lead_admin_id: '',
lead_admin_name: '',
connect_uids: '',
connect_names: '',
connect_id: '',
connect_name: '',
connect_time: '',
status: '',
quit_time: '',
})
let personnelType = ref('1')
let value;
const userclick = async (val, type) => {
personnelType.value = type
showDialog.value = true
value = val
await nextTick()
personnel.value.open()
}
const submituser = (e: any) => {
if (personnelType.value == '1') {
formData[value + '_name'] = e.name
formData[value + "_id"] = e.id
} else {
formData.connect_uids = e.map((item: any) => {
return item.id
}).join(',')
formData.connect_names = e.map((item: any) => {
return item.name
}).join(',')
}
showDialog.value = false
}
//
const formRules = reactive<any>({
uid: [{
required: true,
message: '请输入用户ID',
trigger: ['blur']
}],
admin_id: [{
required: true,
message: '请输入创建人',
trigger: ['blur']
}],
lead_admin_id: [{
required: true,
message: '请输入部门负责人',
trigger: ['blur']
}],
connect_uids: [{
required: true,
message: '请输入参与交接人,多',
trigger: ['blur']
}],
connect_id: [{
required: true,
message: '请输入资料交接人',
trigger: ['blur']
}],
connect_time: [{
required: true,
message: '请输入资料交接时间',
trigger: ['blur']
}],
status: [{
required: true,
message: '请输入状态:-1删除 0禁用 1启用',
trigger: ['blur']
}],
quit_time: [{
required: true,
message: '请输入离职时间',
trigger: ['blur']
}]
})
//
const setFormData = async (data: Record<any, any>) => {
for (const key in formData) {
if (data[key] != null && data[key] != undefined) {
//@ts-ignore
formData[key] = data[key]
}
}
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiOaPersonalQuitDetail({
id: row.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
formData.uid = formData.uid_id
delete formData.uid_id
console.log(formData)
await formRef.value?.validate()
const data = { ...formData, }
mode.value == 'edit'
? await apiOaPersonalQuitEdit(data)
: await apiOaPersonalQuitAdd(data)
popupRef.value?.close()
emit('success')
}
//
const open = (type = 'add') => {
mode.value = type
popupRef.value?.open()
}
//
const handleClose = () => {
emit('close')
}
defineExpose({
open,
setFormData,
getDetail
})
</script>

View File

@ -0,0 +1,124 @@
<template>
<div>
<el-card class="!border-none mb-4" shadow="never">
<el-form class="mb-[-16px]" :model="queryParams" inline>
<el-form-item label="离职员工" prop="uid">
<el-input class="w-[280px]" v-model="queryParams.uid_name" clearable placeholder="请输入离职员工" />
</el-form-item>
<el-form-item label="离职时间" prop="quit_time">
<el-date-picker v-model="queryParams.quit_time" value-format="YYYY-MM-DD" placeholder="选择日期"
class="!flex flex-1"></el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="resetPage">查询</el-button>
<el-button @click="resetParams">重置</el-button>
</el-form-item>
</el-form>
</el-card>
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
<el-button v-perms="['works.rlzy.oa_personal_quit/add']" type="primary" @click="handleAdd">
<template #icon>
<icon name="el-icon-Plus" />
</template>
新增
</el-button>
<el-button v-perms="['works.rlzy.oa_personal_quit/delete']" :disabled="!selectData.length"
@click="handleDelete(selectData)">
删除
</el-button>
<div class="mt-4">
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" />
<el-table-column label="离职员工" prop="uid_name" show-overflow-tooltip />
<el-table-column label="离职时间" prop="quit_time" show-overflow-tooltip />
<el-table-column label="部门负责人" prop="lead_admin_name" show-overflow-tooltip />
<el-table-column label="资料交接人" prop="connect_name" show-overflow-tooltip />
<el-table-column label="资料交接时间" prop="connect_time" show-overflow-tooltip />
<el-table-column label="参与交接人" prop="connect_names" show-overflow-tooltip />
<el-table-column label="离职原因" prop="remark" show-overflow-tooltip />
<el-table-column label="状态" prop="status_text" show-overflow-tooltip />
<el-table-column label="操作" width="120" fixed="right">
<template #default="{ row }">
<el-button v-perms="['works.rlzy.oa_personal_quit/edit']" type="primary" link
@click="handleEdit(row)">
编辑
</el-button>
<el-button v-perms="['works.rlzy.oa_personal_quit/delete']" type="danger" link
@click="handleDelete(row.id)">
删除
</el-button>
</template>
</el-table-column>
</el-table>
</div>
<div class="flex mt-4 justify-end">
<pagination v-model="pager" @change="getLists" />
</div>
</el-card>
<edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" />
</div>
</template>
<script lang="ts" setup name="oaPersonalQuitLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiOaPersonalQuitLists, apiOaPersonalQuitDelete } from '@/api/oa_personal_quit'
import { timeFormat } from '@/utils/util'
import feedback from '@/utils/feedback'
import EditPopup from './edit.vue'
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
//
const showEdit = ref(false)
//
const queryParams = reactive({
uid: '',
lead_admin_id: '',
connect_id: '',
quit_time: ''
})
//
const selectData = ref<any[]>([])
//
const handleSelectionChange = (val: any[]) => {
selectData.value = val.map(({ id }) => id)
}
//
const { dictData } = useDictData('')
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiOaPersonalQuitLists,
params: queryParams
})
//
const handleAdd = async () => {
showEdit.value = true
await nextTick()
editRef.value?.open('add')
}
//
const handleEdit = async (data: any) => {
showEdit.value = true
await nextTick()
editRef.value?.open('edit')
editRef.value?.setFormData(data)
}
//
const handleDelete = async (id: number | any[]) => {
await feedback.confirm('确定要删除?')
await apiOaPersonalQuitDelete({ id })
getLists()
}
getLists()
</script>