fix : 修改分摊汇总bug

This commit is contained in:
2024-06-06 22:13:14 +08:00
parent 4ddd53cec7
commit e1a7b46b35
3 changed files with 16 additions and 37 deletions

View File

@@ -38,15 +38,7 @@ export const getProjectOption = () => {
method: "get"
});
};
export const getAllocationCollect = (allocationId) => {
return request({
url: '/workflow/mosr/cost/allocation/collect',
method: "post",
params:{
allocationId:allocationId
}
});
};
export const editAllocation = (data) => {
return request({
url: '/workflow/mosr/cost/allocation/edit',

View File

@@ -203,10 +203,15 @@ const getList = async () => {
localData.loading = true
try {
const {code, data, msg} = await requestList(api, queryParmas)
if (code === 1000) {
localData.list = data.rows
localData.total = data.total
if(data.rows){
localData.list = data.rows
}else {
localData.list = data
}
if(data.total){
localData.total = data.total
}
localData.loading = false
} else {
ElNotification({

View File

@@ -18,7 +18,7 @@
<expense-detail/>
</el-tab-pane>
<el-tab-pane label="分摊汇总" name="second" v-loading="loading">
<fvTable v-if="showTable" ref="tableRef" :tableConfig="tableConfig" :data="collectList">
<fvTable v-if="showTable" ref="tableRef" :tableConfig="tableConfig">
<template #empty>
<el-empty description="暂无数据"/>
</template>
@@ -52,7 +52,7 @@ 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,getAllocationCollect} from "@/api/expense-manage";
import {getAllocationDetail} from "@/api/expense-manage";
const processStore = useProcessStore()
const route = useRoute()
@@ -62,7 +62,6 @@ const auditOpinion = ref('')
const shareProcessViewer = ref(true)
const showTable = ref(true)
const loading = ref(false)
const collectList = ref([])
const activeName = ref('first')
const tableConfig = reactive({
columns: [
@@ -112,7 +111,11 @@ const tableConfig = reactive({
label: '摘要',
align: 'center'
}
]
],
api:'/workflow/mosr/cost/allocation/collect',
params:{
allocationId:route.query.id
}
})
const getDetail = async () => {
const id = route.query.id
@@ -139,30 +142,9 @@ const getDetail = async () => {
}
}
const getDetailCollect = async () => {
loading.value = true
showTable.value = false
const {code, data, msg} = await getAllocationCollect(route.query.id)
if (code === 1000) {
collectList.value = data
nextTick(() => {
loading.value = false
showTable.value = true
})
}else {
ElNotification({
title: '提示',
message: msg,
type: 'error'
})
}
}
const handleClick = (tab) => {
console.log('tab',tab.index)
if (tab.index==0) {
getDetail()
}else {
getDetailCollect()
}
}
getDetail()