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

@@ -1,28 +1,28 @@
<template> <template>
<el-form :model="formData" ref="applyForm" :rules="rules" :label-position="labelPosition" style="margin-left: 5px"> <el-form :model="formData" ref="applyForm" :rules="rules" :label-position="labelPosition" style="margin-left: 5px">
<el-row> <el-row>
<!-- <el-col :span="24">-->
<!-- <el-form-item :label="label" prop="attachment" >-->
<!-- <template v-if="preview">-->
<!-- <file-upload @getFile="getAttachment" :multiple="false"-->
<!-- :disabled="singleFileArray?.length>0?true:false" title="如需修改需求申请书附件,请先删除文件再上传!"/>-->
<!-- <fvTable style="width: 100%;max-height: 80px;" height="80" v-if="singleFileArray?.length>0"-->
<!-- :tableConfig="editSingleTableConfig"-->
<!-- :data="singleFileArray" :isSettingCol="false" :pagination="false">-->
<!-- </fvTable>-->
<!-- </template>-->
<!-- <template v-else-if="!preview">-->
<!-- <file-upload @getFile="getAttachment" :multiple="false"-->
<!-- :disabled="isSingleFile"/>-->
<!-- <fvTable style="width: 100%;max-height: 80px;" v-if="showSingleTable" height="80"-->
<!-- :tableConfig="singleTableConfig"-->
<!-- :data="_singleFileValue" :isSettingCol="false" :pagination="false">-->
<!-- </fvTable>-->
<!-- </template>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<el-col :span="24"> <el-col :span="24">
<el-form-item :label="label" prop="attachment" > <el-form-item :label="label" prop="" required>
<template v-if="preview">
<file-upload @getFile="getAttachment" :multiple="false"
:disabled="singleFileArray?.length>0?true:false" title="如需修改需求申请书附件,请先删除文件再上传!"/>
<fvTable style="width: 100%;max-height: 80px;" height="80" v-if="singleFileArray?.length>0"
:tableConfig="editSingleTableConfig"
:data="singleFileArray" :isSettingCol="false" :pagination="false">
</fvTable>
</template>
<template v-else-if="!preview">
<file-upload @getFile="getAttachment" :multiple="false"
:disabled="isSingleFile"/>
<fvTable style="width: 100%;max-height: 80px;" v-if="showSingleTable" height="80"
:tableConfig="singleTableConfig"
:data="_singleFileValue" :isSettingCol="false" :pagination="false">
</fvTable>
</template>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="其他文件" :label-width="tag==='需求上报'?120:106">
<file-upload @getFile="getOtherFile"/> <file-upload @getFile="getOtherFile"/>
<fvTable style="width: 100%;max-height: 160px;" v-if="showTable" height="160" :tableConfig="tableConfig" <fvTable style="width: 100%;max-height: 160px;" v-if="showTable" height="160" :tableConfig="tableConfig"
:data="allFileList" :isSettingCol="false" :pagination="false"> :data="allFileList" :isSettingCol="false" :pagination="false">
@@ -240,11 +240,12 @@ const editSingleTableConfig = reactive({
}) })
const singleFileArray = ref([]) const singleFileArray = ref([])
const rules = reactive({ const rules = reactive({
attachment: [{required: true, message: '请上传附件', trigger: ['blur', 'change']}], // attachment: [{required: true, message: '请上传附件', trigger: ['blur', 'change']}],
}) })
const applyForm = ref() const applyForm = ref()
const singleFile = ref({}) const singleFile = ref({})
const isSingleFile = ref(false) const isSingleFile = ref(false)
const isHaveOneFile = ref(false)
const allFileList = ref([]) const allFileList = ref([])
if (localStorage.getItem('singleFile')) { if (localStorage.getItem('singleFile')) {
singleFileArray.value.push(JSON.parse(localStorage.getItem('singleFile'))) singleFileArray.value.push(JSON.parse(localStorage.getItem('singleFile')))
@@ -276,16 +277,18 @@ const _otherFileListValue = computed({
} }
}) })
if (_otherFileListValue.value && _otherFileListValue.value.length > 0) { if (_otherFileListValue.value && _otherFileListValue.value.length > 0) {
isHaveOneFile.value=true
_otherFileListValue.value.forEach(item => { _otherFileListValue.value.forEach(item => {
allFileList.value.push(item) allFileList.value.push(item)
}) })
} }
watch(() => props.showSingleTable, (newVal) => { // watch(() => props.showSingleTable, (newVal) => {
props.showSingleTable = newVal // props.showSingleTable = newVal
}, {deep: true}) // }, {deep: true})
watch(() => props.formData.fileList, (newVal) => { watch(() => props.formData.fileList, (newVal) => {
if (props.preview) { if (props.preview) {
newVal?.forEach(item => { newVal?.forEach(item => {
isHaveOneFile.value=true
allFileList.value.push(item) allFileList.value.push(item)
}) })
} }
@@ -329,6 +332,9 @@ watch(() => props.showTable, (newVal) => {
watch(() => isSingleFile.value, (newVal) => { watch(() => isSingleFile.value, (newVal) => {
isSingleFile.value = newVal isSingleFile.value = newVal
}, {deep: true}) }, {deep: true})
watch(() => isHaveOneFile.value, (newVal) => {
isHaveOneFile.value = newVal
}, {deep: true})
// watch(() => singleFile.value, (newVal) => { // watch(() => singleFile.value, (newVal) => {
// singleFile.value = newVal // singleFile.value = newVal
// }, {deep: true}) // }, {deep: true})
@@ -364,6 +370,7 @@ const handleDelete = (row, type) => {
_singleFileValue.value.splice(_singleFileValue.value.findIndex((item) => item.fileId === row.fileId), 1); _singleFileValue.value.splice(_singleFileValue.value.findIndex((item) => item.fileId === row.fileId), 1);
isSingleFile.value = false isSingleFile.value = false
} else { } else {
isHaveOneFile.value=false
allFileList.value.splice(allFileList.value.findIndex((item) => item.fileId === row.fileId), 1); allFileList.value.splice(allFileList.value.findIndex((item) => item.fileId === row.fileId), 1);
} }
} }
@@ -373,7 +380,6 @@ const handleSingleDelete = (row) => {
handleDelete(row, 'single') handleDelete(row, 'single')
} }
const getAttachment = (val) => { const getAttachment = (val) => {
// console.log('getAttachment', val)
isSingleFile.value = true isSingleFile.value = true
emit('getAttachment', val) emit('getAttachment', val)
} }
@@ -394,6 +400,7 @@ const getOtherFile = (val) => {
} else { } else {
allFileList.value = _otherFileListValue.value allFileList.value = _otherFileListValue.value
} }
isHaveOneFile.value=true
emit('getOtherFile', val) emit('getOtherFile', val)
} }
const deleteAttachment = (val) => { const deleteAttachment = (val) => {
@@ -458,7 +465,8 @@ defineExpose({
}, },
allFileList, allFileList,
singleFile, singleFile,
isSingleFile isSingleFile,
isHaveOneFile,
}) })
</script> </script>

