zhouwx
4 天以前 ff1169ac5114c68e96c5686a0caa5d69d8a60b8a
src/views/build/conpanyFunctionConsult/orgStructure/departManage/components/departDialog.vue
@@ -7,9 +7,10 @@
        :before-close="handleClose"
        :close-on-press-escape="false"
        :close-on-click-modal="false"
        draggable
    >
      <el-form :model="state.form" size="default" ref="superRef" :rules="state.formRules" label-width="150px">
        <el-form-item label="企业:" prop="companyId" v-if="state.isAdmin">
        <el-form-item label="单位:" prop="companyId" v-if="state.isAdmin">
          <el-select v-model="state.form.companyId" placeholder="请选择" clearable @change="getDeptList()">
            <el-option
                v-for="item in state.companyList"
@@ -66,9 +67,9 @@
          <el-select clearable v-model="state.form.leaderUserId" :disabled="state.title =='查看'" filterable placeholder="负责人" style="width: 100%">
            <el-option
                v-for="item in state.userList"
                :key="item.id"
                :key="item.userId"
                :label="item.name"
                :value="item.id"
                :value="item.userId"
            />
          </el-select>
        </el-form-item>
@@ -130,6 +131,7 @@
import {ElMessage} from "element-plus";
import {getDepart, getSysClause, saveDepart} from "@/api/orgStructure/depart";
import {listUser} from "@/api/system/user";
import {getEmployeeRecords} from "@/api/onlineEducation/user";
const emit = defineEmits(["getList"]);
const dialogVisible = ref(false)
const superRef = ref()
@@ -175,7 +177,7 @@
  if(isAdmin){
    state.companyList = companyList
  }
  await getUserList()
  await getUserList(companyId)
  await getDepartList(companyId)
  await getSysClauseList()
  state.title = type === 'add' ? '新增' : type ==='edit' ? '编辑' : '查看';
@@ -201,10 +203,10 @@
  dialogVisible.value = true
}
const getUserList = async ()=> {
  const res = await listUser({pageIndex: 1,pageSize: 999})
const getUserList = async (companyId)=> {
  const res = await getEmployeeRecords({companyId: companyId})
  if(res.code == 200){
    state.userList = res.data.list?res.data.list:[]
    state.userList = res.data ? res.data :[]
  }else{
    ElMessage.warning(res.message)
  }
@@ -212,6 +214,7 @@
const getDeptList = async ()=>{
  await getDepartList(state.form.companyId)
  await getUserList(state.form.companyId)
}
const getDepartList = async (companyId)=> {