Merge pull request 'fix : 修复文件下载、专项资金新增、删除功能、流程新增细节优化' (#270) from dj into master

Reviewed-on: http://git.feashow.cn/clay/mosr-web/pulls/270
This commit is contained in:
2024-06-02 08:12:55 +00:00
12 changed files with 94 additions and 52 deletions

View File

@@ -38,3 +38,9 @@ export const resubmitFund= (data) => {
data data
}); });
}; };
export const deleteFund = (id) => {
return request({
url: `/workflow/mosr/special/fund/${id}`,
method: "delete"
});
};

View File

@@ -11,7 +11,8 @@
import {ElNotification} from 'element-plus'; import {ElNotification} from 'element-plus';
import {agreeTask, rejectTask} from "@/api/project-demand/index.js"; import {agreeTask, rejectTask} from "@/api/project-demand/index.js";
import { useTagsView } from '@/stores/tagsview.js' import {useTagsView} from '@/stores/tagsview.js'
const tagsViewStore = useTagsView() const tagsViewStore = useTagsView()
const route = useRoute() const route = useRoute()
const router = useRouter() const router = useRouter()
@@ -84,7 +85,11 @@ const back = () => {
} }
break; break;
case 'Fund/detail': case 'Fund/detail':
router.push({name: 'Fund'}) if (route.query.source === 'home') {
router.push('/home')
} else {
router.push({name: 'Fund'})
}
break; break;
case 'Share/detail': case 'Share/detail':
router.push({name: 'Expense/share'}) router.push({name: 'Expense/share'})

View File

@@ -30,7 +30,7 @@
<baseTitle title="关联项目"></baseTitle> <baseTitle title="关联项目"></baseTitle>
<el-col :span="24"> <el-col :span="24">
<el-form-item> <el-form-item>
<fvTable style="width: 100%;max-height: 200px" v-if="showTable" :tableConfig="projectTable" <fvTable style="width: 100%;max-height:300px" v-if="showTable" :tableConfig="projectTable"
:data="formData.projects" :isSettingCol="false" :pagination="false"> :data="formData.projects" :isSettingCol="false" :pagination="false">
<template #empty> <template #empty>
<el-empty :image-size="90" description="暂无数据" style="padding: 0"/> <el-empty :image-size="90" description="暂无数据" style="padding: 0"/>
@@ -41,7 +41,7 @@
<baseTitle title="附件列表"></baseTitle> <baseTitle title="附件列表"></baseTitle>
<el-col :span="24"> <el-col :span="24">
<el-form-item> <el-form-item>
<fvTable style="width: 100%;max-height: 200px" v-if="showTable" :tableConfig="fileTable" <fvTable style="width: 100%;max-height: 300px;" v-if="showTable" :tableConfig="fileTable"
:data="formData.files" :isSettingCol="false" :pagination="false"> :data="formData.files" :isSettingCol="false" :pagination="false">
<template #empty> <template #empty>
<el-empty :image-size="90" description="暂无数据" style="padding: 0"/> <el-empty :image-size="90" description="暂无数据" style="padding: 0"/>
@@ -201,6 +201,8 @@ watch(() => props.showTable, (newVal) => {
}, {deep: true}) }, {deep: true})
</script> </script>
<style scoped> <style scoped lang="scss">
:deep(.el-table--fit ){
height: 300px!important;
}
</style> </style>

View File

@@ -103,7 +103,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="其中申请公司总部科技创新专项资金(元)" prop="specialFundAmount"> <el-form-item label="其中申请公司总部科技创新专项资金(元)" prop="specialFundAmount" v-if="localFormData.isSpecialFund!==null||localFormData.isSpecialFund">
<span>{{ localFormData.specialFundAmount }}</span> <span>{{ localFormData.specialFundAmount }}</span>
</el-form-item> </el-form-item>
</el-col> </el-col>

View File

@@ -74,7 +74,7 @@ const props = defineProps({
}, },
height:{ height:{
type: Number, type: Number,
default: 650 default: 500
} }
}) })
const content = ref(props.value); const content = ref(props.value);

View File

@@ -148,7 +148,6 @@ const tableConfig = reactive({
return ( return (
<div> <div>
<el-button type="primary" link onClick={() => handleView(row)}>查看</el-button> <el-button type="primary" link onClick={() => handleView(row)}>查看</el-button>
<el-button type="primary" link onClick={() => handleEdit(row)}>已读</el-button>
</div> </div>
) )
} }
@@ -175,7 +174,7 @@ const handleView = (row) => {
source: 'home' source: 'home'
} }
}) })
} else { } else if (row.targetState == '20'||row.targetState == '40'||row.targetState == '50'){
router.push({ router.push({
name: 'Implementation/detail', name: 'Implementation/detail',
query: { query: {
@@ -185,6 +184,15 @@ const handleView = (row) => {
source: 'home' source: 'home'
} }
}) })
}else if (row.targetState == '70' && row.targetId) {
router.push({
name: 'Fund/detail',
query: {
id: row.targetId,
state: row.state,
source: 'home'
}
})
} }
} }
</script> </script>

