Merge pull request 'fix: 优化移动端项目管理功能' (#970) from master into prod

Reviewed-on: http://git.feashow.cn/clay/mosr-web/pulls/970
This commit is contained in:
2025-04-06 14:38:30 +00:00
7 changed files with 145 additions and 31 deletions

View File

@@ -86,3 +86,15 @@ export const shareExportExcel = (allocationId) => {
}
);
};
export const shareDetailExport= (data) => {
return axios.post(
`${import.meta.env.VITE_BASE_URL}/workflow/mosr/cost/share/export`,
data, {
responseType: 'blob',
headers: {
Authorization: getToken()
}
}
);
};

View File

@@ -32,7 +32,7 @@
<!-- <el-button color="#DED0B2" @click="handleUpload">上传附件</el-button>-->
<file-upload v-if="!isLineBtn&&uploadState" @getFile="getFile"/>
<el-button color="#DED0B2" @click="handleEditTag" v-if="activeName!='all'&&activeName!='plus'" style="margin-left: 10px;">编辑
<el-button color="#DED0B2" @click="handleEditTag" v-if="activeName!='all'&&activeName!='plus'&&uploadState" style="margin-left: 10px;">编辑
</el-button>
</div>
<fvTable style="width: 100%;min-height:311px;max-height: 311px" v-if="showAttachmentTable" height="311"

View File

