add 增加弹窗选人
This commit is contained in:
parent
18f89055e1
commit
0539fa3c1f
@ -19,6 +19,7 @@ export interface UserQuery extends PageQuery {
|
|||||||
status?: string;
|
status?: string;
|
||||||
deptId?: string | number;
|
deptId?: string | number;
|
||||||
roleId?: string | number;
|
roleId?: string | number;
|
||||||
|
userIds?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -178,3 +178,16 @@ export const currentTaskAllUser = (taskId: string | number) => {
|
|||||||
method: 'get'
|
method: 'get'
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取下一节点写
|
||||||
|
* @param data参数
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export const getNextNodeList = (data: any): any => {
|
||||||
|
return request({
|
||||||
|
url: '/workflow/task/getNextNodeList',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
};
|
||||||
|
@ -29,6 +29,7 @@ export interface FlowTaskVO {
|
|||||||
nodeType: number;
|
nodeType: number;
|
||||||
nodeRatio: string | number;
|
nodeRatio: string | number;
|
||||||
version?: string;
|
version?: string;
|
||||||
|
applyNode?: boolean;
|
||||||
buttonList?: buttonList[];
|
buttonList?: buttonList[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,6 +17,21 @@
|
|||||||
{{ user.nickName }}
|
{{ user.nickName }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item v-if="buttonObj.pop && nestNodeList && nestNodeList.length > 0" label="下一步审批人" prop="assigneeMap">
|
||||||
|
<div v-for="(item, index) in nestNodeList" :key="index" style="display: flex; justify-content: space-between; margin-bottom: 5px">
|
||||||
|
<div>
|
||||||
|
<span>【{{ item.nodeName }}】:</span>
|
||||||
|
<el-input v-if="false" v-model="form.assigneeMap[item.nodeCode]" />
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<el-input placeholder="请选择审批人" readonly>
|
||||||
|
<template v-slot:append>
|
||||||
|
<el-button @click="choosePeople(item)" icon="search">选择</el-button>
|
||||||
|
</template>
|
||||||
|
</el-input>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item v-if="task.flowStatus === 'waiting'" label="审批意见">
|
<el-form-item v-if="task.flowStatus === 'waiting'" label="审批意见">
|
||||||
<el-input v-model="form.message" type="textarea" resize="none" />
|
<el-input v-model="form.message" type="textarea" resize="none" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -68,6 +83,8 @@
|
|||||||
<UserSelect ref="delegateTaskRef" :multiple="false" @confirm-call-back="handleDelegateTask"></UserSelect>
|
<UserSelect ref="delegateTaskRef" :multiple="false" @confirm-call-back="handleDelegateTask"></UserSelect>
|
||||||
<!-- 加签组件 -->
|
<!-- 加签组件 -->
|
||||||
<UserSelect ref="multiInstanceUserRef" :multiple="true" @confirm-call-back="addMultiInstanceUser"></UserSelect>
|
<UserSelect ref="multiInstanceUserRef" :multiple="true" @confirm-call-back="addMultiInstanceUser"></UserSelect>
|
||||||
|
<!-- 弹窗选人 -->
|
||||||
|
<UserSelect ref="porUserRef" :multiple="true" :userIds="popUserIds" @confirm-call-back="handlePopUser"></UserSelect>
|
||||||
|
|
||||||
<!-- 驳回开始 -->
|
<!-- 驳回开始 -->
|
||||||
<el-dialog v-model="backVisible" draggable title="驳回" width="40%" :close-on-click-modal="false">
|
<el-dialog v-model="backVisible" draggable title="驳回" width="40%" :close-on-click-modal="false">
|
||||||
@ -123,7 +140,16 @@
|
|||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import { ComponentInternalInstance } from 'vue';
|
import { ComponentInternalInstance } from 'vue';
|
||||||
import { ElForm } from 'element-plus';
|
import { ElForm } from 'element-plus';
|
||||||
import { completeTask, backProcess, getTask, taskOperation, terminationTask, getBackTaskNode, currentTaskAllUser } from '@/api/workflow/task';
|
import {
|
||||||
|
completeTask,
|
||||||
|
backProcess,
|
||||||
|
getTask,
|
||||||
|
taskOperation,
|
||||||
|
terminationTask,
|
||||||
|
getBackTaskNode,
|
||||||
|
currentTaskAllUser,
|
||||||
|
getNextNodeList
|
||||||
|
} from '@/api/workflow/task';
|
||||||
import UserSelect from '@/components/UserSelect';
|
import UserSelect from '@/components/UserSelect';
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||||
@ -134,6 +160,7 @@ const userSelectCopyRef = ref<InstanceType<typeof UserSelect>>();
|
|||||||
const transferTaskRef = ref<InstanceType<typeof UserSelect>>();
|
const transferTaskRef = ref<InstanceType<typeof UserSelect>>();
|
||||||
const delegateTaskRef = ref<InstanceType<typeof UserSelect>>();
|
const delegateTaskRef = ref<InstanceType<typeof UserSelect>>();
|
||||||
const multiInstanceUserRef = ref<InstanceType<typeof UserSelect>>();
|
const multiInstanceUserRef = ref<InstanceType<typeof UserSelect>>();
|
||||||
|
const porUserRef = ref<InstanceType<typeof UserSelect>>();
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
taskVariables: {
|
taskVariables: {
|
||||||
@ -153,6 +180,8 @@ const selectCopyUserList = ref<UserVO[]>([]);
|
|||||||
const selectCopyUserIds = ref<string>(undefined);
|
const selectCopyUserIds = ref<string>(undefined);
|
||||||
//可减签的人员
|
//可减签的人员
|
||||||
const deleteUserList = ref<any>([]);
|
const deleteUserList = ref<any>([]);
|
||||||
|
//弹窗可选择的人员id
|
||||||
|
const popUserIds = ref<any>([]);
|
||||||
//驳回是否显示
|
//驳回是否显示
|
||||||
const backVisible = ref(false);
|
const backVisible = ref(false);
|
||||||
const backLoading = ref(true);
|
const backLoading = ref(true);
|
||||||
@ -163,6 +192,8 @@ const buttonObj = ref<any>({
|
|||||||
code: undefined,
|
code: undefined,
|
||||||
show: false
|
show: false
|
||||||
});
|
});
|
||||||
|
//下一节点列表
|
||||||
|
const nestNodeList = ref([]);
|
||||||
//任务
|
//任务
|
||||||
const task = ref<FlowTaskVO>({
|
const task = ref<FlowTaskVO>({
|
||||||
id: undefined,
|
id: undefined,
|
||||||
@ -181,6 +212,7 @@ const task = ref<FlowTaskVO>({
|
|||||||
formPath: undefined,
|
formPath: undefined,
|
||||||
nodeType: undefined,
|
nodeType: undefined,
|
||||||
nodeRatio: undefined,
|
nodeRatio: undefined,
|
||||||
|
applyNode: false,
|
||||||
buttonList: []
|
buttonList: []
|
||||||
});
|
});
|
||||||
const dialog = reactive<DialogOption>({
|
const dialog = reactive<DialogOption>({
|
||||||
@ -205,7 +237,7 @@ const backForm = ref<Record<string, any>>({
|
|||||||
});
|
});
|
||||||
|
|
||||||
//打开弹窗
|
//打开弹窗
|
||||||
const openDialog = (id?: string) => {
|
const openDialog = async (id?: string) => {
|
||||||
selectCopyUserIds.value = undefined;
|
selectCopyUserIds.value = undefined;
|
||||||
selectCopyUserList.value = [];
|
selectCopyUserList.value = [];
|
||||||
form.value.fileId = undefined;
|
form.value.fileId = undefined;
|
||||||
@ -214,17 +246,21 @@ const openDialog = (id?: string) => {
|
|||||||
dialog.visible = true;
|
dialog.visible = true;
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
buttonDisabled.value = true;
|
buttonDisabled.value = true;
|
||||||
nextTick(() => {
|
const response = await getTask(taskId.value);
|
||||||
getTask(taskId.value).then((response) => {
|
task.value = response.data;
|
||||||
task.value = response.data;
|
buttonObj.value = [];
|
||||||
buttonObj.value = [];
|
task.value.buttonList.forEach((e) => {
|
||||||
task.value.buttonList.forEach((e) => {
|
buttonObj.value[e.code] = e.show;
|
||||||
buttonObj.value[e.code] = e.show;
|
|
||||||
});
|
|
||||||
loading.value = false;
|
|
||||||
buttonDisabled.value = false;
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
buttonObj.value.applyNode = task.value.applyNode;
|
||||||
|
loading.value = false;
|
||||||
|
buttonDisabled.value = false;
|
||||||
|
const data = {
|
||||||
|
taskId: taskId.value,
|
||||||
|
variables: props.taskVariables
|
||||||
|
};
|
||||||
|
const nextData = await getNextNodeList(data);
|
||||||
|
nestNodeList.value = nextData.data;
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(() => {});
|
onMounted(() => {});
|
||||||
@ -438,6 +474,15 @@ const handleTaskUser = async () => {
|
|||||||
}
|
}
|
||||||
deleteSignatureVisible.value = true;
|
deleteSignatureVisible.value = true;
|
||||||
};
|
};
|
||||||
|
// 选择人员
|
||||||
|
const choosePeople = async (data) => {
|
||||||
|
if (!data.permissionFlag) {
|
||||||
|
proxy?.$modal.msgError('没有可选择的人员,请联系管理员!');
|
||||||
|
}
|
||||||
|
popUserIds.value = data.permissionFlag;
|
||||||
|
porUserRef.value.open();
|
||||||
|
};
|
||||||
|
const handlePopUser = async () => {};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 对外暴露子组件方法
|
* 对外暴露子组件方法
|
||||||
|
@ -108,11 +108,13 @@ interface PropType {
|
|||||||
modelValue?: UserVO[] | UserVO | undefined;
|
modelValue?: UserVO[] | UserVO | undefined;
|
||||||
multiple?: boolean;
|
multiple?: boolean;
|
||||||
data?: string | number | (string | number)[] | undefined;
|
data?: string | number | (string | number)[] | undefined;
|
||||||
|
userIds?: string;
|
||||||
}
|
}
|
||||||
const prop = withDefaults(defineProps<PropType>(), {
|
const prop = withDefaults(defineProps<PropType>(), {
|
||||||
multiple: true,
|
multiple: true,
|
||||||
modelValue: undefined,
|
modelValue: undefined,
|
||||||
data: undefined
|
data: undefined,
|
||||||
|
userIds: undefined
|
||||||
});
|
});
|
||||||
const emit = defineEmits(['update:modelValue', 'confirmCallBack']);
|
const emit = defineEmits(['update:modelValue', 'confirmCallBack']);
|
||||||
|
|
||||||
@ -143,7 +145,8 @@ const queryParams = ref<UserQuery>({
|
|||||||
phonenumber: '',
|
phonenumber: '',
|
||||||
status: '',
|
status: '',
|
||||||
deptId: '',
|
deptId: '',
|
||||||
roleId: ''
|
roleId: '',
|
||||||
|
userIds: ''
|
||||||
});
|
});
|
||||||
|
|
||||||
const defaultSelectUserIds = computed(() => computedIds(prop.data));
|
const defaultSelectUserIds = computed(() => computedIds(prop.data));
|
||||||
@ -166,7 +169,7 @@ const confirm = () => {
|
|||||||
|
|
||||||
const computedIds = (data) => {
|
const computedIds = (data) => {
|
||||||
if (data instanceof Array) {
|
if (data instanceof Array) {
|
||||||
return data.map(item => String(item));
|
return data.map((item) => String(item));
|
||||||
} else if (typeof data === 'string') {
|
} else if (typeof data === 'string') {
|
||||||
return data.split(',');
|
return data.split(',');
|
||||||
} else if (typeof data === 'number') {
|
} else if (typeof data === 'number') {
|
||||||
@ -192,6 +195,7 @@ const getTreeSelect = async () => {
|
|||||||
/** 查询用户列表 */
|
/** 查询用户列表 */
|
||||||
const getList = async () => {
|
const getList = async () => {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
|
queryParams.value.userIds = prop.userIds;
|
||||||
const res = await api.listUser(proxy?.addDateRange(queryParams.value, dateRange.value));
|
const res = await api.listUser(proxy?.addDateRange(queryParams.value, dateRange.value));
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
userList.value = res.rows;
|
userList.value = res.rows;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user