292 рядки
12 KiB
Plaintext
292 рядки
12 KiB
Plaintext
${zhiqim_manager_breadcrumb("字段参数")}
|
||
${zhiqim_manager_content()}
|
||
${sweet_alert_reuse_method()}
|
||
<script>
|
||
var catMap = new Z.HashMap();
|
||
var list = Z.J.toObject('${catList}');
|
||
Z.onload(function(){
|
||
Z.each(list, function(item, i){
|
||
catMap.put(Z.S.toString(item.reasonId), item)
|
||
})
|
||
});
|
||
|
||
function toAdd(type)
|
||
{
|
||
if ((type != 1 && type != 0))
|
||
{
|
||
Z.alert("未知添加类型");
|
||
return;
|
||
}
|
||
|
||
|
||
var isCat = type == 1;
|
||
var addreasonTile = '';
|
||
var content = '<form name="addForm" action="javascript:void(0)">';
|
||
content += '<input name="isStandardType" type="hidden" value="'+isCat+'">';
|
||
content += '<table class="z-table z-bordered z-h40-tr z-pd6 z-bg-white z-text-center">';
|
||
var height = 300;
|
||
if (isCat)
|
||
{//添加分类
|
||
height = 120;
|
||
content += ' <tr>';
|
||
content += ' <td>规范分类 :</td>';
|
||
content += ' <td><input name="standardTitle" class="z-input z-w200" placeholder="不能超过32字符"></td>';
|
||
content += ' </tr>';
|
||
}
|
||
else
|
||
{
|
||
content += ' <tr>';
|
||
content += ' <td>规范分类 :</td>';
|
||
content += ' <td>';
|
||
content += ' <select name="standardParent" class="z-select z-w200" data-role="z-select" data-class="z-blue">';
|
||
Z.each(list, function(item, i)
|
||
{
|
||
content += ' <option value="'+item.standardId+'">'+item.standardTitle+'</option>';
|
||
})
|
||
content += ' </select>';
|
||
content += ' </td>';
|
||
content += ' </tr>';
|
||
|
||
content += ' <tr>';
|
||
content += ' <td>规范项 :</td>';
|
||
content += ' <td><input name="standardTitle" class="z-input z-w200" placeholder="不能超过32字符"></td>';
|
||
content += ' </tr>';
|
||
}
|
||
|
||
content += '</table>';
|
||
content += '<div class="z-absolute z-b0 z-l0 z-w100p z-h60 z-pd10 z-bg-gray z-text-center">';
|
||
content += ' <button class="z-button z-large z-w150 z-blue" onclick="doSave(this.form)">保存</button>';
|
||
content += ' <button class="z-button z-large z-w70 z-mg-l10" onclick="Z.Dialog.close(location.hash);">取消</button>';
|
||
content += '</div>';
|
||
content += '</form>';
|
||
var dialog = Z.dialog({id:'addreason', title:'<span id="addreasonTile"></span>', text:'<div id="addreasonContent"></div>',width:460,height:height, shadow:true});
|
||
Z("#addreasonContent").htmlc(content);
|
||
Z("#addreasonTile").htmlc("添加原因预录");
|
||
}
|
||
|
||
function doSave(form)
|
||
{
|
||
var ajax = new Z.Ajax();
|
||
ajax.setContextPath("${context.getContextPath()}");
|
||
ajax.setClassName("com.zhiqim.yangcai.design.action.sys.DesignStandardAction");
|
||
ajax.setMethodName("insert");
|
||
ajax.setParamForm(form);
|
||
ajax.setFailureAlert();
|
||
ajax.setSuccess(function(){
|
||
swal({title:"添加成功",type:"success",timer: 1000,width:300,showConfirmButton:false}).then(function(){
|
||
parent.location.reload();
|
||
});
|
||
});
|
||
ajax.setLoading(document);
|
||
ajax.execute();
|
||
}
|
||
|
||
|
||
function doModify(reasonId, parentId, text)
|
||
{//修改
|
||
var addreasonTile = '';
|
||
var content = '<form name="modifyForm" action="javascript:void(0)">';
|
||
content += '<input name="standardId" type="hidden" value="'+reasonId+'">';
|
||
content += '<input name="isStandardType" type="hidden" value="false">';
|
||
content += '<table class="z-table z-bordered z-h40-tr z-pd6 z-bg-white z-text-center">';
|
||
var height = 300;
|
||
content += ' <tr>';
|
||
content += ' <td>类型分类 :</td>';
|
||
content += ' <td>';
|
||
content += ' <select name="standardParent" class="z-select z-w200" data-role="z-select-search" data-class="z-blue">';
|
||
Z.each(list, function(item, i)
|
||
{
|
||
content += ' <option value="'+item.standardId+'" '+(item.standardId == parentId ? 'selected' : '')+'>'+item.standardTitle+'</option>';
|
||
});
|
||
content += ' </select>';
|
||
content += ' </td>';
|
||
content += ' </tr>';
|
||
|
||
content += ' <tr>';
|
||
content += ' <td>标题 :</td>';
|
||
content += ' <td><input name="standardTitle" class="z-input z-w200" value="'+(text ? text : '')+'" placeholder="不能超过32字符"></td>';
|
||
content += ' </tr>';
|
||
|
||
content += '</table>';
|
||
content += '<div class="z-absolute z-b0 z-l0 z-w100p z-h60 z-pd10 z-bg-gray z-text-center">';
|
||
content += ' <button class="z-button z-large z-w150 z-blue" onclick="doUpdate(this.form)">保存</button>';
|
||
content += ' <button class="z-button z-large z-w70 z-mg-l10" onclick="Z.Dialog.close(location.hash);">取消</button>';
|
||
content += '</div>';
|
||
content += '</form>';
|
||
var dialog = Z.dialog({id:'modifyreason', title:'<span id="modifyreasonTile"></span>', text:'<div id="modifyreasonContent"></div>',width:460,height:height, shadow:true});
|
||
Z("#modifyreasonContent").htmlc(content);
|
||
Z("#modifyreasonTile").htmlc("添加原因预录");
|
||
|
||
}
|
||
|
||
|
||
|
||
|
||
function doModifys(reasonId, parentId, text)
|
||
{//修改
|
||
var addreasonTile = '';
|
||
var content = '<form name="modifyForm" action="javascript:void(0)">';
|
||
content += '<input name="standardId" type="hidden" value="'+reasonId+'">';
|
||
content += '<input name="isStandardType" type="hidden" value="false">';
|
||
content += '<table class="z-table z-bordered z-h40-tr z-pd6 z-bg-white z-text-center">';
|
||
var height = 300;
|
||
|
||
content += ' <tr>';
|
||
content += ' <td>类型:</td>';
|
||
content += ' <td><input name="standardTitle" class="z-input z-w200" value="'+(text ? text : '')+'" placeholder="不能超过32字符"></td>';
|
||
content += ' </tr>';
|
||
|
||
content += '</table>';
|
||
content += '<div class="z-absolute z-b0 z-l0 z-w100p z-h60 z-pd10 z-bg-gray z-text-center">';
|
||
content += ' <button class="z-button z-large z-w150 z-blue" onclick="doUpdate(this.form)">保存</button>';
|
||
content += ' <button class="z-button z-large z-w70 z-mg-l10" onclick="Z.Dialog.close(location.hash);">取消</button>';
|
||
content += '</div>';
|
||
content += '</form>';
|
||
var dialog = Z.dialog({id:'modifyreason', title:'<span id="modifyreasonTile"></span>', text:'<div id="modifyreasonContent"></div>',width:460,height:height, shadow:true});
|
||
Z("#modifyreasonContent").htmlc(content);
|
||
Z("#modifyreasonTile").htmlc("添加原因预录");
|
||
|
||
}
|
||
|
||
|
||
function doUpdate(form)
|
||
{
|
||
var ajax = new Z.Ajax();
|
||
ajax.setContextPath("${context.getContextPath()}");
|
||
ajax.setClassName("com.zhiqim.yangcai.design.action.sys.DesignStandardAction");
|
||
ajax.setMethodName("update");
|
||
ajax.setParamForm(form);
|
||
ajax.setFailureAlert();
|
||
ajax.setSuccess(function(){
|
||
swal({title:"更新成功",type:"success",timer: 1000,width:300,showConfirmButton:false}).then(function(){
|
||
|
||
parent.location.reload();
|
||
});
|
||
|
||
});
|
||
ajax.setLoading(document);
|
||
ajax.execute();
|
||
}
|
||
|
||
|
||
function doDelete(reasonId){
|
||
var ajax = new Z.Ajax();
|
||
ajax.setContextPath("${context.getContextPath()}");
|
||
ajax.setClassName("com.zhiqim.yangcai.design.action.sys.DesignStandardAction");
|
||
ajax.setMethodName("beforeDelete");
|
||
ajax.addParam("reasonId",reasonId);
|
||
ajax.setSuccess(function(){
|
||
swal({title:"更新成功",type:"success",timer: 1000,width:300,showConfirmButton:false}).then(function(){
|
||
parent.location.reload();
|
||
});
|
||
});
|
||
ajax.setLoading("removeReason", '<i class="z-font z-delete"></i>正在移除',{disabled:true});
|
||
ajax.execute();
|
||
|
||
}
|
||
|
||
|
||
function doReasonDelete(reasonId){
|
||
|
||
var ajax = new Z.Ajax();
|
||
ajax.setContextPath("${context.getContextPath()}");
|
||
ajax.setClassName("com.zhiqim.yangcai.design.action.sys.CheckBackReasonAction");
|
||
ajax.setMethodName("delete");
|
||
ajax.addParam("reasonId",reasonId);
|
||
ajax.setSuccess(function(){
|
||
swal({title:"移除成功",type:"success",timer: 1000,width:300,showConfirmButton:false}).then(function(){
|
||
parent.location.reload();
|
||
});
|
||
});
|
||
ajax.setLoading("removeReason", '<i class="z-font z-delete"></i>正在移除',{disabled:true});
|
||
ajax.execute();
|
||
}
|
||
|
||
|
||
function showEditor(designId)
|
||
{
|
||
|
||
var dialog = new Z.Dialog();
|
||
dialog.title = "行为规范";
|
||
dialog.url = "/designStandardDetails.htm?reasonId=" + designId;
|
||
dialog.width = 1100;
|
||
dialog.height = 700;
|
||
dialog.execute();
|
||
}
|
||
</script>
|
||
<#-- 导航 -->
|
||
<div data-role="z-tabnav" class="z-tabnav-main z-mg-b20 ${zmr_color_class}">
|
||
<nav>
|
||
<ul>
|
||
<#if ZmrPathRule.check(request, "/designTypeList.htm")><li onclick="Z.L.href('/designTypeList.htm');">产品类型</li></#if>
|
||
<#if ZmrPathRule.check(request, "/businessParam.htm")><li onclick="Z.L.href('/businessParam.htm');">公共参数</li></#if>
|
||
<#if ZmrPathRule.check(request, "/industryList.htm")><li onclick="Z.L.href('/industryList.htm');">行业管理</li></#if>
|
||
<#if ZmrPathRule.check(request, "/checkBackReasonList.htm")><li onclick="Z.L.href('/checkBackReasonList.htm');">行业管理</li></#if>
|
||
<#if ZmrPathRule.check(request, "/designOrderRefundReason.htm")><li onclick="Z.L.href('/designOrderRefundReason.htm');">退款原因类型配置</li></#if>
|
||
<li class="z-active">行为规范</li>
|
||
</ul>
|
||
<div class="z-pd6 z-text-right">
|
||
<button type="button" class="z-button z-cyan" onclick="toAdd(1)"><i class="z-font z-add"></i>添加规范分类</button>
|
||
<button type="button" class="z-button z-cyan" onclick="toAdd(0)"><i class="z-font z-add" ></i>新增规范</button>
|
||
<div>
|
||
</nav>
|
||
</div>
|
||
|
||
<#-- 列表 -->
|
||
<table class="z-table">
|
||
<tr>
|
||
<td width="400" valign="top">
|
||
<table class="z-table z-bordered z-h40-tr z-pd6 z-bg-white z-text-center">
|
||
<tr bgcolor="${zmr_thead_bgcolor}">
|
||
<td width="80">序号</td>
|
||
<td width="*">类型名称</td>
|
||
<td width="220">操作</td>
|
||
</tr>
|
||
<#for item : catList>
|
||
<tr ${zhiqim_manager_tr_onmouse()} <#if item.getStandardId() == reasonCatId> style="background-color:#eaeaff;"</#if>>
|
||
<td>${item_index+1}</td>
|
||
<td><a href="designStandardList.htm?reasonCatId=${item.getStandardId()}">${item.getStandardTitle()}</a></td>
|
||
<td>
|
||
<button type="button" class="z-button z-blue" onclick="doModifys('${item.getStandardId()}','${item.getStandardTitle()}')"><i class="z-font z-modify"></i>修改类型项</button>
|
||
<button class="z-button z-red removeReason" onclick="doDelete('${item.getStandardId()}')"><i class="z-font z-delete"></i>移除类型</button> </td>
|
||
</tr>
|
||
</#for>
|
||
<#if catList.size() == 0>
|
||
<tr bgcolor="">
|
||
<td colspan="2">暂时没有数据信息</td>
|
||
</tr>
|
||
</#if>
|
||
</table>
|
||
</td>
|
||
<td width="10"></td>
|
||
<td width="*" id="result" valign="top">
|
||
<table class="z-table z-bordered z-h40-tr z-pd6 z-bg-white z-text-center">
|
||
<tr bgcolor="${zmr_thead_bgcolor}">
|
||
<td width="10%">序号</td>
|
||
<td width="*">标题</td>
|
||
<td width="220">操作</td>
|
||
<td width="100">规范详情</td>
|
||
</tr>
|
||
<#for item : reasonList>
|
||
<tr ${zhiqim_manager_tr_onmouse()}>
|
||
<td>${item_index+1}</td>
|
||
<td id="item_${item.getStandardId()}">${item.getStandardTitle()}</td>
|
||
<td>
|
||
<button type="button" class="z-button z-blue" onclick="doModify('${item.getStandardId()}','${item.getStandardTitle()}')"><i class="z-font z-modify"></i>修改标题项</button>
|
||
<button class="z-button z-red removeReason" onclick="doDelete('${item.getStandardId()}')"><i class="z-font z-delete"></i>移除标题</button> </td>
|
||
|
||
<td align="center">
|
||
<span class="z-button z-blue" onclick="showEditor('${item.getStandardId()}')">添加规范</span>
|
||
</td>
|
||
</tr>
|
||
</#for>
|
||
<#if Validates.isEmpty(reasonList) || reasonList.size() == 0>
|
||
<tr bgcolor="">
|
||
<td colspan="3">暂时没有数据信息</td>
|
||
</tr>
|
||
</#if>
|
||
</table>
|
||
</td>
|
||
</tr>
|
||
</table>
|
||
${zhiqim_manager_content_end()} |