项目书-基本信息 功能添加 10.24

master
zhc077 4 weeks ago
parent df77236902
commit 4e0671168c
  1. 15
      jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/project/controller/ProjectController.java
  2. 8
      jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/project/entity/Project.java
  3. 6
      jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/project/service/impl/ProjectServiceImpl.java
  4. 26
      jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/projectType/controller/ProjectTypeController.java
  5. 2
      jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/projectType/entity/ProjectType.java
  6. 21
      jeecgboot-vue3/src/views/projectApplication/kejigongguan/data.ts
  7. 41
      jeecgboot-vue3/src/views/projectApplication/kejigongguan/xiangmushu/JiBenXinXi.ts
  8. 5
      jeecgboot-vue3/src/views/projectApplication/project/Project.api.ts
  9. 42
      jeecgboot-vue3/src/views/projectApplication/project/ProjectList.vue

@ -21,6 +21,8 @@ import org.jeecg.modules.demo.project.dto.DepartExtDto;
import org.jeecg.modules.demo.project.dto.ProjectShenBaoDto; import org.jeecg.modules.demo.project.dto.ProjectShenBaoDto;
import org.jeecg.modules.demo.project.entity.Project; import org.jeecg.modules.demo.project.entity.Project;
import org.jeecg.modules.demo.project.service.IProjectService; import org.jeecg.modules.demo.project.service.IProjectService;
import org.jeecg.modules.demo.projectType.entity.ProjectType;
import org.jeecg.modules.demo.projectType.service.IProjectTypeService;
import org.jeecg.modules.demo.userext.entity.UserExt; import org.jeecg.modules.demo.userext.entity.UserExt;
import org.jeecg.modules.demo.userext.service.IUserExtService; import org.jeecg.modules.demo.userext.service.IUserExtService;
import org.jeecg.modules.system.entity.SysDepart; import org.jeecg.modules.system.entity.SysDepart;
@ -64,6 +66,9 @@ public class ProjectController extends JeecgController<Project, IProjectService>
@Autowired @Autowired
private ISysDepartService iSysDepartService; private ISysDepartService iSysDepartService;
@Autowired
private IProjectTypeService iProjectTypeService;
/** /**
* 分页列表查询 * 分页列表查询
* *
@ -94,8 +99,14 @@ public class ProjectController extends JeecgController<Project, IProjectService>
@ApiOperation(value = "项目表-根据id查询", notes = "项目表-根据id查询") @ApiOperation(value = "项目表-根据id查询", notes = "项目表-根据id查询")
@GetMapping(value = "/getById") @GetMapping(value = "/getById")
public Result<Project> getById(Project project,HttpServletRequest req) { public Result<Project> getById(Project param,HttpServletRequest req) {
return Result.OK(projectService.getById(project.getId())); Project project = projectService.getById(param.getId());
ProjectType projectType = iProjectTypeService.getById(project.getProjectTypeid());
project.setAnnualName(projectType.getAnnualName());
project.setProjectTypeName(projectType.getTypeName());
project.setAnnualName(projectType.getAnnualName());
project.setProjectTypeName(projectType.getTypeName());
return Result.OK(project);
} }
@ApiOperation(value = "获取项目负责人信息", notes = "获取项目负责人信息") @ApiOperation(value = "获取项目负责人信息", notes = "获取项目负责人信息")

@ -1,6 +1,7 @@
package org.jeecg.modules.demo.project.entity; package org.jeecg.modules.demo.project.entity;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
@ -234,6 +235,13 @@ public class Project implements Serializable {
@ApiModelProperty(value = "项目类别表id") @ApiModelProperty(value = "项目类别表id")
@Dict(dictTable = "project_type",dicCode = "id",dicText = "type_name") @Dict(dictTable = "project_type",dicCode = "id",dicText = "type_name")
private String projectTypeid; private String projectTypeid;
@TableField(exist = false)
private String projectTypeName;
@TableField(exist = false)
private String annualName;
/** /**
* 批次 * 批次
*/ */

