208 lines
4.6 KiB
Vue
208 lines
4.6 KiB
Vue
<template>
|
|
<fvSearchForm :searchConfig="searchConfig" @search="search"></fvSearchForm>
|
|
<fvTable ref="tableIns" :tableConfig="tableConfig" @headBtnClick="headBtnClick"></fvTable>
|
|
</template>
|
|
|
|
<script setup lang="jsx">
|
|
import {reactive, ref, shallowRef} from 'vue';
|
|
import fvSelect from '@/fvcomponents/fvSelect/index.vue'
|
|
import {useRouter} from 'vue-router';
|
|
|
|
const localData = reactive({})
|
|
|
|
const tableIns = ref()
|
|
const router = useRouter()
|
|
|
|
|
|
const searchConfig = reactive([
|
|
{
|
|
label: '名称',
|
|
prop: 'requirementName',
|
|
props: {
|
|
placeholder: '请输入'
|
|
},
|
|
component: 'el-input',
|
|
colProps: {}
|
|
},
|
|
{
|
|
label: '项目类型',
|
|
prop: 'projectType',
|
|
component: shallowRef(fvSelect),
|
|
props: {},
|
|
colProps: {}
|
|
},
|
|
{
|
|
label: '研发主体',
|
|
prop: 'productMainBody',
|
|
component: shallowRef(fvSelect),
|
|
props: {},
|
|
colProps: {}
|
|
},
|
|
{
|
|
label: '项目影响',
|
|
prop: 'projectEffect',
|
|
component: shallowRef(fvSelect),
|
|
props: {},
|
|
colProps: {}
|
|
},
|
|
{
|
|
label: '起止时间',
|
|
prop: 'startTime',
|
|
component: 'el-date-picker',
|
|
props: {},
|
|
colProps: {}
|
|
},
|
|
{
|
|
label: '最小金额',
|
|
prop: 'minMoney',
|
|
component: 'el-input',
|
|
colProps: {}
|
|
},
|
|
{
|
|
label: '最大金额',
|
|
prop: 'maxMoney',
|
|
component: 'el-input',
|
|
colProps: {}
|
|
},
|
|
])
|
|
|
|
const tableConfig = reactive({
|
|
columns: [
|
|
{
|
|
type: 'selection',
|
|
prop: 'selection'
|
|
},
|
|
{
|
|
prop: 'requirementName',
|
|
label: '名称',
|
|
align: 'center'
|
|
},
|
|
{
|
|
prop: 'undertaker',
|
|
label: '承办单位',
|
|
align: 'center'
|
|
},
|
|
{
|
|
prop: 'projectType',
|
|
label: '项目类型',
|
|
align: 'center'
|
|
},
|
|
{
|
|
prop: 'rdSubject',
|
|
label: '研发主体',
|
|
align: 'center'
|
|
},
|
|
{
|
|
prop: 'projectImpact',
|
|
label: '项目影响',
|
|
align: 'center'
|
|
},
|
|
{
|
|
prop: 'startTime',
|
|
label: '起止时间',
|
|
align: 'center'
|
|
},
|
|
{
|
|
prop: 'state',
|
|
label: '状态',
|
|
align: 'center',
|
|
showOverflowTooltip: false,
|
|
currentRender: ({row, index}) => {
|
|
if (row.state !== null&&row.state != 0) {
|
|
return (<Tag dictType={'demand_summary'} value={row.state}/>)
|
|
} else {
|
|
return '--'
|
|
}
|
|
}
|
|
},
|
|
{
|
|
prop: 'oper',
|
|
label: '操作',
|
|
align: 'center',
|
|
showOverflowTooltip: false,
|
|
currentRender: ({row, index}) => {
|
|
let btn = []
|
|
let buttons = new Set(Array.from(row.buttons))
|
|
if (buttons.has("detail")) {
|
|
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: () => handleEdit(row), type: 'primary'})
|
|
// }
|
|
if (buttons.has("reported")) {
|
|
btn.push({label: '上报',prem: ['mosr:collect:reported'], func: () => handleAdd(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/requirement/collect',
|
|
params: {},
|
|
btns: [
|
|
{name: '年度计划导出', key: '_export', color: '#DED0B2', auth: ''},
|
|
{name: '经费预算生成', key: 'preMonty', color: '#DED0B2', auth: ''},
|
|
]
|
|
})
|
|
|
|
const search = (val) => {
|
|
let obj = {...val}
|
|
if (obj.time) {
|
|
obj.startTime = obj.time[0]
|
|
obj.endTime = obj.time[1]
|
|
delete obj.dateValue
|
|
}
|
|
tableConfig.params = obj
|
|
tableIns.value.refresh()
|
|
}
|
|
|
|
const handleAdd = (row) => {
|
|
router.push({
|
|
name: 'Summary/add',
|
|
query: {
|
|
id:row.requirementId
|
|
}
|
|
})
|
|
}
|
|
const handleEdit = (row) => {
|
|
router.push({
|
|
name: 'Summary/edit',
|
|
query: {
|
|
id:row.requirementId,
|
|
projectId:row.projectId
|
|
}
|
|
})
|
|
}
|
|
const handleDetail = (row) => {
|
|
router.push({
|
|
name: 'Summary/detail',
|
|
query: {
|
|
id:row.requirementId,
|
|
projectId: row.projectId,
|
|
state: row.state
|
|
}
|
|
})
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
</style>
|