|
@@ -325,18 +325,24 @@ const initPostData = async (id, index) => {
|
|
postData.value[index] = []
|
|
postData.value[index] = []
|
|
}
|
|
}
|
|
//处理负责人限制
|
|
//处理负责人限制
|
|
- const deptList = formModel.value.deptList
|
|
|
|
let isLader = 0;
|
|
let isLader = 0;
|
|
|
|
+ const deptList = formModel.value.deptList
|
|
deptList.forEach((item, indexs) => {
|
|
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
|
|
|
|
|
|
+ if (item.deptId === id) {
|
|
|
|
+ //如果当前相同部门项的负责人存在,就全局存在
|
|
|
|
+ if (item.isLader === 1) {
|
|
|
|
+ isLader = 1
|
|
|
|
+ }
|
|
|
|
+ //设置其它相同部门项的负责人
|
|
|
|
+ if (indexs !== index) {
|
|
|
|
+ item.isLader = isLader
|
|
|
|
+ item.isLaderDisabled = true
|
|
|
|
+ }
|
|
}
|
|
}
|
|
})
|
|
})
|
|
- formModel.value.deptList[index].isLaderDisabled = false
|
|
|
|
|
|
+ //设置当前项的负责人
|
|
|
|
+ deptList[index].isLader = isLader
|
|
|
|
+ deptList[index].isLaderDisabled = false
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -344,9 +350,9 @@ const initPostData = async (id, index) => {
|
|
const isLaderChange = (id, index) => {
|
|
const isLaderChange = (id, index) => {
|
|
const deptList = formModel.value.deptList
|
|
const deptList = formModel.value.deptList
|
|
const deptId = deptList[index].deptId
|
|
const deptId = deptList[index].deptId
|
|
- deptList.forEach((item, indexs) => {
|
|
|
|
|
|
+ deptList.forEach((item) => {
|
|
if (item.deptId === deptId) {
|
|
if (item.deptId === deptId) {
|
|
- formModel.value.deptList[indexs].isLader = item.isLader
|
|
|
|
|
|
+ item.isLader = id
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|