This commit is contained in:
zmj 2024-05-22 18:22:47 +08:00
parent 3f8d261bd7
commit 7cbfbd79ba
21 changed files with 1430 additions and 23 deletions

BIN
public/index/RCBG.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 583 B

BIN
public/index/RCBGACT.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 585 B

26
src/api/oa_admin.ts Normal file
View File

@ -0,0 +1,26 @@
import request from "@/utils/request";
// 员工表列表
export function apiOaAdminLists(params: any) {
return request.get({ url: "/works.rlzy.oa_admin/lists", params });
}
// 添加员工表
export function apiOaAdminAdd(params: any) {
return request.post({ url: "/works.rlzy.oa_admin/add", params });
}
// 编辑员工表
export function apiOaAdminEdit(params: any) {
return request.post({ url: "/works.rlzy.oa_admin/edit", params });
}
// 删除员工表
export function apiOaAdminDelete(params: any) {
return request.post({ url: "/works.rlzy.oa_admin/delete", params });
}
// 员工表详情
export function apiOaAdminDetail(params: any) {
return request.get({ url: "/works.rlzy.oa_admin/detail", params });
}

26
src/api/oa_car_cate.ts Normal file
View File

@ -0,0 +1,26 @@
import request from "@/utils/request";
// 用车类型列表
export function apiOaCarCateLists(params: any) {
return request.get({ url: "/works.xzgl.oa_car_cate/lists", params });
}
// 添加用车类型
export function apiOaCarCateAdd(params: any) {
return request.post({ url: "/works.xzgl.oa_car_cate/add", params });
}
// 编辑用车类型
export function apiOaCarCateEdit(params: any) {
return request.post({ url: "/works.xzgl.oa_car_cate/edit", params });
}
// 删除用车类型
export function apiOaCarCateDelete(params: any) {
return request.post({ url: "/works.xzgl.oa_car_cate/delete", params });
}
// 用车类型详情
export function apiOaCarCateDetail(params: any) {
return request.get({ url: "/works.xzgl.oa_car_cate/detail", params });
}

View File

@ -0,0 +1,26 @@
import request from "@/utils/request";
// 会议室列表
export function apiOaMeetingCateLists(params: any) {
return request.get({ url: "/works.xzgl.oa_meeting_cate/lists", params });
}
// 添加会议室
export function apiOaMeetingCateAdd(params: any) {
return request.post({ url: "/works.xzgl.oa_meeting_cate/add", params });
}
// 编辑会议室
export function apiOaMeetingCateEdit(params: any) {
return request.post({ url: "/works.xzgl.oa_meeting_cate/edit", params });
}
// 删除会议室
export function apiOaMeetingCateDelete(params: any) {
return request.post({ url: "/works.xzgl.oa_meeting_cate/delete", params });
}
// 会议室详情
export function apiOaMeetingCateDetail(params: any) {
return request.get({ url: "/works.xzgl.oa_meeting_cate/detail", params });
}

26
src/api/oa_seal_cate.ts Normal file
View File

@ -0,0 +1,26 @@
import request from "@/utils/request";
// 印章类型列表
export function apiOaSealCateLists(params: any) {
return request.get({ url: "/works.xzgl.oa_seal_cate/lists", params });
}
// 添加印章类型
export function apiOaSealCateAdd(params: any) {
return request.post({ url: "/works.xzgl.oa_seal_cate/add", params });
}
// 编辑印章类型
export function apiOaSealCateEdit(params: any) {
return request.post({ url: "/works.xzgl.oa_seal_cate/edit", params });
}
// 删除印章类型
export function apiOaSealCateDelete(params: any) {
return request.post({ url: "/works.xzgl.oa_seal_cate/delete", params });
}
// 印章类型详情
export function apiOaSealCateDetail(params: any) {
return request.get({ url: "/works.xzgl.oa_seal_cate/detail", params });
}

View File

