fix : 修改阶段变更抄送人样式

This commit is contained in:
2024-06-10 00:44:20 +08:00
parent d3fe46f0bc
commit cb224ab437
2 changed files with 34 additions and 54 deletions

View File

@@ -1,12 +1,10 @@
<template> <template>
<el-button type="primary" link > <el-button color="#DED0B2" >
{{ modelValue || '请选择抄送人员' }} {{ modelValue || '请选择抄送人员' }}
</el-button> </el-button>
</template> </template>
<script setup> <script setup>
import { ref, watch, watchEffect } from 'vue';
const props = defineProps({ const props = defineProps({
modelValue: { modelValue: {
type: String, type: String,
@@ -22,4 +20,4 @@ const localText = ref('')
<style lang="scss" scoped> <style lang="scss" scoped>
</style> </style>

View File

@@ -1,9 +1,10 @@
<template> <template>
<div class="apply-block"> <div class="apply-block">
<div> <el-form :model="formData" label-width="auto">
抄送人员: <el-form-item label="抄送人员">
<Ttsup :modelValue="chooseUserInfo()" @click="chooseUser"/> <Ttsup :modelValue="chooseUserInfo()" @click="chooseUser"/>
</div> </el-form-item>
</el-form>
<user-picker :multiple="true" ref="userPicker" title="请选择抄送人员" v-model:value="userList" @ok="selected"/> <user-picker :multiple="true" ref="userPicker" title="请选择抄送人员" v-model:value="userList" @ok="selected"/>
<AttachmentUpload ref="attachment" label="阶段变更附件" :showTable="showTable" :otherFileList="otherFileList" <AttachmentUpload ref="attachment" label="阶段变更附件" :showTable="showTable" :otherFileList="otherFileList"
@getAttachment="getAttachment" @getAttachment="getAttachment"
@@ -62,7 +63,7 @@ const compositeParam = (item) => {
} }
const getAttachment = (val) => { const getAttachment = (val) => {
console.log('上传文件getAttachment', val) console.log('上传文件getAttachment', val)
file.value = compositeParam(val) formData.value.singleFile = compositeParam(val)
} }
const getOtherFile = (val) => { const getOtherFile = (val) => {
console.log('上传文件getOtherFile', val) console.log('上传文件getOtherFile', val)
@@ -85,11 +86,11 @@ const chooseUser = () => {
userPicker.value.showUserPicker() userPicker.value.showUserPicker()
} }
const chooseUserInfo = () => { const chooseUserInfo = () => {
if (userList.value.length > 0){ if (userList.value.length > 0) {
return userList.value.map(item => { return userList.value.map(item => {
return item.name return item.name
}).join(',') }).join('')
}else { } else {
return "请选择抄送人员" return "请选择抄送人员"
} }
} }
@@ -107,32 +108,27 @@ const selected = (select) => {
} }
const handleSubmit = async () => { const handleSubmit = async () => {
let files = [] let files = []
let singleFile = {} otherFileList.value?.forEach(item => {
let fileArray
if (file.value.fileId !== undefined) {
singleFile = {
fileId: file.value.fileId
}
}
fileArray = otherFileList.value
fileArray.forEach(item => {
files.push(getFileParam(item)) files.push(getFileParam(item))
}) })
let userIds = [] let userIds = []
if (userList.value.length > 0){ if (userList.value.length > 0) {
userIds = userList.value.map(item => { userIds = userList.value?.map(item => {
return item.id return item.id
}) })
} }
if (formData.value.singleFile !== undefined) {
formData.value.singleFile = getFileParam(formData.value.singleFile)
}
let params = { let params = {
deploymentId: deploymentId.value, deploymentId: deploymentId.value,
requirementId: route.query.id, requirementId: route.query.id,
fileList: files, fileList: files,
singleFile: singleFile, singleFile: formData.value.singleFile,
projectId: route.query.projectId, projectId: route.query.projectId,
userIds: userIds userIds: userIds
} }
if (JSON.stringify(singleFile) === "{}") { if (!attachment.value.isSingleFile) {
attachment.value.validate() attachment.value.validate()
ElNotification({ ElNotification({
title: '提示', title: '提示',
@@ -157,41 +153,19 @@ const handleSubmit = async () => {
} }
} }
const handleResubmit = (instance) => { const handleResubmit = (instance) => {
let singleFile = {}
let otherFiles = [] let otherFiles = []
let fileArray if (name.value === 'Phase/edit') {
if (attachment.value.singleFile !== null && name.value === 'Phase/edit') { attachment.value.allFileList?.forEach(item => {
singleFile = { otherFiles.push(getFileParam(item))
fileId: attachment.value.singleFile.fileId })
}
fileArray = attachment.value.allFileList
} else {
if (file.value.fileId !== undefined) {
singleFile = {
fileId: file.value.fileId
}
}
fileArray = otherFileList.value
} }
fileArray.forEach(item => {
otherFiles.push(getFileParam(item))
})
let userIds = [] let userIds = []
if (userList.value.length > 0){ if (userList.value.length > 0) {
userIds = userList.value.map(item => { userIds = userList.value?.map(item => {
return item.id return item.id
}) })
} }
//todo requirementId if (attachment.value.singleFile == null) {
let params = {
deploymentId: deploymentId.value,
requirementId: route.query.id,
fileList: otherFiles,
singleFile: singleFile,
projectId: route.query.projectId,
userIds: userIds
}
if (JSON.stringify(singleFile) === "{}") {
attachment.value.validate() attachment.value.validate()
ElNotification({ ElNotification({
title: '提示', title: '提示',
@@ -202,6 +176,14 @@ const handleResubmit = (instance) => {
} else { } else {
attachment.value.clearValidate() attachment.value.clearValidate()
} }
let params = {
deploymentId: deploymentId.value,
requirementId: route.query.id,
fileList: otherFiles,
singleFile: attachment.value.singleFile,
projectId: route.query.projectId,
userIds: userIds
}
console.log('重新提交params', params) console.log('重新提交params', params)
resubmitPhaseForm(params).then(res => { resubmitPhaseForm(params).then(res => {
ElNotification({ ElNotification({