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

master
zhc077 1 month ago
parent 4a6c9150b5
commit 79efe8964e
  1. 41
      jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/project/controller/ProjectController.java
  2. 4
      jeecgboot-vue3/src/views/projectApplication/kejigongguan/xiangmushu/JiBenXinXi.api.ts
  3. 0
      jeecgboot-vue3/src/views/projectApplication/kejigongguan/xiangmushu/JiBenXinXi.ts
  4. 35
      jeecgboot-vue3/src/views/projectApplication/kejigongguan/xiangmushu/JiBenXinXiDemo.vue

@ -1,5 +1,6 @@
package org.jeecg.modules.demo.project.controller; package org.jeecg.modules.demo.project.controller;
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;
@ -12,9 +13,17 @@ 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.common.system.query.QueryRuleEnum; import org.jeecg.common.system.query.QueryRuleEnum;
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.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.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
@ -39,6 +48,18 @@ public class ProjectController extends JeecgController<Project, IProjectService>
@Autowired @Autowired
private IProjectService projectService; private IProjectService projectService;
@Autowired
private IUserExtService userExtService;
@Autowired
private ISysUserService iSysUserService;
@Autowired
private IDepartExtService iDepartExtService;
@Autowired
private ISysDepartService iSysDepartService;
/** /**
* 分页列表查询 * 分页列表查询
* *
@ -70,7 +91,25 @@ 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 project,HttpServletRequest req) {
return Result.OK(projectService.getById("1847214041989091329")); return Result.OK(projectService.getById(project.getId()));
}
@ApiOperation(value = "获取项目负责人信息", notes = "获取项目负责人信息")
@GetMapping(value = "/getUserInfo")
public Result<UserExt> getUserInfo(Project para,HttpServletRequest req) {
Project project = projectService.getById(para.getId());
UserExt userExt = userExtService.getOne(new LambdaQueryWrapper<UserExt>().eq(UserExt::getUserId, project.getProjectCharger()));
return Result.OK(userExt);
}
@ApiOperation(value = "获取申请单位信息", notes = "获取申请单位信息")
@GetMapping(value = "/getDepartInfo")
public Result<DepartExt> getDepartInfo(Project para,HttpServletRequest req) {
Project project = projectService.getById(para.getId());
SysUser sysUser = iSysUserService.getById(project.getProjectCharger());
SysDepart sysDepart = iSysDepartService.getOne(new LambdaQueryWrapper<SysDepart>().eq(SysDepart::getOrgCode, sysUser.getOrgCode()));
DepartExt departExt = iDepartExtService.getOne(new LambdaQueryWrapper<DepartExt>().eq(DepartExt::getDepartId, sysDepart.getId()));
return Result.OK(departExt);
} }
/** /**

@ -6,8 +6,8 @@ const {createConfirm} = useMessage();
enum Api { enum Api {
list = '/project/project/list', list = '/project/project/list',
projectInfo = '/project/project/getById', projectInfo = '/project/project/getById',
userInfo = '/project/project/getById', userInfo = '/project/project/getUserInfo',
departInfo = '/project/project/getById', departInfo = '/project/project/getDepartInfo',
save = '/project/project/add', save = '/project/project/add',
shenbao = '/project/project/save4shenbao', shenbao = '/project/project/save4shenbao',
edit = '/project/project/edit', edit = '/project/project/edit',

@ -20,17 +20,20 @@
import { BasicForm, useForm } from '@/components/Form'; import { BasicForm, useForm } from '@/components/Form';
import {defineComponent, ref} from 'vue'; import {defineComponent, ref} from 'vue';
import { PageWrapper } from '@/components/Page'; import { PageWrapper } from '@/components/Page';
import { projectBaseInfoSchemas, userSchemas, departSchemas } from './jiBenXinXi'; import { projectBaseInfoSchemas, userSchemas, departSchemas } from './JiBenXinXi';
import { Card } from 'ant-design-vue'; import { Card } from 'ant-design-vue';
import {defHttp} from "@/utils/http/axios"; import {defHttp} from "@/utils/http/axios";
import {save4shenbao,getProjectById,getUserByProjectId,getDepartByProjectId} from './jiBenXinXi.api'; import {save4shenbao,getProjectById,getUserByProjectId,getDepartByProjectId} from './JiBenXinXi.api';
import { useRouter } from 'vue-router'; import {useRoute, useRouter} from 'vue-router';
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 { currentRoute, back } = useRouter(); const route = useRoute();
const {back } = useRouter();
let params = {
id: route.query.id,
}
const [registerProjectInfo, { validate: validateProjectInfoForm ,setFieldsValue}] = useForm({ const [registerProjectInfo, { validate: validateProjectInfoForm ,setFieldsValue}] = useForm({
baseColProps: { baseColProps: {
span: 6, span: 6,
@ -41,14 +44,14 @@ export default defineComponent({
showActionButtonGroup: false, showActionButtonGroup: false,
}); });
const uploadValue = async() => { const uploadValue = async() => {
const baseInfoObj = await getProjectById(); const projectObj = await getProjectById(params);
console.log('baseInfoObj',JSON.stringify(baseInfoObj)) console.log('projectObj',JSON.stringify(projectObj))
await setFieldsValue(baseInfoObj) await setFieldsValue(projectObj)
} }
setTimeout(()=>{ setTimeout(()=>{
uploadValue() uploadValue()
},0) },0)
const [registerUser, formMethods] = useForm({ const [registerUser, formMethods] = useForm({
baseColProps: { baseColProps: {
span: 6, span: 6,
@ -60,16 +63,16 @@ export default defineComponent({
}); });
const setFieldValues = formMethods.setFieldsValue; const setFieldValues = formMethods.setFieldsValue;
const uploadValue2 = async() => { const uploadValue2 = async() => {
console.log( formMethods.setFieldsValue,' formMethods.setFieldsValue') // console.log( formMethods.setFieldsValue,' formMethods.setFieldsValue')
const userInfoObj = await getUserByProjectId(); const userInfoObj = await getUserByProjectId(params);
console.log('userInfoObj',JSON.stringify(userInfoObj)) console.log('userInfoObj',JSON.stringify(userInfoObj))
// await setFieldValues({currentPerfession:1}) // await setFieldValues({currentPerfession:1})
await setFieldValues({userInfoObj}) await setFieldValues(userInfoObj)
} }
setTimeout(()=>{ setTimeout(()=>{
uploadValue2() uploadValue2()
},200) },200)
const [registerDepart, formMethods2] = useForm({ const [registerDepart, formMethods2] = useForm({
baseColProps: { baseColProps: {
span: 6, span: 6,
@ -81,11 +84,11 @@ export default defineComponent({
}); });
const setFieldValues2 = formMethods2.setFieldsValue; const setFieldValues2 = formMethods2.setFieldsValue;
const uploadValue3 = async() => { const uploadValue3 = async() => {
console.log( formMethods2.setFieldsValue,' formMethods.setFieldsValue') // console.log( formMethods2.setFieldsValue,' formMethods.setFieldsValue')
const departInfoObj = await getDepartByProjectId(); const departInfoObj = await getDepartByProjectId(params);
console.log('departInfoObj',JSON.stringify(departInfoObj)) console.log('departInfoObj',JSON.stringify(departInfoObj))
// await setFieldValues2({bankNo:1,category:'2'}) // await setFieldValues2({bankNo:1,category:'2'})
await setFieldValues2({departInfoObj}) await setFieldValues2(departInfoObj)
} }
setTimeout(()=>{ setTimeout(()=>{
uploadValue3() uploadValue3()

Loading…
Cancel
Save