Commit 800db84b authored by sherlock's avatar sherlock

manual formula not number valid

parent 5358de9d
...@@ -239,11 +239,42 @@ ...@@ -239,11 +239,42 @@
closeOnCancel: true closeOnCancel: true
}, },
function (isConfirm) { function (isConfirm) {
if (isConfirm) { if(isConfirm){
var message;
var r = /^00\d*|^\.\d+|\.$/;
doConfirmEventHandler(); if ($scope.detail.inputValue && (isNaN($scope.detail.inputValue) || r.test($scope.detail.inputValue))) {
message = $translate.instant('CheckInputValueFormat');
} else if ($scope.detail.inputValue && parseFloat($scope.detail.inputValue).toFixed(2) > 9999999999999) {
message = $translate.instant('CheckInputValueLength');
} else if ($scope.detail.dataType === 5) {
r = /^(-[1-9]\d*|[1-9]\d*|[0]{1,1})$/;
if (!r.test($scope.detail.inputValue)) {
message = $translate.instant('CheckIntInputValue');
}
}
if ($scope.detail.inputMemo && $scope.detail.inputMemo.length > 500) {
message = $translate.instant('CheckInputMemoLength');
}
if (message) {
setTimeout(function () {
swal({
title: "warning!",
text: message,
type: "warning",
showCancelButton: false,
confirmButtonColor: "#DD6B55",
confirmButtonText: '确认',
closeOnConfirm: true
}, function (isConfirm) {
if (isConfirm) {
return;
}
})},500);
} else { } else {
doConfirmEventHandler();
}
}
else {
swal.close(); swal.close();
} }
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment