zmj 27713a1295 根据以上 git diff 信息,我们可以生成以下 commit message:
更新多个页面及组件,包括审批流程显示方式、人员选择器等。
2024-05-29 22:36:38 +08:00

148 lines
4.7 KiB
Vue

<template>
<div class="edit-popup">
<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> -->
</el-card>
<oaFlow :form-data="formData" :flow_cate="formData.id"></oaFlow>
</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"
import qj from './form/jq/qj.vue'
import cc from './form/jq/cc.vue'
import wc from './form/jq/wc.vue'
import jb from './form/jq/jb.vue'
import hysyd from './form/xz/hysyd.vue'
import gwlz from './form/xz/gwlz.vue'
import wpwx from './form/xz/wpwx.vue'
import zzjy from './form/xz/zzjy.vue'
import yz from './form/xz/yz.vue'
import yc from './form/xz/yc.vue'
import ycgh from './form/xz/ycgh.vue'
import jk from './form/cw/jk.vue'
import fk from './form/cw/fk.vue'
import jl from './form/cw/jl.vue'
import cg from './form/cw/cg.vue'
import hdjf from './form/cw/hdjf.vue'
import rz from './form/rs/rz.vue'
import zz from './form/rs/zz.vue'
import lz from './form/rs/lz.vue'
import zg from './form/rs/zg.vue'
import zpxq from './form/rs/zpxq.vue'
import tysp from './form/qt/tysp.vue'
let props = 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(() => {
return "新增审批"
});
// 表单数据
const formData = reactive({
id: 0,
data: [],
extends: {}
});
// 表单验证
const formRules = reactive<any>({
type: [
{
required: true,
message: "请输入所属分类",
trigger: ["blur"],
},
]
});
// 获取详情
const setFormData = async (data: Record<any, any>) => {
formData.data = data.data;
formData.id = data.id;
};
// 获取详情
const setExtend = async (data: Record<any, any>) => {
extend.value = data
};
// 提交按钮
const handleSubmit = async () => {
await forms.value?.check();
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,
setExtend
});
</script>