Commit 8d5947c6 by sunxin

区域列表sql语句修改、转文档controller修改

parent 6738b3d4
...@@ -71,6 +71,16 @@ public class ReportEntity extends DataEntity<ReportEntity> { ...@@ -71,6 +71,16 @@ public class ReportEntity extends DataEntity<ReportEntity> {
private CtBbtcBusType supplementTypeNew;//业务类型 private CtBbtcBusType supplementTypeNew;//业务类型
private Date transTime; //转为线索的时间 private Date transTime; //转为线索的时间
private List regionList; //区域列表
public List getRegionList() {
return regionList;
}
public void setRegionList(List regionList) {
this.regionList = regionList;
}
public Date getTransTime() { public Date getTransTime() {
return transTime; return transTime;
} }
......
...@@ -10,6 +10,7 @@ import com.ejweb.modules.front.report.entity.IP2Regions; ...@@ -10,6 +10,7 @@ import com.ejweb.modules.front.report.entity.IP2Regions;
import com.ejweb.modules.front.report.utils.IpUtils; import com.ejweb.modules.front.report.utils.IpUtils;
import com.ejweb.modules.report.dao.CtBbtcBusCategoryDao; import com.ejweb.modules.report.dao.CtBbtcBusCategoryDao;
import com.ejweb.modules.report.dao.CtBbtcBusTypeDao; import com.ejweb.modules.report.dao.CtBbtcBusTypeDao;
import com.ejweb.modules.report.dao.CtBbtcRegionDao;
import com.ejweb.modules.report.dao.ReportDao; import com.ejweb.modules.report.dao.ReportDao;
import com.ejweb.modules.report.entity.*; import com.ejweb.modules.report.entity.*;
import com.ejweb.modules.sys.dao.RoleDao; import com.ejweb.modules.sys.dao.RoleDao;
...@@ -56,6 +57,9 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> { ...@@ -56,6 +57,9 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> {
@Autowired @Autowired
private CtBbtcBusCategoryDao ctBbtcBusCategoryDao; private CtBbtcBusCategoryDao ctBbtcBusCategoryDao;
@Autowired
private CtBbtcRegionDao ctBbtcRegionDao;
protected static Logger logger = LoggerFactory.getLogger(ReportService.class); protected static Logger logger = LoggerFactory.getLogger(ReportService.class);
/** /**
...@@ -1030,6 +1034,12 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> { ...@@ -1030,6 +1034,12 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> {
*/ */
public Page<ReportEntity> findQyList(Page<ReportEntity> page, ReportEntity reportEntity) { public Page<ReportEntity> findQyList(Page<ReportEntity> page, ReportEntity reportEntity) {
reportEntity.setPage(page); reportEntity.setPage(page);
/*
* *//*查询出区域列表所有集团 id 封装到reportEntity实体内*//*
List<CtBbtcRegion> allList = ctBbtcRegionDao.findAllList();
System.out.println("区域总数:=========="+allList.size());
reportEntity.setRegionList(allList);
*/
page.setList(reportDao.findQyList(reportEntity)); page.setList(reportDao.findQyList(reportEntity));
return page; return page;
} }
......
...@@ -3,8 +3,10 @@ package com.ejweb.modules.report.web; ...@@ -3,8 +3,10 @@ package com.ejweb.modules.report.web;
import com.ejweb.conf.GConstants; import com.ejweb.conf.GConstants;
import com.ejweb.core.base.BaseController; import com.ejweb.core.base.BaseController;
import com.ejweb.core.utils.StringUtils; import com.ejweb.core.utils.StringUtils;
import com.ejweb.modules.report.entity.CtBbtcBusType;
import com.ejweb.modules.report.entity.ReportAttachmentEntity; import com.ejweb.modules.report.entity.ReportAttachmentEntity;
import com.ejweb.modules.report.entity.ReportEntity; import com.ejweb.modules.report.entity.ReportEntity;
import com.ejweb.modules.report.service.CtBbtcBusTypeService;
import com.ejweb.modules.report.service.ReportService; import com.ejweb.modules.report.service.ReportService;
import com.itextpdf.text.*; import com.itextpdf.text.*;
import com.itextpdf.text.pdf.BaseFont; import com.itextpdf.text.pdf.BaseFont;
...@@ -37,6 +39,9 @@ public class ReportToPdfController extends BaseController { ...@@ -37,6 +39,9 @@ public class ReportToPdfController extends BaseController {
@Autowired @Autowired
private ReportService reportService; private ReportService reportService;
@Autowired
protected CtBbtcBusTypeService CtBbtcBusTypeService;
@ModelAttribute @ModelAttribute
public ReportEntity get(@RequestParam(required = false) String id) { public ReportEntity get(@RequestParam(required = false) String id) {
if (StringUtils.isNotBlank(id)) { if (StringUtils.isNotBlank(id)) {
...@@ -206,11 +211,13 @@ public class ReportToPdfController extends BaseController { ...@@ -206,11 +211,13 @@ public class ReportToPdfController extends BaseController {
PdfPCell supplementDepartment1 = new PdfPCell(new Paragraph(reportEntity.getSupplementDepartment() == null ? "" : reportEntity.getSupplementDepartment(), textfont)); PdfPCell supplementDepartment1 = new PdfPCell(new Paragraph(reportEntity.getSupplementDepartment() == null ? "" : reportEntity.getSupplementDepartment(), textfont));
supplementDepartment1.setBorderWidth(0); supplementDepartment1.setBorderWidth(0);
table3.addCell(supplementDepartment1); table3.addCell(supplementDepartment1);
PdfPCell supplementType = new PdfPCell(new Paragraph("业务类型:", textfont)); PdfPCell supplementType = new PdfPCell(new Paragraph("业务类型:", textfont));
supplementType.setBorderWidth(0); supplementType.setBorderWidth(0);
table3.addCell(supplementType); table3.addCell(supplementType);
String supplement_type = reportEntity.getSupplementType(); String supplement_type = reportEntity.getSupplementType();
if (StringUtils.isNotBlank(supplement_type)) {
/* if (StringUtils.isNotBlank(supplement_type)) {
if (supplement_type.equals("1")) { if (supplement_type.equals("1")) {
supplement_type = "营销"; supplement_type = "营销";
} else if (supplement_type.equals("2")) { } else if (supplement_type.equals("2")) {
...@@ -228,15 +235,34 @@ public class ReportToPdfController extends BaseController { ...@@ -228,15 +235,34 @@ public class ReportToPdfController extends BaseController {
} }
} else { } else {
supplement_type = ""; supplement_type = "";
}*/
if (StringUtils.isNotBlank(supplement_type)) {
String[] types = supplement_type.split(",");
String typeStr = "";
for (String str:types) {
CtBbtcBusType ctBbtcBusType = CtBbtcBusTypeService.get(str);
if(ctBbtcBusType!=null){
typeStr = typeStr + ctBbtcBusType.getName() + ",";
}else{
typeStr = typeStr + "--";
}
}
supplement_type = typeStr.substring(0, typeStr.length() - 1);
} else {
supplement_type = "";
} }
PdfPCell supplementType1 = new PdfPCell(new Paragraph(supplement_type, textfont)); PdfPCell supplementType1 = new PdfPCell(new Paragraph(supplement_type, textfont));
supplementType1.setBorderWidth(0); supplementType1.setBorderWidth(0);
table3.addCell(supplementType1); table3.addCell(supplementType1);
PdfPCell supplementArea = new PdfPCell(new Paragraph("被举报区域:", textfont)); PdfPCell supplementArea = new PdfPCell(new Paragraph("被举报区域:", textfont));
supplementArea.setBorderWidth(0); supplementArea.setBorderWidth(0);
table3.addCell(supplementArea); table3.addCell(supplementArea);
String supplement_area = reportEntity.getSupplementArea(); String supplement_area = reportEntity.getSupplementArea();
if (StringUtils.isNotBlank(supplement_area)) {
/* if (StringUtils.isNotBlank(supplement_area)) {
if (supplement_area.equals("North China")) { if (supplement_area.equals("North China")) {
supplement_area = "华北区域公司"; supplement_area = "华北区域公司";
} else if (supplement_area.equals("BeiJing")) { } else if (supplement_area.equals("BeiJing")) {
...@@ -258,7 +284,8 @@ public class ReportToPdfController extends BaseController { ...@@ -258,7 +284,8 @@ public class ReportToPdfController extends BaseController {
} }
} else { } else {
supplement_area = ""; supplement_area = "";
} }*/
PdfPCell supplementArea1 = new PdfPCell(new Paragraph(supplement_area, textfont)); PdfPCell supplementArea1 = new PdfPCell(new Paragraph(supplement_area, textfont));
supplementArea1.setBorderWidth(0); supplementArea1.setBorderWidth(0);
table3.addCell(supplementArea1); table3.addCell(supplementArea1);
......
...@@ -2,8 +2,10 @@ package com.ejweb.modules.report.web; ...@@ -2,8 +2,10 @@ package com.ejweb.modules.report.web;
import com.ejweb.conf.GConstants; import com.ejweb.conf.GConstants;
import com.ejweb.core.utils.StringUtils; import com.ejweb.core.utils.StringUtils;
import com.ejweb.modules.report.entity.CtBbtcBusType;
import com.ejweb.modules.report.entity.ReportAttachmentEntity; import com.ejweb.modules.report.entity.ReportAttachmentEntity;
import com.ejweb.modules.report.entity.ReportEntity; import com.ejweb.modules.report.entity.ReportEntity;
import com.ejweb.modules.report.service.CtBbtcBusTypeService;
import com.ejweb.modules.report.service.ReportService; import com.ejweb.modules.report.service.ReportService;
import org.apache.poi.xwpf.usermodel.*; import org.apache.poi.xwpf.usermodel.*;
import org.apache.poi.xwpf.model.XWPFHeaderFooterPolicy; import org.apache.poi.xwpf.model.XWPFHeaderFooterPolicy;
...@@ -37,6 +39,9 @@ public class ReportToWordController { ...@@ -37,6 +39,9 @@ public class ReportToWordController {
@Autowired @Autowired
private ReportService reportService; private ReportService reportService;
@Autowired
protected CtBbtcBusTypeService CtBbtcBusTypeService;
@ModelAttribute @ModelAttribute
public ReportEntity get(@RequestParam(required = false) String id) { public ReportEntity get(@RequestParam(required = false) String id) {
if (StringUtils.isNotBlank(id)) { if (StringUtils.isNotBlank(id)) {
...@@ -258,10 +263,13 @@ public class ReportToWordController { ...@@ -258,10 +263,13 @@ public class ReportToWordController {
XWPFTableRow supplementType = supplementInfoTable.createRow(); XWPFTableRow supplementType = supplementInfoTable.createRow();
supplementType.getCell(0).setText("业务类型:"); supplementType.getCell(0).setText("业务类型:");
String supplement_type = reportEntity.getSupplementType(); String supplement_type = reportEntity.getSupplementType();
String[] types = supplement_type.split(",");
if (StringUtils.isNotBlank(supplement_type)) { if (StringUtils.isNotBlank(supplement_type)) {
String typeStr = ""; String[] types = supplement_type.split(",");
for (String value : types) { String typeStr = "";
/* for (String value : types) {
if (value.equals("1")) { if (value.equals("1")) {
value = "营销"; value = "营销";
} else if (value.equals("2")) { } else if (value.equals("2")) {
...@@ -295,7 +303,17 @@ public class ReportToWordController { ...@@ -295,7 +303,17 @@ public class ReportToWordController {
} }
typeStr = typeStr + value + ","; typeStr = typeStr + value + ",";
supplement_type = typeStr.substring(0, typeStr.length() - 1); supplement_type = typeStr.substring(0, typeStr.length() - 1);
}*/
for (String str:types) {
CtBbtcBusType ctBbtcBusType = CtBbtcBusTypeService.get(str);
if(ctBbtcBusType!=null){
typeStr = typeStr + ctBbtcBusType.getName() + ",";
}else{
typeStr = typeStr + "--";
}
} }
supplement_type = typeStr.substring(0, typeStr.length() - 1);
} else { } else {
supplement_type = ""; supplement_type = "";
} }
...@@ -304,7 +322,8 @@ public class ReportToWordController { ...@@ -304,7 +322,8 @@ public class ReportToWordController {
XWPFTableRow supplementArea = supplementInfoTable.createRow(); XWPFTableRow supplementArea = supplementInfoTable.createRow();
supplementArea.getCell(0).setText("被举报区域:"); supplementArea.getCell(0).setText("被举报区域:");
String supplement_area = reportEntity.getSupplementArea(); String supplement_area = reportEntity.getSupplementArea();
if (StringUtils.isNotBlank(supplement_area)) {
/* if (StringUtils.isNotBlank(supplement_area)) {
if (supplement_area.equals("North China")) { if (supplement_area.equals("North China")) {
supplement_area = "华北区域公司"; supplement_area = "华北区域公司";
} else if (supplement_area.equals("BeiJing")) { } else if (supplement_area.equals("BeiJing")) {
...@@ -326,7 +345,8 @@ public class ReportToWordController { ...@@ -326,7 +345,8 @@ public class ReportToWordController {
} }
} else { } else {
supplement_area = ""; supplement_area = "";
} }*/
supplementArea.addNewTableCell().setText(supplement_area); supplementArea.addNewTableCell().setText(supplement_area);
//表格第六行 //表格第六行
XWPFTableRow supplementContent = supplementInfoTable.createRow(); XWPFTableRow supplementContent = supplementInfoTable.createRow();
......
...@@ -281,6 +281,7 @@ ...@@ -281,6 +281,7 @@
AND r.exchange_after_user = #{exchangeAfterUser} AND r.create_by = #{exchangeAfterUser} AND r.exchange_after_user = #{exchangeAfterUser} AND r.create_by = #{exchangeAfterUser}
</if> </if>
<if test="isAdmin != null"> <if test="isAdmin != null">
/*
AND su.area IN ('North China', AND su.area IN ('North China',
'BeiJing', 'BeiJing',
'ShangHai', 'ShangHai',
...@@ -291,11 +292,14 @@ ...@@ -291,11 +292,14 @@
'Hainan', 'Hainan',
'Group', 'Group',
'PropertyGroup') 'PropertyGroup')
*/
AND su.area IS NOT NULL
</if> </if>
<if test="isFzAdmin != null"> <if test="isFzAdmin != null">
AND r.Exchange_After_User = #{exchangeBeforeUser} AND r.Exchange_After_User = #{exchangeBeforeUser}
AND r.create_by != #{exchangeBeforeUser} AND r.create_by != #{exchangeBeforeUser}
AND su.area IN ('North China', /*
AND su.area IN ('North China',
'BeiJing', 'BeiJing',
'ShangHai', 'ShangHai',
'SouthWest', 'SouthWest',
...@@ -305,6 +309,8 @@ ...@@ -305,6 +309,8 @@
'Hainan', 'Hainan',
'Group', 'Group',
'PropertyGroup') 'PropertyGroup')
*/
AND su.area IS NOT NULL
</if> </if>
<if test="reportStatus != null and reportStatus != ''"> <if test="reportStatus != null and reportStatus != ''">
AND r.report_status = #{reportStatus} AND r.report_status = #{reportStatus}
......
...@@ -6,6 +6,9 @@ ...@@ -6,6 +6,9 @@
<meta name="decorator" content="default"/> <meta name="decorator" content="default"/>
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function() { $(document).ready(function() {
getRegion();
//$("#name").focus(); //$("#name").focus();
$("#inputForm").validate({ $("#inputForm").validate({
submitHandler: function(form){ submitHandler: function(form){
...@@ -24,11 +27,13 @@ ...@@ -24,11 +27,13 @@
}); });
}); });
function getRegion(ts_describe){
function getRegion(){
var selectNode = $("#supplementType"); var selectNode = $("#supplementType");
selectNode.empty();//每次需要将上一次的数据进行清空 selectNode.empty();//每次需要将上一次的数据进行清空
selectNode.append("<option value=''>请选择</option>"); selectNode.append("<option value=''>请选择</option>");
console.log(ts_describe);
var ts_describe= $("#ctBbtcGroup").val();
if(ts_describe != null && ts_describe != ''){ if(ts_describe != null && ts_describe != ''){
$.ajax({ $.ajax({
type: "POST", type: "POST",
...@@ -52,7 +57,7 @@ ...@@ -52,7 +57,7 @@
} }
}); });
}else{ }else{
top.$.jBox.tip('请选择所属集团', 'warning'); /*top.$.jBox.tip('请选择所属集团', 'warning');*/
} }
} }
...@@ -83,7 +88,7 @@ ...@@ -83,7 +88,7 @@
<div class="control-group"> <div class="control-group">
<label class="control-label">所属集团:</label> <label class="control-label">所属集团:</label>
<div class="controls"> <div class="controls">
<form:select onchange="getRegion(value)" path="ctBbtcGroup" class="input-xlarge required"> <form:select onchange="getRegion()" path="ctBbtcGroup" class="input-xlarge required" id="ctBbtcGroup" cssStyle="width: 285px">
<form:option value="">请选择</form:option> <form:option value="">请选择</form:option>
<form:options items="${fns:getDictList('supplement_group')}" itemLabel="label" itemValue="id" <form:options items="${fns:getDictList('supplement_group')}" itemLabel="label" itemValue="id"
htmlEscape="false"/> htmlEscape="false"/>
...@@ -95,7 +100,7 @@ ...@@ -95,7 +100,7 @@
<div class="control-group"> <div class="control-group">
<label class="control-label">所属业务类型:</label> <label class="control-label">所属业务类型:</label>
<div class="controls"> <div class="controls">
<form:select onchange="resetPageNo();" path="type.id" class="input-xlarge required" id="supplementType" > <form:select onchange="resetPageNo();" path="type.id" class="input-xlarge required" id="supplementType" cssStyle="width: 285px" >
<form:option value="">请选择</form:option> <form:option value="">请选择</form:option>
</form:select> </form:select>
<%--<form:input path="type" htmlEscape="false" maxlength="64" class="input-xlarge "/>--%> <%--<form:input path="type" htmlEscape="false" maxlength="64" class="input-xlarge "/>--%>
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
<div class="control-group"> <div class="control-group">
<label class="control-label">所属集团:</label> <label class="control-label">所属集团:</label>
<div class="controls"> <div class="controls">
<form:select onchange="resetPageNo();" path="group" class="input-xlarge required"> <form:select onchange="resetPageNo();" path="group" class="input-xlarge required" cssStyle="width: 285px">
<form:option value="">请选择</form:option> <form:option value="">请选择</form:option>
<form:options items="${fns:getDictList('supplement_group')}" itemLabel="label" itemValue="id" <form:options items="${fns:getDictList('supplement_group')}" itemLabel="label" itemValue="id"
htmlEscape="false"/></form:select> htmlEscape="false"/></form:select>
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
<div class="control-group"> <div class="control-group">
<label class="control-label">所属集团:</label> <label class="control-label">所属集团:</label>
<div class="controls"> <div class="controls">
<form:select onchange="resetPageNo();" path="group" class="input-xlarge required"> <form:select onchange="resetPageNo();" path="group" class="input-xlarge required" cssStyle="width: 285px">
<form:option value="">请选择</form:option> <form:option value="">请选择</form:option>
<form:options items="${fns:getDictList('supplement_group')}" itemLabel="label" itemValue="id" <form:options items="${fns:getDictList('supplement_group')}" itemLabel="label" itemValue="id"
htmlEscape="false"/></form:select> htmlEscape="false"/></form:select>
......
...@@ -547,18 +547,17 @@ ...@@ -547,18 +547,17 @@
} }
}); });
}else{ }else{
top.$.jBox.tip('请选择被举报集团', 'warning'); /*top.$.jBox.tip('请选择被举报集团', 'warning');*/
} }
} }
/*跟据集团 获取对应的业务类型 和业务类别 */ /*跟据集团 获取对应的业务类型 和业务类别 */
function getDepartment(ts_describe){ function getDepartment(){
var selectNode = $("#transferDepartment"); var selectNode = $("#transferDepartment");
selectNode.empty();//每次需要将上一次的数据进行清空 selectNode.empty();//每次需要将上一次的数据进行清空
selectNode.append("<option value=''>请选择</option>"); selectNode.append("<option value=''>请选择</option>");
if($("#transferGroup").val() !=null && $("#transferGroup").val() != ''){
ts_describe= $("#transferGroup").val(); var ts_describe= $("#transferGroupSelect").val();
}
if(ts_describe != null && ts_describe != ''){ if(ts_describe != null && ts_describe != ''){
$.ajax({ $.ajax({
type: "POST", type: "POST",
...@@ -576,13 +575,9 @@ ...@@ -576,13 +575,9 @@
if (data1 != '') { if (data1 != '') {
var slsb=document.getElementById("transferDepartment"); var slsb=document.getElementById("transferDepartment");
for (var i = 0;i < data1.length;i++){ for (var i = 0;i < data1.length;i++){
/* if(i==0){
slsb.options[i] = new Option("请选择","");
}*/
slsb.append(new Option(data1[i].name,data1[i].id)); slsb.append(new Option(data1[i].name,data1[i].id));
} }
} }
$("#transferDepartment").val("");
},error:function(data){ },error:function(data){
alert("系统错误"); alert("系统错误");
} }
...@@ -943,7 +938,7 @@ ...@@ -943,7 +938,7 @@
<br> <br>
<label class="control-label">处理结论:</label> <label class="control-label">处理结论:</label>
<div class="controls"> <div class="controls">
<form:select path="dealResult" id="dealResult" class="input-small required" onchange="showDone();" cssStyle="width: 280px"> <form:select path="dealResult" id="dealResult" class="input-small required" onchange="showDone();" cssStyle="width: 285px">
<form:option value=" ">请选择</form:option> <form:option value=" ">请选择</form:option>
<form:options items="${fns:getDictList('deal_result')}" itemLabel="label" itemValue="value" <form:options items="${fns:getDictList('deal_result')}" itemLabel="label" itemValue="value"
htmlEscape="false"/> htmlEscape="false"/>
...@@ -953,7 +948,7 @@ ...@@ -953,7 +948,7 @@
<div id="transferGroup" class="control-group" style="display:none"> <div id="transferGroup" class="control-group" style="display:none">
<label class="control-label">移交集团:</label> <label class="control-label">移交集团:</label>
<div class="controls"> <div class="controls">
<form:select id="" path="transferGroup" class="input-small required" onchange="getDepartment(value)" cssStyle="width: 280px"> <form:select id="transferGroupSelect" path="transferGroup" class="input-small required" onchange="getDepartment()" cssStyle="width: 280px">
<form:option value="">请选择</form:option> <form:option value="">请选择</form:option>
<form:options items="${fns:getDictList('supplement_group')}" itemLabel="label" itemValue="id" <form:options items="${fns:getDictList('supplement_group')}" itemLabel="label" itemValue="id"
htmlEscape="false"/></form:select> htmlEscape="false"/></form:select>
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
<meta name="decorator" content="default"/> <meta name="decorator" content="default"/>
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function () { $(document).ready(function () {
getRegion();
$("#no").focus(); $("#no").focus();
$("#inputForm").validate({ $("#inputForm").validate({
rules: { rules: {
...@@ -31,8 +32,12 @@ ...@@ -31,8 +32,12 @@
}); });
}); });
function getRegion(ts_describe){ function getRegion(){
var selectNode = $("#supplementArea");
selectNode.empty();//每次需要将上一次的数据进行清空
selectNode.append("<option value=''>请选择</option>");
var ts_describe= $("#supplementGroup").val();
if(ts_describe != null && ts_describe != ''){ if(ts_describe != null && ts_describe != ''){
$.ajax({ $.ajax({
type: "POST", type: "POST",
...@@ -41,36 +46,21 @@ ...@@ -41,36 +46,21 @@
success: function(returnedData) { success: function(returnedData) {
console.log(returnedData); console.log(returnedData);
var data1 = returnedData.ctBbtcRegionList; var data1 = returnedData.ctBbtcRegionList;
var data2 = returnedData.ctBbtcBusTypeList;
// console.log(data1[0].name); // console.log(data1[0].name);
// console.log(data2[0].name); // console.log(data2[0].name);
var selectNode = $("#supplementArea");
selectNode.empty();//每次需要将上一次的数据进行清空
/* $("#supplementArea").append("<option value=''>请选择</option>");*/
/* slsb.option("请选择","");*/
if (data1 != '') {
if (data1 != '') {
var slsb=document.getElementById("supplementArea"); var slsb=document.getElementById("supplementArea");
for (var i = 0;i < data1.length;i++){ for (var i = 0;i < data1.length;i++){
/* if(i==0){ slsb.append(new Option(data1[i].name,data1[i].id));
slsb.options[i] = new Option("请选择","");
}*/
slsb.options[i] = new Option(data1[i].name,data1[i].id);
} }
} }
/*每次更新选项 ================================*/
$("#supplementArea").prepend("<option value=''>请选择</option>");
/* $("#supplementArea option[text='请选择']").attr("selected", true);
$("#supplementArea").val("");*/
$("#supplementArea option").eq(0).attr("selected",true);
$("#supplementArea option[text='请选择']").attr("selected", "selected");
},error:function(data){ },error:function(data){
alert("系统错误"); alert("系统错误");
} }
}); });
}else{ }else{
top.$.jBox.tip('请选择被举报集团', 'warning'); /* top.$.jBox.tip('请选择被举报集团', 'warning');*/
} }
} }
...@@ -134,7 +124,7 @@ ...@@ -134,7 +124,7 @@
<div class="control-group"> <div class="control-group">
<label class="control-label">所属集团:</label> <label class="control-label">所属集团:</label>
<div class="controls"> <div class="controls">
<form:select id="supplementGroup" path="supplementGroup" class="input-small required" onchange="getRegion(value)"> <form:select id="supplementGroup" path="supplementGroup" class="input-small " onchange="getRegion()" cssStyle="width: 220px">
<form:option value="">请选择</form:option> <form:option value="">请选择</form:option>
<form:options items="${fns:getDictList('supplement_group')}" itemLabel="label" itemValue="id" <form:options items="${fns:getDictList('supplement_group')}" itemLabel="label" itemValue="id"
htmlEscape="false"/> htmlEscape="false"/>
...@@ -146,12 +136,12 @@ ...@@ -146,12 +136,12 @@
<div class="control-group"> <div class="control-group">
<label class="control-label">所属区域:</label> <label class="control-label">所属区域:</label>
<div class="controls"> <div class="controls">
<form:select id="supplementArea" path="area" class="input-small required"> <form:select id="supplementArea" path="area" class="input-small " cssStyle="width: 220px">
<form:option value="">请选择</form:option> <form:option value="">请选择</form:option>
<%-- <form:options items="${fns:getDictList('supplement_area')}" itemLabel="label" itemValue="value" <%-- <form:options items="${fns:getDictList('supplement_area')}" itemLabel="label" itemValue="value"
htmlEscape="false"/>--%> htmlEscape="false"/>--%>
</form:select> </form:select>
<span class="help-inline"><font color="red">*</font> </span> <%-- <span class="help-inline"><font color="red">*</font> </span>--%>
</div> </div>
</div> </div>
<%--<div class="control-group"> <%--<div class="control-group">
......
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