@@ -2,7 +2,7 @@
<!-- <fvSearchForm :searchConfig="searchConfig" @search="search" style="margin-left: 16px"></fvSearchForm>-->
<!-- <el-button color="#DED0B2" style="float: left;margin: 0 10px 10px 0" @click="exportTable">导出</el-button>-->
<fvTable ref="tableIns" :tableConfig="tableConfig" @headBtnClick="headBtnClick" style="margin-top: 15px">
<fvTable ref="tableIns" :tableConfig="tableConfig" @headBtnClick="headBtnClick" style="margin-top: 15px" @selectionChange="selectionChange">
<template #empty>
<el-empty description="暂无数据"/>
</template>
@@ -10,11 +10,10 @@
</template>
<script setup lang="jsx">
import fvSelect from '@/fvcomponents/fvSelect/index.vue'
import {toThousands} from '@/utils/changePrice.js'
import { getSubCompOpt } from '@/api/user/user.js';
import {reactive, ref} from "vue";
import {shareExportExcel} from "@/api/expense-manage";
import {shareDetailExport, shareExportExcel} from "@/api/expense-manage";
import {ElMessage} from "element-plus";
const router = useRouter()
const route = useRoute()
const searchConfig = reactive([
@@ -54,8 +53,13 @@ const searchConfig = reactive([
// },
])
const tableIns = ref()
const selectData = ref([])
const tableConfig = reactive({
columns: [
{
type: 'selection',
prop: 'selection',
},
// {
// prop: 'name',
// type: 'index',
@@ -100,7 +104,16 @@ const tableConfig = reactive({
{
prop: 'personnelNature',
label: '人员性质',
align: 'center'
align: 'center',
width: 120,
showOverflowTooltip: false,
currentRender: ({row, index}) => {
if (row.personnelNature&&row.personnelNature !== null&&row.personnelNature!==undefined) {
return (<Tag dictType={'nature_of_personnel'} value={row.personnelNature}/>)
} else {
return '--'
}
}
},
{
prop: 'researchDuration',
@@ -126,23 +139,15 @@ const tableConfig = reactive({
api: '/workflow/mosr/cost/share',
params: {},
btns: [
{name: '添加分摊', key: 'add', color: '#DED0B2'}
{name: '添加分摊', key: 'add', color: '#DED0B2'},
{name: '导出', key: 'export', color: '#DED0B2'}
],
export:{
open :false,
}
})
// const exportTable = () => {
// shareExportExcel().then(res => {
// console.log(res)
// let fileName = `科技研发项目工时及成本分摊汇总表.xlsx`
// const blob = new Blob([res.data])
// let a = document.createElement('a')
// a.href = URL.createObjectURL(blob)
// a.download = fileName
// a.click()
// })
// }
const search = (val) => {
tableConfig.params = {...val}
tableIns.value.refresh()
@@ -152,8 +157,32 @@ const headBtnClick = (key) => {
case 'add':
handleAdd()
break;
case 'export':
exportTable()
break;
}
}
const selectionChange = (data) => {
console.log('data', data)
selectData.value=data
}
const exportTable = () => {
console.log('selectData',selectData.value)
if (selectData.value.length === 0) {
ElMessage.warning('请选择要导出的费用分摊')
return
}
shareDetailExport(selectData.value[0]).then(res => {
console.log(res)
let fileName = `科技研发项目工时及成本分摊汇总表.xlsx`
const blob = new Blob([res.data])
let a = document.createElement('a')
a.href = URL.createObjectURL(blob)
a.download = fileName
a.click()
})
}
const handleAdd = () => {
router.push({
name: 'Sharedetail/add',
@@ -172,7 +201,7 @@ const init = async () => {
:deep(.el-table__header) {
.is-leaf:first-child {
.cell {
margin-left: -25px !important;
//margin-left: -25px !important;
}
}
}
@@ -180,7 +209,7 @@ const init = async () => {
:deep(.el-table__body) {
.el-table__cell:first-child {
.cell {
margin-left: -13px !important;
//margin-left: -13px !important;
}
}
}

View File

@@ -393,7 +393,7 @@ const getTagName = (type) => {
case 'approval':
return '项目立项'
case 'execute':
return '项目实施'
return '项目验收'
case 'archivist':
return '项目归档'
case 'phase':

View File

@@ -21,15 +21,24 @@
<span>{{ toThousands(formData.residualAmount) }}</span>
</el-form-item>
</el-col>
<baseTitle title="介绍"></baseTitle>
<!-- <baseTitle title="介绍"></baseTitle>-->
<!-- <el-col :span="24">-->
<!-- <el-form-item>-->
<!-- <el-card style="width: 100%">-->
<!-- <div v-html="formData.introduce">-->
<!-- </div>-->
<!-- </el-card>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<el-col :span="24">
<el-form-item>
<el-card style="width: 100%">
<div v-html="formData.introduce">
</div>
</el-card>
<el-form-item label="专项资金情况说明" >
<div style="white-space: pre-wrap">{{formData.introduce}}
</div>
</el-form-item>
</el-col>
</el-row>
<el-row style="margin-top: -18px;" class="projects">
<baseTitle title="关联项目"></baseTitle>
<el-col :span="24">
<el-form-item>
@@ -41,6 +50,8 @@
</fvTable>
</el-form-item>
</el-col>
</el-row>
<el-row style="margin-top: -18px;" class="projects">
<baseTitle title="附件文件"></baseTitle>
<el-col :span="24">
<el-form-item>
@@ -137,7 +148,7 @@ const projectTable = reactive({
prop: 'startTime',
label: '项目时间',
align: 'center',
width: 150,
width: 180,
},
// {
// prop: 'oper',

View File

@@ -211,7 +211,7 @@ const schema = computed(() => {
)
},
{
label: '所属业务板块',
label: '业务板块',
prop: 'businessSegment',
colProps: {
span: 24
@@ -258,6 +258,7 @@ const schema = computed(() => {
</div>
)
},
{
label: '预估经费预算',
prop: 'economicEstimate',
@@ -274,6 +275,22 @@ const schema = computed(() => {
</div>
)
},
{
label: '实际经费预算',
prop: 'actualEconomicEstimate',
colProps: {
span: 6
},
component: () => (
<div>
{
baseFormData.value?.actualEconomicEstimate ?
<span>{toThousands(baseFormData.value?.actualEconomicEstimate)}</span>
: <span>{'--'}</span>
}
</div>
)
},
{
label: '产学研联合',
prop: 'industryUniversityResearch',
@@ -320,9 +337,27 @@ const schema = computed(() => {
span: 24
}
},
{
label: '预估专项资金(元)',
prop: 'specialFundAmount',
prop: 'forecastSpecialFundAmount',
colProps: {
span: 24
},
component: () => (
<div>
{
baseFormData.value?.forecastSpecialFundAmount ?
<span>{toThousands(baseFormData.value?.forecastSpecialFundAmount)}</span>
: <span>{'--'}</span>
}
</div>
)
},
{
label: '实际专项资金(元)',
prop: 'forecastSpecialFundAmount',
colProps: {
span: 24
},
@@ -336,12 +371,36 @@ const schema = computed(() => {
</div>
)
},
{
label: '是否在预算内',
prop: 'isWithinBudget',
colProps: {
span: 24
},
component: () => (
<div>
{
baseFormData.value?.isWithinBudget!=null ? baseFormData.value?.isWithinBudget?
<span>{'预算内'}</span>
: <span>{'预算外'}</span>:'--'
}
</div>
)
},
{
label: '部门分管领导',
prop: 'optionalChargeLeadership',
colProps: {
span: 24
}
},
{
label: '主项目',
prop: 'masterProjectName',
colProps: {
span: 24
}
}
]
})
@@ -579,6 +638,9 @@ watchEffect(() => {
</script>
<style lang="scss" scoped>
:deep(.el-step__title){
font-size: 14px;
}
.steps-box {
padding: 10px 0;
}

View File

@@ -94,7 +94,7 @@
</el-form-item>
</div>
<div v-if="data.state==='5'" style="margin-bottom: 15px">
<baseTitle title="前置流程"></baseTitle>
<baseTitle title="前置流程" v-if="localFormData.preProcess"></baseTitle>
<div style="display: flex;align-items: center;flex-wrap: wrap;">
<div v-for="(item,index) in localFormData.preProcess" :key="item.requestId">
<a :href="item.baseUrl" target="_blank"