|
@@ -24,6 +24,40 @@
|
|
|
$("#searchForm").submit();
|
|
|
return false;
|
|
|
}
|
|
|
+
|
|
|
+ //验证输入的排序值是否合法
|
|
|
+ var cmConsulttypeId_sortNumber = '';
|
|
|
+ function confirmSortIndex(index) {
|
|
|
+ var $sortIndex = $("#sortNumber"+index).val();
|
|
|
+ var $bigTypeId = $("#cmConsulttypeId"+index).val();
|
|
|
+ if (!isNaN($sortIndex)) {
|
|
|
+ if($sortIndex % 1 === 0 && $sortIndex >0){
|
|
|
+ cmConsulttypeId_sortNumber += $bigTypeId+"_"+$sortIndex+",";
|
|
|
+ }else{
|
|
|
+ alertx("排序只能输入大于0的整数");
|
|
|
+ $.get("${ctx}/consult/type/cmConsulttype/getType",{'id':$bigTypeId}, function (data) {
|
|
|
+ $("#sortIndex" + index).val(data.data.sortIndex);
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ alertx("排序只能输入大于0的整数");
|
|
|
+ $.get("${ctx}/consult/type/cmConsulttype/getType",{'id':$bigTypeId},function (data) {
|
|
|
+ $("#sortIndex" + index).val(data.data.sortIndex);
|
|
|
+ })
|
|
|
+ }
|
|
|
+ alert(cmConsulttypeId_sortNumber);
|
|
|
+ }
|
|
|
+
|
|
|
+ //批量保存排序
|
|
|
+ function updateSortIndex() {
|
|
|
+ $.post("${ctx}/consult/type/cmConsulttype/updateSort",{'cmConsulttypeIdSortNumber':cmConsulttypeId_sortNumber},function(result){
|
|
|
+ $.jBox.tip(result.data, 'info');
|
|
|
+ setTimeout(function () {
|
|
|
+ $("#searchForm").submit();
|
|
|
+ }, 500);
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
</script>
|
|
|
</head>
|
|
|
<body>
|
|
@@ -31,13 +65,11 @@
|
|
|
<li><a href="${ctx}/new/user/agency/regist">已注册用户咨询记录</a></li>
|
|
|
<li><a href="${ctx}/new/user/visit/unregist">未注册用户咨询记录</a></li>
|
|
|
<li class="active"><a href="${ctx}/consult/type/cmConsulttype/">咨询类别设置</a></li>
|
|
|
-<%-- <li><a href="${ctx}/consult/type/cmConsulttype/form">咨询类别添加</a></li>--%>
|
|
|
</ul>
|
|
|
<form:form id="searchForm" modelAttribute="cmConsulttype" action="${ctx}/consult/type/cmConsulttype/" method="post"
|
|
|
class="breadcrumb form-search">
|
|
|
<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
|
|
|
<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
|
|
|
- <%-- < class="ul-form">--%>
|
|
|
<label>类别名称:</label>
|
|
|
<form:input path="className" class="input-medium" maxlength="20"/>
|
|
|
<label>状态:</label>
|
|
@@ -47,14 +79,11 @@
|
|
|
<form:option value="2" label="停用"></form:option>
|
|
|
</form:select>
|
|
|
|
|
|
- <input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
|
|
|
-
|
|
|
+ <input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
|
|
|
+
|
|
|
<a href="${ctx}/consult/type/cmConsulttype/form" class="btn btn-primary" style="width: 70px">添加类别</a>
|
|
|
-
|
|
|
-
|
|
|
- <a class="btn btn-primary" style="width: 70px"
|
|
|
- href="${ctx}/consult/type/cmConsulttype/sort">一键排序</a>
|
|
|
-
|
|
|
+
|
|
|
+ <input class="btn btn-primary" type="button" value="一键排序" onclick="updateSortIndex()" style="margin-left: 15px"/>
|
|
|
|
|
|
<div class="clearfix"></div>
|
|
|
</div>
|
|
@@ -72,9 +101,14 @@
|
|
|
</tr>
|
|
|
</thead>
|
|
|
<tbody id="sortbody">
|
|
|
- <c:forEach items="${page.list}" var="cmConsulttype">
|
|
|
+ <c:forEach items="${page.list}" var="cmConsulttype" varStatus="ct">
|
|
|
<tr>
|
|
|
- <td>${cmConsulttype.id}</td>
|
|
|
+ <td>
|
|
|
+ <input type="text" id="cmConsulttypeId${ct.index}"
|
|
|
+ value="${cmConsulttype.id}"
|
|
|
+ style="width: 50px;display: none">
|
|
|
+ ${ct.index+1}
|
|
|
+ </td>
|
|
|
<td>${cmConsulttype.className}</td>
|
|
|
<td><c:if test="${cmConsulttype.status eq 1}">
|
|
|
<div style="color: green">已启用<a style="text-decoration: none" href="${ctx}/consult/type/cmConsulttype/use?id=${cmConsulttype.id}&status=2">    停用</a></div>
|
|
@@ -83,7 +117,12 @@
|
|
|
<div style="color: red">已停用<a style="text-decoration: none" href="${ctx}/consult/type/cmConsulttype/use?id=${cmConsulttype.id}&status=1">    启用</a></div>
|
|
|
</c:if>
|
|
|
</td>
|
|
|
- <td>${cmConsulttype.sortNumber}</td>
|
|
|
+ <td>
|
|
|
+ <input type="text" name="sortNumber" id="sortNumber${ct.index}"
|
|
|
+ onchange="confirmSortIndex(${ct.index})"
|
|
|
+ value="${cmConsulttype.sortNumber}"
|
|
|
+ style="width: 50px">
|
|
|
+ </td>
|
|
|
<td><fmt:formatDate value="${cmConsulttype.createdTime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
|
|
|
<td>
|
|
|
<a href="${ctx}/consult/type/cmConsulttype/form?id=${cmConsulttype.id}">编辑</a>
|