fix: 流程下拉框选择bug修改

dev_1.0.0
JINGYJ 11 months ago
parent 0bf60b46c6
commit 17bf0db4f5

@ -64,3 +64,13 @@ export const createProcess = (data?: object) => {
data data
}); });
}; };
/**
*
* @returns
*/
export const updateProcess = (data?: object) => {
return http.request<Result>("post", "/know-sub/flow/update", {
data
});
};

@ -39,7 +39,7 @@ const processForm = reactive({
link: [ link: [
{ {
nodeName: "", nodeName: "",
roleId: null, roleId: "",
userIdList: [] userIdList: []
} }
], ],
@ -155,7 +155,7 @@ const handleDrawerClosed = () => {
const addLink = () => { const addLink = () => {
processForm.link.push({ processForm.link.push({
nodeName: "", nodeName: "",
roleId: null, roleId: "",
userIdList: [] userIdList: []
}); });
}; };
@ -194,11 +194,12 @@ const getUserLists = async () => {
}; };
const handleSelect = async (value: any) => { const handleSelect = async (value: any) => {
console.log(value); console.log(value);
value.userIdList.length = 0;
// const selectItem = JSON.parse(value); // const selectItem = JSON.parse(value);
const res: any = await getUserList({ const res: any = await getUserList({
userName: "", userName: "",
deptId: "", deptId: "",
roleId: value, roleId: value.roleId,
pageNum: "1", pageNum: "1",
pageSize: "10" pageSize: "10"
}); });
@ -307,7 +308,7 @@ onMounted(() => {
popper-class="custom-header" popper-class="custom-header"
placeholder="请选择" placeholder="请选择"
class="w-[100%]" class="w-[100%]"
@change="handleSelect" @change="handleSelect(item)"
> >
<el-option <el-option
v-for="item in roleNameList" v-for="item in roleNameList"
@ -337,6 +338,7 @@ onMounted(() => {
placeholder="请选择" placeholder="请选择"
:max-collapse-tags="2" :max-collapse-tags="2"
class="w-[100%]" class="w-[100%]"
:disabled="item.roleId === ''"
> >
<el-option <el-option
v-for="item in userNameList" v-for="item in userNameList"

@ -5,7 +5,7 @@ import {
getOptionalBaseList, getOptionalBaseList,
getRoleManageList, getRoleManageList,
getUserList, getUserList,
createProcess, updateProcess,
getFlowDetail getFlowDetail
} from "@/api/business"; } from "@/api/business";
import { message } from "@/utils/message"; import { message } from "@/utils/message";
@ -47,7 +47,7 @@ const processForm = reactive({
link: [ link: [
{ {
nodeName: "", nodeName: "",
roleId: null, roleId: "",
userIdList: [] userIdList: []
} }
], ],
@ -140,7 +140,7 @@ const submitForm = async (formEl: FormInstance | undefined) => {
}) })
}; };
// console.log(createForm); // console.log(createForm);
createProcess(createForm).then(res => { updateProcess(createForm).then(res => {
if (res.code === 200) { if (res.code === 200) {
message("新建成功", { type: "success" }); message("新建成功", { type: "success" });
props.closeDrawer(); props.closeDrawer();
@ -161,7 +161,7 @@ const handleDrawerClosed = () => {
const addLink = () => { const addLink = () => {
processForm.link.push({ processForm.link.push({
nodeName: "", nodeName: "",
roleId: null, roleId: "",
userIdList: [] userIdList: []
}); });
}; };
@ -201,10 +201,11 @@ const getUserLists = async () => {
const handleSelect = async (value: any) => { const handleSelect = async (value: any) => {
// console.log(value); // console.log(value);
// const selectItem = JSON.parse(value); // const selectItem = JSON.parse(value);
value.userIdList.length = 0;
const res: any = await getUserList({ const res: any = await getUserList({
userName: "", userName: "",
deptId: "", deptId: "",
roleId: value, roleId: value.roleId,
pageNum: "1", pageNum: "1",
pageSize: "10" pageSize: "10"
}); });
@ -331,7 +332,7 @@ onMounted(() => {
popper-class="custom-header" popper-class="custom-header"
placeholder="请选择" placeholder="请选择"
class="w-[100%]" class="w-[100%]"
@change="handleSelect" @change="handleSelect(item)"
> >
<el-option <el-option
v-for="item in roleNameList" v-for="item in roleNameList"
@ -361,6 +362,7 @@ onMounted(() => {
placeholder="请选择" placeholder="请选择"
:max-collapse-tags="2" :max-collapse-tags="2"
class="w-[100%]" class="w-[100%]"
:disabled="item.roleId === ''"
> >
<el-option <el-option
v-for="item in userNameList" v-for="item in userNameList"

@ -207,6 +207,15 @@ const getFlowDetails = (value: any) => {
}); });
accountForm.remark = value.remark; accountForm.remark = value.remark;
}; };
const drawerName = (type: any) => {
if (type === "edit") {
return "编辑账号";
} else if (type === "view") {
return "查看账号";
} else {
return "新建账号";
}
};
onMounted(() => { onMounted(() => {
getDeptManageLists(); getDeptManageLists();
getRoleManageLists(); getRoleManageLists();
@ -223,7 +232,7 @@ onMounted(() => {
@closed="handleDrawerClosed" @closed="handleDrawerClosed"
> >
<div class="drawer_header"> <div class="drawer_header">
<span>新建账号</span> <span>{{ drawerName(props.accountFromType) }}</span>
</div> </div>
<div class="drawer_box"> <div class="drawer_box">
<el-form <el-form

Loading…
Cancel
Save