Merge pull request 'fix : 重新提交页面初始化' (#216) from dj into master

Reviewed-on: http://git.feashow.cn/clay/mosr-web/pulls/216
This commit is contained in:
2024-05-20 09:56:49 +00:00
8 changed files with 270 additions and 60 deletions

View File

@@ -221,7 +221,7 @@
</el-form> </el-form>
<AttachmentUpload ref="attachment" label="需求申请书附件" :showTable="showTable" :otherFileList="otherFileList" <AttachmentUpload ref="attachment" label="需求申请书附件" :showTable="showTable" :otherFileList="otherFileList"
@getAttachment="getAttachment" @getAttachment="getAttachment"
@getOtherFile="getOtherFile" :showFileList="true" :formData="formData" :preview="router.currentRoute.value.name === 'Summary/edit'"/> @getOtherFile="getOtherFile" :showFileList="true" :formData="formData" :preview="name === 'Summary/edit'"/>
<!-- <fvForm :schema="schame" @getInstance="getInstance"></fvForm>--> <!-- <fvForm :schema="schame" @getInstance="getInstance"></fvForm>-->
<div class="approval-record"> <div class="approval-record">
<baseTitle title="流程"></baseTitle> <baseTitle title="流程"></baseTitle>
@@ -250,13 +250,13 @@ const cacheStore = useCacheStore()
const processStore = useProcessStore() const processStore = useProcessStore()
const router = useRouter() const router = useRouter()
const route = useRoute() const route = useRoute()
const attachment = ref()
const name=ref(router.currentRoute.value.name) const name=ref(router.currentRoute.value.name)
const loading = ref(false) const loading = ref(false)
const processDiagramViewer = ref(false) const processDiagramViewer = ref(false)
const tagsViewStore = useTagsView() const tagsViewStore = useTagsView()
const companyOption = ref([]) const companyOption = ref([])
const summaryForm = ref() const summaryForm = ref()
const attachment = ref()
const deploymentId = ref() const deploymentId = ref()
const showTable = ref(true) const showTable = ref(true)
const otherFileList = ref([]) const otherFileList = ref([])
@@ -412,6 +412,7 @@ const handleResubmit = () => {
fileArray.forEach(item => { fileArray.forEach(item => {
otherFiles.push(getFileParam(item)) otherFiles.push(getFileParam(item))
}) })
//todo requirementId
let params={ let params={
...formData.value, ...formData.value,
deploymentId: deploymentId.value, deploymentId: deploymentId.value,
@@ -421,14 +422,16 @@ const handleResubmit = () => {
} }
console.log('重新提交params',params) console.log('重新提交params',params)
resubmitReported(params).then(res => { resubmitReported(params).then(res => {
ElNotification({
title: '提示',
message: res.msg,
type: res.code === 1000 ? 'success' : 'error'
})
if (res.code === 1000) { if (res.code === 1000) {
ElMessage.success(res.msg)
tagsViewStore.delVisitedViews(router.currentRoute.value.path) tagsViewStore.delVisitedViews(router.currentRoute.value.path)
router.push({ router.push({
name: 'Summary' name: 'Summary'
}) })
} else {
ElMessage.error(res.msg)
} }
}) })
} }

View File

@@ -121,11 +121,11 @@ const tableConfig = reactive({
align: 'center', align: 'center',
showOverflowTooltip: false, showOverflowTooltip: false,
currentRender: ({row, index}) => { currentRender: ({row, index}) => {
let btn = [{label: '详情', func: () => handleDetail(row), type: 'primary'},{label: '编辑', func: () => handleEdit(row), type: 'primary'},{label: '上报', func: () => handleAdd(row), type: 'primary'}] let btn = [{label: '详情', func: () => handleDetail(row), type: 'primary'}]
// if (row.state === '3') { // if (row.state === '3') {
// btn.push({label: '编辑', func: () => handleEdit(row), type: 'primary'}) btn.push({label: '编辑', func: () => handleEdit(row), type: 'primary'})
// } else if (row.state === '0') { // } else if (row.state === '0') {
// btn.push({label: '上报', func: () => handleAdd(row), type: 'primary'}) btn.push({label: '上报', func: () => handleAdd(row), type: 'primary'})
// } // }
return ( return (
<div style={{width: '100%'}}> <div style={{width: '100%'}}>
@@ -169,7 +169,6 @@ const handleAdd = (row) => {
router.push({ router.push({
name: 'Summary/add', name: 'Summary/add',
query: { query: {
isAdd: 1,
id:row.requirementId id:row.requirementId
} }
}) })

View File

@@ -2,9 +2,9 @@
<div class="apply-block"> <div class="apply-block">
<el-form :model="formData" ref="applyForm" label-width="auto" :rules="rules"> <el-form :model="formData" ref="applyForm" label-width="auto" :rules="rules">
<baseTitle title="项目结项"></baseTitle> <baseTitle title="项目结项"></baseTitle>
<AttachmentUpload label="项目结项附件" :showTable="showTable" :otherFileList="otherFileList" <AttachmentUpload ref="attachment" label="项目结项附件" :showTable="showTable" :otherFileList="otherFileList"
@getAttachment="getAttachment" @getAttachment="getAttachment"
@getOtherFile="getOtherFile" :showFileList="true"/> @getOtherFile="getOtherFile" :showFileList="true" :formData="formData" :preview="name === 'Filing/edit'"/>
<div class="approval-record"> <div class="approval-record">
<baseTitle title="流程"></baseTitle> <baseTitle title="流程"></baseTitle>
<process-diagram-viewer mode="view" v-if="processDiagramViewer"/> <process-diagram-viewer mode="view" v-if="processDiagramViewer"/>
@@ -12,6 +12,7 @@
</el-form> </el-form>
<div class="oper-page-btn"> <div class="oper-page-btn">
<el-button color="#DED0B2" @click="handleSubmit(applyForm)">提交</el-button> <el-button color="#DED0B2" @click="handleSubmit(applyForm)">提交</el-button>
<el-button color="#DED0B2" @click="handleResubmit">重新提交</el-button>
</div> </div>
</div> </div>
</template> </template>
@@ -23,12 +24,16 @@ import {downloadFile} from "@/api/project-demand";
import {ElNotification} from "element-plus"; import {ElNotification} from "element-plus";
import {useProcessStore} from '@/stores/processStore.js'; import {useProcessStore} from '@/stores/processStore.js';
import {getProjectConclusionProcess, projectConclusion} from "@/api/project-manage"; import {getProjectConclusionProcess, projectConclusion} from "@/api/project-manage";
const router = useRouter()
const route = useRoute()
const tagsViewStore = useTagsView() const tagsViewStore = useTagsView()
const formData = ref({}) const formData = ref({})
const rules = reactive({ const rules = reactive({
attachment: [{required: true, message: '请上传项目结项附件', trigger: 'blur'}], attachment: [{required: true, message: '请上传项目结项附件', trigger: 'blur'}],
}) })
const attachment = ref()
const name=ref(router.currentRoute.value.name)
const loading = ref(false)
const file = ref({}) const file = ref({})
const applyForm = ref() const applyForm = ref()
const deploymentId = ref() const deploymentId = ref()
@@ -37,8 +42,6 @@ const otherFileList = ref([])
const processInstanceData = ref() const processInstanceData = ref()
const processDiagramViewer = ref(true) const processDiagramViewer = ref(true)
const processStore = useProcessStore() const processStore = useProcessStore()
const router = useRouter()
const route = useRoute()
const tableConfig = reactive({ const tableConfig = reactive({
columns: [ columns: [
{ {
@@ -90,7 +93,7 @@ const handleDownload = (row) => {
} }
const compositeParam = (item) => { const compositeParam = (item) => {
let tag = '' let tag = ''
if (router.currentRoute.value.name === 'Filing/conclusion') { if (name.value === 'Filing/conclusion'||name.value === 'Filing/edit') {
tag = '项目结项' tag = '项目结项'
} }
return { return {
@@ -99,7 +102,6 @@ const compositeParam = (item) => {
originalFileName: item.originalFilename, originalFileName: item.originalFilename,
fileType: item.fileType, fileType: item.fileType,
url: item.url, url: item.url,
processNodeTag: null,
tag: tag tag: tag
} }
} }
@@ -119,8 +121,7 @@ const getOtherFile = (val) => {
const getFileParam = (item) => { const getFileParam = (item) => {
return { return {
fileId: item.fileId, fileId: item.fileId
type: item.type
} }
} }
const handleSubmit = (instance) => { const handleSubmit = (instance) => {
@@ -165,6 +166,62 @@ const handleSubmit = (instance) => {
} }
}) })
} }
const handleResubmit = () => {
let singleFile = {}
let otherFiles = []
let fileArray
if(name.value === 'Filing/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
}
fileArray.forEach(item => {
otherFiles.push(getFileParam(item))
})
//todo requirementId
let params={
deploymentId: deploymentId.value,
requirementId: route.query.id,
files: otherFiles,
singleFile: singleFile,
projectId:route.query.projectId,
}
console.log('重新提交params',params)
// resubmitReported(params).then(res => {
// ElNotification({
// title: '提示',
// message: res.msg,
// type: res.code === 1000 ? 'success' : 'error'
// })
// if (res.code === 1000) {
// tagsViewStore.delVisitedViews(router.currentRoute.value.path)
// router.push({
// name: 'Filing'
// })
// }
// })
}
const getDetailInfo = async () => {
// getDetail(route.query.projectId).then(res => {
// ElNotification({
// title: '提示',
// message: res.msg,
// type: res.code === 1000 ? 'success' : 'error'
// })
// if (res.code === 1000) {
// formData.value = res.data.formData
// loading.value=false
// }
// })
}
const init = () => { const init = () => {
getProjectConclusionProcess().then(res => { getProjectConclusionProcess().then(res => {
processDiagramViewer.value = false processDiagramViewer.value = false
@@ -184,7 +241,14 @@ const init = () => {
} }
}) })
} }
init() onMounted(async () => {
loading.value=true
await init()
if (route.query.projectId) {
await getDetailInfo()
}
})
</script> </script>
<style scoped> <style scoped>

View File

@@ -146,12 +146,13 @@ const tableConfig = reactive({
align: 'center', align: 'center',
showOverflowTooltip: false, showOverflowTooltip: false,
currentRender: ({row, index}) => { currentRender: ({row, index}) => {
let btn = [{label: '详情', func: () => handleDetail(row), type: 'primary'},{label: '结项', func: () => handleConclusion(row), type: 'primary'}] let btn = [{label: '详情', func: () => handleDetail(row), type: 'primary'}]
if (row.state === '3') { // if (row.state === '3') {
btn.push({label: '附件', func: () => handleCheck(row), type: 'primary'}) btn.push({label: '附件', func: () => handleCheck(row), type: 'primary'})
} else if (row.state === '4') { // } else if (row.state === '4') {
btn.push({label: '结项', func: () => handleConclusion(row), type: 'primary'}) btn.push({label: '结项', func: () => handleConclusion(row), type: 'primary'})
} btn.push({label: '编辑', func: () => handleEdit(row), type: 'primary'})
// }
return ( return (
<div style={{width: '100%'}}> <div style={{width: '100%'}}>
{ {
@@ -197,4 +198,13 @@ const handleConclusion = (row) => {
} }
}) })
} }
const handleEdit = (row) => {
router.push({
name:'Filing/edit',
query: {
id: row.requirementId,
projectId: row.projectId
}
})
}
</script> </script>

View File

@@ -10,15 +10,16 @@
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
<AttachmentUpload label="项目验收附件" :showTable="showTable" :otherFileList="otherFileList" <AttachmentUpload ref="attachment" label="项目验收附件" :showTable="showTable" :otherFileList="otherFileList"
@getAttachment="getAttachment" @getAttachment="getAttachment"
@getOtherFile="getOtherFile" :showFileList="true"/> @getOtherFile="getOtherFile" :showFileList="true" :formData="formData" :preview="name === 'Implementation/edit'"/>
<div class="approval-record"> <div class="approval-record">
<baseTitle title="流程"></baseTitle> <baseTitle title="流程"></baseTitle>
<process-diagram-viewer mode="view" v-if="processDiagramViewer"/> <process-diagram-viewer mode="view" v-if="processDiagramViewer"/>
</div> </div>
<div class="oper-page-btn"> <div class="oper-page-btn">
<el-button color="#DED0B2" @click="handleSubmit(applyForm)">提交</el-button> <el-button color="#DED0B2" @click="handleSubmit(applyForm)">提交</el-button>
<el-button color="#DED0B2" @click="handleResubmit">重新提交</el-button>
</div> </div>
</div> </div>
</template> </template>
@@ -29,7 +30,13 @@ import {getProjectCheckProcess, projectCheck} from "@/api/project-manage";
import {ElNotification} from "element-plus"; import {ElNotification} from "element-plus";
import {useProcessStore} from '@/stores/processStore.js'; import {useProcessStore} from '@/stores/processStore.js';
import {useTagsView} from '@/stores/tagsview.js' import {useTagsView} from '@/stores/tagsview.js'
import {getDetail, resubmitReported} from "../../project-demand/summary/api";
const tagsViewStore = useTagsView() const tagsViewStore = useTagsView()
const router = useRouter()
const route = useRoute()
const attachment = ref()
const name=ref(router.currentRoute.value.name)
const loading = ref(false)
const formData = ref({}) const formData = ref({})
const file = ref({}) const file = ref({})
const applyForm = ref() const applyForm = ref()
@@ -39,11 +46,9 @@ const otherFileList = ref([])
const processInstanceData = ref() const processInstanceData = ref()
const processDiagramViewer = ref(true) const processDiagramViewer = ref(true)
const processStore = useProcessStore() const processStore = useProcessStore()
const router = useRouter()
const route = useRoute()
const compositeParam = (item) => { const compositeParam = (item) => {
let tag='' let tag=''
if(router.currentRoute.value.name==='Implementation/check'){ if(name.value==='Implementation/check'||name.value === 'Implementation/edit'){
tag='项目验收' tag='项目验收'
} }
return { return {
@@ -52,7 +57,6 @@ const compositeParam = (item) => {
originalFileName: item.originalFilename, originalFileName: item.originalFilename,
fileType: item.fileType, fileType: item.fileType,
url: item.url, url: item.url,
processNodeTag: null,
tag: tag tag: tag
} }
} }
@@ -72,8 +76,7 @@ const getOtherFile = (val) => {
const getFileParam = (item) => { const getFileParam = (item) => {
return { return {
fileId: item.fileId, fileId: item.fileId
type: item.type
} }
} }
const handleSubmit = (instance) => { const handleSubmit = (instance) => {
@@ -88,12 +91,21 @@ const handleSubmit = (instance) => {
if (!valid) return if (!valid) return
let files = [] let files = []
let singleFile={} let singleFile={}
if(file.value.fileId!==undefined){ let fileArray
if(name.value === 'Implementation/edit'){
singleFile = { singleFile = {
fileId: file.value.fileId fileId: attachment.value.singleFile.fileId
} }
fileArray=attachment.value.allFileList
}else {
if (file.value.fileId !== undefined) {
singleFile = {
fileId: file.value.fileId
}
}
fileArray=otherFileList.value
} }
otherFileList.value.forEach(item => { fileArray.forEach(item => {
files.push(getFileParam(item)) files.push(getFileParam(item))
}) })
let params = { let params = {
@@ -118,6 +130,62 @@ const handleSubmit = (instance) => {
} }
}) })
} }
const handleResubmit = () => {
let singleFile = {}
let otherFiles = []
let fileArray
if(name.value === 'Implementation/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
}
fileArray.forEach(item => {
otherFiles.push(getFileParam(item))
})
//todo requirementId
let params={
deploymentId: deploymentId.value,
requirementId: route.query.id,
files: otherFiles,
singleFile: singleFile,
projectId:route.query.projectId,
}
console.log('重新提交params',params)
// resubmitReported(params).then(res => {
// ElNotification({
// title: '提示',
// message: res.msg,
// type: res.code === 1000 ? 'success' : 'error'
// })
// if (res.code === 1000) {
// tagsViewStore.delVisitedViews(router.currentRoute.value.path)
// router.push({
// name: 'Implementation'
// })
// }
// })
}
const getDetailInfo = async () => {
// getDetail(route.query.projectId).then(res => {
// ElNotification({
// title: '提示',
// message: res.msg,
// type: res.code === 1000 ? 'success' : 'error'
// })
// if (res.code === 1000) {
// formData.value = res.data.formData
// loading.value=false
// }
// })
}
const init = () => { const init = () => {
getProjectCheckProcess().then(res => { getProjectCheckProcess().then(res => {
processDiagramViewer.value = false processDiagramViewer.value = false
@@ -137,7 +205,14 @@ const init = () => {
} }
}) })
} }
init() onMounted(async () => {
loading.value=true
await init()
if (route.query.projectId) {
await getDetailInfo()
}
})
</script> </script>
<style scoped> <style scoped>

View File

@@ -150,15 +150,16 @@ const tableConfig = reactive({
align: 'center', align: 'center',
showOverflowTooltip: false, showOverflowTooltip: false,
currentRender: ({row, index}) => { currentRender: ({row, index}) => {
let btn = [{label: '详情', func: () => handleDetail(row), type: 'primary'},{label: '验收', func: () => handleCheck(row), type: 'primary'}] let btn = [{label: '详情', func: () => handleDetail(row), type: 'primary'}]
if (row.state === '3') { // if (row.state === '3') {
btn.push( btn.push(
{label: '验收', func: () => handleCheck(row), type: 'primary'}, {label: '验收', func: () => handleCheck(row), type: 'primary'},
{label: '编辑', func: () => handleEdit(row), type: 'primary'},
{label: '台账', func: () => handleStandingBook(row), type: 'primary'}, {label: '台账', func: () => handleStandingBook(row), type: 'primary'},
{label: '附件', func: () => handleAttachment(row), type: 'primary'}, {label: '附件', func: () => handleAttachment(row), type: 'primary'},
{label: '查看分摊', func: () => handleShare(row), type: 'primary'} {label: '查看分摊', func: () => handleShare(row), type: 'primary'}
) )
} // }
return ( return (
<div style={{width: '100%'}}> <div style={{width: '100%'}}>
{ {
@@ -207,6 +208,15 @@ const handleCheck = (row) => {
} }
}) })
} }
const handleEdit = (row) => {
router.push({
name: 'Implementation/edit',
query: {
id: row.requirementId,
projectId: row.projectId
}
})
}
const handleStandingBook = (row) => { const handleStandingBook = (row) => {
router.push({ router.push({
name: 'Implementation/account', name: 'Implementation/account',

View File

@@ -12,7 +12,7 @@
</el-form> </el-form>
<AttachmentUpload ref="attachment" label="需求申请书附件" :showTable="showTable" :otherFileList="otherFileList" <AttachmentUpload ref="attachment" label="需求申请书附件" :showTable="showTable" :otherFileList="otherFileList"
@getAttachment="getAttachment" @getAttachment="getAttachment"
@getOtherFile="getOtherFile" :showFileList="true"/> @getOtherFile="getOtherFile" :showFileList="true" :formData="formData" :preview="name === 'Initiation/edit'"/>
<div class="approval-record"> <div class="approval-record">
<baseTitle title="流程"></baseTitle> <baseTitle title="流程"></baseTitle>
<process-diagram-viewer mode="view" v-if="processDiagramViewer"/> <process-diagram-viewer mode="view" v-if="processDiagramViewer"/>
@@ -40,6 +40,7 @@ const rules = reactive({
}) })
const processStore = useProcessStore() const processStore = useProcessStore()
const deploymentId = ref() const deploymentId = ref()
const attachment = ref()
const file = ref({}) const file = ref({})
const applyForm = ref() const applyForm = ref()
const showTable = ref(true) const showTable = ref(true)
@@ -84,21 +85,21 @@ const tableConfig = reactive({
// } // }
] ]
}) })
const loading = ref(false)
const processInstanceData = ref() const processInstanceData = ref()
const processDiagramViewer = ref(true) const processDiagramViewer = ref(true)
const compositeParam = (item, type) => { const name=ref(router.currentRoute.value.name)
const compositeParam = (item) => {
let tag = '' let tag = ''
if (router.currentRoute.value.name === 'Initiation/apply') { if (name.value === 'Initiation/apply'||name.value === 'Initiation/edit') {
tag = '项目立项申请' tag = '项目立项申请'
} }
return { return {
fileId: item.id, fileId: item.id,
size: item.size, size: item.size,
type: type,
originalFileName: item.originalFilename, originalFileName: item.originalFilename,
fileType: item.fileType, fileType: item.fileType,
url: item.url, url: item.url,
processNodeTag: null,
tag:tag tag:tag
} }
} }
@@ -117,8 +118,7 @@ const getOtherFile = (val) => {
} }
const getFileParam = (item) => { const getFileParam = (item) => {
return { return {
fileId: item.fileId, fileId: item.fileId
type: item.type
} }
} }
const handleSubmit = (instance) => { const handleSubmit = (instance) => {
@@ -162,18 +162,59 @@ const handleSubmit = (instance) => {
} }
}) })
} }
const handleResubmit = () => { const handleResubmit =async () => {
resubmit(submitParam(formData.value)).then(res => { let files = []
if (res.code === 1000) { let singleFile={}
ElMessage.success(res.msg) let fileArray
tagsViewStore.delVisitedViews(router.currentRoute.value.path) if(name.value === 'Initiation/edit'){
router.push({ singleFile = {
name: 'Collection' fileId: attachment.value.singleFile.fileId
})
} else {
ElMessage.error(res.msg)
} }
fileArray=attachment.value.allFileList
}else {
if (file.value.fileId !== undefined) {
singleFile = {
fileId: file.value.fileId
}
}
fileArray=otherFileList.value
}
fileArray.forEach(item => {
files.push(getFileParam(item))
}) })
let params = {
deploymentId: deploymentId.value,
requirementId: route.query.id,
files: files,
singleFile: singleFile,
projectId:route.query.projectId,
}
console.log('params',params)
// let res = await resubmit(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: 'Initiation'
// })
// }
}
const getDetailInfo = async () => {
// getDetail(route.query.projectId).then(res => {
// ElNotification({
// title: '提示',
// message: res.msg,
// type: res.code === 1000 ? 'success' : 'error'
// })
// if (res.code === 1000) {
// formData.value = res.data.formData
// loading.value=false
// }
// })
} }
const init = () => { const init = () => {
getProcessInfo().then(res => { getProcessInfo().then(res => {
@@ -195,6 +236,14 @@ const init = () => {
}) })
} }
init() init()
onMounted(async () => {
loading.value=true
await init()
if (route.query.projectId) {
await getDetailInfo()
}
})
</script> </script>
<style scoped> <style scoped>

View File

@@ -147,11 +147,11 @@ const tableConfig = reactive({
showOverflowTooltip: false, showOverflowTooltip: false,
currentRender: ({row, index}) => { currentRender: ({row, index}) => {
let btn = [{label: '详情', func: () => handleDetail(row), type: 'primary'}] let btn = [{label: '详情', func: () => handleDetail(row), type: 'primary'}]
if (row.state === '3') { // if (row.state === '3') {
btn.push({label: '编辑', func: () => handleEdit(row), type: 'primary'}) btn.push({label: '编辑', func: () => handleEdit(row), type: 'primary'})
} else if (row.state === '0') { // } else if (row.state === '0') {
btn.push({label: '申请', func: () => handleApply(row), type: 'primary'}) btn.push({label: '申请', func: () => handleApply(row), type: 'primary'})
} // }
return ( return (
<div style={{width: '100%'}}> <div style={{width: '100%'}}>
{ {
@@ -193,7 +193,8 @@ const handleEdit = (row) => {
router.push({ router.push({
name:'Initiation/edit', name:'Initiation/edit',
query: { query: {
id: row.requirementId id: row.requirementId,
projectId: row.projectId
} }
}) })
} }
@@ -201,7 +202,6 @@ const handleApply = (row) => {
router.push({ router.push({
name:'Initiation/apply', name:'Initiation/apply',
query: { query: {
isAdd: 1,
id: row.requirementId, id: row.requirementId,
projectId: row.projectId projectId: row.projectId
} }