From 2eb2a28b1fb1681eba3dd062c119812996f550a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=B2=E4=B9=88=E4=BA=86?= Date: Mon, 11 Mar 2024 09:39:44 +0800 Subject: [PATCH] =?UTF-8?q?=E9=83=A8=E9=97=A8=E7=BC=96=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/user-boot/dept.ts | 15 +++++++++++++++ src/views/auth/department/popupForm.vue | 13 +++++++------ 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/src/api/user-boot/dept.ts b/src/api/user-boot/dept.ts index 52fb4743..d6476f81 100644 --- a/src/api/user-boot/dept.ts +++ b/src/api/user-boot/dept.ts @@ -14,3 +14,18 @@ export function getPidAreaByAreaId(data: any) { params: data }) } + +export function addDept(data: any) { + return request({ + url: '/user-boot/dept/add', + method: 'post', + data: data + }) +} +export function updateDept(data: any) { + return request({ + url: '/user-boot/dept/update', + method: 'post', + data: data + }) +} diff --git a/src/views/auth/department/popupForm.vue b/src/views/auth/department/popupForm.vue index 972dfe72..1bbc6301 100644 --- a/src/views/auth/department/popupForm.vue +++ b/src/views/auth/department/popupForm.vue @@ -28,7 +28,7 @@ > - + ({ sort: 100, type: 0, code: '', - specialType: 0 + specialType: 0, + id:'' }) const originForm = { ...form } const rules = { @@ -84,7 +85,7 @@ const rules = { type: [{ required: true, message: '请输选择部门类型', trigger: 'blur' }], specialType: [{ required: true, message: '请输选择部门子类型', trigger: 'blur' }], sort: [{ required: true, message: '请输入部门排序', trigger: 'blur' }], - deptName: [{ required: true, message: '请选择部门区域', trigger: 'blur' }] + area: [{ required: true, message: '请选择部门区域', trigger: 'blur' }] } const customDeptOption = [ { value: 0, label: '非自定义' }, @@ -132,9 +133,9 @@ const submit = () => { formRef.value.validate(async (valid: boolean) => { if (valid) { if (form.id) { - // await update(form) + await updateDept(form) } else { - // await create(form) + await addDept(form) } ElMessage.success('保存成功') tableStore.index()