|
|
|
@ -4,10 +4,10 @@ |
|
|
|
|
<BasicTable @register="registerTable" :rowSelection="rowSelection"> |
|
|
|
|
<!--插槽:table标题--> |
|
|
|
|
<template #tableTitle> |
|
|
|
|
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button> |
|
|
|
|
<!-- <a-button type="primary" @click="go_xinjianshenbao" preIcon="ant-design:plus-outlined"> 新建审报书</a-button>--> |
|
|
|
|
<!-- <a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>--> |
|
|
|
|
<!-- <a-button type="primary" @click="go_xinjianshenbao" preIcon="ant-design:plus-outlined"> 新建申报书</a-button>--> |
|
|
|
|
<a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button> |
|
|
|
|
<!-- <j-upload-button type="primary" v-auth="'project:project:importExcel'" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>--> |
|
|
|
|
<!-- <j-upload-button type="primary" v-auth="'project:project:importExcel'" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>--> |
|
|
|
|
<a-dropdown> |
|
|
|
|
<template #overlay> |
|
|
|
|
<a-menu> |
|
|
|
@ -15,13 +15,16 @@ |
|
|
|
|
<Icon icon="ant-design:plus-outlined"></Icon> |
|
|
|
|
科技攻关 |
|
|
|
|
</a-menu-item> |
|
|
|
|
<!-- <a-menu-item v-for="opt of RANGE_OPTIONS" :key="opt.key"> |
|
|
|
|
{{ opt.label }} |
|
|
|
|
</a-menu-item>--> |
|
|
|
|
<!--<a-menu-item key="1" @click="go_xinjianshenbao"> |
|
|
|
|
<Icon icon="ant-design:plus-outlined"></Icon> |
|
|
|
|
xxx |
|
|
|
|
</a-menu-item>--> |
|
|
|
|
</a-menu> |
|
|
|
|
</template> |
|
|
|
|
<a-button type="primary">新建审报 |
|
|
|
|
<a-button type="primary">新建申报 |
|
|
|
|
<Icon icon="mdi:chevron-down"></Icon> |
|
|
|
|
</a-button> |
|
|
|
|
</a-dropdown> |
|
|
|
@ -43,203 +46,264 @@ |
|
|
|
|
|
|
|
|
|
<script lang="ts" name="project-project" setup> |
|
|
|
|
import {ref, reactive, computed, unref, onMounted} from 'vue'; |
|
|
|
|
import {BasicTable, useTable, TableAction} from '/@/components/Table'; |
|
|
|
|
import {useModal} from '/@/components/Modal'; |
|
|
|
|
import { useListPage } from '/@/hooks/system/useListPage' |
|
|
|
|
import ProjectModal from './components/ProjectModal.vue' |
|
|
|
|
import {columns, searchFormSchema, superQuerySchema} from './Project.data'; |
|
|
|
|
import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './Project.api'; |
|
|
|
|
import { downloadFile } from '/@/utils/common/renderUtils'; |
|
|
|
|
import { useGo } from '/@/hooks/web/usePage'; |
|
|
|
|
|
|
|
|
|
import { useUserStore } from '/@/store/modules/user'; |
|
|
|
|
import {getUserData} from "@/views/system/usersetting/UserSetting.api"; |
|
|
|
|
const go = useGo(); |
|
|
|
|
|
|
|
|
|
const queryParam = reactive<any>({}); |
|
|
|
|
const checkedKeys = ref<Array<string | number>>([]); |
|
|
|
|
const userStore = useUserStore(); |
|
|
|
|
//注册model |
|
|
|
|
const [registerModal, {openModal}] = useModal(); |
|
|
|
|
//注册table数据 |
|
|
|
|
const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({ |
|
|
|
|
tableProps:{ |
|
|
|
|
title: '项目表', |
|
|
|
|
api: list, |
|
|
|
|
columns, |
|
|
|
|
canResize:false, |
|
|
|
|
formConfig: { |
|
|
|
|
//labelWidth: 120, |
|
|
|
|
schemas: searchFormSchema, |
|
|
|
|
autoSubmitOnEnter:true, |
|
|
|
|
showAdvancedButton:true, |
|
|
|
|
fieldMapToNumber: [ |
|
|
|
|
], |
|
|
|
|
fieldMapToTime: [ |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
actionColumn: { |
|
|
|
|
width: 280, |
|
|
|
|
fixed:'right' |
|
|
|
|
}, |
|
|
|
|
beforeFetch: (params) => { |
|
|
|
|
return Object.assign(params, queryParam); |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
exportConfig: { |
|
|
|
|
name:"项目表", |
|
|
|
|
url: getExportUrl, |
|
|
|
|
params: queryParam, |
|
|
|
|
}, |
|
|
|
|
importConfig: { |
|
|
|
|
url: getImportUrl, |
|
|
|
|
success: handleSuccess |
|
|
|
|
}, |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext |
|
|
|
|
|
|
|
|
|
// 高级查询配置 |
|
|
|
|
const superQueryConfig = reactive(superQuerySchema); |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 高级查询事件 |
|
|
|
|
*/ |
|
|
|
|
function handleSuperQuery(params) { |
|
|
|
|
Object.keys(params).map((k) => { |
|
|
|
|
queryParam[k] = params[k]; |
|
|
|
|
}); |
|
|
|
|
reload(); |
|
|
|
|
} |
|
|
|
|
/** |
|
|
|
|
* 新增事件 |
|
|
|
|
*/ |
|
|
|
|
function handleAdd() { |
|
|
|
|
openModal(true, { |
|
|
|
|
isUpdate: false, |
|
|
|
|
showFooter: true, |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//跳转到新建申报页面 |
|
|
|
|
function go_xinjianshenbao() { |
|
|
|
|
// go('/comp/jeecg/basic'); |
|
|
|
|
go('/projectApplication/index'); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//跳转到项目书页面 |
|
|
|
|
function go_xiangmushu(record) { |
|
|
|
|
// go('/comp/jeecg/basic?id=' +'666'); |
|
|
|
|
go('/projectApplication/kejigongguan/xiangmushu?id='+record.id); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//跳转到预算书页面 |
|
|
|
|
function go_yusuanshu(record) { |
|
|
|
|
// go('/comp/jeecg/basic?id=' +'666'); |
|
|
|
|
go('/projectApplication/kejigongguan/xiangmushu?id='+record.id); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 编辑事件 |
|
|
|
|
*/ |
|
|
|
|
function handleEdit(record: Recordable) { |
|
|
|
|
openModal(true, { |
|
|
|
|
record, |
|
|
|
|
isUpdate: true, |
|
|
|
|
showFooter: true, |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
/** |
|
|
|
|
* 详情 |
|
|
|
|
*/ |
|
|
|
|
function handleDetail(record: Recordable) { |
|
|
|
|
openModal(true, { |
|
|
|
|
record, |
|
|
|
|
isUpdate: true, |
|
|
|
|
showFooter: false, |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
/** |
|
|
|
|
* 删除事件 |
|
|
|
|
*/ |
|
|
|
|
async function handleDelete(record) { |
|
|
|
|
await deleteOne({id: record.id}, handleSuccess); |
|
|
|
|
} |
|
|
|
|
/** |
|
|
|
|
* 批量删除事件 |
|
|
|
|
*/ |
|
|
|
|
async function batchHandleDelete() { |
|
|
|
|
await batchDelete({ids: selectedRowKeys.value}, handleSuccess); |
|
|
|
|
} |
|
|
|
|
/** |
|
|
|
|
* 成功回调 |
|
|
|
|
*/ |
|
|
|
|
function handleSuccess() { |
|
|
|
|
(selectedRowKeys.value = []) && reload(); |
|
|
|
|
} |
|
|
|
|
/** |
|
|
|
|
* 操作栏 |
|
|
|
|
*/ |
|
|
|
|
function getTableAction(record){ |
|
|
|
|
const actions = [ |
|
|
|
|
{ |
|
|
|
|
label: '项目书', |
|
|
|
|
onClick: go_xiangmushu.bind(null, record), |
|
|
|
|
// auth: 'projecttype:project_type:edit' |
|
|
|
|
import {BasicTable, useTable, TableAction} from '/@/components/Table'; |
|
|
|
|
import {useModal} from '/@/components/Modal'; |
|
|
|
|
import { useListPage } from '/@/hooks/system/useListPage' |
|
|
|
|
import ProjectModal from './components/ProjectModal.vue' |
|
|
|
|
import {columns, searchFormSchema, superQuerySchema} from './Project.data'; |
|
|
|
|
import { |
|
|
|
|
list, |
|
|
|
|
deleteOne, |
|
|
|
|
rollbackOne, |
|
|
|
|
submitOne, |
|
|
|
|
batchDelete, |
|
|
|
|
getImportUrl, |
|
|
|
|
getExportUrl, |
|
|
|
|
getProjectTypeList |
|
|
|
|
} from './Project.api'; |
|
|
|
|
import { downloadFile } from '/@/utils/common/renderUtils'; |
|
|
|
|
import { useGo } from '/@/hooks/web/usePage'; |
|
|
|
|
|
|
|
|
|
import { useUserStore } from '/@/store/modules/user'; |
|
|
|
|
import {getUserData} from "@/views/system/usersetting/UserSetting.api"; |
|
|
|
|
import {useTimeoutFn} from "@/hooks/core/useTimeout"; |
|
|
|
|
const go = useGo(); |
|
|
|
|
|
|
|
|
|
const queryParam = reactive<any>({}); |
|
|
|
|
const checkedKeys = ref<Array<string | number>>([]); |
|
|
|
|
const userStore = useUserStore(); |
|
|
|
|
//注册model |
|
|
|
|
const [registerModal, {openModal}] = useModal(); |
|
|
|
|
const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({ |
|
|
|
|
tableProps:{ |
|
|
|
|
title: '项目表', |
|
|
|
|
api: list, |
|
|
|
|
columns, |
|
|
|
|
canResize:false, |
|
|
|
|
formConfig: { |
|
|
|
|
//labelWidth: 120, |
|
|
|
|
schemas: searchFormSchema, |
|
|
|
|
autoSubmitOnEnter:true, |
|
|
|
|
showAdvancedButton:true, |
|
|
|
|
fieldMapToNumber: [ |
|
|
|
|
], |
|
|
|
|
fieldMapToTime: [ |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
actionColumn: { |
|
|
|
|
width: 380, |
|
|
|
|
fixed:'right' |
|
|
|
|
}, |
|
|
|
|
beforeFetch: (params) => { |
|
|
|
|
return Object.assign(params, queryParam); |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: '预算书', |
|
|
|
|
onClick: go_yusuanshu.bind(null, record), |
|
|
|
|
// auth: 'projecttype:project_type:edit' |
|
|
|
|
exportConfig: { |
|
|
|
|
name:"项目表", |
|
|
|
|
url: getExportUrl, |
|
|
|
|
params: queryParam, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: '详情', |
|
|
|
|
onClick: handleDetail.bind(null, record), |
|
|
|
|
importConfig: { |
|
|
|
|
url: getImportUrl, |
|
|
|
|
success: handleSuccess |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: '删除', |
|
|
|
|
popConfirm: { |
|
|
|
|
title: '是否确认删除', |
|
|
|
|
confirm: handleDelete.bind(null, record), |
|
|
|
|
placement: 'topLeft', |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
// 日期范围选项 |
|
|
|
|
// 日期范围选项 |
|
|
|
|
const RANGE_OPTIONS = [ |
|
|
|
|
{key: 'TODAY', label: '今天'}, |
|
|
|
|
{key: 'YESTERDAY', label: '昨天'}, |
|
|
|
|
{key: 'TOMORROW', label: '明天'}, |
|
|
|
|
{key: 'THIS_WEEK', label: '本周'}, |
|
|
|
|
{key: 'LAST_WEEK', label: '上周'}, |
|
|
|
|
{key: 'NEXT_WEEK', label: '下周'}, |
|
|
|
|
{key: 'LAST_7_DAYS', label: '过去七天'}, |
|
|
|
|
{key: 'THIS_MONTH', label: '本月'}, |
|
|
|
|
{key: 'LAST_MONTH', label: '上月'}, |
|
|
|
|
{key: 'NEXT_MONTH', label: '下月'}, |
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext |
|
|
|
|
|
|
|
|
|
// 高级查询配置 |
|
|
|
|
const superQueryConfig = reactive(superQuerySchema); |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 高级查询事件 |
|
|
|
|
*/ |
|
|
|
|
function handleSuperQuery(params) { |
|
|
|
|
Object.keys(params).map((k) => { |
|
|
|
|
queryParam[k] = params[k]; |
|
|
|
|
}); |
|
|
|
|
reload(); |
|
|
|
|
} |
|
|
|
|
/** |
|
|
|
|
* 新增事件 |
|
|
|
|
*/ |
|
|
|
|
function handleAdd() { |
|
|
|
|
openModal(true, { |
|
|
|
|
isUpdate: false, |
|
|
|
|
showFooter: true, |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//跳转到新建申报页面 |
|
|
|
|
function go_xinjianshenbao() { |
|
|
|
|
// go('/comp/jeecg/basic'); |
|
|
|
|
go('/projectApplication/index?projectTypeId='+'1846744340708184065'); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//跳转到项目书页面 |
|
|
|
|
function go_xiangmushu(record) { |
|
|
|
|
// go('/comp/jeecg/basic?id=' +'666'); |
|
|
|
|
go('/projectApplication/kejigongguan/xiangmushu?id='+record.id); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//跳转到预算书页面 |
|
|
|
|
function go_yusuanshu(record) { |
|
|
|
|
// go('/comp/jeecg/basic?id=' +'666'); |
|
|
|
|
go('/projectApplication/kejigongguan/yusuanshu?id='+record.id); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function go_projectLog(record) { |
|
|
|
|
// go('/comp/jeecg/basic?id=' +'666'); |
|
|
|
|
go('/projectLog/projectLogList?id='+record.id); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 编辑事件 |
|
|
|
|
*/ |
|
|
|
|
function handleEdit(record: Recordable) { |
|
|
|
|
openModal(true, { |
|
|
|
|
record, |
|
|
|
|
isUpdate: true, |
|
|
|
|
showFooter: true, |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
/** |
|
|
|
|
* 详情 |
|
|
|
|
*/ |
|
|
|
|
function handleDetail(record: Recordable) { |
|
|
|
|
openModal(true, { |
|
|
|
|
record, |
|
|
|
|
isUpdate: true, |
|
|
|
|
showFooter: false, |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
/** |
|
|
|
|
* 删除事件 |
|
|
|
|
*/ |
|
|
|
|
async function handleDelete(record) { |
|
|
|
|
await deleteOne({id: record.id}, handleSuccess); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//取回项目 |
|
|
|
|
async function handleSubmitOne(record) { |
|
|
|
|
await submitOne({id: record.id}, handleSuccess); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//取回项目 |
|
|
|
|
async function handleRollbackOne(record) { |
|
|
|
|
await rollbackOne({id: record.id}, handleSuccess); |
|
|
|
|
} |
|
|
|
|
/** |
|
|
|
|
* 批量删除事件 |
|
|
|
|
*/ |
|
|
|
|
async function batchHandleDelete() { |
|
|
|
|
await batchDelete({ids: selectedRowKeys.value}, handleSuccess); |
|
|
|
|
} |
|
|
|
|
/** |
|
|
|
|
* 成功回调 |
|
|
|
|
*/ |
|
|
|
|
function handleSuccess() { |
|
|
|
|
(selectedRowKeys.value = []) && reload(); |
|
|
|
|
} |
|
|
|
|
/** |
|
|
|
|
* 操作栏 |
|
|
|
|
*/ |
|
|
|
|
function getTableAction(record){ |
|
|
|
|
const actions = [ |
|
|
|
|
{ |
|
|
|
|
label: '项目书', |
|
|
|
|
onClick: go_xiangmushu.bind(null, record), |
|
|
|
|
// auth: 'projecttype:project_type:edit' |
|
|
|
|
}, |
|
|
|
|
// auth: 'projecttype:project_type:delete' |
|
|
|
|
}]; |
|
|
|
|
//申请人待提交时,可以修改 |
|
|
|
|
if (record.projectStatus == 5) { |
|
|
|
|
actions.unshift({ |
|
|
|
|
label: '编辑', |
|
|
|
|
onClick: handleEdit.bind(null, record), |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
return actions; |
|
|
|
|
} |
|
|
|
|
/** |
|
|
|
|
* 下拉操作栏 |
|
|
|
|
*/ |
|
|
|
|
function getDropDownAction(record){ |
|
|
|
|
return [ |
|
|
|
|
{ |
|
|
|
|
label: '详情', |
|
|
|
|
onClick: handleDetail.bind(null, record), |
|
|
|
|
}, { |
|
|
|
|
label: '删除', |
|
|
|
|
popConfirm: { |
|
|
|
|
title: '是否确认删除', |
|
|
|
|
confirm: handleDelete.bind(null, record), |
|
|
|
|
placement: 'topLeft', |
|
|
|
|
{ |
|
|
|
|
label: '预算书', |
|
|
|
|
onClick: go_yusuanshu.bind(null, record), |
|
|
|
|
// auth: 'projecttype:project_type:edit' |
|
|
|
|
}, |
|
|
|
|
auth: 'project:project:delete' |
|
|
|
|
{ |
|
|
|
|
label: '详情', |
|
|
|
|
onClick: handleDetail.bind(null, record), |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: '日志查询', |
|
|
|
|
onClick: go_projectLog.bind(null, record), |
|
|
|
|
} |
|
|
|
|
]; |
|
|
|
|
//申请人待提交时可以删除(只有自己能删除) |
|
|
|
|
if (record.projectStatus == 5) { |
|
|
|
|
actions.unshift({ |
|
|
|
|
label: '删除', |
|
|
|
|
popConfirm: { |
|
|
|
|
title: '是否确认删除', |
|
|
|
|
confirm: handleDelete.bind(null, record), |
|
|
|
|
placement: 'topLeft', |
|
|
|
|
}, |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
if (record.projectStatus == 5) { |
|
|
|
|
actions.unshift({ |
|
|
|
|
label: '提交项目', |
|
|
|
|
onClick: handleSubmitOne.bind(null, record), |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
//projectStatus 项目书状态 |
|
|
|
|
//('科技主管部门待提交', '1'); |
|
|
|
|
//('科技主管部门已提交', '2'); |
|
|
|
|
//('不受理', '3'); |
|
|
|
|
//('已受理', '4'); |
|
|
|
|
//('申请人待提交', '5'); |
|
|
|
|
//('申请单位待提交', '6'); |
|
|
|
|
//('市科技局待提交', '7'); |
|
|
|
|
//('市科技局已提交', '8'); |
|
|
|
|
if (record.projectStatus ==6) { |
|
|
|
|
actions.unshift({ |
|
|
|
|
label: '取回项目', |
|
|
|
|
onClick: handleRollbackOne.bind(null, record), |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
] |
|
|
|
|
} |
|
|
|
|
return actions; |
|
|
|
|
} |
|
|
|
|
/** |
|
|
|
|
* 下拉操作栏 |
|
|
|
|
*/ |
|
|
|
|
function getDropDownAction(record){ |
|
|
|
|
return [ |
|
|
|
|
{ |
|
|
|
|
label: '详情', |
|
|
|
|
onClick: handleDetail.bind(null, record), |
|
|
|
|
}, { |
|
|
|
|
label: '删除', |
|
|
|
|
popConfirm: { |
|
|
|
|
title: '是否确认删除', |
|
|
|
|
confirm: handleDelete.bind(null, record), |
|
|
|
|
placement: 'topLeft', |
|
|
|
|
}, |
|
|
|
|
auth: 'project:project:delete' |
|
|
|
|
} |
|
|
|
|
] |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
<style lang="less" scoped> |
|
|
|
|
:deep(.ant-picker),:deep(.ant-input-number){ |
|
|
|
|
width: 100%; |
|
|
|
|
} |
|
|
|
|
:deep(.ant-picker),:deep(.ant-input-number){ |
|
|
|
|
width: 100%; |
|
|
|
|
} |
|
|
|
|
</style> |
|
|
|
|