增加了一些代码和功能,包括对oa_Initiate的修改和oa_flow_type的编辑和索引页面的修改。
This commit is contained in:
parent
68a5db5933
commit
868d6fc726
@ -1,30 +1,4 @@
|
||||
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 });
|
||||
@ -49,3 +23,7 @@ export function apiOaoaApproveCopy(params: any) {
|
||||
export function apiOaoaApprovelst(params: any) {
|
||||
return request.get({ url: "/works.bgsp.oa_approve/lst", params });
|
||||
}
|
||||
|
||||
export function apiOaoaApproveCheck(params: any) {
|
||||
return request.post({ url: "/works.bgsp.oa_approve/check", params });
|
||||
}
|
||||
|
@ -10,14 +10,17 @@
|
||||
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">
|
||||
<el-select v-model="formData[item.value].value" :placeholder="'请选择' + item.label" class="flex-1">
|
||||
<el-select @change="selectChange(item.value)" 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">
|
||||
<el-input v-model="formData[item.value].value" readonly :placeholder="'点击选择' + item.label"
|
||||
<el-input v-model="formData[item.value].text" readonly :placeholder="'点击选择' + item.label"
|
||||
@click="userclick(item.value)" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="item.label" v-if="item.type == 4">
|
||||
@ -36,7 +39,7 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup >
|
||||
<script setup>
|
||||
import uploadAnnex from './../uploadAnnex/index.vue'
|
||||
import { ref, reactive } from 'vue'
|
||||
import { deptLists } from "@/api/org/department";
|
||||
@ -75,19 +78,23 @@ const userclick = async (val) => {
|
||||
personnel.value.open()
|
||||
}
|
||||
const submituser = (e) => {
|
||||
props.formData[value + '_name'] = e.name
|
||||
props.formData[value] = e.id
|
||||
props.formData[value].text = e.name
|
||||
props.formData[value].value = e.id
|
||||
showPerDialog.value = false
|
||||
}
|
||||
|
||||
const selectChange = (lab) => {
|
||||
props.formData[lab].text = deptList.value.find(item => item.id === props.formData[lab].value).name
|
||||
}
|
||||
|
||||
const setKey = () => {
|
||||
props.config.forEach(item => {
|
||||
props.formData[item.value] = {
|
||||
name: item.label,
|
||||
value: ""
|
||||
label: item.label,
|
||||
value: "",
|
||||
text: ""
|
||||
}
|
||||
})
|
||||
console.log(props.formData, 'formData');
|
||||
}
|
||||
setKey()
|
||||
</script>
|
@ -1,68 +1,105 @@
|
||||
<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>
|
||||
<el-card>
|
||||
<template #header> 审批流程 </template>
|
||||
<el-form ref="formRef" :model="formData" label-width="100px" :rules="formRules">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="审批流程">
|
||||
<el-select v-model="formData.flow_id" placeholder="选择审批流程" class="flex-1" @change="flowChnage">
|
||||
<el-option :label="item.name" :value="item.id" v-for="item in flowList">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12" v-if="checkType == 2">
|
||||
<el-form-item label="审核人" prop="name">
|
||||
<el-input v-model="formData.check_admin_names" clearable placeholder="点击选择审核人" readonly
|
||||
@click="userclick(1)" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col v-else style="max-height: 400px;min-height: 200px;">
|
||||
<el-steps direction="vertical" :active="0">
|
||||
<el-step :title="i + 1 + '级审核' + `(${flowTypeToText(items.flow_type)})`"
|
||||
:description="items.flow_user_names" v-for="(items, i) in flowListPer" />
|
||||
</el-steps>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="抄送人">
|
||||
<el-input v-model="formData.copy_names" clearable placeholder="点击选择抄送人" readonly
|
||||
@click="userclick(2)" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div v-if="showPerDialog">
|
||||
<personnelselector ref="personnel" @confirm="submituser" :type="perType">
|
||||
</personnelselector>
|
||||
</div>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</template>
|
||||
<script setup>
|
||||
import { reactive, ref, defineProps } from 'vue'
|
||||
import { apiOaFlowLists } from '@/api/oa_flow'
|
||||
import { ref, defineProps } from "vue";
|
||||
import { apiOaFlowLists, apiOaFlowDetail } from "@/api/oa_flow";
|
||||
|
||||
const props = defineProps({
|
||||
formData: {
|
||||
type: Object,
|
||||
required: true
|
||||
required: true,
|
||||
},
|
||||
})
|
||||
});
|
||||
|
||||
const showPerDialog = ref(false);
|
||||
const personnel = ref(null);
|
||||
const perType = ref(2); //人员选择器1为单选2为多选
|
||||
|
||||
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 userclick = async (type) => {
|
||||
perType.value = type;
|
||||
showPerDialog.value = true;
|
||||
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
|
||||
}
|
||||
if (perType.value == 1) {
|
||||
props.formData.check_admin_names = e.name;
|
||||
props.formData.check_admin_ids = e.id;
|
||||
} else {
|
||||
props.formData.copy_names = e.map((item) => item.name).join(",");
|
||||
props.formData.copy_ids = e.map((item) => item.id).join(",");
|
||||
}
|
||||
showPerDialog.value = false;
|
||||
};
|
||||
|
||||
|
||||
const flowList = ref([])
|
||||
const flowList = ref([]);
|
||||
const getFlowList = async () => {
|
||||
const res = await apiOaFlowLists()
|
||||
flowList.value = res.lists
|
||||
// 根据id筛选审批流程列表
|
||||
const res = await apiOaFlowLists();
|
||||
flowList.value = res.lists;
|
||||
};
|
||||
getFlowList();
|
||||
|
||||
// 根据选择的流程类型展示固定审批流与非固定审批流的审批流程人员
|
||||
const checkType = ref(2);
|
||||
const flowListPer = ref([]); //非固定审批流的审批流程人员
|
||||
|
||||
const flowChnage = async (e) => {
|
||||
const flow = flowList.value.find((item) => item.id === e);
|
||||
checkType.value = flow.check_type;
|
||||
if (flow.check_type != 2) {
|
||||
let res = await apiOaFlowDetail({ id: flow.id });
|
||||
flowListPer.value = res.flow_list;
|
||||
console.log(res);
|
||||
}
|
||||
};
|
||||
|
||||
const flowTypeToText = (type) => {
|
||||
console.log(type, "type")
|
||||
if (type == 1) return '当前部门负责人';
|
||||
if (type == 2) return '或签';
|
||||
if (type == 3) return '会签';
|
||||
}
|
||||
getFlowList()
|
||||
|
||||
|
||||
</script>
|
||||
</script>
|
||||
|
@ -1,168 +1,170 @@
|
||||
import { defineStore } from 'pinia'
|
||||
import { isExternal } from '@/utils/validate'
|
||||
import { defineStore } from "pinia";
|
||||
import { isExternal } from "@/utils/validate";
|
||||
import type {
|
||||
LocationQuery,
|
||||
RouteLocationNormalized,
|
||||
RouteParamsRaw,
|
||||
Router,
|
||||
RouteRecordName
|
||||
} from 'vue-router'
|
||||
import { PageEnum } from '@/enums/pageEnum'
|
||||
LocationQuery,
|
||||
RouteLocationNormalized,
|
||||
RouteParamsRaw,
|
||||
Router,
|
||||
RouteRecordName,
|
||||
} from "vue-router";
|
||||
import { PageEnum } from "@/enums/pageEnum";
|
||||
|
||||
interface TabItem {
|
||||
name: RouteRecordName
|
||||
fullPath: string
|
||||
path: string
|
||||
title?: string
|
||||
query?: LocationQuery
|
||||
params?: RouteParamsRaw
|
||||
name: RouteRecordName;
|
||||
fullPath: string;
|
||||
path: string;
|
||||
title?: string;
|
||||
query?: LocationQuery;
|
||||
params?: RouteParamsRaw;
|
||||
}
|
||||
|
||||
interface TabsSate {
|
||||
cacheTabList: Set<string>
|
||||
tabList: TabItem[]
|
||||
tasMap: Record<string, TabItem>
|
||||
indexRouteName: RouteRecordName
|
||||
cacheTabList: Set<string>;
|
||||
tabList: TabItem[];
|
||||
tasMap: Record<string, TabItem>;
|
||||
indexRouteName: RouteRecordName;
|
||||
}
|
||||
|
||||
const getHasTabIndex = (fullPath: string, tabList: TabItem[]) => {
|
||||
return tabList.findIndex((item) => item.fullPath == fullPath)
|
||||
}
|
||||
return tabList.findIndex((item) => item.fullPath == fullPath);
|
||||
};
|
||||
|
||||
const isCannotAddRoute = (route: RouteLocationNormalized, router: Router) => {
|
||||
const { path, meta, name } = route
|
||||
if (!path || isExternal(path)) return true
|
||||
if (meta?.hideTab) return true
|
||||
if (!router.hasRoute(name!)) return true
|
||||
if (([PageEnum.LOGIN, PageEnum.ERROR_403] as string[]).includes(path)) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
const { path, meta, name } = route;
|
||||
if (!path || isExternal(path)) return true;
|
||||
if (meta?.hideTab) return true;
|
||||
if (!router.hasRoute(name!)) return true;
|
||||
if (([PageEnum.LOGIN, PageEnum.ERROR_403] as string[]).includes(path)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
const findTabsIndex = (fullPath: string, tabList: TabItem[]) => {
|
||||
return tabList.findIndex((item) => item.fullPath === fullPath)
|
||||
}
|
||||
return tabList.findIndex((item) => item.fullPath === fullPath);
|
||||
};
|
||||
|
||||
const getComponentName = (route: RouteLocationNormalized) => {
|
||||
return route.matched.at(-1)?.components?.default?.name
|
||||
}
|
||||
// return route.matched.at(-1)?.components?.default?.name || null;
|
||||
};
|
||||
|
||||
export const getRouteParams = (tabItem: TabItem) => {
|
||||
const { params, path, query } = tabItem
|
||||
return {
|
||||
params: params || {},
|
||||
path,
|
||||
query: query || {}
|
||||
}
|
||||
}
|
||||
const { params, path, query } = tabItem;
|
||||
return {
|
||||
params: params || {},
|
||||
path,
|
||||
query: query || {},
|
||||
};
|
||||
};
|
||||
|
||||
const useTabsStore = defineStore({
|
||||
id: 'tabs',
|
||||
state: (): TabsSate => ({
|
||||
cacheTabList: new Set(),
|
||||
tabList: [],
|
||||
tasMap: {},
|
||||
indexRouteName: ''
|
||||
}),
|
||||
getters: {
|
||||
getTabList(): TabItem[] {
|
||||
return this.tabList
|
||||
},
|
||||
getCacheTabList(): string[] {
|
||||
return Array.from(this.cacheTabList)
|
||||
}
|
||||
id: "tabs",
|
||||
state: (): TabsSate => ({
|
||||
cacheTabList: new Set(),
|
||||
tabList: [],
|
||||
tasMap: {},
|
||||
indexRouteName: "",
|
||||
}),
|
||||
getters: {
|
||||
getTabList(): TabItem[] {
|
||||
return this.tabList;
|
||||
},
|
||||
actions: {
|
||||
setRouteName(name: RouteRecordName) {
|
||||
this.indexRouteName = name
|
||||
},
|
||||
addCache(componentName?: string) {
|
||||
if (componentName) this.cacheTabList.add(componentName)
|
||||
},
|
||||
removeCache(componentName?: string) {
|
||||
if (componentName && this.cacheTabList.has(componentName)) {
|
||||
this.cacheTabList.delete(componentName)
|
||||
}
|
||||
},
|
||||
clearCache() {
|
||||
this.cacheTabList.clear()
|
||||
},
|
||||
resetState() {
|
||||
this.cacheTabList = new Set()
|
||||
this.tabList = []
|
||||
this.tasMap = {}
|
||||
this.indexRouteName = ''
|
||||
},
|
||||
addTab(router: Router) {
|
||||
const route = unref(router.currentRoute)
|
||||
const { name, query, meta, params, fullPath, path } = route
|
||||
if (isCannotAddRoute(route, router)) return
|
||||
const hasTabIndex = getHasTabIndex(fullPath!, this.tabList)
|
||||
const componentName = getComponentName(route)
|
||||
const tabItem = {
|
||||
name: name!,
|
||||
path,
|
||||
fullPath,
|
||||
title: meta?.title,
|
||||
query,
|
||||
params
|
||||
}
|
||||
this.tasMap[fullPath] = tabItem
|
||||
if (meta?.keepAlive) {
|
||||
this.addCache(componentName)
|
||||
}
|
||||
if (hasTabIndex != -1) {
|
||||
return
|
||||
}
|
||||
getCacheTabList(): string[] {
|
||||
return Array.from(this.cacheTabList);
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
setRouteName(name: RouteRecordName) {
|
||||
this.indexRouteName = name;
|
||||
},
|
||||
addCache(componentName?: string) {
|
||||
if (componentName) this.cacheTabList.add(componentName);
|
||||
},
|
||||
removeCache(componentName?: string) {
|
||||
if (componentName && this.cacheTabList.has(componentName)) {
|
||||
this.cacheTabList.delete(componentName);
|
||||
}
|
||||
},
|
||||
clearCache() {
|
||||
this.cacheTabList.clear();
|
||||
},
|
||||
resetState() {
|
||||
this.cacheTabList = new Set();
|
||||
this.tabList = [];
|
||||
this.tasMap = {};
|
||||
this.indexRouteName = "";
|
||||
},
|
||||
addTab(router: Router) {
|
||||
const route = unref(router.currentRoute);
|
||||
const { name, query, meta, params, fullPath, path } = route;
|
||||
if (isCannotAddRoute(route, router)) return;
|
||||
const hasTabIndex = getHasTabIndex(fullPath!, this.tabList);
|
||||
const componentName = getComponentName(route);
|
||||
const tabItem = {
|
||||
name: name!,
|
||||
path,
|
||||
fullPath,
|
||||
title: meta?.title,
|
||||
query,
|
||||
params,
|
||||
};
|
||||
this.tasMap[fullPath] = tabItem;
|
||||
if (meta?.keepAlive) {
|
||||
this.addCache(componentName);
|
||||
}
|
||||
if (hasTabIndex != -1) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.tabList.push(tabItem)
|
||||
},
|
||||
removeTab(fullPath: string, router: Router) {
|
||||
const { currentRoute, push } = router
|
||||
const index = findTabsIndex(fullPath, this.tabList)
|
||||
// 移除tab
|
||||
if (this.tabList.length > 1) {
|
||||
index !== -1 && this.tabList.splice(index, 1)
|
||||
}
|
||||
const componentName = getComponentName(currentRoute.value)
|
||||
this.removeCache(componentName)
|
||||
if (fullPath !== currentRoute.value.fullPath) {
|
||||
return
|
||||
}
|
||||
// 删除选中的tab
|
||||
let toTab: TabItem | null = null
|
||||
this.tabList.push(tabItem);
|
||||
},
|
||||
removeTab(fullPath: string, router: Router) {
|
||||
const { currentRoute, push } = router;
|
||||
const index = findTabsIndex(fullPath, this.tabList);
|
||||
// 移除tab
|
||||
if (this.tabList.length > 1) {
|
||||
index !== -1 && this.tabList.splice(index, 1);
|
||||
}
|
||||
const componentName = getComponentName(currentRoute.value);
|
||||
this.removeCache(componentName);
|
||||
if (fullPath !== currentRoute.value.fullPath) {
|
||||
return;
|
||||
}
|
||||
// 删除选中的tab
|
||||
let toTab: TabItem | null = null;
|
||||
|
||||
if (index === 0) {
|
||||
toTab = this.tabList[index]
|
||||
} else {
|
||||
toTab = this.tabList[index - 1]
|
||||
}
|
||||
if (index === 0) {
|
||||
toTab = this.tabList[index];
|
||||
} else {
|
||||
toTab = this.tabList[index - 1];
|
||||
}
|
||||
|
||||
const toRoute = getRouteParams(toTab)
|
||||
push(toRoute)
|
||||
},
|
||||
removeOtherTab(route: RouteLocationNormalized) {
|
||||
this.tabList = this.tabList.filter((item) => item.fullPath == route.fullPath)
|
||||
const componentName = getComponentName(route)
|
||||
this.cacheTabList.forEach((name) => {
|
||||
if (componentName !== name) {
|
||||
this.removeCache(name)
|
||||
}
|
||||
})
|
||||
},
|
||||
removeAllTab(router: Router) {
|
||||
const { push, currentRoute } = router
|
||||
const { name } = unref(currentRoute)
|
||||
if (name == this.indexRouteName) {
|
||||
this.removeOtherTab(currentRoute.value)
|
||||
return
|
||||
}
|
||||
this.tabList = []
|
||||
this.clearCache()
|
||||
push(PageEnum.INDEX)
|
||||
const toRoute = getRouteParams(toTab);
|
||||
push(toRoute);
|
||||
},
|
||||
removeOtherTab(route: RouteLocationNormalized) {
|
||||
this.tabList = this.tabList.filter(
|
||||
(item) => item.fullPath == route.fullPath
|
||||
);
|
||||
const componentName = getComponentName(route);
|
||||
this.cacheTabList.forEach((name) => {
|
||||
if (componentName !== name) {
|
||||
this.removeCache(name);
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
},
|
||||
removeAllTab(router: Router) {
|
||||
const { push, currentRoute } = router;
|
||||
const { name } = unref(currentRoute);
|
||||
if (name == this.indexRouteName) {
|
||||
this.removeOtherTab(currentRoute.value);
|
||||
return;
|
||||
}
|
||||
this.tabList = [];
|
||||
this.clearCache();
|
||||
push(PageEnum.INDEX);
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
export default useTabsStore
|
||||
export default useTabsStore;
|
||||
|
@ -1,40 +1,87 @@
|
||||
<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 ref="popupRef" :showFootBtn="false" title="审批详情" :async="true" width="60vw">
|
||||
<el-card>
|
||||
<template #header>审批内容</template>
|
||||
<el-descriptions :column="3" border>
|
||||
<el-descriptions-item v-for="item in formData.extends" :label="item.label" label-align="left"
|
||||
align="left">
|
||||
{{ item.text || item.value }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
<el-card>
|
||||
<template #header>审批流程</template>
|
||||
<el-descriptions :column="3" border>
|
||||
<el-descriptions-item label="审批状态" label-align="left" align="left">
|
||||
{{ formData.check_status_text }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="当前审核人" label-align="left" align="left">
|
||||
{{ formData.check_admin_users }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="抄送人" label-align="left" align="left">
|
||||
{{ formData.copy_users }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-descriptions :column="1" border>
|
||||
<el-descriptions-item label="审批流程" label-align="left" align="left">
|
||||
审批流程
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="审批记录" label-align="left" align="left">
|
||||
审批记录
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="审批节点" label-align="left" align="left">
|
||||
<div class="flex" style="position: relative;">
|
||||
<el-radio-group v-model="form.check_node">
|
||||
<el-radio :label="1">审批结束</el-radio>
|
||||
<el-radio :label="2">下一审批人</el-radio>
|
||||
</el-radio-group>
|
||||
<div class="w-280[px]" style="position: absolute;left:250px">
|
||||
<el-input v-show="form.check_node == 2" v-model="form.check_admin_names"
|
||||
placeholder="点击选择下一审批人" clearable readonly @click="userclick" />
|
||||
</div>
|
||||
</div>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="审批意见" label-align="left" align="left">
|
||||
<el-input type="textarea" v-model="form.content"></el-input>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="操作" label-align="left" align="left">
|
||||
<el-button type="primary" @click="form.check = 1, handCheck()">
|
||||
通过
|
||||
</el-button>
|
||||
<el-button @click="form.check = 2, handCheck()">
|
||||
拒绝
|
||||
</el-button>
|
||||
<el-button type="info" @click="form.check = 3, handCheck()">
|
||||
撤回
|
||||
</el-button>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
<div v-if="showPerDialog">
|
||||
<personnelselector ref="personnel" @confirm="submituser" type="1">
|
||||
</personnelselector>
|
||||
</div>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="customdetail">
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import type { PropType } from 'vue'
|
||||
import { apiOaoaApproveCheck } from "@/api/oa_initiate"
|
||||
import useUserStore from "@/stores/modules/user";
|
||||
|
||||
|
||||
const emit = defineEmits(['close'])
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
const showPerDialog = ref(false);
|
||||
const personnel = ref(null);
|
||||
const userStore = useUserStore().userInfo;
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
|
||||
id: 0,
|
||||
extends: {}
|
||||
})
|
||||
|
||||
// 获取详情
|
||||
@ -45,27 +92,54 @@ const setFormData = async (data: Record<any, any>) => {
|
||||
formData[key] = data[key]
|
||||
}
|
||||
}
|
||||
console.log(formData, 'formData')
|
||||
}
|
||||
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
popupRef.value?.close()
|
||||
const form = reactive({
|
||||
"id": formData.id,
|
||||
"check": '',
|
||||
"content": "",
|
||||
"check_node": 1,
|
||||
"check_admin_ids": '',
|
||||
check_admin_names: ""
|
||||
})
|
||||
|
||||
|
||||
const userclick = async (type) => {
|
||||
showPerDialog.value = true;
|
||||
await nextTick();
|
||||
personnel.value.open();
|
||||
};
|
||||
|
||||
const submituser = (e) => {
|
||||
form.check_admin_names = e.name;
|
||||
form.check_admin_ids = e.id;
|
||||
showPerDialog.value = false;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
//打开弹窗
|
||||
const open = () => {
|
||||
popupRef.value?.open()
|
||||
}
|
||||
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
popupRef.value?.close()
|
||||
}
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
|
||||
// 审批
|
||||
const handCheck = async () => {
|
||||
const res = await apiOaoaApproveCheck({ ...form })
|
||||
handleClose()
|
||||
}
|
||||
|
||||
|
||||
|
||||
defineExpose({
|
||||
@ -73,4 +147,3 @@ defineExpose({
|
||||
setFormData,
|
||||
})
|
||||
</script>
|
||||
|
||||
|
@ -1,18 +1,14 @@
|
||||
<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>
|
||||
<generateForm :config="formData.data" :form-data="formData.extends"></generateForm>
|
||||
</el-card>
|
||||
<el-card>
|
||||
<template #header>
|
||||
审批流程
|
||||
</template>
|
||||
<oaFlow :form-data="formData"></oaFlow>
|
||||
</el-card>
|
||||
<oaFlow :form-data="formData"></oaFlow>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
@ -61,7 +57,6 @@ const setFormData = async (data: Record<any, any>) => {
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
console.log(formData)
|
||||
await formRef.value?.validate();
|
||||
const data = { ...formData };
|
||||
await apiOaoaApproveAdd(data)
|
||||
|
@ -1,6 +1,7 @@
|
||||
<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-form ref="formRef" :model="formData" label-width="90px" :rules="formRules">
|
||||
<el-card>
|
||||
<template #header>
|
||||
@ -10,8 +11,8 @@
|
||||
<el-col :span="8">
|
||||
<el-form-item label="所属分类" prop="type">
|
||||
<el-select v-model="formData.type" clearable placeholder="请选择所属分类" class="flex-1">
|
||||
<el-option v-for="item in dictData.oa_approve_cate" :key="item.value" :label="item.name"
|
||||
:value="parseInt(item.value)" />
|
||||
<el-option v-for="item in dictData.oa_approve_cate" :key="item.value"
|
||||
:label="item.name" :value="parseInt(item.value)" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@ -32,7 +33,8 @@
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="应用部门">
|
||||
<el-select v-model="formData.department_ids" multiple placeholder="请选择应用部门" class="flex-1">
|
||||
<el-select v-model="formData.department_ids" multiple placeholder="请选择应用部门"
|
||||
class="flex-1">
|
||||
<el-option :label="item.name" :value="parseInt(item.id)" v-for="item in deptList">
|
||||
</el-option>
|
||||
</el-select>
|
||||
@ -70,11 +72,6 @@
|
||||
<el-input v-model="item.label" clearable placeholder="请输入名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="4">
|
||||
<el-form-item label="是否必填">
|
||||
<el-switch v-model="item.isRequired"></el-switch>
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
<el-col :span="4">
|
||||
<el-button @click="formData.data.splice(index, 1)">
|
||||
删除
|
||||
@ -203,24 +200,15 @@ 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": '',
|
||||
"label": "",
|
||||
"value": "",
|
||||
isRequired: false,
|
||||
})
|
||||
}
|
||||
|
||||
@ -231,6 +219,9 @@ const handleSubmit = async () => {
|
||||
await formRef.value?.validate();
|
||||
const data = { ...formData };
|
||||
data.department_ids = data.department_ids.join(",");
|
||||
data.data.forEach((item: any) => {
|
||||
item.value = Pinyin.getCamelChars(item.label)
|
||||
});
|
||||
mode.value == "edit"
|
||||
? await apiOaFlowTypeEdit(data)
|
||||
: await apiOaFlowTypeAdd(data);
|
||||
|
@ -141,23 +141,6 @@ const getDeptList = async () => {
|
||||
deptList.value = res.lists
|
||||
}
|
||||
|
||||
const coverIcon = () => {
|
||||
|
||||
|
||||
let dom = document.getElementById('test0')
|
||||
dom.innerHTML = ' <Loading />'
|
||||
console.log(dom)
|
||||
|
||||
}
|
||||
|
||||
|
||||
onMounted(() => {
|
||||
setTimeout(() => {
|
||||
// coverIcon()
|
||||
}, 2000)
|
||||
|
||||
})
|
||||
|
||||
|
||||
getDeptList()
|
||||
getLists()
|
||||
|
Loading…
x
Reference in New Issue
Block a user