259 lines
6.0 KiB
Vue
259 lines
6.0 KiB
Vue
<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 tableIns = ref()
|
|
const router = useRouter()
|
|
const searchConfig = reactive([
|
|
{
|
|
label: '需求名称',
|
|
prop: 'requirementName',
|
|
props: {
|
|
placeholder: '请输入需求名称',
|
|
clearable: true,
|
|
checkStrictly: true
|
|
},
|
|
component: 'el-input',
|
|
colProps: {}
|
|
},
|
|
{
|
|
label: '项目类型',
|
|
prop: 'projectType',
|
|
component: shallowRef(fvSelect),
|
|
props: {
|
|
placeholder: '请选择项目类型',
|
|
cacheKey: 'project_type',
|
|
clearable: true,
|
|
filterable: true,
|
|
},
|
|
colProps: {}
|
|
},
|
|
{
|
|
label: '研发主体',
|
|
prop: 'productMainBody',
|
|
component: shallowRef(fvSelect),
|
|
props: {
|
|
placeholder: '请选择研发主体',
|
|
cacheKey: 'rd_subject',
|
|
clearable: true,
|
|
filterable: true
|
|
},
|
|
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 auths = {
|
|
edit: ['mosr:collect:resubmit'],
|
|
detail: ['mosr:collect:info'],
|
|
report: ['mosr:collect:reported'],
|
|
}
|
|
const tableConfig = reactive({
|
|
columns: [
|
|
// {
|
|
// type: 'selection',
|
|
// prop: 'selection'
|
|
// },
|
|
{
|
|
prop: 'requirementName',
|
|
label: '征集名称',
|
|
align: 'center'
|
|
},
|
|
{
|
|
prop: 'projectName',
|
|
label: '项目名称',
|
|
align: 'center'
|
|
},
|
|
{
|
|
prop: 'undertaker',
|
|
label: '承办单位',
|
|
align: 'center'
|
|
},
|
|
{
|
|
prop: 'projectType',
|
|
label: '项目类型',
|
|
align: 'center',
|
|
showOverflowTooltip: false,
|
|
currentRender: ({row, index}) => {
|
|
if (row.projectType !== null) {
|
|
return (<Tag dictType={'project_type'} value={row.projectType}/>)
|
|
} else {
|
|
return '--'
|
|
}
|
|
}
|
|
},
|
|
{
|
|
prop: 'rdSubject',
|
|
label: '研发主体',
|
|
align: 'center',
|
|
showOverflowTooltip: false,
|
|
currentRender: ({row, index}) => {
|
|
if (row.rdSubject !== null) {
|
|
return (<Tag dictType={'rd_subject'} value={row.rdSubject}/>)
|
|
} else {
|
|
return '--'
|
|
}
|
|
}
|
|
},
|
|
{
|
|
prop: 'projectImpact',
|
|
label: '项目影响',
|
|
align: 'center',
|
|
showOverflowTooltip: false,
|
|
currentRender: ({row, index}) => {
|
|
if (row.projectImpact !== null) {
|
|
return (<Tag dictType={'project_impact'} value={row.projectImpact}/>)
|
|
} else {
|
|
return '--'
|
|
}
|
|
}
|
|
},
|
|
{
|
|
prop: 'startTime',
|
|
label: '起止时间',
|
|
align: 'center',
|
|
currentRender: ({row}) => {
|
|
return row.startTime + ' 至 ' + row.endTime
|
|
}
|
|
},
|
|
{
|
|
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',
|
|
fixed:'right',
|
|
showOverflowTooltip: false,
|
|
currentRender: ({row, index}) => {
|
|
let btn = []
|
|
let buttons = new Set(Array.from(row.buttons))
|
|
if (buttons.has("details")) {
|
|
btn.push({label: '详情', prem: auths.detail, func: () => handleDetail(row), type: 'primary'})
|
|
}
|
|
if (buttons.has("edit")) {
|
|
btn.push({label: '编辑', prem: auths.edit, func: () => handleEdit(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>
|
|
))
|
|
}
|
|
{
|
|
buttons.has("delete") ?
|
|
<popover-delete name={row.requirementName} type={'需求'} btnType={'danger'}
|
|
perm={['mosr:collect:del']} onDelete={() => handleDelete(row)}/>
|
|
: ''
|
|
}
|
|
</div>
|
|
)
|
|
}
|
|
}
|
|
],
|
|
api: '/workflow/mosr/requirement/collect',
|
|
params: {},
|
|
btns: [
|
|
{name: '新增上报', key: 'add', color: '#DED0B2', auth:auths.report},
|
|
// {name: '年度计划导出', key: '_export', auth: ''},
|
|
// {name: '经费预算生成', key: 'preMonty', auth: ''},
|
|
]
|
|
})
|
|
const headBtnClick = (key) => {
|
|
switch (key) {
|
|
case 'add':
|
|
handleAdd()
|
|
break;
|
|
}
|
|
}
|
|
|
|
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 = () => {
|
|
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==null?'-1':row.requirementId,
|
|
projectId: row.projectId,
|
|
state: row.state
|
|
}
|
|
})
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
</style>
|