Commit c6bee104 authored by gary's avatar gary

1、fixbug

parent cc4c112b
...@@ -117,6 +117,8 @@ public class OrganizationDto { ...@@ -117,6 +117,8 @@ public class OrganizationDto {
private Boolean oversea; private Boolean oversea;
private String country;
public List<EnterpriseAccountSetOrgDto> enterpriseAccountSetOrgList; public List<EnterpriseAccountSetOrgDto> enterpriseAccountSetOrgList;
public List<OrganizationServiceTemplateGroupDto> organizationServiceTemplateGroupList; public List<OrganizationServiceTemplateGroupDto> organizationServiceTemplateGroupList;
public List<DimensionValueOrgDto> dimensionValueOrgList; public List<DimensionValueOrgDto> dimensionValueOrgList;
...@@ -671,6 +673,14 @@ public class OrganizationDto { ...@@ -671,6 +673,14 @@ public class OrganizationDto {
this.oversea = oversea; this.oversea = oversea;
} }
public String getCountry() {
return country;
}
public void setCountry(String country) {
this.country = country;
}
public List<EnterpriseAccountSetOrgDto> getEnterpriseAccountSetOrgList() { public List<EnterpriseAccountSetOrgDto> getEnterpriseAccountSetOrgList() {
return enterpriseAccountSetOrgList; return enterpriseAccountSetOrgList;
} }
......
...@@ -98,21 +98,88 @@ controller('editOrganizationModalController', ['$scope', '$log', '$translate', ' ...@@ -98,21 +98,88 @@ controller('editOrganizationModalController', ['$scope', '$log', '$translate', '
// 保存机构 // 保存机构
$scope.saveOrg = function () { $scope.saveOrg = function () {
debugger;
if($scope.isInternational){
saveInternationalOrg();
}else{
saveLocalOrg();
}
};
this.orgControlForm.$setSubmitted(); var saveInternationalOrg = function () {
$scope.orgControlForm.$setSubmitted();
var fail = false; var editModel = $scope.editOrgModel;
/*if(!$scope.isInternational){
if($('.localRequired').attr("required")==="required"){ // 是否为境外企业
$('.localRequired').each( function (index,ele){ editModel.oversea = $scope.isInternational;
if(null==ele.value||""===ele.value){
SweetAlert.error("请检查必填项"); if ($scope.isAdd) {
fail = true; editModel.isActive = true;
return false; orgService.addOrg(editModel).success(function (orgId) {
} if (orgId && !orgId.result) {
SweetAlert.warning($translate.instant(orgId.resultMsg));
return;
}
$(selectedModel).modal('hide');
SweetAlert.success($translate.instant('SaveSuccess'));
refreshOrg();
$scope.operateType = null;
$scope.isUpdate = true;
});
} else {
if (editModel.parentID && $scope.selectedOrganization.suborgList) {
if (editModel.parentID === editModel.id) {
SweetAlert.warning('上级机构不能为机构本身');
return;
}
var subOrg = _.find($scope.selectedOrganization.suborgList, function (row) {
return row.id === editModel.parentID;
}); });
if (subOrg) {
SweetAlert.warning('不能将当前机构的下级机构设置为其上级公司');
return;
}
} }
}*/ editModel.isActive = !editModel.isActive;
orgService.updateOrg(editModel).success(function (data) {
if (data && !data.result) {
//SweetAlert.info("Disable", orgId);
SweetAlert.warning($translate.instant(data.resultMsg));
return;
}
$(selectedModel).modal('hide');
SweetAlert.success($translate.instant('SaveSuccess'));
refreshOrg();
$scope.operateType = null;
$scope.isUpdate = true;
});
}
};
var saveLocalOrg = function () {
$scope.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; if(fail) return;
...@@ -123,7 +190,7 @@ controller('editOrganizationModalController', ['$scope', '$log', '$translate', ' ...@@ -123,7 +190,7 @@ controller('editOrganizationModalController', ['$scope', '$log', '$translate', '
return false; return false;
} }
if (this.orgControlForm.$invalid ) { if ($scope.orgControlForm.$invalid ) {
$scope.isShowBasic = true; $scope.isShowBasic = true;
return; return;
} else { } else {
...@@ -137,8 +204,8 @@ controller('editOrganizationModalController', ['$scope', '$log', '$translate', ' ...@@ -137,8 +204,8 @@ controller('editOrganizationModalController', ['$scope', '$log', '$translate', '
$scope.isShowAdvanced = false; $scope.isShowAdvanced = false;
} }
//this.advancedControlForm.$setSubmitted(); //$scope.advancedControlForm.$setSubmitted();
//if (this.advancedControlForm.$invalid) { //if ($scope.advancedControlForm.$invalid) {
// $scope.isShowAdvanced = true; // $scope.isShowAdvanced = true;
// return; // return;
//} else { //} else {
...@@ -424,6 +491,10 @@ controller('editOrganizationModalController', ['$scope', '$log', '$translate', ' ...@@ -424,6 +491,10 @@ controller('editOrganizationModalController', ['$scope', '$log', '$translate', '
}); });
if($scope.isInternational){
$('.localRequired').removeAttr("required");
}
// set first active page is basic info // set first active page is basic info
$('#orgControlTab a:first').tab('show'); $('#orgControlTab a:first').tab('show');
// $('#orgModalFooter').css('padding-left','139px'); // $('#orgModalFooter').css('padding-left','139px');
......
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