项目申报表单添加 10.18

master
zhc077 1 month ago
parent fecd768869
commit 255b20dd8c
  1. 5
      jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/project/controller/ProjectController.java
  2. 4
      jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/project/entity/Project.java
  3. 52
      jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/project/service/impl/ProjectServiceImpl.java
  4. 70
      jeecgboot-vue3/src/views/projectApplication/kejigongguan/projectApplicationList.vue

@ -82,9 +82,8 @@ public class ProjectController extends JeecgController<Project, IProjectService>
return Result.OK("添加成功!");
}
@AutoLog(value = "项目审报")
@ApiOperation(value = "项目表-添加", notes = "项目表-添加")
// @RequiresPermissions("project:project:add")
@AutoLog(value = "新增项目审报")
@ApiOperation(value = "新增项目审报", notes = "新增项目审报")
@PostMapping(value = "/save4shenbao")
public Result<String> save4shenbao(@RequestBody ProjectShenBaoDto dto) {
projectService.save4shenbao(dto);

@ -257,8 +257,8 @@ public class Project implements Serializable {
/**
* 负责人
*/
@Excel(name = "负责人", width = 15, dictTable = "sys_user", dicText = "realname", dicCode = "username")
@Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username")
@Excel(name = "负责人", width = 15, dictTable = "sys_user", dicText = "realname", dicCode = "id")
@Dict(dictTable = "sys_user", dicText = "realname", dicCode = "id")
@ApiModelProperty(value = "负责人")
private String projectCharger;
}

@ -1,13 +1,26 @@
package org.jeecg.modules.demo.project.service.impl;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.SecurityUtils;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.modules.demo.departext.entity.DepartExt;
import org.jeecg.modules.demo.departext.service.IDepartExtService;
import org.jeecg.modules.demo.project.dto.ProjectShenBaoDto;
import org.jeecg.modules.demo.project.entity.Project;
import org.jeecg.modules.demo.project.mapper.ProjectMapper;
import org.jeecg.modules.demo.project.service.IProjectService;
import org.jeecg.modules.demo.userext.entity.UserExt;
import org.jeecg.modules.demo.userext.service.IUserExtService;
import org.jeecg.modules.system.entity.SysDepart;
import org.jeecg.modules.system.entity.SysUser;
import org.jeecg.modules.system.service.ISysDepartService;
import org.jeecg.modules.system.service.ISysUserService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 项目表
* @Author: jeecg-boot
@ -15,10 +28,43 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
* @Version: V1.0
*/
@Service
@Slf4j
public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> implements IProjectService {
@Autowired
private IDepartExtService iDepartExtService;
@Autowired
private ISysDepartService iSysDepartService;
@Autowired
private ISysUserService iSysUserService;
@Autowired
private IUserExtService iUserExtService;
@Override
public void save4shenbao(ProjectShenBaoDto dto) {
System.out.println("dto = " + dto);
log.info(">>> the 新增项目审报 reqParams:{}", JSON.toJSONString(dto));
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
// SysDepart sysDepart = new SysDepart();
DepartExt departExt = new DepartExt();
// SysUser sysUser = new SysUser();
UserExt userExt = new UserExt();
Project project = new Project();
BeanUtils.copyProperties(dto, departExt);
// BeanUtils.copyProperties(dto, sysDepart);
// BeanUtils.copyProperties(dto, sysUser);
BeanUtils.copyProperties(dto, userExt);
BeanUtils.copyProperties(dto, project);
//负责人
project.setProjectCharger(loginUser.getId());
this.save(project);
userExt.setUserId(loginUser.getId());
this.iUserExtService.save(userExt);
departExt.setDepartId(loginUser.getOrgId());
this.iDepartExtService.save(departExt);
}
}

@ -1,35 +1,35 @@
<template>
<PageWrapper title="基本信息">
<a-card title="项目概况" :bordered="false">
<BasicForm @register="registerProjectInfo"/>
<BasicForm @register="registerProjectInfo" />
</a-card>
<a-card title="项目负责人" :bordered="false" class="!mt-5">
<BasicForm @register="registerUser"/>
<BasicForm @register="registerUser" />
</a-card>
<a-card title="申请单位概况" :bordered="false" class="!mt-5">
<BasicForm @register="registerDepart"/>
<BasicForm @register="registerDepart" />
</a-card>
<template #rightFooter>
<a-button @click="cancel">取消</a-button>
<a-button type="primary" @click="submitAll">提交</a-button>
<a-button type="primary" @click="submitAll"> 提交 </a-button>
</template>
</PageWrapper>
</template>
<script lang="ts">
import {BasicForm, useForm} from '@/components/Form';
import {defineComponent} from 'vue';
// import PersonTable from './PersonTable.vue';
import {PageWrapper} from '@/components/Page';
import {departSchemas, projectBaseInfoSchemas, userSchemas} from './data';
import {Card} from 'ant-design-vue';
import {save4shenbao} from './data.api';
import { BasicForm, useForm } from '@/components/Form';
import { defineComponent, ref } from 'vue';
// import PersonTable from './PersonTable.vue';
import { PageWrapper } from '@/components/Page';
import { projectBaseInfoSchemas, userSchemas, departSchemas } from './data';
import { Card } from 'ant-design-vue';
import {defHttp} from "@/utils/http/axios";
import {save4shenbao} from './data.api';
export default defineComponent({
export default defineComponent({
name: 'FormHightPage',
components: {BasicForm, PageWrapper, [Card.name]: Card},
components: { BasicForm, PageWrapper, [Card.name]: Card },
setup() {
const [registerProjectInfo, {validate: validateProjectInfoForm}] = useForm({
const [registerProjectInfo, { validate: validateProjectInfoForm }] = useForm({
baseColProps: {
span: 6,
},
@ -39,7 +39,7 @@ export default defineComponent({
showActionButtonGroup: false,
});
const [registerUser, {validate: validateUserForm}] = useForm({
const [registerUser, { validate: validateUserForm }] = useForm({
baseColProps: {
span: 6,
},
@ -49,7 +49,7 @@ export default defineComponent({
showActionButtonGroup: false,
});
const [registerDepart, {validate: validateDepartForm}] = useForm({
const [registerDepart, { validate: validateDepartForm }] = useForm({
baseColProps: {
span: 6,
},
@ -59,8 +59,6 @@ export default defineComponent({
showActionButtonGroup: false,
});
async function submitAll() {
try {
async function submitAll() {
try {
Promise.all([validateProjectInfoForm(), validateUserForm(), validateDepartForm()]).then(function (results) {
@ -68,36 +66,20 @@ export default defineComponent({
console.log('results', params);
save4shenbao(params);
});
} catch (error){};
}
} catch (error) {
}
}
async function cancel() {
alert("kkkkkkk")
// window.close();
} catch (error) {}
}
// return { register, registerUser, registerDepart, submitAll, tableRef };
return {registerProjectInfo, registerUser, registerDepart,cancel,submitAll};
return { registerProjectInfo, registerUser, registerDepart, submitAll };
},
});
function cancel2() {
alert("kkkkkkk")
window.close();
}
});
</script>
<style lang="less" scoped>
.high-form {
.high-form {
padding-bottom: 48px;
}
}
/** update-begin-author:taoyan date:2022-5-16 for:/issues/63 下拉框z-index问题 */
:deep(.ant-select-dropdown) {
/** update-begin-author:taoyan date:2022-5-16 for:/issues/63 下拉框z-index问题 */
:deep(.ant-select-dropdown) {
z-index: 98 !important;
}
/** update-end-author:taoyan date:2022-5-16 for:/issues/63 下拉框z-index问题 */
}
/** update-end-author:taoyan date:2022-5-16 for:/issues/63 下拉框z-index问题 */
</style>

Loading…
Cancel
Save