fix : 修复专项资金页面功能细节
This commit is contained in:
140
src/views/special-fund/index.vue
Normal file
140
src/views/special-fund/index.vue
Normal file
@@ -0,0 +1,140 @@
|
||||
<template>
|
||||
<fvSearchForm :searchConfig="searchConfig" @search="search"></fvSearchForm>
|
||||
<fvTable ref="tableIns" :tableConfig="tableConfig" @headBtnClick="headBtnClick"></fvTable>
|
||||
</template>
|
||||
|
||||
|
||||
<script setup lang="jsx">
|
||||
import fvSelect from '@/fvcomponents/fvSelect/index.vue'
|
||||
|
||||
const router = useRouter()
|
||||
const searchConfig = reactive([
|
||||
{
|
||||
label: '专项资金名称',
|
||||
prop: 'requirementName',
|
||||
component: 'el-input',
|
||||
props: {
|
||||
placeholder: '请输入名称查询'
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '状态',
|
||||
prop: 'state',
|
||||
component: shallowRef(fvSelect),
|
||||
props: {
|
||||
placeholder: '请选择状态',
|
||||
clearable: true,
|
||||
cacheKey: 'special_fund'
|
||||
}
|
||||
},
|
||||
])
|
||||
const tableConfig = reactive({
|
||||
columns: [
|
||||
{
|
||||
prop: 'name',
|
||||
label: '专项资金名称',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'fundAmount',
|
||||
label: '专项资金金额',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'residualAmount',
|
||||
label: '剩余金额',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'state',
|
||||
label: '状态',
|
||||
align: 'center',
|
||||
showOverflowTooltip: false,
|
||||
currentRender: ({row, index}) => {
|
||||
if (row.state == undefined) {
|
||||
return '--'
|
||||
} else {
|
||||
return (<Tag dictType={'special_fund'} value={row.state}/>)
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'oper',
|
||||
label: '操作',
|
||||
align: 'center',
|
||||
showOverflowTooltip: false,
|
||||
currentRender: ({row, index}) => {
|
||||
let btn = []
|
||||
// let buttons = new Set(Array.from(row.buttons))
|
||||
// if (buttons.has("details")) {
|
||||
btn.push({label: '详情', prem: ['mosr:collect:info'], func: () => handleDetail(row), type: 'primary'})
|
||||
// }
|
||||
// if (buttons.has("edit")) {
|
||||
btn.push({label: '编辑',prem: ['mosr:collect:resubmit'], func: () => handleEdit(row), type: 'primary'})
|
||||
// }
|
||||
// if (buttons.has("delete")) {
|
||||
// btn.push({label: '删除',prem: ['mosr:requirement:del'], func: () => handleDelete(row), type: 'primary'})
|
||||
// }
|
||||
return (
|
||||
<div style={{width: '100%'}}>
|
||||
{
|
||||
btn.map(item => (
|
||||
<el-button
|
||||
type={item.type}
|
||||
// v-perm={item.prem}
|
||||
onClick={() => item.func()}
|
||||
link
|
||||
>
|
||||
{item.label}
|
||||
</el-button>
|
||||
))
|
||||
}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
],
|
||||
api: '/workflow/mosr/special/fund',
|
||||
params: {},
|
||||
btns: [
|
||||
{name: '新增', key: 'add', color: '#DED0B2', auth: ''},
|
||||
{name: '导出', key: '_export', color: '#DED0B2', auth: ''},
|
||||
]
|
||||
})
|
||||
const handleDetail = (row) => {
|
||||
router.push({
|
||||
name:'Fund/detail',
|
||||
query: {
|
||||
id:row.id
|
||||
}
|
||||
})
|
||||
}
|
||||
const handleAdd = () => {
|
||||
router.push({
|
||||
name:'Fund/add',
|
||||
query: {}
|
||||
})
|
||||
}
|
||||
const handleEdit = (row) => {
|
||||
router.push({
|
||||
name:'Fund/edit',
|
||||
query: {
|
||||
id:row.id
|
||||
}
|
||||
})
|
||||
}
|
||||
const headBtnClick = (key) => {
|
||||
switch (key) {
|
||||
case 'add':
|
||||
handleAdd()
|
||||
break;
|
||||
case 'export':
|
||||
handleExport()
|
||||
break;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user