提交 69bdfed6 authored 作者: 钟是志's avatar 钟是志

28146 审核时如果有必填项 审核框位置往下移动不要挡住必填项 【或者给一个弹窗提示 请先填写必填项】

上级 2926881d
...@@ -10,6 +10,8 @@ import Btn from '../pagesBtn'; ...@@ -10,6 +10,8 @@ import Btn from '../pagesBtn';
import MyModal from '../Modal'; import MyModal from '../Modal';
import styles from './styles.less'; import styles from './styles.less';
import stylesList from './styles-in-line'; import stylesList from './styles-in-line';
import { checkNeedFormValidateFieldsAndScroll } from '@/webPublic/one_stop_public/DetailForAudit/splitDetailSplit';
const { TextArea } = Input; const { TextArea } = Input;
export default class userButton extends Component { export default class userButton extends Component {
constructor() { constructor() {
...@@ -115,7 +117,12 @@ export default class userButton extends Component { ...@@ -115,7 +117,12 @@ export default class userButton extends Component {
* 用于确认用户输入 * 用于确认用户输入
*/ */
postUser = () => { postUser = () => {
const { key, btnValue, value, checked } = this.state; const {
key,
btnValue,
value,
checked
} = this.state;
this.props.affairOk(key, btnValue, value, checked); this.props.affairOk(key, btnValue, value, checked);
}; };
...@@ -133,17 +140,49 @@ export default class userButton extends Component { ...@@ -133,17 +140,49 @@ export default class userButton extends Component {
this.setState({ checked: e.target.checked }); this.setState({ checked: e.target.checked });
}; };
checkAndShowModal(item = {}) {
const {
form,
btns
} = this.props;
const showM = () => {
this.showModal(item.name, item.key, item.value);
return true;
};
if (form && form.validateFieldsAndScroll) {
let checkSumbitInfo = checkNeedFormValidateFieldsAndScroll({ // 检查是否必须填写表单值
btns,
btnValue: item.value,
});
if (!checkSumbitInfo) { // 如果不需要校验 直接提交数据
return showM();
} else {
form.validateFieldsAndScroll((err, values) => {
if (!err) {
return showM();
}
});
}
} else {
return showM();
}
}
render() { render() {
const { visibleOk, value, user } = this.state; const {
visibleOk,
value,
user
} = this.state;
const { const {
btns, btns,
isSecond, isSecond,
isSumbitLoading, isSumbitLoading,
addition, // 附件按钮 只负责显示 addition, // 附件按钮 只负责显示
Sign, // 判断是否有签名 Sign, // 判断是否有签名
form,
} = this.props; } = this.props;
return ( return (
<> <>
<div className={styles.btn_page} id={'form_btns_list'}> <div className={styles.btn_page} id={'form_btns_list'}>
...@@ -154,9 +193,7 @@ export default class userButton extends Component { ...@@ -154,9 +193,7 @@ export default class userButton extends Component {
<Btn <Btn
get="8" get="8"
key={index} key={index}
btnOne={() => { btnOne={this.checkAndShowModal.bind(this, item)}
this.showModal(item.name, item.key, item.value);
}}
text={item.name} text={item.name}
style={className} style={className}
/> />
...@@ -173,13 +210,13 @@ export default class userButton extends Component { ...@@ -173,13 +210,13 @@ export default class userButton extends Component {
handleCancel={this.handleCancelOk}> handleCancel={this.handleCancelOk}>
<div style={stylesList.is_ok}> <div style={stylesList.is_ok}>
<p style={stylesList.header}> <p style={stylesList.header}>
<span style={{...stylesList.headerSpan, ...stylesList.headerSpan_1}}> <span style={{ ...stylesList.headerSpan, ...stylesList.headerSpan_1 }}>
{isSecond ? '当前状态' : '审批结果'} {isSecond ? '当前状态' : '审批结果'}
</span> </span>
{this.getUser()} {this.getUser()}
</p> </p>
<div style={stylesList.body}> <div style={stylesList.body}>
<span style={{...stylesList.body_span, ...stylesList.body_span_1}}> <span style={{ ...stylesList.body_span, ...stylesList.body_span_1 }}>
{isSecond ? '发起说明' : '审批说明'} {isSecond ? '发起说明' : '审批说明'}
</span> </span>
<span id={'textarea_shen_pi_li_you'}> <span id={'textarea_shen_pi_li_you'}>
...@@ -187,17 +224,21 @@ export default class userButton extends Component { ...@@ -187,17 +224,21 @@ export default class userButton extends Component {
value={value} value={value}
onChange={this.onChange} onChange={this.onChange}
placeholder={isSecond ? '请输入发起说明' : '请输入审批理由'} placeholder={isSecond ? '请输入发起说明' : '请输入审批理由'}
style={{ width: 380, height: 120, color: '#7F8B95' }} style={{
width: 380,
height: 120,
color: '#7F8B95'
}}
/> />
</span> </span>
</div> </div>
{Sign ? ( {Sign ? (
<div style={stylesList.body}> <div style={stylesList.body}>
<span style={{...stylesList.body_span, ...stylesList.body_span_1}}> <span style={{ ...stylesList.body_span, ...stylesList.body_span_1 }}>
使用签名 使用签名
</span> </span>
<span style={{...stylesList.body_span}}> <span style={{ ...stylesList.body_span }}>
<Checkbox defaultChecked={user.isUseBackImage} onChange={this.onChange1} /> <Checkbox defaultChecked={user.isUseBackImage} onChange={this.onChange1}/>
</span> </span>
</div> </div>
) : ( ) : (
......
...@@ -315,12 +315,12 @@ export default class DetailSplit extends Component { ...@@ -315,12 +315,12 @@ export default class DetailSplit extends Component {
callback(); callback();
} }
let checkSumbitInfo = checkNeedFormValidateFieldsAndScroll({ let checkSumbitInfo = checkNeedFormValidateFieldsAndScroll({ // 检查是否必填表单值
btns, btns,
btnValue, btnValue,
}); });
let needWriteAuditInfo = checkNeedWriteAuditInfo({ let needWriteAuditInfo = checkNeedWriteAuditInfo({ // 检查是否必填审批理由
btns, btns,
btnValue, btnValue,
}); });
...@@ -867,6 +867,7 @@ export default class DetailSplit extends Component { ...@@ -867,6 +867,7 @@ export default class DetailSplit extends Component {
isSumbitLoading={isSumbitLoading} isSumbitLoading={isSumbitLoading}
isSecond={isSecond} isSecond={isSecond}
affairOk={this.affairOk} affairOk={this.affairOk}
form={this.props.form}
btns={btns} btns={btns}
addition={ addition={
<> <>
......
...@@ -35,7 +35,6 @@ export default class GetDetail extends Component { ...@@ -35,7 +35,6 @@ export default class GetDetail extends Component {
render() { render() {
const {id} = this.state; const {id} = this.state;
console.log(this.props.showPrint);
const { const {
detailInfoDivStyle = { detailInfoDivStyle = {
backgroundColor: '#FFFFFF', backgroundColor: '#FFFFFF',
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论