|
|
@ -23,7 +23,7 @@ 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} from './jiBenXinXi.api'; |
|
|
|
import {save4shenbao,getProjectById,getUserByProjectId,getDepartByProjectId} from './jiBenXinXi.api'; |
|
|
|
import { useRouter } from 'vue-router'; |
|
|
|
import { useRouter } from 'vue-router'; |
|
|
|
|
|
|
|
|
|
|
|
export default defineComponent({ |
|
|
|
export default defineComponent({ |
|
|
@ -31,7 +31,7 @@ export default defineComponent({ |
|
|
|
components: { BasicForm, PageWrapper, [Card.name]: Card }, |
|
|
|
components: { BasicForm, PageWrapper, [Card.name]: Card }, |
|
|
|
setup() { |
|
|
|
setup() { |
|
|
|
const { currentRoute, back } = useRouter(); |
|
|
|
const { currentRoute, back } = useRouter(); |
|
|
|
const [registerProjectInfo, { validate: validateProjectInfoForm }] = useForm({ |
|
|
|
const [registerProjectInfo, { validate: validateProjectInfoForm ,setFieldsValue}] = useForm({ |
|
|
|
baseColProps: { |
|
|
|
baseColProps: { |
|
|
|
span: 6, |
|
|
|
span: 6, |
|
|
|
}, |
|
|
|
}, |
|
|
@ -40,8 +40,16 @@ export default defineComponent({ |
|
|
|
schemas: projectBaseInfoSchemas, |
|
|
|
schemas: projectBaseInfoSchemas, |
|
|
|
showActionButtonGroup: false, |
|
|
|
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: { |
|
|
|
baseColProps: { |
|
|
|
span: 6, |
|
|
|
span: 6, |
|
|
|
}, |
|
|
|
}, |
|
|
@ -50,8 +58,19 @@ export default defineComponent({ |
|
|
|
schemas: userSchemas, |
|
|
|
schemas: userSchemas, |
|
|
|
showActionButtonGroup: false, |
|
|
|
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: { |
|
|
|
baseColProps: { |
|
|
|
span: 6, |
|
|
|
span: 6, |
|
|
|
}, |
|
|
|
}, |
|
|
@ -60,10 +79,20 @@ export default defineComponent({ |
|
|
|
schemas: departSchemas, |
|
|
|
schemas: departSchemas, |
|
|
|
showActionButtonGroup: false, |
|
|
|
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() { |
|
|
|
async function submitAll() { |
|
|
|
try { |
|
|
|
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]} |
|
|
|
const params = {...results[0], ...results[1], ...results[2]} |
|
|
|
console.log('results', JSON.stringify(params)); |
|
|
|
console.log('results', JSON.stringify(params)); |
|
|
|
save4shenbao(params); |
|
|
|
save4shenbao(params); |
|
|
|