@ -75,6 +75,9 @@ const getImgById = (id: number) => {
else if (id == 1548) {
return { img: '/index/CWGLACT.png', actImg: "/index/CWGL.png", color: '#F7BB20' }
}
else if (id == 1808) {
return { img: '/index/RCBGACT.png', actImg: "/index/RCBG.png", color: '#F7BB20' }
}
else {
return { img: '/index/SCJYACT.png', actImg: "/index/SCJY.png", color: '#3A6EEF' }
}

328
src/views/oa_admin/edit.vue Normal file
View File

@ -0,0 +1,328 @@
<template>
<div class="edit-popup">
<popup ref="popupRef" :title="popupTitle" :async="true" width="80vw" @confirm="handleSubmit" @close="handleClose">
<el-form ref="formRef" :model="formData" label-width="120px" :rules="formRules">
<el-row>
<el-col :span="8">
<el-form-item label="员工姓名" prop="name">
<el-input v-model="formData.name" clearable placeholder="请输入员工姓名" />
</el-form-item>
</el-col>
<el-col :span="8"> <el-form-item label="电子邮箱">
<el-input v-model="formData.email" clearable placeholder="请输入电子邮箱" />
</el-form-item>
</el-col>
<el-col :span="8"> <el-form-item label="手机号码" prop="mobile">
<el-input v-model="formData.mobile" clearable placeholder="请输入手机号码" />
</el-form-item>
</el-col>
<el-col :span="8"> <!-- <el-form-item label="性别0-未设置1男,2女" prop="sex">
<el-input v-model="formData.sex" clearable placeholder="请输入性别0-未设置1男,2女" />
</el-form-item>
</el-col>
<el-col :span="8"> -->
<el-form-item label="性别" prop="sex">
<!-- <el-input v-model="formData.sex" clearable placeholder="请输入性别" /> -->
<el-select v-model="formData.sex" clearable placeholder="请选择性别" class="flex-1">
<el-option label="男" :value="1" />
<el-option label="女" :value="2" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="生日" prop="birthday">
<el-date-picker v-model="formData.birthday" class="!flex flex-1" type="date"
placeholder="选择日期" />
</el-form-item>
</el-col>
<el-col :span="8"> <el-form-item label="头像">
<el-input v-model="formData.thumb" clearable placeholder="请输入头像" />
</el-form-item>
</el-col>
<el-col :span="8"> <el-form-item label="组织id" prop="org_id">
<el-input v-model="formData.org_id" clearable placeholder="请输入组织id" />
</el-form-item>
</el-col>
<el-col :span="8"> <el-form-item label="部门id" prop="dept_id">
<el-input v-model="formData.dept_id" clearable placeholder="请输入部门id" />
</el-form-item>
</el-col>
<el-col :span="8"> <el-form-item label="职位id" prop="job_id">
<el-input v-model="formData.job_id" clearable placeholder="请输入职位id" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="员工类型" prop="type">
<el-select v-model="formData.type" clearable placeholder="请选择员工类型" class="flex-1">
<el-option label="正式" :value="1" />
<el-option label="试用" :value="2" />
<el-option label="实习" :value="3" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8"> <el-form-item label="年龄">
<el-input v-model="formData.age" clearable placeholder="请输入年龄" />
</el-form-item>
</el-col>
<el-col :span="8"> <el-form-item label="籍贯">
<el-input v-model="formData.native_place" clearable placeholder="请输入籍贯" />
</el-form-item>
</el-col>
<el-col :span="8"> <el-form-item label="身份证">
<el-input v-model="formData.idcard" clearable placeholder="请输入身份证" />
</el-form-item>
</el-col>
<el-col :span="8"> <el-form-item label="学历">
<el-input v-model="formData.education" clearable placeholder="请输入学历" />
</el-form-item>
</el-col>
<el-col :span="8"> <el-form-item label="银行账号">
<el-input v-model="formData.bank_account" clearable placeholder="请输入银行账号" />
</el-form-item>
</el-col>
<el-col :span="8"> <el-form-item label="银行卡信息">
<el-input v-model="formData.bank_info" clearable placeholder="请输入银行卡信息" />
</el-form-item>
</el-col>
<el-col :span="8"> <el-form-item label="员工个人简介">
<el-input v-model="formData.desc" clearable placeholder="请输入员工个人简介" type="textarea" />
</el-form-item>
</el-col>
<el-col :span="8"> <el-form-item label="员工入职日期" prop="entry_time">
<el-date-picker v-model="formData.entry_time" class="!flex flex-1" type="date"
placeholder="选择日期" />
</el-form-item>
</el-col>
<el-col :span="8">
<!-- <el-form-item label="状态0禁止登录,1正常,2离职" prop="status">
<el-input v-model="formData.status" clearable placeholder="请输入状态0禁止登录,1正常,2离职" />
</el-form-item>
</el-col>
<el-col :span="8"> -->
<el-form-item label="状态" prop="status">
<el-select v-model="formData.status" clearable placeholder="请选择状态" class="flex-1">
<el-option label="禁止登录" :value="0" />
<el-option label="正常" :value="1" />
<el-option label="离职" :value="2" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8"> <el-form-item label="登录密码" prop="password">
<el-input v-model="formData.password" clearable placeholder="请输入登录密码" />
</el-form-item>
</el-col>
<el-col :span="8"> <el-form-item label="角色权限" prop="role_id">
<el-input v-model="formData.role_id" clearable placeholder="请选择角色权限" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="oaAdminEdit">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { apiOaAdminAdd, apiOaAdminEdit, apiOaAdminDetail } from '@/api/oa_admin'
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 popupTitle = computed(() => {
return mode.value == 'edit' ? '编辑员工表' : '新增员工表'
})
//
const formData = reactive({
id: '',
name: '',
email: '',
mobile: '',
sex: '',
thumb: '',
org_id: '',
dept_id: '',
job_id: '',
type: '',
age: '',
native_place: '',
idcard: '',
education: '',
bank_account: '',
bank_info: '',
desc: '',
entry_time: '',
status: '',
password: "",
role_id: []
})
//
const formRules = reactive<any>({
name: [{
required: true,
message: '请输入员工姓名',
trigger: ['blur']
}],
email: [{
required: true,
message: '请输入电子邮箱',
trigger: ['blur']
}],
mobile: [{
required: true,
message: '请输入手机号码',
trigger: ['blur']
}],
sex: [{
required: true,
message: '请输入性别0-未设置1男,2女',
trigger: ['blur']
}],
thumb: [{
required: true,
message: '请输入头像',
trigger: ['blur']
}],
org_id: [{
required: true,
message: '请输入组织id',
trigger: ['blur']
}],
dept_id: [{
required: true,
message: '请输入部门id',
trigger: ['blur']
}],
job_id: [{
required: true,
message: '请输入职位id',
trigger: ['blur']
}],
type: [{
required: true,
message: '请输入员工类型0未设置,1正式,2试用,3实习',
trigger: ['blur']
}],
age: [{
required: true,
message: '请输入年龄',
trigger: ['blur']
}],
native_place: [{
required: true,
message: '请输入籍贯',
trigger: ['blur']
}],
idcard: [{
required: true,
message: '请输入身份证',
trigger: ['blur']
}],
education: [{
required: true,
message: '请输入学历',
trigger: ['blur']
}],
bank_account: [{
required: true,
message: '请输入银行账号',
trigger: ['blur']
}],
bank_info: [{
required: true,
message: '请输入银行卡信息',
trigger: ['blur']
}],
entry_time: [{
required: true,
message: '请输入员工入职日期',
trigger: ['blur']
}],
status: [{
required: true,
message: '请输入状态0禁止登录,1正常,2离职',
trigger: ['blur']
}],
password: [{
required: true,
message: '请输入状态0禁止登录,1正常,2离职',
trigger: ['blur']
}],
role_id: [{
required: true,
message: '请输入状态0禁止登录,1正常,2离职',
trigger: ['blur']
}]
})
//
const setFormData = async (data: Record<any, any>) => {
console.log(data)
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 apiOaAdminDetail({
id: row.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
await formRef.value?.validate()
const data = { ...formData, }
mode.value == 'edit'
? await apiOaAdminEdit(data)
: await apiOaAdminAdd(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,208 @@
<template>
<div class="flex" style="height:80vh">
<el-card style="width:auto" class="!border-none mr-5" shadow="never">
<template #header>企业组织架构</template>
<el-tree default-expand-all :data="data" :props="defaultProps" @node-click="handleNodeClick" />
</el-card>
<el-card class="!border-none flex-1" shadow="never">
<el-form class="mb-[-16px]" :model="queryParams" inline>
<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="mobile">
<el-input class="w-[280px]" v-model="queryParams.mobile" clearable placeholder="请输入手机号码" />
</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>
<div class="mt-4">
<el-button v-perms="['works.rlzy.oa_admin/add']" type="primary" @click="handleAdd">
<template #icon>
<icon name="el-icon-Plus" />
</template>
新增
</el-button>
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" />
<el-table-column label="员工姓名" prop="name" show-overflow-tooltip />
<el-table-column label="电子邮箱" prop="email" show-overflow-tooltip />
<el-table-column label="手机号码" prop="mobile" show-overflow-tooltip />
<!-- <el-table-column label="性别0-未设置1男,2女" prop="sex" show-overflow-tooltip /> -->
<el-table-column label="头像" prop="thumb" show-overflow-tooltip />
<el-table-column label="组织id" prop="org_id" show-overflow-tooltip />
<el-table-column label="部门id" prop="dept_id" show-overflow-tooltip />
<el-table-column label="职位id" prop="job_id" show-overflow-tooltip />
<!-- <el-table-column label="员工类型0未设置,1正式,2试用,3实习" prop="type" show-overflow-tooltip /> -->
<el-table-column label="年龄" prop="age" show-overflow-tooltip />
<el-table-column label="籍贯" prop="native_place" show-overflow-tooltip />
<!-- <el-table-column label="身份证" prop="idcard" show-overflow-tooltip /> -->
<!-- <el-table-column label="学历" prop="education" show-overflow-tooltip /> -->
<!-- <el-table-column label="银行账号" prop="bank_account" show-overflow-tooltip /> -->
<!-- <el-table-column label="银行卡信息" prop="bank_info" show-overflow-tooltip /> -->
<!-- <el-table-column label="员工个人简介" prop="desc" show-overflow-tooltip /> -->
<el-table-column label="员工入职日期" prop="entry_time" show-overflow-tooltip />
<!-- <el-table-column label="状态0禁止登录,1正常,2离职" prop="status" show-overflow-tooltip /> -->
<el-table-column label="操作" width="120" fixed="right">
<template #default="{ row }">
<el-button v-perms="['works.rlzy.oa_admin/edit']" type="primary" link @click="handleEdit(row)">
编辑
</el-button>
<el-button v-perms="['works.rlzy.oa_admin/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="oaAdminLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiOaAdminLists, apiOaAdminDelete, apiOaAdminDetail } from '@/api/oa_admin'
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({
name: '',
mobile: '',
sex: '',
org_id: '',
dept_id: '',
job_id: '',
type: '',
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: apiOaAdminLists,
params: queryParams
})
//
const handleAdd = async () => {
showEdit.value = true
await nextTick()
editRef.value?.open('add')
}
//
const handleEdit = async (data: any) => {
let res = await apiOaAdminDetail({ id: data.id })
console.log(res)
showEdit.value = true
await nextTick()
editRef.value?.open('edit')
editRef.value?.setFormData(res)
}
//
const handleDelete = async (id: number | any[]) => {
await feedback.confirm('确定要删除?')
await apiOaAdminDelete({ id })
getLists()
}
interface Tree {
label: string
children?: Tree[]
}
const handleNodeClick = (data: Tree) => {
console.log(data)
}
const data: Tree[] = [
{
label: 'Level one 1',
id: 1,
children: [
{
label: 'Level two 1-1',
id: 2,
children: [
{
label: 'Level three 1-1-1',
id: 3,
children: [
{
label: 'Level three 1-1-1',
children: [
{
label: 'Level three 1-1-1',
id: 5,
},
],
},
],
},
],
},
],
},
{
label: 'Level one 2',
id: 1,
children: [
{
label: 'Level two 2-1',
id: 6,
children: [
{
id: 4,
label: 'Level three 2-1-1',
},
],
},
{
label: 'Level two 2-2',
id: 6,
children: [
{
label: 'Level three 2-2-1',
},
],
},
],
},
]
const defaultProps = {
children: 'children',
label: 'label',
id: 'id'
}
getLists()
</script>

View File

@ -0,0 +1,126 @@
<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="title">
<el-input v-model="formData.title" clearable placeholder="请输入车辆名称" />
</el-form-item>
<el-form-item label="车辆号码" prop="name">
<el-input v-model="formData.name" clearable placeholder="请输入车辆号码" />
</el-form-item>
<el-form-item label="状态" prop="status">
<el-switch v-model="formData.status" :active-value="1" :inactive-value="0" />
</el-form-item>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="oaCarCateEdit">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { apiOaCarCateAdd, apiOaCarCateEdit, apiOaCarCateDetail } from '@/api/oa_car_cate'
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 popupTitle = computed(() => {
return mode.value == 'edit' ? '编辑用车类型' : '新增用车类型'
})
//
const formData = reactive({
id: '',
title: '',
name: '',
status: '',
})
//
const carNumberReg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-Z0-9]{4}[A-Z0-9挂学警港澳]{1}$/
//
const formRules = reactive<any>({
title: [{
required: true,
message: '请输入车辆名称',
trigger: ['blur']
}],
name: [{
required: true,
trigger: ['blur'],
validator: (rule: any, value: string, callback: any) => {
if (!carNumberReg.test(formData.name)) {
callback(new Error('请输入正确的车牌号码'))
} else {
callback()
}
}
}]
})
//
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 apiOaCarCateDetail({
id: row.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
await formRef.value?.validate()
const data = { ...formData, }
mode.value == 'edit'
? await apiOaCarCateEdit(data)
: await apiOaCarCateAdd(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,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

@ -0,0 +1,63 @@
<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,111 @@
<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="100px" :rules="formRules">
<el-form-item label="会议室名称" prop="title">
<el-input v-model="formData.title" clearable placeholder="请输入会议室名称" />
</el-form-item>
<el-form-item label="状态" prop="status">
<el-switch v-model="formData.status" :active-value="1" :inactive-value="0" />
</el-form-item>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="oaMeetingCateEdit">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { apiOaMeetingCateAdd, apiOaMeetingCateEdit, apiOaMeetingCateDetail } from '@/api/oa_meeting_cate'
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 popupTitle = computed(() => {
return mode.value == 'edit' ? '编辑会议室' : '新增会议室'
})
//
const formData = reactive({
id: '',
title: '',
status: '',
})
//
const formRules = reactive<any>({
title: [{
required: true,
message: '请输入会议室名称',
trigger: ['blur']
}],
status: [{
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 apiOaMeetingCateDetail({
id: row.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
await formRef.value?.validate()
const data = { ...formData, }
mode.value == 'edit'
? await apiOaMeetingCateEdit(data)
: await apiOaMeetingCateAdd(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 right" 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="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 right" v-loading="pager.loading" shadow="never">
<el-button v-perms="['works.xzgl.oa_meeting_cate/add']" type="primary" @click="handleAdd">
<template #icon>
<icon name="el-icon-Plus" />
</template>
新增
</el-button>
<el-button v-perms="['works.xzgl.oa_meeting_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="status_text" show-overflow-tooltip />
<el-table-column label="操作" width="120" fixed="right">
<template #default="{ row }">
<el-button v-perms="['works.xzgl.oa_meeting_cate/edit']" type="primary" link
@click="handleEdit(row)">
编辑
</el-button>
<el-button v-perms="['works.xzgl.oa_meeting_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="oaMeetingCateLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiOaMeetingCateLists, apiOaMeetingCateDelete } from '@/api/oa_meeting_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: '',
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: apiOaMeetingCateLists,
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 apiOaMeetingCateDelete({ id })
getLists()
}
getLists()
</script>
<style scoped lang="scss">
.right {
translation: all 0.5s;
}
</style>

View File

@ -0,0 +1,111 @@
<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="120px" :rules="formRules">
<el-form-item label="印章类型名称" prop="title">
<el-input v-model="formData.title" clearable placeholder="请输入印章类型名称" />
</el-form-item>
<el-form-item label="状态" prop="status">
<el-switch v-model="formData.status" :active-value="1" :inactive-value="0" />
</el-form-item>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="oaSealCateEdit">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { apiOaSealCateAdd, apiOaSealCateEdit, apiOaSealCateDetail } from '@/api/oa_seal_cate'
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 popupTitle = computed(() => {
return mode.value == 'edit' ? '编辑印章类型' : '新增印章类型'
})
//
const formData = reactive({
id: '',
title: '',
status: '',
})
//
const formRules = reactive<any>({
title: [{
required: true,
message: '请输入印章类型名称',
trigger: ['blur']
}],
status: [{
required: true,
message: '请输入状态:-1删除 0禁用 1启用',
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 apiOaSealCateDetail({
id: row.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
await formRef.value?.validate()
const data = { ...formData, }
mode.value == 'edit'
? await apiOaSealCateEdit(data)
: await apiOaSealCateAdd(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,118 @@
<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="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_seal_cate/add']" type="primary" @click="handleAdd">
<template #icon>
<icon name="el-icon-Plus" />
</template>
新增
</el-button>
<el-button v-perms="['works/xzgl.oa_seal_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="status_text" show-overflow-tooltip />
<el-table-column label="操作" width="120" fixed="right">
<template #default="{ row }">
<el-button v-perms="['works/xzgl.oa_seal_cate/edit']" type="primary" link
@click="handleEdit(row)">
编辑
</el-button>
<el-button v-perms="['works/xzgl.oa_seal_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="oaSealCateLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiOaSealCateLists, apiOaSealCateDelete } from '@/api/oa_seal_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: '',
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: apiOaSealCateLists,
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 apiOaSealCateDelete({ id })
getLists()
}
getLists()
</script>

View File

@ -1,21 +1,15 @@
<template>
<div class="edit-popup">
<popup ref="popupRef" :title="popupTitle" :async="true" width="550px" @confirm="handleSubmit"
@close="handleClose">
<popup ref="popupRef" :title="popupTitle" :async="true" width="550px" @confirm="handleSubmit" @close="handleClose">
<el-form ref="formRef" :model="formData" label-width="84px" :rules="formRules">
<el-form-item label="组织" prop="org_id">
<el-select clearable v-model="formData.org_id" placeholder="请选择组织" @change="area_change"
class="flex-1">
<el-select clearable v-model="formData.org_id" placeholder="请选择组织" @change="area_change" class="flex-1">
<el-option v-for="(item, index) in orglist" :key="index" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="部门名称" prop="name">
<el-input v-model="formData.name" clearable placeholder="请输入部门名称" />
</el-form-item>
<el-form-item label="负责人" prop="leader">
<el-input v-model="formData.leader_name" readonly placeholder="请输入负责人姓名" :maxlength="30"
@click="openDialog" />
</el-form-item>
<el-form-item label="联系电话" prop="mobile">
<el-input v-model="formData.mobile" placeholder="请输入联系电话" />
</el-form-item>

View File

@ -28,17 +28,16 @@
</el-button>
<el-button @click="handleExpand"> 展开/折叠 </el-button>
</div>
<el-table ref="tableRef" class="mt-4" size="large" v-loading="pager.loading" :data="pager.lists"
row-key="id" :tree-props="{ children: 'children', hasChildren: 'hasChildren' }">
<el-table ref="tableRef" class="mt-4" size="large" v-loading="pager.loading" :data="pager.lists" row-key="id"
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }">
<el-table-column label="部门名称" prop="name" min-width="150" show-overflow-tooltip />
<el-table-column label="部门状态" prop="status" min-width="100">
<template #default="{ row }">
<el-tag class="ml-2" :type="row.status ? '' : 'danger'">{{
row.status == 1 ? "正常" : "禁用"
}}</el-tag>
row.status == 1 ? "正常" : "禁用"
}}</el-tag>
</template>
</el-table-column>
<el-table-column label="负责人" prop="leader" min-width="150" show-overflow-tooltip />
<el-table-column label="所属组织" prop="org_name" min-width="150" show-overflow-tooltip />
<el-table-column label="排序" prop="sort" min-width="100" />

View File

@ -5,9 +5,6 @@
<el-form-item label="组织名称" prop="name">
<el-input v-model="formData.name" placeholder="请输入组织名称" clearable :maxlength="100" />
</el-form-item>
<el-form-item label="组织负责人" prop="master">
<el-input v-model="formData.master" placeholder="请输入组织负责人" clearable :maxlength="100" />
</el-form-item>
<el-form-item label="组织状态" required prop="status">
<el-switch v-model="formData.status" :active-value="1" :inactive-value="0" />
</el-form-item>

View File

@ -34,7 +34,6 @@
<el-table class="mt-4" size="large" v-loading="pager.loading" :data="pager.lists">
<el-table-column label="组织名称" prop="name" min-width="100" />
<el-table-column label="组织负责人" prop="master" min-width="100" />
<el-table-column label="状态" prop="status" min-width="100">
<template #default="{ row }">
<el-tag class="ml-2" :type="row.status ? '' : 'danger'">

View File

@ -1,21 +1,20 @@
<template>
<div class="edit-popup">
<popup ref="popupRef" :title="popupTitle" :async="true" width="550px" @confirm="handleSubmit"
@close="handleClose">
<popup ref="popupRef" :title="popupTitle" :async="true" width="550px" @confirm="handleSubmit" @close="handleClose">
<el-form ref="formRef" :model="formData" label-width="84px" :rules="formRules">
<el-form-item label="组织名称" prop="name" v-if="mode == 'add'">
<el-select clearable v-model="org_id1" placeholder="请选择部门" @change="area_change">
<el-select clearable v-model="org_id1" placeholder="请选择部门" @change="area_change" class="!flex-1">
<el-option v-for="(item, index) in orglist" :key="index" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="部门名称" prop="dept_id">
<el-select clearable v-model="formData.dept_id" placeholder="请选择部门" @change="area_change1">
<el-select clearable v-model="formData.dept_id" placeholder="请选择部门" @change="area_change1"
class="!flex-1">
<el-option v-for="(item, index) in jobs" :key="index" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="岗位名称" prop="name">
<el-input class="w-[280px]" v-model="formData.name" clearable @keyup.enter="getLists" />
<el-input v-model="formData.name" clearable />
</el-form-item>
<el-form-item label="排序" prop="sort">
<div>