Files
mosr-web/src/views/project-management/implementation/index.vue
2024-05-20 22:03:53 +08:00

246 lines
5.3 KiB
Vue

<template>
<fvSearchForm :searchConfig="searchConfig" @search="search"></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 {reactive, shallowRef} from "vue";
const router = useRouter()
const searchConfig = reactive([
{
label: '名称',
prop: 'projectName',
component: 'el-input',
props: {
placeholder: '请输入名称查询',
clearable: true,
filterable: true,
checkStrictly: true
}
},
{
label: '项目类型',
prop: 'projectType',
component: shallowRef(fvSelect),
props: {
placeholder: '请选择项目类型',
clearable: true,
filterable: true,
}
},
{
label: '项目影响',
prop: 'projectImpact',
component: shallowRef(fvSelect),
props: {
placeholder: '请选择项目影响',
clearable: true,
filterable: true,
},
colProps: {}
},
{
label: '研发主体',
prop: 'rdSubject',
component: shallowRef(fvSelect),
props: {
placeholder: '请选择研发主体',
clearable: true,
filterable: true,
}
},
{
label: '起止时间',
prop: 'startTime',
component: 'el-date-picker',
props: {
placeholder: '请选择起止时间',
clearable: true,
},
colProps: {}
},
{
label: '最小金额',
prop: 'requirementName',
component: 'el-input',
props: {
placeholder: '请输入金额查询',
clearable: true,
filterable: true,
checkStrictly: true
}
},
{
label: '最大金额',
prop: 'requirementName',
component: 'el-input',
props: {
placeholder: '请输入金额查询',
clearable: true,
filterable: true,
checkStrictly: true
}
},
])
const tableIns = ref()
const tableConfig = reactive({
columns: [
{
type: 'selection',
prop: 'selection'
},
{
prop: 'projectName',
label: '名称',
align: 'center'
},
{
prop: 'affiliatedCompany',
label: '所属公司',
align: 'center'
},
{
prop: 'projectType',
label: '项目类型',
align: 'center'
},
{
prop: 'rdSubject',
label: '研发主体',
align: 'center'
},
{
prop: 'projectImpact',
label: '项目影响',
align: 'center'
},
{
prop: 'economicEstimate',
label: '经济概况',
align: 'center'
},
{
prop: 'startTime',
label: '起止时间',
align: 'center'
},
{
prop: 'state',
label: '状态',
align: 'center',
showOverflowTooltip: false,
currentRender: ({row, index}) =>{
if (row.state !== null) {
return (<Tag dictType={'project_initiation'} value={row.state}/>)
} else {
return '--'
}
}
},
{
prop: 'oper',
label: '操作',
align: 'center',
showOverflowTooltip: false,
currentRender: ({row, index}) => {
let btn = [{label: '详情', func: () => handleDetail(row), type: 'primary'}]
// if (row.state === '3') {
btn.push(
{label: '验收', func: () => handleCheck(row), type: 'primary'},
{label: '编辑', func: () => handleEdit(row), type: 'primary'},
{label: '台账', func: () => handleStandingBook(row), type: 'primary'},
{label: '附件', func: () => handleAttachment(row), type: 'primary'},
{label: '查看分摊', func: () => handleShare(row), type: 'primary'}
)
// }
return (
<div style={{width: '100%'}}>
{
btn.map(item => (
<el-button
type={item.type}
// v-perm={item.auth}
onClick={() => item.func()}
link
>
{item.label}
</el-button>
))
}
</div>
)
}
}
],
api: '/workflow/mosr/project/implementation',
params: {},
btns: [
{name: '生成分摊报表', key: '_export', color: '#DED0B2', auth: ''}
]
})
const search = (val) => {
tableConfig.params = {...val}
tableIns.value.refresh()
}
const handleDetail = (row) => {
router.push({
name: 'Implementation/detail',
query: {
id: row.requirementId,
projectId: row.projectId
}
})
}
const handleCheck = (row) => {
router.push({
name: 'Implementation/check',
query: {
id: row.requirementId,
projectId: row.projectId
}
})
}
const handleEdit = (row) => {
router.push({
name: 'Implementation/edit',
query: {
id: row.requirementId,
projectId: row.projectId
}
})
}
const handleStandingBook = (row) => {
router.push({
name: 'Implementation/account',
query: {
id: row.requirementId
}
})
}
const handleAttachment = (row) => {
router.push({
name: 'Implementation/attachment',
query: {
id: row.requirementId
}
})
}
const handleShare = (row) => {
router.push({
name: 'Implementation/share',
query: {
id: row.requirementId
}
})
}
</script>