|
|
@@ -122,16 +122,16 @@ watch(props, (val) => {
|
|
|
if(props.dialogVisible)
|
|
|
if(props.deptIds.length<2){
|
|
|
treeRef.value?.setCurrentKey(props?.deptIds[0]);
|
|
|
- treeClick({id:props.deptIds[0]})
|
|
|
+ treeClick({id:props.deptIds[0]})
|
|
|
}
|
|
|
})
|
|
|
-
|
|
|
+
|
|
|
// if(val.dialogVisible){
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
// }
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
});
|
|
|
|
|
|
const list = ref<ListItem[]>([]);
|
|
|
@@ -152,15 +152,17 @@ const remoteMethod = (query: string) => {
|
|
|
name: query,
|
|
|
})
|
|
|
.then((res: any) => {
|
|
|
-
|
|
|
+
|
|
|
if (res.code === 200) {
|
|
|
// userList.value = res.data;
|
|
|
let arr: any = [];
|
|
|
+ console.log('res.data是啥', res.data)
|
|
|
res.data.forEach((item) => {
|
|
|
arr.push({
|
|
|
label: item.name,
|
|
|
value: item.id,
|
|
|
mobile: item.mobile,
|
|
|
+ userOd: item.userId
|
|
|
});
|
|
|
});
|
|
|
loading.value = false;
|
|
|
@@ -192,43 +194,36 @@ function treeClick(node: any) {
|
|
|
}
|
|
|
|
|
|
function submit(){
|
|
|
-
|
|
|
+
|
|
|
if(props.title=='设置负责人'){
|
|
|
if(userId.value){
|
|
|
-
|
|
|
- const obj=options.value.map((item:any)=>{
|
|
|
- if(item.value==userId.value){
|
|
|
- return {
|
|
|
- name:item.label,
|
|
|
- id:item.value,
|
|
|
- mobile:item.mobile
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
+ const obj = options.value.find(a => a.value === userId.value)
|
|
|
api.institutionApi.setDeptLeader({
|
|
|
deptId:props.deptIds,
|
|
|
- leaderId:obj[0].userId
|
|
|
+ leaderId:obj.userId
|
|
|
}).then(res=>{
|
|
|
-
|
|
|
+
|
|
|
if(res.code==200){
|
|
|
ElMessage.success(res.msg)
|
|
|
emits('closeDialog')
|
|
|
+ } else {
|
|
|
+ ElMessage.warning(res.msg)
|
|
|
}
|
|
|
})
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
}else{
|
|
|
let flag={}
|
|
|
userList.value.some((item:any)=>{
|
|
|
-
|
|
|
+
|
|
|
if( item.id==treeReId.value){
|
|
|
flag={...item}
|
|
|
return true
|
|
|
}
|
|
|
return false
|
|
|
-
|
|
|
+
|
|
|
})
|
|
|
-
|
|
|
+
|
|
|
api.institutionApi.setDeptLeader({
|
|
|
deptId:props.deptIds,
|
|
|
leaderId:flag.userId
|
|
|
@@ -251,30 +246,30 @@ function submit(){
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
-
|
|
|
+
|
|
|
emits('closeDialog',obj[0])
|
|
|
}else{
|
|
|
let flag={}
|
|
|
userList.value.some((item:any)=>{
|
|
|
-
|
|
|
+
|
|
|
if( item.id==treeReId.value){
|
|
|
flag={...item}
|
|
|
return true
|
|
|
}
|
|
|
return false
|
|
|
-
|
|
|
+
|
|
|
})
|
|
|
emits('closeDialog',flag)
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
const handleClose = (done: () => void) => {
|
|
|
-
|
|
|
+
|
|
|
emits('cancelDialog',false)
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|