fix : 修复项目申请/验收/结项功能

This commit is contained in:
2024-05-19 20:39:54 +08:00
parent 4a90f4bc1e
commit 1f4389eb5e
10 changed files with 409 additions and 122 deletions

View File

@@ -0,0 +1,43 @@
import request from '@/utils/request.js'
export const getProcessInfo = () => {
return request({
url: '/workflow/mosr/project/approval/initiation/process',
method: "post"
});
};
export const projectApply = (data) => {
return request({
url: '/workflow/mosr/project/approval/initiation/apply',
method: "post",
data:data
});
};
export const projectCheck = (data) => {
return request({
url: '/workflow/mosr/project/implementation/initiation/check',
method: "post",
data:data
});
};
export const getProjectCheckProcess = (data) => {
return request({
url: '/workflow/mosr/project/implementation/process',
method: "post",
data:data
});
};
export const projectConclusion = (data) => {
return request({
url: '/workflow/mosr/project/filing/project/entry',
method: "post",
data:data
});
};
export const getProjectConclusionProcess = (data) => {
return request({
url: '/workflow/mosr/project/filing/process',
method: "post",
data:data
});
};

View File

@@ -378,7 +378,7 @@ html, body, #app, .el-container, .el-aside, .el-main {
.scale {
margin-top: 10px;
z-index: 666;
position: absolute;
position: static;
//top: -20px;
}

View File