View File

@@ -69,19 +69,18 @@ const tableConfig = reactive({
align: 'center', align: 'center',
currentRender: ({row, index}) => (parseInt(row.size / 1024) + 'KB') currentRender: ({row, index}) => (parseInt(row.size / 1024) + 'KB')
}, },
// { {
// prop: 'oper', prop: 'oper',
// label: '操作', label: '操作',
// align: 'center', align: 'center',
// currentRender: ({row, index}) => { currentRender: ({row, index}) => {
// return ( return (
// <div> <div>
// <el-button type="primary" link onClick={() => handleDownload(row)}>下载</el-button> <el-button type="primary" link onClick={() => handleDownload(row)}>下载</el-button>
// <el-button type="primary" size="large" link onClick={() => beforeRemove(row)}>删除</el-button> </div>
// </div> )
// ) }
// } }
// }
] ]
}) })
const handleDownload = (row) => { const handleDownload = (row) => {

View File

@@ -27,10 +27,11 @@
<script setup lang="jsx"> <script setup lang="jsx">
import {useTagsView} from '@/stores/tagsview.js' import {useTagsView} from '@/stores/tagsview.js'
import {ElMessage, ElNotification} from "element-plus"; import { ElNotification} from "element-plus";
import ProcessDiagramViewer from '@/views/workflow/common/ProcessDiagramViewer.vue'; import ProcessDiagramViewer from '@/views/workflow/common/ProcessDiagramViewer.vue';
import {getApplyProcess, projectApply, resubmitApply, getApplyDetail} from "@/api/project-manage"; import {getApplyProcess, projectApply, resubmitApply, getApplyDetail} from "@/api/project-manage";
import {useProcessStore} from '@/stores/processStore.js'; import {useProcessStore} from '@/stores/processStore.js';
import {downloadFile} from "@/api/project-demand";
const tagsViewStore = useTagsView() const tagsViewStore = useTagsView()
const router = useRouter() const router = useRouter()
@@ -71,25 +72,31 @@ const tableConfig = reactive({
align: 'center', align: 'center',
currentRender: ({row, index}) => (parseInt(row.size / 1024) + 'KB') currentRender: ({row, index}) => (parseInt(row.size / 1024) + 'KB')
}, },
// { {
// prop: 'oper', prop: 'oper',
// label: '操作', label: '操作',
// align: 'center', align: 'center',
// currentRender: ({row, index}) => { currentRender: ({row, index}) => {
// return ( return (
// <div> <el-button type="primary" link onClick={() => handleDownload(row)}>下载</el-button>
// <a style="cursor: pointer;font-size: 14px;color: #2a99ff;" href={row.url}>下载</a> )
// <el-button type="primary" size="large" link onClick={() => beforeRemove(row)}>删除</el-button> }
// </div> }
// )
// }
// }
] ]
}) })
const loading = ref(false) const loading = ref(false)
const processInstanceData = ref() const processInstanceData = ref()
const processDiagramViewer = ref(true) const processDiagramViewer = ref(true)
const name = ref(router.currentRoute.value.name) const name = ref(router.currentRoute.value.name)
const handleDownload = (row) => {
downloadFile(row.fileId).then(res => {
const blob = new Blob([res])
let a = document.createElement('a')
a.href = URL.createObjectURL(blob)
a.download = row.originalFileName
a.click()
})
}
const compositeParam = (item) => { const compositeParam = (item) => {
let tag = '' let tag = ''
if (name.value === 'Initiation/apply' || name.value === 'Initiation/edit') { if (name.value === 'Initiation/apply' || name.value === 'Initiation/edit') {
@@ -145,7 +152,7 @@ const handleSubmit = (instance) => {
type: 'error' type: 'error'
}) })
return; return;
}else { } else {
attachment.value.clearValidate() attachment.value.clearValidate()
} }
let params = { let params = {
@@ -206,7 +213,7 @@ const handleResubmit = async () => {
type: 'error' type: 'error'
}) })
return; return;
}else { } else {
attachment.value.clearValidate() attachment.value.clearValidate()
} }
console.log('params', params) console.log('params', params)
@@ -252,7 +259,7 @@ const init = () => {
nextTick(() => { nextTick(() => {
processDiagramViewer.value = true processDiagramViewer.value = true
}) })
}else { } else {
ElNotification({ ElNotification({
title: '提示', title: '提示',
message: res.msg, message: res.msg,

View File

@@ -6,7 +6,7 @@
<el-input v-model="formData.name" placeholder="请输入专项资金名称" clearable></el-input> <el-input v-model="formData.name" placeholder="请输入专项资金名称" clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item label="金额(元)" prop="fundAmount"> <el-form-item label="金额(元)" prop="fundAmount">
<el-input v-model="formData.fundAmount" placeholder="请输入金额" clearable></el-input> <el-input-number v-model="formData.fundAmount" placeholder="请输入金额" :controls="false"/>
</el-form-item> </el-form-item>
</el-form> </el-form>
<baseTitle title="介绍"></baseTitle> <baseTitle title="介绍"></baseTitle>
@@ -14,7 +14,7 @@
v-model:value="formData.introduce"/> v-model:value="formData.introduce"/>
<baseTitle title="申请文件"></baseTitle> <baseTitle title="申请文件"></baseTitle>
<file-upload @getFile="getFile"/> <file-upload @getFile="getFile"/>
<fvTable style="width: 100%;max-height: 650px;" v-if="showTable" <fvTable style="width: 100%;max-height: 300px;" v-if="showTable"
:tableConfig="tableConfig" :data="formData.files" :tableConfig="tableConfig" :data="formData.files"
:isSettingCol="false" :pagination="false"> :isSettingCol="false" :pagination="false">
<template #empty> <template #empty>
@@ -169,7 +169,7 @@ const handleSubmit = async (instance) => {
const handleResubmit = () => { const handleResubmit = () => {
if (!route.query.id) return if (!route.query.id) return
let params = { let params = {
id: route.query.id, specialFundId: route.query.id,
...submitParam(formData.value) ...submitParam(formData.value)
} }
resubmitFund(params).then(res => { resubmitFund(params).then(res => {
@@ -237,6 +237,8 @@ onMounted(async () => {
}) })
</script> </script>
<style scoped> <style scoped lang="scss">
:deep(.el-table--fit ){
height: 300px!important;
}
</style> </style>

View File

@@ -10,6 +10,8 @@
<script setup lang="jsx"> <script setup lang="jsx">
import fvSelect from '@/fvcomponents/fvSelect/index.vue' import fvSelect from '@/fvcomponents/fvSelect/index.vue'
import { ElNotification} from "element-plus";
import {deleteFund} from "@/api/special-fund";
const router = useRouter() const router = useRouter()
const searchConfig = reactive([ const searchConfig = reactive([
@@ -117,9 +119,6 @@ const tableConfig = reactive({
if (buttons.has("edit")) { if (buttons.has("edit")) {
btn.push({label: '编辑', prem: ['mosr:collect:resubmit'], func: () => handleEdit(row), type: 'primary'}) btn.push({label: '编辑', prem: ['mosr:collect:resubmit'], func: () => handleEdit(row), type: 'primary'})
} }
// if (buttons.has("delete")) {
// btn.push({label: '删除',prem: ['mosr:requirement:del'], func: () => handleDelete(row), type: 'primary'})
// }
return ( return (
<div style={{width: '100%'}}> <div style={{width: '100%'}}>
{ {
@@ -162,7 +161,7 @@ const handleDetail = (row) => {
router.push({ router.push({
name: 'Fund/detail', name: 'Fund/detail',
query: { query: {
id: row.id id: row.specialFundId
} }
}) })
} }
@@ -176,7 +175,19 @@ const handleEdit = (row) => {
router.push({ router.push({
name: 'Fund/edit', name: 'Fund/edit',
query: { query: {
id: row.id id: row.specialFundId
}
})
}
const handleDelete = async (row) => {
deleteFund(row.specialFundId).then(res => {
ElNotification({
title: '提示',
message: res.msg,
type: res.code === 1000 ? 'success' : 'error'
})
if (res.code === 1000) {
tableIns.value.refresh()
} }
}) })
} }

View File

@@ -324,6 +324,7 @@ const doPublish = () => {
type: res.code === 1000 ? 'success' : 'error' type: res.code === 1000 ? 'success' : 'error'
}) })
if (res.code === 1000) { if (res.code === 1000) {
validVisible.value = false
tagsViewStore.delVisitedViews(router.currentRoute.value.path) tagsViewStore.delVisitedViews(router.currentRoute.value.path)
router.push("/workflow/process") router.push("/workflow/process")
} }

View File

@@ -142,14 +142,15 @@ const selectDefinition = ref(null)
const historyVersionList = ref([]) const historyVersionList = ref([])
const singleTable = ref() const singleTable = ref()
const isVisited = ref(false) const isVisited = ref(false)
onActivated(()=>{
getList()
})
//重置搜索 //重置搜索
const handleReset = () => { const handleReset = () => {
queryForm.value.resetFields() queryForm.value.resetFields()
getList() getList()
} }
//获取数据 //获取数据
const getList = async () => { const getList = async () => {
let params = { let params = {