Commit 84cea4d5840b98191b9b7860ddd6e7e5084aeb0d
1 parent
077bf7cd
线调-服务热线-报备登记重复提交事件问题修复;
Showing
2 changed files
with
12 additions
and
3 deletions
src/main/resources/static/real_control_v2/fragments/north/nav/report_register/add.html
| ... | ... | @@ -568,7 +568,9 @@ |
| 568 | 568 | |
| 569 | 569 | //校验 |
| 570 | 570 | formActive.formValidation({framework: 'uikit', locale: 'zh_CN'}); |
| 571 | - //提交 | |
| 571 | + //解绑事件(防止重复绑定同一事件提交多份数据) | |
| 572 | + formActive.off('success.form.fv'); | |
| 573 | + //提交事件 | |
| 572 | 574 | formActive.on('success.form.fv', function (e) { |
| 573 | 575 | e.preventDefault(); |
| 574 | 576 | // disabled_submit_btn(formActive); | ... | ... |
src/main/resources/static/real_control_v2/fragments/north/nav/report_register/update.html
| ... | ... | @@ -578,8 +578,13 @@ |
| 578 | 578 | |
| 579 | 579 | //校验 |
| 580 | 580 | formActive.formValidation({framework: 'uikit', locale: 'zh_CN'}); |
| 581 | - //提交 | |
| 582 | - formActive.on('success.form.fv', function (e) { | |
| 581 | + //解绑事件(防止重复绑定同一事件提交多份数据) | |
| 582 | + formActive.off('success.form.fv'); | |
| 583 | + formActive.off('success'); | |
| 584 | + formActive.off('click'); | |
| 585 | + formActive.off('err'); | |
| 586 | + //提交事件(one:只触发一次后自动解绑) | |
| 587 | + formActive.one('success.form.fv', function (e) { | |
| 583 | 588 | e.preventDefault(); |
| 584 | 589 | var headData = $('#add_head_table').serializeJSON(); |
| 585 | 590 | var bodyData = $(formActive).serializeJSON(); |
| ... | ... | @@ -600,6 +605,8 @@ |
| 600 | 605 | notify_err('修改失败!'); |
| 601 | 606 | }); |
| 602 | 607 | }); |
| 608 | +// var events = $._data($('#'+tableActiveStr)[0], "events"); | |
| 609 | +// console.log(events); | |
| 603 | 610 | } |
| 604 | 611 | |
| 605 | 612 | //submit | ... | ... |