Showing
1 changed file
with
9 additions
and
2 deletions
@@ -59,8 +59,8 @@ $('.status').each(function() { | @@ -59,8 +59,8 @@ $('.status').each(function() { | ||
59 | $(CHECKBOX_SELECTOR + ':checkbox').click(function() { | 59 | $(CHECKBOX_SELECTOR + ':checkbox').click(function() { |
60 | // var selection = repayment.getSelection(); | 60 | // var selection = repayment.getSelection(); |
61 | // var isSkipped = false; | 61 | // var isSkipped = false; |
62 | - // var curSel = $(this).data('sortId'); | ||
63 | - // var isChecked = $(this).is(':checked'); | 62 | + // |
63 | + | ||
64 | // | 64 | // |
65 | // | 65 | // |
66 | // if (isChecked && selection[0] !== curSel || | 66 | // if (isChecked && selection[0] !== curSel || |
@@ -77,7 +77,9 @@ $(CHECKBOX_SELECTOR + ':checkbox').click(function() { | @@ -77,7 +77,9 @@ $(CHECKBOX_SELECTOR + ':checkbox').click(function() { | ||
77 | 77 | ||
78 | var selection = repayment.getSelection(); | 78 | var selection = repayment.getSelection(); |
79 | var isSkipped = false; | 79 | var isSkipped = false; |
80 | + var isChecked = $(this).is(':checked'); | ||
80 | var lastIndex = $('input:first').data('sortId'); | 81 | var lastIndex = $('input:first').data('sortId'); |
82 | + var curSel = $(this).data('sortId'); | ||
81 | var self = this; | 83 | var self = this; |
82 | 84 | ||
83 | selection.forEach(function(sel) { | 85 | selection.forEach(function(sel) { |
@@ -88,6 +90,11 @@ $(CHECKBOX_SELECTOR + ':checkbox').click(function() { | @@ -88,6 +90,11 @@ $(CHECKBOX_SELECTOR + ':checkbox').click(function() { | ||
88 | } | 90 | } |
89 | }); | 91 | }); |
90 | 92 | ||
93 | + // 取消选择时候判断下标,只能先取消大的 | ||
94 | + if (selection && selection.length > 0 && !isChecked && curSel < selection[0].index) { | ||
95 | + isSkipped = true; | ||
96 | + } | ||
97 | + | ||
91 | if (isSkipped) { | 98 | if (isSkipped) { |
92 | setTimeout(function() { | 99 | setTimeout(function() { |
93 | tip.show($(self).is(':checked') ? '请按时间顺序取消选择,不可以跨期' : '请按时间顺序添加还款,不可以跨期'); | 100 | tip.show($(self).is(':checked') ? '请按时间顺序取消选择,不可以跨期' : '请按时间顺序添加还款,不可以跨期'); |
-
Please register or login to post a comment