| | |
| | | :data="deptTree" |
| | | :props="treeProps" |
| | | check-strictly |
| | | @change="getUserList" |
| | | @change="belongDeptChange" |
| | | clearable |
| | | /> |
| | | </el-form-item> |
| | |
| | | <el-col :span="12"> |
| | | <el-form-item label="负责人" prop="charger"> |
| | | <el-select v-model="formData.charger" placeholder="请选择" :disabled="!formData.belongDept" clearable> |
| | | <el-option v-for="item in userList" :key="item.id" :label="item.name" :value="item.id" /> |
| | | <el-option v-for="item in userList" :key="item.id" :label="item.name" :value="item.name" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | } |
| | | |
| | | const userList = ref([]) |
| | | function getUserList(val) { |
| | | |
| | | function belongDeptChange() { |
| | | formData.value.charger = '' |
| | | if (val) { |
| | | getUserListApi(val).then(res => { |
| | | userList.value = res.data.data.records |
| | | }) |
| | | } |
| | | } |
| | | |
| | | function getUserList() { |
| | | getUserListApi(formData.value.belongDept).then(res => { |
| | | userList.value = res.data.data.records |
| | | }) |
| | | } |
| | | |
| | | watch(() => formData.value.belongDept, getUserList) |
| | | |
| | | // 关闭弹框 |
| | | function handleCancel() { |
| | | visible.value = false |