'add'
This commit is contained in:
parent
ba2e038e2f
commit
68a5db5933
51
src/api/oa_Initiate.ts
Normal file
51
src/api/oa_Initiate.ts
Normal file
@ -0,0 +1,51 @@
|
||||
import request from "@/utils/request";
|
||||
|
||||
// // 审批流程表列表
|
||||
// export function apiOaFlowLists(params: any) {
|
||||
// return request.get({ url: "/works.bgsp.oa_flow/lists", params });
|
||||
// }
|
||||
|
||||
// // 添加审批流程表
|
||||
// export function apiOaFlowAdd(params: any) {
|
||||
// return request.post({ url: "/works.bgsp.oa_flow/add", params });
|
||||
// }
|
||||
|
||||
// // 编辑审批流程表
|
||||
// export function apiOaFlowEdit(params: any) {
|
||||
// return request.post({ url: "/works.bgsp.oa_flow/edit", params });
|
||||
// }
|
||||
|
||||
// // 删除审批流程表
|
||||
// export function apiOaFlowDelete(params: any) {
|
||||
// return request.post({ url: "/works.bgsp.oa_flow/delete", params });
|
||||
// }
|
||||
|
||||
// // 审批流程表详情
|
||||
// export function apiOaFlowDetail(params: any) {
|
||||
// return request.get({ url: "/works.bgsp.oa_flow/detail", params });
|
||||
// }
|
||||
|
||||
// 审批流程表列表
|
||||
export function apiOaFlowTypeLists(params: any) {
|
||||
return request.get({ url: "/works.bgsp.oa_flow_type/all", params });
|
||||
}
|
||||
|
||||
export function apiOaoaApproveLists(params: any) {
|
||||
return request.get({ url: "/works.bgsp.oa_approve/lists", params });
|
||||
}
|
||||
|
||||
export function apiOaoaApproveDetail(params: any) {
|
||||
return request.get({ url: "/works.bgsp.oa_approve/detail", params });
|
||||
}
|
||||
|
||||
export function apiOaoaApproveAdd(params: any) {
|
||||
return request.post({ url: "/works.bgsp.oa_approve/add", params });
|
||||
}
|
||||
|
||||
export function apiOaoaApproveCopy(params: any) {
|
||||
return request.get({ url: "/works.bgsp.oa_approve/copy", params });
|
||||
}
|
||||
|
||||
export function apiOaoaApprovelst(params: any) {
|
||||
return request.get({ url: "/works.bgsp.oa_approve/lst", params });
|
||||
}
|
@ -2,28 +2,29 @@
|
||||
<el-form ref="formRef" :model="formData" label-width="90px" :rules="formRules">
|
||||
<el-row>
|
||||
<el-col :span="8" v-for="(item, index) in config" :key="index">
|
||||
<el-form-item :label="item.label" v-if="item.type == 0" :prop="item.isRequired ? item.value : ''">
|
||||
<el-input v-model="formData[item.value]" clearable :placeholder="'请输入' + item.label" />
|
||||
<el-form-item :label="item.label" v-if="item.type == 0">
|
||||
<el-input v-model="formData[item.value].value" clearable :placeholder="'请输入' + item.label" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="item.label" v-if="item.type == 1" :prop="item.isRequired ? item.value : ''">
|
||||
<el-date-picker class="flex-1 !flex" v-model="formData[item.value]" clearable type="date"
|
||||
<el-form-item :label="item.label" v-if="item.type == 1">
|
||||
<el-date-picker class="flex-1 !flex" v-model="formData[item.value].value" clearable type="date"
|
||||
value-format="YYYY-MM-DD" :placeholder="'请选择' + item.label">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item :label="item.label" v-if="item.type == 2" :prop="item.isRequired ? item.value : ''">
|
||||
<el-select v-model="formData[item.value]" :placeholder="'请选择' + item.label" class="flex-1">
|
||||
<el-form-item :label="item.label" v-if="item.type == 2">
|
||||
<el-select v-model="formData[item.value].value" :placeholder="'请选择' + item.label" 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="item.label" v-if="item.type == 3" :prop="item.isRequired ? item.value : ''">
|
||||
<el-input v-model="formData[item.value + '_name']" readonly :placeholder="'点击选择' + item.label"
|
||||
<el-form-item :label="item.label" v-if="item.type == 3">
|
||||
<el-input v-model="formData[item.value].value" readonly :placeholder="'点击选择' + item.label"
|
||||
@click="userclick(item.value)" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="item.label" v-if="item.type == 4" :prop="item.isRequired ? item.value : ''">
|
||||
<el-input v-model="formData[item.value]" clearable type="textarea" :placeholder="'请输入' + item.label" />
|
||||
<el-form-item :label="item.label" v-if="item.type == 4">
|
||||
<el-input v-model="formData[item.value].value" clearable type="textarea"
|
||||
:placeholder="'请输入' + item.label" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="item.label" v-if="item.type == 5" :prop="item.isRequired ? item.value : ''">
|
||||
<el-form-item :label="item.label" v-if="item.type == 5">
|
||||
<uploadAnnex :form-data="formData"></uploadAnnex>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@ -45,6 +46,10 @@ const props = defineProps({
|
||||
type: Array,
|
||||
required: true
|
||||
},
|
||||
formData: {
|
||||
type: Object,
|
||||
required: true
|
||||
}
|
||||
})
|
||||
|
||||
const deptList = ref([])
|
||||
@ -53,39 +58,11 @@ const getDeptList = async () => {
|
||||
deptList.value = res.lists
|
||||
}
|
||||
getDeptList()
|
||||
const formData = reactive({})
|
||||
|
||||
// 表单验证
|
||||
const formRules = reactive({
|
||||
|
||||
});
|
||||
|
||||
const setRules = () => {
|
||||
props.config.forEach(item => {
|
||||
if (item.isRequired) {
|
||||
formRules[item.value] = [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入" + item.label,
|
||||
trigger: ["blur"],
|
||||
},
|
||||
]
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
setRules()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const showPerDialog = ref(false)
|
||||
const personnel = ref(null)
|
||||
@ -98,12 +75,19 @@ const userclick = async (val) => {
|
||||
personnel.value.open()
|
||||
}
|
||||
const submituser = (e) => {
|
||||
formData[value + '_name'] = e.name
|
||||
formData[value] = e.id
|
||||
props.formData[value + '_name'] = e.name
|
||||
props.formData[value] = e.id
|
||||
showPerDialog.value = false
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
const setKey = () => {
|
||||
props.config.forEach(item => {
|
||||
props.formData[item.value] = {
|
||||
name: item.label,
|
||||
value: ""
|
||||
}
|
||||
})
|
||||
console.log(props.formData, 'formData');
|
||||
}
|
||||
setKey()
|
||||
</script>
|
68
src/components/oaFlow/index.vue
Normal file
68
src/components/oaFlow/index.vue
Normal file
@ -0,0 +1,68 @@
|
||||
<template>
|
||||
<el-form ref="formRef" :model="formData" label-width="100px" :rules="formRules">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="审批流程">
|
||||
<el-select v-model="formData.flow_id" placeholder="选择审批流程" class="flex-1">
|
||||
<el-option :label="item.name" :value="item.id" v-for="item in flowList">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="审核人" prop="name">
|
||||
<el-input v-model="formData.check_admin_names" clearable placeholder="点击选择审核人" readonly
|
||||
@click="userclick('check_admin')" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="抄送人">
|
||||
<el-input v-model="formData.copy_names" clearable placeholder="点击选择抄送人" readonly
|
||||
@click="userclick('copy')" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div v-if="showPerDialog">
|
||||
<personnelselector ref="personnel" @confirm="submituser" type="2">
|
||||
</personnelselector>
|
||||
</div>
|
||||
</el-form>
|
||||
</template>
|
||||
<script setup>
|
||||
import { reactive, ref, defineProps } from 'vue'
|
||||
import { apiOaFlowLists } from '@/api/oa_flow'
|
||||
|
||||
const props = defineProps({
|
||||
formData: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
const showPerDialog = ref(false)
|
||||
const personnel = ref(null)
|
||||
|
||||
let value
|
||||
const userclick = async (val) => {
|
||||
showPerDialog.value = true
|
||||
value = val
|
||||
await nextTick()
|
||||
personnel.value.open()
|
||||
}
|
||||
const submituser = (e) => {
|
||||
props.formData[value + '_names'] = e.map(item => item.name).join(',')
|
||||
props.formData[value + '_ids'] = e.map(item => item.id).join(',')
|
||||
showPerDialog.value = false
|
||||
}
|
||||
|
||||
|
||||
const flowList = ref([])
|
||||
const getFlowList = async () => {
|
||||
const res = await apiOaFlowLists()
|
||||
flowList.value = res.lists
|
||||
}
|
||||
getFlowList()
|
||||
|
||||
|
||||
</script>
|
124
src/views/oa_CopyMe/index.vue
Normal file
124
src/views/oa_CopyMe/index.vue
Normal 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="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="id" prop="title" show-overflow-tooltip />
|
||||
<el-table-column label="申请人" prop="user_name" show-overflow-tooltip />
|
||||
<el-table-column label="申请时间" prop="create_time" show-overflow-tooltip />
|
||||
<el-table-column label="审批类型" prop="type_name" show-overflow-tooltip />
|
||||
<el-table-column label="所属部门" prop="dept_name" show-overflow-tooltip />
|
||||
<el-table-column label="当前审批人" prop="check_admin_users" show-overflow-tooltip />
|
||||
<el-table-column label="审批状态" prop="check_status_text" 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 { apiOaoaApproveCopy } from '@/api/oa_Initiate'
|
||||
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: apiOaoaApproveCopy,
|
||||
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>
|
||||
|
0
src/views/oa_Deal/detail.vue
Normal file
0
src/views/oa_Deal/detail.vue
Normal file
118
src/views/oa_Deal/index.vue
Normal file
118
src/views/oa_Deal/index.vue
Normal 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="user_name" show-overflow-tooltip />
|
||||
<el-table-column label="申请时间" prop="create_time" show-overflow-tooltip />
|
||||
<el-table-column label="审批类型" prop="type_name" show-overflow-tooltip />
|
||||
<el-table-column label="所属部门" prop="dept_name" show-overflow-tooltip />
|
||||
<el-table-column label="当前审批人" prop="check_admin_users" show-overflow-tooltip />
|
||||
<el-table-column label="审批状态" prop="check_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>
|
||||
</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 { apiOaoaApprovelst } from '@/api/oa_Initiate'
|
||||
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: apiOaoaApprovelst,
|
||||
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>
|
||||
|
76
src/views/oa_Initiate/detail.vue
Normal file
76
src/views/oa_Initiate/detail.vue
Normal file
@ -0,0 +1,76 @@
|
||||
<template>
|
||||
<div class="detail-popup">
|
||||
<popup ref="popupRef" title="日程安排详情" :async="true" width="550px" @confirm="handleSubmit" @close="handleClose">
|
||||
<el-descriptions :column="1" border>
|
||||
<el-descriptions-item label="工作安排主题" label-align="left" align="left" label-class-name="my-label">
|
||||
{{ formData.title }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="日程优先级" label-align="left" align="left" label-class-name="my-label">
|
||||
{{ formData.type_text }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="开始时间" label-align="left" align="left" label-class-name="my-label">
|
||||
{{ formData.start_time }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="结束时间" label-align="left" align="left" label-class-name="my-label">
|
||||
{{ formData.end_time }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="提醒类型" label-align="left" align="left" label-class-name="my-label">
|
||||
{{ formData.remind_type_text }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="描述" label-align="left" align="left" label-class-name="my-label">
|
||||
{{ formData.remark }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="customdetail">
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import type { PropType } from 'vue'
|
||||
|
||||
const emit = defineEmits(['close'])
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
|
||||
})
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
for (const key in data) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key]
|
||||
}
|
||||
}
|
||||
console.log(formData, 'formData')
|
||||
}
|
||||
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
popupRef.value?.close()
|
||||
|
||||
}
|
||||
|
||||
//打开弹窗
|
||||
const open = () => {
|
||||
popupRef.value?.open()
|
||||
}
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
})
|
||||
</script>
|
||||
|
87
src/views/oa_Initiate/edit.vue
Normal file
87
src/views/oa_Initiate/edit.vue
Normal file
@ -0,0 +1,87 @@
|
||||
<template>
|
||||
<div class="edit-popup">
|
||||
<popup ref="popupRef" :title="popupTitle" :async="true" width="60vw" @confirm="handleSubmit" @close="handleClose">
|
||||
<el-card>
|
||||
<template #header>
|
||||
审批内容
|
||||
</template>
|
||||
<generateForm :config="formData.data" :form-data="formData.extends"></generateForm>
|
||||
</el-card>
|
||||
<el-card>
|
||||
<template #header>
|
||||
审批流程
|
||||
</template>
|
||||
<oaFlow :form-data="formData"></oaFlow>
|
||||
</el-card>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="oaFlowTypeEdit">
|
||||
import generateForm from './../../components/generateForm/index.vue'
|
||||
import Popup from "@/components/popup/index.vue";
|
||||
import { apiOaoaApproveAdd } from "@/api/oa_Initiate"
|
||||
|
||||
const emit = defineEmits(["success", "close"]);
|
||||
const formRef = shallowRef<FormInstance>();
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>();
|
||||
const mode = ref("add");
|
||||
const showDialog = ref(false)
|
||||
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == "edit" ? "编辑审批类型" : "新增审批类型";
|
||||
});
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
data: [],
|
||||
extends: {}
|
||||
});
|
||||
|
||||
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({
|
||||
type: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入所属分类",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
]
|
||||
});
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
formData.data = data.data;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
console.log(formData)
|
||||
await formRef.value?.validate();
|
||||
const data = { ...formData };
|
||||
await apiOaoaApproveAdd(data)
|
||||
popupRef.value?.close();
|
||||
emit("success");
|
||||
};
|
||||
|
||||
//打开弹窗
|
||||
const open = (type = "add") => {
|
||||
mode.value = type;
|
||||
popupRef.value?.open();
|
||||
};
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit("close");
|
||||
};
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
});
|
||||
</script>
|
169
src/views/oa_Initiate/index.vue
Normal file
169
src/views/oa_Initiate/index.vue
Normal file
@ -0,0 +1,169 @@
|
||||
<template>
|
||||
<div class="flex content">
|
||||
<el-card style="flex:1" class="mr-5">
|
||||
<template #header>
|
||||
审批新申请
|
||||
</template>
|
||||
<div v-for="(item, index) in lists.filter(e => e.children.length > 0)" :key="index" class="tit">
|
||||
{{ item.name }}
|
||||
<div class="tit-content">
|
||||
<div v-for="(e, i) in item.children" :key="i" class="tit-li" @click="handleEdit(e.id)">{{ e.title }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card style="flex:4">
|
||||
<template #header>
|
||||
审批列表
|
||||
</template>
|
||||
<el-form class="mb-[-16px] mt-5" :model="queryParams" inline>
|
||||
<el-form-item label="类型" prop="type">
|
||||
<el-select v-model="queryParams.type" clearable placeholder="请选择类型" class="flex-1">
|
||||
<el-option label="全部" :value="1" />
|
||||
<el-option label="待审核" :value="2" />
|
||||
<el-option label="审核通过," :value="3" />
|
||||
<el-option label="审核不通过" :value="4" />
|
||||
</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>
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column label="申请人" prop="user_name" show-overflow-tooltip />
|
||||
<el-table-column label="申请时间" prop="create_time" show-overflow-tooltip />
|
||||
<el-table-column label="审批类型" prop="type_name" show-overflow-tooltip />
|
||||
<el-table-column label="所属部门" prop="dept_name" show-overflow-tooltip />
|
||||
<el-table-column label="当前审批人" prop="check_admin_users" show-overflow-tooltip />
|
||||
<el-table-column label="审批状态" prop="check_status_text" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="120" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button link @click="handDetail(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" :deptList="deptList" :dict-data="dictData" @success="getLists"
|
||||
@close="showEdit = false" />
|
||||
<detailPopup v-if="showDetail" ref="detailRef" @success="showDetail = false" @close="showDetail = false" />
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup >
|
||||
import { ref, shallowRef, nextTick, reactive } from 'vue'
|
||||
import { usePaging } from '@/hooks/usePaging';
|
||||
import { apiOaWorkLists } from '@/api/oa_work'
|
||||
import { apiOaFlowTypeLists, apiOaoaApproveLists, apiOaoaApproveAdd, apiOaoaApproveDetail } from "@/api/oa_Initiate"
|
||||
import EditPopup from './edit.vue'
|
||||
import detailPopup from './detail.vue'
|
||||
import { apiOaFlowTypeDetail } from '@/api/oa_flow_type'
|
||||
|
||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
|
||||
// 是否显示编辑框
|
||||
const showEdit = ref(false)
|
||||
|
||||
const detailRef = ref(null)
|
||||
// 是否显示编辑框
|
||||
const showDetail = ref(false)
|
||||
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
type: 1
|
||||
})
|
||||
|
||||
|
||||
// 编辑
|
||||
const handleEdit = async (id: any) => {
|
||||
let res = await apiOaFlowTypeDetail({ id })
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('edit')
|
||||
editRef.value?.setFormData(res)
|
||||
}
|
||||
|
||||
const handDetail = async (id: any) => {
|
||||
let res = await apiOaoaApproveDetail({ id })
|
||||
showDetail.value = true
|
||||
await nextTick()
|
||||
detailRef.value?.open()
|
||||
detailRef.value?.setFormData(res)
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 删除
|
||||
const handleDelete = async (id: number) => {
|
||||
await apiOaFlowTypeDelete({ id })
|
||||
getLists()
|
||||
}
|
||||
|
||||
// 批量删除
|
||||
const handleBatchDelete = async () => {
|
||||
const ids = pager.lists.map((item) => item.id)
|
||||
await apiOaFlowTypeDelete({ ids })
|
||||
getLists()
|
||||
|
||||
}
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiOaoaApproveLists,
|
||||
params: queryParams
|
||||
})
|
||||
const activeName = ref('first')
|
||||
|
||||
getLists()
|
||||
|
||||
|
||||
|
||||
const lists = ref([])
|
||||
|
||||
const getTypeList = async () => {
|
||||
const res = await apiOaFlowTypeLists()
|
||||
lists.value = res
|
||||
}
|
||||
getTypeList()
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.content {
|
||||
height: 82vh;
|
||||
}
|
||||
|
||||
.tit {
|
||||
margin-bottom: 10px;
|
||||
|
||||
.tit-content {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
flex-wrap: wrap;
|
||||
|
||||
.tit-li {
|
||||
width: 60px;
|
||||
background: #FF8F4A;
|
||||
color: white;
|
||||
text-align: center;
|
||||
height: 60px;
|
||||
line-height: 60px;
|
||||
cursor: pointer;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
@ -56,12 +56,12 @@
|
||||
<el-col :span="8">
|
||||
<el-form-item label="类型">
|
||||
<el-select v-model="item.type" clearable placeholder="请选择所属类型" class="flex-1">
|
||||
<el-option label="文本框" :value="parseInt(0)" />
|
||||
<el-option label="日期选择框" :value="parseInt(1)" />
|
||||
<el-option label="部门选择器" :value="parseInt(2)" />
|
||||
<el-option label="人员选择器" :value="parseInt(3)" />
|
||||
<el-option label="文本域" :value="parseInt(4)" />
|
||||
<el-option label="文件上传" :value="parseInt(5)" />
|
||||
<el-option label="文本框" value="0" />
|
||||
<el-option label="日期选择框" value="1" />
|
||||
<el-option label="部门选择器" value="2" />
|
||||
<el-option label="人员选择器" value="3" />
|
||||
<el-option label="文本域" value="4" />
|
||||
<el-option label="文件上传" value="5" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@ -70,11 +70,11 @@
|
||||
<el-input v-model="item.label" clearable placeholder="请输入名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<!-- <el-col :span="4">
|
||||
<el-form-item label="是否必填">
|
||||
<el-switch v-model="item.isRequired"></el-switch>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-col> -->
|
||||
<el-col :span="4">
|
||||
<el-button @click="formData.data.splice(index, 1)">
|
||||
删除
|
||||
@ -85,7 +85,7 @@
|
||||
</el-form>
|
||||
</popup>
|
||||
<el-dialog v-if="showDialog" v-model="showDialog" title="预览审批内容" width="70%">
|
||||
<generateForm :config="formData.data"></generateForm>
|
||||
<generateForm :config="formData.data" :form-data="previewObj"></generateForm>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
@ -133,49 +133,14 @@ const formData = reactive({
|
||||
department_ids: "",
|
||||
data: [
|
||||
{
|
||||
"type": 0,
|
||||
"label": "请假类型",
|
||||
"value": "DZFS",
|
||||
isRequired: true,
|
||||
},
|
||||
{
|
||||
"type": 1,
|
||||
"label": "开始时间",
|
||||
"value": "SD",
|
||||
isRequired: true,
|
||||
|
||||
},
|
||||
{
|
||||
"type": 1,
|
||||
"label": "结束时间",
|
||||
"value": "DSFSD",
|
||||
isRequired: true,
|
||||
|
||||
},
|
||||
{
|
||||
"type": 0,
|
||||
"label": "请假天数",
|
||||
"value": "DSF",
|
||||
isRequired: false,
|
||||
|
||||
},
|
||||
{
|
||||
"type": 4,
|
||||
"label": "请假事由",
|
||||
"value": "SDS",
|
||||
isRequired: true,
|
||||
|
||||
},
|
||||
{
|
||||
"type": 5,
|
||||
"label": "附件",
|
||||
"value": "DZFS",
|
||||
isRequired: false,
|
||||
|
||||
"type": '0',
|
||||
"label": "",
|
||||
"value": "",
|
||||
},
|
||||
]
|
||||
});
|
||||
|
||||
const previewObj = reactive({})
|
||||
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({
|
||||
@ -238,12 +203,21 @@ const previewFn = () => {
|
||||
formData.data.forEach((item: any) => {
|
||||
item.value = Pinyin.getCamelChars(item.label)
|
||||
});
|
||||
console.log(formData.data)
|
||||
showDialog.value = true;
|
||||
}
|
||||
|
||||
const handleDelete = (index: number) => {
|
||||
formData.data.splice(index, 1);
|
||||
}
|
||||
|
||||
const handleEdit = (index: number) => {
|
||||
showDialog.value = true;
|
||||
}
|
||||
|
||||
const handAdd = () => {
|
||||
formData.data.push({
|
||||
"type": 0,
|
||||
"type": '',
|
||||
"label": "",
|
||||
"value": "",
|
||||
isRequired: false,
|
||||
|
@ -56,8 +56,6 @@ const setFormData = async (data: Record<any, any>) => {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
popupRef.value?.close()
|
||||
|
@ -122,5 +122,24 @@ const handleDelete = async (id: number | any[]) => {
|
||||
getLists()
|
||||
}
|
||||
|
||||
[
|
||||
{
|
||||
name: "假勤",
|
||||
children: [
|
||||
{
|
||||
name: "请假"
|
||||
},
|
||||
{
|
||||
name: "请假"
|
||||
},
|
||||
{
|
||||
name: "请假"
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
]
|
||||
|
||||
|
||||
getLists()
|
||||
</script>
|
@ -8,7 +8,6 @@
|
||||
<reciveReport></reciveReport>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
@ -24,3 +23,4 @@ const activeName = ref('first')
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user