|
@@ -46,9 +46,9 @@
|
|
|
<div class="text-c">
|
|
|
<button type="button" style="float:left;" class="btn btn-success radius" onclick="add_Agent();" id="addAgent" name=""><i class="Hui-iconfont"></i> 添加代理商</button>
|
|
|
<select name="agentStatus" style="height: 30px;">
|
|
|
- <option value="">线下状态</option>
|
|
|
- <option <c:if test="${agentStatus == 1}">selected = "selected"</c:if> value="1">正在使用</option>
|
|
|
- <option <c:if test="${agentStatus == 2}">selected = "selected"</c:if> value="2">停止使用</option>
|
|
|
+ <option value="">状态</option>
|
|
|
+ <option <c:if test="${agentStatus == 1}">selected = "selected"</c:if> value="1">启用</option>
|
|
|
+ <option <c:if test="${agentStatus == 2}">selected = "selected"</c:if> value="2">停用</option>
|
|
|
</select>
|
|
|
<input type="text" class="input-text" style="width:130px" placeholder="请输入代理商姓名" value="${agentName}" name="agentName">
|
|
|
<input type="text" class="input-text" style="width:130px" placeholder="请输入代理商电话" value="${agentTel}" name="agentTel">
|
|
@@ -66,7 +66,7 @@
|
|
|
<th width="100">名称</th>
|
|
|
<th width="100">地址</th>
|
|
|
<th width="100">电话</th>
|
|
|
- <th width="100">线下状态</th>
|
|
|
+ <th width="100">状态</th>
|
|
|
<th width="100">创建时间</th>
|
|
|
<th width="100">操作</th>
|
|
|
</tr>
|
|
@@ -78,30 +78,24 @@
|
|
|
<td>${list.agentName }</td>
|
|
|
<td>${list.agentAddr }</td>
|
|
|
<td>${fn:substring(list.agentTel,0,3)}****${fn:substring(list.agentTel,7,11)}</td>
|
|
|
- <td>
|
|
|
+ <td id="agent_status${list.agentId }">
|
|
|
<c:if test="${list.agentStatus == 1}">
|
|
|
- 正在使用
|
|
|
+ 启用
|
|
|
</c:if>
|
|
|
<c:if test="${list.agentStatus == 2}">
|
|
|
- 停止使用
|
|
|
+ 停用
|
|
|
</c:if>
|
|
|
</td>
|
|
|
<td><fmt:formatDate value="${list.agentCreateDate }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
|
|
|
<td class="td-manage">
|
|
|
- <div id="config_status">
|
|
|
- <c:if test="${list.agentStatus == 2}">
|
|
|
- <a onclick="updateagentState('${list.agentId }','1')"
|
|
|
- title="修改状态" href="javascript:;" class="ml-5" style="text-decoration:none">修改为正在使用</a>
|
|
|
- </c:if>
|
|
|
- <c:if test="${list.agentStatus == 1}">
|
|
|
- <a onclick="updateagentState('${list.agentId }','2')"
|
|
|
- title="修改状态" href="javascript:;" class="ml-5" style="text-decoration:none">修改为停用</a>
|
|
|
- </c:if>
|
|
|
- </div>
|
|
|
-
|
|
|
- <a onclick="updateAgent('${list.agentId}')"
|
|
|
- title="修改" href="javascript:;" class="ml-5" style="text-decoration:none">修改代理商信息</a>
|
|
|
- </td>
|
|
|
+ <input id="agentStatus" type="hidden" value="${list.agentStatus }">
|
|
|
+ <select id="goodstatus" name="" onchange="updateGiftState(this,${list.agentId },${list.agentTel})">
|
|
|
+ <option value="1" ${list.agentStatus==1?'selected':''}>启用</option>
|
|
|
+ <option value="2" ${list.agentStatus==2?'selected':''}>停用</option>
|
|
|
+ </select>
|
|
|
+ <a onclick="updateAgent('${list.agentId}')"
|
|
|
+ title="编辑" href="javascript:;" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont"></i></a>
|
|
|
+ </td>
|
|
|
</c:forEach>
|
|
|
</c:if>
|
|
|
</tbody>
|
|
@@ -121,32 +115,33 @@
|
|
|
<script type="text/javascript" src="${pageContext.request.contextPath }/common/js/page/jqPaginator.js"></script>
|
|
|
<script type="text/javascript" src="${pageContext.request.contextPath }/common/goods/js/utils.js"></script>
|
|
|
<script type="text/javascript">
|
|
|
- function updateagentState(id,state){
|
|
|
+
|
|
|
+ function updateGiftState(_this,id,tel){
|
|
|
+ var obj = $(_this);
|
|
|
layer.confirm('确认要修改状态吗?',function(index){
|
|
|
$.ajax({
|
|
|
url: '${pageContext.request.contextPath }/admin/agentTooth/update_agentInfo',
|
|
|
type: "POST",
|
|
|
dataType: "json",
|
|
|
- data: {agentId : id,agentStatus : state},
|
|
|
+ data: {agentId : id,agentStatus : obj.val(),agentTel:tel},
|
|
|
error:function(data){
|
|
|
layer.msg("修改失败</br>",{icon: 5,time:2000});
|
|
|
},
|
|
|
success: function(data){
|
|
|
if (data.status) {
|
|
|
layer.msg("修改成功</br>",{icon: 1,time:2000});
|
|
|
- location.replace(location.href);
|
|
|
- /*var message = '';
|
|
|
- switch (state) {
|
|
|
+ var message = '';
|
|
|
+ switch (obj.val()) {
|
|
|
case "1":
|
|
|
- message = '<a onclick="updateagentState('+id+',2)" title="修改状态" href="javascript:;" class="ml-5" style="text-decoration:none">修改为停止使用</a>';
|
|
|
+ message = '启用';
|
|
|
break;
|
|
|
case "2":
|
|
|
- message = '<a onclick="updateagentState('+id+',1)" title="修改状态" href="javascript:;" class="ml-5" style="text-decoration:none">修改为正在使用</a>';
|
|
|
+ message = '停用';
|
|
|
break;
|
|
|
- }*/
|
|
|
- /* $('#config_status').html(message);*/
|
|
|
+ }
|
|
|
+ $('#agent_status'+id).html(message);
|
|
|
} else {
|
|
|
- layer.msg("修改失败</br>",{icon: 5,time:2000});
|
|
|
+ layer.alert(data.message, {icon: 5});
|
|
|
}
|
|
|
}
|
|
|
});
|