|
@@ -502,7 +502,14 @@ $(document).ready(() => {
|
|
|
});
|
|
|
// 自定义金额变更并提交
|
|
|
$('#calc_zdy').on('blur', function () {
|
|
|
- const newValue = parseFloat($(this).val());
|
|
|
+ let newValue = parseFloat($(this).val());
|
|
|
+ // 判断输入位数,并自动四舍五入
|
|
|
+ newValue = ZhCalc.round(newValue, decimal.tp);
|
|
|
+ $('#calc_zdy').val(newValue);
|
|
|
+ if (isNaN(newValue)) {
|
|
|
+ toastr.error('请输入正确的金额');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
const zdy = _.find(ex_calc, { code: 'zdy' });
|
|
|
if (zdy.value === newValue) {
|
|
|
return;
|