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

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

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