|
|
@@ -47,6 +47,15 @@ define(['app/app'], function (app) {
|
|
|
}
|
|
|
return len;
|
|
|
}
|
|
|
+ var cutOutString = function (str, length) {
|
|
|
+ for (var i = 1; i <= str.length; i++) {
|
|
|
+ if (getRealLen(str.substr(0, i)) > length){
|
|
|
+ str = str.substr(0, i-1);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return str;
|
|
|
+ };
|
|
|
|
|
|
$scope.nowDate = new Date();
|
|
|
|
|
|
@@ -109,7 +118,7 @@ define(['app/app'], function (app) {
|
|
|
}
|
|
|
$scope.onProduceDateChange = function () {
|
|
|
if ($scope.applyObj.produceDate && getRealLen($scope.applyObj.produceDate) > 12) {
|
|
|
- $scope.applyObj.produceDate = $scope.applyObj.produceDate.substring(0, $scope.applyObj.produceDate.length - 1)
|
|
|
+ $scope.applyObj.produceDate = cutOutString($scope.applyObj.produceDate, 12);
|
|
|
}
|
|
|
}
|
|
|
$scope.checkAmount = function () {
|