fix : 修复人员取消功能

This commit is contained in:
2024-08-17 00:13:17 +08:00
parent 26ed532684
commit 7637608226
6 changed files with 115 additions and 66 deletions

View File

@@ -42,7 +42,7 @@
{{ item.name }}
</div>
<user-picker :multiple="false" ref="projectChargePersonUserPicker" title="请选择项目负责人"
v-model:value="projectChargePersonUserList" @ok="projectChargePersonUserPickerOk"/>
v-model:value="projectChargePersonUserList" @ok="projectChargePersonUserPickerOk" @cancelOrClear="projectChargePersonUserPickerCancel"/>
</el-form-item>
</el-col>
<el-col :span="6" v-if="title==='apply'">
@@ -55,23 +55,21 @@
{{ item.name }}{{index != getProjectPerson(projectPersonUserList)?.length - 1 ? '' : ''}}
</div>
<user-picker :multiple="true" ref="projectPersonUserPicker" title="请选择项目成员"
v-model:value="projectPersonUserList" @ok="projectPersonUserPickerOk"/>
v-model:value="projectPersonUserList" @ok="projectPersonUserPickerOk" @cancelOrClear="projectPersonUserPickerCancel"/>
</el-form-item>
</el-col>
<el-col :span="6" v-if="title==='apply'||title==='check'">
<el-form-item label="部门分管领导" :label-width="title==='check'?110:115"
>
<el-form-item label="部门分管领导" :label-width="title==='check'?110:115">
<el-button color="#DED0B2" style="margin-right: 10px" @click="handleShowOptionalChargeLeadershipPicker">
{{
optionalChargeLeadershipList?.length !== 0 ? '更改' : getOptionalChargeLeadershipList(optionalChargeLeadershipList) ? '更改' : '请选择'
}}
</el-button>
<div v-for="(item,index) in getOptionalChargeLeadershipList(optionalChargeLeadershipList)" :key="item.id"
>
{{ item.name }}{{index != getProjectPerson(projectPersonUserList)?.length - 1 ? '' : ''}}
<div v-for="(item,index) in getOptionalChargeLeadershipList(optionalChargeLeadershipList)" :key="item.id">
{{ item.name }}{{index != getOptionalChargeLeadershipList(optionalChargeLeadershipList)?.length - 1 ? '' : ''}}
</div>
<user-picker :multiple="true" ref="optionalChargeLeadershipPickerRef" title="请选择部门分管领导"
v-model:value="optionalChargeLeadershipList" @ok="optionalChargeLeaderPickerOk"/>
v-model:value="optionalChargeLeadershipList" @ok="optionalChargeLeaderPickerOk" @cancelOrClear="optionalChargeLeaderPickerCancel"/>
</el-form-item>
</el-col>
<el-col :span="24" v-if="preProcessShow === 'EDIT'">
@@ -342,7 +340,14 @@ const handleShowOptionalChargeLeadershipPicker = () => {
const optionalChargeLeaderPickerOk = (userList) => {
optionalChargeLeadershipList.value = userList
localStorage.setItem('optionalChargeLeadershipList', JSON.stringify(optionalChargeLeadershipList.value))
if(userList?.length>0){
localStorage.setItem('optionalChargeLeadershipList', JSON.stringify(optionalChargeLeadershipList.value))
}else {
localStorage.removeItem('optionalChargeLeadershipList')
}
}
const optionalChargeLeaderPickerCancel = (userList) => {
optionalChargeLeadershipList.value = userList
}
const clickToPreview = (row) => {
@@ -471,19 +476,29 @@ const handleShowProjectChargePersonTable = () => {
}
const projectChargePersonUserPickerOk = (userList) => {
projectChargePersonUserList.value = userList
localStorage.setItem('projectChargePersonUserList', JSON.stringify(projectChargePersonUserList.value))
if(userList?.length>0){
localStorage.setItem('projectChargePersonUserList', JSON.stringify(projectChargePersonUserList.value))
}else {
localStorage.removeItem('projectPersonUserList')
}
}
const handleShowProjectPersonTable = () => {
projectPersonUserPicker.value.showUserPicker()
}
const projectChargePersonUserPickerCancel=(userList)=>{
projectChargePersonUserList.value = userList
}
const projectPersonUserPickerCancel=(userList)=>{
projectPersonUserList.value = userList
}
const projectPersonUserPickerOk = (userList) => {
projectPersonUserList.value = userList
localStorage.setItem('projectPersonUserList', JSON.stringify(userList))
// let userIds = []
// for (const user of userList) {
// userIds.push(user.id)
// }
if(userList?.length>0){
localStorage.setItem('projectPersonUserList', JSON.stringify(userList))
}else {
localStorage.removeItem('projectPersonUserList')
}
}
const getPreProcessList = () => {
loading.value = true
@@ -604,6 +619,7 @@ const getFileParam = (item) => {
}
}
const handleSubmit = async () => {
console.log(' projectPersonUserList.value', projectPersonUserList.value)
let files = []
if (props.mode === 'resubmit') {
attachment.value.allFileList.forEach(item => {