fix : 修改为一个文件上传入口, 阶段变更增加变更状态,修复项目实施显示

This commit is contained in:
2024-08-27 22:28:52 +08:00
parent a1a3c0ac9f
commit 50504f4e94
9 changed files with 252 additions and 214 deletions

View File

@@ -435,6 +435,7 @@ const handlePhaseChangeEdit = (row) => {
router.push({
name: 'Phase/edit',
query: {
id: row.requirementId,
projectId:row.projectId
}
})

View File

@@ -1,20 +1,29 @@
<template>
<div class="apply-block" v-loading="loading">
<baseTitle title="项目基本信息"></baseTitle>
<fvForm :schema="schema" @getInstance="(e)=>baseForm = e" label-position="left" label-width="left" style="margin-left: 15px"></fvForm>
<fvForm :schema="schema" @getInstance="(e)=>baseForm = e" label-position="left" label-width="left"
style="margin-left: 15px"></fvForm>
<baseTitle title="阶段变更信息" style="margin-top: -10px"></baseTitle>
<el-form :model="formData" label-width="auto">
<el-form :model="formData" label-width="auto" :rules="rules">
<el-form-item label="抄送人员" label-width="110">
<Ttsup :modelValue="chooseUserInfo()" @clickCopyUser="chooseUser"/>
</el-form-item>
<el-form-item label="变更状态" label-width="110" prop="changeState">
<el-select v-model="formData.changeState" placeholder="请选择变更状态" filterable clearable style="width: 300px">
<el-option v-for="item in cacheStore.getDict('fee_stage')" :key="item.value" :label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
</el-form>
<user-picker :multiple="true" ref="userPicker" title="请选择抄送人员" v-model:value="userList" @ok="ccPersonPickerOkOrCancel" @cancelOrClear="ccPersonPickerOkOrCancel"/>
<user-picker :multiple="true" ref="userPicker" title="请选择抄送人员" v-model:value="userList"
@ok="ccPersonPickerOkOrCancel" @cancelOrClear="ccPersonPickerOkOrCancel"/>
<AttachmentUpload ref="attachment" label="阶段变更附件" :showTable="showTable" v-model:otherFileList="otherFileList"
@getAttachment="getAttachment" v-model:singleList="singleList" :showSingleTable="showSingleTable"
@getAttachment="getAttachment" v-model:singleList="singleList" :showSingleTable="showSingleTable"
@getOtherFile="getOtherFile" :showFileList="true" :formData="formData" tag="阶段变更"
:preview="name === 'Phase/edit'"/>
<div class="approval-record" >
<div class="approval-title" style="margin-top: -15px">
<div class="approval-record">
<div class="approval-title" style="margin-top: -15px">
<baseTitle title="审批记录"></baseTitle>
<div class="diagram">
<div class="base-title">流程图</div>
@@ -24,8 +33,9 @@
/>
</div>
</div>
<el-empty :image-size="100" description="暂无审批记录" v-if="processDiagramViewer&& !opentionData?.operationList&&!changeDiagram"/>
<!-- <process-diagram-viewer mode="view" v-if="processDiagramViewer&&changeDiagram"/>-->
<el-empty :image-size="100" description="暂无审批记录"
v-if="processDiagramViewer&& !opentionData?.operationList&&!changeDiagram"/>
<!-- <process-diagram-viewer mode="view" v-if="processDiagramViewer&&changeDiagram"/>-->
<div class="process">
<operation-render
v-if="processDiagramViewer&& opentionData?.operationList && opentionData?.operationList.length > 0&&!changeDiagram"
@@ -55,6 +65,7 @@ import {getBaseInfoApi} from "@/components/steps/api";
import {useCacheStore} from '@/stores/cache.js'
import {toThousands} from '@/utils/changePrice.js'
const cacheStore = useCacheStore()
const changeDiagram = ref(false)
const tagsViewStore = useTagsView()
@@ -67,7 +78,9 @@ const showSingleTable = ref(false)
const singleList = ref([])
const name = ref(router.currentRoute.value.name)
const loading = ref(false)
const formData = ref({})
const formData = ref({
changeState:'1'
})
const file = ref({})
const deploymentId = ref()
const showTable = ref(true)
@@ -77,6 +90,9 @@ const processDiagramViewer = ref(true)
const userList = ref([])
const processStore = useProcessStore()
const baseFormData = ref([])
const rules = reactive({
changeState: [{required: true, message: '请选择变更状态', trigger: ['blur', 'change']}],
})
const schema = computed(() => {
return [
{
@@ -214,7 +230,7 @@ const schema = computed(() => {
<div>
{
baseFormData.value?.economicEstimate ?
<span>{ toThousands(baseFormData.value?.economicEstimate )}</span>
<span>{toThousands(baseFormData.value?.economicEstimate)}</span>
: <span>{'--'}</span>
}
</div>
@@ -330,9 +346,9 @@ const compositeParam = (item) => {
}
const getAttachment = (val) => {
// console.log('上传文件getAttachment', val)
showSingleTable.value=false
showSingleTable.value = false
formData.value.singleFile = compositeParam(val)
singleList.value.push( compositeParam(val))
singleList.value.push(compositeParam(val))
nextTick(() => {
showSingleTable.value = true
if (attachment.value.singleFile == null) {
@@ -372,7 +388,7 @@ const chooseUser = () => {
userPicker.value.showUserPicker()
}
const chooseUserInfo = () => {
if(userList.value==null)return;
if (userList.value == null) return;
if (userList.value.length > 0) {
return userList.value.map(item => {
return item.name
@@ -382,7 +398,7 @@ const chooseUserInfo = () => {
}
}
const ccPersonPickerOkOrCancel = (select) => {
console.log('select',select)
console.log('select', select)
userList.value = select
}
const handleSubmit = async () => {
@@ -391,7 +407,7 @@ const handleSubmit = async () => {
files.push(getFileParam(item))
})
let userIds = []
if (userList.value&&userList.value.length > 0) {
if (userList.value && userList.value.length > 0) {
userIds = userList.value?.map(item => {
return item.id
})
@@ -403,22 +419,23 @@ const handleSubmit = async () => {
deploymentId: deploymentId.value,
requirementId: route.query.id,
fileList: files,
singleFile: formData.value.singleFile,
// singleFile: formData.value.singleFile,
projectId: route.query.projectId,
userIds: userIds
userIds: userIds,
changeState:formData.value.changeState
}
if (!attachment.value.isSingleFile) {
attachment.value.validate()
ElNotification({
title: '提示',
message: '请上传附件',
type: 'error'
})
return;
} else {
attachment.value.clearValidate()
}
console.log('params',params)
// if (!attachment.value.isHaveOneFile) {
// attachment.value.validate()
// ElNotification({
// title: '提示',
// message: '请上传附件',
// type: 'error'
// })
// return;
// } else {
// attachment.value.clearValidate()
// }
console.log('params', params)
let res = await submitPhaseChange(params)
ElNotification({
title: '提示',
@@ -440,29 +457,30 @@ const handleResubmit = (instance) => {
})
}
let userIds = []
if (userList.value&&userList.value.length > 0) {
if (userList.value && userList.value.length > 0) {
userIds = userList.value?.map(item => {
return item.id
})
}
if (attachment.value.singleFile == null) {
attachment.value.validate()
ElNotification({
title: '提示',
message: '请上传附件',
type: 'error'
})
return;
} else {
attachment.value.clearValidate()
}
// if (!attachment.value.isHaveOneFile) {
// attachment.value.validate()
// ElNotification({
// title: '提示',
// message: '请上传附件',
// type: 'error'
// })
// return;
// } else {
// attachment.value.clearValidate()
// }
let params = {
deploymentId: deploymentId.value,
requirementId: route.query.id,
fileList: otherFiles,
singleFile: attachment.value.singleFile,
// singleFile: attachment.value.singleFile,
projectId: route.query.projectId,
userIds: userIds
userIds: userIds,
changeState:formData.value.changeState
}
// console.log('重新提交params', params)
resubmitPhaseForm(params).then(res => {
@@ -510,7 +528,7 @@ const getDetailInfo = async () => {
type: res.code === 1000 ? 'success' : 'error'
})
if (res.code === 1000) {
userList.value=res.data.formData.userInfoList?res.data.formData.userInfoList:[]
userList.value = res.data.formData.userInfoList ? res.data.formData.userInfoList : []
formData.value = res.data.formData
opentionData.value = res.data
loading.value = false
@@ -529,6 +547,6 @@ onMounted(async () => {
<style scoped>
.apply-block {
margin: 15px 0;
padding: 0 30px ;
padding: 0 30px;
}
</style>

View File

@@ -3,7 +3,12 @@
<baseTitle title="项目基本信息"></baseTitle>
<fvForm :schema="schema" @getInstance="(e)=>baseForm = e" label-position="left" label-width="left" style="margin-left: 15px"></fvForm>
<baseTitle title="阶段变更详情" style="margin-top: -10px"></baseTitle>
<div style="color: #606266;font-size: 14px;height:25px;"><span style="display:inline-block;text-align: right;margin-right: 14px;margin-left: 15px">抄送人</span>{{copyName?copyName:'--'}}</div>
<div style="color: #606266;font-size: 14px;height:32px;line-height: 32px"><span style="display:inline-block;text-align: right;margin-right: 14px;margin-left: 15px">抄送人</span>{{copyName?copyName:'--'}}</div>
<div style="color: #606266;font-size: 14px;display: flex;height:40px;line-height: 32px">
<span style="display:inline-block;text-align: right;margin-right: 14px;margin-left: 15px">变更状态</span>
<!-- {{changeState=='1'?'开发阶段':'研究阶段'}}-->
<tag dict-type="fee_stage" :value="changeState"/>
</div>
<ApprovalDetail :formData="summaryData.formData" :data="summaryData" type="phase"
:processViewer="summaryProcessViewer" :loading="loading" :fileListShow="fileListShow" v-model:value="auditOpinion"/>
<opinion v-if="summaryData.taskId" :formData="summaryData.formData" :taskId="summaryData.taskId" :taskUserOptionList="summaryData.taskUserOptionList" v-model:value="auditOpinion"></opinion>
@@ -28,6 +33,7 @@ const processStore = useProcessStore()
const loading = ref(false)
const auditOpinion = ref('')
const copyName = ref('')
const changeState = ref('')
const fileListShow = ref('READ')
const baseFormData = ref([])
const schema = computed(() => {
@@ -275,6 +281,7 @@ const getInfo = async () => {
if (code === 1000) {
summaryData.value = data;
copyName.value= data.formData.userInfoList?.map(item=>item.name).join('')
changeState.value= data.formData.changeState
loading.value = false
processStore.setDesign(data)
processStore.runningList.value = data.runningList;