535 lines
20 KiB
Vue
535 lines
20 KiB
Vue
<template>
|
|
<div class="detail-block" v-loading="loading">
|
|
<baseTitle title="需求上报"></baseTitle>
|
|
<el-form :model="formData" ref="summaryForm" :rules="rules">
|
|
<el-row gutter="50">
|
|
<el-col :span="12">
|
|
<el-form-item label="项目名称" prop="projectName">
|
|
<el-input v-model="formData.projectName" placeholder="请输入项目名称" clearable></el-input>
|
|
</el-form-item>
|
|
</el-col>
|
|
<!-- <el-col :span="5">-->
|
|
<!-- <el-form-item label="是否专项资金" prop="isSpecialFund">-->
|
|
<!-- <el-radio-group v-model="formData.isSpecialFund" >-->
|
|
<!-- <el-radio :label="true">是</el-radio>-->
|
|
<!-- <el-radio :label="false">否</el-radio>-->
|
|
<!-- </el-radio-group>-->
|
|
<!-- </el-form-item>-->
|
|
<!-- </el-col>-->
|
|
<el-col :span="6">
|
|
<el-form-item label="专项资金" prop="specialFund" v-if="formData.isSpecialFund">
|
|
<el-select v-model="formData.specialFund" placeholder="请选择专项资金" clearable filterable>
|
|
<el-option
|
|
v-for="item in specialFundOption"
|
|
:key="item.value"
|
|
:label="item.label"
|
|
:value="item.value"
|
|
/>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="12">
|
|
<el-form-item label="开始时间" prop="startTime">
|
|
<el-config-provider>
|
|
<el-date-picker
|
|
v-model="formData.startTime"
|
|
type="datetime"
|
|
placeholder="开始时间"
|
|
value-format="YYYY-MM-DD HH:mm:ss"
|
|
style="width: 100%"
|
|
/>
|
|
</el-config-provider>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="12">
|
|
<el-form-item label="结束时间" prop="endTime">
|
|
<el-config-provider>
|
|
<el-date-picker
|
|
v-model="formData.endTime"
|
|
type="datetime"
|
|
placeholder="结束时间"
|
|
value-format="YYYY-MM-DD HH:mm:ss"
|
|
style="width: 100%"
|
|
/>
|
|
</el-config-provider>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="12">
|
|
<el-form-item label="项目类型" prop="projectType">
|
|
<el-select v-model="formData.projectType" placeholder="请选择项目类型" clearable filterable>
|
|
<el-option
|
|
v-for="item in cacheStore.getDict('project_type')"
|
|
:key="item.value"
|
|
:label="item.label"
|
|
:value="item.value"
|
|
/>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="12">
|
|
<el-form-item label="研发主体" prop="rdSubject">
|
|
<el-select v-model="formData.rdSubject" placeholder="请选择研发主体" clearable filterable>
|
|
<el-option
|
|
v-for="item in cacheStore.getDict('rd_subject')"
|
|
:key="item.value"
|
|
:label="item.label"
|
|
:value="item.value"
|
|
/>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="12">
|
|
<el-form-item label="出资类型" prop="investmentType">
|
|
<el-select v-model="formData.investmentType" placeholder="请选择出资类型" clearable filterable>
|
|
<el-option
|
|
v-for="item in cacheStore.getDict('invest_type')"
|
|
:key="item.value"
|
|
:label="item.label"
|
|
:value="item.value"
|
|
/>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="12">
|
|
<el-form-item label="项目影响" prop="projectImpact">
|
|
<el-select v-model="formData.projectImpact" placeholder="请选择项目影响" clearable filterable>
|
|
<el-option
|
|
v-for="item in cacheStore.getDict('project_impact')"
|
|
:key="item.value"
|
|
:label="item.label"
|
|
:value="item.value"
|
|
/>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="12">
|
|
<el-form-item label="所属业务板块" prop="businessSegment">
|
|
<el-select v-model="formData.businessSegment" placeholder="请选择所属业务板块" clearable filterable>
|
|
<el-option
|
|
v-for="item in cacheStore.getDict('business_segment')"
|
|
:key="item.value"
|
|
:label="item.label"
|
|
:value="item.value"
|
|
/>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="12">
|
|
<el-form-item label="预期成果形式" prop="resultForm">
|
|
<el-select v-model="formData.resultForm" placeholder="请选择预期成果形式" clearable filterable>
|
|
<el-option
|
|
v-for="item in cacheStore.getDict('result_form')"
|
|
:key="item.value"
|
|
:label="item.label"
|
|
:value="item.value"
|
|
/>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="12">
|
|
<el-form-item label="预期技术标准制定" prop="technicalStandard">
|
|
<el-select v-model="formData.technicalStandard" placeholder="请选择预期技术标准制定" clearable filterable>
|
|
<el-option
|
|
v-for="item in cacheStore.getDict('technical_standard')"
|
|
:key="item.value"
|
|
:label="item.label"
|
|
:value="item.value"
|
|
/>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="12">
|
|
<el-form-item label="产学研联合" prop="industryUniversityResearch">
|
|
<el-radio-group v-model="formData.industryUniversityResearch">
|
|
<el-radio v-for="item in cacheStore.getDict('industry_university')"
|
|
:key="item.value"
|
|
:label="item.value">{{ item.label }}
|
|
</el-radio>
|
|
</el-radio-group>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="12">
|
|
<el-form-item label="开展政府申报" prop="governmentDeclaration">
|
|
<el-radio-group v-model="formData.governmentDeclaration">
|
|
<el-radio v-for="item in cacheStore.getDict('government_declaration')"
|
|
:key="item.value"
|
|
:label="item.value">{{ item.label }}
|
|
</el-radio>
|
|
</el-radio-group>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="12">
|
|
<el-form-item label="知识产权状况" prop="intellectualProperty">
|
|
<el-select v-model="formData.intellectualProperty" placeholder="请选择知识产权状况" clearable filterable>
|
|
<el-option
|
|
v-for="item in cacheStore.getDict('intellectual_property')"
|
|
:key="item.value"
|
|
:label="item.label"
|
|
:value="item.value"
|
|
/>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="24">
|
|
<baseTitle title="预期知识产权"></baseTitle>
|
|
</el-col>
|
|
<el-col :span="6">
|
|
<el-form-item label="发明专利(项)" prop="inventionPatent">
|
|
<el-input v-model="formData.inventionPatent" clearable></el-input>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="6">
|
|
<el-form-item label="实用性新型专利(项)" prop="newPatent">
|
|
<el-input v-model="formData.newPatent" clearable></el-input>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="6">
|
|
<el-form-item label="软件著作权(项)" prop="softwareCopyright">
|
|
<el-input v-model="formData.softwareCopyright" clearable></el-input>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="6">
|
|
<el-form-item label="著作权(项)" prop="copyright">
|
|
<el-input v-model="formData.copyright" clearable></el-input>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="6">
|
|
<el-form-item label="其他(项)" prop="other">
|
|
<el-input v-model="formData.other" clearable></el-input>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="6">
|
|
<el-form-item label="经济概算(元)" prop="economicEstimate">
|
|
<el-input v-model="formData.economicEstimate" clearable></el-input>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="12">
|
|
<el-form-item label="其中申请公司总部科技创新专项资金(元)" prop="specialFundAmount" v-if="formData.isSpecialFund">
|
|
<el-input v-model="formData.specialFundAmount" clearable></el-input>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="24">
|
|
<el-form-item label="现有业务描述" prop="serviceDescription">
|
|
<el-input v-model="formData.serviceDescription" type="textarea" clearable></el-input>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="24">
|
|
<el-form-item label="研发项目关键内容描述" prop="contentDescription">
|
|
<el-input v-model="formData.contentDescription" type="textarea" clearable></el-input>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
</el-form>
|
|
<AttachmentUpload ref="attachment" label="需求申请书附件" :showTable="showTable" :otherFileList="otherFileList"
|
|
@getAttachment="getAttachment"
|
|
@getOtherFile="getOtherFile" :showFileList="true" :formData="formData"
|
|
:preview="name === 'Summary/edit'"/>
|
|
<!-- <fvForm :schema="schame" @getInstance="getInstance"></fvForm>-->
|
|
<div class="approval-record">
|
|
<baseTitle title="流程"></baseTitle>
|
|
<process-diagram-viewer mode="view" v-if="processDiagramViewer"/>
|
|
<!-- <div class="process" id="approvalRecord">-->
|
|
<!-- <process-tree ref="processTree" mode="view" id-name="approvalRecord"/>-->
|
|
<!-- </div>-->
|
|
</div>
|
|
<div class="oper-page-btn">
|
|
<el-button type="info" @click="staging">存为草稿</el-button>
|
|
<el-button color="#DED0B2" v-if="name==='Summary/add'" @click="handleSubmit(summaryForm)">发布</el-button>
|
|
<el-button color="#DED0B2" v-else @click="handleResubmit">重新发布</el-button>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<script setup lang="jsx">
|
|
import {debounce} from 'lodash'
|
|
import {getDetail, getProcessInfo, requirementReported, resubmitReported} from "./api";
|
|
import {ElMessage, ElNotification} from "element-plus";
|
|
import {useTagsView} from '@/stores/tagsview.js'
|
|
import {useCacheStore} from '@/stores/cache.js'
|
|
import {useProcessStore} from '@/stores/processStore.js';
|
|
import {getSubCompOpt} from "@/api/user/user";
|
|
import ProcessDiagramViewer from '@/views/workflow/common/ProcessDiagramViewer.vue';
|
|
import {getFormInfo} from "@/api/project-demand";
|
|
import {getFundOption} from "@/api/special-fund";
|
|
|
|
const cacheStore = useCacheStore()
|
|
const processStore = useProcessStore()
|
|
const router = useRouter()
|
|
const route = useRoute()
|
|
const attachment = ref()
|
|
const name = ref(router.currentRoute.value.name)
|
|
const loading = ref(false)
|
|
const processDiagramViewer = ref(false)
|
|
const tagsViewStore = useTagsView()
|
|
const companyOption = ref([])
|
|
const summaryForm = ref()
|
|
const deploymentId = ref()
|
|
const specialFundOption = ref([])
|
|
const showTable = ref(true)
|
|
const otherFileList = ref([])
|
|
const file = ref({})
|
|
const formData = ref({
|
|
industryUniversityResearch: '0',
|
|
governmentDeclaration: '0',
|
|
})
|
|
const rules = reactive({
|
|
projectName: [{required: true, message: '请输入项目名称', trigger: 'blur'}],
|
|
specialFund: [{required: true, message: '请选择专项资金', trigger: 'blur'}],
|
|
startTime: [{required: true, message: '请选择开始时间', trigger: 'blur'}],
|
|
rdSubject: [{required: true, message: '请输入研发主体', trigger: 'blur'}],
|
|
projectType: [{required: true, message: '请选择项目类型', trigger: 'blur'}],
|
|
endTime: [{required: true, message: '请选择结束时间', trigger: 'blur'}],
|
|
investmentType: [{required: true, message: '请选择出资类型', trigger: 'blur'}],
|
|
projectImpact: [{required: true, message: '请选择项目影响', trigger: 'blur'}],
|
|
businessSegment: [{required: true, message: '请选择所属业务板块', trigger: 'blur'}],
|
|
resultForm: [{required: true, message: '请选择预期成果形式', trigger: 'blur'}],
|
|
technicalStandard: [{required: true, message: '请选择预期技术标准制定', trigger: 'blur'}],
|
|
industryUniversityResearch: [{required: true, message: '请选择产学研联合', trigger: 'blur'}],
|
|
governmentDeclaration: [{required: true, message: '请选择开展政府申报', trigger: 'blur'}],
|
|
intellectualProperty: [{required: true, message: '请选择知识产权状况', trigger: 'blur'}],
|
|
inventionPatent: [{required: true, message: '请输入发明专利', trigger: 'blur'}],
|
|
newPatent: [{required: true, message: '请输入实用性新型专利', trigger: 'blur'}],
|
|
softwareCopyright: [{required: true, message: '请输入软件著作权', trigger: 'blur'}],
|
|
copyright: [{required: true, message: '请输入著作权', trigger: 'blur'}],
|
|
other: [{required: true, message: '请输入其他', trigger: 'blur'}],
|
|
economicEstimate: [{required: true, message: '请输入经济概算', trigger: 'blur'}],
|
|
specialFundAmount: [{required: true, message: '请输入专项资金', trigger: 'blur'}],
|
|
serviceDescription: [{required: true, message: '请输入现有业务描述', trigger: 'blur'}],
|
|
contentDescription: [{required: true, message: '请输入研发项目关键内容描述', trigger: 'blur'}]
|
|
})
|
|
const getIsFund = async () => {
|
|
getFormInfo(route.query.id).then(res => {
|
|
if (res.code === 1000) {
|
|
formData.value.isSpecialFund = res.data.isSpecialFund
|
|
if(res.data.isSpecialFund){
|
|
formData.value.specialFund = Number(res.data.specialFund)
|
|
}
|
|
}
|
|
})
|
|
}
|
|
const compositeParam = (item, type) => {
|
|
let tag = ''
|
|
if (name.value === 'Summary/add' || name.value === 'Summary/edit') {
|
|
tag = '需求上报'
|
|
}
|
|
return {
|
|
fileId: item.id,
|
|
size: item.size,
|
|
originalFileName: item.originalFilename,
|
|
fileType: item.fileType,
|
|
url: item.url,
|
|
newFile: true,
|
|
tag: tag
|
|
}
|
|
}
|
|
|
|
const getAttachment = (val) => {
|
|
console.log('上传文件getAttachment', val)
|
|
file.value = compositeParam(val)
|
|
formData.value.singleFile = compositeParam(val)
|
|
}
|
|
const getOtherFile = (val) => {
|
|
console.log('上传文件getOtherFile', val)
|
|
showTable.value = false
|
|
let fileObj = compositeParam(val)
|
|
otherFileList.value.push(fileObj)
|
|
nextTick(() => {
|
|
showTable.value = true
|
|
})
|
|
}
|
|
const getFileParam = (item) => {
|
|
return {
|
|
fileId: item.fileId,
|
|
tag: item.tag
|
|
}
|
|
}
|
|
const handleSubmit = debounce(async (instance) => {
|
|
if (!instance) return
|
|
instance.validate(async (valid, fields) => {
|
|
if (!valid) return
|
|
let singleFile = {}
|
|
if (file.value.fileId !== undefined) {
|
|
singleFile = {
|
|
fileId: file.value.fileId
|
|
}
|
|
}
|
|
let otherFiles = []
|
|
otherFileList.value.forEach(item => {
|
|
otherFiles.push(getFileParam(item))
|
|
})
|
|
// let params = {
|
|
// "specialFund": "2",
|
|
// "projectName": "测试全流程功能-上报",
|
|
// "startTime": "2024-05-24 00:00:00",
|
|
// "endTime": "2024-05-29 00:00:00",
|
|
// "projectType": "3",
|
|
// "investmentType": "3",
|
|
// "businessSegment": "2",
|
|
// "technicalStandard": "2",
|
|
// "governmentDeclaration": 0,
|
|
// "inventionPatent": "3",
|
|
// "newPatent": "3",
|
|
// "economicEstimate": "3",
|
|
// "other": "3",
|
|
// "copyright": "3",
|
|
// "softwareCopyright": "3",
|
|
// "industryUniversityResearch": 0,
|
|
// "intellectualProperty": "00",
|
|
// "resultForm": "3",
|
|
// "projectImpact": "3",
|
|
// "rdSubject": "3",
|
|
// "serviceDescription": "3",
|
|
// "contentDescription": "3",
|
|
// "specialFundAmount": "3",
|
|
// deploymentId: deploymentId.value,
|
|
// "singleFile": singleFile,
|
|
// "fileList": otherFiles,
|
|
// "requirementId":route.query.id
|
|
// }
|
|
let params = {
|
|
...formData.value,
|
|
isSpecialFund:false,
|
|
deploymentId: deploymentId.value,
|
|
fileList: otherFiles,
|
|
singleFile: singleFile,
|
|
requirementId: route.query.id
|
|
}
|
|
if (JSON.stringify(singleFile) === "{}") {
|
|
attachment.value.validate()
|
|
ElNotification({
|
|
title: '提示',
|
|
message: '请上传附件',
|
|
type: 'error'
|
|
})
|
|
return;
|
|
}else {
|
|
attachment.value.clearValidate()
|
|
}
|
|
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(() => {
|
|
let singleFile = {}
|
|
let otherFiles = []
|
|
let fileArray
|
|
if (name.value === 'Summary/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 = {
|
|
...formData.value,
|
|
deploymentId: deploymentId.value,
|
|
fileList: otherFiles,
|
|
singleFile: singleFile,
|
|
requirementId: route.query.id
|
|
}
|
|
if (JSON.stringify(singleFile) === "{}") {
|
|
attachment.value.validate()
|
|
ElNotification({
|
|
title: '提示',
|
|
message: '请上传附件',
|
|
type: 'error'
|
|
})
|
|
return;
|
|
}else {
|
|
attachment.value.clearValidate()
|
|
}
|
|
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: 'Summary'
|
|
})
|
|
}
|
|
})
|
|
})
|
|
|
|
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 = async () => {
|
|
const resFund = await getFundOption()
|
|
specialFundOption.value = resFund.data
|
|
await getIsFund()
|
|
const res = await getSubCompOpt()
|
|
companyOption.value = res.data
|
|
getProcessInfo().then(res => {
|
|
if (res.code === 1000) {
|
|
let data = res.data
|
|
deploymentId.value = data.deploymentId
|
|
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
|
|
})
|
|
} else {
|
|
ElNotification({
|
|
title: '提示',
|
|
message: res.msg,
|
|
type: 'error'
|
|
})
|
|
}
|
|
})
|
|
}
|
|
onMounted(async () => {
|
|
await init()
|
|
if (route.query.projectId) {
|
|
loading.value = true
|
|
await getDetailInfo()
|
|
}
|
|
})
|
|
const staging = async () => {
|
|
}
|
|
</script>
|
|
<style lang="scss" scoped>
|
|
.detail-block {
|
|
overflow: hidden;
|
|
padding-bottom: 30px;
|
|
}
|
|
</style>
|