Commit 72475254 authored by gary's avatar gary

1、fix了一半bug

parent 94eb6b17
...@@ -99,6 +99,20 @@ controller('editOrganizationModalController', ['$scope', '$log', '$translate', ' ...@@ -99,6 +99,20 @@ controller('editOrganizationModalController', ['$scope', '$log', '$translate', '
this.orgControlForm.$setSubmitted(); this.orgControlForm.$setSubmitted();
var fail = false;
if($('.localRequired').attr("required")==="required"){
$('.localRequired').each( function (index,ele){
if(null==ele.value||""===ele.value){
SweetAlert.error("请检查必填项");
fail = true;
return false;
}
});
}
if(fail) return;
var hasSpecialChar = window.PWC.hasSpecialChar($scope.editOrgModel.name); var hasSpecialChar = window.PWC.hasSpecialChar($scope.editOrgModel.name);
if (hasSpecialChar) { if (hasSpecialChar) {
$scope.editOrgModel.nameError = $translate.instant('SpecialChar'); $scope.editOrgModel.nameError = $translate.instant('SpecialChar');
...@@ -941,19 +955,15 @@ controller('editOrganizationModalController', ['$scope', '$log', '$translate', ' ...@@ -941,19 +955,15 @@ controller('editOrganizationModalController', ['$scope', '$log', '$translate', '
$scope.changeInternational = function () { $scope.changeInternational = function () {
// $('.local').attr('hidden','hidden');
// $('.international').removeAttr('hidden');
$scope.isLocal = false; $scope.isLocal = false;
$scope.isInternational = true; $scope.isInternational = true;
$('.localRequired').removeAttr("required"); $('.localRequired').removeAttr("required");
}; };
$scope.changeLocal = function () { $scope.changeLocal = function () {
// $('.international').attr('hidden','hidden');
// $('.local').removeAttr('hidden');
$scope.isLocal = true; $scope.isLocal = true;
$scope.isInternational = false; $scope.isInternational = false;
$('.localRequired').attr("required","true"); $('.localRequired').attr("required",true);
}; };
// 强制刷新机构控件里的机构 // 强制刷新机构控件里的机构
...@@ -982,7 +992,10 @@ controller('editOrganizationModalController', ['$scope', '$log', '$translate', ' ...@@ -982,7 +992,10 @@ controller('editOrganizationModalController', ['$scope', '$log', '$translate', '
$scope.regStatusList = constant.RegStatusList; $scope.regStatusList = constant.RegStatusList;
$scope.architectureTypeList = constant.ArchitectureTypeList; $scope.architectureTypeList = constant.ArchitectureTypeList;
$scope.trueFalse = constant.trueFalse; $scope.trueFalse = constant.trueFalse;
$('.localRequired').attr("required","true"); debugger;
$('.localRequired').attr("required",true);
// $('.localRequired').attr("required","true"); required="required"
}; };
// 省改变时联动市 // 省改变时联动市
......
...@@ -47,9 +47,10 @@ ...@@ -47,9 +47,10 @@
| translate}}:</label> | translate}}:</label>
<div class="col-sm-9" <div class="col-sm-9"
ng-class="{'has-error':orgControlForm.name.$invalid && (orgControlForm.name.$dirty || orgControlForm.$submitted)}"> ng-class="{'has-error':orgControlForm.name.$invalid && (orgControlForm.name.$dirty || orgControlForm.$submitted)}">
<!--<input class="form-control localRequired" id="name" ng-model="editOrgModel.name"-->
<input class="form-control localRequired" id="name" ng-model="editOrgModel.name" <input class="form-control localRequired" id="name" ng-model="editOrgModel.name"
name="name" placeholder="{{resources.OrganizationName}}" name="name" placeholder="{{resources.OrganizationName}}"
ng-keyup="nameKeyUp()" maxlength="100" > ng-keyup="nameKeyUp()" maxlength="100">
<p ng-show="orgControlForm.name.$error.required && (orgControlForm.name.$dirty || orgControlForm.$submitted)" <p ng-show="orgControlForm.name.$error.required && (orgControlForm.name.$dirty || orgControlForm.$submitted)"
class="has-error label">{{resources.OrganizationMsgNameRequired}}</p> class="has-error label">{{resources.OrganizationMsgNameRequired}}</p>
<p ng-show="editOrgModel.nameError" class="has-error label"> <p ng-show="editOrgModel.nameError" class="has-error label">
...@@ -131,10 +132,10 @@ ...@@ -131,10 +132,10 @@
| translate}}:</label> | translate}}:</label>
<div class="col-sm-9" <div class="col-sm-9"
ng-class="{'has-error':orgControlForm.registrationCapital.$invalid && (orgControlForm.registrationCapital.$dirty || orgControlForm.$submitted)}"> ng-class="{'has-error':orgControlForm.registrationCapital.$invalid && (orgControlForm.registrationCapital.$dirty || orgControlForm.$submitted)}">
<input class="form-control localRequired" name="registrationCapital" <input class="form-control" name="registrationCapital"
id="registrationCapital" id="registrationCapital"
ng-model="editOrgModel.registrationCapital" ng-model="editOrgModel.registrationCapital"
placeholder="{{resources.RegistrationCapital}}" maxlength="50"> placeholder="{{resources.RegistrationCapital}}" maxlength="50" required>
</div> </div>
</div> </div>
...@@ -480,15 +481,8 @@ ...@@ -480,15 +481,8 @@
</div> </div>
</div> </div>
</div> </div>
<div style="clear: both;"></div> <div style="clear: both;"></div>
</div> </div>
<div class="international" hidden="hidden">
</div>
</form> </form>
</div> </div>
......
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