|
@@ -84,7 +84,7 @@
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="7">
|
|
<el-col :span="7">
|
|
<el-form-item prop="principal">
|
|
<el-form-item prop="principal">
|
|
- <el-select v-model="item.isLader" placeholder="是否为部门负责人">
|
|
|
|
|
|
+ <el-select v-model="item.isLader" placeholder="是否为部门负责人" :disabled="item.isLaderDisabled" @change="isLaderChange($event, index)">
|
|
<el-option label="是" :value="1"/>
|
|
<el-option label="是" :value="1"/>
|
|
<el-option label="否" :value="0"/>
|
|
<el-option label="否" :value="0"/>
|
|
</el-select>
|
|
</el-select>
|
|
@@ -317,15 +317,39 @@ const getSectionData = async () => {
|
|
const postData = ref([])
|
|
const postData = ref([])
|
|
const initPostData = async (id, index) => {
|
|
const initPostData = async (id, index) => {
|
|
if (id) {
|
|
if (id) {
|
|
|
|
+ //获取岗位数据
|
|
const { error, code, data } = await organizationApi.getList({parentId: id})
|
|
const { error, code, data } = await organizationApi.getList({parentId: id})
|
|
if (!error && code === 200) {
|
|
if (!error && code === 200) {
|
|
postData.value[index] = getArrValue(data)
|
|
postData.value[index] = getArrValue(data)
|
|
} else {
|
|
} else {
|
|
postData.value[index] = []
|
|
postData.value[index] = []
|
|
}
|
|
}
|
|
|
|
+ //处理负责人限制
|
|
|
|
+ const deptList = formModel.value.deptList
|
|
|
|
+ let isLader = 0;
|
|
|
|
+ deptList.forEach((item, indexs) => {
|
|
|
|
+ if (item.isLader === 1 && isLader !== 1) {
|
|
|
|
+ isLader = 1
|
|
|
|
+ }
|
|
|
|
+ if (item.deptId === id && indexs !== index) {
|
|
|
|
+ formModel.value.deptList[indexs].isLader = isLader
|
|
|
|
+ formModel.value.deptList[indexs].isLaderDisabled = true
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ formModel.value.deptList[index].isLaderDisabled = false
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+//是否为部门负责人
|
|
|
|
+const isLaderChange = (id, index) => {
|
|
|
|
+ const deptList = formModel.value.deptList
|
|
|
|
+ const deptId = deptList[index].deptId
|
|
|
|
+ deptList.forEach((item, indexs) => {
|
|
|
|
+ if (item.deptId === deptId) {
|
|
|
|
+ formModel.value.deptList[indexs].isLader = item.isLader
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+}
|
|
|
|
|
|
//新增组织
|
|
//新增组织
|
|
const addOrganizationClick = () => {
|
|
const addOrganizationClick = () => {
|