feat : 新增需求上报缓存

This commit is contained in:
2024-10-25 21:32:45 +08:00
parent 80bf9ae9bd
commit e78ae692ee
2 changed files with 85 additions and 43 deletions

View File

@@ -376,6 +376,11 @@ const handleDelete = (row, type) => {
}else{ }else{
isHaveOneFile.value=true isHaveOneFile.value=true
} }
if(localStorage.getItem('collectData')){
let collectData=JSON.parse(localStorage.getItem('collectData'))
collectData.fileList=allFileList.value
localStorage.setItem('collectData', JSON.stringify(collectData))
}
} }
} }
}); });

View File

@@ -14,7 +14,7 @@
</el-col> </el-col>
<el-col :span="6" :style="{marginLeft:!formData.isSpecialFund?'0':route.query.id?'':'-40px'}"> <el-col :span="6" :style="{marginLeft:!formData.isSpecialFund?'0':route.query.id?'':'-40px'}">
<el-form-item label="项目名称" prop="projectName"> <el-form-item label="项目名称" prop="projectName">
<el-input v-model="formData.projectName" placeholder="请输入项目名称" clearable></el-input> <el-input v-model="formData.projectName" placeholder="请输入项目名称" clearable @change="changeCollectData"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6" :style="{marginLeft:!formData.isSpecialFund?'-10px':route.query.id?'-40px':'0'}"> <el-col :span="6" :style="{marginLeft:!formData.isSpecialFund?'-10px':route.query.id?'-40px':'0'}">
@@ -26,7 +26,7 @@
placeholder="开始时间" placeholder="开始时间"
format="YYYY-MM-DD" format="YYYY-MM-DD"
value-format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss"
style="width: 100%" style="width: 100%" @change="changeCollectData"
/> />
</el-config-provider> </el-config-provider>
</el-form-item> </el-form-item>
@@ -43,14 +43,14 @@
value-format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss"
style="width: 100%" style="width: 100%"
:disabled="!formData.startTime" :disabled="!formData.startTime"
:disabled-date="disabledDate" :disabled-date="disabledDate" @change="changeCollectData"
/> />
</el-config-provider> </el-config-provider>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="项目类型" prop="projectType"> <el-form-item label="项目类型" prop="projectType">
<el-select v-model="formData.projectType" placeholder="请选择项目类型" clearable filterable> <el-select v-model="formData.projectType" placeholder="请选择项目类型" clearable filterable @change="changeCollectData">
<el-option <el-option
v-for="item in cacheStore.getDict('project_type')" v-for="item in cacheStore.getDict('project_type')"
:key="item.value" :key="item.value"
@@ -62,7 +62,7 @@
</el-col> </el-col>
<el-col :span="6" :style="{marginLeft:!formData.isSpecialFund?'0':route.query.id?'':'-40px'}"> <el-col :span="6" :style="{marginLeft:!formData.isSpecialFund?'0':route.query.id?'':'-40px'}">
<el-form-item label="研发主体" prop="rdSubject"> <el-form-item label="研发主体" prop="rdSubject">
<el-select v-model="formData.rdSubject" placeholder="请选择研发主体" clearable filterable> <el-select v-model="formData.rdSubject" placeholder="请选择研发主体" clearable filterable @change="changeCollectData">
<el-option <el-option
v-for="item in cacheStore.getDict('rd_subject')" v-for="item in cacheStore.getDict('rd_subject')"
:key="item.value" :key="item.value"
@@ -74,7 +74,7 @@
</el-col> </el-col>
<el-col :span="6" :style="{marginLeft:!formData.isSpecialFund?'-10px':route.query.id?'-40px':'0'}"> <el-col :span="6" :style="{marginLeft:!formData.isSpecialFund?'-10px':route.query.id?'-40px':'0'}">
<el-form-item label="出资类型" prop="investmentType"> <el-form-item label="出资类型" prop="investmentType">
<el-select v-model="formData.investmentType" placeholder="请选择出资类型" clearable filterable> <el-select v-model="formData.investmentType" placeholder="请选择出资类型" clearable filterable @change="changeCollectData">
<el-option <el-option
v-for="item in cacheStore.getDict('invest_type')" v-for="item in cacheStore.getDict('invest_type')"
:key="item.value" :key="item.value"
@@ -86,7 +86,7 @@
</el-col> </el-col>
<el-col :span="6" :style="{marginLeft:!formData.isSpecialFund?'-10px':'-40px'}"> <el-col :span="6" :style="{marginLeft:!formData.isSpecialFund?'-10px':'-40px'}">
<el-form-item label="业务板块" prop="businessSegment"> <el-form-item label="业务板块" prop="businessSegment">
<el-select v-model="formData.businessSegment" placeholder="请选择所属业务板块" clearable filterable> <el-select v-model="formData.businessSegment" placeholder="请选择所属业务板块" clearable filterable @change="changeCollectData">
<el-option <el-option
v-for="item in cacheStore.getDict('business_segment')" v-for="item in cacheStore.getDict('business_segment')"
:key="item.value" :key="item.value"
@@ -98,7 +98,7 @@
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="标准制定" prop="technicalStandard"> <el-form-item label="标准制定" prop="technicalStandard">
<el-select v-model="formData.technicalStandard" placeholder="请选择预期技术标准制定" clearable filterable> <el-select v-model="formData.technicalStandard" placeholder="请选择预期技术标准制定" clearable filterable @change="changeCollectData">
<el-option <el-option
v-for="item in cacheStore.getDict('technical_standard')" v-for="item in cacheStore.getDict('technical_standard')"
:key="item.value" :key="item.value"
@@ -115,14 +115,14 @@
placeholder="请输入经费预算" placeholder="请输入经费预算"
clearable clearable
:formatter="(value) => value.replace(/\B(?=(\d{3})+(?!\d))/g, ',')" :formatter="(value) => value.replace(/\B(?=(\d{3})+(?!\d))/g, ',')"
:parser="(value) => value.replace(/\$\s?|(,*)+[^0-9.]/g, '')" :parser="(value) => value.replace(/\$\s?|(,*)+[^0-9.]/g, '')" @change="changeCollectData"
/> />
<!-- <el-input-number v-model="formData.economicEstimate" placeholder="请输入经费预算" :controls="false"/>--> <!-- <el-input-number v-model="formData.economicEstimate" placeholder="请输入经费预算" :controls="false"/>-->
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6" :style="{marginLeft:!formData.isSpecialFund?'-10px':route.query.id?'-40px':'0'}"> <el-col :span="6" :style="{marginLeft:!formData.isSpecialFund?'-10px':route.query.id?'-40px':'0'}">
<el-form-item label="产学研联合" prop="industryUniversityResearch"> <el-form-item label="产学研联合" prop="industryUniversityResearch">
<el-select v-model="formData.industryUniversityResearch" clearable placeholder="请选择产学研联合"> <el-select v-model="formData.industryUniversityResearch" clearable placeholder="请选择产学研联合" @change="changeCollectData">
<el-option <el-option
v-for="item in cacheStore.getDict('industry_university')" v-for="item in cacheStore.getDict('industry_university')"
:key="item.value" :key="item.value"
@@ -134,7 +134,7 @@
</el-col> </el-col>
<el-col :span="6" :style="{marginLeft:!formData.isSpecialFund?'-10px':'-40px'}"> <el-col :span="6" :style="{marginLeft:!formData.isSpecialFund?'-10px':'-40px'}">
<el-form-item label="开展政府申报" prop="governmentDeclaration"> <el-form-item label="开展政府申报" prop="governmentDeclaration">
<el-select v-model="formData.governmentDeclaration" clearable placeholder="请选择开展政府申报"> <el-select v-model="formData.governmentDeclaration" clearable placeholder="请选择开展政府申报" @change="changeCollectData">
<el-option <el-option
v-for="item in cacheStore.getDict('government_declaration')" v-for="item in cacheStore.getDict('government_declaration')"
:key="item.value" :key="item.value"
@@ -162,7 +162,7 @@
<el-col :span="6" v-if="!route.query.id && formData.isSpecialFund" <el-col :span="6" v-if="!route.query.id && formData.isSpecialFund"
:style="{marginLeft:!formData.isSpecialFund?'0':route.query.id?'':'-40px'}"> :style="{marginLeft:!formData.isSpecialFund?'0':route.query.id?'':'-40px'}">
<el-form-item label="所属专项资金" prop="specialFundId"> <el-form-item label="所属专项资金" prop="specialFundId">
<el-select v-model="formData.specialFundId" placeholder="请选择专项资金名称" clearable filterable> <el-select v-model="formData.specialFundId" placeholder="请选择专项资金名称" clearable filterable @change="changeCollectData">
<el-option <el-option
v-for="item in specialFundOption" v-for="item in specialFundOption"
:key="item.value" :key="item.value"
@@ -179,14 +179,14 @@
placeholder="请输入申请总部专项资金" placeholder="请输入申请总部专项资金"
clearable clearable
:formatter="(value) => value.replace(/\B(?=(\d{3})+(?!\d))/g, ',')" :formatter="(value) => value.replace(/\B(?=(\d{3})+(?!\d))/g, ',')"
:parser="(value) => value.replace(/\$\s?|(,*)+[^0-9.]/g, '')" :parser="(value) => value.replace(/\$\s?|(,*)+[^0-9.]/g, '')" @change="changeCollectData"
/> />
<!-- <el-input-number v-model="formData.specialFundAmount" placeholder="请输入申请总部专项资金" :controls="false"/>--> <!-- <el-input-number v-model="formData.specialFundAmount" placeholder="请输入申请总部专项资金" :controls="false"/>-->
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6" :style="{marginLeft:!formData.isSpecialFund?'0':'-40px'}"> <el-col :span="6" :style="{marginLeft:!formData.isSpecialFund?'0':'-40px'}">
<el-form-item label="是否在预算内" prop="isWithinBudget" required > <el-form-item label="是否在预算内" prop="isWithinBudget" required >
<el-select v-model="formData.isWithinBudget" clearable placeholder="请选择是否在预算内"> <el-select v-model="formData.isWithinBudget" clearable placeholder="请选择是否在预算内" @change="changeCollectData">
<el-option label="是" :value="true"/> <el-option label="是" :value="true"/>
<el-option label="否" :value="false"/> <el-option label="否" :value="false"/>
</el-select> </el-select>
@@ -213,7 +213,7 @@
<el-col :span="12"> <el-col :span="12">
<el-form-item label="预期成果形式" prop="resultForm" <el-form-item label="预期成果形式" prop="resultForm"
:style="{marginRight:!formData.isSpecialFund?'0':route.query.id?'':'40px'}"> :style="{marginRight:!formData.isSpecialFund?'0':route.query.id?'':'40px'}">
<el-select v-model="formData.resultForm" placeholder="请选择预期成果形式" clearable filterable multiple> <el-select v-model="formData.resultForm" placeholder="请选择预期成果形式" clearable filterable multiple @change="changeCollectData">
<el-option <el-option
v-for="item in cacheStore.getDict('result_form')" v-for="item in cacheStore.getDict('result_form')"
:key="item.value" :key="item.value"
@@ -225,7 +225,7 @@
</el-col> </el-col>
<el-col :span="6" :style="{marginLeft:!formData.isSpecialFund?'-10px':'-40px'}"> <el-col :span="6" :style="{marginLeft:!formData.isSpecialFund?'-10px':'-40px'}">
<el-form-item label="知识产权状况" prop="intellectualProperty"> <el-form-item label="知识产权状况" prop="intellectualProperty">
<el-select v-model="formData.intellectualProperty" placeholder="请选择知识产权状况" clearable filterable> <el-select v-model="formData.intellectualProperty" placeholder="请选择知识产权状况" clearable filterable @change="changeCollectData">
<el-option <el-option
v-for="item in cacheStore.getDict('intellectual_property')" v-for="item in cacheStore.getDict('intellectual_property')"
:key="item.value" :key="item.value"
@@ -237,28 +237,28 @@
</el-col> </el-col>
<el-col :span="6" :style="{marginLeft:!formData.isSpecialFund?'-10px':'-40px'}"> <el-col :span="6" :style="{marginLeft:!formData.isSpecialFund?'-10px':'-40px'}">
<el-form-item label="发明专利(项)" prop="inventionPatent"> <el-form-item label="发明专利(项)" prop="inventionPatent">
<el-input-number v-model="formData.inventionPatent" placeholder="请输入发明专利数量" :controls="false"/> <el-input-number v-model="formData.inventionPatent" placeholder="请输入发明专利数量" :controls="false" @change="changeCollectData"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="新型专利(项)" prop="newPatent"> <el-form-item label="新型专利(项)" prop="newPatent">
<el-input-number v-model="formData.newPatent" placeholder="请输入实用性新型专利数量" :controls="false" <el-input-number v-model="formData.newPatent" placeholder="请输入实用性新型专利数量" :controls="false" @change="changeCollectData"
style="width: 100%"/> style="width: 100%"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6" :style="{marginLeft:!formData.isSpecialFund?'0':route.query.id?'':'-40px'}"> <el-col :span="6" :style="{marginLeft:!formData.isSpecialFund?'0':route.query.id?'':'-40px'}">
<el-form-item label="软件著作权(项)" prop="softwareCopyright"> <el-form-item label="软件著作权(项)" prop="softwareCopyright">
<el-input-number v-model="formData.softwareCopyright" placeholder="请输入软件著作权数量" :controls="false"/> <el-input-number v-model="formData.softwareCopyright" placeholder="请输入软件著作权数量" :controls="false" @change="changeCollectData"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6" :style="{marginLeft:!formData.isSpecialFund?'-10px':route.query.id?'-40px':'0'}"> <el-col :span="6" :style="{marginLeft:!formData.isSpecialFund?'-10px':route.query.id?'-40px':'0'}">
<el-form-item label="著作权(项)" prop="copyright"> <el-form-item label="著作权(项)" prop="copyright">
<el-input-number v-model="formData.copyright" placeholder="请输入著作权数量" :controls="false"/> <el-input-number v-model="formData.copyright" placeholder="请输入著作权数量" :controls="false" @change="changeCollectData"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6" :style="{marginLeft:!formData.isSpecialFund?'-10px':'-40px'}"> <el-col :span="6" :style="{marginLeft:!formData.isSpecialFund?'-10px':'-40px'}">
<el-form-item label="其他(项)" prop="other"> <el-form-item label="其他(项)" prop="other">
<el-input-number v-model="formData.other" placeholder="请输入其他数量" :controls="false"/> <el-input-number v-model="formData.other" placeholder="请输入其他数量" :controls="false" @change="changeCollectData"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@@ -268,14 +268,14 @@
<el-col :span="24"> <el-col :span="24">
<el-form-item label="现有业务描述" prop="serviceDescription"> <el-form-item label="现有业务描述" prop="serviceDescription">
<el-input v-model="formData.serviceDescription" placeholder="请输入现有业务描述" rows="4" type="textarea" <el-input v-model="formData.serviceDescription" placeholder="请输入现有业务描述" rows="4" type="textarea"
:style="{marginRight:!formData.isSpecialFund?'20px':'80px'}" :style="{marginRight:!formData.isSpecialFund?'20px':'80px'}" @change="changeCollectData"
clearable></el-input> clearable></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="建设目标描述" prop="contentDescription"> <el-form-item label="建设目标描述" prop="contentDescription">
<el-input v-model="formData.contentDescription" placeholder="请输入研发项目关键内容描述" rows="4" type="textarea" <el-input v-model="formData.contentDescription" placeholder="请输入研发项目关键内容描述" rows="4" type="textarea"
:style="{marginRight:!formData.isSpecialFund?'20px':'80px'}" :style="{marginRight:!formData.isSpecialFund?'20px':'80px'}" @change="changeCollectData"
clearable></el-input> clearable></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
@@ -395,14 +395,53 @@ const rules = reactive({
serviceDescription: [{required: true, message: '请输入现有业务描述', trigger: ['blur', 'change']}], serviceDescription: [{required: true, message: '请输入现有业务描述', trigger: ['blur', 'change']}],
contentDescription: [{required: true, message: '请输入研发项目关键内容描述', trigger: ['blur', 'change']}] contentDescription: [{required: true, message: '请输入研发项目关键内容描述', trigger: ['blur', 'change']}]
}) })
// watch(() => otherFileList.value, (newVal) => {
// console.log('newVal',newVal)
// otherFileList.value=newVal
// changeCollectData()
// }, {deep: true})
watch(() => singleList.value, (newVal) => {
showSingleTable.value = newVal.length !== 0;
}, {deep: true})
localStorage.removeItem('originallySelectedList') localStorage.removeItem('originallySelectedList')
if(localStorage.getItem('collectData')){
let collectData=JSON.parse(localStorage.getItem('collectData'))
if(collectData.fileList){
if (name.value === 'Summary/edit') {
attachment.value.allFileList=collectData.fileList
}else {
otherFileList.value=collectData.fileList
}
}
if(collectData.optionalChargeLeadership){
optionalChargeLeadershipList.value=collectData.optionalChargeLeadership
}
formData.value=collectData
}
const changeCollectData=()=>{
let params = {
...formData.value,
deploymentId: deploymentId.value,
fileList: [],
requirementId: route.query.id ? route.query.id : '-1'
}
if (name.value === 'Summary/edit') {
params.fileList= attachment.value.allFileList
}else {
params.fileList= otherFileList.value
}
localStorage.setItem('collectData', JSON.stringify(params))
}
const handleShowOptionalChargeLeadershipPicker = () => { const handleShowOptionalChargeLeadershipPicker = () => {
optionalChargeLeadershipPickerRef.value.showUserPicker() optionalChargeLeadershipPickerRef.value.showUserPicker()
} }
const optionalChargeLeaderPickerOkOrCancel = (userList) => { const optionalChargeLeaderPickerOkOrCancel = (userList) => {
optionalChargeLeadershipList.value = userList optionalChargeLeadershipList.value = userList
formData.value.optionalChargeLeadership = optionalChargeLeadershipList.value
changeCollectData()
} }
const handleBack = () => { const handleBack = () => {
@@ -479,15 +518,9 @@ const getOtherFile = (val) => {
nextTick(() => { nextTick(() => {
showTable.value = true showTable.value = true
}) })
changeCollectData()
} }
// watch(() => otherFileList.value, (newVal) => {
// console.log('newVal',newVal)
// showTable.value = newVal.length !== 0;
// console.log('showTable.value',showTable.value)
// }, {deep: true})
watch(() => singleList.value, (newVal) => {
showSingleTable.value = newVal.length !== 0;
}, {deep: true})
const getFileParam = (item) => { const getFileParam = (item) => {
if (item === undefined) return; if (item === undefined) return;
return { return {
@@ -495,6 +528,7 @@ const getFileParam = (item) => {
tag: item.tag tag: item.tag
} }
} }
const handleSubmit = debounce(async (instance) => { const handleSubmit = debounce(async (instance) => {
if (!instance) return if (!instance) return
instance.validate(async (valid, fields) => { instance.validate(async (valid, fields) => {
@@ -535,18 +569,19 @@ const handleSubmit = debounce(async (instance) => {
requirementId: route.query.id ? route.query.id : '-1' requirementId: route.query.id ? route.query.id : '-1'
} }
console.log('params', params) console.log('params', params)
let res = await requirementReported(params) // let res = await requirementReported(params)
ElNotification({ // ElNotification({
title: '提示', // title: '提示',
message: res.msg, // message: res.msg,
type: res.code === 1000 ? 'success' : 'error' // type: res.code === 1000 ? 'success' : 'error'
}) // })
if (res.code === 1000) { // if (res.code === 1000) {
tagsViewStore.delVisitedViews(router.currentRoute.value.path) // tagsViewStore.delVisitedViews(router.currentRoute.value.path)
await router.push({ // await router.push({
name: 'Summary' // name: 'Summary'
}) // })
} // localStorage.removeItem('collectData')
// }
}) })
}) })
const handleResubmit = debounce((instance) => { const handleResubmit = debounce((instance) => {
@@ -599,6 +634,7 @@ const handleResubmit = debounce((instance) => {
router.push({ router.push({
name: 'Summary' name: 'Summary'
}) })
localStorage.removeItem('collectData')
} }
}) })
}) })
@@ -623,6 +659,7 @@ const getDetailInfo = async () => {
} }
const specialFundChange = () => { const specialFundChange = () => {
processInfo() processInfo()
changeCollectData()
} }
const init = async () => { const init = async () => {
await getIsFund() await getIsFund()