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

View File

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