diff --git a/src/api/business.ts b/src/api/business.ts index 6f7d45f..e402378 100644 --- a/src/api/business.ts +++ b/src/api/business.ts @@ -64,3 +64,13 @@ export const createProcess = (data?: object) => { data }); }; + +/** + * + * @returns 修改流程 + */ +export const updateProcess = (data?: object) => { + return http.request("post", "/know-sub/flow/update", { + data + }); +}; diff --git a/src/views/businessManagement/processConfiguration/components/createForm.vue b/src/views/businessManagement/processConfiguration/components/createForm.vue index f441181..d693178 100644 --- a/src/views/businessManagement/processConfiguration/components/createForm.vue +++ b/src/views/businessManagement/processConfiguration/components/createForm.vue @@ -39,7 +39,7 @@ const processForm = reactive({ link: [ { nodeName: "", - roleId: null, + roleId: "", userIdList: [] } ], @@ -155,7 +155,7 @@ const handleDrawerClosed = () => { const addLink = () => { processForm.link.push({ nodeName: "", - roleId: null, + roleId: "", userIdList: [] }); }; @@ -194,11 +194,12 @@ const getUserLists = async () => { }; const handleSelect = async (value: any) => { console.log(value); + value.userIdList.length = 0; // const selectItem = JSON.parse(value); const res: any = await getUserList({ userName: "", deptId: "", - roleId: value, + roleId: value.roleId, pageNum: "1", pageSize: "10" }); @@ -307,7 +308,7 @@ onMounted(() => { popper-class="custom-header" placeholder="请选择" class="w-[100%]" - @change="handleSelect" + @change="handleSelect(item)" > { placeholder="请选择" :max-collapse-tags="2" class="w-[100%]" + :disabled="item.roleId === ''" > { }) }; // console.log(createForm); - createProcess(createForm).then(res => { + updateProcess(createForm).then(res => { if (res.code === 200) { message("新建成功", { type: "success" }); props.closeDrawer(); @@ -161,7 +161,7 @@ const handleDrawerClosed = () => { const addLink = () => { processForm.link.push({ nodeName: "", - roleId: null, + roleId: "", userIdList: [] }); }; @@ -201,10 +201,11 @@ const getUserLists = async () => { const handleSelect = async (value: any) => { // console.log(value); // const selectItem = JSON.parse(value); + value.userIdList.length = 0; const res: any = await getUserList({ userName: "", deptId: "", - roleId: value, + roleId: value.roleId, pageNum: "1", pageSize: "10" }); @@ -331,7 +332,7 @@ onMounted(() => { popper-class="custom-header" placeholder="请选择" class="w-[100%]" - @change="handleSelect" + @change="handleSelect(item)" > { placeholder="请选择" :max-collapse-tags="2" class="w-[100%]" + :disabled="item.roleId === ''" > { }); accountForm.remark = value.remark; }; +const drawerName = (type: any) => { + if (type === "edit") { + return "编辑账号"; + } else if (type === "view") { + return "查看账号"; + } else { + return "新建账号"; + } +}; onMounted(() => { getDeptManageLists(); getRoleManageLists(); @@ -223,7 +232,7 @@ onMounted(() => { @closed="handleDrawerClosed" >
- 新建账号 + {{ drawerName(props.accountFromType) }}