fix : 修复分摊编辑传参问题

This commit is contained in:
2024-07-03 21:31:05 +08:00
parent 0f0fa0f4e0
commit 9a789db8a7
2 changed files with 25 additions and 19 deletions

View File

@@ -223,21 +223,20 @@ const isSingleFile = ref(false)
const allFileList = ref([]) const allFileList = ref([])
const deleteFileVal = ref({}) const deleteFileVal = ref({})
const singleFileList = ref([]) const singleFileList = ref([])
if (props.formData.fileList !== null && props.formData.fileList?.length > 0) { // if (props.formData.fileList !== null && props.formData.fileList?.length > 0) {
allFileList.value = props.formData.fileList // allFileList.value = props.formData.fileList
} // }
watch(() => props.showSingleTable, (newVal) => { watch(() => props.showSingleTable, (newVal) => {
props.showSingleTable = newVal props.showSingleTable = newVal
}, {deep: true}) }, {deep: true})
// watch(() => props.formData.fileList, (newVal) => { watch(() => props.formData.fileList, (newVal) => {
// console.log('newVal-fileList', newVal) console.log('newVal-fileList', newVal)
// if (props.preview) { if (props.preview) {
// // newVal?.forEach(item => { newVal?.forEach(item => {
// // allFileList.value.push(item) allFileList.value.push(item)
// // }) })
// } }
// }, {deep: true}) }, {immediate: true})
// watch(() => props.otherFileList, (newVal) => { // watch(() => props.otherFileList, (newVal) => {
// props.otherFileList=newVal // props.otherFileList=newVal
// if (props.preview) { // if (props.preview) {
@@ -280,8 +279,6 @@ const handleDelete = (row, type) => {
singleFileList.value.splice(singleFileList.value.findIndex((item) => item.fileId === row.fileId), 1); singleFileList.value.splice(singleFileList.value.findIndex((item) => item.fileId === row.fileId), 1);
isSingleFile.value = false isSingleFile.value = false
} else { } else {
console.log('allFileList.value',allFileList.value,row)
console.log('allFileList.value.findIndex((item) => item.id === row.fileId)',allFileList.value.findIndex((item) => item.id === row.fileId))
allFileList.value.splice(allFileList.value.findIndex((item) => item.fileId === row.fileId), 1); allFileList.value.splice(allFileList.value.findIndex((item) => item.fileId === row.fileId), 1);
} }
} }

View File

@@ -115,7 +115,7 @@
<baseTitle title="审批记录" v-if="processDiagramViewer&& opentionData?.operationList"></baseTitle> <baseTitle title="审批记录" v-if="processDiagramViewer&& opentionData?.operationList"></baseTitle>
<div v-else></div> <div v-else></div>
<div style="display: flex;align-items: center;justify-content: flex-start;"> <div style="display: flex;align-items: center;justify-content: flex-start;">
<div class="base-title">流程图</div> <div class="base-title" style="margin-left: 10px">流程图</div>
<el-switch <el-switch
v-model="changeDiagram" v-model="changeDiagram"
style="--el-switch-on-color:#BEA266 ; --el-switch-off-color:#cecdcd" style="--el-switch-on-color:#BEA266 ; --el-switch-off-color:#cecdcd"
@@ -214,11 +214,14 @@ const showPersonnelPicker = (row, index) => {
name: row.researchPersonnel, name: row.researchPersonnel,
companyName: row.companyName, companyName: row.companyName,
} }
userList.value.push(userObj) userList.value=[userObj]
} }
userPicker.value.showUserPicker() nextTick(() => {
userPicker.value.showUserPicker()
})
} }
const selected = (select) => { const selected = (select) => {
console.log('select',select)
if (!select || select.length === 0) { if (!select || select.length === 0) {
return return
} }
@@ -228,7 +231,7 @@ const selected = (select) => {
item.researchPersonnel = select[0].name item.researchPersonnel = select[0].name
} }
}) })
userList.value=select // userList.value=select
} }
const getResearchOptions = async () => { const getResearchOptions = async () => {
const res = await getResearchUser() const res = await getResearchUser()
@@ -353,13 +356,18 @@ const handleResubmit = (instance) => {
item.performance = null item.performance = null
} }
newUsrAllocationsObj = { newUsrAllocationsObj = {
allocationId: formData.value.allocationId,
id: item.id,
projectId: item.projectId, projectId: item.projectId,
projectName: item.projectName, projectName: item.projectName,
researchPersonnel: item.researchPersonnel,
researchPersonnelId: item.researchPersonnelId, researchPersonnelId: item.researchPersonnelId,
wagesPayable: item.wagesPayable, wagesPayable: item.wagesPayable,
performance: item.performance, performance: item.performance,
reserveFund: item.reserveFund, reserveFund: item.reserveFund,
socialSecurity: item.socialSecurity, socialSecurity: item.socialSecurity,
time: item.time,
subtotal: item.subtotal,
annuity: item.annuity, annuity: item.annuity,
workday: item.workday, workday: item.workday,
researchDuration: item.researchDuration, researchDuration: item.researchDuration,
@@ -378,9 +386,10 @@ const handleResubmit = (instance) => {
allocationId: formData.value.allocationId, allocationId: formData.value.allocationId,
shareName: formData.value.shareName, shareName: formData.value.shareName,
apportionmentMonth: formData.value.apportionmentMonth, apportionmentMonth: formData.value.apportionmentMonth,
usrAllocations: newUsrAllocationsObjArray, usrAllocations:newUsrAllocationsObjArray,
deploymentId: processInstanceData.value.deploymentId, deploymentId: processInstanceData.value.deploymentId,
} }
console.log('params', params, formData.value.tableData)
const {code, msg} = await editAllocation(params) const {code, msg} = await editAllocation(params)
ElNotification({ ElNotification({
title: '提示', title: '提示',