...
|
...
|
@@ -8,6 +8,15 @@ var Repayment = function(options) { |
|
|
onDeselectAll: $.noop,
|
|
|
|
|
|
/**
|
|
|
* 返回可选择数目
|
|
|
*
|
|
|
* @returns {number}
|
|
|
*/
|
|
|
onGetSelectableCount: function() {
|
|
|
return 0;
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
* 获取选择
|
|
|
*
|
|
|
* @returns {Array}
|
...
|
...
|
@@ -28,8 +37,10 @@ var Repayment = function(options) { |
|
|
|
|
|
var params = {
|
|
|
action: 'go.instalmentRepayment',
|
|
|
params: {
|
|
|
list: self.setParams(),
|
|
|
amount: self.total
|
|
|
}
|
|
|
};
|
|
|
|
|
|
$(this).attr('href', path + '?openby:yohobuy=' + encodeURIComponent(JSON.stringify(params)));
|
...
|
...
|
@@ -114,11 +125,17 @@ Repayment.prototype.getSelection = function() { |
|
|
return this.settings.onGetSelection();
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
* 更新组件并计算金额
|
|
|
*/
|
|
|
Repayment.prototype.update = function() {
|
|
|
var values = this.getSelection();
|
|
|
var $repaymentBottom = $('.repayment-bottom');
|
|
|
var self = this;
|
|
|
|
|
|
// 是否选择全部
|
|
|
var totalCheck = this.settings.onGetSelectableCount() === values.length;
|
|
|
|
|
|
this.total = 0;
|
|
|
this.fee = 0;
|
|
|
|
...
|
...
|
@@ -136,6 +153,8 @@ Repayment.prototype.update = function() { |
|
|
$repaymentBottom.slideDown();
|
|
|
}
|
|
|
|
|
|
$('#repayment-total').prop('checked', totalCheck).data('checked', totalCheck);
|
|
|
|
|
|
this.setTotal(this.total);
|
|
|
this.setFee(this.fee);
|
|
|
|
...
|
...
|
|