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

View File

@@ -30,7 +30,7 @@
<baseTitle title="关联项目"></baseTitle>
<el-col :span="24">
<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">
<template #empty>
<el-empty :image-size="90" description="暂无数据" style="padding: 0"/>
@@ -41,7 +41,7 @@
<baseTitle title="附件列表"></baseTitle>
<el-col :span="24">
<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">
<template #empty>
<el-empty :image-size="90" description="暂无数据" style="padding: 0"/>
@@ -201,6 +201,8 @@ watch(() => props.showTable, (newVal) => {
}, {deep: true})
</script>
<style scoped>
<style scoped lang="scss">
:deep(.el-table--fit ){
height: 300px!important;
}
</style>

View File

@@ -103,7 +103,7 @@
</el-form-item>
</el-col>
<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>
</el-form-item>
</el-col>

View File

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

View File

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

View File

@@ -69,19 +69,18 @@ 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>
</div>
)
}
}
]
})
const handleDownload = (row) => {

View File

@@ -27,10 +27,11 @@
<script setup lang="jsx">
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 {getApplyProcess, projectApply, resubmitApply, getApplyDetail} from "@/api/project-manage";
import {useProcessStore} from '@/stores/processStore.js';
import {downloadFile} from "@/api/project-demand";
const tagsViewStore = useTagsView()
const router = useRouter()
@@ -71,25 +72,31 @@ const tableConfig = reactive({
align: 'center',
currentRender: ({row, index}) => (parseInt(row.size / 1024) + 'KB')
},
// {
// prop: 'oper',
// label: '操作',
// align: 'center',
// currentRender: ({row, index}) => {
// return (
// <div>
// <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>
// )
// }
// }
{
prop: 'oper',
label: '操作',
align: 'center',
currentRender: ({row, index}) => {
return (
<el-button type="primary" link onClick={() => handleDownload(row)}>下载</el-button>
)
}
}
]
})
const loading = ref(false)
const processInstanceData = ref()
const processDiagramViewer = ref(true)
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) => {
let tag = ''
if (name.value === 'Initiation/apply' || name.value === 'Initiation/edit') {
@@ -145,7 +152,7 @@ const handleSubmit = (instance) => {
type: 'error'
})
return;
}else {
} else {
attachment.value.clearValidate()
}
let params = {
@@ -206,7 +213,7 @@ const handleResubmit = async () => {
type: 'error'
})
return;
}else {
} else {
attachment.value.clearValidate()
}
console.log('params', params)
@@ -252,7 +259,7 @@ const init = () => {
nextTick(() => {
processDiagramViewer.value = true
})
}else {
} else {
ElNotification({
title: '提示',
message: res.msg,

View File

@@ -6,7 +6,7 @@
<el-input v-model="formData.name" placeholder="请输入专项资金名称" clearable></el-input>
</el-form-item>
<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>
<baseTitle title="介绍"></baseTitle>
@@ -14,7 +14,7 @@
v-model:value="formData.introduce"/>
<baseTitle title="申请文件"></baseTitle>
<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"
:isSettingCol="false" :pagination="false">
<template #empty>
@@ -169,7 +169,7 @@ const handleSubmit = async (instance) => {
const handleResubmit = () => {
if (!route.query.id) return
let params = {
id: route.query.id,
specialFundId: route.query.id,
...submitParam(formData.value)
}
resubmitFund(params).then(res => {
@@ -237,6 +237,8 @@ onMounted(async () => {
})
</script>
<style scoped>
<style scoped lang="scss">
:deep(.el-table--fit ){
height: 300px!important;
}
</style>

View File

@@ -10,6 +10,8 @@
<script setup lang="jsx">
import fvSelect from '@/fvcomponents/fvSelect/index.vue'
import { ElNotification} from "element-plus";
import {deleteFund} from "@/api/special-fund";
const router = useRouter()
const searchConfig = reactive([
@@ -117,9 +119,6 @@ const tableConfig = reactive({
if (buttons.has("edit")) {
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 (
<div style={{width: '100%'}}>
{
@@ -162,7 +161,7 @@ const handleDetail = (row) => {
router.push({
name: 'Fund/detail',
query: {
id: row.id
id: row.specialFundId
}
})
}
@@ -176,7 +175,19 @@ const handleEdit = (row) => {
router.push({
name: 'Fund/edit',
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'
})
if (res.code === 1000) {
validVisible.value = false
tagsViewStore.delVisitedViews(router.currentRoute.value.path)
router.push("/workflow/process")
}

View File

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