Lijy 4 månader sedan
förälder
incheckning
a444723474

+ 1 - 0
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/team/api.ts

@@ -4,6 +4,7 @@ export const GET_ROUTELIST = '/permission/getFrontRoleList'
 export const GET_DEPTLIST = '/department/list'
 export const GET_USERLIST = '/user/getSimpleActiveUserList'
 export const GET_ADDDEPT = '/department/add'
+export const EDIT_ADDDEPT = '/department/edit'
 export const DETELE_DEPT = '/department/delete'
 export const ADD_USER = '/user/insertUser'
 export const GET_USERINFO = '/user/getUserInfo'

+ 5 - 4
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/team/index.vue

@@ -259,7 +259,7 @@ import { UploadRequestOptions, dayjs } from 'element-plus'
 import { Search, CirclePlusFilled, Edit, CirclePlus, Delete } from '@element-plus/icons-vue'
 import { FormInstance, FormRules, ElMessageBox } from 'element-plus'
 import { useStore } from '@/store/index'
-import { GET_DATA_LIST, DETELE_DEPT, MOD, GET_USERINFO, GET_ROUTELIST, DEACTIVEUSER, SETACTIVE, GET_DEPTLIST, BACTHSERROLE, GET_USERLIST, GET_ADDDEPT, ADD_USER, SETRESETPWD, EXPOERTUSER } from './api'
+import { GET_DATA_LIST, DETELE_DEPT, MOD, GET_USERINFO, GET_ROUTELIST, DEACTIVEUSER, SETACTIVE, GET_DEPTLIST, BACTHSERROLE, GET_USERLIST, GET_ADDDEPT, ADD_USER, SETRESETPWD, EXPOERTUSER, EDIT_ADDDEPT } from './api'
 import { post, uploadFile } from "@/utils/request";
 import { getFromValue, updateDepTreeData, resetFromValue, confirmAction, downloadFile } from '@/utils/tools'
 
@@ -464,7 +464,7 @@ async function personnelModalConfirm(data: any, modelType: string) {
     globalPopup?.showSuccess('添加成功')
     getTableData()
   }).catch(_err => {
-    dialogFrom[modelType] = false
+    dialogFrom[modelType] = false 
   })
 }
 
@@ -472,14 +472,15 @@ function createDepartment(formEl: FormInstance | undefined) {
   if (!formEl) return
   let data = getFromValue(deptForm)
   loadingFrom.deptDialogVisibleLoading = true
-  post(GET_ADDDEPT, { ...deptForm, otherManagerIds: data.otherManagerIds && data.otherManagerIds.join(',') }).then(res => {
+  EDIT_ADDDEPT
+  post(data.id ? EDIT_ADDDEPT : GET_ADDDEPT, { ...deptForm, otherManagerIds: data.otherManagerIds && data.otherManagerIds.join(',') }).then(res => {
     if (res.code != 'ok') {
       loadingFrom.deptDialogVisibleLoading = false
       globalPopup?.showError(res.msg)
       return
     }
     loadingFrom.deptDialogVisibleLoading = false
-    globalPopup?.showSuccess('创建成功')
+    globalPopup?.showSuccess(data.id ? '修改成功' : '创建成功')
     getDeptList()
     dialogFrom.addDeptDialogVisible = false
   }).catch(_err => {