This commit is contained in:
zmj 2024-05-30 09:58:05 +08:00
parent 802fa15268
commit 048380d297
5 changed files with 73 additions and 97 deletions
src
components/generateForm
views
oa_Initiate
oa_flow_type
oa_message

@ -113,6 +113,6 @@ const setKey = () => {
})
}
}
setKey()
setKey()
</script>

@ -4,13 +4,12 @@
<el-card>
<template #header>审批内容</template>
<el-descriptions :column="3" border>
<el-descriptions-item v-for="(item,value) in fromValue" :label="item" label-align="left"
align="left">
{{formData.extends[value]}}
<el-descriptions-item v-for="(item, value) in fromValue" :label="item" label-align="left" align="left">
{{ formData.extends[value] }}
</el-descriptions-item>
</el-descriptions>
<el-descriptions :column="1" border v-if='formData.extends?.annex'>
<el-descriptions-item label="附件" label-align="left" align="left">
<el-descriptions-item label="附件" label-align="left" align="left">
<annexLink :annex='formData.extends.annex'></annexLink>
</el-descriptions-item>
</el-descriptions>
@ -113,8 +112,7 @@ import { apiOaoaApproveCheck } from "@/api/oa_initiate"
import useUserStore from "@/stores/modules/user";
import { Clock } from '@element-plus/icons-vue'
import feedback from './../../utils/feedback'
import {ref,reactive} from "vue"
import { ref, reactive } from "vue"
import qja from './form/jq/qja.js'
import cca from './form/jq/cca.js'
import wca from './form/jq/wca.js'
@ -137,42 +135,11 @@ import lza from './form/rs/lza.js'
import zga from './form/rs/zga.js'
import zpxqa from './form/rs/zpxqa.js'
import tyspa from './form/qt/tyspa.js'
let props = defineProps({
typeName: {
type: String,
}
})
let fromValue=ref({})
const getFormValue=()=>{
if(props.typeName=='请假')fromValue.value=qja;
if(props.typeName=='出差')fromValue.value=cca;
if(props.typeName=='外出')fromValue.value=wca;
if(props.typeName=='加班')fromValue.value=jba;
if(props.typeName=='会议室预定')fromValue.value=hysyda;
if(props.typeName=='公文流转')fromValue.value=gwlza;
if(props.typeName=='物品维修')fromValue.value=wpwxa;
if(props.typeName=='资质借用')fromValue.value=zzjya;
if(props.typeName=='用章')fromValue.value=yza;
if(props.typeName=='用车')fromValue.value=yca;
if(props.typeName=='用车归还')fromValue.value=ycgha;
if(props.typeName=='借款')fromValue.value=jka;
if(props.typeName=='付款')fromValue.value=fka;
if(props.typeName=='奖励')fromValue.value=cga;
if(props.typeName=='采购')fromValue.value=qja;
if(props.typeName=='活动经费')fromValue.value=hdjfa;
if(props.typeName=='入职')fromValue.value=rza;
if(props.typeName=='转正')fromValue.value=zza;
if(props.typeName=='离职')fromValue.value=lza;
if(props.typeName=='转岗')fromValue.value=zga;
if(props.typeName=='招聘需求')fromValue.value=zpxqa;
if(props.typeName=='通用审批')fromValue.value=tyspa;
}
getFormValue()
const emit = defineEmits(['close', 'reEdit'])
const popupRef = shallowRef<InstanceType<typeof Popup>>()
const showPerDialog = ref(false);
@ -180,6 +147,35 @@ const personnel = ref(null);
const userStore = useUserStore().userInfo;
const showBackDialog = ref(false)
let fromValue = ref({})
const getFormValue = () => {
if (props.typeName == '请假') fromValue.value = qja;
if (props.typeName == '出差') fromValue.value = cca;
if (props.typeName == '外出') fromValue.value = wca;
if (props.typeName == '加班') fromValue.value = jba;
if (props.typeName == '会议室预定') fromValue.value = hysyda;
if (props.typeName == '公文流转') fromValue.value = gwlza;
if (props.typeName == '物品维修') fromValue.value = wpwxa;
if (props.typeName == '资质借用') fromValue.value = zzjya;
if (props.typeName == '用章') fromValue.value = yza;
if (props.typeName == '用车') fromValue.value = yca;
if (props.typeName == '用车归还') fromValue.value = ycgha;
if (props.typeName == '借款') fromValue.value = jka;
if (props.typeName == '付款') fromValue.value = fka;
if (props.typeName == '奖励') fromValue.value = jla;
if (props.typeName == '采购') fromValue.value = cga;
if (props.typeName == '活动经费') fromValue.value = hdjfa;
if (props.typeName == '入职') fromValue.value = rza;
if (props.typeName == '转正') fromValue.value = zza;
if (props.typeName == '离职') fromValue.value = lza;
if (props.typeName == '转岗') fromValue.value = zga;
if (props.typeName == '招聘需求') fromValue.value = zpxqa;
if (props.typeName == '通用审批') fromValue.value = tyspa;
}
getFormValue()
//
const formData = reactive({
id: 0,
@ -238,7 +234,6 @@ const flowTypeToText = (type, item) => {
if (type == 4) return item.user_id_info[0].name;
}
const findActive = () => {
let index = formData.steps.findIndex(item => { return item.sort == formData.check_step_sort })
return index
@ -249,9 +244,8 @@ const handleClose = () => {
emit('close')
}
const hdClose=()=>{
const hdClose = () => {
emit('close')
}
@ -269,7 +263,6 @@ const handCheck = async () => {
//
const showActionList = reactive([4, 3, 2])
const showTextarea = () => {
if (showActionList.includes(formData.check_status)) return false;
if (formData.admin_id == userStore.id) return true;
@ -285,7 +278,7 @@ const showTextarea = () => {
//
const reEdit = () => {
emit('reEdit', { extends: formData.extends,typeName:props.typeName,cate:formData.flow_info.flow_cate })
emit('reEdit', { extends: formData.extends, typeName: props.typeName, cate: formData.flow_info.flow_cate })
}
defineExpose({

@ -1,36 +1,33 @@
<template>
<div class="edit-popup">
<popup ref="popupRef" :title="popupTitle" :async="true" width="60vw" @confirm="handleSubmit"
@close="handleClose">
<popup ref="popupRef" :title="popupTitle" :async="true" width="60vw" @confirm="handleSubmit" @close="handleClose">
<el-card>
<template #header>
审批内容
</template>
<qj :formData=formData.extends ref="forms" v-if="type == '请假'"></qj>
<cc ref="forms" :formData=formData.extends v-if="type == '出差'"></cc>
<wc ref="forms" :formData=formData.extends v-if="type == '外出'"></wc>
<jb ref="forms" :formData=formData.extends v-if="type == '加班'"></jb>
<hysyd ref="forms" :formData=formData.extends v-if="type == '会议室预定'"></hysyd>
<gwlz ref="forms" :formData=formData.extends v-if="type == '公文流转'"></gwlz>
<wpwx ref="forms" :formData=formData.extends v-if="type == '物品维修'"></wpwx>
<zzjy ref="forms" :formData=formData.extends v-if="type == '资质借用'"></zzjy>
<yz ref="forms" :formData=formData.extends v-if="type == '用章'"></yz>
<yc ref="forms" :formData=formData.extends v-if="type == '用车'"></yc>
<ycgh ref="forms" :formData=formData.extends v-if="type == '用车归还'"></ycgh>
<jk ref="forms" :formData=formData.extends v-if="type == '借款'"></jk>
<fk ref="forms" :formData=formData.extends v-if="type == '付款'"></fk>
<jl ref="forms" :formData=formData.extends v-if="type == '奖励'"></jl>
<cg ref="forms" :formData=formData.extends v-if="type == '采购'"></cg>
<hdjf ref="forms" :formData=formData.extends v-if="type == '活动经费'"></hdjf>
<rz ref="forms" :formData=formData.extends v-if="type == '入职'"></rz>
<zz ref="forms" :formData=formData.extends v-if="type == '转正'"></zz>
<lz ref="forms" :formData=formData.extends v-if="type == '离职'"></lz>
<zg ref="forms" :formData=formData.extends v-if="type == '转岗'"></zg>
<zpxq ref="forms" :formData=formData.extends v-if="type == '招聘需求'"></zpxq>
<tysp ref="forms" :formData=formData.extends v-if="type == '通用审批'"></tysp>
<!-- <generateForm></generateForm> -->
<cc ref="forms" :formData=formData.extends v-else-if="type == '出差'"></cc>
<wc ref="forms" :formData=formData.extends v-else-if="type == '外出'"></wc>
<jb ref="forms" :formData=formData.extends v-else-if="type == '加班'"></jb>
<hysyd ref="forms" :formData=formData.extends v-else-if="type == '会议室预定'"></hysyd>
<gwlz ref="forms" :formData=formData.extends v-else-if="type == '公文流转'"></gwlz>
<wpwx ref="forms" :formData=formData.extends v-else-if="type == '物品维修'"></wpwx>
<zzjy ref="forms" :formData=formData.extends v-else-if="type == '资质借用'"></zzjy>
<yz ref="forms" :formData=formData.extends v-else-if="type == '用章'"></yz>
<yc ref="forms" :formData=formData.extends v-else-if="type == '用车'"></yc>
<ycgh ref="forms" :formData=formData.extends v-else-if="type == '用车归还'"></ycgh>
<jk ref="forms" :formData=formData.extends v-else-if="type == '借款'"></jk>
<fk ref="forms" :formData=formData.extends v-else-if="type == '付款'"></fk>
<jl ref="forms" :formData=formData.extends v-else-if="type == '奖励'"></jl>
<cg ref="forms" :formData=formData.extends v-else-if="type == '采购'"></cg>
<hdjf ref="forms" :formData=formData.extends v-else-if="type == '活动经费'"></hdjf>
<rz ref="forms" :formData=formData.extends v-else-if="type == '入职'"></rz>
<zz ref="forms" :formData=formData.extends v-else-if="type == '转正'"></zz>
<lz ref="forms" :formData=formData.extends v-else-if="type == '离职'"></lz>
<zg ref="forms" :formData=formData.extends v-else-if="type == '转岗'"></zg>
<zpxq ref="forms" :formData=formData.extends v-else-if="type == '招聘需求'"></zpxq>
<tysp ref="forms" :formData=formData.extends v-else-if="type == '通用审批'"></tysp>
<generateForm :config="formData.data" :formData="formData.extends" v-else></generateForm>
</el-card>
<oaFlow :form-data="formData" :flow_cate="formData.id"></oaFlow>
</popup>
@ -64,22 +61,16 @@ import zg from './form/rs/zg.vue'
import zpxq from './form/rs/zpxq.vue'
import tysp from './form/qt/tysp.vue'
let props = defineProps({
defineProps({
type: {
type: String,
}
})
const forms = ref('')
const emit = defineEmits(["success", "close"]);
const popupRef = shallowRef<InstanceType<typeof Popup>>();
const mode = ref("add");
const extend = ref({})
//
const popupTitle = computed(() => {
@ -94,16 +85,7 @@ const formData = reactive({
});
//
const formRules = reactive<any>({
type: [
{
required: true,
message: "请输入所属分类",
trigger: ["blur"],
},
]
});
//
const setFormData = async (data: Record<any, any>) => {
@ -113,14 +95,16 @@ const setFormData = async (data: Record<any, any>) => {
//
const setExtend = async (data: Record<any, any>) => {
formData.extends=data
formData.extends = data
};
//
const handleSubmit = async () => {
await forms.value?.check();
if (forms.value) {
await forms.value?.check();
}
const data = { ...formData };
await apiOaoaApproveAdd(data)
popupRef.value?.close();

@ -21,17 +21,16 @@
</el-form>
</el-card>
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
<!-- <el-button v-perms="['works.bgsp.oa_flow_type/add']" type="primary" @click="handleAdd">
<el-button v-perms="['works.bgsp.oa_flow_type/add']" type="primary" @click="handleAdd">
<template #icon>
<icon name="el-icon-Plus" />
</template>
新增
</el-button>
<el-button v-perms="['works.bgsp.oa_flow_type/delete']" :disabled="!selectData.length"
@click="handleDelete(selectData)">
删除
</el-button> -->
新增
</el-button>
<el-button v-perms="['works.bgsp.oa_flow_type/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" />

@ -25,7 +25,7 @@
<script lang="ts" setup name="oaMessageEdit">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { apiOaMessageAdd, apiOaMessageEdit, apiOaMessageDetail } from '@/api/oa_message'
import { apiOaMessageDetail } from '@/api/oa_message'
import { timeFormat } from '@/utils/util'
import type { PropType } from 'vue'
defineProps({