//======================利用easyui验证功能,进行内容变化监控=== =============
$(function () {
var CustomerService = $.parseJSON($(‘#CustomerService‘).val());
$.extend($.fn.validatebox.defaults.rules, {
//校验正整数,并计算码洋
calculateMY: {
validator: function (value) {
var driverAmount = value * CustomerService.DriverAmountRate;
var Deposit = Math.round(driverAmount * CustomerService.AdvanceRate*100)/100;//预付款
var TransportationExpense = Math.round(driverAmount * CustomerService.FreightRate * 100) / 100;//运费
var AdvancePayment = Math.round(driverAmount * CustomerService.ReceiptDepositRate * 100) / 100;//回执
$(‘#Deposit‘).textbox(‘setValue‘, Deposit);
$(‘#TransportationExpense‘).textbox(‘setValue‘, TransportationExpense);
$(‘#AdvancePayment‘).textbox(‘setValue‘, AdvancePayment);
return true;
},
message: ‘客户费用参数错误‘
}
});
})
原文地址:https://www.cnblogs.com/efreer/p/10191861.html