diff --git a/src/components/AttachmentUpload.vue b/src/components/AttachmentUpload.vue index 6d4f122..6907d48 100644 --- a/src/components/AttachmentUpload.vue +++ b/src/components/AttachmentUpload.vue @@ -213,7 +213,7 @@ const singleTableConfig = reactive({ } ] }) -const fileUploadRef=ref() +const fileUploadRef = ref() const rules = reactive({ attachment: [{required: true, message: '请上传附件', trigger: ['blur', 'change']}], }) @@ -230,7 +230,7 @@ watch(() => props.showSingleTable, (newVal) => { props.showSingleTable = newVal }, {deep: true}) watch(() => props.formData.fileList, (newVal) => { - console.log('newVal-fileList', newVal) + // console.log('newVal-fileList', newVal) if (props.preview) { newVal?.forEach(item => { allFileList.value.push(item) @@ -239,19 +239,19 @@ watch(() => props.formData.fileList, (newVal) => { }, {immediate: true}) // watch(() => props.otherFileList, (newVal) => { // props.otherFileList=newVal - // if (props.preview) { - // console.log('newotherFileList', newVal,props.preview,props.formData.fileList) - // if (props.formData.fileList === null || props.formData.fileList?.length === 0) { - // allFileList.value = newVal - // } else { - // console.log('props.otherFileList',props.otherFileList) - // // props.otherFileList?.forEach(item => { - // // allFileList.value.push(item) - // // }) - // } - // } else { - // allFileList.value = newVal - // } +// if (props.preview) { +// console.log('newotherFileList', newVal,props.preview,props.formData.fileList) +// if (props.formData.fileList === null || props.formData.fileList?.length === 0) { +// allFileList.value = newVal +// } else { +// console.log('props.otherFileList',props.otherFileList) +// // props.otherFileList?.forEach(item => { +// // allFileList.value.push(item) +// // }) +// } +// } else { +// allFileList.value = newVal +// } // }, {deep: true}) watch(() => props.showTable, (newVal) => { props.showTable = newVal @@ -263,6 +263,7 @@ watch(() => props.singleList, (newVal) => { watch(() => props.formData.singleFile, (newVal) => { // console.log('singleFile', newVal) singleFile.value = newVal + props.formData.singleFile=newVal }, {deep: true}) watch(() => isSingleFile.value, (newVal) => { isSingleFile.value = newVal @@ -303,12 +304,12 @@ const compositeParam = (item) => { fileType: item.fileType, url: item.url, newFile: true, - tag:props.tag + tag: props.tag } } const getOtherFile = (val) => { if (props.preview) { - allFileList.value.push(compositeParam(val)) + allFileList.value.push(compositeParam(val)) } else { allFileList.value = props.otherFileList } diff --git a/src/components/DetailComponent/ProjectApply.vue b/src/components/DetailComponent/ProjectApply.vue index 473f3af..c133b38 100644 --- a/src/components/DetailComponent/ProjectApply.vue +++ b/src/components/DetailComponent/ProjectApply.vue @@ -3,11 +3,11 @@ - - - {{projectChargePersonUserList.length!==0 ? '更改' : '请选择' }} + + {{ projectChargePersonUserList.length !== 0 ? '更改' : '请选择' }}
{{ item.name }} @@ -20,8 +20,8 @@ - - {{projectPersonUserList.length!==0 ? '更改' : '请选择' }} + + {{ projectPersonUserList.length !== 0 ? '更改' : '请选择' }}
{{ item.name }} @@ -210,17 +210,17 @@ const name = ref(router.currentRoute.value.name) const deploymentId = ref() const selectRows = ref([]) const projectId = ref(route.query.projectId) -const getProjectChargePersonUser=()=>{ - console.log('list',projectChargePersonUserList.value) - if(projectChargePersonUserList.value.length!==0){ - return projectChargePersonUserList.value.map(item=>item.name).join() +const getProjectChargePersonUser = () => { + console.log('list', projectChargePersonUserList.value) + if (projectChargePersonUserList.value.length !== 0) { + return projectChargePersonUserList.value.map(item => item.name).join() } // if(list[0]!==null){ // return list.map(item=>item.name).join() // } } -const getProjectPersonUser=(list)=>{ - console.log('list2',projectPersonUserList.value) +const getProjectPersonUser = (list) => { + console.log('list2', projectPersonUserList.value) // if(list!=null){ // return list.map(item=>item.name).join() // } @@ -270,7 +270,7 @@ const projectPersonUserPickerOk = (userList) => { userIds.push(user.id) } // localFormData.value.projectPersonIds = userIds - console.log(userList,projectPersonUserList.value) + console.log(userList, projectPersonUserList.value) } const getPreProcessList = () => { loading.value = true @@ -415,13 +415,13 @@ const handleSubmit = async () => { fileList: files, singleFile: attachment.value.singleFile, projectId: projectId.value, - projectChargePerson: parseInt(projectChargePersonUserList.value[0].id), - projectPersonIds: projectPersonIds, preProcess: JSON.stringify(localFormData.value.preProcess) } console.log(params) let res if (props.step === '20') { + params.projectChargePersonq = parseInt(projectChargePersonUserList.value[0].id) + params.projectPersonIds = projectPersonIds if (props.mode === 'resubmit') { res = await resubmitApply(params) } else { @@ -498,15 +498,15 @@ const init = async () => { } watchEffect(() => { - if(props.formData.projectChargePerson==null){ - // projectChargePersonUserList.value = [] - }else { + if (props.formData.projectChargePerson == null) { + // projectChargePersonUserList.value = [] + } else { projectChargePersonUserList.value = [props.formData.projectChargePerson] } // console.log('props.formData.projectPersonList',props.formData.projectPersonList) projectPersonUserList.value = props.formData.projectPersonList ? props.formData.projectPersonList : [] let flag = Object.keys(props.formData).length && (localFormData.value = props.formData) - if(props.formData.projectChargePerson!=null){ + if (props.formData.projectChargePerson != null) { localFormData.value.projectChargePerson = props.formData.projectChargePerson.id } // localFormData.value.projectPersonIds = [] diff --git a/src/views/project-management/implementation/phase.vue b/src/views/project-management/implementation/phase.vue index 54ab532..e567124 100644 --- a/src/views/project-management/implementation/phase.vue +++ b/src/views/project-management/implementation/phase.vue @@ -125,9 +125,9 @@ const getAttachment = (val) => { showSingleTable.value = true }) } -watch(() => singleList.value, (newVal) => { - showSingleTable.value = newVal.length !== 0; -}, {deep: true}) +// watch(() => singleList.value, (newVal) => { +// showSingleTable.value = newVal.length !== 0; +// }, {deep: true}) const getOtherFile = (val) => { // console.log('上传文件getOtherFile', val) showTable.value = false @@ -149,6 +149,7 @@ const chooseUser = () => { userPicker.value.showUserPicker() } const chooseUserInfo = () => { + if(userList.value==null)return; if (userList.value.length > 0) { return userList.value.map(item => { return item.name @@ -158,17 +159,7 @@ const chooseUserInfo = () => { } } const selected = (select) => { - let userInfoList = [] - for (let val of select) { - let userInfo = { - id: val.id, - name: val.name, - companyName: val.companyName, - accountType: val.accountType, - } - userInfoList.push(userInfo) - } - userList.value = userInfoList + userList.value = select } const handleSubmit = async () => { let files = [] @@ -176,7 +167,7 @@ const handleSubmit = async () => { files.push(getFileParam(item)) }) let userIds = [] - if (userList.value.length > 0) { + if (userList.value&&userList.value.length > 0) { userIds = userList.value?.map(item => { return item.id }) @@ -203,6 +194,7 @@ const handleSubmit = async () => { } else { attachment.value.clearValidate() } + console.log('params',params) let res = await submitPhaseChange(params) ElNotification({ title: '提示', @@ -224,7 +216,7 @@ const handleResubmit = (instance) => { }) } let userIds = [] - if (userList.value.length > 0) { + if (userList.value&&userList.value.length > 0) { userIds = userList.value?.map(item => { return item.id }) @@ -294,7 +286,7 @@ const getDetailInfo = async () => { type: res.code === 1000 ? 'success' : 'error' }) if (res.code === 1000) { - userList.value=res.data.userInfoList + userList.value=res.data.userInfoList?res.data.userInfoList:[] formData.value = res.data loading.value = false }