fix the error of project plan
This commit is contained in:
		
							parent
							
								
									d1953a024c
								
							
						
					
					
						commit
						9843ca4020
					
				| @ -1,6 +1,6 @@ | |||||||
| import request from '@/utils/request' | import request from '@/utils/request' | ||||||
| 
 | 
 | ||||||
| // 查询项目申报v2列表
 | // 查询项目申报指南列表
 | ||||||
| export function listHandbook(query) { | export function listHandbook(query) { | ||||||
|   return request({ |   return request({ | ||||||
|     url: '/scientific/handbook/list', |     url: '/scientific/handbook/list', | ||||||
| @ -9,7 +9,7 @@ export function listHandbook(query) { | |||||||
|   }) |   }) | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| // 查询项目申报v2详细
 | // 查询项目申报指南详细
 | ||||||
| export function getHandbook(handbookId) { | export function getHandbook(handbookId) { | ||||||
|   return request({ |   return request({ | ||||||
|     url: '/scientific/handbook/' + handbookId, |     url: '/scientific/handbook/' + handbookId, | ||||||
| @ -17,7 +17,7 @@ export function getHandbook(handbookId) { | |||||||
|   }) |   }) | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| // 新增项目申报v2
 | // 新增项目申报指南
 | ||||||
| export function addHandbook(data) { | export function addHandbook(data) { | ||||||
|   return request({ |   return request({ | ||||||
|     url: '/scientific/handbook', |     url: '/scientific/handbook', | ||||||
| @ -26,7 +26,7 @@ export function addHandbook(data) { | |||||||
|   }) |   }) | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| // 修改项目申报v2
 | // 修改项目申报指南
 | ||||||
| export function updateHandbook(data) { | export function updateHandbook(data) { | ||||||
|   return request({ |   return request({ | ||||||
|     url: '/scientific/handbook', |     url: '/scientific/handbook', | ||||||
| @ -35,7 +35,7 @@ export function updateHandbook(data) { | |||||||
|   }) |   }) | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| // 删除项目申报v2
 | // 删除项目申报指南
 | ||||||
| export function delHandbook(handbookId) { | export function delHandbook(handbookId) { | ||||||
|   return request({ |   return request({ | ||||||
|     url: '/scientific/handbook/' + handbookId, |     url: '/scientific/handbook/' + handbookId, | ||||||
|  | |||||||
							
								
								
									
										44
									
								
								ruoyi-ui/src/api/scientific/project_application_plan.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										44
									
								
								ruoyi-ui/src/api/scientific/project_application_plan.js
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,44 @@ | |||||||
|  | import request from '@/utils/request' | ||||||
|  | 
 | ||||||
|  | // 查询项目申报v2列表
 | ||||||
|  | export function listPlan(query) { | ||||||
|  |   return request({ | ||||||
|  |     url: '/scientific/plan/list', | ||||||
|  |     method: 'get', | ||||||
|  |     params: query | ||||||
|  |   }) | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | // 查询项目申报v2详细
 | ||||||
|  | export function getPlan(handbookId) { | ||||||
|  |   return request({ | ||||||
|  |     url: '/scientific/plan/' + handbookId, | ||||||
|  |     method: 'get' | ||||||
|  |   }) | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | // 新增项目申报v2
 | ||||||
|  | export function addPlan(data) { | ||||||
|  |   return request({ | ||||||
|  |     url: '/scientific/plan', | ||||||
|  |     method: 'post', | ||||||
|  |     data: data | ||||||
|  |   }) | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | // 修改项目申报v2
 | ||||||
|  | export function updatePlan(data) { | ||||||
|  |   return request({ | ||||||
|  |     url: '/scientific/plan', | ||||||
|  |     method: 'put', | ||||||
|  |     data: data | ||||||
|  |   }) | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | // 删除项目申报v2
 | ||||||
|  | export function delPlan(handbookId) { | ||||||
|  |   return request({ | ||||||
|  |     url: '/scientific/plan/' + handbookId, | ||||||
|  |     method: 'delete' | ||||||
|  |   }) | ||||||
|  | } | ||||||
| @ -209,39 +209,70 @@ export const dynamicRoutes = [ | |||||||
|       } |       } | ||||||
|     ] |     ] | ||||||
|   }, |   }, | ||||||
|  |   // zqjia:用三级路由会出问题,就通过这种形式区分不同模块吧
 | ||||||
|  |   // 申报计划路由
 | ||||||
|   { |   { | ||||||
|     path: '/scientific', |     path: '/scientific/project_application_plan', | ||||||
|     component: Layout, |     component: Layout, | ||||||
|     hidden: true, |     hidden: true, | ||||||
|     permissions: ['scientific:projectApply'], |     permissions: ['scientific:project_application_plan'], | ||||||
|     children: [ |     children: [ | ||||||
|  |       // zqjia:这个路由是菜单管理里的起作用
 | ||||||
|  |       // {
 | ||||||
|  |       //   path: 'list',
 | ||||||
|  |       //   component: () => import('@/views/scientific/project_application_plan/index'),
 | ||||||
|  |       //   name: 'planList',
 | ||||||
|  |       //   meta: { title: '项目申报计划', icon: '' }
 | ||||||
|  |       // },
 | ||||||
|  |       { | ||||||
|  |         path: 'detail/:planProcId([\\w|\\-]+)', | ||||||
|  |         component: () => import('@/views/scientific/project_application_plan/detail'), | ||||||
|  |         name: 'planDetail', | ||||||
|  |         meta: { title: '申报计划详情' } | ||||||
|  |       }, | ||||||
|  |       // zqjia:这个路由是菜单管理里的起作用
 | ||||||
|  |       // {
 | ||||||
|  |       //   path: 'planApply',
 | ||||||
|  |       //   component: () => import('@/views/scientific/project_application_plan/planApply'),
 | ||||||
|  |       //   name: 'planApply',
 | ||||||
|  |       //   meta: { title: '项目申报', icon: '' }
 | ||||||
|  |       // },
 | ||||||
|  |     ] | ||||||
|  |   }, | ||||||
|  |   // 项目路由
 | ||||||
|  |   { | ||||||
|  |     path: '/scientific/project', | ||||||
|  |     component: Layout, | ||||||
|  |     hidden: true, | ||||||
|  |     permissions: ['scientific:project'], | ||||||
|  |     children: [ | ||||||
|  |       // zqjia:这个路由是菜单管理里的起作用
 | ||||||
|  |       // {
 | ||||||
|  |       //   path: 'list',
 | ||||||
|  |       //   component: () => import('@/views/scientific/project/index'),
 | ||||||
|  |       //   name: 'projectList',
 | ||||||
|  |       //   meta: { title: '项目', icon: '' }
 | ||||||
|  |       // },
 | ||||||
|  |       // zqjia:项目详情还没写
 | ||||||
|  |       { | ||||||
|  |         path: 'detail/:planProcId([\\w|\\-]+)', | ||||||
|  |         component: () => import('@/views/scientific/project_application_plan/detail'), | ||||||
|  |         name: 'planDetail', | ||||||
|  |         meta: { title: '申报计划详情' } | ||||||
|  |       }, | ||||||
|  |       { | ||||||
|  |         path: 'planProjectQuery/:planId([\\w|\\-]+)', | ||||||
|  |         // permissions: ['scientific:application:list'],
 | ||||||
|  |         component: () => import('@/views/scientific/project/index'), | ||||||
|  |         name: 'planProjectQuery', | ||||||
|  |         meta: { title: '已申报项目' } | ||||||
|  |       }, | ||||||
|       { |       { | ||||||
|         path: 'projectApply/:deployId([\\w|\\-]+)', |         path: 'projectApply/:deployId([\\w|\\-]+)', | ||||||
|         component: () => import('@/views/scientific/projectApply'), |         component: () => import('@/views/scientific/project/projectApply.vue'), | ||||||
|         name: 'ProjectApply', |         name: 'ProjectApply', | ||||||
|         meta: { title: '项目申报', icon: '' } |         meta: { title: '项目申报', icon: '' } | ||||||
|       }, |       }, | ||||||
|       { |  | ||||||
|         path: 'handbookProjectQuery/:handbookId([\\w|\\-]+)', |  | ||||||
|         component: () => import('@/views/scientific/project/index'), |  | ||||||
|         name: 'handbookProjectQuery', |  | ||||||
|         meta: { title: '指南项目' } |  | ||||||
|         // meta: { title: '已申报项目', activeMenu: '/work/own' }
 |  | ||||||
|       }, |  | ||||||
|       { |  | ||||||
|         path: 'handbookList', |  | ||||||
|         component: () => import('@/views/scientific/handbook/index'), |  | ||||||
|         name: 'handbookList', |  | ||||||
|         meta: { title: '申报指南' } |  | ||||||
|         // meta: { title: '已申报项目', activeMenu: '/work/own' }
 |  | ||||||
|       }, |  | ||||||
|       { |  | ||||||
|         path: 'handbook/detail/:handbookProcId([\\w|\\-]+)', |  | ||||||
|         component: () => import('@/views/scientific/handbook/detail'), |  | ||||||
|         name: 'handbookDetail', |  | ||||||
|         meta: { title: '申报计划' } |  | ||||||
|         // meta: { title: '已申报项目', activeMenu: '/work/own' }
 |  | ||||||
|       } |  | ||||||
|     ] |     ] | ||||||
|   }, |   }, | ||||||
| ] | ] | ||||||
|  | |||||||
| @ -1,39 +1,62 @@ | |||||||
| <template> | <template> | ||||||
|   <div class="app-container"> |   <div class="app-container"> | ||||||
|     <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> |     <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> | ||||||
|       <el-form-item label="申报计划名称" prop="handbookName" label-width="100px" > |       <el-form-item label="项目ID" prop="handbookId"> | ||||||
|  |         <el-input | ||||||
|  |           v-model="queryParams.handbookId" | ||||||
|  |           placeholder="请输入项目ID" | ||||||
|  |           clearable | ||||||
|  |           @keyup.enter.native="handleQuery" | ||||||
|  |         /> | ||||||
|  |       </el-form-item> | ||||||
|  |       <el-form-item label="指南名称" prop="handbookName"> | ||||||
|         <el-input |         <el-input | ||||||
|           v-model="queryParams.handbookName" |           v-model="queryParams.handbookName" | ||||||
|           placeholder="请输入申报计划名称" |           placeholder="请输入指南名称" | ||||||
|           clearable |           clearable | ||||||
|           @keyup.enter.native="handleQuery" |           @keyup.enter.native="handleQuery" | ||||||
|         /> |         /> | ||||||
|       </el-form-item> |       </el-form-item> | ||||||
|       <el-form-item label="申报计划级别" prop="handbookLevel" label-width="100px"> |       <el-form-item label="指南分类" prop="handbookCategory"> | ||||||
|  |         <el-input | ||||||
|  |           v-model="queryParams.handbookCategory" | ||||||
|  |           placeholder="请输入指南分类" | ||||||
|  |           clearable | ||||||
|  |           @keyup.enter.native="handleQuery" | ||||||
|  |         /> | ||||||
|  |       </el-form-item> | ||||||
|  |       <el-form-item label="指南级别(4院级 3市级 2省级 1国家级)" prop="handbookLevel"> | ||||||
|         <el-input |         <el-input | ||||||
|           v-model="queryParams.handbookLevel" |           v-model="queryParams.handbookLevel" | ||||||
|           placeholder="请输入申报计划级别" |           placeholder="请输入指南级别(4院级 3市级 2省级 1国家级)" | ||||||
|           clearable |           clearable | ||||||
|           @keyup.enter.native="handleQuery" |           @keyup.enter.native="handleQuery" | ||||||
|         /> |         /> | ||||||
|       </el-form-item> |       </el-form-item> | ||||||
|       <el-form-item label="申报开始日期" prop="projectAppStTime" label-width="100px"> |       <el-form-item label="发布时间" prop="handbookDate"> | ||||||
|         <el-date-picker clearable |         <el-date-picker clearable | ||||||
|           v-model="queryParams.projectAppStTime" |           v-model="queryParams.handbookDate" | ||||||
|           type="date" |           type="date" | ||||||
|           value-format="yyyy-MM-dd" |           value-format="yyyy-MM-dd" | ||||||
|           placeholder="请选择申报开始日期"> |           placeholder="请选择发布时间"> | ||||||
|         </el-date-picker> |         </el-date-picker> | ||||||
|       </el-form-item> |       </el-form-item> | ||||||
|       <el-form-item label="申报结束日期" prop="projectAppEndTime" label-width="100px"> |       <el-form-item label="备注" prop="handbookNote"> | ||||||
|         <el-date-picker clearable |         <el-input | ||||||
|           v-model="queryParams.projectAppEndTime" |           v-model="queryParams.handbookNote" | ||||||
|           type="date" |           placeholder="请输入备注" | ||||||
|           value-format="yyyy-MM-dd" |           clearable | ||||||
|           placeholder="请选择申报结束日期"> |           @keyup.enter.native="handleQuery" | ||||||
|         </el-date-picker> |         /> | ||||||
|  |       </el-form-item> | ||||||
|  |       <el-form-item label="指南录入流程实例Id" prop="handbookProcId"> | ||||||
|  |         <el-input | ||||||
|  |           v-model="queryParams.handbookProcId" | ||||||
|  |           placeholder="请输入指南录入流程实例Id" | ||||||
|  |           clearable | ||||||
|  |           @keyup.enter.native="handleQuery" | ||||||
|  |         /> | ||||||
|       </el-form-item> |       </el-form-item> | ||||||
| 
 |  | ||||||
|       <el-form-item> |       <el-form-item> | ||||||
|         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> |         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> | ||||||
|         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> |         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> | ||||||
| @ -48,7 +71,7 @@ | |||||||
|           icon="el-icon-plus" |           icon="el-icon-plus" | ||||||
|           size="mini" |           size="mini" | ||||||
|           @click="handleAdd" |           @click="handleAdd" | ||||||
|           v-hasPermi="['scientific:handbook:add']" |           v-hasPermi="['scientific:project_application_plan:add']" | ||||||
|         >新增</el-button> |         >新增</el-button> | ||||||
|       </el-col> |       </el-col> | ||||||
|       <el-col :span="1.5"> |       <el-col :span="1.5"> | ||||||
| @ -59,7 +82,7 @@ | |||||||
|           size="mini" |           size="mini" | ||||||
|           :disabled="single" |           :disabled="single" | ||||||
|           @click="handleUpdate" |           @click="handleUpdate" | ||||||
|           v-hasPermi="['scientific:handbook:edit']" |           v-hasPermi="['scientific:project_application_plan:edit']" | ||||||
|         >修改</el-button> |         >修改</el-button> | ||||||
|       </el-col> |       </el-col> | ||||||
|       <el-col :span="1.5"> |       <el-col :span="1.5"> | ||||||
| @ -70,7 +93,7 @@ | |||||||
|           size="mini" |           size="mini" | ||||||
|           :disabled="multiple" |           :disabled="multiple" | ||||||
|           @click="handleDelete" |           @click="handleDelete" | ||||||
|           v-hasPermi="['scientific:handbook:remove']" |           v-hasPermi="['scientific:project_application_plan:remove']" | ||||||
|         >删除</el-button> |         >删除</el-button> | ||||||
|       </el-col> |       </el-col> | ||||||
|       <el-col :span="1.5"> |       <el-col :span="1.5"> | ||||||
| @ -80,7 +103,7 @@ | |||||||
|           icon="el-icon-download" |           icon="el-icon-download" | ||||||
|           size="mini" |           size="mini" | ||||||
|           @click="handleExport" |           @click="handleExport" | ||||||
|           v-hasPermi="['scientific:handbook:export']" |           v-hasPermi="['scientific:project_application_plan:export']" | ||||||
|         >导出</el-button> |         >导出</el-button> | ||||||
|       </el-col> |       </el-col> | ||||||
|       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> | ||||||
| @ -88,65 +111,35 @@ | |||||||
| 
 | 
 | ||||||
|     <el-table v-loading="loading" :data="handbookList" @selection-change="handleSelectionChange"> |     <el-table v-loading="loading" :data="handbookList" @selection-change="handleSelectionChange"> | ||||||
|       <el-table-column type="selection" width="55" align="center" /> |       <el-table-column type="selection" width="55" align="center" /> | ||||||
|       <el-table-column label="序号" type="index" width="50"></el-table-column> |       <el-table-column label="项目ID" align="center" prop="handbookId" v-if="true"/> | ||||||
|       <el-table-column label="申报计划名称" align="center" prop="handbookName" :min-width="100"/> |       <el-table-column label="指南名称" align="center" prop="handbookName" /> | ||||||
|       <el-table-column label="申报计划级别" align="center" width="100px" :min-width="100"> |       <el-table-column label="指南分类" align="center" prop="handbookCategory" /> | ||||||
|  |       <el-table-column label="指南级别(4院级 3市级 2省级 1国家级)" align="center" prop="handbookLevel" /> | ||||||
|  |       <el-table-column label="发布时间" align="center" prop="handbookDate" width="180"> | ||||||
|         <template slot-scope="scope"> |         <template slot-scope="scope"> | ||||||
|           <el-tag size="medium" :type="getTagLevelType(scope.row.handbookLevel)"> |           <span>{{ parseTime(scope.row.handbookDate, '{y}-{m}-{d}') }}</span> | ||||||
|             {{ formatHandbookLevel(scope.row.handbookLevel) }} |  | ||||||
|           </el-tag> |  | ||||||
|         </template> |         </template> | ||||||
|       </el-table-column> |       </el-table-column> | ||||||
| 
 |       <el-table-column label="备注" align="center" prop="handbookNote" /> | ||||||
| 
 |       <el-table-column label="指南文件" align="center" prop="handbookFile" /> | ||||||
|       <el-table-column label="申报开始日期" align="center" prop="projectAppStTime" width="180"> |       <el-table-column label="指南录入流程实例Id" align="center" prop="handbookProcId" /> | ||||||
|         <template slot-scope="scope"> |       <el-table-column label="指南录入流程状态(0未发起审核 1审核中 2审核失败 3审核通过)" align="center" prop="handbookStatus" /> | ||||||
|           <span>{{ parseTime(scope.row.projectAppStTime, '{y}-{m}-{d}') }}</span> |  | ||||||
|         </template> |  | ||||||
|       </el-table-column> |  | ||||||
|       <el-table-column label="申报结束日期" align="center" prop="projectAppEndTime" width="180"> |  | ||||||
|         <template slot-scope="scope"> |  | ||||||
|           <span>{{ parseTime(scope.row.projectAppEndTime, '{y}-{m}-{d}') }}</span> |  | ||||||
|         </template> |  | ||||||
|       </el-table-column> |  | ||||||
| 
 |  | ||||||
|       <el-table-column label="已申报项目" align="center" prop="projectAppStTime" width="180"> |  | ||||||
|         <template slot-scope="scope"> |  | ||||||
|           <el-button plain |  | ||||||
|             size="mini" |  | ||||||
|             @click="listProjectInHandbook(scope.row.handbookId)" |  | ||||||
|             v-hasPermi="['scientific:handbook:list']" |  | ||||||
|           >{{ scope.row.nProject }}</el-button> |  | ||||||
|         </template> |  | ||||||
|       </el-table-column> |  | ||||||
| 
 |  | ||||||
|       <el-table-column label="申报状态" align="center" width="100px" :min-width="100"> |  | ||||||
|         <template slot-scope="scope"> |  | ||||||
|           <el-tag size="medium" :type="getTagType(isCurrentDateInRange(scope.row.projectAppStTime, scope.row.projectAppEndTime))"> |  | ||||||
|             {{ isCurrentDateInRange(scope.row.projectAppStTime, scope.row.projectAppEndTime) }} |  | ||||||
|           </el-tag> |  | ||||||
|         </template> |  | ||||||
|       </el-table-column> |  | ||||||
| 
 |  | ||||||
|       <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |       <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> | ||||||
|         <template slot-scope="scope"> |         <template slot-scope="scope"> | ||||||
|           <el-button |           <el-button | ||||||
|             type="primary" |  | ||||||
|             icon="el-icon-top" |  | ||||||
|             size="mini" |             size="mini" | ||||||
|             @click="handbookDetail(scope.row)" |             type="text" | ||||||
|             v-hasPermi="['scientific:handbook:list']" |             icon="el-icon-edit" | ||||||
|           >查看计划</el-button> |             @click="handleUpdate(scope.row)" | ||||||
| 
 |             v-hasPermi="['scientific:project_application_plan:edit']" | ||||||
|  |           >修改</el-button> | ||||||
|           <el-button |           <el-button | ||||||
|             type="primary" |  | ||||||
|             icon="el-icon-top" |  | ||||||
|             size="mini" |             size="mini" | ||||||
|             @click="projectApply(scope.row)" |             type="text" | ||||||
|             :disabled="isCurrentDateInRange(scope.row.projectAppStTime, scope.row.projectAppEndTime) !== '申报中'" |             icon="el-icon-delete" | ||||||
|             v-hasPermi="['scientific:handbook:list']" |             @click="handleDelete(scope.row)" | ||||||
|           >进入申报</el-button> |             v-hasPermi="['scientific:project_application_plan:remove']" | ||||||
| 
 |           >删除</el-button> | ||||||
|         </template> |         </template> | ||||||
|       </el-table-column> |       </el-table-column> | ||||||
|     </el-table> |     </el-table> | ||||||
| @ -159,35 +152,35 @@ | |||||||
|       @pagination="getList" |       @pagination="getList" | ||||||
|     /> |     /> | ||||||
| 
 | 
 | ||||||
|     <!-- 添加或修改项目申报v2对话框 --> |     <!-- 添加或修改项目申报指南对话框 --> | ||||||
|     <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> |     <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> | ||||||
|       <el-form ref="form" :model="form" :rules="rules" label-width="80px"> |       <el-form ref="form" :model="form" :rules="rules" label-width="80px"> | ||||||
|         <el-form-item label="申报信息名称" prop="handbookName"> |         <el-form-item label="指南名称" prop="handbookName"> | ||||||
|           <el-input v-model="form.handbookName" placeholder="请输入申报信息名称" /> |           <el-input v-model="form.handbookName" placeholder="请输入指南名称" /> | ||||||
|         </el-form-item> |         </el-form-item> | ||||||
|         <el-form-item label="项目立项流程实例Id" prop="handbookProcId"> |         <el-form-item label="指南分类" prop="handbookCategory"> | ||||||
|           <el-input v-model="form.handbookProcId" placeholder="请输入项目立项流程实例Id" /> |           <el-input v-model="form.handbookCategory" placeholder="请输入指南分类" /> | ||||||
|         </el-form-item> |         </el-form-item> | ||||||
|         <el-form-item label="项目指南级别(0市级 1区级 3省级 4国家级)" prop="handbookLevel"> |         <el-form-item label="指南级别(4院级 3市级 2省级 1国家级)" prop="handbookLevel"> | ||||||
|           <el-input v-model="form.handbookLevel" placeholder="请输入项目指南级别(0市级 1区级 3省级 4国家级)" /> |           <el-input v-model="form.handbookLevel" placeholder="请输入指南级别(4院级 3市级 2省级 1国家级)" /> | ||||||
|         </el-form-item> |         </el-form-item> | ||||||
|         <el-form-item label="申报开始日期" prop="projectAppStTime"> |         <el-form-item label="发布时间" prop="handbookDate"> | ||||||
|           <el-date-picker clearable |           <el-date-picker clearable | ||||||
|             v-model="form.projectAppStTime" |             v-model="form.handbookDate" | ||||||
|             type="datetime" |             type="datetime" | ||||||
|             value-format="yyyy-MM-dd HH:mm:ss" |             value-format="yyyy-MM-dd HH:mm:ss" | ||||||
|             placeholder="请选择申报开始日期"> |             placeholder="请选择发布时间"> | ||||||
|           </el-date-picker> |           </el-date-picker> | ||||||
|         </el-form-item> |         </el-form-item> | ||||||
|         <el-form-item label="申报结束日期" prop="projectAppEndTime"> |         <el-form-item label="备注" prop="handbookNote"> | ||||||
|           <el-date-picker clearable |           <el-input v-model="form.handbookNote" type="textarea" placeholder="请输入内容" /> | ||||||
|             v-model="form.projectAppEndTime" |         </el-form-item> | ||||||
|             type="datetime" |         <el-form-item label="指南文件" prop="handbookFile"> | ||||||
|             value-format="yyyy-MM-dd HH:mm:ss" |           <file-upload v-model="form.handbookFile"/> | ||||||
|             placeholder="请选择申报结束日期"> |         </el-form-item> | ||||||
|           </el-date-picker> |         <el-form-item label="指南录入流程实例Id" prop="handbookProcId"> | ||||||
|  |           <el-input v-model="form.handbookProcId" placeholder="请输入指南录入流程实例Id" /> | ||||||
|         </el-form-item> |         </el-form-item> | ||||||
| 
 |  | ||||||
|       </el-form> |       </el-form> | ||||||
|       <div slot="footer" class="dialog-footer"> |       <div slot="footer" class="dialog-footer"> | ||||||
|         <el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button> |         <el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button> | ||||||
| @ -199,8 +192,6 @@ | |||||||
| 
 | 
 | ||||||
| <script> | <script> | ||||||
| import { listHandbook, getHandbook, delHandbook, addHandbook, updateHandbook } from "@/api/scientific/handbook"; | import { listHandbook, getHandbook, delHandbook, addHandbook, updateHandbook } from "@/api/scientific/handbook"; | ||||||
| import { listProcess } from '@/api/workflow/process' |  | ||||||
| import { listApplication } from '@/api/scientific/application' |  | ||||||
| 
 | 
 | ||||||
| export default { | export default { | ||||||
|   name: "Handbook", |   name: "Handbook", | ||||||
| @ -220,7 +211,7 @@ export default { | |||||||
|       showSearch: true, |       showSearch: true, | ||||||
|       // 总条数 |       // 总条数 | ||||||
|       total: 0, |       total: 0, | ||||||
|       // 项目申报v2表格数据 |       // 项目申报指南表格数据 | ||||||
|       handbookList: [], |       handbookList: [], | ||||||
|       // 弹出层标题 |       // 弹出层标题 | ||||||
|       title: "", |       title: "", | ||||||
| @ -230,16 +221,15 @@ export default { | |||||||
|       queryParams: { |       queryParams: { | ||||||
|         pageNum: 1, |         pageNum: 1, | ||||||
|         pageSize: 10, |         pageSize: 10, | ||||||
|  |         handbookId: undefined, | ||||||
|         handbookName: undefined, |         handbookName: undefined, | ||||||
|         handbookProcId: undefined, |         handbookCategory: undefined, | ||||||
|         handbookStatus: "3", |  | ||||||
|         handbookType: undefined, |  | ||||||
|         handbookLevel: undefined, |         handbookLevel: undefined, | ||||||
|         declareStatus: undefined, |         handbookDate: undefined, | ||||||
|         projectAppStTime: undefined, |         handbookNote: undefined, | ||||||
|         projectAppEndTime: undefined, |         handbookFile: undefined, | ||||||
|         handbookLeader: undefined, |         handbookProcId: undefined, | ||||||
|         projectLeaderPhone: undefined, |         handbookStatus: undefined, | ||||||
|       }, |       }, | ||||||
|       // 表单参数 |       // 表单参数 | ||||||
|       form: {}, |       form: {}, | ||||||
| @ -249,22 +239,28 @@ export default { | |||||||
|           { required: true, message: "项目ID不能为空", trigger: "blur" } |           { required: true, message: "项目ID不能为空", trigger: "blur" } | ||||||
|         ], |         ], | ||||||
|         handbookName: [ |         handbookName: [ | ||||||
|           { required: true, message: "申报信息名称不能为空", trigger: "blur" } |           { required: true, message: "指南名称不能为空", trigger: "blur" } | ||||||
|         ], |         ], | ||||||
|         handbookProcId: [ |         handbookCategory: [ | ||||||
|           { required: true, message: "项目立项流程实例Id不能为空", trigger: "blur" } |           { required: true, message: "指南分类不能为空", trigger: "blur" } | ||||||
|         ], |         ], | ||||||
|         handbookLevel: [ |         handbookLevel: [ | ||||||
|           { required: true, message: "项目指南级别(0市级 1区级 3省级 4国家级)不能为空", trigger: "blur" } |           { required: true, message: "指南级别(4院级 3市级 2省级 1国家级)不能为空", trigger: "blur" } | ||||||
|         ], |         ], | ||||||
|         declareStatus: [ |         handbookDate: [ | ||||||
|           { required: true, message: "申报状态(0 停止申报 1 申报中)不能为空", trigger: "change" } |           { required: true, message: "发布时间不能为空", trigger: "blur" } | ||||||
|         ], |         ], | ||||||
|         projectAppStTime: [ |         handbookNote: [ | ||||||
|           { required: true, message: "申报开始日期不能为空", trigger: "blur" } |           { required: true, message: "备注不能为空", trigger: "blur" } | ||||||
|         ], |         ], | ||||||
|         projectAppEndTime: [ |         handbookFile: [ | ||||||
|           { required: true, message: "申报结束日期不能为空", trigger: "blur" } |           { required: true, message: "指南文件不能为空", trigger: "blur" } | ||||||
|  |         ], | ||||||
|  |         handbookProcId: [ | ||||||
|  |           { required: true, message: "指南录入流程实例Id不能为空", trigger: "blur" } | ||||||
|  |         ], | ||||||
|  |         handbookStatus: [ | ||||||
|  |           { required: true, message: "指南录入流程状态(0未发起审核 1审核中 2审核失败 3审核通过)不能为空", trigger: "change" } | ||||||
|         ], |         ], | ||||||
|       } |       } | ||||||
|     }; |     }; | ||||||
| @ -273,32 +269,15 @@ export default { | |||||||
|     this.getList(); |     this.getList(); | ||||||
|   }, |   }, | ||||||
|   methods: { |   methods: { | ||||||
|     /** 查询项目申报v2列表 */ |     /** 查询项目申报指南列表 */ | ||||||
|     getList() { |     getList() { | ||||||
|       this.loading = true; |       this.loading = true; | ||||||
|       listHandbook(this.queryParams).then(response => { |       listHandbook(this.queryParams).then(response => { | ||||||
|         this.handbookList = response.rows; |         this.handbookList = response.rows; | ||||||
|         this.total = response.total; |         this.total = response.total; | ||||||
|         // 使用Promise.all来处理异步操作 |         this.loading = false; | ||||||
|         const promises = this.handbookList.map(item => { |  | ||||||
|           const queryParams = { |  | ||||||
|             pageNum: 1, |  | ||||||
|               pageSize: 10, |  | ||||||
|               projectHandbookId: item.handbookId, |  | ||||||
|           }; |  | ||||||
|           listApplication(queryParams).then(res => { |  | ||||||
|             // zqjia:后续考虑是否保存整个res的信息 |  | ||||||
|             this.$set(item, "nProject", res.total); |  | ||||||
|           }); |  | ||||||
|         }); |  | ||||||
| 
 |  | ||||||
|         Promise.all(promises).then(() => { |  | ||||||
|           // 所有异步操作完成后,更新loading状态 |  | ||||||
|           this.loading = false; |  | ||||||
|         }); |  | ||||||
|       }); |       }); | ||||||
|     }, |     }, | ||||||
| 
 |  | ||||||
|     // 取消按钮 |     // 取消按钮 | ||||||
|     cancel() { |     cancel() { | ||||||
|       this.open = false; |       this.open = false; | ||||||
| @ -309,15 +288,13 @@ export default { | |||||||
|       this.form = { |       this.form = { | ||||||
|         handbookId: undefined, |         handbookId: undefined, | ||||||
|         handbookName: undefined, |         handbookName: undefined, | ||||||
|  |         handbookCategory: undefined, | ||||||
|  |         handbookLevel: undefined, | ||||||
|  |         handbookDate: undefined, | ||||||
|  |         handbookNote: undefined, | ||||||
|  |         handbookFile: undefined, | ||||||
|         handbookProcId: undefined, |         handbookProcId: undefined, | ||||||
|         handbookStatus: undefined, |         handbookStatus: undefined, | ||||||
|         handbookType: undefined, |  | ||||||
|         handbookLevel: undefined, |  | ||||||
|         declareStatus: undefined, |  | ||||||
|         projectAppStTime: undefined, |  | ||||||
|         projectAppEndTime: undefined, |  | ||||||
|         handbookLeader: undefined, |  | ||||||
|         projectLeaderPhone: undefined, |  | ||||||
|         createBy: undefined, |         createBy: undefined, | ||||||
|         createTime: undefined, |         createTime: undefined, | ||||||
|         updateBy: undefined, |         updateBy: undefined, | ||||||
| @ -345,7 +322,7 @@ export default { | |||||||
|     handleAdd() { |     handleAdd() { | ||||||
|       this.reset(); |       this.reset(); | ||||||
|       this.open = true; |       this.open = true; | ||||||
|       this.title = "添加项目申报v2"; |       this.title = "添加项目申报指南"; | ||||||
|     }, |     }, | ||||||
|     /** 修改按钮操作 */ |     /** 修改按钮操作 */ | ||||||
|     handleUpdate(row) { |     handleUpdate(row) { | ||||||
| @ -356,7 +333,7 @@ export default { | |||||||
|         this.loading = false; |         this.loading = false; | ||||||
|         this.form = response.data; |         this.form = response.data; | ||||||
|         this.open = true; |         this.open = true; | ||||||
|         this.title = "修改项目申报v2"; |         this.title = "修改项目申报指南"; | ||||||
|       }); |       }); | ||||||
|     }, |     }, | ||||||
|     /** 提交按钮 */ |     /** 提交按钮 */ | ||||||
| @ -387,7 +364,7 @@ export default { | |||||||
|     /** 删除按钮操作 */ |     /** 删除按钮操作 */ | ||||||
|     handleDelete(row) { |     handleDelete(row) { | ||||||
|       const handbookIds = row.handbookId || this.ids; |       const handbookIds = row.handbookId || this.ids; | ||||||
|       this.$modal.confirm('是否确认删除项目申报v2编号为"' + handbookIds + '"的数据项?').then(() => { |       this.$modal.confirm('是否确认删除项目申报指南编号为"' + handbookIds + '"的数据项?').then(() => { | ||||||
|         this.loading = true; |         this.loading = true; | ||||||
|         return delHandbook(handbookIds); |         return delHandbook(handbookIds); | ||||||
|       }).then(() => { |       }).then(() => { | ||||||
| @ -401,134 +378,10 @@ export default { | |||||||
|     }, |     }, | ||||||
|     /** 导出按钮操作 */ |     /** 导出按钮操作 */ | ||||||
|     handleExport() { |     handleExport() { | ||||||
|       this.download('scientific/handbook/export', { |       this.download('scientific/project_application_plan/export', { | ||||||
|         ...this.queryParams |         ...this.queryParams | ||||||
|       }, `handbook_${new Date().getTime()}.xlsx`) |       }, `handbook_${new Date().getTime()}.xlsx`) | ||||||
|     }, |     } | ||||||
|         /** |  | ||||||
|      * 把项目状态的申报code转换为文字: 0 : 未申报  1: 审核中  2: 已申报 |  | ||||||
|      * @param   {number|string} cellValue - 原始数值 |  | ||||||
|      * @returns {string} 转换后的字符串 |  | ||||||
|      * @author  zhanli |  | ||||||
|      */ |  | ||||||
| 
 |  | ||||||
|     formatHandbookLevel(cellValue) { |  | ||||||
|       switch (cellValue) { |  | ||||||
|         case '1': |  | ||||||
|           return "国家级"; |  | ||||||
|         case '2': |  | ||||||
|           return "省级"; |  | ||||||
|         case '3': |  | ||||||
|           return "市级"; |  | ||||||
|         case '4': |  | ||||||
|           return "院级"; |  | ||||||
|         default: |  | ||||||
|           return "未知"; |  | ||||||
|       } |  | ||||||
|     }, |  | ||||||
|     getTagType(status) { |  | ||||||
|       switch (status) { |  | ||||||
|         case '已结束': |  | ||||||
|           // 显示红色 停止申报 |  | ||||||
|           return 'danger'; |  | ||||||
|         case '申报中': |  | ||||||
|           // 审核中 显示绿色 |  | ||||||
|           return 'success'; |  | ||||||
|         case '未开始': |  | ||||||
|           // 未申报, 灰色 |  | ||||||
|           return 'info'; |  | ||||||
|         default: |  | ||||||
|           return ''; |  | ||||||
|       } |  | ||||||
|     }, |  | ||||||
|     getTagLevelType(status) { |  | ||||||
|       switch (status) { |  | ||||||
|         case '2': |  | ||||||
|           // 省级 蓝色 |  | ||||||
|           return 'primary'; |  | ||||||
|         case '3': |  | ||||||
|           // 市级 显示绿色 |  | ||||||
|           return 'success'; |  | ||||||
|         case '4': |  | ||||||
|           // 院级, 灰色 |  | ||||||
|           return 'info'; |  | ||||||
|         case '1': |  | ||||||
|           // 国家级 红色 |  | ||||||
|           return 'danger'; |  | ||||||
|         default: |  | ||||||
|           return ''; |  | ||||||
|       } |  | ||||||
|     }, |  | ||||||
|     isCurrentDateInRange(startDate, endDate) { |  | ||||||
|       // 获取当前时间 |  | ||||||
|       const currentDate = new Date(); |  | ||||||
| 
 |  | ||||||
|       // 将字符串日期转换为Date对象 |  | ||||||
|       const start = new Date(startDate); |  | ||||||
|       const end = new Date(endDate); |  | ||||||
| 
 |  | ||||||
|       // 判断当前时间是否在范围内 |  | ||||||
|       if(currentDate >= start && currentDate <= end) { |  | ||||||
|         return "申报中"; |  | ||||||
|       } |  | ||||||
|       else { |  | ||||||
|         if(currentDate < start) { |  | ||||||
|           return "未开始"; |  | ||||||
|         } |  | ||||||
|         else { |  | ||||||
|           return "已结束"; |  | ||||||
|         } |  | ||||||
|       } |  | ||||||
|     }, |  | ||||||
|     projectApply(row) { |  | ||||||
|       let queryParams = { |  | ||||||
|         pageNum: 1, |  | ||||||
|         pageSize: 10, |  | ||||||
|         processKey: undefined, |  | ||||||
|         processName: "项目申报", |  | ||||||
|         category: "002" |  | ||||||
|       }; |  | ||||||
| 
 |  | ||||||
|       // 跳转到项目申报 |  | ||||||
|       listProcess(queryParams).then(response => { |  | ||||||
|         const apply = response.rows[0]; |  | ||||||
|         if(apply) { |  | ||||||
|           this.$router.push({ |  | ||||||
|             name: 'ProjectApply', |  | ||||||
|             params: { |  | ||||||
|               deployId: apply.deploymentId, |  | ||||||
|               definitionId: apply.definitionId, |  | ||||||
|               row: row |  | ||||||
|             } |  | ||||||
|           }) |  | ||||||
|         } |  | ||||||
|       }); |  | ||||||
|     }, |  | ||||||
|     listProjectInHandbook(handbookId) { |  | ||||||
|       if (handbookId === undefined) { |  | ||||||
|         handbookId = 1; |  | ||||||
|       } |  | ||||||
|       let queryParams = { |  | ||||||
|         pageNum: 1, |  | ||||||
|         pageSize: 10, |  | ||||||
|         projectHandbookId: handbookId, |  | ||||||
|       }; |  | ||||||
|       this.$router.push({ |  | ||||||
|         name: 'handbookProjectQuery', |  | ||||||
|         params: { |  | ||||||
|           handbookId: handbookId, |  | ||||||
|           queryParams: queryParams, |  | ||||||
|         } |  | ||||||
|       }) |  | ||||||
|     }, |  | ||||||
|     handbookDetail(row) { |  | ||||||
|       this.$router.push({ |  | ||||||
|         path: '/scientific/handbook/detail/' + row.handbookProcId, |  | ||||||
|         query: { |  | ||||||
|           processed: false |  | ||||||
|         } |  | ||||||
|       }) |  | ||||||
|     }, |  | ||||||
|   } |   } | ||||||
| }; | }; | ||||||
| </script> | </script> | ||||||
|  | |||||||
| @ -124,12 +124,9 @@ | |||||||
|       <el-table-column label="项目负责人" align="center" prop="projectLeader" width="100"/> |       <el-table-column label="项目负责人" align="center" prop="projectLeader" width="100"/> | ||||||
|       <el-table-column label="申报状态" align="center" width="100px" :min-width="100"> |       <el-table-column label="申报状态" align="center" width="100px" :min-width="100"> | ||||||
|         <template slot-scope="scope"> |         <template slot-scope="scope"> | ||||||
|           <el-tag size="medium">{{ formatProjectDeclareStatus(scope.row.projectDeclareStatus) }}</el-tag> |           <el-tag size="medium" :type="getTagType(scope.row.projectDeclareStatus)"> | ||||||
|         </template> |             {{ formatProjectDeclareStatus(scope.row.projectDeclareStatus) }} | ||||||
|       </el-table-column> |           </el-tag> | ||||||
|       <el-table-column label="立项状态" align="center" width="100px" :min-width="100"> |  | ||||||
|         <template slot-scope="scope"> |  | ||||||
|           <el-tag size="medium">{{ formatProjectAppStatus(scope.row.projectAppStaus) }}</el-tag> |  | ||||||
|         </template> |         </template> | ||||||
|       </el-table-column> |       </el-table-column> | ||||||
| 
 | 
 | ||||||
| @ -154,7 +151,7 @@ | |||||||
|             icon="el-icon-top" |             icon="el-icon-top" | ||||||
|             @click="handleUpdate(scope.row)" |             @click="handleUpdate(scope.row)" | ||||||
|             v-hasPermi="['project:application:remove']" |             v-hasPermi="['project:application:remove']" | ||||||
|           >申请立项</el-button> |           >申报项目</el-button> | ||||||
|           <el-button |           <el-button | ||||||
|             size="mini" |             size="mini" | ||||||
|             type="text" |             type="text" | ||||||
| @ -327,7 +324,6 @@ export default { | |||||||
|     /** 查询项目申报列表 */ |     /** 查询项目申报列表 */ | ||||||
|     getList() { |     getList() { | ||||||
|       this.loading = true; |       this.loading = true; | ||||||
|       this.queryParams = this.$route.params && this.$route.params.queryParams; |  | ||||||
|       listApplication(this.queryParams).then(response => { |       listApplication(this.queryParams).then(response => { | ||||||
|         this.applicationList = response.rows; |         this.applicationList = response.rows; | ||||||
|         this.total = response.total; |         this.total = response.total; | ||||||
| @ -389,6 +385,12 @@ export default { | |||||||
|         this.title = "修改项目申报"; |         this.title = "修改项目申报"; | ||||||
|         console.log(this.form) |         console.log(this.form) | ||||||
|       }); |       }); | ||||||
|  |     }, | ||||||
|  |     /** | ||||||
|  |      * 根据填写的项目信息进行申报 | ||||||
|  |      */ | ||||||
|  |     declareProject(row){ | ||||||
|  | 
 | ||||||
|     }, |     }, | ||||||
|     /** 修改按钮操作 */ |     /** 修改按钮操作 */ | ||||||
|     handleUpdateBudget(row) { |     handleUpdateBudget(row) { | ||||||
| @ -396,14 +398,6 @@ export default { | |||||||
|       this.reset(); |       this.reset(); | ||||||
|       const upProjectId = row.projectId || this.ids |       const upProjectId = row.projectId || this.ids | ||||||
| 
 | 
 | ||||||
|       // 注释参考代码:用于后续代码修改的参考 |  | ||||||
|       // getApplication(projectId).then(response => { |  | ||||||
|       //   this.loading = false; |  | ||||||
|       //   this.form = response.data; |  | ||||||
|       //   this.open = true; |  | ||||||
|       //   this.title = "修改项目申报"; |  | ||||||
|       // }); |  | ||||||
| 
 |  | ||||||
|       // 查询项目经费追加流程 |       // 查询项目经费追加流程 | ||||||
|       listProcess(this.queryProcParams).then(response => { |       listProcess(this.queryProcParams).then(response => { | ||||||
|         this.processParams = response.rows[0]; |         this.processParams = response.rows[0]; | ||||||
| @ -498,7 +492,7 @@ export default { | |||||||
|     formatProjectDeclareStatus(cellValue) { |     formatProjectDeclareStatus(cellValue) { | ||||||
|       switch (cellValue) { |       switch (cellValue) { | ||||||
|         case '0': |         case '0': | ||||||
|           return "未申报"; |           return "草稿"; | ||||||
|         case '1': |         case '1': | ||||||
|           return "审核中"; |           return "审核中"; | ||||||
|         case '2': |         case '2': | ||||||
| @ -506,6 +500,24 @@ export default { | |||||||
|         default: |         default: | ||||||
|           return "未知状态"; |           return "未知状态"; | ||||||
|       } |       } | ||||||
|  |     }, | ||||||
|  |     getTagType(status) { | ||||||
|  |       switch (status) { | ||||||
|  |         case '2': | ||||||
|  |           // 显示绿色 审核通过绿色 | ||||||
|  |           return 'success'; | ||||||
|  |         case '1': | ||||||
|  |           // 审核中 显示黄色 | ||||||
|  |           return 'warning'; | ||||||
|  |         case '0': | ||||||
|  |           // 未申报, 灰色 | ||||||
|  |           return 'primary'; | ||||||
|  |         case '4': | ||||||
|  |           // 其他状态 灰色 | ||||||
|  |           return 'info'; | ||||||
|  |         default: | ||||||
|  |           return ''; | ||||||
|  |       } | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
| }; | }; | ||||||
|  | |||||||
| @ -142,7 +142,7 @@ export default { | |||||||
|   }, |   }, | ||||||
|   methods: { |   methods: { | ||||||
|     initData() { |     initData() { | ||||||
|       this.taskForm.procInsId = this.$route.params && this.$route.params.handbookProcId; |       this.taskForm.procInsId = this.$route.params && this.$route.params.planProcId; | ||||||
|       this.taskForm.taskId  = this.$route.query && this.$route.query.taskId; |       this.taskForm.taskId  = this.$route.query && this.$route.query.taskId; | ||||||
|       this.processed = this.$route.query && eval(this.$route.query.processed || false); |       this.processed = this.$route.query && eval(this.$route.query.processed || false); | ||||||
| 
 | 
 | ||||||
							
								
								
									
										535
									
								
								ruoyi-ui/src/views/scientific/project_application_plan/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										535
									
								
								ruoyi-ui/src/views/scientific/project_application_plan/index.vue
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,535 @@ | |||||||
|  | <template> | ||||||
|  |   <div class="app-container"> | ||||||
|  |     <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> | ||||||
|  |       <el-form-item label="申报计划名称" prop="handbookName" label-width="100px" > | ||||||
|  |         <el-input | ||||||
|  |           v-model="queryParams.handbookName" | ||||||
|  |           placeholder="请输入申报计划名称" | ||||||
|  |           clearable | ||||||
|  |           @keyup.enter.native="handleQuery" | ||||||
|  |         /> | ||||||
|  |       </el-form-item> | ||||||
|  |       <el-form-item label="申报计划级别" prop="handbookLevel" label-width="100px"> | ||||||
|  |         <el-input | ||||||
|  |           v-model="queryParams.handbookLevel" | ||||||
|  |           placeholder="请输入申报计划级别" | ||||||
|  |           clearable | ||||||
|  |           @keyup.enter.native="handleQuery" | ||||||
|  |         /> | ||||||
|  |       </el-form-item> | ||||||
|  |       <el-form-item label="申报开始日期" prop="projectAppStTime" label-width="100px"> | ||||||
|  |         <el-date-picker clearable | ||||||
|  |           v-model="queryParams.projectAppStTime" | ||||||
|  |           type="date" | ||||||
|  |           value-format="yyyy-MM-dd" | ||||||
|  |           placeholder="请选择申报开始日期"> | ||||||
|  |         </el-date-picker> | ||||||
|  |       </el-form-item> | ||||||
|  |       <el-form-item label="申报结束日期" prop="projectAppEndTime" label-width="100px"> | ||||||
|  |         <el-date-picker clearable | ||||||
|  |           v-model="queryParams.projectAppEndTime" | ||||||
|  |           type="date" | ||||||
|  |           value-format="yyyy-MM-dd" | ||||||
|  |           placeholder="请选择申报结束日期"> | ||||||
|  |         </el-date-picker> | ||||||
|  |       </el-form-item> | ||||||
|  | 
 | ||||||
|  |       <el-form-item> | ||||||
|  |         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> | ||||||
|  |         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> | ||||||
|  |       </el-form-item> | ||||||
|  |     </el-form> | ||||||
|  | 
 | ||||||
|  |     <el-row :gutter="10" class="mb8"> | ||||||
|  |       <el-col :span="1.5"> | ||||||
|  |         <el-button | ||||||
|  |           type="primary" | ||||||
|  |           plain | ||||||
|  |           icon="el-icon-plus" | ||||||
|  |           size="mini" | ||||||
|  |           @click="handleAdd" | ||||||
|  |           v-hasPermi="['scientific:project_application_plan:add']" | ||||||
|  |         >新增</el-button> | ||||||
|  |       </el-col> | ||||||
|  |       <el-col :span="1.5"> | ||||||
|  |         <el-button | ||||||
|  |           type="success" | ||||||
|  |           plain | ||||||
|  |           icon="el-icon-edit" | ||||||
|  |           size="mini" | ||||||
|  |           :disabled="single" | ||||||
|  |           @click="handleUpdate" | ||||||
|  |           v-hasPermi="['scientific:project_application_plan:edit']" | ||||||
|  |         >修改</el-button> | ||||||
|  |       </el-col> | ||||||
|  |       <el-col :span="1.5"> | ||||||
|  |         <el-button | ||||||
|  |           type="danger" | ||||||
|  |           plain | ||||||
|  |           icon="el-icon-delete" | ||||||
|  |           size="mini" | ||||||
|  |           :disabled="multiple" | ||||||
|  |           @click="handleDelete" | ||||||
|  |           v-hasPermi="['scientific:project_application_plan:remove']" | ||||||
|  |         >删除</el-button> | ||||||
|  |       </el-col> | ||||||
|  |       <el-col :span="1.5"> | ||||||
|  |         <el-button | ||||||
|  |           type="warning" | ||||||
|  |           plain | ||||||
|  |           icon="el-icon-download" | ||||||
|  |           size="mini" | ||||||
|  |           @click="handleExport" | ||||||
|  |           v-hasPermi="['scientific:project_application_plan:export']" | ||||||
|  |         >导出</el-button> | ||||||
|  |       </el-col> | ||||||
|  |       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> | ||||||
|  |     </el-row> | ||||||
|  | 
 | ||||||
|  |     <el-table v-loading="loading" :data="handbookList" @selection-change="handleSelectionChange"> | ||||||
|  |       <el-table-column type="selection" width="55" align="center" /> | ||||||
|  |       <el-table-column label="序号" type="index" width="50"></el-table-column> | ||||||
|  |       <el-table-column label="申报计划名称" align="center" prop="handbookName" :min-width="100"/> | ||||||
|  |       <el-table-column label="申报计划级别" align="center" width="100px" :min-width="100"> | ||||||
|  |         <template slot-scope="scope"> | ||||||
|  |           <el-tag size="medium" :type="getTagLevelType(scope.row.handbookLevel)"> | ||||||
|  |             {{ formatHandbookLevel(scope.row.handbookLevel) }} | ||||||
|  |           </el-tag> | ||||||
|  |         </template> | ||||||
|  |       </el-table-column> | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |       <el-table-column label="申报开始日期" align="center" prop="projectAppStTime" width="180"> | ||||||
|  |         <template slot-scope="scope"> | ||||||
|  |           <span>{{ parseTime(scope.row.projectAppStTime, '{y}-{m}-{d}') }}</span> | ||||||
|  |         </template> | ||||||
|  |       </el-table-column> | ||||||
|  |       <el-table-column label="申报结束日期" align="center" prop="projectAppEndTime" width="180"> | ||||||
|  |         <template slot-scope="scope"> | ||||||
|  |           <span>{{ parseTime(scope.row.projectAppEndTime, '{y}-{m}-{d}') }}</span> | ||||||
|  |         </template> | ||||||
|  |       </el-table-column> | ||||||
|  | 
 | ||||||
|  |       <el-table-column label="已申报项目" align="center" prop="projectAppStTime" width="180"> | ||||||
|  |         <template slot-scope="scope"> | ||||||
|  |           <el-button plain | ||||||
|  |             size="mini" | ||||||
|  |             @click="listProjectInHandbook(scope.row.handbookId)" | ||||||
|  |             v-hasPermi="['scientific:project_application_plan:list']" | ||||||
|  |           >{{ scope.row.nProject }}</el-button> | ||||||
|  |         </template> | ||||||
|  |       </el-table-column> | ||||||
|  | 
 | ||||||
|  |       <el-table-column label="申报状态" align="center" width="100px" :min-width="100"> | ||||||
|  |         <template slot-scope="scope"> | ||||||
|  |           <el-tag size="medium" :type="getTagType(isCurrentDateInRange(scope.row.projectAppStTime, scope.row.projectAppEndTime))"> | ||||||
|  |             {{ isCurrentDateInRange(scope.row.projectAppStTime, scope.row.projectAppEndTime) }} | ||||||
|  |           </el-tag> | ||||||
|  |         </template> | ||||||
|  |       </el-table-column> | ||||||
|  | 
 | ||||||
|  |       <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> | ||||||
|  |         <template slot-scope="scope"> | ||||||
|  |           <el-button | ||||||
|  |             type="primary" | ||||||
|  |             icon="el-icon-top" | ||||||
|  |             size="mini" | ||||||
|  |             @click="handbookDetail(scope.row)" | ||||||
|  |             v-hasPermi="['scientific:project_application_plan:list']" | ||||||
|  |           >查看计划</el-button> | ||||||
|  | 
 | ||||||
|  |           <el-button | ||||||
|  |             type="primary" | ||||||
|  |             icon="el-icon-top" | ||||||
|  |             size="mini" | ||||||
|  |             @click="projectApply(scope.row)" | ||||||
|  |             :disabled="isCurrentDateInRange(scope.row.projectAppStTime, scope.row.projectAppEndTime) !== '申报中'" | ||||||
|  |             v-hasPermi="['scientific:project_application_plan:list']" | ||||||
|  |           >进入申报</el-button> | ||||||
|  | 
 | ||||||
|  |         </template> | ||||||
|  |       </el-table-column> | ||||||
|  |     </el-table> | ||||||
|  | 
 | ||||||
|  |     <pagination | ||||||
|  |       v-show="total>0" | ||||||
|  |       :total="total" | ||||||
|  |       :page.sync="queryParams.pageNum" | ||||||
|  |       :limit.sync="queryParams.pageSize" | ||||||
|  |       @pagination="getList" | ||||||
|  |     /> | ||||||
|  | 
 | ||||||
|  |     <!-- 添加或修改项目申报v2对话框 --> | ||||||
|  |     <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> | ||||||
|  |       <el-form ref="form" :model="form" :rules="rules" label-width="80px"> | ||||||
|  |         <el-form-item label="申报信息名称" prop="handbookName"> | ||||||
|  |           <el-input v-model="form.handbookName" placeholder="请输入申报信息名称" /> | ||||||
|  |         </el-form-item> | ||||||
|  |         <el-form-item label="项目立项流程实例Id" prop="handbookProcId"> | ||||||
|  |           <el-input v-model="form.handbookProcId" placeholder="请输入项目立项流程实例Id" /> | ||||||
|  |         </el-form-item> | ||||||
|  |         <el-form-item label="项目指南级别(0市级 1区级 3省级 4国家级)" prop="handbookLevel"> | ||||||
|  |           <el-input v-model="form.handbookLevel" placeholder="请输入项目指南级别(0市级 1区级 3省级 4国家级)" /> | ||||||
|  |         </el-form-item> | ||||||
|  |         <el-form-item label="申报开始日期" prop="projectAppStTime"> | ||||||
|  |           <el-date-picker clearable | ||||||
|  |             v-model="form.projectAppStTime" | ||||||
|  |             type="datetime" | ||||||
|  |             value-format="yyyy-MM-dd HH:mm:ss" | ||||||
|  |             placeholder="请选择申报开始日期"> | ||||||
|  |           </el-date-picker> | ||||||
|  |         </el-form-item> | ||||||
|  |         <el-form-item label="申报结束日期" prop="projectAppEndTime"> | ||||||
|  |           <el-date-picker clearable | ||||||
|  |             v-model="form.projectAppEndTime" | ||||||
|  |             type="datetime" | ||||||
|  |             value-format="yyyy-MM-dd HH:mm:ss" | ||||||
|  |             placeholder="请选择申报结束日期"> | ||||||
|  |           </el-date-picker> | ||||||
|  |         </el-form-item> | ||||||
|  | 
 | ||||||
|  |       </el-form> | ||||||
|  |       <div slot="footer" class="dialog-footer"> | ||||||
|  |         <el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button> | ||||||
|  |         <el-button @click="cancel">取 消</el-button> | ||||||
|  |       </div> | ||||||
|  |     </el-dialog> | ||||||
|  |   </div> | ||||||
|  | </template> | ||||||
|  | 
 | ||||||
|  | <script> | ||||||
|  | import { listPlan, getPlan, delPlan, addPlan, updatePlan } from "@/api/scientific/project_application_plan"; | ||||||
|  | import { listProcess } from '@/api/workflow/process' | ||||||
|  | import { listApplication } from '@/api/scientific/application' | ||||||
|  | 
 | ||||||
|  | export default { | ||||||
|  |   name: "Handbook", | ||||||
|  |   data() { | ||||||
|  |     return { | ||||||
|  |       // 按钮loading | ||||||
|  |       buttonLoading: false, | ||||||
|  |       // 遮罩层 | ||||||
|  |       loading: true, | ||||||
|  |       // 选中数组 | ||||||
|  |       ids: [], | ||||||
|  |       // 非单个禁用 | ||||||
|  |       single: true, | ||||||
|  |       // 非多个禁用 | ||||||
|  |       multiple: true, | ||||||
|  |       // 显示搜索条件 | ||||||
|  |       showSearch: true, | ||||||
|  |       // 总条数 | ||||||
|  |       total: 0, | ||||||
|  |       // 项目申报v2表格数据 | ||||||
|  |       handbookList: [], | ||||||
|  |       // 弹出层标题 | ||||||
|  |       title: "", | ||||||
|  |       // 是否显示弹出层 | ||||||
|  |       open: false, | ||||||
|  |       // 查询参数 | ||||||
|  |       queryParams: { | ||||||
|  |         pageNum: 1, | ||||||
|  |         pageSize: 10, | ||||||
|  |         handbookName: undefined, | ||||||
|  |         handbookProcId: undefined, | ||||||
|  |         handbookStatus: "3", | ||||||
|  |         handbookType: undefined, | ||||||
|  |         handbookLevel: undefined, | ||||||
|  |         declareStatus: undefined, | ||||||
|  |         projectAppStTime: undefined, | ||||||
|  |         projectAppEndTime: undefined, | ||||||
|  |         handbookLeader: undefined, | ||||||
|  |         projectLeaderPhone: undefined, | ||||||
|  |       }, | ||||||
|  |       // 表单参数 | ||||||
|  |       form: {}, | ||||||
|  |       // 表单校验 | ||||||
|  |       rules: { | ||||||
|  |         handbookId: [ | ||||||
|  |           { required: true, message: "项目ID不能为空", trigger: "blur" } | ||||||
|  |         ], | ||||||
|  |         handbookName: [ | ||||||
|  |           { required: true, message: "申报信息名称不能为空", trigger: "blur" } | ||||||
|  |         ], | ||||||
|  |         handbookProcId: [ | ||||||
|  |           { required: true, message: "项目立项流程实例Id不能为空", trigger: "blur" } | ||||||
|  |         ], | ||||||
|  |         handbookLevel: [ | ||||||
|  |           { required: true, message: "项目指南级别(0市级 1区级 3省级 4国家级)不能为空", trigger: "blur" } | ||||||
|  |         ], | ||||||
|  |         declareStatus: [ | ||||||
|  |           { required: true, message: "申报状态(0 停止申报 1 申报中)不能为空", trigger: "change" } | ||||||
|  |         ], | ||||||
|  |         projectAppStTime: [ | ||||||
|  |           { required: true, message: "申报开始日期不能为空", trigger: "blur" } | ||||||
|  |         ], | ||||||
|  |         projectAppEndTime: [ | ||||||
|  |           { required: true, message: "申报结束日期不能为空", trigger: "blur" } | ||||||
|  |         ], | ||||||
|  |       } | ||||||
|  |     }; | ||||||
|  |   }, | ||||||
|  |   created() { | ||||||
|  |     this.getList(); | ||||||
|  |   }, | ||||||
|  |   methods: { | ||||||
|  |     /** 查询项目申报v2列表 */ | ||||||
|  |     getList() { | ||||||
|  |       this.loading = true; | ||||||
|  |       listPlan(this.queryParams).then(response => { | ||||||
|  |         this.handbookList = response.rows; | ||||||
|  |         this.total = response.total; | ||||||
|  |         // 使用Promise.all来处理异步操作 | ||||||
|  |         const promises = this.handbookList.map(item => { | ||||||
|  |           const queryParams = { | ||||||
|  |             pageNum: 1, | ||||||
|  |               pageSize: 10, | ||||||
|  |               projectHandbookId: item.handbookId, | ||||||
|  |           }; | ||||||
|  |           listApplication(queryParams).then(res => { | ||||||
|  |             // zqjia:后续考虑是否保存整个res的信息 | ||||||
|  |             this.$set(item, "nProject", res.total); | ||||||
|  |           }); | ||||||
|  |         }); | ||||||
|  | 
 | ||||||
|  |         Promise.all(promises).then(() => { | ||||||
|  |           // 所有异步操作完成后,更新loading状态 | ||||||
|  |           this.loading = false; | ||||||
|  |         }); | ||||||
|  |       }); | ||||||
|  |     }, | ||||||
|  | 
 | ||||||
|  |     // 取消按钮 | ||||||
|  |     cancel() { | ||||||
|  |       this.open = false; | ||||||
|  |       this.reset(); | ||||||
|  |     }, | ||||||
|  |     // 表单重置 | ||||||
|  |     reset() { | ||||||
|  |       this.form = { | ||||||
|  |         handbookId: undefined, | ||||||
|  |         handbookName: undefined, | ||||||
|  |         handbookProcId: undefined, | ||||||
|  |         handbookStatus: undefined, | ||||||
|  |         handbookType: undefined, | ||||||
|  |         handbookLevel: undefined, | ||||||
|  |         declareStatus: undefined, | ||||||
|  |         projectAppStTime: undefined, | ||||||
|  |         projectAppEndTime: undefined, | ||||||
|  |         handbookLeader: undefined, | ||||||
|  |         projectLeaderPhone: undefined, | ||||||
|  |         createBy: undefined, | ||||||
|  |         createTime: undefined, | ||||||
|  |         updateBy: undefined, | ||||||
|  |         updateTime: undefined | ||||||
|  |       }; | ||||||
|  |       this.resetForm("form"); | ||||||
|  |     }, | ||||||
|  |     /** 搜索按钮操作 */ | ||||||
|  |     handleQuery() { | ||||||
|  |       this.queryParams.pageNum = 1; | ||||||
|  |       this.getList(); | ||||||
|  |     }, | ||||||
|  |     /** 重置按钮操作 */ | ||||||
|  |     resetQuery() { | ||||||
|  |       this.resetForm("queryForm"); | ||||||
|  |       this.handleQuery(); | ||||||
|  |     }, | ||||||
|  |     // 多选框选中数据 | ||||||
|  |     handleSelectionChange(selection) { | ||||||
|  |       this.ids = selection.map(item => item.handbookId) | ||||||
|  |       this.single = selection.length!==1 | ||||||
|  |       this.multiple = !selection.length | ||||||
|  |     }, | ||||||
|  |     /** 新增按钮操作 */ | ||||||
|  |     handleAdd() { | ||||||
|  |       this.reset(); | ||||||
|  |       this.open = true; | ||||||
|  |       this.title = "添加项目申报v2"; | ||||||
|  |     }, | ||||||
|  |     /** 修改按钮操作 */ | ||||||
|  |     handleUpdate(row) { | ||||||
|  |       this.loading = true; | ||||||
|  |       this.reset(); | ||||||
|  |       const handbookId = row.handbookId || this.ids | ||||||
|  |       getPlan(handbookId).then(response => { | ||||||
|  |         this.loading = false; | ||||||
|  |         this.form = response.data; | ||||||
|  |         this.open = true; | ||||||
|  |         this.title = "修改项目申报v2"; | ||||||
|  |       }); | ||||||
|  |     }, | ||||||
|  |     /** 提交按钮 */ | ||||||
|  |     submitForm() { | ||||||
|  |       this.$refs["form"].validate(valid => { | ||||||
|  |         if (valid) { | ||||||
|  |           this.buttonLoading = true; | ||||||
|  |           if (this.form.handbookId != null) { | ||||||
|  |             updatePlan(this.form).then(response => { | ||||||
|  |               this.$modal.msgSuccess("修改成功"); | ||||||
|  |               this.open = false; | ||||||
|  |               this.getList(); | ||||||
|  |             }).finally(() => { | ||||||
|  |               this.buttonLoading = false; | ||||||
|  |             }); | ||||||
|  |           } else { | ||||||
|  |             addPlan(this.form).then(response => { | ||||||
|  |               this.$modal.msgSuccess("新增成功"); | ||||||
|  |               this.open = false; | ||||||
|  |               this.getList(); | ||||||
|  |             }).finally(() => { | ||||||
|  |               this.buttonLoading = false; | ||||||
|  |             }); | ||||||
|  |           } | ||||||
|  |         } | ||||||
|  |       }); | ||||||
|  |     }, | ||||||
|  |     /** 删除按钮操作 */ | ||||||
|  |     handleDelete(row) { | ||||||
|  |       const handbookIds = row.handbookId || this.ids; | ||||||
|  |       this.$modal.confirm('是否确认删除项目申报v2编号为"' + handbookIds + '"的数据项?').then(() => { | ||||||
|  |         this.loading = true; | ||||||
|  |         return delPlan(handbookIds); | ||||||
|  |       }).then(() => { | ||||||
|  |         this.loading = false; | ||||||
|  |         this.getList(); | ||||||
|  |         this.$modal.msgSuccess("删除成功"); | ||||||
|  |       }).catch(() => { | ||||||
|  |       }).finally(() => { | ||||||
|  |         this.loading = false; | ||||||
|  |       }); | ||||||
|  |     }, | ||||||
|  |     /** 导出按钮操作 */ | ||||||
|  |     handleExport() { | ||||||
|  |       this.download('scientific/project_application_plan/export', { | ||||||
|  |         ...this.queryParams | ||||||
|  |       }, `handbook_${new Date().getTime()}.xlsx`) | ||||||
|  |     }, | ||||||
|  |         /** | ||||||
|  |      * 把项目状态的申报code转换为文字: 0 : 未申报  1: 审核中  2: 已申报 | ||||||
|  |      * @param   {number|string} cellValue - 原始数值 | ||||||
|  |      * @returns {string} 转换后的字符串 | ||||||
|  |      * @author  zhanli | ||||||
|  |      */ | ||||||
|  | 
 | ||||||
|  |     formatHandbookLevel(cellValue) { | ||||||
|  |       switch (cellValue) { | ||||||
|  |         case '1': | ||||||
|  |           return "国家级"; | ||||||
|  |         case '2': | ||||||
|  |           return "省级"; | ||||||
|  |         case '3': | ||||||
|  |           return "市级"; | ||||||
|  |         case '4': | ||||||
|  |           return "院级"; | ||||||
|  |         default: | ||||||
|  |           return "未知"; | ||||||
|  |       } | ||||||
|  |     }, | ||||||
|  |     getTagType(status) { | ||||||
|  |       switch (status) { | ||||||
|  |         case '已结束': | ||||||
|  |           // 显示红色 停止申报 | ||||||
|  |           return 'danger'; | ||||||
|  |         case '申报中': | ||||||
|  |           // 审核中 显示绿色 | ||||||
|  |           return 'success'; | ||||||
|  |         case '未开始': | ||||||
|  |           // 未申报, 灰色 | ||||||
|  |           return 'info'; | ||||||
|  |         default: | ||||||
|  |           return ''; | ||||||
|  |       } | ||||||
|  |     }, | ||||||
|  |     getTagLevelType(status) { | ||||||
|  |       switch (status) { | ||||||
|  |         case '2': | ||||||
|  |           // 省级 蓝色 | ||||||
|  |           return 'primary'; | ||||||
|  |         case '3': | ||||||
|  |           // 市级 显示绿色 | ||||||
|  |           return 'success'; | ||||||
|  |         case '4': | ||||||
|  |           // 院级, 灰色 | ||||||
|  |           return 'info'; | ||||||
|  |         case '1': | ||||||
|  |           // 国家级 红色 | ||||||
|  |           return 'danger'; | ||||||
|  |         default: | ||||||
|  |           return ''; | ||||||
|  |       } | ||||||
|  |     }, | ||||||
|  |     isCurrentDateInRange(startDate, endDate) { | ||||||
|  |       // 获取当前时间 | ||||||
|  |       const currentDate = new Date(); | ||||||
|  | 
 | ||||||
|  |       // 将字符串日期转换为Date对象 | ||||||
|  |       const start = new Date(startDate); | ||||||
|  |       const end = new Date(endDate); | ||||||
|  | 
 | ||||||
|  |       // 判断当前时间是否在范围内 | ||||||
|  |       if(currentDate >= start && currentDate <= end) { | ||||||
|  |         return "申报中"; | ||||||
|  |       } | ||||||
|  |       else { | ||||||
|  |         if(currentDate < start) { | ||||||
|  |           return "未开始"; | ||||||
|  |         } | ||||||
|  |         else { | ||||||
|  |           return "已结束"; | ||||||
|  |         } | ||||||
|  |       } | ||||||
|  |     }, | ||||||
|  |     projectApply(row) { | ||||||
|  |       let queryParams = { | ||||||
|  |         pageNum: 1, | ||||||
|  |         pageSize: 10, | ||||||
|  |         processKey: undefined, | ||||||
|  |         processName: "项目申报", | ||||||
|  |         category: "002" | ||||||
|  |       }; | ||||||
|  | 
 | ||||||
|  |       // 跳转到项目申报 | ||||||
|  |       listProcess(queryParams).then(response => { | ||||||
|  |         const apply = response.rows[0]; | ||||||
|  |         if(apply) { | ||||||
|  |           this.$router.push({ | ||||||
|  |             name: 'ProjectApply', | ||||||
|  |             params: { | ||||||
|  |               deployId: apply.deploymentId, | ||||||
|  |               definitionId: apply.definitionId, | ||||||
|  |               row: row | ||||||
|  |             } | ||||||
|  |           }) | ||||||
|  |         } | ||||||
|  |       }); | ||||||
|  |     }, | ||||||
|  |     listProjectInHandbook(handbookId) { | ||||||
|  |       if (handbookId === undefined) { | ||||||
|  |         handbookId = 1; | ||||||
|  |       } | ||||||
|  |       let queryParams = { | ||||||
|  |         pageNum: 1, | ||||||
|  |         pageSize: 10, | ||||||
|  |         projectHandbookId: handbookId, | ||||||
|  |       }; | ||||||
|  |       this.$router.push({ | ||||||
|  |         name: 'planProjectQuery', | ||||||
|  |         params: { | ||||||
|  |           planId: handbookId, | ||||||
|  |           queryParams: queryParams, | ||||||
|  |         } | ||||||
|  |       }) | ||||||
|  |     }, | ||||||
|  |     handbookDetail(row) { | ||||||
|  |       console.log('/scientific/project_application_plan/detail/' + row.handbookProcId) | ||||||
|  |       this.$router.push({ | ||||||
|  |         path: '/scientific/project_application_plan/detail/' + row.handbookProcId, | ||||||
|  |         query: { | ||||||
|  |           processed: false, | ||||||
|  |         } | ||||||
|  |       }) | ||||||
|  |     }, | ||||||
|  |   } | ||||||
|  | }; | ||||||
|  | </script> | ||||||
| @ -19,7 +19,7 @@ import { listProcess, startProcess_ } from '@/api/workflow/process' | |||||||
| import { listAllCategory } from '@/api/workflow/category' | import { listAllCategory } from '@/api/workflow/category' | ||||||
| import { getProcessForm, startProcess } from '@/api/workflow/process' | import { getProcessForm, startProcess } from '@/api/workflow/process' | ||||||
| import Parser from '@/utils/generator/parser' | import Parser from '@/utils/generator/parser' | ||||||
| import { addHandbook } from '@/api/scientific/handbook' | import { addPlan } from '@/api/scientific/project_application_plan' | ||||||
| 
 | 
 | ||||||
| export default { | export default { | ||||||
|   name: 'handbookApply', |   name: 'handbookApply', | ||||||
| @ -127,7 +127,7 @@ export default { | |||||||
|             handbookData.handbookFile = JSON.stringify(formatedFiles); |             handbookData.handbookFile = JSON.stringify(formatedFiles); | ||||||
|           } |           } | ||||||
| 
 | 
 | ||||||
|           addHandbook(JSON.stringify(handbookData)).then(resp => { |           addPlan(JSON.stringify(handbookData)).then(resp => { | ||||||
|             if (res.code !== 200) { |             if (res.code !== 200) { | ||||||
|               this.$modal.msgError("操作失败"); |               this.$modal.msgError("操作失败"); | ||||||
|               return; |               return; | ||||||
| @ -0,0 +1,108 @@ | |||||||
|  | package com.ruoyi.scientific.controller; | ||||||
|  | 
 | ||||||
|  | import java.util.List; | ||||||
|  | import java.util.Arrays; | ||||||
|  | import java.util.concurrent.TimeUnit; | ||||||
|  | 
 | ||||||
|  | import lombok.RequiredArgsConstructor; | ||||||
|  | import javax.servlet.http.HttpServletResponse; | ||||||
|  | import javax.validation.constraints.*; | ||||||
|  | import cn.dev33.satoken.annotation.SaCheckPermission; | ||||||
|  | import org.springframework.web.bind.annotation.*; | ||||||
|  | import org.springframework.validation.annotation.Validated; | ||||||
|  | import com.ruoyi.common.annotation.RepeatSubmit; | ||||||
|  | import com.ruoyi.common.annotation.Log; | ||||||
|  | import com.ruoyi.common.core.controller.BaseController; | ||||||
|  | import com.ruoyi.common.core.domain.PageQuery; | ||||||
|  | import com.ruoyi.common.core.domain.R; | ||||||
|  | import com.ruoyi.common.core.validate.AddGroup; | ||||||
|  | import com.ruoyi.common.core.validate.EditGroup; | ||||||
|  | import com.ruoyi.common.core.validate.QueryGroup; | ||||||
|  | import com.ruoyi.common.enums.BusinessType; | ||||||
|  | import com.ruoyi.common.utils.poi.ExcelUtil; | ||||||
|  | import com.ruoyi.scientific.domain.vo.HandbookVo; | ||||||
|  | import com.ruoyi.scientific.domain.bo.HandbookBo; | ||||||
|  | import com.ruoyi.scientific.service.IHandbookService; | ||||||
|  | import com.ruoyi.common.core.page.TableDataInfo; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * 项目申报指南 | ||||||
|  |  * | ||||||
|  |  * @author zqjia | ||||||
|  |  * @date 2024-07-29 | ||||||
|  |  */ | ||||||
|  | @Validated | ||||||
|  | @RequiredArgsConstructor | ||||||
|  | @RestController | ||||||
|  | @RequestMapping("/scientific/handbook1") | ||||||
|  | public class HandbookController extends BaseController { | ||||||
|  | 
 | ||||||
|  |     private final IHandbookService iHandbookService; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 查询项目申报指南列表 | ||||||
|  |      */ | ||||||
|  |     @SaCheckPermission("scientific:handbook1:list") | ||||||
|  |     @GetMapping("/list") | ||||||
|  |     public TableDataInfo<HandbookVo> list(HandbookBo bo, PageQuery pageQuery) { | ||||||
|  |         return iHandbookService.queryPageList(bo, pageQuery); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 导出项目申报指南列表 | ||||||
|  |      */ | ||||||
|  |     @SaCheckPermission("scientific:handbook1:export") | ||||||
|  |     @Log(title = "项目申报指南", businessType = BusinessType.EXPORT) | ||||||
|  |     @PostMapping("/export") | ||||||
|  |     public void export(HandbookBo bo, HttpServletResponse response) { | ||||||
|  |         List<HandbookVo> list = iHandbookService.queryList(bo); | ||||||
|  |         ExcelUtil.exportExcel(list, "项目申报指南", HandbookVo.class, response); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 获取项目申报指南详细信息 | ||||||
|  |      * | ||||||
|  |      * @param handbookId 主键 | ||||||
|  |      */ | ||||||
|  |     @SaCheckPermission("scientific:handbook1:query") | ||||||
|  |     @GetMapping("/{handbookId}") | ||||||
|  |     public R<HandbookVo> getInfo(@NotNull(message = "主键不能为空") | ||||||
|  |                                      @PathVariable Long handbookId) { | ||||||
|  |         return R.ok(iHandbookService.queryById(handbookId)); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 新增项目申报指南 | ||||||
|  |      */ | ||||||
|  |     @SaCheckPermission("scientific:handbook1:add") | ||||||
|  |     @Log(title = "项目申报指南", businessType = BusinessType.INSERT) | ||||||
|  |     @RepeatSubmit() | ||||||
|  |     @PostMapping() | ||||||
|  |     public R<Void> add(@Validated(AddGroup.class) @RequestBody HandbookBo bo) { | ||||||
|  |         return toAjax(iHandbookService.insertByBo(bo)); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 修改项目申报指南 | ||||||
|  |      */ | ||||||
|  |     @SaCheckPermission("scientific:handbook1:edit") | ||||||
|  |     @Log(title = "项目申报指南", businessType = BusinessType.UPDATE) | ||||||
|  |     @RepeatSubmit() | ||||||
|  |     @PutMapping() | ||||||
|  |     public R<Void> edit(@Validated(EditGroup.class) @RequestBody HandbookBo bo) { | ||||||
|  |         return toAjax(iHandbookService.updateByBo(bo)); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 删除项目申报指南 | ||||||
|  |      * | ||||||
|  |      * @param handbookIds 主键串 | ||||||
|  |      */ | ||||||
|  |     @SaCheckPermission("scientific:handbook1:remove") | ||||||
|  |     @Log(title = "项目申报指南", businessType = BusinessType.DELETE) | ||||||
|  |     @DeleteMapping("/{handbookIds}") | ||||||
|  |     public R<Void> remove(@NotEmpty(message = "主键不能为空") | ||||||
|  |                           @PathVariable Long[] handbookIds) { | ||||||
|  |         return toAjax(iHandbookService.deleteWithValidByIds(Arrays.asList(handbookIds), true)); | ||||||
|  |     } | ||||||
|  | } | ||||||
| @ -42,7 +42,7 @@ public class ProjectApplicationController extends BaseController { | |||||||
|     /** |     /** | ||||||
|      * 查询项目申报列表 |      * 查询项目申报列表 | ||||||
|      */ |      */ | ||||||
|     @SaCheckPermission("scientific:application:list") | //    @SaCheckPermission("scientific:application:list") | ||||||
|     @GetMapping("/list") |     @GetMapping("/list") | ||||||
|     public TableDataInfo<ProjectApplicationVo> list(ProjectApplicationBo bo, PageQuery pageQuery) { |     public TableDataInfo<ProjectApplicationVo> list(ProjectApplicationBo bo, PageQuery pageQuery) { | ||||||
|         return iProjectApplicationService.queryPageList(bo, pageQuery); |         return iProjectApplicationService.queryPageList(bo, pageQuery); | ||||||
|  | |||||||
| @ -34,7 +34,7 @@ import com.ruoyi.common.core.page.TableDataInfo; | |||||||
| @Validated | @Validated | ||||||
| @RequiredArgsConstructor | @RequiredArgsConstructor | ||||||
| @RestController | @RestController | ||||||
| @RequestMapping("/scientific/handbook") | @RequestMapping("/scientific/plan") | ||||||
| public class ProjectHandbookController extends BaseController { | public class ProjectHandbookController extends BaseController { | ||||||
| 
 | 
 | ||||||
|     private final IProjectHandbookService iProjectHandbookService; |     private final IProjectHandbookService iProjectHandbookService; | ||||||
| @ -42,7 +42,7 @@ public class ProjectHandbookController extends BaseController { | |||||||
|     /** |     /** | ||||||
|      * 查询项目申报v2列表 |      * 查询项目申报v2列表 | ||||||
|      */ |      */ | ||||||
|     @SaCheckPermission("scientific:handbook:list") |     @SaCheckPermission("scientific:project_application_plan:list") | ||||||
|     @GetMapping("/list") |     @GetMapping("/list") | ||||||
|     public TableDataInfo<ProjectHandbookVo> list(ProjectHandbookBo bo, PageQuery pageQuery) { |     public TableDataInfo<ProjectHandbookVo> list(ProjectHandbookBo bo, PageQuery pageQuery) { | ||||||
|         return iProjectHandbookService.queryPageList(bo, pageQuery); |         return iProjectHandbookService.queryPageList(bo, pageQuery); | ||||||
| @ -51,7 +51,7 @@ public class ProjectHandbookController extends BaseController { | |||||||
|     /** |     /** | ||||||
|      * 导出项目申报v2列表 |      * 导出项目申报v2列表 | ||||||
|      */ |      */ | ||||||
|     @SaCheckPermission("scientific:handbook:export") |     @SaCheckPermission("scientific:plan:export") | ||||||
|     @Log(title = "项目申报v2", businessType = BusinessType.EXPORT) |     @Log(title = "项目申报v2", businessType = BusinessType.EXPORT) | ||||||
|     @PostMapping("/export") |     @PostMapping("/export") | ||||||
|     public void export(ProjectHandbookBo bo, HttpServletResponse response) { |     public void export(ProjectHandbookBo bo, HttpServletResponse response) { | ||||||
| @ -64,7 +64,7 @@ public class ProjectHandbookController extends BaseController { | |||||||
|      * |      * | ||||||
|      * @param handbookId 主键 |      * @param handbookId 主键 | ||||||
|      */ |      */ | ||||||
|     @SaCheckPermission("scientific:handbook:query") |     @SaCheckPermission("scientific:plan:query") | ||||||
|     @GetMapping("/{handbookId}") |     @GetMapping("/{handbookId}") | ||||||
|     public R<ProjectHandbookVo> getInfo(@NotNull(message = "主键不能为空") |     public R<ProjectHandbookVo> getInfo(@NotNull(message = "主键不能为空") | ||||||
|                                      @PathVariable Long handbookId) { |                                      @PathVariable Long handbookId) { | ||||||
| @ -74,7 +74,7 @@ public class ProjectHandbookController extends BaseController { | |||||||
|     /** |     /** | ||||||
|      * 新增项目申报v2 |      * 新增项目申报v2 | ||||||
|      */ |      */ | ||||||
|     @SaCheckPermission("scientific:handbook:add") |     @SaCheckPermission("scientific:plan:add") | ||||||
|     @Log(title = "项目申报v2", businessType = BusinessType.INSERT) |     @Log(title = "项目申报v2", businessType = BusinessType.INSERT) | ||||||
|     @RepeatSubmit() |     @RepeatSubmit() | ||||||
|     @PostMapping() |     @PostMapping() | ||||||
| @ -85,7 +85,7 @@ public class ProjectHandbookController extends BaseController { | |||||||
|     /** |     /** | ||||||
|      * 修改项目申报v2 |      * 修改项目申报v2 | ||||||
|      */ |      */ | ||||||
|     @SaCheckPermission("scientific:handbook:edit") |     @SaCheckPermission("scientific:plan:edit") | ||||||
|     @Log(title = "项目申报v2", businessType = BusinessType.UPDATE) |     @Log(title = "项目申报v2", businessType = BusinessType.UPDATE) | ||||||
|     @RepeatSubmit() |     @RepeatSubmit() | ||||||
|     @PutMapping() |     @PutMapping() | ||||||
| @ -98,7 +98,7 @@ public class ProjectHandbookController extends BaseController { | |||||||
|      * |      * | ||||||
|      * @param handbookIds 主键串 |      * @param handbookIds 主键串 | ||||||
|      */ |      */ | ||||||
|     @SaCheckPermission("scientific:handbook:remove") |     @SaCheckPermission("scientific:plan:remove") | ||||||
|     @Log(title = "项目申报v2", businessType = BusinessType.DELETE) |     @Log(title = "项目申报v2", businessType = BusinessType.DELETE) | ||||||
|     @DeleteMapping("/{handbookIds}") |     @DeleteMapping("/{handbookIds}") | ||||||
|     public R<Void> remove(@NotEmpty(message = "主键不能为空") |     public R<Void> remove(@NotEmpty(message = "主键不能为空") | ||||||
|  | |||||||
| @ -0,0 +1,65 @@ | |||||||
|  | package com.ruoyi.scientific.domain; | ||||||
|  | 
 | ||||||
|  | import com.baomidou.mybatisplus.annotation.*; | ||||||
|  | import lombok.Data; | ||||||
|  | import lombok.EqualsAndHashCode; | ||||||
|  | import java.io.Serializable; | ||||||
|  | import java.util.Date; | ||||||
|  | import java.math.BigDecimal; | ||||||
|  | 
 | ||||||
|  | import java.util.Date; | ||||||
|  | import com.fasterxml.jackson.annotation.JsonFormat; | ||||||
|  | import com.ruoyi.common.core.domain.BaseEntity; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * 项目申报指南对象 handbook | ||||||
|  |  * | ||||||
|  |  * @author zqjia | ||||||
|  |  * @date 2024-07-29 | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | @EqualsAndHashCode(callSuper = true) | ||||||
|  | @TableName("handbook") | ||||||
|  | public class Handbook extends BaseEntity { | ||||||
|  | 
 | ||||||
|  |     private static final long serialVersionUID=1L; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 项目ID | ||||||
|  |      */ | ||||||
|  |     @TableId(value = "handbook_id") | ||||||
|  |     private Long handbookId; | ||||||
|  |     /** | ||||||
|  |      * 指南名称 | ||||||
|  |      */ | ||||||
|  |     private String handbookName; | ||||||
|  |     /** | ||||||
|  |      * 指南分类 | ||||||
|  |      */ | ||||||
|  |     private String handbookCategory; | ||||||
|  |     /** | ||||||
|  |      * 指南级别(4院级 3市级 2省级 1国家级) | ||||||
|  |      */ | ||||||
|  |     private String handbookLevel; | ||||||
|  |     /** | ||||||
|  |      * 发布时间 | ||||||
|  |      */ | ||||||
|  |     private Date handbookDate; | ||||||
|  |     /** | ||||||
|  |      * 备注 | ||||||
|  |      */ | ||||||
|  |     private String handbookNote; | ||||||
|  |     /** | ||||||
|  |      * 指南文件 | ||||||
|  |      */ | ||||||
|  |     private String handbookFile; | ||||||
|  |     /** | ||||||
|  |      * 指南录入流程实例Id | ||||||
|  |      */ | ||||||
|  |     private String handbookProcId; | ||||||
|  |     /** | ||||||
|  |      * 指南录入流程状态(0未发起审核 1审核中 2审核失败 3审核通过) | ||||||
|  |      */ | ||||||
|  |     private String handbookStatus; | ||||||
|  | 
 | ||||||
|  | } | ||||||
| @ -0,0 +1,81 @@ | |||||||
|  | package com.ruoyi.scientific.domain.bo; | ||||||
|  | 
 | ||||||
|  | import com.ruoyi.common.core.validate.AddGroup; | ||||||
|  | import com.ruoyi.common.core.validate.EditGroup; | ||||||
|  | import lombok.Data; | ||||||
|  | import lombok.EqualsAndHashCode; | ||||||
|  | import javax.validation.constraints.*; | ||||||
|  | 
 | ||||||
|  | import java.util.Date; | ||||||
|  | 
 | ||||||
|  | import java.util.Date; | ||||||
|  | import com.fasterxml.jackson.annotation.JsonFormat; | ||||||
|  | import com.ruoyi.common.core.domain.BaseEntity; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * 项目申报指南业务对象 handbook | ||||||
|  |  * | ||||||
|  |  * @author zqjia | ||||||
|  |  * @date 2024-07-29 | ||||||
|  |  */ | ||||||
|  | 
 | ||||||
|  | @Data | ||||||
|  | @EqualsAndHashCode(callSuper = true) | ||||||
|  | public class HandbookBo extends BaseEntity { | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 项目ID | ||||||
|  |      */ | ||||||
|  |     @NotNull(message = "项目ID不能为空", groups = { EditGroup.class }) | ||||||
|  |     private Long handbookId; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 指南名称 | ||||||
|  |      */ | ||||||
|  |     @NotBlank(message = "指南名称不能为空", groups = { AddGroup.class, EditGroup.class }) | ||||||
|  |     private String handbookName; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 指南分类 | ||||||
|  |      */ | ||||||
|  |     @NotBlank(message = "指南分类不能为空", groups = { AddGroup.class, EditGroup.class }) | ||||||
|  |     private String handbookCategory; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 指南级别(4院级 3市级 2省级 1国家级) | ||||||
|  |      */ | ||||||
|  |     @NotBlank(message = "指南级别(4院级 3市级 2省级 1国家级)不能为空", groups = { AddGroup.class, EditGroup.class }) | ||||||
|  |     private String handbookLevel; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 发布时间 | ||||||
|  |      */ | ||||||
|  |     @NotNull(message = "发布时间不能为空", groups = { AddGroup.class, EditGroup.class }) | ||||||
|  |     private Date handbookDate; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 备注 | ||||||
|  |      */ | ||||||
|  |     @NotBlank(message = "备注不能为空", groups = { AddGroup.class, EditGroup.class }) | ||||||
|  |     private String handbookNote; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 指南文件 | ||||||
|  |      */ | ||||||
|  |     @NotBlank(message = "指南文件不能为空", groups = { AddGroup.class, EditGroup.class }) | ||||||
|  |     private String handbookFile; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 指南录入流程实例Id | ||||||
|  |      */ | ||||||
|  |     @NotBlank(message = "指南录入流程实例Id不能为空", groups = { AddGroup.class, EditGroup.class }) | ||||||
|  |     private String handbookProcId; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 指南录入流程状态(0未发起审核 1审核中 2审核失败 3审核通过) | ||||||
|  |      */ | ||||||
|  |     @NotBlank(message = "指南录入流程状态(0未发起审核 1审核中 2审核失败 3审核通过)不能为空", groups = { AddGroup.class, EditGroup.class }) | ||||||
|  |     private String handbookStatus; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | } | ||||||
| @ -0,0 +1,81 @@ | |||||||
|  | package com.ruoyi.scientific.domain.vo; | ||||||
|  | 
 | ||||||
|  | import java.util.Date; | ||||||
|  | import com.fasterxml.jackson.annotation.JsonFormat; | ||||||
|  | import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; | ||||||
|  | import com.alibaba.excel.annotation.ExcelProperty; | ||||||
|  | import com.ruoyi.common.annotation.ExcelDictFormat; | ||||||
|  | import com.ruoyi.common.convert.ExcelDictConvert; | ||||||
|  | import lombok.Data; | ||||||
|  | import java.util.Date; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * 项目申报指南视图对象 handbook | ||||||
|  |  * | ||||||
|  |  * @author zqjia | ||||||
|  |  * @date 2024-07-29 | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | @ExcelIgnoreUnannotated | ||||||
|  | public class HandbookVo { | ||||||
|  | 
 | ||||||
|  |     private static final long serialVersionUID = 1L; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 项目ID | ||||||
|  |      */ | ||||||
|  |     @ExcelProperty(value = "项目ID") | ||||||
|  |     private Long handbookId; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 指南名称 | ||||||
|  |      */ | ||||||
|  |     @ExcelProperty(value = "指南名称") | ||||||
|  |     private String handbookName; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 指南分类 | ||||||
|  |      */ | ||||||
|  |     @ExcelProperty(value = "指南分类") | ||||||
|  |     private String handbookCategory; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 指南级别(4院级 3市级 2省级 1国家级) | ||||||
|  |      */ | ||||||
|  |     @ExcelProperty(value = "指南级别(4院级 3市级 2省级 1国家级)") | ||||||
|  |     private String handbookLevel; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 发布时间 | ||||||
|  |      */ | ||||||
|  |     @ExcelProperty(value = "发布时间") | ||||||
|  |     private Date handbookDate; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 备注 | ||||||
|  |      */ | ||||||
|  |     @ExcelProperty(value = "备注") | ||||||
|  |     private String handbookNote; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 指南文件 | ||||||
|  |      */ | ||||||
|  |     @ExcelProperty(value = "指南文件") | ||||||
|  |     private String handbookFile; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 指南录入流程实例Id | ||||||
|  |      */ | ||||||
|  |     @ExcelProperty(value = "指南录入流程实例Id") | ||||||
|  |     private String handbookProcId; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 指南录入流程状态(0未发起审核 1审核中 2审核失败 3审核通过) | ||||||
|  |      */ | ||||||
|  |     @ExcelProperty(value = "指南录入流程状态(0未发起审核 1审核中 2审核失败 3审核通过)") | ||||||
|  |     private String handbookStatus; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | } | ||||||
| @ -0,0 +1,15 @@ | |||||||
|  | package com.ruoyi.scientific.mapper; | ||||||
|  | 
 | ||||||
|  | import com.ruoyi.scientific.domain.Handbook; | ||||||
|  | import com.ruoyi.scientific.domain.vo.HandbookVo; | ||||||
|  | import com.ruoyi.common.core.mapper.BaseMapperPlus; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * 项目申报指南Mapper接口 | ||||||
|  |  * | ||||||
|  |  * @author zqjia | ||||||
|  |  * @date 2024-07-29 | ||||||
|  |  */ | ||||||
|  | public interface HandbookMapper extends BaseMapperPlus<HandbookMapper, Handbook, HandbookVo> { | ||||||
|  | 
 | ||||||
|  | } | ||||||
| @ -0,0 +1,49 @@ | |||||||
|  | package com.ruoyi.scientific.service; | ||||||
|  | 
 | ||||||
|  | import com.ruoyi.scientific.domain.Handbook; | ||||||
|  | import com.ruoyi.scientific.domain.vo.HandbookVo; | ||||||
|  | import com.ruoyi.scientific.domain.bo.HandbookBo; | ||||||
|  | import com.ruoyi.common.core.page.TableDataInfo; | ||||||
|  | import com.ruoyi.common.core.domain.PageQuery; | ||||||
|  | 
 | ||||||
|  | import java.util.Collection; | ||||||
|  | import java.util.List; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * 项目申报指南Service接口 | ||||||
|  |  * | ||||||
|  |  * @author zqjia | ||||||
|  |  * @date 2024-07-29 | ||||||
|  |  */ | ||||||
|  | public interface IHandbookService { | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 查询项目申报指南 | ||||||
|  |      */ | ||||||
|  |     HandbookVo queryById(Long handbookId); | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 查询项目申报指南列表 | ||||||
|  |      */ | ||||||
|  |     TableDataInfo<HandbookVo> queryPageList(HandbookBo bo, PageQuery pageQuery); | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 查询项目申报指南列表 | ||||||
|  |      */ | ||||||
|  |     List<HandbookVo> queryList(HandbookBo bo); | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 新增项目申报指南 | ||||||
|  |      */ | ||||||
|  |     Boolean insertByBo(HandbookBo bo); | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 修改项目申报指南 | ||||||
|  |      */ | ||||||
|  |     Boolean updateByBo(HandbookBo bo); | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 校验并批量删除项目申报指南信息 | ||||||
|  |      */ | ||||||
|  |     Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid); | ||||||
|  | } | ||||||
| @ -0,0 +1,117 @@ | |||||||
|  | package com.ruoyi.scientific.service.impl; | ||||||
|  | 
 | ||||||
|  | import cn.hutool.core.bean.BeanUtil; | ||||||
|  | import com.ruoyi.common.utils.StringUtils; | ||||||
|  | import com.ruoyi.common.core.page.TableDataInfo; | ||||||
|  | import com.ruoyi.common.core.domain.PageQuery; | ||||||
|  | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||||||
|  | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||||||
|  | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ||||||
|  | import lombok.RequiredArgsConstructor; | ||||||
|  | import org.springframework.stereotype.Service; | ||||||
|  | import com.ruoyi.scientific.domain.bo.HandbookBo; | ||||||
|  | import com.ruoyi.scientific.domain.vo.HandbookVo; | ||||||
|  | import com.ruoyi.scientific.domain.Handbook; | ||||||
|  | import com.ruoyi.scientific.mapper.HandbookMapper; | ||||||
|  | import com.ruoyi.scientific.service.IHandbookService; | ||||||
|  | 
 | ||||||
|  | import java.util.List; | ||||||
|  | import java.util.Map; | ||||||
|  | import java.util.Collection; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * 项目申报指南Service业务层处理 | ||||||
|  |  * | ||||||
|  |  * @author zqjia | ||||||
|  |  * @date 2024-07-29 | ||||||
|  |  */ | ||||||
|  | @RequiredArgsConstructor | ||||||
|  | @Service | ||||||
|  | public class HandbookServiceImpl implements IHandbookService { | ||||||
|  | 
 | ||||||
|  |     private final HandbookMapper baseMapper; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 查询项目申报指南 | ||||||
|  |      */ | ||||||
|  |     @Override | ||||||
|  |     public HandbookVo queryById(Long handbookId){ | ||||||
|  |         return baseMapper.selectVoById(handbookId); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 查询项目申报指南列表 | ||||||
|  |      */ | ||||||
|  |     @Override | ||||||
|  |     public TableDataInfo<HandbookVo> queryPageList(HandbookBo bo, PageQuery pageQuery) { | ||||||
|  |         LambdaQueryWrapper<Handbook> lqw = buildQueryWrapper(bo); | ||||||
|  |         Page<HandbookVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw); | ||||||
|  |         return TableDataInfo.build(result); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 查询项目申报指南列表 | ||||||
|  |      */ | ||||||
|  |     @Override | ||||||
|  |     public List<HandbookVo> queryList(HandbookBo bo) { | ||||||
|  |         LambdaQueryWrapper<Handbook> lqw = buildQueryWrapper(bo); | ||||||
|  |         return baseMapper.selectVoList(lqw); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     private LambdaQueryWrapper<Handbook> buildQueryWrapper(HandbookBo bo) { | ||||||
|  |         Map<String, Object> params = bo.getParams(); | ||||||
|  |         LambdaQueryWrapper<Handbook> lqw = Wrappers.lambdaQuery(); | ||||||
|  |         lqw.eq(bo.getHandbookId() != null, Handbook::getHandbookId, bo.getHandbookId()); | ||||||
|  |         lqw.like(StringUtils.isNotBlank(bo.getHandbookName()), Handbook::getHandbookName, bo.getHandbookName()); | ||||||
|  |         lqw.eq(StringUtils.isNotBlank(bo.getHandbookCategory()), Handbook::getHandbookCategory, bo.getHandbookCategory()); | ||||||
|  |         lqw.eq(StringUtils.isNotBlank(bo.getHandbookLevel()), Handbook::getHandbookLevel, bo.getHandbookLevel()); | ||||||
|  |         lqw.eq(bo.getHandbookDate() != null, Handbook::getHandbookDate, bo.getHandbookDate()); | ||||||
|  |         lqw.eq(StringUtils.isNotBlank(bo.getHandbookNote()), Handbook::getHandbookNote, bo.getHandbookNote()); | ||||||
|  |         lqw.eq(StringUtils.isNotBlank(bo.getHandbookFile()), Handbook::getHandbookFile, bo.getHandbookFile()); | ||||||
|  |         lqw.eq(StringUtils.isNotBlank(bo.getHandbookProcId()), Handbook::getHandbookProcId, bo.getHandbookProcId()); | ||||||
|  |         lqw.eq(StringUtils.isNotBlank(bo.getHandbookStatus()), Handbook::getHandbookStatus, bo.getHandbookStatus()); | ||||||
|  |         return lqw; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 新增项目申报指南 | ||||||
|  |      */ | ||||||
|  |     @Override | ||||||
|  |     public Boolean insertByBo(HandbookBo bo) { | ||||||
|  |         Handbook add = BeanUtil.toBean(bo, Handbook.class); | ||||||
|  |         validEntityBeforeSave(add); | ||||||
|  |         boolean flag = baseMapper.insert(add) > 0; | ||||||
|  |         if (flag) { | ||||||
|  |             bo.setHandbookId(add.getHandbookId()); | ||||||
|  |         } | ||||||
|  |         return flag; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 修改项目申报指南 | ||||||
|  |      */ | ||||||
|  |     @Override | ||||||
|  |     public Boolean updateByBo(HandbookBo bo) { | ||||||
|  |         Handbook update = BeanUtil.toBean(bo, Handbook.class); | ||||||
|  |         validEntityBeforeSave(update); | ||||||
|  |         return baseMapper.updateById(update) > 0; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 保存前的数据校验 | ||||||
|  |      */ | ||||||
|  |     private void validEntityBeforeSave(Handbook entity){ | ||||||
|  |         //TODO 做一些数据校验,如唯一约束 | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 批量删除项目申报指南 | ||||||
|  |      */ | ||||||
|  |     @Override | ||||||
|  |     public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) { | ||||||
|  |         if(isValid){ | ||||||
|  |             //TODO 做一些业务上的校验,判断是否需要校验 | ||||||
|  |         } | ||||||
|  |         return baseMapper.deleteBatchIds(ids) > 0; | ||||||
|  |     } | ||||||
|  | } | ||||||
| @ -0,0 +1,24 @@ | |||||||
|  | <?xml version="1.0" encoding="UTF-8" ?> | ||||||
|  | <!DOCTYPE mapper | ||||||
|  | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||||||
|  | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||||||
|  | <mapper namespace="com.ruoyi.scientific.mapper.HandbookMapper"> | ||||||
|  | 
 | ||||||
|  |     <resultMap type="com.ruoyi.scientific.domain.Handbook" id="HandbookResult"> | ||||||
|  |         <result property="handbookId" column="handbook_id"/> | ||||||
|  |         <result property="handbookName" column="handbook_name"/> | ||||||
|  |         <result property="handbookCategory" column="handbook_category"/> | ||||||
|  |         <result property="handbookLevel" column="handbook_level"/> | ||||||
|  |         <result property="handbookDate" column="handbook_date"/> | ||||||
|  |         <result property="handbookNote" column="handbook_note"/> | ||||||
|  |         <result property="handbookFile" column="handbook_file"/> | ||||||
|  |         <result property="handbookProcId" column="handbook_proc_id"/> | ||||||
|  |         <result property="handbookStatus" column="handbook_status"/> | ||||||
|  |         <result property="createBy" column="create_by"/> | ||||||
|  |         <result property="createTime" column="create_time"/> | ||||||
|  |         <result property="updateBy" column="update_by"/> | ||||||
|  |         <result property="updateTime" column="update_time"/> | ||||||
|  |     </resultMap> | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | </mapper> | ||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user