Commit df5f3b38 by 佰邦同创-郝泉明

Merge branch 'develop' of https://git.okayapps.com/java-sunac-report/sunac_report into develop

# Conflicts:
#	src/main/webapp/WEB-INF/views/modules/report/reportTrack.jsp
parents 7dc03bcc 7659182a
...@@ -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;
} }
......
...@@ -736,9 +736,9 @@ public class ReportController extends BaseController { ...@@ -736,9 +736,9 @@ public class ReportController extends BaseController {
*/ */
@RequestMapping(value = "viewTransfer") @RequestMapping(value = "viewTransfer")
public void viewTransfer(User user, String flag, HttpServletRequest request, HttpServletResponse public void viewTransfer(User user, String flag, HttpServletRequest request, HttpServletResponse
response, Model model) throws IOException { response, Model model,Integer pageNo,Integer pageSize) throws IOException {
Page<User> page = reportService.findUserPage(new Page<User>(request, response), user); Page<User> page = reportService.findUserPage(new Page<User>(pageNo, pageSize), user);
StringBuffer html = new StringBuffer(); StringBuffer html = new StringBuffer();
html.append("<table id='contentTable' class='table table-striped table-bordered table-condensed'>"); html.append("<table id='contentTable' class='table table-striped table-bordered table-condensed'>");
html.append(" <thead>"); html.append(" <thead>");
...@@ -769,7 +769,7 @@ public class ReportController extends BaseController { ...@@ -769,7 +769,7 @@ public class ReportController extends BaseController {
for (User userEntity : page.getList()) { for (User userEntity : page.getList()) {
html.append(" <tr>"); html.append(" <tr>");
if (flag.equals("1")) { if (flag.equals("1")) {
html.append(" <td><input type='radio' value='" + userEntity.getId() + "' onclick='chooseRen(this);'></td>"); html.append(" <td><input type='radio' value='" + userEntity.getId() + "'></td>");
html.append(" <td>" + i + "</td>"); html.append(" <td>" + i + "</td>");
html.append(" <td>" + (userEntity.getNo() == null ? "" : userEntity.getNo()) + "</td>"); html.append(" <td>" + (userEntity.getNo() == null ? "" : userEntity.getNo()) + "</td>");
html.append(" <td>" + (userEntity.getName() == null ? "" : userEntity.getName()) + "</td>"); html.append(" <td>" + (userEntity.getName() == null ? "" : userEntity.getName()) + "</td>");
......
...@@ -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,8 +27,13 @@ ...@@ -24,8 +27,13 @@
}); });
}); });
function getRegion(ts_describe){
console.log(ts_describe); function getRegion(){
var selectNode = $("#supplementType");
selectNode.empty();//每次需要将上一次的数据进行清空
selectNode.append("<option value=''>请选择</option>");
var ts_describe= $("#ctBbtcGroup").val();
if(ts_describe != null && ts_describe != ''){ if(ts_describe != null && ts_describe != ''){
$.ajax({ $.ajax({
type: "POST", type: "POST",
...@@ -36,9 +44,7 @@ ...@@ -36,9 +44,7 @@
var data2 = returnedData.ctBbtcBusTypeList; 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 = $("#supplementType");
selectNode.empty();//每次需要将上一次的数据进行清空
selectNode.append("<option value=''>请选择</option>");
if (data2 != '') { if (data2 != '') {
console.log(data2[0].name); console.log(data2[0].name);
var slsb=document.getElementById("supplementType"); var slsb=document.getElementById("supplementType");
...@@ -51,7 +57,7 @@ ...@@ -51,7 +57,7 @@
} }
}); });
}else{ }else{
top.$.jBox.tip('请选择被举报集团', 'warning'); /*top.$.jBox.tip('请选择所属集团', 'warning');*/
} }
} }
...@@ -82,7 +88,7 @@ ...@@ -82,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"/>
...@@ -94,7 +100,7 @@ ...@@ -94,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>
......
...@@ -37,6 +37,9 @@ ...@@ -37,6 +37,9 @@
i += 1; i += 1;
$(this).children("td:first-child").html(num); $(this).children("td:first-child").html(num);
}); });
/*加载时 执行跟据集团 搜索下拉信息 解决每次刷新问题*/
getRegion();
getTransferDepartment();
}); });
function page(n, s) { function page(n, s) {
...@@ -167,8 +170,16 @@ ...@@ -167,8 +170,16 @@
showDiv.innerHTML = ''; showDiv.innerHTML = '';
} }
function getRegion(ts_describe){ function getRegion(){
console.log(ts_describe); var selectNode = $("#supplementArea");
selectNode.empty();//每次需要将上一次的数据进行清空
selectNode.append("<option value=''>请选择</option>");
var selectNode = $("#supplementType");
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",
...@@ -180,9 +191,9 @@ ...@@ -180,9 +191,9 @@
var data2 = returnedData.ctBbtcBusTypeList; 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"); /* var selectNode = $("#supplementArea");
selectNode.empty();//每次需要将上一次的数据进行清空 selectNode.empty();//每次需要将上一次的数据进行清空
selectNode.append("<option value=''>请选择</option>"); selectNode.append("<option value=''>请选择</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++){
...@@ -191,9 +202,9 @@ ...@@ -191,9 +202,9 @@
} }
} }
var selectNode = $("#supplementType"); /* var selectNode = $("#supplementType");
selectNode.empty();//每次需要将上一次的数据进行清空 selectNode.empty();//每次需要将上一次的数据进行清空
selectNode.append("<option value=''>请选择</option>"); selectNode.append("<option value=''>请选择</option>");*/
if (data2 != '') { if (data2 != '') {
console.log(data2[0].name); console.log(data2[0].name);
var slsb=document.getElementById("supplementType"); var slsb=document.getElementById("supplementType");
...@@ -207,7 +218,7 @@ ...@@ -207,7 +218,7 @@
} }
}); });
}else{ }else{
top.$.jBox.tip('请选择被举报集团', 'warning'); /*top.$.jBox.tip('请选择被举报集团', 'warning');*/
} }
} }
...@@ -215,7 +226,10 @@ ...@@ -215,7 +226,10 @@
*联动查询类型下的类别 传多个id *联动查询类型下的类别 传多个id
*/ */
function getBusCategory(ts_describe){ function getBusCategory(ts_describe){
console.log(ts_describe); var selectNode = $("#supplementCategory");
selectNode.empty();//每次需要将上一次的数据进行清空
selectNode.append("<option value=''>请选择</option>");
if(ts_describe != null && ts_describe != ''){ if(ts_describe != null && ts_describe != ''){
$.ajax({ $.ajax({
type: "POST", type: "POST",
...@@ -225,9 +239,9 @@ ...@@ -225,9 +239,9 @@
console.log(returnedData); console.log(returnedData);
var data = returnedData.ctBbtcBusCategoryList; var data = returnedData.ctBbtcBusCategoryList;
var selectNode = $("#supplementCategory"); /* var selectNode = $("#supplementCategory");
selectNode.empty();//每次需要将上一次的数据进行清空 selectNode.empty();//每次需要将上一次的数据进行清空
selectNode.append("<option value=''>请选择</option>"); selectNode.append("<option value=''>请选择</option>");*/
if (data != '') { if (data != '') {
var slsb=document.getElementById("supplementCategory"); var slsb=document.getElementById("supplementCategory");
for (var i = 0;i <= data.length;i++){ for (var i = 0;i <= data.length;i++){
...@@ -240,12 +254,16 @@ ...@@ -240,12 +254,16 @@
} }
}); });
}else{ }else{
top.$.jBox.tip('请选择业务类型', 'warning'); /* top.$.jBox.tip('请选择业务类型', 'warning');*/
} }
} }
function getTransferDepartment(ts_describe){ function getTransferDepartment(){
var selectNode = $("#transferDepartment");
selectNode.empty();//每次需要将上一次的数据进行清空
selectNode.append("<option value=''>请选择</option>");
var ts_describe= $("#transferGroup").val();
if(ts_describe != null && ts_describe != ''){ if(ts_describe != null && ts_describe != ''){
$.ajax({ $.ajax({
type: "POST", type: "POST",
...@@ -254,10 +272,10 @@ ...@@ -254,10 +272,10 @@
success: function(returnedData) { success: function(returnedData) {
var data2 = returnedData.ctBbtcBusTypeList; var data2 = returnedData.ctBbtcBusTypeList;
//移交部门赋值 /* //移交部门赋值
var selectNode = $("#transferDepartment"); var selectNode = $("#transferDepartment");
selectNode.empty();//每次需要将上一次的数据进行清空 selectNode.empty();//每次需要将上一次的数据进行清空
selectNode.append("<option value=''>请选择</option>"); selectNode.append("<option value=''>请选择</option>");*/
if (data2 != '') { if (data2 != '') {
console.log(data2[0].name); console.log(data2[0].name);
var slsb=document.getElementById("transferDepartment"); var slsb=document.getElementById("transferDepartment");
...@@ -270,13 +288,9 @@ ...@@ -270,13 +288,9 @@
} }
}); });
}else{ }else{
top.$.jBox.tip('请选择业务类型', 'warning'); /*top.$.jBox.tip('请选择业务类型', 'warning');*/
}
} }
function resetPageNo() {
$("#pageNo").val(0);
} }
</script> </script>
...@@ -420,7 +434,7 @@ ...@@ -420,7 +434,7 @@
maxlength="50" class="input-small"/></li> maxlength="50" class="input-small"/></li>
<li><label>所属集团:</label> <li><label>所属集团:</label>
<form:select id="supplementGroup" path="supplementGroup" class="input-small required" onchange="getRegion(value)"> <form:select id="supplementGroup" path="supplementGroup" class="input-small required" onchange="getRegion()">
<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"/>
...@@ -433,18 +447,19 @@ ...@@ -433,18 +447,19 @@
&lt;%&ndash;<options items="${ctBbtcRegionList}" itemLabel="name" itemValue="id"&ndash;%&gt; &lt;%&ndash;<options items="${ctBbtcRegionList}" itemLabel="name" itemValue="id"&ndash;%&gt;
&lt;%&ndash;htmlEscape="false"/></select>&ndash;%&gt; &lt;%&ndash;htmlEscape="false"/></select>&ndash;%&gt;
</select>--%> </select>--%>
<form:select id="supplementArea" onchange="resetPageNo();" path="supplementArea" class="input-small" value="${report.supplementArea}"> <form:select id="supplementArea" onchange="resetPageNo();" path="supplementArea" class="input-small required">
<form:option value="">请选择</form:option> <form:option value="">请选择</form:option>
</form:select> </form:select>
</li> </li>
<li><label>业务类型:</label> <li><label>业务类型:</label>
<form:select id="supplementType" onchange="getBusCategory(value);" path="supplementType" class="input-small" value="${report.supplementType}"> <form:select id="supplementType" onchange="getBusCategory(value);" path="supplementType" class="input-small required" >
<form:option value="">请选择</form:option> <form:option value="">请选择</form:option>
</form:select> </form:select>
</li> </li>
<li><label>业务类别:</label> <li><label>业务类别:</label>
<form:select onchange="resetPageNo();" path="supplementCategory" class="input-small" id="supplementCategory" value="${report.supplementCategory}"> <form:select onchange="resetPageNo();" path="supplementCategory" class="input-small required" id="supplementCategory" >
<form:option value="">请选择</form:option> <form:option value="">请选择</form:option>
</form:select> </form:select>
</li> </li>
...@@ -453,7 +468,7 @@ ...@@ -453,7 +468,7 @@
<%-- <form:select onchange="resetPageNo();" path="transferGroup" class="input-small" id="transferGroup" value="${report.transferGroup}"> <%-- <form:select onchange="resetPageNo();" path="transferGroup" class="input-small" id="transferGroup" value="${report.transferGroup}">
<form:option value="">请选择</form:option> <form:option value="">请选择</form:option>
</form:select>--%> </form:select>--%>
<form:select id="transferGroup" path="transferGroup" class="input-small required" onchange="getTransferDepartment(value)"> <form:select id="transferGroup" path="transferGroup" class="input-small required" onchange="getTransferDepartment()">
<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"/>
...@@ -463,7 +478,7 @@ ...@@ -463,7 +478,7 @@
<%-- <form:select onchange="resetPageNo();" path="transferDepartment" class="input-small" id="transferDepartment" value="${report.transferDepartment}"> <%-- <form:select onchange="resetPageNo();" path="transferDepartment" class="input-small" id="transferDepartment" value="${report.transferDepartment}">
<form:option value="">请选择</form:option> <form:option value="">请选择</form:option>
</form:select>--%> </form:select>--%>
<form:select id="transferDepartment" onchange="resetPageNo();" path="transferDepartment" class="input-small" value="${report.transferDepartment}"> <form:select id="transferDepartment" onchange="resetPageNo();" path="transferDepartment" class="input-small required" >
<form:option value="">请选择</form:option> <form:option value="">请选择</form:option>
</form:select> </form:select>
</li> </li>
......
...@@ -37,6 +37,10 @@ ...@@ -37,6 +37,10 @@
i += 1; i += 1;
$(this).children("td:first-child").html(num); $(this).children("td:first-child").html(num);
}); });
/*加载时 执行跟据集团 搜索下拉信息 解决每次刷新问题*/
getRegion();
getTransferDepartment();
}); });
function page(n, s) { function page(n, s) {
...@@ -167,8 +171,16 @@ ...@@ -167,8 +171,16 @@
showDiv.innerHTML = ''; showDiv.innerHTML = '';
} }
function getRegion(ts_describe){ function getRegion(){
console.log(ts_describe); var selectNode = $("#supplementArea");
selectNode.empty();//每次需要将上一次的数据进行清空
selectNode.append("<option value=''>请选择</option>");
var selectNode = $("#supplementType");
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",
...@@ -180,9 +192,9 @@ ...@@ -180,9 +192,9 @@
var data2 = returnedData.ctBbtcBusTypeList; 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"); /* var selectNode = $("#supplementArea");
selectNode.empty();//每次需要将上一次的数据进行清空 selectNode.empty();//每次需要将上一次的数据进行清空
selectNode.append("<option value=''>请选择</option>"); selectNode.append("<option value=''>请选择</option>");*/
if (data1 != '') { if (data1 != '') {
console.log(data1[0].name); console.log(data1[0].name);
...@@ -192,9 +204,9 @@ ...@@ -192,9 +204,9 @@
slsb.append(new Option(data1[i].name,data1[i].id)); slsb.append(new Option(data1[i].name,data1[i].id));
} }
} }
var selectNode = $("#supplementType"); /* var selectNode = $("#supplementType");
selectNode.empty();//每次需要将上一次的数据进行清空 selectNode.empty();//每次需要将上一次的数据进行清空
selectNode.append("<option value=''>请选择</option>"); selectNode.append("<option value=''>请选择</option>");*/
if (data2 != '') { if (data2 != '') {
console.log(data2[0].name); console.log(data2[0].name);
var slsb=document.getElementById("supplementType"); var slsb=document.getElementById("supplementType");
...@@ -207,7 +219,7 @@ ...@@ -207,7 +219,7 @@
} }
}); });
}else{ }else{
top.$.jBox.tip('请选择被举报集团', 'warning'); /*top.$.jBox.tip('请选择被举报集团', 'warning');*/
} }
} }
...@@ -226,9 +238,9 @@ ...@@ -226,9 +238,9 @@
var data = returnedData.ctBbtcBusCategoryList; var data = returnedData.ctBbtcBusCategoryList;
console.log(data[0].name); console.log(data[0].name);
var selectNode = $("#supplementCategory"); /* var selectNode = $("#supplementCategory");
selectNode.empty();//每次需要将上一次的数据进行清空 selectNode.empty();//每次需要将上一次的数据进行清空
selectNode.append("<option value=''>请选择</option>"); selectNode.append("<option value=''>请选择</option>");*/
if (data != '') { if (data != '') {
var slsb=document.getElementById("supplementCategory"); var slsb=document.getElementById("supplementCategory");
...@@ -243,12 +255,16 @@ ...@@ -243,12 +255,16 @@
} }
}); });
}else{ }else{
top.$.jBox.tip('请选择业务类型', 'warning'); /* top.$.jBox.tip('请选择业务类型', 'warning');*/
} }
} }
function getTransferDepartment(ts_describe){ function getTransferDepartment(){
var selectNode = $("#transferDepartment");
selectNode.empty();//每次需要将上一次的数据进行清空
selectNode.append("<option value=''>请选择</option>");
var ts_describe= $("#transferGroup").val();
if(ts_describe != null && ts_describe != ''){ if(ts_describe != null && ts_describe != ''){
$.ajax({ $.ajax({
type: "POST", type: "POST",
...@@ -258,9 +274,9 @@ ...@@ -258,9 +274,9 @@
var data2 = returnedData.ctBbtcBusTypeList; var data2 = returnedData.ctBbtcBusTypeList;
//移交部门赋值 //移交部门赋值
var selectNode = $("#transferDepartment"); /* var selectNode = $("#transferDepartment");
selectNode.empty();//每次需要将上一次的数据进行清空 selectNode.empty();//每次需要将上一次的数据进行清空
selectNode.append("<option value=''>请选择</option>"); selectNode.append("<option value=''>请选择</option>");*/
if (data2 != '') { if (data2 != '') {
console.log(data2[0].name); console.log(data2[0].name);
var slsb=document.getElementById("transferDepartment"); var slsb=document.getElementById("transferDepartment");
...@@ -273,7 +289,7 @@ ...@@ -273,7 +289,7 @@
} }
}); });
}else{ }else{
top.$.jBox.tip('请选择业务类型', 'warning'); /* top.$.jBox.tip('请选择业务类型', 'warning');*/
} }
} }
...@@ -424,7 +440,7 @@ ...@@ -424,7 +440,7 @@
<li><label>所属集团:</label> <li><label>所属集团:</label>
<form:select id="supplementGroup" path="supplementGroup" class="input-small required" onchange="getRegion(value)"> <form:select id="supplementGroup" path="supplementGroup" class="input-small required" onchange="getRegion()">
<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"/>
...@@ -451,7 +467,7 @@ ...@@ -451,7 +467,7 @@
<%-- <form:select onchange="resetPageNo();" path="transferGroup" class="input-small" id="transferGroup" value="${report.transferGroup}"> <%-- <form:select onchange="resetPageNo();" path="transferGroup" class="input-small" id="transferGroup" value="${report.transferGroup}">
<form:option value="">请选择</form:option> <form:option value="">请选择</form:option>
</form:select>--%> </form:select>--%>
<form:select id="transferGroup" path="transferGroup" class="input-small required" onchange="getTransferDepartment(value)"> <form:select id="transferGroup" path="transferGroup" class="input-small required" onchange="getTransferDepartment()">
<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"/>
......
...@@ -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">
......
...@@ -482,6 +482,9 @@ ...@@ -482,6 +482,9 @@
}); });
/* $('#total').highcharts({ /* $('#total').highcharts({
});*/ });*/
getRegion();
}); });
//选择区域 //选择区域
// function selectArea(value){ // function selectArea(value){
...@@ -489,8 +492,11 @@ ...@@ -489,8 +492,11 @@
// $("#area").val(selAreaTemp); // $("#area").val(selAreaTemp);
// } // }
function getRegion(ts_describe){ function getRegion(){
console.log(ts_describe); var selectNode = $("#area");
selectNode.empty();//每次需要将上一次的数据进行清空
$("#area").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",
...@@ -500,27 +506,30 @@ ...@@ -500,27 +506,30 @@
var data1 = returnedData.ctBbtcRegionList; var data1 = returnedData.ctBbtcRegionList;
// console.log(data1[0].name); // console.log(data1[0].name);
// console.log(data2[0].name); // console.log(data2[0].name);
var selectNode = $("#area"); /* var selectNode = $("#area");
selectNode.empty();//每次需要将上一次的数据进行清空 selectNode.empty();//每次需要将上一次的数据进行清空
$("#area").append("<option value=''>请选择</option>"); $("#area").append("<option value=''>请选择</option>");*/
if (data1 != '') { if (data1 != '') {
var slsb=document.getElementById("area"); var slsb=document.getElementById("area");
for (var i = 0;i < data1.length;i++){ for (var i = 0;i < data1.length;i++){
slsb.append(new Option(data1[i].name,data1[i].id)); slsb.append(new Option(data1[i].name,data1[i].id));
} }
} }
/* $("#area").prepend("<option value=''>请选择</option>");*/
},error:function(data){ },error:function(data){
alert(系统错误); alert(系统错误);
} }
}); });
}else{ }else{
top.$.jBox.tip('请选择被举报集团', 'warning'); /* top.$.jBox.tip('请选择被举报集团', 'warning');*/
} }
} }
function resetPageNo() {
$("#pageNo").val(0);
}
</script> </script>
</head> </head>
<body> <body>
...@@ -564,23 +573,25 @@ ...@@ -564,23 +573,25 @@
<form:option value="PropertyGroup">物业集团</form:option> <form:option value="PropertyGroup">物业集团</form:option>
</form:select> </form:select>
</li>--%> </li>--%>
<li><label>所属集团:</label> <li style="float: right">
<form:select id="supplementGroup" path="supplementGroup" class="input-small required" onchange="getRegion(value)"> <li><label>所属集团:</label>
<form:option value="">请选择</form:option> <form:select id="supplementGroup" path="supplementGroup" class="input-medium " onchange="getRegion()" cssStyle="width: 180px" htmlEscape="false">
<form:options items="${fns:getDictList('supplement_group')}" itemLabel="label" itemValue="id" <form:option value="">请选择</form:option>
htmlEscape="false"/> <form:options items="${fns:getDictList('supplement_group')}" itemLabel="label" itemValue="id"
</form:select> htmlEscape="false"/>
</li> </form:select>
</li>
<li><label>所属区域:</label> <li><label>所属区域:</label>
<%-- <select id="supplementArea" path="supplementArea" class="input-small required" onchange="resetPageNo();"> <%-- <select id="supplementArea" path="supplementArea" class="input-small required" onchange="resetPageNo();">
<option value="">请选择</option> <option value="">请选择</option>
&lt;%&ndash;<options items="${ctBbtcRegionList}" itemLabel="name" itemValue="id"&ndash;%&gt; &lt;%&ndash;<options items="${ctBbtcRegionList}" itemLabel="name" itemValue="id"&ndash;%&gt;
&lt;%&ndash;htmlEscape="false"/></select>&ndash;%&gt; &lt;%&ndash;htmlEscape="false"/></select>&ndash;%&gt;
</select>--%> </select>--%>
<form:select id="area" onchange="resetPageNo();" path="area" class="input-small"> <form:select id="area" onchange="resetPageNo();" path="area" class="input-medium " cssStyle="width: 180px" htmlEscape="false">
<form:option value="">请选择</form:option> <form:option value="">请选择</form:option>
</form:select> </form:select>
</li>
</li> </li>
</c:if> </c:if>
</ul> </ul>
......
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