parent
fecd768869
commit
255b20dd8c
4 changed files with 116 additions and 89 deletions
@ -1,24 +1,70 @@ |
|||||||
package org.jeecg.modules.demo.project.service.impl; |
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.dto.ProjectShenBaoDto; |
||||||
import org.jeecg.modules.demo.project.entity.Project; |
import org.jeecg.modules.demo.project.entity.Project; |
||||||
import org.jeecg.modules.demo.project.mapper.ProjectMapper; |
import org.jeecg.modules.demo.project.mapper.ProjectMapper; |
||||||
import org.jeecg.modules.demo.project.service.IProjectService; |
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 org.springframework.stereotype.Service; |
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
||||||
|
|
||||||
/** |
/** |
||||||
* @Description: 项目表 |
* @Description: 项目表 |
||||||
* @Author: jeecg-boot |
* @Author: jeecg-boot |
||||||
* @Date: 2024-10-17 |
* @Date: 2024-10-17 |
||||||
* @Version: V1.0 |
* @Version: V1.0 |
||||||
*/ |
*/ |
||||||
@Service |
@Service |
||||||
|
@Slf4j |
||||||
public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> implements IProjectService { |
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 |
@Override |
||||||
public void save4shenbao(ProjectShenBaoDto dto) { |
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,103 +1,85 @@ |
|||||||
<template> |
<template> |
||||||
<PageWrapper title="基本信息"> |
<PageWrapper title="基本信息"> |
||||||
<a-card title="项目概况" :bordered="false"> |
<a-card title="项目概况" :bordered="false"> |
||||||
<BasicForm @register="registerProjectInfo"/> |
<BasicForm @register="registerProjectInfo" /> |
||||||
</a-card> |
</a-card> |
||||||
<a-card title="项目负责人" :bordered="false" class="!mt-5"> |
<a-card title="项目负责人" :bordered="false" class="!mt-5"> |
||||||
<BasicForm @register="registerUser"/> |
<BasicForm @register="registerUser" /> |
||||||
</a-card> |
</a-card> |
||||||
<a-card title="申请单位概况" :bordered="false" class="!mt-5"> |
<a-card title="申请单位概况" :bordered="false" class="!mt-5"> |
||||||
<BasicForm @register="registerDepart"/> |
<BasicForm @register="registerDepart" /> |
||||||
</a-card> |
</a-card> |
||||||
|
|
||||||
<template #rightFooter> |
<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> |
</template> |
||||||
</PageWrapper> |
</PageWrapper> |
||||||
</template> |
</template> |
||||||
<script lang="ts"> |
<script lang="ts"> |
||||||
import {BasicForm, useForm} from '@/components/Form'; |
import { BasicForm, useForm } from '@/components/Form'; |
||||||
import {defineComponent} from 'vue'; |
import { defineComponent, ref } from 'vue'; |
||||||
// import PersonTable from './PersonTable.vue'; |
// import PersonTable from './PersonTable.vue'; |
||||||
import {PageWrapper} from '@/components/Page'; |
import { PageWrapper } from '@/components/Page'; |
||||||
import {departSchemas, projectBaseInfoSchemas, userSchemas} from './data'; |
import { projectBaseInfoSchemas, userSchemas, departSchemas } from './data'; |
||||||
import {Card} from 'ant-design-vue'; |
import { Card } from 'ant-design-vue'; |
||||||
import {save4shenbao} from './data.api'; |
import {defHttp} from "@/utils/http/axios"; |
||||||
|
import {save4shenbao} from './data.api'; |
||||||
|
|
||||||
export default defineComponent({ |
export default defineComponent({ |
||||||
name: 'FormHightPage', |
name: 'FormHightPage', |
||||||
components: {BasicForm, PageWrapper, [Card.name]: Card}, |
components: { BasicForm, PageWrapper, [Card.name]: Card }, |
||||||
setup() { |
setup() { |
||||||
const [registerProjectInfo, {validate: validateProjectInfoForm}] = useForm({ |
const [registerProjectInfo, { validate: validateProjectInfoForm }] = useForm({ |
||||||
baseColProps: { |
baseColProps: { |
||||||
span: 6, |
span: 6, |
||||||
}, |
}, |
||||||
labelWidth: 200, |
labelWidth: 200, |
||||||
layout: 'vertical', |
layout: 'vertical', |
||||||
schemas: projectBaseInfoSchemas, |
schemas: projectBaseInfoSchemas, |
||||||
showActionButtonGroup: false, |
showActionButtonGroup: false, |
||||||
}); |
}); |
||||||
|
|
||||||
const [registerUser, {validate: validateUserForm}] = useForm({ |
const [registerUser, { validate: validateUserForm }] = useForm({ |
||||||
baseColProps: { |
baseColProps: { |
||||||
span: 6, |
span: 6, |
||||||
}, |
}, |
||||||
labelWidth: 200, |
labelWidth: 200, |
||||||
layout: 'vertical', |
layout: 'vertical', |
||||||
schemas: userSchemas, |
schemas: userSchemas, |
||||||
showActionButtonGroup: false, |
showActionButtonGroup: false, |
||||||
}); |
}); |
||||||
|
|
||||||
const [registerDepart, {validate: validateDepartForm}] = useForm({ |
const [registerDepart, { validate: validateDepartForm }] = useForm({ |
||||||
baseColProps: { |
baseColProps: { |
||||||
span: 6, |
span: 6, |
||||||
}, |
}, |
||||||
labelWidth: 200, |
labelWidth: 200, |
||||||
layout: 'vertical', |
layout: 'vertical', |
||||||
schemas: departSchemas, |
schemas: departSchemas, |
||||||
showActionButtonGroup: false, |
showActionButtonGroup: false, |
||||||
}); |
}); |
||||||
|
|
||||||
async function submitAll() { |
async function submitAll() { |
||||||
try { |
try { |
||||||
async function submitAll() { |
Promise.all([validateProjectInfoForm(), validateUserForm(), validateDepartForm()]).then(function (results) { |
||||||
try { |
const params = {...results[0], ...results[1], ...results[2]} |
||||||
Promise.all([validateProjectInfoForm(), validateUserForm(), validateDepartForm()]).then(function (results) { |
console.log('results', params); |
||||||
const params = {...results[0], ...results[1], ...results[2]} |
save4shenbao(params); |
||||||
console.log('results', params); |
}); |
||||||
save4shenbao(params); |
} catch (error) {} |
||||||
}); |
|
||||||
} catch (error){}; |
|
||||||
} |
|
||||||
} catch (error) { |
|
||||||
} |
} |
||||||
} |
return { registerProjectInfo, registerUser, registerDepart, submitAll }; |
||||||
|
}, |
||||||
async function cancel() { |
}); |
||||||
alert("kkkkkkk") |
|
||||||
// window.close(); |
|
||||||
} |
|
||||||
|
|
||||||
// return { register, registerUser, registerDepart, submitAll, tableRef }; |
|
||||||
return {registerProjectInfo, registerUser, registerDepart,cancel,submitAll}; |
|
||||||
}, |
|
||||||
}); |
|
||||||
|
|
||||||
function cancel2() { |
|
||||||
alert("kkkkkkk") |
|
||||||
window.close(); |
|
||||||
} |
|
||||||
</script> |
</script> |
||||||
<style lang="less" scoped> |
<style lang="less" scoped> |
||||||
.high-form { |
.high-form { |
||||||
padding-bottom: 48px; |
padding-bottom: 48px; |
||||||
} |
} |
||||||
|
|
||||||
/** 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-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问题 */ |
||||||
</style> |
</style> |
||||||
|
Loading…
Reference in new issue