修改部门地区字段
This commit is contained in:
parent
835fae4578
commit
7d0bc13636
@ -58,35 +58,9 @@ public class DepartmentPO implements Serializable {
|
||||
@ApiModelProperty(name = "departmentDuty", value = "组织部门职责")
|
||||
private String departmentDuty;
|
||||
@ApiModelProperty(name = "departmentArea1Id", value = "1级区域ID")
|
||||
private String departmentArea1Id;
|
||||
@ApiModelProperty(name = "departmentArea1Code", value = "1级区域编码")
|
||||
private String departmentArea1Code;
|
||||
@ApiModelProperty(name = "departmentArea1Name", value = "1级区域名称")
|
||||
private String departmentArea1Name;
|
||||
@ApiModelProperty(name = "departmentArea2Id", value = "2级区域ID")
|
||||
private String departmentArea2Id;
|
||||
@ApiModelProperty(name = "departmentArea2Code", value = "2级区域编码")
|
||||
private String departmentArea2Code;
|
||||
@ApiModelProperty(name = "departmentArea2Name", value = "2级区域名称")
|
||||
private String departmentArea2Name;
|
||||
@ApiModelProperty(name = "departmentArea3Id", value = "3级区域ID")
|
||||
private String departmentArea3Id;
|
||||
@ApiModelProperty(name = "departmentArea3Code", value = "3级区域编码")
|
||||
private String departmentArea3Code;
|
||||
@ApiModelProperty(name = "departmentArea3Name", value = "3级区域名称")
|
||||
private String departmentArea3Name;
|
||||
@ApiModelProperty(name = "departmentArea4Id", value = "4级区域ID")
|
||||
private String departmentArea4Id;
|
||||
@ApiModelProperty(name = "departmentArea4Code", value = "4级区域编码")
|
||||
private String departmentArea4Code;
|
||||
@ApiModelProperty(name = "departmentArea4Name", value = "4级区域名称")
|
||||
private String departmentArea4Name;
|
||||
@ApiModelProperty(name = "departmentArea5Id", value = "5级区域ID")
|
||||
private String departmentArea5Id;
|
||||
@ApiModelProperty(name = "departmentArea5Code", value = "5级区域编码")
|
||||
private String departmentArea5Code;
|
||||
@ApiModelProperty(name = "departmentArea5Name", value = "5级区域名称")
|
||||
private String departmentArea5Name;
|
||||
private String departmentAreaCode;
|
||||
@ApiModelProperty(name = "departmentAreaName", value = "部门地区名称")
|
||||
private String departmentAreaName;
|
||||
@ApiModelProperty(name = "departmentLongitude", value = "组织部门经度")
|
||||
private String departmentLongitude;
|
||||
@ApiModelProperty(name = "departmentLatitude", value = "组织部门纬度")
|
||||
@ -254,124 +228,20 @@ public class DepartmentPO implements Serializable {
|
||||
this.departmentDuty = departmentDuty;
|
||||
}
|
||||
|
||||
public String getDepartmentArea1Id() {
|
||||
return departmentArea1Id == null ? "" : departmentArea1Id;
|
||||
public String getDepartmentAreaCode() {
|
||||
return departmentAreaCode == null ? "" : departmentAreaCode.trim();
|
||||
}
|
||||
|
||||
public void setDepartmentArea1Id(String departmentArea1Id) {
|
||||
this.departmentArea1Id = departmentArea1Id;
|
||||
public void setDepartmentAreaCode(String departmentAreaCode) {
|
||||
this.departmentAreaCode = departmentAreaCode;
|
||||
}
|
||||
|
||||
public String getDepartmentArea1Code() {
|
||||
return departmentArea1Code == null ? "" : departmentArea1Code;
|
||||
public String getDepartmentAreaName() {
|
||||
return departmentAreaName == null ? "" : departmentAreaName.trim();
|
||||
}
|
||||
|
||||
public void setDepartmentArea1Code(String departmentArea1Code) {
|
||||
this.departmentArea1Code = departmentArea1Code;
|
||||
}
|
||||
|
||||
public String getDepartmentArea1Name() {
|
||||
return departmentArea1Name == null ? "" : departmentArea1Name;
|
||||
}
|
||||
|
||||
public void setDepartmentArea1Name(String departmentArea1Name) {
|
||||
this.departmentArea1Name = departmentArea1Name;
|
||||
}
|
||||
|
||||
public String getDepartmentArea2Id() {
|
||||
return departmentArea2Id == null ? "" : departmentArea2Id;
|
||||
}
|
||||
|
||||
public void setDepartmentArea2Id(String departmentArea2Id) {
|
||||
this.departmentArea2Id = departmentArea2Id;
|
||||
}
|
||||
|
||||
public String getDepartmentArea2Code() {
|
||||
return departmentArea2Code == null ? "" : departmentArea2Code;
|
||||
}
|
||||
|
||||
public void setDepartmentArea2Code(String departmentArea2Code) {
|
||||
this.departmentArea2Code = departmentArea2Code;
|
||||
}
|
||||
|
||||
public String getDepartmentArea2Name() {
|
||||
return departmentArea2Name == null ? "" : departmentArea2Name;
|
||||
}
|
||||
|
||||
public void setDepartmentArea2Name(String departmentArea2Name) {
|
||||
this.departmentArea2Name = departmentArea2Name;
|
||||
}
|
||||
|
||||
public String getDepartmentArea3Id() {
|
||||
return departmentArea3Id == null ? "" : departmentArea3Id;
|
||||
}
|
||||
|
||||
public void setDepartmentArea3Id(String departmentArea3Id) {
|
||||
this.departmentArea3Id = departmentArea3Id;
|
||||
}
|
||||
|
||||
public String getDepartmentArea3Code() {
|
||||
return departmentArea3Code == null ? "" : departmentArea3Code;
|
||||
}
|
||||
|
||||
public void setDepartmentArea3Code(String departmentArea3Code) {
|
||||
this.departmentArea3Code = departmentArea3Code;
|
||||
}
|
||||
|
||||
public String getDepartmentArea3Name() {
|
||||
return departmentArea3Name == null ? "" : departmentArea3Name;
|
||||
}
|
||||
|
||||
public void setDepartmentArea3Name(String departmentArea3Name) {
|
||||
this.departmentArea3Name = departmentArea3Name;
|
||||
}
|
||||
|
||||
public String getDepartmentArea4Id() {
|
||||
return departmentArea4Id == null ? "" : departmentArea4Id;
|
||||
}
|
||||
|
||||
public void setDepartmentArea4Id(String departmentArea4Id) {
|
||||
this.departmentArea4Id = departmentArea4Id;
|
||||
}
|
||||
|
||||
public String getDepartmentArea4Code() {
|
||||
return departmentArea4Code == null ? "" : departmentArea4Code;
|
||||
}
|
||||
|
||||
public void setDepartmentArea4Code(String departmentArea4Code) {
|
||||
this.departmentArea4Code = departmentArea4Code;
|
||||
}
|
||||
|
||||
public String getDepartmentArea4Name() {
|
||||
return departmentArea4Name == null ? "" : departmentArea4Name;
|
||||
}
|
||||
|
||||
public void setDepartmentArea4Name(String departmentArea4Name) {
|
||||
this.departmentArea4Name = departmentArea4Name;
|
||||
}
|
||||
|
||||
public String getDepartmentArea5Id() {
|
||||
return departmentArea5Id == null ? "" : departmentArea5Id;
|
||||
}
|
||||
|
||||
public void setDepartmentArea5Id(String departmentArea5Id) {
|
||||
this.departmentArea5Id = departmentArea5Id;
|
||||
}
|
||||
|
||||
public String getDepartmentArea5Code() {
|
||||
return departmentArea5Code == null ? "" : departmentArea5Code;
|
||||
}
|
||||
|
||||
public void setDepartmentArea5Code(String departmentArea5Code) {
|
||||
this.departmentArea5Code = departmentArea5Code;
|
||||
}
|
||||
|
||||
public String getDepartmentArea5Name() {
|
||||
return departmentArea5Name == null ? "" : departmentArea5Name;
|
||||
}
|
||||
|
||||
public void setDepartmentArea5Name(String departmentArea5Name) {
|
||||
this.departmentArea5Name = departmentArea5Name;
|
||||
public void setDepartmentAreaName(String departmentAreaName) {
|
||||
this.departmentAreaName = departmentAreaName;
|
||||
}
|
||||
|
||||
public String getDepartmentLongitude() {
|
||||
@ -398,86 +268,4 @@ public class DepartmentPO implements Serializable {
|
||||
this.departmentOrder = departmentOrder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
final StringBuilder sb = new StringBuilder("{");
|
||||
sb.append("\"departmentIntId\":")
|
||||
.append(departmentIntId);
|
||||
sb.append(",\"departmentId\":\"")
|
||||
.append(departmentId).append('\"');
|
||||
sb.append(",\"departmentParentId\":\"")
|
||||
.append(departmentParentId).append('\"');
|
||||
sb.append(",\"departmentParentName\":\"")
|
||||
.append(departmentParentName).append('\"');
|
||||
sb.append(",\"departmentName\":\"")
|
||||
.append(departmentName).append('\"');
|
||||
sb.append(",\"departmentNameEn\":\"")
|
||||
.append(departmentNameEn).append('\"');
|
||||
sb.append(",\"departmentNo\":\"")
|
||||
.append(departmentNo).append('\"');
|
||||
sb.append(",\"departmentNameOther\":\"")
|
||||
.append(departmentNameOther).append('\"');
|
||||
sb.append(",\"departmentCode\":\"")
|
||||
.append(departmentCode).append('\"');
|
||||
sb.append(",\"departmentSummary\":\"")
|
||||
.append(departmentSummary).append('\"');
|
||||
sb.append(",\"departmentLogo\":")
|
||||
.append(departmentLogo);
|
||||
sb.append(",\"departmentLogoHover\":")
|
||||
.append(departmentLogoHover);
|
||||
sb.append(",\"departmentType\":")
|
||||
.append(departmentType);
|
||||
sb.append(",\"departmentState\":")
|
||||
.append(departmentState);
|
||||
sb.append(",\"departmentFax\":\"")
|
||||
.append(departmentFax).append('\"');
|
||||
sb.append(",\"departmentTel\":\"")
|
||||
.append(departmentTel).append('\"');
|
||||
sb.append(",\"departmentAddress\":\"")
|
||||
.append(departmentAddress).append('\"');
|
||||
sb.append(",\"departmentMaster\":\"")
|
||||
.append(departmentMaster).append('\"');
|
||||
sb.append(",\"departmentMasterName\":\"")
|
||||
.append(departmentMasterName).append('\"');
|
||||
sb.append(",\"departmentDuty\":\"")
|
||||
.append(departmentDuty).append('\"');
|
||||
sb.append(",\"departmentArea1Id\":\"")
|
||||
.append(departmentArea1Id).append('\"');
|
||||
sb.append(",\"departmentArea1Code\":\"")
|
||||
.append(departmentArea1Code).append('\"');
|
||||
sb.append(",\"departmentArea1Name\":\"")
|
||||
.append(departmentArea1Name).append('\"');
|
||||
sb.append(",\"departmentArea2Id\":\"")
|
||||
.append(departmentArea2Id).append('\"');
|
||||
sb.append(",\"departmentArea2Code\":\"")
|
||||
.append(departmentArea2Code).append('\"');
|
||||
sb.append(",\"departmentArea2Name\":\"")
|
||||
.append(departmentArea2Name).append('\"');
|
||||
sb.append(",\"departmentArea3Id\":\"")
|
||||
.append(departmentArea3Id).append('\"');
|
||||
sb.append(",\"departmentArea3Code\":\"")
|
||||
.append(departmentArea3Code).append('\"');
|
||||
sb.append(",\"departmentArea3Name\":\"")
|
||||
.append(departmentArea3Name).append('\"');
|
||||
sb.append(",\"departmentArea4Id\":\"")
|
||||
.append(departmentArea4Id).append('\"');
|
||||
sb.append(",\"departmentArea4Code\":\"")
|
||||
.append(departmentArea4Code).append('\"');
|
||||
sb.append(",\"departmentArea4Name\":\"")
|
||||
.append(departmentArea4Name).append('\"');
|
||||
sb.append(",\"departmentArea5Id\":\"")
|
||||
.append(departmentArea5Id).append('\"');
|
||||
sb.append(",\"departmentArea5Code\":\"")
|
||||
.append(departmentArea5Code).append('\"');
|
||||
sb.append(",\"departmentArea5Name\":\"")
|
||||
.append(departmentArea5Name).append('\"');
|
||||
sb.append(",\"departmentLongitude\":\"")
|
||||
.append(departmentLongitude).append('\"');
|
||||
sb.append(",\"departmentLatitude\":\"")
|
||||
.append(departmentLatitude).append('\"');
|
||||
sb.append(",\"departmentOrder\":\"")
|
||||
.append(departmentOrder).append('\"');
|
||||
sb.append('}');
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
@ -45,16 +45,10 @@ public class DepartmentVO {
|
||||
private String departmentMaster;
|
||||
@ApiModelProperty(name = "departmentDuty", value = "组织部门职责")
|
||||
private String departmentDuty;
|
||||
@ApiModelProperty(name = "departmentArea1Id", value = "1级区域ID")
|
||||
private Integer departmentArea1Id;
|
||||
@ApiModelProperty(name = "departmentArea2Id", value = "2级区域ID")
|
||||
private Integer departmentArea2Id;
|
||||
@ApiModelProperty(name = "departmentArea3Id", value = "3级区域ID")
|
||||
private Integer departmentArea3Id;
|
||||
@ApiModelProperty(name = "departmentArea4Id", value = "4级区域ID")
|
||||
private Integer departmentArea4Id;
|
||||
@ApiModelProperty(name = "departmentArea5Id", value = "5级区域ID")
|
||||
private Integer departmentArea5Id;
|
||||
@ApiModelProperty(name = "departmentAreaCode", value = "部门地区编码")
|
||||
private String departmentAreaCode;
|
||||
@ApiModelProperty(name = "departmentAreaName", value = "部门地区名称")
|
||||
private String departmentAreaName;
|
||||
@ApiModelProperty(name = "departmentLongitude", value = "组织部门经度")
|
||||
private String departmentLongitude;
|
||||
@ApiModelProperty(name = "departmentLatitude", value = "组织部门纬度")
|
||||
@ -167,44 +161,20 @@ public class DepartmentVO {
|
||||
this.departmentDuty = departmentDuty;
|
||||
}
|
||||
|
||||
public Integer getDepartmentArea1Id() {
|
||||
return departmentArea1Id;
|
||||
public String getDepartmentAreaCode() {
|
||||
return departmentAreaCode == null ? "" : departmentAreaCode.trim();
|
||||
}
|
||||
|
||||
public void setDepartmentArea1Id(Integer departmentArea1Id) {
|
||||
this.departmentArea1Id = departmentArea1Id;
|
||||
public void setDepartmentAreaCode(String departmentAreaCode) {
|
||||
this.departmentAreaCode = departmentAreaCode;
|
||||
}
|
||||
|
||||
public Integer getDepartmentArea2Id() {
|
||||
return departmentArea2Id;
|
||||
public String getDepartmentAreaName() {
|
||||
return departmentAreaName == null ? "" : departmentAreaName.trim();
|
||||
}
|
||||
|
||||
public void setDepartmentArea2Id(Integer departmentArea2Id) {
|
||||
this.departmentArea2Id = departmentArea2Id;
|
||||
}
|
||||
|
||||
public Integer getDepartmentArea3Id() {
|
||||
return departmentArea3Id;
|
||||
}
|
||||
|
||||
public void setDepartmentArea3Id(Integer departmentArea3Id) {
|
||||
this.departmentArea3Id = departmentArea3Id;
|
||||
}
|
||||
|
||||
public Integer getDepartmentArea4Id() {
|
||||
return departmentArea4Id;
|
||||
}
|
||||
|
||||
public void setDepartmentArea4Id(Integer departmentArea4Id) {
|
||||
this.departmentArea4Id = departmentArea4Id;
|
||||
}
|
||||
|
||||
public Integer getDepartmentArea5Id() {
|
||||
return departmentArea5Id;
|
||||
}
|
||||
|
||||
public void setDepartmentArea5Id(Integer departmentArea5Id) {
|
||||
this.departmentArea5Id = departmentArea5Id;
|
||||
public void setDepartmentAreaName(String departmentAreaName) {
|
||||
this.departmentAreaName = departmentAreaName;
|
||||
}
|
||||
|
||||
public String getDepartmentLongitude() {
|
||||
@ -231,52 +201,5 @@ public class DepartmentVO {
|
||||
this.departmentOrder = departmentOrder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
final StringBuilder sb = new StringBuilder("{");
|
||||
sb.append("\"departmentParentId\":\"")
|
||||
.append(departmentParentId).append('\"');
|
||||
sb.append(",\"departmentName\":\"")
|
||||
.append(departmentName).append('\"');
|
||||
sb.append(",\"departmentNameEn\":\"")
|
||||
.append(departmentNameEn).append('\"');
|
||||
sb.append(",\"departmentNameOther\":\"")
|
||||
.append(departmentNameOther).append('\"');
|
||||
sb.append(",\"departmentNo\":\"")
|
||||
.append(departmentNo).append('\"');
|
||||
sb.append(",\"departmentType\":")
|
||||
.append(departmentType);
|
||||
sb.append(",\"departmentState\":")
|
||||
.append(departmentState);
|
||||
sb.append(",\"departmentSummary\":\"")
|
||||
.append(departmentSummary).append('\"');
|
||||
sb.append(",\"departmentFax\":\"")
|
||||
.append(departmentFax).append('\"');
|
||||
sb.append(",\"departmentTel\":\"")
|
||||
.append(departmentTel).append('\"');
|
||||
sb.append(",\"departmentAddress\":\"")
|
||||
.append(departmentAddress).append('\"');
|
||||
sb.append(",\"departmentMaster\":\"")
|
||||
.append(departmentMaster).append('\"');
|
||||
sb.append(",\"departmentDuty\":\"")
|
||||
.append(departmentDuty).append('\"');
|
||||
sb.append(",\"departmentArea1Id\":")
|
||||
.append(departmentArea1Id);
|
||||
sb.append(",\"departmentArea2Id\":")
|
||||
.append(departmentArea2Id);
|
||||
sb.append(",\"departmentArea3Id\":")
|
||||
.append(departmentArea3Id);
|
||||
sb.append(",\"departmentArea4Id\":")
|
||||
.append(departmentArea4Id);
|
||||
sb.append(",\"departmentArea5Id\":")
|
||||
.append(departmentArea5Id);
|
||||
sb.append(",\"departmentLongitude\":\"")
|
||||
.append(departmentLongitude).append('\"');
|
||||
sb.append(",\"departmentLatitude\":\"")
|
||||
.append(departmentLatitude).append('\"');
|
||||
sb.append(",\"departmentOrder\":")
|
||||
.append(departmentOrder);
|
||||
sb.append('}');
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -87,7 +87,6 @@ public class DepartmentServiceImpl extends DefaultBaseService implements IDepart
|
||||
String departmentId = UUIDUtil.getUUID();
|
||||
String departmentCode = getCode(parentCode, departmentParentId);
|
||||
Map<String, Object> params = HashMapUtil.beanToMap(departmentVO);
|
||||
setArea(departmentVO, params);
|
||||
params.put("departmentCode", departmentCode);
|
||||
params.put("departmentId", departmentId);
|
||||
setSaveInfo(params);
|
||||
@ -113,7 +112,6 @@ public class DepartmentServiceImpl extends DefaultBaseService implements IDepart
|
||||
throw new SaveException("同级组织名称不能相同");
|
||||
}
|
||||
Map<String, Object> params = HashMapUtil.beanToMap(departmentVO);
|
||||
setArea(departmentVO, params);
|
||||
params.put("departmentId", departmentId);
|
||||
setUpdateInfo(params);
|
||||
departmentDao.update(params);
|
||||
@ -377,55 +375,6 @@ public class DepartmentServiceImpl extends DefaultBaseService implements IDepart
|
||||
return departmentDao.listPO(params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置组织组织地区
|
||||
*
|
||||
* @param departmentVO
|
||||
* @param params
|
||||
*/
|
||||
private void setArea(DepartmentVO departmentVO, Map<String, Object> params) {
|
||||
if (departmentVO.getDepartmentArea1Id() != null) {
|
||||
AreaDTO areaDTO = areaService.get(departmentVO.getDepartmentArea1Id().toString());
|
||||
params.put("departmentArea1Code", areaDTO.getAreaCode());
|
||||
params.put("departmentArea1Name", areaDTO.getAreaName());
|
||||
} else {
|
||||
params.put("departmentArea1Code", "");
|
||||
params.put("departmentArea1Name", "");
|
||||
}
|
||||
if (departmentVO.getDepartmentArea2Id() != null) {
|
||||
AreaDTO areaDTO = areaService.get(departmentVO.getDepartmentArea2Id().toString());
|
||||
params.put("departmentArea2Code", areaDTO.getAreaCode());
|
||||
params.put("departmentArea2Name", areaDTO.getAreaName());
|
||||
} else {
|
||||
params.put("departmentArea2Code", "");
|
||||
params.put("departmentArea2Name", "");
|
||||
}
|
||||
if (departmentVO.getDepartmentArea3Id() != null) {
|
||||
AreaDTO areaDTO = areaService.get(departmentVO.getDepartmentArea3Id().toString());
|
||||
params.put("departmentArea3Code", areaDTO.getAreaCode());
|
||||
params.put("departmentArea3Name", areaDTO.getAreaName());
|
||||
} else {
|
||||
params.put("departmentArea3Code", "");
|
||||
params.put("departmentArea3Name", "");
|
||||
}
|
||||
if (departmentVO.getDepartmentArea4Id() != null) {
|
||||
AreaDTO areaDTO = areaService.get(departmentVO.getDepartmentArea4Id().toString());
|
||||
params.put("departmentArea4Code", areaDTO.getAreaCode());
|
||||
params.put("departmentArea4Name", areaDTO.getAreaName());
|
||||
} else {
|
||||
params.put("departmentArea4Code", "");
|
||||
params.put("departmentArea4Name", "");
|
||||
}
|
||||
if (departmentVO.getDepartmentArea5Id() != null) {
|
||||
AreaDTO areaDTO = areaService.get(departmentVO.getDepartmentArea5Id().toString());
|
||||
params.put("departmentArea5Code", areaDTO.getAreaCode());
|
||||
params.put("departmentArea5Name", areaDTO.getAreaName());
|
||||
} else {
|
||||
params.put("departmentArea5Code", "");
|
||||
params.put("departmentArea5Name", "");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 合并组织到指定组织
|
||||
*
|
||||
|
@ -25,21 +25,8 @@
|
||||
<result property="departmentMaster" column="department_master"/>
|
||||
<result property="departmentMasterName" column="department_master_name"/>
|
||||
<result property="departmentDuty" column="department_duty"/>
|
||||
<result property="departmentArea1Id" column="department_area1_id"/>
|
||||
<result property="departmentArea1Code" column="department_area1_code"/>
|
||||
<result property="departmentArea1Name" column="department_area1_name"/>
|
||||
<result property="departmentArea2Id" column="department_area2_id"/>
|
||||
<result property="departmentArea2Code" column="department_area2_code"/>
|
||||
<result property="departmentArea2Name" column="department_area2_name"/>
|
||||
<result property="departmentArea3Id" column="department_area3_id"/>
|
||||
<result property="departmentArea3Code" column="department_area3_code"/>
|
||||
<result property="departmentArea3Name" column="department_area3_name"/>
|
||||
<result property="departmentArea4Id" column="department_area4_id"/>
|
||||
<result property="departmentArea4Code" column="department_area4_code"/>
|
||||
<result property="departmentArea4Name" column="department_area4_name"/>
|
||||
<result property="departmentArea5Id" column="department_area5_id"/>
|
||||
<result property="departmentArea5Code" column="department_area5_code"/>
|
||||
<result property="departmentArea5Name" column="department_area5_name"/>
|
||||
<result property="departmentAreaCode" column="department_area_code"/>
|
||||
<result property="departmentAreaName" column="department_area_name"/>
|
||||
<result property="departmentLongitude" column="department_longitude"/>
|
||||
<result property="departmentLatitude" column="department_latitude"/>
|
||||
<result property="departmentOrder" column="department_order"/>
|
||||
@ -67,21 +54,8 @@
|
||||
<result property="departmentMaster" column="department_master"/>
|
||||
<result property="departmentMasterName" column="department_master_name"/>
|
||||
<result property="departmentDuty" column="department_duty"/>
|
||||
<result property="departmentArea1Id" column="department_area1_id"/>
|
||||
<result property="departmentArea1Code" column="department_area1_code"/>
|
||||
<result property="departmentArea1Name" column="department_area1_name"/>
|
||||
<result property="departmentArea2Id" column="department_area2_id"/>
|
||||
<result property="departmentArea2Code" column="department_area2_code"/>
|
||||
<result property="departmentArea2Name" column="department_area2_name"/>
|
||||
<result property="departmentArea3Id" column="department_area3_id"/>
|
||||
<result property="departmentArea3Code" column="department_area3_code"/>
|
||||
<result property="departmentArea3Name" column="department_area3_name"/>
|
||||
<result property="departmentArea4Id" column="department_area4_id"/>
|
||||
<result property="departmentArea4Code" column="department_area4_code"/>
|
||||
<result property="departmentArea4Name" column="department_area4_name"/>
|
||||
<result property="departmentArea5Id" column="department_area5_id"/>
|
||||
<result property="departmentArea5Code" column="department_area5_code"/>
|
||||
<result property="departmentArea5Name" column="department_area5_name"/>
|
||||
<result property="departmentAreaCode" column="department_area_code"/>
|
||||
<result property="departmentAreaName" column="department_area_name"/>
|
||||
<result property="departmentLongitude" column="department_longitude"/>
|
||||
<result property="departmentLatitude" column="department_latitude"/>
|
||||
<result property="departmentOrder" column="department_order"/>
|
||||
@ -117,21 +91,8 @@
|
||||
`department_longitude` varchar(255) DEFAULT '0' COMMENT '部门经度',
|
||||
`department_latitude` varchar(255) DEFAULT '0' COMMENT '部门纬度',
|
||||
`department_order` int(11) DEFAULT '0' COMMENT '部门排序',
|
||||
`department_area1_id` bigint(20) DEFAULT NULL COMMENT '1级区域ID',
|
||||
`department_area1_code` varchar(255) DEFAULT NULL COMMENT '1级区域编码',
|
||||
`department_area1_name` varchar(255) DEFAULT NULL COMMENT '1级区域名称',
|
||||
`department_area2_id` bigint(20) DEFAULT NULL COMMENT '2级区域ID',
|
||||
`department_area2_code` varchar(255) DEFAULT NULL COMMENT '2级区域编码',
|
||||
`department_area2_name` varchar(255) DEFAULT NULL COMMENT '2级区域名称',
|
||||
`department_area3_id` bigint(20) DEFAULT NULL COMMENT '3级区域ID',
|
||||
`department_area3_code` varchar(255) DEFAULT NULL COMMENT '3级区域编码',
|
||||
`department_area3_name` varchar(255) DEFAULT NULL COMMENT '3级区域名称',
|
||||
`department_area4_id` bigint(20) DEFAULT NULL COMMENT '4级区域ID',
|
||||
`department_area4_code` varchar(255) DEFAULT NULL COMMENT '4级区域编码',
|
||||
`department_area4_name` varchar(255) DEFAULT NULL COMMENT '4级区域名称',
|
||||
`department_area5_id` bigint(20) DEFAULT NULL COMMENT '5级区域ID',
|
||||
`department_area5_code` varchar(255) DEFAULT NULL COMMENT '5级区域编码',
|
||||
`department_area5_name` varchar(255) DEFAULT NULL COMMENT '5级区域名称',
|
||||
`department_area_code` varchar(255) DEFAULT NULL COMMENT '部门地区编码',
|
||||
`department_area_name` varchar(255) DEFAULT NULL COMMENT '部门地区名称',
|
||||
`creator` char(36) DEFAULT NULL,
|
||||
`gmt_create` datetime DEFAULT NULL,
|
||||
`modifier` char(36) DEFAULT NULL,
|
||||
@ -162,21 +123,8 @@
|
||||
department_address,
|
||||
department_master,
|
||||
department_duty,
|
||||
department_area1_id,
|
||||
department_area1_code,
|
||||
department_area1_name,
|
||||
department_area2_id,
|
||||
department_area2_code,
|
||||
department_area2_name,
|
||||
department_area3_id,
|
||||
department_area3_code,
|
||||
department_area3_name,
|
||||
department_area4_id,
|
||||
department_area4_code,
|
||||
department_area4_name,
|
||||
department_area5_id,
|
||||
department_area5_code,
|
||||
department_area5_name,
|
||||
department_area_code,
|
||||
department_area_name,
|
||||
department_longitude,
|
||||
department_latitude,
|
||||
department_order,
|
||||
@ -203,21 +151,8 @@
|
||||
#{departmentAddress},
|
||||
#{departmentMaster},
|
||||
#{departmentDuty},
|
||||
#{departmentArea1Id},
|
||||
#{departmentArea1Code},
|
||||
#{departmentArea1Name},
|
||||
#{departmentArea2Id},
|
||||
#{departmentArea2Code},
|
||||
#{departmentArea2Name},
|
||||
#{departmentArea3Id},
|
||||
#{departmentArea3Code},
|
||||
#{departmentArea3Name},
|
||||
#{departmentArea4Id},
|
||||
#{departmentArea4Code},
|
||||
#{departmentArea4Name},
|
||||
#{departmentArea5Id},
|
||||
#{departmentArea5Code},
|
||||
#{departmentArea5Name},
|
||||
#{departmentAreaCode},
|
||||
#{departmentAreaName},
|
||||
#{departmentLongitude},
|
||||
#{departmentLatitude},
|
||||
#{departmentOrder},
|
||||
@ -294,40 +229,11 @@
|
||||
<if test="departmentDuty != null">
|
||||
department_duty = #{departmentDuty},
|
||||
</if>
|
||||
department_area1_id = #{departmentArea1Id},
|
||||
<if test="departmentArea1Code != null">
|
||||
department_area1_code = #{departmentArea1Code},
|
||||
<if test="departmentAreaCode != null">
|
||||
department_area_code = #{departmentAreaCode},
|
||||
</if>
|
||||
<if test="departmentArea1Name != null">
|
||||
department_area1_name = #{departmentArea1Name},
|
||||
</if>
|
||||
department_area2_id = #{departmentArea2Id},
|
||||
<if test="departmentArea2Code != null">
|
||||
department_area2_code = #{departmentArea2Code},
|
||||
</if>
|
||||
<if test="departmentArea2Name != null">
|
||||
department_area2_name = #{departmentArea2Name},
|
||||
</if>
|
||||
department_area3_id = #{departmentArea3Id},
|
||||
<if test="departmentArea3Code != null">
|
||||
department_area3_code = #{departmentArea3Code},
|
||||
</if>
|
||||
<if test="departmentArea3Name != null">
|
||||
department_area3_name = #{departmentArea3Name},
|
||||
</if>
|
||||
department_area4_id = #{departmentArea4Id},
|
||||
<if test="departmentArea4Code != null">
|
||||
department_area4_code = #{departmentArea4Code},
|
||||
</if>
|
||||
<if test="departmentArea4Name != null">
|
||||
department_area4_name = #{departmentArea4Name},
|
||||
</if>
|
||||
department_area5_id = #{departmentArea5Id},
|
||||
<if test="departmentArea5Code != null">
|
||||
department_area5_code = #{departmentArea5Code},
|
||||
</if>
|
||||
<if test="departmentArea5Name != null">
|
||||
department_area5_name = #{departmentArea5Name},
|
||||
<if test="departmentAreaName != null">
|
||||
department_area_name = #{departmentAreaName},
|
||||
</if>
|
||||
<if test="departmentLongitude != null">
|
||||
department_longitude = #{departmentLongitude},
|
||||
@ -449,21 +355,8 @@
|
||||
department_address,
|
||||
department_master,
|
||||
department_duty,
|
||||
department_area1_id,
|
||||
department_area1_code,
|
||||
department_area1_name,
|
||||
department_area2_id,
|
||||
department_area2_code,
|
||||
department_area2_name,
|
||||
department_area3_id,
|
||||
department_area3_code,
|
||||
department_area3_name,
|
||||
department_area4_id,
|
||||
department_area4_code,
|
||||
department_area4_name,
|
||||
department_area5_id,
|
||||
department_area5_code,
|
||||
department_area5_name,
|
||||
department_area_code,
|
||||
department_area_name,
|
||||
department_longitude,
|
||||
department_latitude,
|
||||
department_order,
|
||||
@ -672,21 +565,8 @@
|
||||
department_address,
|
||||
department_master,
|
||||
department_duty,
|
||||
department_area1_id,
|
||||
department_area1_code,
|
||||
department_area1_name,
|
||||
department_area2_id,
|
||||
department_area2_code,
|
||||
department_area2_name,
|
||||
department_area3_id,
|
||||
department_area3_code,
|
||||
department_area3_name,
|
||||
department_area4_id,
|
||||
department_area4_code,
|
||||
department_area4_name,
|
||||
department_area5_id,
|
||||
department_area5_code,
|
||||
department_area5_name,
|
||||
department_area_code,
|
||||
department_area_name,
|
||||
department_longitude,
|
||||
department_latitude,
|
||||
department_order
|
||||
@ -725,21 +605,8 @@
|
||||
department_address,
|
||||
department_master,
|
||||
department_duty,
|
||||
department_area1_id,
|
||||
department_area1_code,
|
||||
department_area1_name,
|
||||
department_area2_id,
|
||||
department_area2_code,
|
||||
department_area2_name,
|
||||
department_area3_id,
|
||||
department_area3_code,
|
||||
department_area3_name,
|
||||
department_area4_id,
|
||||
department_area4_code,
|
||||
department_area4_name,
|
||||
department_area5_id,
|
||||
department_area5_code,
|
||||
department_area5_name,
|
||||
department_area_code,
|
||||
department_area_name,
|
||||
department_longitude,
|
||||
department_latitude,
|
||||
department_order
|
||||
@ -848,7 +715,7 @@
|
||||
is_delete = 0
|
||||
<if test="area1 != null">
|
||||
AND (
|
||||
department_area1_id = #{area1}
|
||||
department_area_code = #{area1}
|
||||
<if test="local != null">
|
||||
AND ((
|
||||
department_area2_id IS NULL
|
||||
|
@ -140,76 +140,11 @@
|
||||
<div class="layui-row">
|
||||
<div class="layui-col-md6 layui-col-sm6 layui-col-xs12">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">1级区域</label>
|
||||
<div class="layui-input-block layui-form" id="departmentArea1IdSelectTemplateBox" lay-filter="departmentArea1IdSelectTemplateBox"></div>
|
||||
<script id="departmentArea1IdSelectTemplate" type="text/html">
|
||||
<select id="departmentArea1Id" name="departmentArea1Id" lay-filter="departmentArea1Id" lay-search>
|
||||
<option value="">请选择1级区域</option>
|
||||
{{# for(var i = 0, item; item = d[i++];) { }}
|
||||
<option value="{{item.areaId}}">{{item.areaName}}</option>
|
||||
{{# } }}
|
||||
</select>
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md6 layui-col-sm6 layui-col-xs12">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">2级区域</label>
|
||||
<div class="layui-input-block layui-form" id="departmentArea2IdSelectTemplateBox" lay-filter="departmentArea2IdSelectTemplateBox"></div>
|
||||
<script id="departmentArea2IdSelectTemplate" type="text/html">
|
||||
<select id="departmentArea2Id" name="departmentArea2Id" lay-filter="departmentArea2Id" lay-search>
|
||||
<option value="">请选择2级区域</option>
|
||||
{{# for(var i = 0, item; item = d[i++];) { }}
|
||||
<option value="{{item.areaId}}">{{item.areaName}}</option>
|
||||
{{# } }}
|
||||
</select>
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-row">
|
||||
<div class="layui-col-md6 layui-col-sm6 layui-col-xs12">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">3级区域</label>
|
||||
<div class="layui-input-block layui-form" id="departmentArea3IdSelectTemplateBox" lay-filter="departmentArea3IdSelectTemplateBox"></div>
|
||||
<script id="departmentArea3IdSelectTemplate" type="text/html">
|
||||
<select id="departmentArea3Id" name="departmentArea3Id" lay-filter="departmentArea3Id" lay-search>
|
||||
<option value="">请选择3级区域</option>
|
||||
{{# for(var i = 0, item; item = d[i++];) { }}
|
||||
<option value="{{item.areaId}}">{{item.areaName}}</option>
|
||||
{{# } }}
|
||||
</select>
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md6 layui-col-sm6 layui-col-xs12">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">4级区域</label>
|
||||
<div class="layui-input-block layui-form" id="departmentArea4IdSelectTemplateBox" lay-filter="departmentArea4IdSelectTemplateBox"></div>
|
||||
<script id="departmentArea4IdSelectTemplate" type="text/html">
|
||||
<select id="departmentArea4Id" name="departmentArea4Id" lay-filter="departmentArea4Id" lay-search>
|
||||
<option value="">请选择4级区域</option>
|
||||
{{# for(var i = 0, item; item = d[i++];) { }}
|
||||
<option value="{{item.areaId}}">{{item.areaName}}</option>
|
||||
{{# } }}
|
||||
</select>
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-row">
|
||||
<div class="layui-col-md6 layui-col-sm6 layui-col-xs12">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">5级区域</label>
|
||||
<div class="layui-input-block layui-form" id="departmentArea5IdSelectTemplateBox" lay-filter="departmentArea5IdSelectTemplateBox"></div>
|
||||
<script id="departmentArea5IdSelectTemplate" type="text/html">
|
||||
<select id="departmentArea5Id" name="departmentArea5Id" lay-search>
|
||||
<option value="">请选择5级区域</option>
|
||||
{{# for(var i = 0, item; item = d[i++];) { }}
|
||||
<option value="{{item.areaId}}">{{item.areaName}}</option>
|
||||
{{# } }}
|
||||
</select>
|
||||
</script>
|
||||
<label class="layui-form-label layui-form-label-up">选择地区</label>
|
||||
<div class="layui-input-block layui-input-block-down">
|
||||
<input type="hidden" id="departmentAreaCode" name="departmentAreaCode">
|
||||
<input type="text" id="departmentAreaName" name="departmentAreaName" class="layui-input" value="" placeholder="请选择地区" maxlength="255" readonly lay-verify="required" style="cursor:pointer;">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md6 layui-col-sm6 layui-col-xs6">
|
||||
@ -259,75 +194,31 @@
|
||||
}
|
||||
}
|
||||
|
||||
// 初始化1级区域下拉选择
|
||||
function initDepartmentArea1CodeSelect() {
|
||||
top.restAjax.get(top.restAjax.path('api/area/listbyparentid/0', []), {}, null, function(code, data, args) {
|
||||
initSelectRadioCheckboxTemplate('departmentArea1IdSelectTemplate', 'departmentArea1IdSelectTemplateBox', data);
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
});
|
||||
}
|
||||
|
||||
// 初始化2级区域下拉选择
|
||||
function initDepartmentArea2CodeSelect(area1) {
|
||||
if(!area1) {
|
||||
initSelectRadioCheckboxTemplate('departmentArea2IdSelectTemplate', 'departmentArea2IdSelectTemplateBox', []);
|
||||
return;
|
||||
}
|
||||
top.restAjax.get(top.restAjax.path('api/area/listbyparentid/{area1}', [area1]), {}, null, function(code, data, args) {
|
||||
initSelectRadioCheckboxTemplate('departmentArea2IdSelectTemplate', 'departmentArea2IdSelectTemplateBox', data);
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
});
|
||||
}
|
||||
|
||||
// 初始化3级区域下拉选择
|
||||
function initDepartmentArea3CodeSelect(area2) {
|
||||
if(!area2) {
|
||||
initSelectRadioCheckboxTemplate('departmentArea3IdSelectTemplate', 'departmentArea3IdSelectTemplateBox', []);
|
||||
return;
|
||||
}
|
||||
top.restAjax.get(top.restAjax.path('api/area/listbyparentid/{area2}', [area2]), {}, null, function(code, data, args) {
|
||||
initSelectRadioCheckboxTemplate('departmentArea3IdSelectTemplate', 'departmentArea3IdSelectTemplateBox', data);
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
});
|
||||
}
|
||||
|
||||
// 初始化4级区域下拉选择
|
||||
function initDepartmentArea4CodeSelect(area3) {
|
||||
if(!area3) {
|
||||
initSelectRadioCheckboxTemplate('departmentArea4IdSelectTemplate', 'departmentArea4IdSelectTemplateBox', []);
|
||||
return;
|
||||
}
|
||||
top.restAjax.get(top.restAjax.path('api/area/listbyparentid/{area3}', [area3]), {}, null, function(code, data, args) {
|
||||
initSelectRadioCheckboxTemplate('departmentArea4IdSelectTemplate', 'departmentArea4IdSelectTemplateBox', data);
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
});
|
||||
}
|
||||
|
||||
// 初始化5级区域下拉选择
|
||||
function initDepartmentArea5CodeSelect(area4) {
|
||||
if(!area4) {
|
||||
initSelectRadioCheckboxTemplate('departmentArea5IdSelectTemplate', 'departmentArea5IdSelectTemplateBox', []);
|
||||
return;
|
||||
}
|
||||
top.restAjax.get(top.restAjax.path('api/area/listbyparentid/{area4}', [area4]), {}, null, function(code, data, args) {
|
||||
initSelectRadioCheckboxTemplate('departmentArea5IdSelectTemplate', 'departmentArea5IdSelectTemplateBox', data);
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
});
|
||||
}
|
||||
|
||||
// 初始化
|
||||
function initData() {}
|
||||
initData();
|
||||
initDepartmentArea1CodeSelect();
|
||||
initDepartmentArea2CodeSelect();
|
||||
initDepartmentArea3CodeSelect();
|
||||
initDepartmentArea4CodeSelect();
|
||||
initDepartmentArea5CodeSelect();
|
||||
|
||||
// 提交表单
|
||||
form.on('submit(submitForm)', function(formData) {
|
||||
top.dialog.confirm('确定合并到该组织吗?操作不可撤销!', function(index) {
|
||||
top.dialog.close(index);
|
||||
var loadLayerIndex;
|
||||
formData.field.departmentParentId = departmentParentId;
|
||||
formData.field.mergeDepartmentIds = top.dialog.dialogData.mergeDepartmentIds;
|
||||
top.restAjax.put(top.restAjax.path('api/department/updatemergenew', []), formData.field, null, function(code, data) {
|
||||
top.dialog.msg('合并成功');
|
||||
closeBox();
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
}, function() {
|
||||
loadLayerIndex = top.dialog.msg('正在合并...', {icon: 16, time: 0, shade: 0.3});
|
||||
}, function() {
|
||||
top.dialog.close(loadLayerIndex);
|
||||
});
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
// 选择负责人
|
||||
$(document).on('click', '#departmentMasterName', function() {
|
||||
top.dialog.dialogData.selectedUserIds = $('#departmentMaster').val();
|
||||
@ -353,53 +244,35 @@
|
||||
});
|
||||
})
|
||||
|
||||
// 提交表单
|
||||
form.on('submit(submitForm)', function(formData) {
|
||||
top.dialog.confirm('确定合并到该组织吗?操作不可撤销!', function(index) {
|
||||
top.dialog.close(index);
|
||||
var loadLayerIndex;
|
||||
formData.field.departmentParentId = departmentParentId;
|
||||
formData.field.mergeDepartmentIds = top.dialog.dialogData.mergeDepartmentIds;
|
||||
top.restAjax.put(top.restAjax.path('api/department/updatemergenew', []), formData.field, null, function(code, data) {
|
||||
top.dialog.msg('合并成功');
|
||||
closeBox();
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
}, function() {
|
||||
loadLayerIndex = top.dialog.msg('正在合并...', {icon: 16, time: 0, shade: 0.3});
|
||||
}, function() {
|
||||
top.dialog.close(loadLayerIndex);
|
||||
});
|
||||
});
|
||||
return false;
|
||||
$('#departmentAreaName').on('click', function() {
|
||||
top.dialog.open({
|
||||
title: '选择地区',
|
||||
url: top.restAjax.path('route/area/get-select?areaName={departmentAreaName}', [encodeURI($('#departmentAreaName').val())]),
|
||||
width: '600px',
|
||||
height: '225px',
|
||||
onClose: function() {
|
||||
var selectedAreaArray = top.dialog.dialogData.selectedAreaArray;
|
||||
var areaCode = '';
|
||||
var areaName = '';
|
||||
if(selectedAreaArray.length > 0) {
|
||||
areaCode = selectedAreaArray[selectedAreaArray.length - 1].areaCode;
|
||||
for(var i = 0, item; item = selectedAreaArray[i++];) {
|
||||
if(areaName) {
|
||||
areaName += '/';
|
||||
}
|
||||
areaName += item.areaName;
|
||||
}
|
||||
}
|
||||
$('#departmentAreaCode').val(departmentAreaCode);
|
||||
$('#departmentAreaName').val(areaName);
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
$('.close').on('click', function() {
|
||||
closeBox();
|
||||
});
|
||||
|
||||
// departmentArea1Id 选择事件
|
||||
form.on('select(departmentArea1Id)', function(data) {
|
||||
initDepartmentArea2CodeSelect(data.value);
|
||||
initDepartmentArea3CodeSelect(data.value);
|
||||
initDepartmentArea4CodeSelect(data.value);
|
||||
initDepartmentArea5CodeSelect(data.value);
|
||||
});
|
||||
// departmentArea2Id 选择事件
|
||||
form.on('select(departmentArea2Id)', function(data) {
|
||||
initDepartmentArea3CodeSelect(data.value);
|
||||
initDepartmentArea4CodeSelect(data.value);
|
||||
initDepartmentArea5CodeSelect(data.value);
|
||||
});
|
||||
// departmentArea3Id 选择事件
|
||||
form.on('select(departmentArea3Id)', function(data) {
|
||||
initDepartmentArea4CodeSelect(data.value);
|
||||
initDepartmentArea5CodeSelect(data.value);
|
||||
});
|
||||
// departmentArea4Id 选择事件
|
||||
form.on('select(departmentArea4Id)', function(data) {
|
||||
initDepartmentArea5CodeSelect(data.value);
|
||||
});
|
||||
// 校验部门是否存在
|
||||
var checkDepartmentNameTimeout;
|
||||
$(document).on('keydown', '#departmentName', function() {
|
||||
|
@ -146,76 +146,11 @@
|
||||
<div class="layui-row">
|
||||
<div class="layui-col-md6 layui-col-sm6 layui-col-xs12">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">1级区域</label>
|
||||
<div class="layui-input-block layui-form" id="departmentArea1IdSelectTemplateBox" lay-filter="departmentArea1IdSelectTemplateBox"></div>
|
||||
<script id="departmentArea1IdSelectTemplate" type="text/html">
|
||||
<select id="departmentArea1Id" name="departmentArea1Id" lay-filter="departmentArea1Id" lay-search>
|
||||
<option value="">请选择1级区域</option>
|
||||
{{# for(var i = 0, item; item = d[i++];) { }}
|
||||
<option value="{{item.areaId}}">{{item.areaName}}</option>
|
||||
{{# } }}
|
||||
</select>
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md6 layui-col-sm6 layui-col-xs12">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">2级区域</label>
|
||||
<div class="layui-input-block layui-form" id="departmentArea2IdSelectTemplateBox" lay-filter="departmentArea2IdSelectTemplateBox"></div>
|
||||
<script id="departmentArea2IdSelectTemplate" type="text/html">
|
||||
<select id="departmentArea2Id" name="departmentArea2Id" lay-filter="departmentArea2Id" lay-search>
|
||||
<option value="">请选择2级区域</option>
|
||||
{{# for(var i = 0, item; item = d[i++];) { }}
|
||||
<option value="{{item.areaId}}">{{item.areaName}}</option>
|
||||
{{# } }}
|
||||
</select>
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-row">
|
||||
<div class="layui-col-md6 layui-col-sm6 layui-col-xs12">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">3级区域</label>
|
||||
<div class="layui-input-block layui-form" id="departmentArea3IdSelectTemplateBox" lay-filter="departmentArea3IdSelectTemplateBox"></div>
|
||||
<script id="departmentArea3IdSelectTemplate" type="text/html">
|
||||
<select id="departmentArea3Id" name="departmentArea3Id" lay-filter="departmentArea3Id" lay-search>
|
||||
<option value="">请选择3级区域</option>
|
||||
{{# for(var i = 0, item; item = d[i++];) { }}
|
||||
<option value="{{item.areaId}}">{{item.areaName}}</option>
|
||||
{{# } }}
|
||||
</select>
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md6 layui-col-sm6 layui-col-xs12">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">4级区域</label>
|
||||
<div class="layui-input-block layui-form" id="departmentArea4IdSelectTemplateBox" lay-filter="departmentArea4IdSelectTemplateBox"></div>
|
||||
<script id="departmentArea4IdSelectTemplate" type="text/html">
|
||||
<select id="departmentArea4Id" name="departmentArea4Id" lay-filter="departmentArea4Id" lay-search>
|
||||
<option value="">请选择4级区域</option>
|
||||
{{# for(var i = 0, item; item = d[i++];) { }}
|
||||
<option value="{{item.areaId}}">{{item.areaName}}</option>
|
||||
{{# } }}
|
||||
</select>
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-row">
|
||||
<div class="layui-col-md6 layui-col-sm6 layui-col-xs12">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">5级区域</label>
|
||||
<div class="layui-input-block layui-form" id="departmentArea5IdSelectTemplateBox" lay-filter="departmentArea5IdSelectTemplateBox"></div>
|
||||
<script id="departmentArea5IdSelectTemplate" type="text/html">
|
||||
<select id="departmentArea5Id" name="departmentArea5Id" lay-search>
|
||||
<option value="">请选择5级区域</option>
|
||||
{{# for(var i = 0, item; item = d[i++];) { }}
|
||||
<option value="{{item.areaId}}">{{item.areaName}}</option>
|
||||
{{# } }}
|
||||
</select>
|
||||
</script>
|
||||
<label class="layui-form-label layui-form-label-up">选择地区</label>
|
||||
<div class="layui-input-block layui-input-block-down">
|
||||
<input type="hidden" id="departmentAreaCode" name="departmentAreaCode">
|
||||
<input type="text" id="departmentAreaName" name="departmentAreaName" class="layui-input" value="" placeholder="请选择地区" maxlength="255" readonly lay-verify="required" style="cursor:pointer;">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md6 layui-col-sm6 layui-col-xs6">
|
||||
@ -265,75 +200,22 @@
|
||||
}
|
||||
}
|
||||
|
||||
// 初始化1级区域下拉选择
|
||||
function initDepartmentArea1CodeSelect() {
|
||||
top.restAjax.get(top.restAjax.path('api/area/listbyparentid/0', []), {}, null, function(code, data, args) {
|
||||
initSelectRadioCheckboxTemplate('departmentArea1IdSelectTemplate', 'departmentArea1IdSelectTemplateBox', data);
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
});
|
||||
}
|
||||
|
||||
// 初始化2级区域下拉选择
|
||||
function initDepartmentArea2CodeSelect(area1) {
|
||||
if(!area1) {
|
||||
initSelectRadioCheckboxTemplate('departmentArea2IdSelectTemplate', 'departmentArea2IdSelectTemplateBox', []);
|
||||
return;
|
||||
}
|
||||
top.restAjax.get(top.restAjax.path('api/area/listbyparentid/{area1}', [area1]), {}, null, function(code, data, args) {
|
||||
initSelectRadioCheckboxTemplate('departmentArea2IdSelectTemplate', 'departmentArea2IdSelectTemplateBox', data);
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
});
|
||||
}
|
||||
|
||||
// 初始化3级区域下拉选择
|
||||
function initDepartmentArea3CodeSelect(area2) {
|
||||
if(!area2) {
|
||||
initSelectRadioCheckboxTemplate('departmentArea3IdSelectTemplate', 'departmentArea3IdSelectTemplateBox', []);
|
||||
return;
|
||||
}
|
||||
top.restAjax.get(top.restAjax.path('api/area/listbyparentid/{area2}', [area2]), {}, null, function(code, data, args) {
|
||||
initSelectRadioCheckboxTemplate('departmentArea3IdSelectTemplate', 'departmentArea3IdSelectTemplateBox', data);
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
});
|
||||
}
|
||||
|
||||
// 初始化4级区域下拉选择
|
||||
function initDepartmentArea4CodeSelect(area3) {
|
||||
if(!area3) {
|
||||
initSelectRadioCheckboxTemplate('departmentArea4IdSelectTemplate', 'departmentArea4IdSelectTemplateBox', []);
|
||||
return;
|
||||
}
|
||||
top.restAjax.get(top.restAjax.path('api/area/listbyparentid/{area3}', [area3]), {}, null, function(code, data, args) {
|
||||
initSelectRadioCheckboxTemplate('departmentArea4IdSelectTemplate', 'departmentArea4IdSelectTemplateBox', data);
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
});
|
||||
}
|
||||
|
||||
// 初始化5级区域下拉选择
|
||||
function initDepartmentArea5CodeSelect(area4) {
|
||||
if(!area4) {
|
||||
initSelectRadioCheckboxTemplate('departmentArea5IdSelectTemplate', 'departmentArea5IdSelectTemplateBox', []);
|
||||
return;
|
||||
}
|
||||
top.restAjax.get(top.restAjax.path('api/area/listbyparentid/{area4}', [area4]), {}, null, function(code, data, args) {
|
||||
initSelectRadioCheckboxTemplate('departmentArea5IdSelectTemplate', 'departmentArea5IdSelectTemplateBox', data);
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
});
|
||||
}
|
||||
|
||||
// 初始化
|
||||
function initData() {}
|
||||
initData();
|
||||
initDepartmentArea1CodeSelect();
|
||||
initDepartmentArea2CodeSelect();
|
||||
initDepartmentArea3CodeSelect();
|
||||
initDepartmentArea4CodeSelect();
|
||||
initDepartmentArea5CodeSelect();
|
||||
|
||||
// 提交表单
|
||||
form.on('submit(submitForm)', function(formData) {
|
||||
top.dialog.confirm(top.dataMessage.commit, function(index) {
|
||||
top.dialog.close(index);
|
||||
formData.field.departmentId = new Date().getTime();
|
||||
formData.field.departmentParentId = departmentParentId;
|
||||
parent.splitDepartmentArray.push(formData.field);
|
||||
closeBox();
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
// 选择负责人
|
||||
$(document).on('click', '#departmentMasterName', function() {
|
||||
top.dialog.dialogData.selectedUserIds = $('#departmentMaster').val();
|
||||
@ -359,44 +241,35 @@
|
||||
});
|
||||
})
|
||||
|
||||
// 提交表单
|
||||
form.on('submit(submitForm)', function(formData) {
|
||||
top.dialog.confirm(top.dataMessage.commit, function(index) {
|
||||
top.dialog.close(index);
|
||||
formData.field.departmentId = new Date().getTime();
|
||||
formData.field.departmentParentId = departmentParentId;
|
||||
parent.splitDepartmentArray.push(formData.field);
|
||||
closeBox();
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
$('.close').on('click', function() {
|
||||
closeBox();
|
||||
});
|
||||
|
||||
// departmentArea1Id 选择事件
|
||||
form.on('select(departmentArea1Id)', function(data) {
|
||||
initDepartmentArea2CodeSelect(data.value);
|
||||
initDepartmentArea3CodeSelect(data.value);
|
||||
initDepartmentArea4CodeSelect(data.value);
|
||||
initDepartmentArea5CodeSelect(data.value);
|
||||
});
|
||||
// departmentArea2Id 选择事件
|
||||
form.on('select(departmentArea2Id)', function(data) {
|
||||
initDepartmentArea3CodeSelect(data.value);
|
||||
initDepartmentArea4CodeSelect(data.value);
|
||||
initDepartmentArea5CodeSelect(data.value);
|
||||
});
|
||||
// departmentArea3Id 选择事件
|
||||
form.on('select(departmentArea3Id)', function(data) {
|
||||
initDepartmentArea4CodeSelect(data.value);
|
||||
initDepartmentArea5CodeSelect(data.value);
|
||||
});
|
||||
// departmentArea4Id 选择事件
|
||||
form.on('select(departmentArea4Id)', function(data) {
|
||||
initDepartmentArea5CodeSelect(data.value);
|
||||
$('#departmentAreaName').on('click', function() {
|
||||
top.dialog.open({
|
||||
title: '选择地区',
|
||||
url: top.restAjax.path('route/area/get-select?areaName={departmentAreaName}', [encodeURI($('#departmentAreaName').val())]),
|
||||
width: '600px',
|
||||
height: '225px',
|
||||
onClose: function() {
|
||||
var selectedAreaArray = top.dialog.dialogData.selectedAreaArray;
|
||||
var areaCode = '';
|
||||
var areaName = '';
|
||||
if(selectedAreaArray.length > 0) {
|
||||
areaCode = selectedAreaArray[selectedAreaArray.length - 1].areaCode;
|
||||
for(var i = 0, item; item = selectedAreaArray[i++];) {
|
||||
if(areaName) {
|
||||
areaName += '/';
|
||||
}
|
||||
areaName += item.areaName;
|
||||
}
|
||||
}
|
||||
$('#departmentAreaCode').val(departmentAreaCode);
|
||||
$('#departmentAreaName').val(areaName);
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
// 校验部门是否存在
|
||||
var checkDepartmentNameTimeout;
|
||||
$(document).on('keydown', '#departmentName', function() {
|
||||
|
@ -153,76 +153,11 @@
|
||||
</div>
|
||||
<div class="layui-col-md6 layui-col-sm6 layui-col-xs12">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">1级区域</label>
|
||||
<div class="layui-input-block layui-form" id="departmentArea1IdSelectTemplateBox" lay-filter="departmentArea1IdSelectTemplateBox"></div>
|
||||
<script id="departmentArea1IdSelectTemplate" type="text/html">
|
||||
<select id="departmentArea1Id" name="departmentArea1Id" lay-filter="departmentArea1Id" lay-search>
|
||||
<option value="">请选择1级区域</option>
|
||||
{{# for(var i = 0, item; item = d[i++];) { }}
|
||||
<option value="{{item.areaId}}">{{item.areaName}}</option>
|
||||
{{# } }}
|
||||
</select>
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-row">
|
||||
<div class="layui-col-md6 layui-col-sm6 layui-col-xs12">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">2级区域</label>
|
||||
<div class="layui-input-block layui-form" id="departmentArea2IdSelectTemplateBox" lay-filter="departmentArea2IdSelectTemplateBox"></div>
|
||||
<script id="departmentArea2IdSelectTemplate" type="text/html">
|
||||
<select id="departmentArea2Id" name="departmentArea2Id" lay-filter="departmentArea2Id" lay-search>
|
||||
<option value="">请选择2级区域</option>
|
||||
{{# for(var i = 0, item; item = d[i++];) { }}
|
||||
<option value="{{item.areaId}}">{{item.areaName}}</option>
|
||||
{{# } }}
|
||||
</select>
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md6 layui-col-sm6 layui-col-xs12">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">3级区域</label>
|
||||
<div class="layui-input-block layui-form" id="departmentArea3IdSelectTemplateBox" lay-filter="departmentArea3IdSelectTemplateBox"></div>
|
||||
<script id="departmentArea3IdSelectTemplate" type="text/html">
|
||||
<select id="departmentArea3Id" name="departmentArea3Id" lay-filter="departmentArea3Id" lay-search>
|
||||
<option value="">请选择3级区域</option>
|
||||
{{# for(var i = 0, item; item = d[i++];) { }}
|
||||
<option value="{{item.areaId}}">{{item.areaName}}</option>
|
||||
{{# } }}
|
||||
</select>
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-row">
|
||||
<div class="layui-col-md6 layui-col-sm6 layui-col-xs12">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">4级区域</label>
|
||||
<div class="layui-input-block layui-form" id="departmentArea4IdSelectTemplateBox" lay-filter="departmentArea4IdSelectTemplateBox"></div>
|
||||
<script id="departmentArea4IdSelectTemplate" type="text/html">
|
||||
<select id="departmentArea4Id" name="departmentArea4Id" lay-filter="departmentArea4Id" lay-search>
|
||||
<option value="">请选择4级区域</option>
|
||||
{{# for(var i = 0, item; item = d[i++];) { }}
|
||||
<option value="{{item.areaId}}">{{item.areaName}}</option>
|
||||
{{# } }}
|
||||
</select>
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md6 layui-col-sm6 layui-col-xs12">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">5级区域</label>
|
||||
<div class="layui-input-block layui-form" id="departmentArea5IdSelectTemplateBox" lay-filter="departmentArea5IdSelectTemplateBox"></div>
|
||||
<script id="departmentArea5IdSelectTemplate" type="text/html">
|
||||
<select id="departmentArea5Id" name="departmentArea5Id" lay-search>
|
||||
<option value="">请选择5级区域</option>
|
||||
{{# for(var i = 0, item; item = d[i++];) { }}
|
||||
<option value="{{item.areaId}}">{{item.areaName}}</option>
|
||||
{{# } }}
|
||||
</select>
|
||||
</script>
|
||||
<label class="layui-form-label layui-form-label-up">选择地区</label>
|
||||
<div class="layui-input-block layui-input-block-down">
|
||||
<input type="hidden" id="departmentAreaCode" name="departmentAreaCode">
|
||||
<input type="text" id="departmentAreaName" name="departmentAreaName" class="layui-input" value="" placeholder="请选择地区" maxlength="255" readonly lay-verify="required" style="cursor:pointer;">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -273,68 +208,7 @@
|
||||
callback();
|
||||
}
|
||||
}
|
||||
|
||||
// 初始化1级区域下拉选择
|
||||
function initDepartmentArea1CodeSelect() {
|
||||
top.restAjax.get(top.restAjax.path('api/area/listbyparentid/0', []), {}, null, function(code, data, args) {
|
||||
initSelectRadioCheckboxTemplate('departmentArea1IdSelectTemplate', 'departmentArea1IdSelectTemplateBox', data);
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
});
|
||||
}
|
||||
|
||||
// 初始化2级区域下拉选择
|
||||
function initDepartmentArea2CodeSelect(area1) {
|
||||
if(!area1) {
|
||||
initSelectRadioCheckboxTemplate('departmentArea2IdSelectTemplate', 'departmentArea2IdSelectTemplateBox', []);
|
||||
return;
|
||||
}
|
||||
top.restAjax.get(top.restAjax.path('api/area/listbyparentid/{area1}', [area1]), {}, null, function(code, data, args) {
|
||||
initSelectRadioCheckboxTemplate('departmentArea2IdSelectTemplate', 'departmentArea2IdSelectTemplateBox', data);
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
});
|
||||
}
|
||||
|
||||
// 初始化3级区域下拉选择
|
||||
function initDepartmentArea3CodeSelect(area2) {
|
||||
if(!area2) {
|
||||
initSelectRadioCheckboxTemplate('departmentArea3IdSelectTemplate', 'departmentArea3IdSelectTemplateBox', []);
|
||||
return;
|
||||
}
|
||||
top.restAjax.get(top.restAjax.path('api/area/listbyparentid/{area2}', [area2]), {}, null, function(code, data, args) {
|
||||
initSelectRadioCheckboxTemplate('departmentArea3IdSelectTemplate', 'departmentArea3IdSelectTemplateBox', data);
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
});
|
||||
}
|
||||
|
||||
// 初始化4级区域下拉选择
|
||||
function initDepartmentArea4CodeSelect(area3) {
|
||||
if(!area3) {
|
||||
initSelectRadioCheckboxTemplate('departmentArea4IdSelectTemplate', 'departmentArea4IdSelectTemplateBox', []);
|
||||
return;
|
||||
}
|
||||
top.restAjax.get(top.restAjax.path('api/area/listbyparentid/{area3}', [area3]), {}, null, function(code, data, args) {
|
||||
initSelectRadioCheckboxTemplate('departmentArea4IdSelectTemplate', 'departmentArea4IdSelectTemplateBox', data);
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
});
|
||||
}
|
||||
|
||||
// 初始化5级区域下拉选择
|
||||
function initDepartmentArea5CodeSelect(area4) {
|
||||
if(!area4) {
|
||||
initSelectRadioCheckboxTemplate('departmentArea5IdSelectTemplate', 'departmentArea5IdSelectTemplateBox', []);
|
||||
return;
|
||||
}
|
||||
top.restAjax.get(top.restAjax.path('api/area/listbyparentid/{area4}', [area4]), {}, null, function(code, data, args) {
|
||||
initSelectRadioCheckboxTemplate('departmentArea5IdSelectTemplate', 'departmentArea5IdSelectTemplateBox', data);
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
});
|
||||
}
|
||||
|
||||
// 初始化
|
||||
function initData() {
|
||||
form.val('dataForm', {
|
||||
@ -362,11 +236,6 @@
|
||||
});
|
||||
}
|
||||
initData();
|
||||
initDepartmentArea1CodeSelect();
|
||||
initDepartmentArea2CodeSelect();
|
||||
initDepartmentArea3CodeSelect();
|
||||
initDepartmentArea4CodeSelect();
|
||||
initDepartmentArea5CodeSelect();
|
||||
|
||||
// 选择负责人
|
||||
$(document).on('click', '#departmentMasterName', function() {
|
||||
@ -427,27 +296,29 @@
|
||||
closeBox();
|
||||
});
|
||||
|
||||
// departmentArea1Id 选择事件
|
||||
form.on('select(departmentArea1Id)', function(data) {
|
||||
initDepartmentArea2CodeSelect(data.value);
|
||||
initDepartmentArea3CodeSelect(data.value);
|
||||
initDepartmentArea4CodeSelect(data.value);
|
||||
initDepartmentArea5CodeSelect(data.value);
|
||||
});
|
||||
// departmentArea2Id 选择事件
|
||||
form.on('select(departmentArea2Id)', function(data) {
|
||||
initDepartmentArea3CodeSelect(data.value);
|
||||
initDepartmentArea4CodeSelect(data.value);
|
||||
initDepartmentArea5CodeSelect(data.value);
|
||||
});
|
||||
// departmentArea3Id 选择事件
|
||||
form.on('select(departmentArea3Id)', function(data) {
|
||||
initDepartmentArea4CodeSelect(data.value);
|
||||
initDepartmentArea5CodeSelect(data.value);
|
||||
});
|
||||
// departmentArea4Id 选择事件
|
||||
form.on('select(departmentArea4Id)', function(data) {
|
||||
initDepartmentArea5CodeSelect(data.value);
|
||||
$('#departmentAreaName').on('click', function() {
|
||||
top.dialog.open({
|
||||
title: '选择地区',
|
||||
url: top.restAjax.path('route/area/get-select?areaName={departmentAreaName}', [encodeURI($('#departmentAreaName').val())]),
|
||||
width: '600px',
|
||||
height: '225px',
|
||||
onClose: function() {
|
||||
var selectedAreaArray = top.dialog.dialogData.selectedAreaArray;
|
||||
var areaCode = '';
|
||||
var areaName = '';
|
||||
if(selectedAreaArray.length > 0) {
|
||||
areaCode = selectedAreaArray[selectedAreaArray.length - 1].areaCode;
|
||||
for(var i = 0, item; item = selectedAreaArray[i++];) {
|
||||
if(areaName) {
|
||||
areaName += '/';
|
||||
}
|
||||
areaName += item.areaName;
|
||||
}
|
||||
}
|
||||
$('#departmentAreaCode').val(departmentAreaCode);
|
||||
$('#departmentAreaName').val(areaName);
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
var checkDepartmentNameTimeout;
|
||||
|
@ -136,76 +136,11 @@
|
||||
<div class="layui-row">
|
||||
<div class="layui-col-md6 layui-col-sm6 layui-col-xs12">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">1级区域</label>
|
||||
<div class="layui-input-block layui-form" id="departmentArea1IdSelectTemplateBox" lay-filter="departmentArea1IdSelectTemplateBox"></div>
|
||||
<script id="departmentArea1IdSelectTemplate" type="text/html">
|
||||
<select id="departmentArea1Id" name="departmentArea1Id" lay-filter="departmentArea1Id" lay-search>
|
||||
<option value="">请选择1级区域</option>
|
||||
{{# for(var i = 0, item; item = d[i++];) { }}
|
||||
<option value="{{item.areaId}}">{{item.areaName}}</option>
|
||||
{{# } }}
|
||||
</select>
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md6 layui-col-sm6 layui-col-xs12">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">2级区域</label>
|
||||
<div class="layui-input-block layui-form" id="departmentArea2IdSelectTemplateBox" lay-filter="departmentArea2IdSelectTemplateBox"></div>
|
||||
<script id="departmentArea2IdSelectTemplate" type="text/html">
|
||||
<select id="departmentArea2Id" name="departmentArea2Id" lay-filter="departmentArea2Id" lay-search>
|
||||
<option value="">请选择2级区域</option>
|
||||
{{# for(var i = 0, item; item = d[i++];) { }}
|
||||
<option value="{{item.areaId}}">{{item.areaName}}</option>
|
||||
{{# } }}
|
||||
</select>
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-row">
|
||||
<div class="layui-col-md6 layui-col-sm6 layui-col-xs12">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">3级区域</label>
|
||||
<div class="layui-input-block layui-form" id="departmentArea3IdSelectTemplateBox" lay-filter="departmentArea3IdSelectTemplateBox"></div>
|
||||
<script id="departmentArea3IdSelectTemplate" type="text/html">
|
||||
<select id="departmentArea3Id" name="departmentArea3Id" lay-filter="departmentArea3Id" lay-search>
|
||||
<option value="">请选择3级区域</option>
|
||||
{{# for(var i = 0, item; item = d[i++];) { }}
|
||||
<option value="{{item.areaId}}">{{item.areaName}}</option>
|
||||
{{# } }}
|
||||
</select>
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md6 layui-col-sm6 layui-col-xs12">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">4级区域</label>
|
||||
<div class="layui-input-block layui-form" id="departmentArea4IdSelectTemplateBox" lay-filter="departmentArea4IdSelectTemplateBox"></div>
|
||||
<script id="departmentArea4IdSelectTemplate" type="text/html">
|
||||
<select id="departmentArea4Id" name="departmentArea4Id" lay-filter="departmentArea4Id" lay-search>
|
||||
<option value="">请选择4级区域</option>
|
||||
{{# for(var i = 0, item; item = d[i++];) { }}
|
||||
<option value="{{item.areaId}}">{{item.areaName}}</option>
|
||||
{{# } }}
|
||||
</select>
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-row">
|
||||
<div class="layui-col-md6 layui-col-sm6 layui-col-xs12">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">5级区域</label>
|
||||
<div class="layui-input-block layui-form" id="departmentArea5IdSelectTemplateBox" lay-filter="departmentArea5IdSelectTemplateBox"></div>
|
||||
<script id="departmentArea5IdSelectTemplate" type="text/html">
|
||||
<select id="departmentArea5Id" name="departmentArea5Id" lay-search>
|
||||
<option value="">请选择5级区域</option>
|
||||
{{# for(var i = 0, item; item = d[i++];) { }}
|
||||
<option value="{{item.areaId}}">{{item.areaName}}</option>
|
||||
{{# } }}
|
||||
</select>
|
||||
</script>
|
||||
<label class="layui-form-label layui-form-label-up">选择地区</label>
|
||||
<div class="layui-input-block layui-input-block-down">
|
||||
<input type="hidden" id="departmentAreaCode" name="departmentAreaCode">
|
||||
<input type="text" id="departmentAreaName" name="departmentAreaName" class="layui-input" value="" placeholder="请选择地区" maxlength="255" readonly lay-verify="required" style="cursor:pointer;">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md6 layui-col-sm6 layui-col-xs12">
|
||||
@ -257,103 +192,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
// 初始化1级区域下拉选择
|
||||
function initDepartmentArea1CodeSelect(selectValue) {
|
||||
top.restAjax.get(top.restAjax.path('api/area/listbyparentid/0', []), {}, null, function(code, data, args) {
|
||||
initSelectRadioCheckboxTemplate('departmentArea1IdSelectTemplate', 'departmentArea1IdSelectTemplateBox', data, function() {
|
||||
var selectObj = {};
|
||||
selectObj['departmentArea1Id'] = selectValue;
|
||||
form.val('dataForm', selectObj);
|
||||
});
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
});
|
||||
}
|
||||
|
||||
// 初始化2级区域下拉选择
|
||||
function initDepartmentArea2CodeSelect(area1, selectValue) {
|
||||
if(!area1) {
|
||||
initSelectRadioCheckboxTemplate('departmentArea2IdSelectTemplate', 'departmentArea2IdSelectTemplateBox', [], function() {
|
||||
var selectObj = {};
|
||||
selectObj['departmentArea2Id'] = selectValue;
|
||||
form.val('dataForm', selectObj);
|
||||
});
|
||||
return;
|
||||
}
|
||||
top.restAjax.get(top.restAjax.path('api/area/listbyparentid/{area1}', [area1]), {}, null, function(code, data, args) {
|
||||
initSelectRadioCheckboxTemplate('departmentArea2IdSelectTemplate', 'departmentArea2IdSelectTemplateBox', data, function() {
|
||||
var selectObj = {};
|
||||
selectObj['departmentArea2Id'] = selectValue;
|
||||
form.val('dataForm', selectObj);
|
||||
});
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
});
|
||||
}
|
||||
|
||||
// 初始化3级区域下拉选择
|
||||
function initDepartmentArea3CodeSelect(area2, selectValue) {
|
||||
if(!area2) {
|
||||
initSelectRadioCheckboxTemplate('departmentArea3IdSelectTemplate', 'departmentArea3IdSelectTemplateBox', [], function() {
|
||||
var selectObj = {};
|
||||
selectObj['departmentArea3Id'] = selectValue;
|
||||
form.val('dataForm', selectObj);
|
||||
});
|
||||
return;
|
||||
}
|
||||
top.restAjax.get(top.restAjax.path('api/area/listbyparentid/{area2}', [area2]), {}, null, function(code, data, args) {
|
||||
initSelectRadioCheckboxTemplate('departmentArea3IdSelectTemplate', 'departmentArea3IdSelectTemplateBox', data, function() {
|
||||
var selectObj = {};
|
||||
selectObj['departmentArea3Id'] = selectValue;
|
||||
form.val('dataForm', selectObj);
|
||||
});
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
});
|
||||
}
|
||||
|
||||
// 初始化4级区域下拉选择
|
||||
function initDepartmentArea4CodeSelect(area3, selectValue) {
|
||||
if(!area3) {
|
||||
initSelectRadioCheckboxTemplate('departmentArea4IdSelectTemplate', 'departmentArea4IdSelectTemplateBox', [], function() {
|
||||
var selectObj = {};
|
||||
selectObj['departmentArea4Id'] = selectValue;
|
||||
form.val('dataForm', selectObj);
|
||||
});
|
||||
return;
|
||||
}
|
||||
top.restAjax.get(top.restAjax.path('api/area/listbyparentid/{area3}', [area3]), {}, null, function(code, data, args) {
|
||||
initSelectRadioCheckboxTemplate('departmentArea4IdSelectTemplate', 'departmentArea4IdSelectTemplateBox', data, function() {
|
||||
var selectObj = {};
|
||||
selectObj['departmentArea4Id'] = selectValue;
|
||||
form.val('dataForm', selectObj);
|
||||
});
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
});
|
||||
}
|
||||
|
||||
// 初始化5级区域下拉选择
|
||||
function initDepartmentArea5CodeSelect(area4, selectValue) {
|
||||
if(!area4) {
|
||||
initSelectRadioCheckboxTemplate('departmentArea5IdSelectTemplate', 'departmentArea5IdSelectTemplateBox', [], function() {
|
||||
var selectObj = {};
|
||||
selectObj['departmentArea5Id'] = selectValue;
|
||||
form.val('dataForm', selectObj);
|
||||
});
|
||||
return;
|
||||
}
|
||||
top.restAjax.get(top.restAjax.path('api/area/listbyparentid/{area4}', [area4]), {}, null, function(code, data, args) {
|
||||
initSelectRadioCheckboxTemplate('departmentArea5IdSelectTemplate', 'departmentArea5IdSelectTemplateBox', data, function() {
|
||||
var selectObj = {};
|
||||
selectObj['departmentArea5Id'] = selectValue;
|
||||
form.val('dataForm', selectObj);
|
||||
});
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
});
|
||||
}
|
||||
|
||||
// 初始化
|
||||
function initData() {
|
||||
var loadLayerIndex;
|
||||
@ -371,6 +209,8 @@
|
||||
departmentState: data.departmentState +'',
|
||||
departmentMaster: data.departmentMaster,
|
||||
departmentMasterName: data.departmentMasterName,
|
||||
departmentAreaCode: data.departmentAreaCode,
|
||||
departmentAreaName: data.departmentAreaName,
|
||||
departmentFax: data.departmentFax,
|
||||
departmentTel: data.departmentTel,
|
||||
departmentDuty: data.departmentDuty,
|
||||
@ -380,17 +220,30 @@
|
||||
departmentAddress: data.departmentAddress,
|
||||
});
|
||||
form.render(null, 'dataForm');
|
||||
|
||||
initDepartmentArea1CodeSelect(data['departmentArea1Id']);
|
||||
initDepartmentArea2CodeSelect(data['departmentArea1Id'], data['departmentArea2Id']);
|
||||
initDepartmentArea3CodeSelect(data['departmentArea2Id'], data['departmentArea3Id']);
|
||||
initDepartmentArea4CodeSelect(data['departmentArea3Id'], data['departmentArea4Id']);
|
||||
initDepartmentArea5CodeSelect(data['departmentArea4Id'], data['departmentArea5Id']);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
initData();
|
||||
|
||||
// 提交表单
|
||||
form.on('submit(submitForm)', function(formData) {
|
||||
top.dialog.confirm('确定修改?', function(index) {
|
||||
top.dialog.close(index);
|
||||
var loadLayerIndex;
|
||||
for(var i = 0, data; data = parent.splitDepartmentArray[i++];) {
|
||||
if(data.departmentId == departmentId) {
|
||||
formData.field.departmentId = departmentId;
|
||||
formData.field.departmentParentId = departmentParentId;
|
||||
parent.splitDepartmentArray.splice(i - 1, 1, formData.field);
|
||||
closeBox();
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
// 选择负责人
|
||||
$(document).on('click', '#departmentMasterName', function() {
|
||||
top.dialog.dialogData.selectedUserIds = $('#departmentMaster').val();
|
||||
@ -415,51 +268,36 @@
|
||||
}
|
||||
});
|
||||
})
|
||||
// 提交表单
|
||||
form.on('submit(submitForm)', function(formData) {
|
||||
top.dialog.confirm('确定修改?', function(index) {
|
||||
top.dialog.close(index);
|
||||
var loadLayerIndex;
|
||||
for(var i = 0, data; data = parent.splitDepartmentArray[i++];) {
|
||||
if(data.departmentId == departmentId) {
|
||||
formData.field.departmentId = departmentId;
|
||||
formData.field.departmentParentId = departmentParentId;
|
||||
parent.splitDepartmentArray.splice(i - 1, 1, formData.field);
|
||||
closeBox();
|
||||
break;
|
||||
|
||||
$('#departmentAreaName').on('click', function() {
|
||||
top.dialog.open({
|
||||
title: '选择地区',
|
||||
url: top.restAjax.path('route/area/get-select?areaName={departmentAreaName}', [encodeURI($('#departmentAreaName').val())]),
|
||||
width: '600px',
|
||||
height: '225px',
|
||||
onClose: function() {
|
||||
var selectedAreaArray = top.dialog.dialogData.selectedAreaArray;
|
||||
var areaCode = '';
|
||||
var areaName = '';
|
||||
if(selectedAreaArray.length > 0) {
|
||||
areaCode = selectedAreaArray[selectedAreaArray.length - 1].areaCode;
|
||||
for(var i = 0, item; item = selectedAreaArray[i++];) {
|
||||
if(areaName) {
|
||||
areaName += '/';
|
||||
}
|
||||
areaName += item.areaName;
|
||||
}
|
||||
}
|
||||
$('#departmentAreaCode').val(departmentAreaCode);
|
||||
$('#departmentAreaName').val(areaName);
|
||||
}
|
||||
});
|
||||
return false;
|
||||
})
|
||||
});
|
||||
|
||||
$('.close').on('click', function() {
|
||||
closeBox();
|
||||
});
|
||||
|
||||
// departmentArea1Id 选择事件
|
||||
form.on('select(departmentArea1Id)', function(data) {
|
||||
initDepartmentArea2CodeSelect(data.value);
|
||||
initDepartmentArea3CodeSelect(data.value);
|
||||
initDepartmentArea4CodeSelect(data.value);
|
||||
initDepartmentArea5CodeSelect(data.value);
|
||||
});
|
||||
// departmentArea2Id 选择事件
|
||||
form.on('select(departmentArea2Id)', function(data) {
|
||||
initDepartmentArea3CodeSelect(data.value);
|
||||
initDepartmentArea4CodeSelect(data.value);
|
||||
initDepartmentArea5CodeSelect(data.value);
|
||||
});
|
||||
// departmentArea3Id 选择事件
|
||||
form.on('select(departmentArea3Id)', function(data) {
|
||||
initDepartmentArea4CodeSelect(data.value);
|
||||
initDepartmentArea5CodeSelect(data.value);
|
||||
});
|
||||
// departmentArea4Id 选择事件
|
||||
form.on('select(departmentArea4Id)', function(data) {
|
||||
initDepartmentArea5CodeSelect(data.value);
|
||||
});
|
||||
|
||||
// 校验部门是否存在
|
||||
var checkDepartmentNameTimeout;
|
||||
$(document).on('keydown', '#departmentName', function() {
|
||||
|
@ -153,76 +153,11 @@
|
||||
</div>
|
||||
<div class="layui-col-md6 layui-col-sm6 layui-col-xs12">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">1级区域</label>
|
||||
<div class="layui-input-block layui-form" id="departmentArea1IdSelectTemplateBox" lay-filter="departmentArea1IdSelectTemplateBox"></div>
|
||||
<script id="departmentArea1IdSelectTemplate" type="text/html">
|
||||
<select id="departmentArea1Id" name="departmentArea1Id" lay-filter="departmentArea1Id" lay-search>
|
||||
<option value="">请选择1级区域</option>
|
||||
{{# for(var i = 0, item; item = d[i++];) { }}
|
||||
<option value="{{item.areaId}}">{{item.areaName}}</option>
|
||||
{{# } }}
|
||||
</select>
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-row">
|
||||
<div class="layui-col-md6 layui-col-sm6 layui-col-xs12">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">2级区域</label>
|
||||
<div class="layui-input-block layui-form" id="departmentArea2IdSelectTemplateBox" lay-filter="departmentArea2IdSelectTemplateBox"></div>
|
||||
<script id="departmentArea2IdSelectTemplate" type="text/html">
|
||||
<select id="departmentArea2Id" name="departmentArea2Id" lay-filter="departmentArea2Id" lay-search>
|
||||
<option value="">请选择2级区域</option>
|
||||
{{# for(var i = 0, item; item = d[i++];) { }}
|
||||
<option value="{{item.areaId}}">{{item.areaName}}</option>
|
||||
{{# } }}
|
||||
</select>
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md6 layui-col-sm6 layui-col-xs12">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">3级区域</label>
|
||||
<div class="layui-input-block layui-form" id="departmentArea3IdSelectTemplateBox" lay-filter="departmentArea3IdSelectTemplateBox"></div>
|
||||
<script id="departmentArea3IdSelectTemplate" type="text/html">
|
||||
<select id="departmentArea3Id" name="departmentArea3Id" lay-filter="departmentArea3Id" lay-search>
|
||||
<option value="">请选择3级区域</option>
|
||||
{{# for(var i = 0, item; item = d[i++];) { }}
|
||||
<option value="{{item.areaId}}">{{item.areaName}}</option>
|
||||
{{# } }}
|
||||
</select>
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-row">
|
||||
<div class="layui-col-md6 layui-col-sm6 layui-col-xs12">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">4级区域</label>
|
||||
<div class="layui-input-block layui-form" id="departmentArea4IdSelectTemplateBox" lay-filter="departmentArea4IdSelectTemplateBox"></div>
|
||||
<script id="departmentArea4IdSelectTemplate" type="text/html">
|
||||
<select id="departmentArea4Id" name="departmentArea4Id" lay-filter="departmentArea4Id" lay-search>
|
||||
<option value="">请选择4级区域</option>
|
||||
{{# for(var i = 0, item; item = d[i++];) { }}
|
||||
<option value="{{item.areaId}}">{{item.areaName}}</option>
|
||||
{{# } }}
|
||||
</select>
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md6 layui-col-sm6 layui-col-xs12">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">5级区域</label>
|
||||
<div class="layui-input-block layui-form" id="departmentArea5IdSelectTemplateBox" lay-filter="departmentArea5IdSelectTemplateBox"></div>
|
||||
<script id="departmentArea5IdSelectTemplate" type="text/html">
|
||||
<select id="departmentArea5Id" name="departmentArea5Id" lay-search>
|
||||
<option value="">请选择5级区域</option>
|
||||
{{# for(var i = 0, item; item = d[i++];) { }}
|
||||
<option value="{{item.areaId}}">{{item.areaName}}</option>
|
||||
{{# } }}
|
||||
</select>
|
||||
</script>
|
||||
<label class="layui-form-label layui-form-label-up">选择地区</label>
|
||||
<div class="layui-input-block layui-input-block-down">
|
||||
<input type="hidden" id="departmentAreaCode" name="departmentAreaCode">
|
||||
<input type="text" id="departmentAreaName" name="departmentAreaName" class="layui-input" value="" placeholder="请选择地区" maxlength="255" readonly lay-verify="required" style="cursor:pointer;">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -274,103 +209,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
// 初始化1级区域下拉选择
|
||||
function initDepartmentArea1CodeSelect(selectValue) {
|
||||
top.restAjax.get(top.restAjax.path('api/area/listbyparentid/0', []), {}, null, function(code, data, args) {
|
||||
initSelectRadioCheckboxTemplate('departmentArea1IdSelectTemplate', 'departmentArea1IdSelectTemplateBox', data, function() {
|
||||
var selectObj = {};
|
||||
selectObj['departmentArea1Id'] = selectValue;
|
||||
form.val('dataForm', selectObj);
|
||||
});
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
});
|
||||
}
|
||||
|
||||
// 初始化2级区域下拉选择
|
||||
function initDepartmentArea2CodeSelect(area1, selectValue) {
|
||||
if(!area1) {
|
||||
initSelectRadioCheckboxTemplate('departmentArea2IdSelectTemplate', 'departmentArea2IdSelectTemplateBox', [], function() {
|
||||
var selectObj = {};
|
||||
selectObj['departmentArea2Id'] = selectValue;
|
||||
form.val('dataForm', selectObj);
|
||||
});
|
||||
return;
|
||||
}
|
||||
top.restAjax.get(top.restAjax.path('api/area/listbyparentid/{area1}', [area1]), {}, null, function(code, data, args) {
|
||||
initSelectRadioCheckboxTemplate('departmentArea2IdSelectTemplate', 'departmentArea2IdSelectTemplateBox', data, function() {
|
||||
var selectObj = {};
|
||||
selectObj['departmentArea2Id'] = selectValue;
|
||||
form.val('dataForm', selectObj);
|
||||
});
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
});
|
||||
}
|
||||
|
||||
// 初始化3级区域下拉选择
|
||||
function initDepartmentArea3CodeSelect(area2, selectValue) {
|
||||
if(!area2) {
|
||||
initSelectRadioCheckboxTemplate('departmentArea3IdSelectTemplate', 'departmentArea3IdSelectTemplateBox', [], function() {
|
||||
var selectObj = {};
|
||||
selectObj['departmentArea3Id'] = selectValue;
|
||||
form.val('dataForm', selectObj);
|
||||
});
|
||||
return;
|
||||
}
|
||||
top.restAjax.get(top.restAjax.path('api/area/listbyparentid/{area2}', [area2]), {}, null, function(code, data, args) {
|
||||
initSelectRadioCheckboxTemplate('departmentArea3IdSelectTemplate', 'departmentArea3IdSelectTemplateBox', data, function() {
|
||||
var selectObj = {};
|
||||
selectObj['departmentArea3Id'] = selectValue;
|
||||
form.val('dataForm', selectObj);
|
||||
});
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
});
|
||||
}
|
||||
|
||||
// 初始化4级区域下拉选择
|
||||
function initDepartmentArea4CodeSelect(area3, selectValue) {
|
||||
if(!area3) {
|
||||
initSelectRadioCheckboxTemplate('departmentArea4IdSelectTemplate', 'departmentArea4IdSelectTemplateBox', [], function() {
|
||||
var selectObj = {};
|
||||
selectObj['departmentArea4Id'] = selectValue;
|
||||
form.val('dataForm', selectObj);
|
||||
});
|
||||
return;
|
||||
}
|
||||
top.restAjax.get(top.restAjax.path('api/area/listbyparentid/{area3}', [area3]), {}, null, function(code, data, args) {
|
||||
initSelectRadioCheckboxTemplate('departmentArea4IdSelectTemplate', 'departmentArea4IdSelectTemplateBox', data, function() {
|
||||
var selectObj = {};
|
||||
selectObj['departmentArea4Id'] = selectValue;
|
||||
form.val('dataForm', selectObj);
|
||||
});
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
});
|
||||
}
|
||||
|
||||
// 初始化5级区域下拉选择
|
||||
function initDepartmentArea5CodeSelect(area4, selectValue) {
|
||||
if(!area4) {
|
||||
initSelectRadioCheckboxTemplate('departmentArea5IdSelectTemplate', 'departmentArea5IdSelectTemplateBox', [], function() {
|
||||
var selectObj = {};
|
||||
selectObj['departmentArea5Id'] = selectValue;
|
||||
form.val('dataForm', selectObj);
|
||||
});
|
||||
return;
|
||||
}
|
||||
top.restAjax.get(top.restAjax.path('api/area/listbyparentid/{area4}', [area4]), {}, null, function(code, data, args) {
|
||||
initSelectRadioCheckboxTemplate('departmentArea5IdSelectTemplate', 'departmentArea5IdSelectTemplateBox', data, function() {
|
||||
var selectObj = {};
|
||||
selectObj['departmentArea5Id'] = selectValue;
|
||||
form.val('dataForm', selectObj);
|
||||
});
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
});
|
||||
}
|
||||
|
||||
// 初始化
|
||||
function initData() {
|
||||
var loadLayerIndex;
|
||||
@ -388,6 +226,8 @@
|
||||
departmentState: data.departmentState +'',
|
||||
departmentMaster: data.departmentMaster,
|
||||
departmentMasterName: data.departmentMasterName,
|
||||
departmentAreaCode: data.departmentAreaCode,
|
||||
departmentAreaName: data.departmentAreaName,
|
||||
departmentFax: data.departmentFax,
|
||||
departmentTel: data.departmentTel,
|
||||
departmentDuty: data.departmentDuty,
|
||||
@ -397,11 +237,6 @@
|
||||
departmentAddress: data.departmentAddress,
|
||||
});
|
||||
form.render(null, 'dataForm');
|
||||
initDepartmentArea1CodeSelect(data['departmentArea1Id']);
|
||||
initDepartmentArea2CodeSelect(data['departmentArea1Id'], data['departmentArea2Id']);
|
||||
initDepartmentArea3CodeSelect(data['departmentArea2Id'], data['departmentArea3Id']);
|
||||
initDepartmentArea4CodeSelect(data['departmentArea3Id'], data['departmentArea4Id']);
|
||||
initDepartmentArea5CodeSelect(data['departmentArea4Id'], data['departmentArea5Id']);
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
}, function() {
|
||||
@ -434,7 +269,33 @@
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
});
|
||||
|
||||
$('#departmentAreaName').on('click', function() {
|
||||
top.dialog.open({
|
||||
title: '选择地区',
|
||||
url: top.restAjax.path('route/area/get-select?areaName={departmentAreaName}', [encodeURI($('#departmentAreaName').val())]),
|
||||
width: '600px',
|
||||
height: '225px',
|
||||
onClose: function() {
|
||||
var selectedAreaArray = top.dialog.dialogData.selectedAreaArray;
|
||||
var areaCode = '';
|
||||
var areaName = '';
|
||||
if(selectedAreaArray.length > 0) {
|
||||
areaCode = selectedAreaArray[selectedAreaArray.length - 1].areaCode;
|
||||
for(var i = 0, item; item = selectedAreaArray[i++];) {
|
||||
if(areaName) {
|
||||
areaName += '/';
|
||||
}
|
||||
areaName += item.areaName;
|
||||
}
|
||||
}
|
||||
$('#departmentAreaCode').val(departmentAreaCode);
|
||||
$('#departmentAreaName').val(areaName);
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
// 提交表单
|
||||
form.on('submit(submitForm)', function(formData) {
|
||||
top.dialog.confirm(top.dataMessage.commit, function(index) {
|
||||
@ -469,28 +330,6 @@
|
||||
closeBox();
|
||||
});
|
||||
|
||||
// departmentArea1Id 选择事件
|
||||
form.on('select(departmentArea1Id)', function(data) {
|
||||
initDepartmentArea2CodeSelect(data.value);
|
||||
initDepartmentArea3CodeSelect(data.value);
|
||||
initDepartmentArea4CodeSelect(data.value);
|
||||
initDepartmentArea5CodeSelect(data.value);
|
||||
});
|
||||
// departmentArea2Id 选择事件
|
||||
form.on('select(departmentArea2Id)', function(data) {
|
||||
initDepartmentArea3CodeSelect(data.value);
|
||||
initDepartmentArea4CodeSelect(data.value);
|
||||
initDepartmentArea5CodeSelect(data.value);
|
||||
});
|
||||
// departmentArea3Id 选择事件
|
||||
form.on('select(departmentArea3Id)', function(data) {
|
||||
initDepartmentArea4CodeSelect(data.value);
|
||||
initDepartmentArea5CodeSelect(data.value);
|
||||
});
|
||||
// departmentArea4Id 选择事件
|
||||
form.on('select(departmentArea4Id)', function(data) {
|
||||
initDepartmentArea5CodeSelect(data.value);
|
||||
});
|
||||
// 校验部门是否存在
|
||||
var checkDepartmentNameTimeout;
|
||||
$(document).on('keydown', '#departmentName', function() {
|
||||
|
Loading…
Reference in New Issue
Block a user