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

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

@ -70,7 +70,7 @@ public class ProjectController extends JeecgController<Project, IProjectService>
@ApiOperation(value = "项目表-根据id查询", notes = "项目表-根据id查询")
@GetMapping(value = "/getById")
public Result<Project> getById(Project project,HttpServletRequest req) {
return Result.OK(projectService.getById(project.getId()));
return Result.OK(projectService.getById("1847214041989091329"));
}
/**

@ -23,7 +23,7 @@ import { PageWrapper } from '@/components/Page';
import { projectBaseInfoSchemas, userSchemas, departSchemas } from './jiBenXinXi';
import { Card } from 'ant-design-vue';
import {defHttp} from "@/utils/http/axios";
import {save4shenbao} from './jiBenXinXi.api';
import {save4shenbao,getProjectById,getUserByProjectId,getDepartByProjectId} from './jiBenXinXi.api';
import { useRouter } from 'vue-router';
export default defineComponent({
@ -31,7 +31,7 @@ export default defineComponent({
components: { BasicForm, PageWrapper, [Card.name]: Card },
setup() {
const { currentRoute, back } = useRouter();
const [registerProjectInfo, { validate: validateProjectInfoForm }] = useForm({
const [registerProjectInfo, { validate: validateProjectInfoForm ,setFieldsValue}] = useForm({
baseColProps: {
span: 6,
},
@ -40,8 +40,16 @@ export default defineComponent({
schemas: projectBaseInfoSchemas,
showActionButtonGroup: false,
});
const uploadValue = async() => {
const baseInfoObj = await getProjectById();
console.log('baseInfoObj',JSON.stringify(baseInfoObj))
await setFieldsValue(baseInfoObj)
}
setTimeout(()=>{
uploadValue()
const [registerUser, { validate: validateUserForm }] = useForm({
},0)
const [registerUser, formMethods] = useForm({
baseColProps: {
span: 6,
},
@ -50,8 +58,19 @@ export default defineComponent({
schemas: userSchemas,
showActionButtonGroup: false,
});
const setFieldValues = formMethods.setFieldsValue;
const uploadValue2 = async() => {
console.log( formMethods.setFieldsValue,' formMethods.setFieldsValue')
const userInfoObj = await getUserByProjectId();
console.log('userInfoObj',JSON.stringify(userInfoObj))
// await setFieldValues({currentPerfession:1})
await setFieldValues({userInfoObj})
}
setTimeout(()=>{
uploadValue2()
const [registerDepart, { validate: validateDepartForm }] = useForm({
},200)
const [registerDepart, formMethods2] = useForm({
baseColProps: {
span: 6,
},
@ -60,10 +79,20 @@ export default defineComponent({
schemas: departSchemas,
showActionButtonGroup: false,
});
const setFieldValues2 = formMethods2.setFieldsValue;
const uploadValue3 = async() => {
console.log( formMethods2.setFieldsValue,' formMethods.setFieldsValue')
const departInfoObj = await getDepartByProjectId();
console.log('departInfoObj',JSON.stringify(departInfoObj))
// await setFieldValues2({bankNo:1,category:'2'})
await setFieldValues2({departInfoObj})
}
setTimeout(()=>{
uploadValue3()
},200)
async function submitAll() {
try {
Promise.all([validateProjectInfoForm(), validateUserForm(), validateDepartForm()]).then(function (results) {
Promise.all([validateProjectInfoForm(), formMethods.validate(), formMethods2.validate()]).then(function (results) {
const params = {...results[0], ...results[1], ...results[2]}
console.log('results', JSON.stringify(params));
save4shenbao(params);

@ -5,7 +5,9 @@ const {createConfirm} = useMessage();
enum Api {
list = '/project/project/list',
getOne = '/project/project/getById',
projectInfo = '/project/project/getById',
userInfo = '/project/project/getById',
departInfo = '/project/project/getById',
save = '/project/project/add',
shenbao = '/project/project/save4shenbao',
edit = '/project/project/edit',
@ -32,8 +34,14 @@ export const list = (params) =>
defHttp.get({url: Api.list, params});
export const getById = (params) =>
defHttp.get({url: Api.getOne, params});
export const getProjectById = (params) =>
defHttp.get({url: Api.projectInfo, params});
export const getUserByProjectId = (params) =>
defHttp.get({url: Api.userInfo, params});
export const getDepartByProjectId = (params) =>
defHttp.get({url: Api.departInfo, params});
/**
* 删除单个

Loading…
Cancel
Save