parent
9605d25f7a
commit
fecd768869
1 changed files with 78 additions and 87 deletions
@ -1,112 +1,103 @@ |
|||||||
<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 type="primary" @click="submitAll"> 提交 </a-button> |
<a-button @click="cancel">取消</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, ref } from 'vue'; |
import {defineComponent} from 'vue'; |
||||||
// import PersonTable from './PersonTable.vue'; |
// import PersonTable from './PersonTable.vue'; |
||||||
import { PageWrapper } from '@/components/Page'; |
import {PageWrapper} from '@/components/Page'; |
||||||
import { projectBaseInfoSchemas, userSchemas, departSchemas } from './data'; |
import {departSchemas, projectBaseInfoSchemas, userSchemas} from './data'; |
||||||
import { Card } from 'ant-design-vue'; |
import {Card} from 'ant-design-vue'; |
||||||
import {defHttp} from "@/utils/http/axios"; |
import {save4shenbao} from './data.api'; |
||||||
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 submitForm() { |
async function submitAll() { |
||||||
// let data = getFieldsValue(); |
try { |
||||||
// let params = Object.assign({}, formData, data); |
async function submitAll() { |
||||||
// console.log('表单数据', params) |
try { |
||||||
// await saveOrUpdate(params, true) |
Promise.all([validateProjectInfoForm(), validateUserForm(), validateDepartForm()]).then(function (results) { |
||||||
// } |
const params = {...results[0], ...results[1], ...results[2]} |
||||||
|
console.log('results', params); |
||||||
async function submitAll() { |
save4shenbao(params); |
||||||
try { |
}); |
||||||
// if (tableRef.value) { |
} catch (error){}; |
||||||
// console.log('table data:', tableRef.value.getDataSource()); |
} |
||||||
// } |
} catch (error) { |
||||||
const [projectBaseInfoValues, userValues, deaprtValues] = await Promise.all([validateProjectInfoForm(), validateUserForm(), validateDepartForm()]); |
} |
||||||
const param = await Promise.resolve([validateProjectInfoForm(), validateUserForm(), validateDepartForm()]); |
} |
||||||
console.log('projectBaseInfoValues form data:', projectBaseInfoValues); |
|
||||||
console.log('userValuesform data:', userValues); |
|
||||||
console.log('deaprtValues form data:', deaprtValues); |
|
||||||
// saveOrUpdate(,false); |
|
||||||
console.log(222222); |
|
||||||
console.log(222222); |
|
||||||
// let param = { id: record.id, useStatus: '1' }; |
|
||||||
|
|
||||||
// let param = JSON.parse(projectBaseInfoValues); |
async function cancel() { |
||||||
console.log("param:",JSON.stringify(param)); |
alert("kkkkkkk") |
||||||
console.log(333); |
// window.close(); |
||||||
// const params = {}; |
} |
||||||
console.log("projectBaseInfoValues:"+projectBaseInfoValues); |
|
||||||
save4shenbao(projectBaseInfoValues); |
|
||||||
// await reload(); |
|
||||||
// defHttp.post({ url: "/project/project/save4shenbao", projectBaseInfoValues}, { isTransformResponse: false }); |
|
||||||
} catch (error) {} |
|
||||||
|
|
||||||
|
// return { register, registerUser, registerDepart, submitAll, tableRef }; |
||||||
|
return {registerProjectInfo, registerUser, registerDepart,cancel,submitAll}; |
||||||
|
}, |
||||||
|
}); |
||||||
|
|
||||||
} |
function cancel2() { |
||||||
|
alert("kkkkkkk") |
||||||
// return { register, registerUser, registerDepart, submitAll, tableRef }; |
window.close(); |
||||||
return { registerProjectInfo, registerUser, registerDepart, submitAll }; |
} |
||||||
}, |
|
||||||
}); |
|
||||||
</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-begin-author:taoyan date:2022-5-16 for:/issues/63 下拉框z-index问题 */ |
/** update-end-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