213 lines
4.5 KiB
Vue
213 lines
4.5 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: 'requirementName',
|
|
component: 'el-input',
|
|
props: {
|
|
placeholder: '请输入名称查询',
|
|
clearable: true,
|
|
filterable: true,
|
|
checkStrictly: true
|
|
}
|
|
},
|
|
{
|
|
label: '项目类型',
|
|
prop: 'collectType',
|
|
component: shallowRef(fvSelect),
|
|
props: {
|
|
placeholder: '请选择项目类型',
|
|
clearable: true,
|
|
filterable: true,
|
|
}
|
|
},
|
|
{
|
|
label: '项目影响',
|
|
prop: 'projectEffect',
|
|
component: shallowRef(fvSelect),
|
|
props: {
|
|
placeholder: '请选择项目影响',
|
|
clearable: true,
|
|
filterable: true,
|
|
},
|
|
colProps: {}
|
|
},
|
|
{
|
|
label: '研发主体',
|
|
prop: 'collectType',
|
|
component: shallowRef(fvSelect),
|
|
props: {
|
|
placeholder: '请选择研发主体',
|
|
clearable: true,
|
|
filterable: true,
|
|
}
|
|
},
|
|
|
|
{
|
|
label: '起止时间',
|
|
prop: 'time',
|
|
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: [
|
|
{
|
|
prop: 'projectName',
|
|
label: '名称',
|
|
align: 'center'
|
|
},
|
|
{
|
|
prop: 'affiliatedCompanyId',
|
|
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: () => handleEdit(row), type: 'primary'})
|
|
} else if (row.state === '0') {
|
|
btn.push({label: '申请', func: () => handleApply(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/approval',
|
|
params: {},
|
|
})
|
|
|
|
const search = (val) => {
|
|
tableConfig.params = {...val}
|
|
tableIns.value.refresh()
|
|
}
|
|
|
|
const handleDetail = (row) => {
|
|
router.push({
|
|
name:'Initiation/detail',
|
|
query: {
|
|
id: row.requirementId,
|
|
projectId: row.projectId,
|
|
state: 2
|
|
}
|
|
})
|
|
}
|
|
const handleEdit = (row) => {
|
|
router.push({
|
|
name:'Initiation/edit',
|
|
query: {
|
|
id: row.requirementId,
|
|
projectId: row.projectId
|
|
}
|
|
})
|
|
}
|
|
const handleApply = (row) => {
|
|
router.push({
|
|
name:'Initiation/apply',
|
|
query: {
|
|
id: row.requirementId,
|
|
projectId: row.projectId
|
|
}
|
|
})
|
|
}
|
|
|
|
</script>
|