fix : 修复分摊汇总及编辑功能

This commit is contained in:
2024-06-06 13:36:07 +08:00
parent 18806f13e4
commit 53ecadf315
6 changed files with 162 additions and 79 deletions

View File

@@ -15,10 +15,10 @@
</el-form>
<el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
<el-tab-pane label="分摊明细" name="first">
<expense-detail :showTable="showTable" :detailList="detailList" :loading="loading"/>
<expense-detail/>
</el-tab-pane>
<el-tab-pane label="分摊汇总" name="second">
<fvTable ref="tableIns" :tableConfig="tableConfig" :data="collectList">
<el-tab-pane label="分摊汇总" name="second" v-loading="loading">
<fvTable v-if="showTable" ref="tableRef" :tableConfig="tableConfig" :data="collectList">
<template #empty>
<el-empty description="暂无数据"/>
</template>
@@ -52,12 +52,11 @@ import OperationRender from '@/views/workflow/common/OperationRender.vue'
import ProcessDiagramViewer from '@/views/workflow/common/ProcessDiagramViewer.vue'
import {ElNotification} from "element-plus";
import {useProcessStore} from '@/stores/processStore.js';
import {getAllocationDetail, getAllocationDetailList,getAllocationCollect} from "@/api/expense-manage";
import {getAllocationDetail,getAllocationCollect} from "@/api/expense-manage";
const processStore = useProcessStore()
const route = useRoute()
const shareData = ref({})
const detailList = ref([])
const formData = ref({})
const auditOpinion = ref('')
const shareProcessViewer = ref(true)
@@ -75,23 +74,42 @@ const tableConfig = reactive({
width: '80',
},
{
prop: 'originalFileName',
prop: 'projectName',
label: '项目名称',
align: 'center',
},
{
prop: 'tag',
prop: 'projectCost',
label: '费用性质',
align: 'center'
align: 'center',
currentRender: ({row, index}) => {
if (row.projectCost !== null) {
return (<Tag dictType={'project_cost'} value={row.projectCost}/>)
} else {
return '--'
}
}
},
{
prop: 'size',
prop: 'researchStage',
label: '项目阶段',
align: 'center',
currentRender: ({row, index}) => {
if (row.researchStage&&row.researchStage !== null&&row.researchStage!==undefined) {
return (<Tag dictType={'research_stage'} value={row.researchStage}/>)
} else {
return '--'
}
}
},
{
prop: 'afterTax',
label: '分摊金额',
align: 'center'
},
{
prop: 'size',
label: '分摊金额',
prop: 'digest',
label: '摘要',
align: 'center'
}
]
@@ -120,18 +138,16 @@ const getDetail = async () => {
})
}
}
const getDetailList = async () => {
let params = {
allocationId: route.query.id
}
const getDetailCollect = async () => {
loading.value = true
showTable.value = false
const {code, data, msg} = await getAllocationDetailList(params)
const {code, data, msg} = await getAllocationCollect(route.query.id)
if (code === 1000) {
detailList.value = data.rows
collectList.value = data
nextTick(() => {
showTable.value = true
loading.value = false
showTable.value = true
})
}else {
ElNotification({
@@ -141,23 +157,21 @@ const getDetailList = async () => {
})
}
}
const getDetailCollect = async () => {
const {code, data, msg} = await getAllocationCollect(route.query.id)
if (code === 1000) {
collectList.value = data.rows
const handleClick = (tab) => {
console.log('tab',tab.index)
if (tab.index==0) {
getDetail()
}else {
ElNotification({
title: '提示',
message: msg,
type: 'error'
})
getDetailCollect()
}
}
getDetail()
getDetailList()
// getDetailCollect()
</script>
<style scoped lang="scss">
:deep(.el-table--fit ){
width: 100%;
height: 400px!important;
}
:deep(.el-tabs__nav-scroll) {
width: 100%;
display: flex;