提交 020582f0 authored 作者: 王绍森's avatar 王绍森

历史表单修改

上级 cc7122fe
...@@ -11,6 +11,10 @@ let ApplyPage = ({ id, form }) => { ...@@ -11,6 +11,10 @@ let ApplyPage = ({ id, form }) => {
function submitCb(res) { function submitCb(res) {
ModalInfo(`提交${res ? '成功' : '失败'}!`, {onOk: () => router.goBack()}); ModalInfo(`提交${res ? '成功' : '失败'}!`, {onOk: () => router.goBack()});
} }
function saveDraftCb(res) {
ModalInfo(`提交${res ? '成功' : '失败'}!`, {onOk: () => router.goBack()});
}
return ( return (
<Shell styleShell={{ marginTop: 0 }}> <Shell styleShell={{ marginTop: 0 }}>
<Entrance id={id} isCg="false" get="web" form={form} /> <Entrance id={id} isCg="false" get="web" form={form} />
...@@ -22,6 +26,7 @@ let ApplyPage = ({ id, form }) => { ...@@ -22,6 +26,7 @@ let ApplyPage = ({ id, form }) => {
openDraftButton openDraftButton
DraftButtonText="暂存" DraftButtonText="暂存"
callback={submitCb} callback={submitCb}
draftCallback={saveDraftCb}
/> />
</div> </div>
</Shell> </Shell>
......
...@@ -82,7 +82,7 @@ function AuditButton(props) { ...@@ -82,7 +82,7 @@ function AuditButton(props) {
} }
function showModal(str, key, value) { function showModal(str, key, value) {
setModalContent(`确定审核${str}吗?`); setModalContent(`确定${str}吗?`);
setAffairParams({ oldKey: key, btnValue: value }); setAffairParams({ oldKey: key, btnValue: value });
setVisible(true); setVisible(true);
} }
......
...@@ -5,7 +5,7 @@ import { ModalInfo } from '@/baseComponent/Modal'; ...@@ -5,7 +5,7 @@ import { ModalInfo } from '@/baseComponent/Modal';
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import { getHistoryFormDetail } from '../../Services'; import { getHistoryFormDetail } from '../../Services';
import withGoBack from '@/highOrderComponent/withGoBack'; import withGoBack from '@/highOrderComponent/withGoBack';
import HistoryForm from '@/webPublic/one_stop_public/Entrance/historyForm'; import HistoryForm from '@/webPublic/FormInsertDiy/HistoryForm';
import AuditButton from '../AuditButton'; import AuditButton from '../AuditButton';
import styles from '../RenderForm/index.less'; import styles from '../RenderForm/index.less';
......
/* eslint-disable no-nested-ternary */
/**
* 历史表单+最新表单生成
* data 'affair/getIdFormDetail' 接口返回的详细参数
* form 表单控件
* isNewForm 是否展示最新表单
*/
import React from 'react';
import { Spin, Card } from 'antd';
import { isEmpty } from '@/webPublic/one_stop_public/copy';
import RenderForm from '../RenderForm';
import styles from './index.less';
export default function HistoryForm(props) {
const { data, isNewForm } = props;
return (
<div>
{data.hisTaskForm.formKeys && data.hisTaskForm.formKeys.length > 0
? data.hisTaskForm.formKeys.map((item, index) => {
return (
<Card
key={item.formKey}
title={item.taskName}
bordered={false}
style={{ width: 800, margin: 'auto' }}
>
{!data ? (
<div
style={{
width: '100%',
height: 200,
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
}}
>
<Spin size="large" />
</div>
) : (
<RenderForm
get="web"
isCg="no"
postData={data}
obj={data.hisTaskForm.formData}
form={props.form}
formKey={item.formKey}
/>
)}
</Card>
);
})
: ''}
{isNewForm ? ( // 展示最新表单
data.isHandle && !!data.taskFormKey ? (
<Card
title="当前流程"
bordered={false}
style={{ width: 800, margin: 'auto' }}
>
{!isEmpty(data) && (
<RenderForm
postData={data}
get="web"
isCg="no"
obj={data.hisTaskForm.formData}
table="new"
form={props.form}
/>
)}
</Card>
) : null
) : null}
</div>
);
}
.title {
font-size: 20px;
font-weight: bolder;
margin: 16px 0 8px 0;
padding-left: calc((100% - 800px) / 2);
}
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import { Form, Spin } from 'antd'; import { Form, Spin } from 'antd';
import Shell from '@/baseComponent/Shell'; import Shell from '@/baseComponent/Shell';
import HistoryForm from '@/webPublic/one_stop_public/Entrance/historyForm'; import HistoryForm from '@/webPublic/FormInsertDiy/HistoryForm';
import { getHistoryFormDetail } from '../../Services'; import { getHistoryFormDetail } from '../../Services';
import withGoBack from '@/highOrderComponent/withGoBack'; import withGoBack from '@/highOrderComponent/withGoBack';
......
...@@ -3,10 +3,10 @@ import ZdyTable from '@/webPublic/one_stop_public/Table'; ...@@ -3,10 +3,10 @@ import ZdyTable from '@/webPublic/one_stop_public/Table';
import styles from './index.less'; import styles from './index.less';
import { fetchTemplateByCode, fetchTableItem } from '@/webPublic/Services'; import { fetchTemplateByCode, fetchTableItem } from '@/webPublic/Services';
export default function RenderForm({ get = 'web', isCg = 'yes', form, postData }) { export default function RenderForm({ get = 'web', isCg = 'yes', ...rest }) {
return ( return (
<div className={styles.zyd_onestop_style_class}> <div className={styles.zyd_onestop_style_class}>
<ZdyTable get={get} isCg={isCg} postData={postData} form={form} /> <ZdyTable get={get} isCg={isCg} {...rest} />
</div> </div>
); );
} }
...@@ -73,6 +73,12 @@ export function RenderFormByObjId({ ...@@ -73,6 +73,12 @@ export function RenderFormByObjId({
); );
return ( return (
<RenderFormByContent get={get} isCg={isCg} content={content} templateCode={templateCode} form={form} /> <RenderFormByContent
get={get}
isCg={isCg}
content={content}
templateCode={templateCode}
form={form}
/>
); );
} }
.zyd_onestop_style_class{ .zyd_onestop_style_class{
padding: 20px;
table, td, div{ table, td, div{
overflow: unset !important; overflow: unset !important;
} }
} }
...@@ -65,8 +65,6 @@ export default class idnex extends Component { ...@@ -65,8 +65,6 @@ export default class idnex extends Component {
if(this.props?.callback){ if(this.props?.callback){
this.props.callback(val) this.props.callback(val)
} }
} else {
openToast('error', '保存失败', '请尝试');
} }
}, },
}).then(()=>{ }).then(()=>{
...@@ -140,8 +138,9 @@ export default class idnex extends Component { ...@@ -140,8 +138,9 @@ export default class idnex extends Component {
openDraftButton? openDraftButton?
<Button <Button
style={{ style={{
marginRight:20 marginRight:24
}} }}
shape='round'
isLoading={isLoading} isLoading={isLoading}
onClick={this.handleDraft} onClick={this.handleDraft}
> >
...@@ -153,6 +152,8 @@ export default class idnex extends Component { ...@@ -153,6 +152,8 @@ export default class idnex extends Component {
onClick={this.showModal} onClick={this.showModal}
isLoading={isLoading} isLoading={isLoading}
type='primary' type='primary'
shape='round'
ghost
> >
{ {
text??'提交' text??'提交'
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论