Commit 2b6738a8 authored by weizhikai's avatar weizhikai

机构地区三级联动区县可选可不选,所以增加当前地区属于市还是区县的判断及后台查询

parent e8f51d96
...@@ -126,6 +126,17 @@ public class OrganizationDto { ...@@ -126,6 +126,17 @@ public class OrganizationDto {
public List<OrganizationDto> sameVehicleroutinglocationList; public List<OrganizationDto> sameVehicleroutinglocationList;
public List<TaxControlDiskDto> taxControlDiskList; public List<TaxControlDiskDto> taxControlDiskList;
@JsonProperty("levelType")
private Integer levelType;
public Integer getLevelType() {
return levelType;
}
public void setLevelType(Integer levelType) {
this.levelType = levelType;
}
public String getId() { public String getId() {
return this.id; return this.id;
} }
......
...@@ -558,6 +558,7 @@ ...@@ -558,6 +558,7 @@
<result column="PARENT_REGION_ID" jdbcType="VARCHAR" property="parentRegionId"/> <result column="PARENT_REGION_ID" jdbcType="VARCHAR" property="parentRegionId"/>
<result column="AREA_NAME" jdbcType="VARCHAR" property="areaName"/> <result column="AREA_NAME" jdbcType="VARCHAR" property="areaName"/>
<result column="BUSINESS_UNIT_NAME" jdbcType="VARCHAR" property="businessUnitName"/> <result column="BUSINESS_UNIT_NAME" jdbcType="VARCHAR" property="businessUnitName"/>
<result column="level_type" jdbcType="INTEGER" property="levelType" />
</resultMap> </resultMap>
<select id="getSingleOrgByOrgIdToOrgDto" parameterType="map" resultMap="OrgDtoForGetSingleOrgByOrgID"> <select id="getSingleOrgByOrgIdToOrgDto" parameterType="map" resultMap="OrgDtoForGetSingleOrgByOrgID">
...@@ -565,6 +566,7 @@ ...@@ -565,6 +566,7 @@
M.*, M.*,
N.name AS INDUSTRY_NAME, N.name AS INDUSTRY_NAME,
CONCAT(PREGION.name,T.name) AS REGION_NAME, CONCAT(PREGION.name,T.name) AS REGION_NAME,
T.level_type AS level_type,
S.name AS STRUCTURE_NAME, S.name AS STRUCTURE_NAME,
T.parent_id AS PARENT_REGION_ID, T.parent_id AS PARENT_REGION_ID,
AR.name AS AREA_NAME, AR.name AS AREA_NAME,
......
...@@ -303,8 +303,8 @@ controller('editOrganizationModalController', ['$scope', '$log', '$translate', ' ...@@ -303,8 +303,8 @@ controller('editOrganizationModalController', ['$scope', '$log', '$translate', '
} }
// 区域是必填项 // 区域是必填项
if ($scope.selectProvince && $scope.selectRegionID) { if ($scope.selectProvince && ($scope.selectCity || $scope.selectRegionID)) {
editModel.regionID = $scope.selectRegionID; editModel.regionID = $scope.selectRegionID || $scope.selectCity.regionID;
} }
var pId = editModel.parentID; var pId = editModel.parentID;
...@@ -675,7 +675,11 @@ controller('editOrganizationModalController', ['$scope', '$log', '$translate', ' ...@@ -675,7 +675,11 @@ controller('editOrganizationModalController', ['$scope', '$log', '$translate', '
$scope.ProvinceList = data; $scope.ProvinceList = data;
//根据当前机构的父级(即市的层级)获取对应的省的regionID //根据当前机构的父级(即市的层级)获取对应的省的regionID
//目前情况为省市区三级联动,参数为$scope.editOrgModel.parentRegionID,若为省市两级联动,参数改为$scope.editOrgModel.regionID即可 //目前情况为省市区三级联动,参数为$scope.editOrgModel.parentRegionID,若为省市两级联动,参数改为$scope.editOrgModel.regionID即可
areaRegionService.getProvincesByCityID($scope.editOrgModel.parentRegionID).success(function (resp) { var cityIDTemp = $scope.editOrgModel.regionID;
if($scope.editOrgModel.levelType == 3){
cityIDTemp = $scope.editOrgModel.parentRegionID;
}
areaRegionService.getProvincesByCityID(cityIDTemp).success(function (resp) {
if(resp){ if(resp){
$scope.selectProvince = _.find($scope.ProvinceList, function (num) { $scope.selectProvince = _.find($scope.ProvinceList, function (num) {
return num.regionID === resp.regionID; return num.regionID === resp.regionID;
...@@ -702,7 +706,11 @@ controller('editOrganizationModalController', ['$scope', '$log', '$translate', ' ...@@ -702,7 +706,11 @@ controller('editOrganizationModalController', ['$scope', '$log', '$translate', '
if (data && data.length > 0) { if (data && data.length > 0) {
$scope.CityList = data; $scope.CityList = data;
$scope.selectCity = _.find($scope.CityList, function (num) { $scope.selectCity = _.find($scope.CityList, function (num) {
return num.regionID === $scope.editOrgModel.parentRegionID; if($scope.editOrgModel.levelType == 3){
return num.regionID === $scope.editOrgModel.parentRegionID;
}else if($scope.editOrgModel.levelType == 2){
return num.regionID === $scope.editOrgModel.regionID;
}
}); });
if ($scope.selectCity) { if ($scope.selectCity) {
...@@ -732,16 +740,19 @@ controller('editOrganizationModalController', ['$scope', '$log', '$translate', ' ...@@ -732,16 +740,19 @@ controller('editOrganizationModalController', ['$scope', '$log', '$translate', '
if (target) { if (target) {
$scope.selectRegionID = $scope.editOrgModel.regionID; $scope.selectRegionID = $scope.editOrgModel.regionID;
} else { }else{
$scope.selectRegionID = data[0].regionID; $scope.selectRegionID = "";
} }
} else { } else {
data = null; data = null;
$scope.DistrictList = data; $scope.DistrictList = data;
$scope.selectRegionID = null; $scope.selectRegionID = "";
} }
}); });
}else {
$scope.DistrictList = null;
$scope.selectRegionID = "";
} }
}; };
......
...@@ -463,7 +463,7 @@ ...@@ -463,7 +463,7 @@
</div> </div>
<div class="col-sm-3" style="width: 31%" <div class="col-sm-3" style="width: 31%"
ng-class="{'has-error':orgControlForm.selectDistrict.$invalid && (orgControlForm.selectDistrict.$dirty || orgControlForm.$submitted)}"> ng-class="{'has-error':orgControlForm.selectDistrict.$invalid && (orgControlForm.selectDistrict.$dirty || orgControlForm.$submitted)}">
<select class="form-control localRequired" name="selectDistrict" style="width: 90px;" <select class="form-control" name="selectDistrict" style="width: 90px;"
id="selectDistrict" id="selectDistrict"
ng-model="selectRegionID"> ng-model="selectRegionID">
<option value="">{{pleaseSelect}}</option> <option value="">{{pleaseSelect}}</option>
......
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