@ -1,6 +1,7 @@
package org.jeecg.modules.demo.project.service.impl; package org.jeecg.modules.demo.project.service.impl;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -72,6 +73,10 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
project.setProjectStatus("5"); project.setProjectStatus("5");
// 预算书不存在 // 预算书不存在
project.setBudgetStatus("10"); project.setBudgetStatus("10");
// ProjectType projectType = iProjectTypeService.getById(project.getProjectTypeid());
// project.setAnnualName(projectType.getAnnualName());
// project.setProjectTypeName(projectType.getTypeName());
this.save(project); this.save(project);
userExt.setUserId(loginUser.getId()); userExt.setUserId(loginUser.getId());
userExt.setProjectId(project.getId()); userExt.setProjectId(project.getId());
@ -80,7 +85,6 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
departExt.setProjectId(project.getId()); departExt.setProjectId(project.getId());
this.iDepartExtService.save(departExt); this.iDepartExtService.save(departExt);
sysDepart.setId(loginUser.getOrgId()); sysDepart.setId(loginUser.getOrgId());
updateDepart4ShenBao(sysDepart); updateDepart4ShenBao(sysDepart);
} }

@ -1,17 +1,21 @@
package org.jeecg.modules.demo.projectType.controller; package org.jeecg.modules.demo.projectType.controller;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jeecg.common.api.vo.Result; import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog; import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController; import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator; import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.modules.demo.annual.entity.Annual;
import org.jeecg.modules.demo.annual.service.IAnnualService;
import org.jeecg.modules.demo.projectType.entity.ProjectType; import org.jeecg.modules.demo.projectType.entity.ProjectType;
import org.jeecg.modules.demo.projectType.service.IProjectTypeService; import org.jeecg.modules.demo.projectType.service.IProjectTypeService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -21,6 +25,7 @@ import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.util.Arrays; import java.util.Arrays;
import java.util.List;
/** /**
* @Description: 项目类型 * @Description: 项目类型
@ -36,6 +41,9 @@ public class ProjectTypeController extends JeecgController<ProjectType, IProject
@Autowired @Autowired
private IProjectTypeService projectTypeService; private IProjectTypeService projectTypeService;
@Autowired
private IAnnualService iAnnualService;
/** /**
* 分页列表查询 * 分页列表查询
* *
@ -70,6 +78,10 @@ public class ProjectTypeController extends JeecgController<ProjectType, IProject
@PostMapping(value = "/add") @PostMapping(value = "/add")
public Result<String> add(@RequestBody ProjectType projectType) { public Result<String> add(@RequestBody ProjectType projectType) {
projectType.setStatus(projectType.getStatus_dictText()); projectType.setStatus(projectType.getStatus_dictText());
if (StrUtil.isNotBlank(projectType.getAnnualId())) {
Annual annual = iAnnualService.getById(projectType.getAnnualId());
projectType.setAnnualName(annual.getAnnualName());
}
projectTypeService.save(projectType); projectTypeService.save(projectType);
return Result.OK("添加成功!"); return Result.OK("添加成功!");
} }
@ -86,9 +98,13 @@ public class ProjectTypeController extends JeecgController<ProjectType, IProject
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST}) @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
public Result<String> edit(@RequestBody ProjectType projectType) { public Result<String> edit(@RequestBody ProjectType projectType) {
projectType.setStatus(projectType.getStatus_dictText()); projectType.setStatus(projectType.getStatus_dictText());
if(projectType.getStatus().equals("0")){ if (projectType.getStatus().equals("0")) {
projectType.setAnnualId(""); projectType.setAnnualId("");
} }
if (StrUtil.isNotBlank(projectType.getAnnualId())) {
Annual annual = iAnnualService.getById(projectType.getAnnualId());
projectType.setAnnualName(annual.getAnnualName());
}
projectTypeService.updateById(projectType); projectTypeService.updateById(projectType);
return Result.OK("编辑成功!"); return Result.OK("编辑成功!");
} }
@ -148,6 +164,12 @@ public class ProjectTypeController extends JeecgController<ProjectType, IProject
return Result.OK(projectType); return Result.OK(projectType);
} }
@GetMapping(value = "/getProjectTypeList")
public Result<List<ProjectType>> getProjectTypeList() {
List<ProjectType> list = projectTypeService.list(new LambdaQueryWrapper<ProjectType>().eq(ProjectType::getStatus, "1"));
return Result.OK(list);
}
/** /**
* 导出excel * 导出excel
* *

@ -97,6 +97,8 @@ public class ProjectType implements Serializable {
@ApiModelProperty(value = "年度id") @ApiModelProperty(value = "年度id")
private String annualId; private String annualId;
private String annualName;
@TableField(exist = false) @TableField(exist = false)
private String status_dictText; private String status_dictText;
} }

@ -6,7 +6,12 @@ export const projectBaseInfoSchemas: FormSchema[] = [
{ {
label: '项目类别', label: '项目类别',
field: 'projectTypeid', field: 'projectTypeid',
component: 'Input', // component: 'Input',
component: 'JDictSelectTag',
componentProps: {
dictCode: 'project_type,type_name,id',
// stringToNumber: true,
},
dynamicDisabled: true, dynamicDisabled: true,
// defaultValue: '', // defaultValue: '',
defaultValue: '1846744340708184065', defaultValue: '1846744340708184065',
@ -158,9 +163,9 @@ export const departSchemas: FormSchema[] = [
field: 'orgName', field: 'orgName',
component: 'Input', component: 'Input',
label: '单位名称', label: '单位名称',
required: true, // required: true,
defaultValue: useUserStore().getUserInfo?.orgCode, defaultValue: useUserStore().getUserInfo?.orgCode,
dynamicDisabled: true, // dynamicDisabled: true,
}, },
{ {
field: 'category', field: 'category',
@ -198,16 +203,6 @@ export const departSchemas: FormSchema[] = [
// }, // },
// width: 200, // width: 200,
}, },
// {
// field: 'date',
// label: '2',
// component: 'DatePicker',
// editComponentProps: {
// valueFormat: 'YYYY-MM-DD',
// format: 'YYYY-MM-DD',
// },
// width: 200,
// },
{ {
field: 'departNameAbbr', field: 'departNameAbbr',
component: 'Input', component: 'Input',

@ -5,10 +5,10 @@ import { useUserStore } from '/@/store/modules/user';
export const projectBaseInfoSchemas: FormSchema[] = [ export const projectBaseInfoSchemas: FormSchema[] = [
{ {
label: '项目类别', label: '项目类别',
field: 'projectTypeid', field: 'projectTypeName',
component: 'Input', component: 'Input',
dynamicDisabled: true, dynamicDisabled: true,
defaultValue: '科技攻关', // defaultValue: '',
// defaultValue: '1846744340708184065', // defaultValue: '1846744340708184065',
}, },
/*{ /*{
@ -16,12 +16,19 @@ export const projectBaseInfoSchemas: FormSchema[] = [
field: 'projectTypeid', field: 'projectTypeid',
component: 'Input', component: 'Input',
},*/ },*/
{ /*{
field: 'annualId', field: 'annualId',
component: 'Input', component: 'Input',
label: '计划年度', label: '计划年度',
dynamicDisabled: true, dynamicDisabled: true,
defaultValue: '2025', defaultValue: '2025',
},*/
{
field: 'annualName',
component: 'Input',
label: '年度',
dynamicDisabled: true,
// defaultValue: '2025',
}, },
{ {
field: 'batchNo', field: 'batchNo',
@ -258,17 +265,35 @@ export const projectBaseInfoSchemas: FormSchema[] = [
{ {
label: '申请专利数', label: '申请专利数',
field: 'applyPatentNumber', field: 'applyPatentNumber',
component: 'Input', component: 'InputNumber',
dynamicRules: ({model,schema}) => {
return [
{ required: false},
{ pattern: /^(([1-9][0-9]*))$/, message: '请输入正确的人数!'},
];
},
}, },
{ {
label: '发明专利数', label: '发明专利数',
field: 'invevtionPatentNumber', field: 'invevtionPatentNumber',
component: 'Input', component: 'InputNumber',
dynamicRules: ({model,schema}) => {
return [
{ required: false},
{ pattern: /^(([1-9][0-9]*))$/, message: '请输入正确的人数!'},
];
},
}, },
{ {
label: '授权专利数', label: '授权专利数',
field: 'creditPatentNumber', field: 'creditPatentNumber',
component: 'Input', component: 'InputNumber',
dynamicRules: ({model,schema}) => {
return [
{ required: false},
{ pattern: /^(([1-9][0-9]*))$/, message: '请输入正确的人数!'},
];
},
}, },
]; ];
@ -379,9 +404,9 @@ export const departSchemas: FormSchema[] = [
field: 'orgName', field: 'orgName',
component: 'Input', component: 'Input',
label: '单位名称', label: '单位名称',
required: true, // required: true,
defaultValue: useUserStore().getUserInfo?.orgCode, defaultValue: useUserStore().getUserInfo?.orgCode,
dynamicDisabled: true, // dynamicDisabled: true,
}, },
{ {
field: 'category', field: 'category',

@ -5,6 +5,7 @@ const {createConfirm} = useMessage();
enum Api { enum Api {
list = '/project/project/list', list = '/project/project/list',
projectType = '/projectType/getProjectTypeList',
save = '/project/project/add', save = '/project/project/add',
edit = '/project/project/edit', edit = '/project/project/edit',
deleteOne = '/project/project/delete', deleteOne = '/project/project/delete',
@ -29,6 +30,10 @@ export const getImportUrl = Api.importExcel;
export const list = (params) => export const list = (params) =>
defHttp.get({url: Api.list, params}); defHttp.get({url: Api.list, params});
export const getProjectTypeList = (params) =>
defHttp.get({url: Api.projectType, params});
/** /**
* 删除单个 * 删除单个
*/ */

@ -15,6 +15,9 @@
<Icon icon="ant-design:plus-outlined"></Icon> <Icon icon="ant-design:plus-outlined"></Icon>
科技攻关 科技攻关
</a-menu-item> </a-menu-item>
<!-- <a-menu-item v-for="opt of RANGE_OPTIONS" :key="opt.key">
{{ opt.label }}
</a-menu-item>-->
<!--<a-menu-item key="1" @click="go_xinjianshenbao"> <!--<a-menu-item key="1" @click="go_xinjianshenbao">
<Icon icon="ant-design:plus-outlined"></Icon> <Icon icon="ant-design:plus-outlined"></Icon>
xxx xxx
@ -48,12 +51,20 @@ import {useModal} from '/@/components/Modal';
import { useListPage } from '/@/hooks/system/useListPage' import { useListPage } from '/@/hooks/system/useListPage'
import ProjectModal from './components/ProjectModal.vue' import ProjectModal from './components/ProjectModal.vue'
import {columns, searchFormSchema, superQuerySchema} from './Project.data'; import {columns, searchFormSchema, superQuerySchema} from './Project.data';
import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './Project.api'; import {
list,
deleteOne,
batchDelete,
getImportUrl,
getExportUrl,
getProjectTypeList
} from './Project.api';
import { downloadFile } from '/@/utils/common/renderUtils'; import { downloadFile } from '/@/utils/common/renderUtils';
import { useGo } from '/@/hooks/web/usePage'; import { useGo } from '/@/hooks/web/usePage';
import { useUserStore } from '/@/store/modules/user'; import { useUserStore } from '/@/store/modules/user';
import {getUserData} from "@/views/system/usersetting/UserSetting.api"; import {getUserData} from "@/views/system/usersetting/UserSetting.api";
import {useTimeoutFn} from "@/hooks/core/useTimeout";
const go = useGo(); const go = useGo();
const queryParam = reactive<any>({}); const queryParam = reactive<any>({});
@ -97,11 +108,34 @@ const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({
}, },
}) })
//
//
const RANGE_OPTIONS = [
{key: 'TODAY', label: '今天'},
{key: 'YESTERDAY', label: '昨天'},
{key: 'TOMORROW', label: '明天'},
{key: 'THIS_WEEK', label: '本周'},
{key: 'LAST_WEEK', label: '上周'},
{key: 'NEXT_WEEK', label: '下周'},
{key: 'LAST_7_DAYS', label: '过去七天'},
{key: 'THIS_MONTH', label: '本月'},
{key: 'LAST_MONTH', label: '上月'},
{key: 'NEXT_MONTH', label: '下月'},
];
const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext
// //
const superQueryConfig = reactive(superQuerySchema); const superQueryConfig = reactive(superQuerySchema);
// onMounted(() => {
// let typeList = getProjectTypeList();
// console.log('typeList',typeList)
// RANGE_OPTIONS = typeList;
// });
/** /**
* 高级查询事件 * 高级查询事件
*/ */
@ -124,7 +158,7 @@ function handleAdd() {
// //
function go_xinjianshenbao() { function go_xinjianshenbao() {
// go('/comp/jeecg/basic'); // go('/comp/jeecg/basic');
go('/projectApplication/index'); go('/projectApplication/index?projectTypeId='+'1846744340708184065');
} }
// //
@ -207,12 +241,12 @@ function getTableAction(record){
// auth: 'projecttype:project_type:delete' // auth: 'projecttype:project_type:delete'
}]; }];
// //
if (record.projectStatus == 5) { /*if (record.projectStatus == 5) {
actions.unshift({ actions.unshift({
label: '编辑', label: '编辑',
onClick: handleEdit.bind(null, record), onClick: handleEdit.bind(null, record),
}); });
} }*/
return actions; return actions;
} }
/** /**

Loading…
Cancel
Save