feat(expense-management): 新增费用分摊功能
This commit is contained in:
248
src/views/expense-management/cost-detail/index.vue
Normal file
248
src/views/expense-management/cost-detail/index.vue
Normal file
@@ -0,0 +1,248 @@
|
||||
<template>
|
||||
<fvSearchForm :searchConfig="searchConfig" @search="search" style="margin-left: 16px"></fvSearchForm>
|
||||
<fvTable ref="tableIns" :tableConfig="tableConfig">
|
||||
<template #empty>
|
||||
<el-empty description="暂无数据"/>
|
||||
</template>
|
||||
</fvTable>
|
||||
</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';
|
||||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
const searchConfig = ref([
|
||||
{
|
||||
label: '公司名称',
|
||||
prop: 'affiliatedCompanyIds',
|
||||
component: 'el-tree-select',
|
||||
props: {
|
||||
placeholder: '请输入公司名称查询',
|
||||
clearable: true,
|
||||
data: [],
|
||||
filterable: true,
|
||||
checkStrictly: true,
|
||||
remote: true
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '项目名称',
|
||||
prop: 'projectName',
|
||||
component: 'el-input',
|
||||
props: {
|
||||
placeholder: '请输入项目名称查询',
|
||||
clearable: true,
|
||||
filterable: true,
|
||||
checkStrictly: true
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
label: '项目费用',
|
||||
prop: 'projectCost',
|
||||
component: shallowRef(fvSelect),
|
||||
props: {
|
||||
placeholder: '请选择项目费用查询',
|
||||
clearable: true,
|
||||
filterable: true,
|
||||
cacheKey: 'project_cost',
|
||||
remote: true
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '研发阶段',
|
||||
prop: 'researchStage',
|
||||
component: shallowRef(fvSelect),
|
||||
props: {
|
||||
placeholder: '请选择研发阶段查询',
|
||||
clearable: true,
|
||||
filterable: true,
|
||||
checkStrictly: true,
|
||||
cacheKey: 'fee_stage',
|
||||
remote: true
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
label: '时间',
|
||||
prop: 'time',
|
||||
component: 'el-date-picker',
|
||||
props: {
|
||||
placeholder: '请选择时间',
|
||||
clearable: true,
|
||||
type:'month',
|
||||
format: 'YYYY-MM',
|
||||
valueFormat:'YYYY-MM',
|
||||
},
|
||||
colProps: {}
|
||||
},
|
||||
{
|
||||
label: '税后余额',
|
||||
prop: 'afterTax',
|
||||
component: 'el-input',
|
||||
props: {
|
||||
placeholder: '请输入税后余额查询',
|
||||
clearable: true,
|
||||
filterable: true,
|
||||
checkStrictly: true
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '摘要',
|
||||
prop: 'digest',
|
||||
component: 'el-input',
|
||||
props: {
|
||||
placeholder: '请输入摘要查询',
|
||||
clearable: true,
|
||||
filterable: true,
|
||||
checkStrictly: true
|
||||
}
|
||||
},
|
||||
])
|
||||
const tableIns = ref()
|
||||
const tableConfig = reactive({
|
||||
columns: [
|
||||
// {
|
||||
// prop: 'name',
|
||||
// type: 'index',
|
||||
// label: '序号',
|
||||
// align: 'center',
|
||||
// width:85,
|
||||
// index: index => {
|
||||
// return (tableIns.value.getQuery().pageNum - 1) * tableIns.value.getQuery().pageSize + index + 1
|
||||
// }
|
||||
// },
|
||||
{
|
||||
prop: 'affiliatedCompany',
|
||||
label: '支出年份',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'projectName',
|
||||
label: '月份',
|
||||
align: 'center'
|
||||
},
|
||||
|
||||
{
|
||||
prop: 'projectCost',
|
||||
label: '主项目',
|
||||
align: 'center',
|
||||
width: 120,
|
||||
showOverflowTooltip: false,
|
||||
currentRender: ({row, index}) => {
|
||||
if (row.projectCost !== null&&row.projectCost !== null&&row.projectCost!==undefined) {
|
||||
return (<Tag dictType={'project_cost'} value={row.projectCost}/>)
|
||||
} else {
|
||||
return '--'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
prop: 'time',
|
||||
label: '子项目',
|
||||
align: 'center',
|
||||
width: 120,
|
||||
},
|
||||
{
|
||||
prop: 'researchStage',
|
||||
label: '凭证日期',
|
||||
align: 'center',
|
||||
width: 120,
|
||||
showOverflowTooltip: false,
|
||||
currentRender: ({row, index}) => {
|
||||
if (row.researchStage&&row.researchStage !== null&&row.researchStage!==undefined) {
|
||||
return (<Tag dictType={'research_stage'} value={row.researchStage}/>)
|
||||
} else {
|
||||
return '--'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'digest',
|
||||
label: '凭证号',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'digest',
|
||||
label: '分录号',
|
||||
align: 'center',
|
||||
currentRender:({row})=>{
|
||||
return <span>{toThousands(row.afterTax)}</span>
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'digest',
|
||||
label: '科目编码',
|
||||
align: 'center',
|
||||
showOverflowTooltip: false,
|
||||
currentRender: ({row, index}) => {
|
||||
if (row.source&&row.source !== null&&row.source!==undefined) {
|
||||
return (<Tag dictType={'ledger_source'} value={row.source}/>)
|
||||
} else {
|
||||
return '--'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'digest',
|
||||
label: '科目名称',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
prop: 'digest',
|
||||
label: '辅助项',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
prop: 'digest',
|
||||
label: '会计凭证记载金额(元)',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
prop: 'digest',
|
||||
label: '归集研发费用金额(元)',
|
||||
align: 'center',
|
||||
},
|
||||
],
|
||||
api: '',
|
||||
params: {},
|
||||
export:{
|
||||
open :true,
|
||||
fileName:`科技创新费用支出明细.xlsx`
|
||||
}
|
||||
})
|
||||
const search = (val) => {
|
||||
tableConfig.params = {...val}
|
||||
tableIns.value.refresh()
|
||||
}
|
||||
const init = async () => {
|
||||
const res = await getSubCompOpt()
|
||||
searchConfig.value.find(item=>item.prop == 'affiliatedCompanyIds').props.data = res.data
|
||||
}
|
||||
|
||||
// init()
|
||||
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
:deep(.el-table__header) {
|
||||
.is-leaf:first-child {
|
||||
.cell {
|
||||
margin-left: -25px !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.el-table__body) {
|
||||
.el-table__cell:first-child {
|
||||
.cell {
|
||||
margin-left: -13px !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
:deep(.el-date-editor--month){
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user