fix : 项目立项页面细节优化
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
<el-form :model="localFormData" ref="formRef" label-width="auto" :rules="rules" v-if="step!=='50'">
|
||||
<el-row>
|
||||
<el-col :span="24" v-if="title==='apply'">
|
||||
<el-form-item label="项目负责人" :required="true" prop="projectChargePerson"
|
||||
<el-form-item label="项目负责人" :required="true" prop="projectChargePerson"
|
||||
label-width="125">
|
||||
<el-button style="margin-right: 10px" color="#DED0B2" @click="handleShowProjectChargePersonTable">
|
||||
<!-- {{ localFormData.projectChargePerson ? '更改' : '请选择' }}-->
|
||||
{{projectChargePersonUserList.length!==0 ? '更改' : '请选择' }}
|
||||
<!-- {{ localFormData.projectChargePerson ? '更改' : '请选择' }}-->
|
||||
{{ projectChargePersonUserList.length !== 0 ? '更改' : '请选择' }}
|
||||
</el-button>
|
||||
<div v-for="item in projectChargePersonUserList" :key="item.id" style="margin-right: 5px">
|
||||
{{ item.name }}
|
||||
@@ -20,8 +20,8 @@
|
||||
<el-form-item label="项目成员" :required="true" prop="projectPerson"
|
||||
label-width="125">
|
||||
<el-button color="#DED0B2" style="margin-right: 10px" @click="handleShowProjectPersonTable">
|
||||
<!-- {{ localFormData.projectPersonIds ? '更改' : '请选择' }}-->
|
||||
{{projectPersonUserList.length!==0 ? '更改' : '请选择' }}
|
||||
<!-- {{ localFormData.projectPersonIds ? '更改' : '请选择' }}-->
|
||||
{{ projectPersonUserList.length !== 0 ? '更改' : '请选择' }}
|
||||
</el-button>
|
||||
<div v-for="item in projectPersonUserList" :key="item.id" style="margin-right: 5px">
|
||||
{{ 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 = []
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user