Commit c6bee104 authored by gary's avatar gary

1、fixbug

parent cc4c112b
......@@ -117,6 +117,8 @@ public class OrganizationDto {
private Boolean oversea;
private String country;
public List<EnterpriseAccountSetOrgDto> enterpriseAccountSetOrgList;
public List<OrganizationServiceTemplateGroupDto> organizationServiceTemplateGroupList;
public List<DimensionValueOrgDto> dimensionValueOrgList;
......@@ -671,6 +673,14 @@ public class OrganizationDto {
this.oversea = oversea;
}
public String getCountry() {
return country;
}
public void setCountry(String country) {
this.country = country;
}
public List<EnterpriseAccountSetOrgDto> getEnterpriseAccountSetOrgList() {
return enterpriseAccountSetOrgList;
}
......
......@@ -98,21 +98,88 @@ controller('editOrganizationModalController', ['$scope', '$log', '$translate', '
// 保存机构
$scope.saveOrg = function () {
debugger;
if($scope.isInternational){
saveInternationalOrg();
}else{
saveLocalOrg();
}
};
this.orgControlForm.$setSubmitted();
var saveInternationalOrg = function () {
$scope.orgControlForm.$setSubmitted();
var fail = false;
/*if(!$scope.isInternational){
if($('.localRequired').attr("required")==="required"){
$('.localRequired').each( function (index,ele){
if(null==ele.value||""===ele.value){
SweetAlert.error("请检查必填项");
fail = true;
return false;
}
var editModel = $scope.editOrgModel;
// 是否为境外企业
editModel.oversea = $scope.isInternational;
if ($scope.isAdd) {
editModel.isActive = true;
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;
......@@ -123,7 +190,7 @@ controller('editOrganizationModalController', ['$scope', '$log', '$translate', '
return false;
}
if (this.orgControlForm.$invalid ) {
if ($scope.orgControlForm.$invalid ) {
$scope.isShowBasic = true;
return;
} else {
......@@ -137,8 +204,8 @@ controller('editOrganizationModalController', ['$scope', '$log', '$translate', '
$scope.isShowAdvanced = false;
}
//this.advancedControlForm.$setSubmitted();
//if (this.advancedControlForm.$invalid) {
//$scope.advancedControlForm.$setSubmitted();
//if ($scope.advancedControlForm.$invalid) {
// $scope.isShowAdvanced = true;
// return;
//} else {
......@@ -424,6 +491,10 @@ controller('editOrganizationModalController', ['$scope', '$log', '$translate', '
});
if($scope.isInternational){
$('.localRequired').removeAttr("required");
}
// set first active page is basic info
$('#orgControlTab a:first').tab('show');
// $('#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