Merge pull request 'master' (#908) from master into prod
Reviewed-on: http://git.feashow.cn/clay/mosr-web/pulls/908
This commit is contained in:
@@ -94,3 +94,13 @@ export const getRequirementStatePerm = () => {
|
||||
method: "get"
|
||||
});
|
||||
};
|
||||
export const downloadTemplate = (type) => {
|
||||
return request({
|
||||
url: '/workflow/mosr/attachment/download/template',
|
||||
method: "get",
|
||||
responseType:'blob',
|
||||
params:{
|
||||
type:type
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
@@ -1,29 +1,32 @@
|
||||
<template>
|
||||
<el-form :model="formData" ref="applyForm" :rules="rules" :label-position="labelPosition" style="margin-left: 5px">
|
||||
<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-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-form-item :label="label" prop="" required>
|
||||
<file-upload @getFile="getOtherFile"/>
|
||||
<el-button color="#DED0B2" v-if="templateDownloadBtnShow" @click="handleImportTemplateDownload"
|
||||
style="margin-left: 10px">模板下载
|
||||
</el-button>
|
||||
<fvTable style="width: 100%;max-height: 160px;" v-if="showTable" height="160" :tableConfig="tableConfig"
|
||||
:data="allFileList" :isSettingCol="false" :pagination="false">
|
||||
<template #empty>
|
||||
@@ -34,13 +37,14 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<file-preview ref="filePreviewRef" v-if="filePreviewShow" :fileName="filePreviewParam.fileName" :fileUrl="filePreviewParam.fileUrl"
|
||||
<file-preview ref="filePreviewRef" v-if="filePreviewShow" :fileName="filePreviewParam.fileName"
|
||||
:fileUrl="filePreviewParam.fileUrl"
|
||||
:fileType="filePreviewParam.fileType"/>
|
||||
</template>
|
||||
|
||||
<script setup lang="jsx">
|
||||
import FileUpload from '@/components/FileUpload.vue'
|
||||
import {deleteFile, downloadFile} from "@/api/project-demand";
|
||||
import {deleteFile, downloadFile, downloadTemplate} from "@/api/project-demand";
|
||||
import {ElMessageBox, ElNotification} from "element-plus";
|
||||
|
||||
|
||||
@@ -65,6 +69,16 @@ const props = defineProps({
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
//是否显示模板下载按钮
|
||||
templateDownloadBtnShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
//模板下载时的文件名
|
||||
templateName: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
singleList: {
|
||||
type: Array,
|
||||
default: []
|
||||
@@ -103,7 +117,8 @@ const baseTableConf = reactive(
|
||||
align: 'center',
|
||||
width: 400,
|
||||
currentRender: ({row, index}) => (
|
||||
<div style="color: #2a99ff;cursor: pointer;" onClick={() => clickToPreview(row)}>{row.originalFileName}</div>)
|
||||
<div style="color: #2a99ff;cursor: pointer;"
|
||||
onClick={() => clickToPreview(row)}>{row.originalFileName}</div>)
|
||||
},
|
||||
{
|
||||
prop: 'tag',
|
||||
@@ -249,7 +264,7 @@ const isHaveOneFile = ref(false)
|
||||
const allFileList = ref([])
|
||||
if (localStorage.getItem('singleFile')) {
|
||||
singleFileArray.value.push(JSON.parse(localStorage.getItem('singleFile')))
|
||||
singleFile.value =JSON.parse(localStorage.getItem('singleFile'))
|
||||
singleFile.value = JSON.parse(localStorage.getItem('singleFile'))
|
||||
}
|
||||
|
||||
const filePreviewParam = ref({
|
||||
@@ -277,7 +292,7 @@ const _otherFileListValue = computed({
|
||||
}
|
||||
})
|
||||
if (_otherFileListValue.value && _otherFileListValue.value.length > 0) {
|
||||
isHaveOneFile.value=true
|
||||
isHaveOneFile.value = true
|
||||
_otherFileListValue.value.forEach(item => {
|
||||
allFileList.value.push(item)
|
||||
})
|
||||
@@ -288,7 +303,7 @@ if (_otherFileListValue.value && _otherFileListValue.value.length > 0) {
|
||||
watch(() => props.formData.fileList, (newVal) => {
|
||||
if (props.preview) {
|
||||
newVal?.forEach(item => {
|
||||
isHaveOneFile.value=true
|
||||
isHaveOneFile.value = true
|
||||
allFileList.value.push(item)
|
||||
})
|
||||
}
|
||||
@@ -340,6 +355,26 @@ watch(() => isHaveOneFile.value, (newVal) => {
|
||||
// }, {deep: true})
|
||||
|
||||
|
||||
const handleImportTemplateDownload = () => {
|
||||
console.info("🚀 ~method:handleImportTemplateDownload -----", props.tag)
|
||||
let templateType = ''
|
||||
if (props.tag === '需求上报') {
|
||||
templateType = '2'
|
||||
} else if (props.tag === '项目立项') {
|
||||
templateType = '5'
|
||||
} else if (props.tag === '项目验收') {
|
||||
templateType = '7'
|
||||
}else if (props.tag === '阶段变更') {
|
||||
templateType = '8'
|
||||
}
|
||||
downloadTemplate(templateType).then(res => {
|
||||
const blob = new Blob([res])
|
||||
let a = document.createElement('a')
|
||||
a.href = URL.createObjectURL(blob)
|
||||
a.download = props.templateName + ".docx"
|
||||
a.click()
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
const clickToPreview = (row) => {
|
||||
@@ -350,14 +385,13 @@ const clickToPreview = (row) => {
|
||||
fileName: row.originalFileName,
|
||||
fileType: row.fileType
|
||||
}
|
||||
nextTick(()=>{
|
||||
nextTick(() => {
|
||||
filePreviewShow.value = true
|
||||
})
|
||||
// filePreviewRef.value.show()
|
||||
}
|
||||
|
||||
|
||||
|
||||
const handleDelete = (row, type) => {
|
||||
deleteFile(row.fileId).then(res => {
|
||||
ElNotification({
|
||||
@@ -371,14 +405,14 @@ const handleDelete = (row, type) => {
|
||||
isSingleFile.value = false
|
||||
} else {
|
||||
allFileList.value.splice(allFileList.value.findIndex((item) => item.fileId === row.fileId), 1);
|
||||
if(allFileList.value&&allFileList.value?.length==0){
|
||||
isHaveOneFile.value=false
|
||||
}else{
|
||||
isHaveOneFile.value=true
|
||||
if (allFileList.value && allFileList.value?.length == 0) {
|
||||
isHaveOneFile.value = false
|
||||
} else {
|
||||
isHaveOneFile.value = true
|
||||
}
|
||||
if(localStorage.getItem('collectData')){
|
||||
let collectData=JSON.parse(localStorage.getItem('collectData'))
|
||||
collectData.fileList=allFileList.value
|
||||
if (localStorage.getItem('collectData')) {
|
||||
let collectData = JSON.parse(localStorage.getItem('collectData'))
|
||||
collectData.fileList = allFileList.value
|
||||
localStorage.setItem('collectData', JSON.stringify(collectData))
|
||||
}
|
||||
}
|
||||
@@ -409,7 +443,7 @@ const getOtherFile = (val) => {
|
||||
} else {
|
||||
allFileList.value = _otherFileListValue.value
|
||||
}
|
||||
isHaveOneFile.value=true
|
||||
isHaveOneFile.value = true
|
||||
emit('getOtherFile', val)
|
||||
}
|
||||
const deleteAttachment = (val) => {
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
</el-form>
|
||||
<!-- v-if="showAttachment"-->
|
||||
<AttachmentUpload ref="attachment" :label="getTitleName(title)+'附件'" :showTable="showTable"
|
||||
v-model:otherFileList="otherFileList" :tag="getTitleName(props.title)"
|
||||
v-model:otherFileList="otherFileList" :tag="getTitleName(props.title)" :templateName="getTemplateName(props.title)" :templateDownloadBtnShow="props.title==='apply'?true:props.title==='check'"
|
||||
@getAttachment="getAttachment" v-model:singleList="singleList" :showSingleTable="showSingleTable"
|
||||
@getOtherFile="getOtherFile" :showFileList="true" :formData="localFormData"
|
||||
:preview="mode == 'resubmit'"/>
|
||||
@@ -250,6 +250,16 @@ const filePreviewParam = ref({
|
||||
fileType: 'pdf'
|
||||
})
|
||||
const filePreviewShow = ref(false)
|
||||
|
||||
const getTemplateName=(type)=>{
|
||||
switch (type) {
|
||||
case 'apply':
|
||||
return '科技创新项目立项申请表'
|
||||
case 'check':
|
||||
return '科技创新项目验收申请表'
|
||||
}
|
||||
}
|
||||
|
||||
const handleShowOptionalChargeLeadershipPicker = () => {
|
||||
optionalChargeLeadershipPickerRef.value.showUserPicker()
|
||||
}
|
||||
|
||||
@@ -284,7 +284,7 @@
|
||||
<baseTitle title="附件文件"></baseTitle>
|
||||
<div :style="{marginRight:!formData.isSpecialFund?'20px':'80px'}">
|
||||
<AttachmentUpload ref="attachment" label="需求申请书附件"
|
||||
:showTable="showTable"
|
||||
:showTable="showTable" templateName="科技创新项目需求申请书" :templateDownloadBtnShow="true"
|
||||
v-model:otherFileList="otherFileList"
|
||||
@getOtherFile="getOtherFile"
|
||||
:showSingleTable="showSingleTable" @getAttachment="getAttachment"
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
</el-form>
|
||||
<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" templateName="科技创新项目变更申请表" :templateDownloadBtnShow="true"
|
||||
@getAttachment="getAttachment" v-model:singleList="singleList" :showSingleTable="showSingleTable"
|
||||
@getOtherFile="getOtherFile" :showFileList="true" :formData="formData" tag="阶段变更"
|
||||
:preview="name === 'Phase/edit'"/>
|
||||
|
||||
@@ -34,7 +34,10 @@
|
||||
</el-row>
|
||||
</el-form>
|
||||
<baseTitle title="附件文件" style="margin-right: 10px"></baseTitle>
|
||||
<file-upload @getFile="getFile"/>
|
||||
<div style="display:flex;">
|
||||
<file-upload @getFile="getFile"/>
|
||||
<el-button color="#DED0B2" @click="handleImportTemplateDownload" style="margin-left: 10px">模板下载</el-button>
|
||||
</div>
|
||||
|
||||
<fvTable style="width: 100%;max-height: 160px;" v-if="showTable"
|
||||
:tableConfig="tableConfig" height="160" :data="formData.files"
|
||||
@@ -84,7 +87,7 @@ import {addFund, resubmitFund, getFundDetail, getFundDetailProcess, getFundProce
|
||||
import {useRouter} from "vue-router";
|
||||
import {useTagsView} from '@/stores/tagsview.js'
|
||||
import {useProcessStore} from '@/stores/processStore.js';
|
||||
import {downloadFile, deleteFile} from "@/api/project-demand";
|
||||
import {downloadFile, deleteFile,downloadTemplate} from "@/api/project-demand";
|
||||
|
||||
const changeDiagram = ref(false)
|
||||
const tagsViewStore = useTagsView()
|
||||
@@ -161,6 +164,18 @@ const filePreviewParam = ref({
|
||||
fileType: 'pdf'
|
||||
})
|
||||
const filePreviewShow = ref(false)
|
||||
|
||||
|
||||
const handleImportTemplateDownload=()=>{
|
||||
downloadTemplate('13').then(res => {
|
||||
const blob = new Blob([res])
|
||||
let a = document.createElement('a')
|
||||
a.href = URL.createObjectURL(blob)
|
||||
a.download = '科技创新项目专项资金任务书.docx'
|
||||
a.click()
|
||||
})
|
||||
}
|
||||
|
||||
const clickToPreview = (row) => {
|
||||
filePreviewShow.value = false
|
||||
filePreviewParam.value = {
|
||||
|
||||
Reference in New Issue
Block a user