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