You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
840 B
47 lines
840 B
|
1 year ago
|
<!--
|
||
|
|
@ 作者: 秦东
|
||
|
|
@ 时间: 2024-09-12 14:41:53
|
||
|
|
@ 备注: 获取行政组织数据
|
||
|
|
-->
|
||
|
|
<script lang='ts' setup>
|
||
|
|
import { getgovcont } from '@/api/hr/org/index'
|
||
|
|
const props = defineProps({
|
||
|
|
orgid:{
|
||
|
|
type: String,
|
||
|
|
default:""
|
||
|
|
}
|
||
|
|
})
|
||
|
|
const orgName = ref("")
|
||
|
|
//选择行政组织
|
||
|
|
const pickOrgVal = (val:any) => {
|
||
|
|
|
||
|
|
if(val != "" && val != null){
|
||
|
|
|
||
|
|
getgovcont({id:val*1,idstr:val})
|
||
|
|
.then(({data}) =>{
|
||
|
|
// console.log("选择行政组织-3->",data,data.name)
|
||
|
|
orgName.value = data.name
|
||
|
|
})
|
||
|
|
.finally(()=>{
|
||
|
|
|
||
|
|
})
|
||
|
|
}
|
||
|
|
}
|
||
|
|
onBeforeMount(() => {
|
||
|
|
pickOrgVal(props.orgid)
|
||
|
|
})
|
||
|
|
onMounted(() => {
|
||
|
|
pickOrgVal(props.orgid)
|
||
|
|
});
|
||
|
|
watch(() =>props.orgid,(val:string) => {
|
||
|
|
// console.log("选择行政组织-4->",val)
|
||
|
|
pickOrgVal(val)
|
||
|
|
})
|
||
|
|
</script>
|
||
|
|
<template>
|
||
|
|
<div>{{ orgName }}</div>
|
||
|
|
</template>
|
||
|
|
<style lang='scss' scoped>
|
||
|
|
|
||
|
|
</style>
|