@@ -2,26 +2,13 @@
<div class="apply-block">
<el-form :model="formData" ref="applyForm" label-width="auto" :rules="rules">
<baseTitle title="项目结项"></baseTitle>
<el-row>
<el-col :span="24">
<el-form-item label="项目结项附件" prop="attachment">
<file-upload @getFile="getAttachment" :showFileList="true"/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="其他文件">
<el-card style="width: 100%">
<file-upload @getFile="getOtherFile" :showFileList="true"/>
<fvTable style="width: 100%;max-height: 250px" v-if="showTable" :tableConfig="tableConfig"
:data="otherFileList" :isSettingCol="false" :pagination="false">
<template #empty>
<el-empty :image-size="90" description="暂无数据" style="padding: 0"/>
</template>
</fvTable>
</el-card>
</el-form-item>
</el-col>
</el-row>
<AttachmentUpload label="项目结项附件" :showTable="showTable" :otherFileList="otherFileList"
@getAttachment="getAttachment"
@getOtherFile="getOtherFile" :showFileList="true"/>
<div class="approval-record">
<baseTitle title="流程"></baseTitle>
<process-diagram-viewer mode="view" v-if="processDiagramViewer"/>
</div>
</el-form>
<div class="oper-page-btn">
<el-button color="#DED0B2" @click="handleSubmit(applyForm)">提交</el-button>
@@ -30,17 +17,26 @@
</template>
<script setup lang="jsx">
import FileUpload from "@/components/FileUpload.vue";
import ProcessDiagramViewer from '@/views/workflow/common/ProcessDiagramViewer.vue';
import {downloadFile} from "@/api/project-demand";
import { ElNotification} from "element-plus";
import {useProcessStore} from '@/stores/processStore.js';
import {getProjectConclusionProcess, projectConclusion} from "@/api/project-manage";
const formData = ref({})
const rules = reactive({
attachment: [{required: true, message: '请上传项目结项附件', trigger: 'blur'}],
})
const fileList = ref(null)
const fileList = ref([])
const applyForm = ref()
const deploymentId = ref()
const showTable = ref(true)
const otherFileList = ref([])
const processInstanceData = ref()
const processDiagramViewer = ref(true)
const processStore = useProcessStore()
const router = useRouter()
const route = useRoute()
const tableConfig = reactive({
columns: [
{
@@ -66,31 +62,35 @@ const tableConfig = reactive({
align: 'center',
currentRender: ({row, index}) => (parseInt(row.size / 1024) + 'KB')
},
{
prop: 'oper',
label: '操作',
align: 'center',
currentRender: ({row, index}) => {
return (
<div>
<el-button type="primary" link onClick={() => handleDownload(row)}>下载</el-button>
<el-button type="primary" size="large" link onClick={() => beforeRemove(row)}>删除</el-button>
</div>
)
}
}
// {
// prop: 'oper',
// label: '操作',
// align: 'center',
// currentRender: ({row, index}) => {
// return (
// <div>
// <el-button type="primary" link onClick={() => handleDownload(row)}>下载</el-button>
// <el-button type="primary" size="large" link onClick={() => beforeRemove(row)}>删除</el-button>
// </div>
// )
// }
// }
]
})
const handleDownload = (row) => {
downloadFile(row.fileId).then(res => {
const blob = new Blob([res])
let a = document.createElement('a')
a.href=URL.createObjectURL(blob)
a.href = URL.createObjectURL(blob)
a.download = row.originalFileName
a.click()
})
}
const compositeParam = (item) => {
let tag = ''
if (router.currentRoute.value.name === 'Filing/conclusion') {
tag = '项目结项'
}
return {
fileId: item.id,
size: item.size,
@@ -98,43 +98,88 @@ const compositeParam = (item) => {
fileType: item.fileType,
url: item.url,
processNodeTag: null,
tag: formData.value.collectType
tag: tag
}
}
const getAttachment = (val) => {
console.log('上传文件', val)
console.log('上传文件getAttachment', val)
let fileObj = compositeParam(val, 1)
fileList.value.push(fileObj)
}
const getOtherFile = (val) => {
console.log('上传文件getOtherFile', val)
showTable.value = false
let fileObj = compositeParam(val, 2)
otherFileList.value.push(fileObj)
nextTick(() => {
showTable.value = true
})
let fileObj = {}
let newFileArray = []
if (route.query.isAdd === undefined) {
val.forEach(item => {
fileObj = compositeParam(item)
newFileArray.push(fileObj)
formData.value.fileList.push(fileObj)
})
fileList.value = formData.value.fileList
} else {
val.forEach(item => {
fileObj = compositeParam(item)
newFileArray.push(fileObj)
})
formData.value.fileList = newFileArray
fileList.value = newFileArray
}
}
const getOtherFile = () => {
const getFileParam = (item) => {
return {
fileId: item.fileId,
type: item.type
}
}
const handleSubmit = (instance) => {
if (!instance) return
instance.validate(async (valid) => {
if (!valid) return
if (fileList.value.length === 0) {
applyForm.value.validate()
} else {
applyForm.value.clearValidate()
}
if (!valid) return
let files = []
fileList.value.forEach(item => {
files.push(getFileParam(item))
})
otherFileList.value.forEach(item => {
files.push(getFileParam(item))
})
let params = {
deploymentId: deploymentId.value,
requirementId: route.query.id,
files: files,
projectId:route.query.projectId,
}
console.log('params', params)
let res = await projectConclusion(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: 'Filing'
})
}
})
}
const init = () => {
getProjectConclusionProcess().then(res => {
processDiagramViewer.value = false
if (res.code === 1000) {
let data = res.data
deploymentId.value=data.deploymentId
processInstanceData.value = data
processStore.setDesign(data)
processStore.runningList.value = data.runningList;
processStore.endList.value = data.endList;
processStore.noTakeList.value = data.noTakeList;
processStore.refuseList.value = data.refuseList;
processStore.passList.value = data.passList;
nextTick(() => {
processDiagramViewer.value = true
})
}
})
}
init()
</script>
<style scoped>

View File

@@ -93,12 +93,12 @@ const tableIns = ref()
const tableConfig = reactive({
columns: [
{
prop: 'name',
prop: 'projectName',
label: '名称',
align: 'center'
},
{
prop: 'company',
prop: 'affiliatedCompany',
label: '所属公司',
align: 'center'
},
@@ -108,31 +108,37 @@ const tableConfig = reactive({
align: 'center'
},
{
prop: 'productMainBody',
prop: 'rdSubject',
label: '研发主体',
align: 'center'
},
{
prop: 'projectEffect',
prop: 'projectImpact',
label: '项目影响',
align: 'center'
},
{
prop: 'survey',
label: '经概况',
prop: 'economicEstimate',
label: '经概况',
align: 'center'
},
{
prop: 'time',
prop: 'startTime',
label: '起止时间',
align: 'center'
},
{
prop: 'status',
prop: 'state',
label: '状态',
align: 'center',
showOverflowTooltip: false,
currentRender: ({row, index}) => (<Tag dictType={'process_state'} value={row.state}/>)
currentRender: ({row, index}) =>{
if (row.state !== null) {
return (<Tag dictType={'project_initiation'} value={row.state}/>)
} else {
return '--'
}
}
},
{
prop: 'oper',
@@ -140,11 +146,11 @@ const tableConfig = reactive({
align: 'center',
showOverflowTooltip: false,
currentRender: ({row, index}) => {
let btn = [{label: '详情', func: () => handleDetail(row), type: 'primary'}]
let btn = [{label: '详情', func: () => handleDetail(row), type: 'primary'},{label: '结项', func: () => handleConclusion(row), type: 'primary'}]
if (row.state === '3') {
btn.push({label: '附件', func: () => handleCheck(row), type: 'primary'})
} else if (row.state === '4') {
btn.push({label: '结项', func: () => handleStandingBook(row), type: 'primary'})
btn.push({label: '结项', func: () => handleConclusion(row), type: 'primary'})
}
return (
<div style={{width: '100%'}}>
@@ -165,7 +171,7 @@ const tableConfig = reactive({
}
}
],
api: '',
api: '/workflow/mosr/project/filing',
params: {},
})
@@ -176,11 +182,19 @@ const search = (val) => {
const handleDetail = (row) => {
router.push({
name:'Implementation/detail',
name:'Filing/detail',
query: {
id: row.requirementId
}
})
}
const handleConclusion = (row) => {
router.push({
name:'Filing/conclusion',
query: {
id: row.requirementId,
projectId: row.projectId
}
})
}
</script>

View File

@@ -1,6 +1,6 @@
<template>
<fvSearchForm :searchConfig="searchConfig" @search="search"></fvSearchForm>
<fvTable ref="tableIns" :tableConfig="tableConfig">
<fvTable ref="tableIns" :tableConfig="tableConfig" @headBtnClick="headBtnClick">
<template #empty>
<el-empty description="暂无数据"/>
</template>
@@ -79,10 +79,23 @@ const tableConfig = reactive({
api: '',
params: {},
btns: [
{name: '上传费用', key: '_export', color: '#DED0B2',auth: ''}
{name: '上传费用', key: 'add', color: '#DED0B2',auth: ''}
]
})
const router = useRouter()
const headBtnClick = (key) => {
switch (key) {
case 'add':
handleUploadFee()
break;
}
}
const handleUploadFee = () => {
router.push({
name: 'Implementation/uploadFee',
query: {}
})
}
</script>
<style scoped>

View File

@@ -13,6 +13,10 @@
<AttachmentUpload label="项目验收附件" :showTable="showTable" :otherFileList="otherFileList"
@getAttachment="getAttachment"
@getOtherFile="getOtherFile" :showFileList="true"/>
<div class="approval-record">
<baseTitle title="流程"></baseTitle>
<process-diagram-viewer mode="view" v-if="processDiagramViewer"/>
</div>
<div class="oper-page-btn">
<el-button color="#DED0B2" @click="handleSubmit(applyForm)">提交</el-button>
</div>
@@ -20,11 +24,21 @@
</template>
<script setup lang="jsx">
import ProcessDiagramViewer from '@/views/workflow/common/ProcessDiagramViewer.vue';
import {getProjectCheckProcess, projectCheck} from "@/api/project-manage";
import { ElNotification} from "element-plus";
import {useProcessStore} from '@/stores/processStore.js';
const formData = ref({})
const fileList = ref(null)
const fileList = ref([])
const applyForm = ref()
const deploymentId = ref()
const showTable = ref(true)
const otherFileList = ref([])
const processInstanceData = ref()
const processDiagramViewer = ref(true)
const processStore = useProcessStore()
const router = useRouter()
const route = useRoute()
const compositeParam = (item) => {
let tag=''
if(router.currentRoute.value.name==='Implementation/check'){
@@ -79,24 +93,46 @@ const handleSubmit = (instance) => {
files.push(getFileParam(item))
})
let params = {
// deploymentId: deploymentId.value,
files: files
deploymentId: deploymentId.value,
requirementId: route.query.id,
files: files,
projectId:route.query.projectId,
}
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'
// })
// }
let res = await projectCheck(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: 'Implementation'
})
}
})
}
const init = () => {
getProjectCheckProcess().then(res => {
processDiagramViewer.value = false
if (res.code === 1000) {
let data = res.data
deploymentId.value=data.deploymentId
processInstanceData.value = data
processStore.setDesign(data)
processStore.runningList.value = data.runningList;
processStore.endList.value = data.endList;
processStore.noTakeList.value = data.noTakeList;
processStore.refuseList.value = data.refuseList;
processStore.passList.value = data.passList;
nextTick(() => {
processDiagramViewer.value = true
})
}
})
}
init()
</script>
<style scoped>

View File

@@ -15,7 +15,7 @@ const router = useRouter()
const searchConfig = reactive([
{
label: '名称',
prop: 'requirementName',
prop: 'projectName',
component: 'el-input',
props: {
placeholder: '请输入名称查询',
@@ -26,7 +26,7 @@ const searchConfig = reactive([
},
{
label: '项目类型',
prop: 'collectType',
prop: 'projectType',
component: shallowRef(fvSelect),
props: {
placeholder: '请选择项目类型',
@@ -36,7 +36,7 @@ const searchConfig = reactive([
},
{
label: '项目影响',
prop: 'projectEffect',
prop: 'projectImpact',
component: shallowRef(fvSelect),
props: {
placeholder: '请选择项目影响',
@@ -47,7 +47,7 @@ const searchConfig = reactive([
},
{
label: '研发主体',
prop: 'collectType',
prop: 'rdSubject',
component: shallowRef(fvSelect),
props: {
placeholder: '请选择研发主体',
@@ -58,7 +58,7 @@ const searchConfig = reactive([
{
label: '起止时间',
prop: 'time',
prop: 'startTime',
component: 'el-date-picker',
props: {
placeholder: '请选择起止时间',
@@ -97,12 +97,12 @@ const tableConfig = reactive({
prop: 'selection'
},
{
prop: 'name',
prop: 'projectName',
label: '名称',
align: 'center'
},
{
prop: 'company',
prop: 'affiliatedCompany',
label: '所属公司',
align: 'center'
},
@@ -112,26 +112,37 @@ const tableConfig = reactive({
align: 'center'
},
{
prop: 'productMainBody',
prop: 'rdSubject',
label: '研发主体',
align: 'center'
},
{
prop: 'projectEffect',
prop: 'projectImpact',
label: '项目影响',
align: 'center'
},
{
prop: 'time',
prop: 'economicEstimate',
label: '经济概况',
align: 'center'
},
{
prop: 'startTime',
label: '起止时间',
align: 'center'
},
{
prop: 'status',
prop: 'state',
label: '状态',
align: 'center',
showOverflowTooltip: false,
currentRender: ({row, index}) => (<Tag dictType={'process_state'} value={row.state}/>)
currentRender: ({row, index}) =>{
if (row.state !== null) {
return (<Tag dictType={'project_initiation'} value={row.state}/>)
} else {
return '--'
}
}
},
{
prop: 'oper',
@@ -139,7 +150,7 @@ const tableConfig = reactive({
align: 'center',
showOverflowTooltip: false,
currentRender: ({row, index}) => {
let btn = [{label: '详情', func: () => handleDetail(row), type: 'primary'}]
let btn = [{label: '详情', func: () => handleDetail(row), type: 'primary'},{label: '验收', func: () => handleCheck(row), type: 'primary'}]
if (row.state === '3') {
btn.push(
{label: '验收', func: () => handleCheck(row), type: 'primary'},
@@ -167,7 +178,7 @@ const tableConfig = reactive({
}
}
],
api: '',
api: '/workflow/mosr/project/implementation',
params: {},
btns: [
{name: '生成分摊报表', key: '_export', color: '#DED0B2', auth: ''}
@@ -191,7 +202,8 @@ const handleCheck = (row) => {
router.push({
name: 'Implementation/check',
query: {
id: row.requirementId
id: row.requirementId,
projectId: row.projectId
}
})
}

View File

@@ -0,0 +1,84 @@
<template>
<el-form :model="formData" ref="demandForm" label-width="auto">
<baseTitle title="上传费用"></baseTitle>
<el-row>
<el-col :span="12">
<el-form-item label="项目名称">
<span>{{ formData.requirementName }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="项目负责人">
<span>{{ formData.companyIds }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="项目开始时间">
<span>{{ formData.collectType }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="项目预计持续时间">
<span>{{ formData.deadline }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="项目开展方式">
<span>{{ formData.deadline }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="项目预算">
<span>{{ formData.deadline }}</span>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-table :data="tableData" style="width: 100%">
<el-table-column prop="date" label="时间" width="180" >
<template #default="scope">
<el-input v-model="scope.row.uqName" placeholder="请输入时间" clearable>
</el-input>
</template>
</el-table-column>
<el-table-column prop="name" label="项目费用" width="180" />
<el-table-column prop="address" label="研发阶段" />
<el-table-column prop="address" label="摘要" />
<el-table-column prop="address" label="税后余额(元)" />
<el-table-column prop="address" label="操作" >
<template #default="scope">
<el-button type="primary" size="mini" @click="handleDelete(scope.row)" link>删除</el-button>
</template>
</el-table-column>
</el-table>
</template>
<script setup lang="jsx">
const formData = ref({})
const tableData = [
{
date: '2016-05-03',
name: 'Tom',
address: 'No. 189, Grove St, Los Angeles',
},
{
date: '2016-05-02',
name: 'Tom',
address: 'No. 189, Grove St, Los Angeles',
},
{
date: '2016-05-04',
name: 'Tom',
address: 'No. 189, Grove St, Los Angeles',
},
{
date: '2016-05-01',
name: 'Tom',
address: 'No. 189, Grove St, Los Angeles',
},
]
</script>
<style scoped>
</style>

View File

@@ -13,6 +13,10 @@
<AttachmentUpload ref="attachment" label="需求申请书附件" :showTable="showTable" :otherFileList="otherFileList"
@getAttachment="getAttachment"
@getOtherFile="getOtherFile" :showFileList="true"/>
<div class="approval-record">
<baseTitle title="流程"></baseTitle>
<process-diagram-viewer mode="view" v-if="processDiagramViewer"/>
</div>
<div class="oper-page-btn">
<el-button color="#DED0B2" @click="handleSubmit(applyForm)">提交</el-button>
</div>
@@ -21,12 +25,19 @@
<script setup lang="jsx">
import {useTagsView} from '@/stores/tagsview.js'
import {ElNotification} from "element-plus";
import ProcessDiagramViewer from '@/views/workflow/common/ProcessDiagramViewer.vue';
import {getProcessInfo,projectApply} from "@/api/project-manage";
import {useProcessStore} from '@/stores/processStore.js';
const tagsViewStore = useTagsView()
const router = useRouter()
const route = useRoute()
const formData = ref({})
const rules = reactive({
attachment: [{required: true, message: '请上传项目立项附件', trigger: 'blur'}],
})
const processStore = useProcessStore()
const deploymentId = ref()
const fileList = ref([])
const applyForm = ref()
const showTable = ref(true)
@@ -71,7 +82,8 @@ const tableConfig = reactive({
// }
]
})
const processInstanceData = ref()
const processDiagramViewer = ref(true)
const compositeParam = (item, type) => {
let tag = ''
if (router.currentRoute.value.name === 'Initiation/apply') {
@@ -125,24 +137,46 @@ const handleSubmit = (instance) => {
files.push(getFileParam(item))
})
let params = {
// deploymentId: deploymentId.value,
files: files
deploymentId: deploymentId.value,
requirementId: route.query.id,
files: files,
projectId:route.query.projectId,
}
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'
// })
// }
let res = await projectApply(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 init = () => {
getProcessInfo().then(res => {
processDiagramViewer.value = false
if (res.code === 1000) {
let data = res.data
deploymentId.value=data.deploymentId
processInstanceData.value = data
processStore.setDesign(data)
processStore.runningList.value = data.runningList;
processStore.endList.value = data.endList;
processStore.noTakeList.value = data.noTakeList;
processStore.refuseList.value = data.refuseList;
processStore.passList.value = data.passList;
nextTick(() => {
processDiagramViewer.value = true
})
}
})
}
init()
</script>
<style scoped>

View File

@@ -117,6 +117,11 @@ const tableConfig = reactive({
label: '项目影响',
align: 'center'
},
{
prop: 'economicEstimate',
label: '经济概况',
align: 'center'
},
{
prop: 'startTime',
label: '起止时间',
@@ -144,7 +149,7 @@ const tableConfig = reactive({
let btn = [{label: '详情', func: () => handleDetail(row), type: 'primary'}]
if (row.state === '3') {
btn.push({label: '编辑', func: () => handleEdit(row), type: 'primary'})
} else if (row.state === '20') {
} else if (row.state === '0') {
btn.push({label: '申请', func: () => handleApply(row), type: 'primary'})
}
return (
@@ -195,7 +200,8 @@ const handleApply = (row) => {
router.push({
name:'Initiation/apply',
query: {
id: row.requirementId
id: row.requirementId,
projectId: row.projectId
}
})
}