View File

@@ -259,22 +259,22 @@ const schema = computed(() => {
} }
} }
arr.push(preProcess) arr.push(preProcess)
arr.push({ // arr.push({
label: '项目立项附件', // label: '项目立项附件',
prop: 'singleFile', // prop: 'singleFile',
colProps: { // colProps: {
span: 24 // span: 24
}, // },
labelWidth: 'left', // labelWidth: 'left',
component: () => { // component: () => {
let singleFileArray = [props.formData.singleFile] // let singleFileArray = [props.formData.singleFile]
return props.formData.singleFile ? <fvTable style="width: 100%;max-height: 80px;" height="80" // return props.formData.singleFile ? <fvTable style="width: 100%;max-height: 80px;" height="80"
tableConfig={editSingleTableConfig} // tableConfig={editSingleTableConfig}
data={singleFileArray} isSettingCol={false} pagination={false}> // data={singleFileArray} isSettingCol={false} pagination={false}>
</fvTable> // </fvTable>
: <span>--</span> // : <span>--</span>
} // }
}) // })
} else if (props.type == 'execute') { } else if (props.type == 'execute') {
arr = [{ arr = [{
label: '部门分管领导', label: '部门分管领导',
@@ -312,60 +312,60 @@ const schema = computed(() => {
} }
} }
arr.push(preProcess) arr.push(preProcess)
arr.push( // arr.push(
{ // {
label: '项目验收附件', // label: '项目验收附件',
prop: 'singleFile', // prop: 'singleFile',
colProps: { // colProps: {
span: 24 // span: 24
}, // },
labelWidth: 'left', // labelWidth: 'left',
component: () => { // component: () => {
let singleFileArray = [props.formData.singleFile] // let singleFileArray = [props.formData.singleFile]
return props.formData.singleFile ? <fvTable style="width: 100%;max-height: 80px;" height="80" // return props.formData.singleFile ? <fvTable style="width: 100%;max-height: 80px;" height="80"
tableConfig={editSingleTableConfig} // tableConfig={editSingleTableConfig}
data={singleFileArray} isSettingCol={false} pagination={false}> // data={singleFileArray} isSettingCol={false} pagination={false}>
</fvTable> // </fvTable>
: <span>--</span> // : <span>--</span>
} // }
}) // })
} else if (props.type == 'archivist') { } else if (props.type == 'archivist') {
arr = [ arr = [
{ // {
label: '项目归档附件', // label: '项目归档附件',
prop: 'singleFile', // prop: 'singleFile',
colProps: { // colProps: {
span: 24 // span: 24
}, // },
labelWidth: 'left', // labelWidth: 'left',
component: () => { // component: () => {
let singleFileArray = [props.formData.singleFile] // let singleFileArray = [props.formData.singleFile]
return props.formData.singleFile ? <fvTable style="width: 100%;max-height: 80px;" height="80" // return props.formData.singleFile ? <fvTable style="width: 100%;max-height: 80px;" height="80"
tableConfig={editSingleTableConfig} // tableConfig={editSingleTableConfig}
data={singleFileArray} isSettingCol={false} pagination={false}> // data={singleFileArray} isSettingCol={false} pagination={false}>
</fvTable> // </fvTable>
: <span>--</span> // : <span>--</span>
} // }
}, // },
] ]
} else if (props.type == 'phase') { } else if (props.type == 'phase') {
arr = [ arr = [
{ // {
label: '阶段变更附件', // label: '阶段变更附件',
prop: 'singleFile', // prop: 'singleFile',
colProps: { // colProps: {
span: 24 // span: 24
}, // },
labelWidth: 'left', // labelWidth: 'left',
component: () => { // component: () => {
let singleFileArray = [props.formData.singleFile] // let singleFileArray = [props.formData.singleFile]
return props.formData.singleFile ? <fvTable style="width: 100%;max-height: 80px;" height="80" // return props.formData.singleFile ? <fvTable style="width: 100%;max-height: 80px;" height="80"
tableConfig={editSingleTableConfig} // tableConfig={editSingleTableConfig}
data={singleFileArray} isSettingCol={false} pagination={false}> // data={singleFileArray} isSettingCol={false} pagination={false}>
</fvTable> // </fvTable>
: <span>--</span> // : <span>--</span>
} // }
}, // },
] ]
} }
return arr return arr

View File

@@ -1,6 +1,6 @@
<template> <template>
<el-form :label-position="labelAlign"> <el-form :label-position="labelAlign">
<el-form-item :label="title?'其他文件':''" v-if="fileListShow === 'READ' || fileListShow === 'EDIT'" :label-position="labelAlign" :label-width="title?95:''" :style="{marginTop: '10px',marginLeft: tag!=='需求上报'?'15px':'0'}"> <el-form-item :label="title" v-if="fileListShow === 'READ' || fileListShow === 'EDIT'" :label-position="labelAlign" :style="{marginTop: '10px',marginLeft: tag!=='需求上报'?'15px':'0'}">
<file-upload @getFile="getOtherFile" v-if="fileListShow === 'EDIT'"/> <file-upload @getFile="getOtherFile" v-if="fileListShow === 'EDIT'"/>
<!-- :style="{width:isOpenPrint?'610px': '100%'}" table-layout="auto" id="printTable"--> <!-- :style="{width:isOpenPrint?'610px': '100%'}" table-layout="auto" id="printTable"-->
<fvTable style="width:100%;max-height: 160px;" v-if="processViewer" height="160" :tableConfig="tableConfig" <fvTable style="width:100%;max-height: 160px;" v-if="processViewer" height="160" :tableConfig="tableConfig"

View File

@@ -491,17 +491,17 @@ const handleSubmit = async () => {
files.push(getFileParam(item)) files.push(getFileParam(item))
}) })
} }
if (attachment.value.singleFile == null) { // if (!attachment.value.isHaveOneFile) {
attachment.value.validate() // attachment.value.validate()
ElNotification({ // ElNotification({
title: '提示', // title: '提示',
message: '请上传附件', // message: '请上传附件',
type: 'error' // type: 'error'
}) // })
return; // return;
} else { // } else {
attachment.value.clearValidate() // attachment.value.clearValidate()
} // }
let projectPersonIds = [] let projectPersonIds = []
for (const item of projectPersonUserList.value) { for (const item of projectPersonUserList.value) {
projectPersonIds.push(parseInt(item.id)) projectPersonIds.push(parseInt(item.id))

View File

@@ -553,20 +553,22 @@ const getBaseInfo = async () => {
const {code, data} = await getBaseInfoApi(route.query.projectId) const {code, data} = await getBaseInfoApi(route.query.projectId)
// console.log('data.procedure', data.procedure, route.query.step) // console.log('data.procedure', data.procedure, route.query.step)
if (route.query.step === '30'||route.query.step === '40') { if (route.query.step === '30'||route.query.step === '40') {
if (data.procedure.indexOf('30') == -1||data.procedure.indexOf('40') == -1) {
data.procedure.push('30')
data.procedure.push('40')
}
}
else if (route.query.step === '10'||route.query.step === '20') {
if (data.procedure.indexOf('40') != -1||data.procedure.indexOf('50') != -1) {
data.procedure.push('30')
}
}
else if (route.query.step === '50') {
if (data.procedure.indexOf('30') == -1) { if (data.procedure.indexOf('30') == -1) {
data.procedure.push('30') data.procedure.push('30')
} }
if (data.procedure.indexOf('40') == -1) {
data.procedure.push('40')
}
}
// else if (route.query.step === '10'||route.query.step === '20') {
// if (data.procedure.indexOf('40') != -1||data.procedure.indexOf('50') != -1) {
// data.procedure.push('30')
// }
// }
else if (route.query.step === '50') {
// if (data.procedure.indexOf('30') == -1) {
// data.procedure.push('30')
// }
if (data.procedure.indexOf('50') == -1) { if (data.procedure.indexOf('50') == -1) {
data.procedure.push('50') data.procedure.push('50')
} }

View File

@@ -254,10 +254,13 @@
</el-form> </el-form>
<baseTitle title="附件文件"></baseTitle> <baseTitle title="附件文件"></baseTitle>
<div :style="{marginRight:!formData.isSpecialFund?'20px':'80px'}"> <div :style="{marginRight:!formData.isSpecialFund?'20px':'80px'}">
<AttachmentUpload ref="attachment" label="需求申请书附件" :showTable="showTable" v-model:otherFileList="otherFileList" <AttachmentUpload ref="attachment" label="需求申请书附件"
@getAttachment="getAttachment" v-model:singleList="singleList" :showTable="showTable"
:showSingleTable="showSingleTable" v-model:otherFileList="otherFileList"
@getOtherFile="getOtherFile" :showFileList="true" :formData="formData" tag="需求上报" @getOtherFile="getOtherFile"
:showSingleTable="showSingleTable" @getAttachment="getAttachment"
v-model:singleList="singleList"
:showFileList="true" :formData="formData" tag="需求上报"
:preview="name === 'Summary/edit'"/> :preview="name === 'Summary/edit'"/>
</div> </div>
<div class="approval-record"> <div class="approval-record">
@@ -470,45 +473,44 @@ const handleSubmit = debounce(async (instance) => {
}) })
return; return;
} }
let otherFiles = [] let otherFiles = []
otherFileList.value.forEach(item => { otherFileList.value.forEach(item => {
otherFiles.push(getFileParam(item)) otherFiles.push(getFileParam(item))
})
formData.value.optionalChargeLeadership = optionalChargeLeadershipList.value
if (formData.value.singleFile !== undefined) {
formData.value.singleFile = getFileParam(formData.value.singleFile)
}
// if (!attachment.value.isHaveOneFile) {
// attachment.value.validate()
// ElNotification({
// title: '提示',
// message: '请上传附件',
// type: 'error'
// })
// return;
// } else {
// attachment.value.clearValidate()
// }
let params = {
...formData.value,
deploymentId: deploymentId.value,
fileList: otherFiles,
requirementId: route.query.id ? route.query.id : '-1'
}
console.log('params', params)
let res = await requirementReported(params)
ElNotification({
title: '提示',
message: res.msg,
type: res.code === 1000 ? 'success' : 'error'
})
if (res.code === 1000) {
tagsViewStore.delVisitedViews(router.currentRoute.value.path)
await router.push({
name: 'Summary'
}) })
formData.value.optionalChargeLeadership = optionalChargeLeadershipList.value }
if (formData.value.singleFile !== undefined) {
formData.value.singleFile = getFileParam(formData.value.singleFile)
}
if (!attachment.value.isSingleFile) {
attachment.value.validate()
ElNotification({
title: '提示',
message: '请上传附件',
type: 'error'
})
return;
} else {
attachment.value.clearValidate()
}
let params = {
...formData.value,
deploymentId: deploymentId.value,
fileList: otherFiles,
requirementId: route.query.id ? route.query.id : '-1'
}
console.log('params', params)
let res = await requirementReported(params)
ElNotification({
title: '提示',
message: res.msg,
type: res.code === 1000 ? 'success' : 'error'
})
if (res.code === 1000) {
tagsViewStore.delVisitedViews(router.currentRoute.value.path)
await router.push({
name: 'Summary'
})
}
}) })
}) })
const handleResubmit = debounce((instance) => { const handleResubmit = debounce((instance) => {
@@ -532,17 +534,17 @@ const handleResubmit = debounce((instance) => {
if (formData.value.isSpecialFund && formData.value.specialFund === null) { if (formData.value.isSpecialFund && formData.value.specialFund === null) {
formData.value.specialFund = getFundName(formData.value.specialFundId) formData.value.specialFund = getFundName(formData.value.specialFundId)
} }
if (attachment.value.singleFile == null) { // if (!attachment.value.isHaveOneFile) {
attachment.value.validate() // attachment.value.validate()
ElNotification({ // ElNotification({
title: '提示', // title: '提示',
message: '请上传附件', // message: '请上传附件',
type: 'error' // type: 'error'
}) // })
return; // return;
} else { // } else {
attachment.value.clearValidate() // attachment.value.clearValidate()
} // }
let params = { let params = {
...formData.value, ...formData.value,
deploymentId: deploymentId.value, deploymentId: deploymentId.value,

View File

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

View File

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

View File

@@ -3,7 +3,12 @@
<baseTitle title="项目基本信息"></baseTitle> <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> <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" <ApprovalDetail :formData="summaryData.formData" :data="summaryData" type="phase"
:processViewer="summaryProcessViewer" :loading="loading" :fileListShow="fileListShow" v-model:value="auditOpinion"/> :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> <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 loading = ref(false)
const auditOpinion = ref('') const auditOpinion = ref('')
const copyName = ref('') const copyName = ref('')
const changeState = ref('')
const fileListShow = ref('READ') const fileListShow = ref('READ')
const baseFormData = ref([]) const baseFormData = ref([])
const schema = computed(() => { const schema = computed(() => {
@@ -275,6 +281,7 @@ const getInfo = async () => {
if (code === 1000) { if (code === 1000) {
summaryData.value = data; summaryData.value = data;
copyName.value= data.formData.userInfoList?.map(item=>item.name).join('') copyName.value= data.formData.userInfoList?.map(item=>item.name).join('')
changeState.value= data.formData.changeState
loading.value = false loading.value = false
processStore.setDesign(data) processStore.setDesign(data)
processStore.runningList.value = data.runningList; processStore.runningList.value = data.runningList;