feat : 研发投入资金crud功能完成

This commit is contained in:
2024-09-21 18:19:17 +08:00
parent 10bb9cbc37
commit 090e9a1ea8
4 changed files with 394 additions and 52 deletions

View File

@@ -1,5 +1,6 @@
<template>
<fvSearchForm :searchConfig="researchFundSearchConfig" @search="searchResearchFund" style="margin-left: 16px"></fvSearchForm>
<fvSearchForm :searchConfig="researchFundSearchConfig" @search="searchResearchFund"
style="margin-left: 16px"></fvSearchForm>
<fvTable ref="tableIns" :tableConfig="researchFundTableConfig" @headBtnClick="headBtnClick">
<template #empty>
<el-empty description="暂无数据"/>
@@ -8,46 +9,49 @@
</template>
<script setup lang="jsx">
import { ElNotification} from "element-plus";
import {deleteAllocation} from "@/api/expense-manage";
import {ElNotification} from "element-plus";
import {deleteResearchFund} from "@/api/research-fund";
import { getSubCompOpt } from '@/api/user/user.js';
const router = useRouter();
const researchFundSearchConfig = reactive([
const researchFundSearchConfig = ref([
{
label: '公司名称',
prop: 'afterTax',
label: '研发公司名称',
prop: 'rdCompanyId',
component: 'el-tree-select',
props: {
placeholder: '请输入研发公司名称查询',
clearable: true,
data: [],
filterable: true,
checkStrictly: true,
remote: true
}
},
{
label: '研发资金金额',
prop: 'rdAmount',
component: 'el-input',
props: {
placeholder: '请输入公司名称查询',
placeholder: '请输入研发资金金额查询',
clearable: true,
filterable: true,
checkStrictly: true
}
},
{
label: '时间',
prop: 'apportionmentMonth',
label: '研发资金日期',
prop: 'rdDate',
component: 'el-date-picker',
props: {
placeholder: '请选择时间',
placeholder: '请选择研发资金日期',
clearable: true,
type:'month',
type: 'month',
format: 'YYYY-MM',
valueFormat:"YYYY-MM"
valueFormat: "YYYY-MM"
},
colProps: {}
},
{
label: '金额',
prop: 'afterTax',
component: 'el-input',
props: {
placeholder: '请输入金额查询',
clearable: true,
filterable: true,
checkStrictly: true
}
},
])
const tableIns = ref()
const researchFundTableConfig = reactive({
@@ -57,40 +61,40 @@ const researchFundTableConfig = reactive({
type: 'index',
label: '序号',
align: 'center',
width:85,
width: 85,
index: index => {
return (tableIns.value.getQuery().pageNum - 1) * tableIns.value.getQuery().pageSize + index + 1
}
},
{
prop: 'shareName',
label: '公司名称',
prop: 'rdCompany',
label: '研发公司名称',
align: 'center'
},
{
prop: 'apportionmentMonth',
label: '时间',
prop: 'rdAmount',
label: '研发资金金额',
align: 'center'
},
{
prop: 'generationTime',
label: '金额',
prop: 'rdDate',
label: '研发资金日期',
align: 'center'
},
{
prop: 'remarks',
label: '备注',
align: 'center'
},
{
prop: 'oper',
label: '操作',
align: 'center',
fixed:'right',
fixed: 'right',
showOverflowTooltip: false,
currentRender: ({row, index}) => {
let btn = []
let buttons
if (row.buttons) {
buttons = new Set(Array.from(row.buttons))
}
btn.push({label: '详情', prem: ['mosr:requirement:info'], func: () => handleDetail(row), type: 'primary'})
btn.push({label: '编辑', prem: ['mosr:requirement:resubmit'], func: () => handleEdit(row), type: 'primary'})
btn.push({label: '编辑', func: () => handleEdit(row), type: 'primary'})
return (
<div style={{width: '100%'}}>
{
@@ -106,8 +110,8 @@ const researchFundTableConfig = reactive({
))
}
{
<popover-delete name={row.shareName} type={'研发投入资金'} btnType={'danger'}
onDelete={() => handleDelete(row)}/>
<popover-delete name={row.rdCompany} type={'研发投入资金'} btnType={'danger'}
onDelete={() => handleDelete(row)}/>
}
</div>
@@ -115,7 +119,7 @@ const researchFundTableConfig = reactive({
}
}
],
api: '',
api: '/workflow/mosr/rd/list',
btns: [
{name: '新增', key: 'add', color: '#DED0B2'}
],
@@ -140,28 +144,20 @@ const headBtnClick = (key) => {
}
const handleAdd = () => {
router.push({
name: 'Share/add',
name: 'Devfund/add',
query: {}
})
}
const handleDetail = (row) => {
router.push({
name: 'Share/detail',
query: {
id: row.allocationId
}
})
}
const handleEdit = (row) => {
router.push({
name: 'Share/edit',
name: 'Devfund/edit',
query: {
id: row.allocationId
id: row.rdFundId
}
})
}
const handleDelete = (row) => {
deleteAllocation(row.allocationId).then(res => {
deleteResearchFund(row.rdFundId).then(res => {
ElNotification({
title: '提示',
message: res.msg,
@@ -172,6 +168,12 @@ const handleDelete = (row) => {
}
});
}
const init = async () => {
const res = await getSubCompOpt()
researchFundSearchConfig.value.find(item=>item.prop == 'rdCompanyId').props.data = res.data
}
init()
</script>
<style scoped lang="scss">