valueList.vm 3.16 KB
#set($page_title="数据字典列表")
#set($crumbs="首页:/home,数据字典列表")
<div class="row">
<div class="page-header">
    <span class="pull-right"><a href="${webUtils.getLocalPath("DataDictionary/list.do")}" class="btn btn-white btn-default">返回</a></span>
    <h1>
        <small>
            <i class="icon-double-angle-right"></i>
          	数据字典值列表
        </small>
    </h1>
</div>
<div class="col-xs-12">
<div class="table-header">
    数据字典值列表
</div>

<div class="table-responsive">
<div id="sample-table-2_wrapper" class="dataTables_wrapper" role="grid">
<div class="row">
    <div class="col-sm-6" style="width:100%">
        <div id="sample-table-2_length" class="dataTables_length">
        </div>
    </div>
</div>
<table id="sample-table-2"
       class="table table-striped table-bordered table-hover dataTable"
       aria-describedby="sample-table-2_info">
    <thead>
    <tr role="row">
        <th>顺序</th>
        <th>值编码</th>
        <th>值名称</th>
        <th>描述</th>
        <th>有效期</th>
        <th><i class="icon-time bigger-110 hidden-480"></i>操作</th>
    </tr>
    </thead>
    <tbody role="alert" aria-live="polite" aria-relevant="all">
        #foreach($obj in $!{model})
        <tr>
        	<td>
            $!{obj.sort}
            </td>
            <td>
            $!{obj.code}
            </td>
            <td>
            $!{obj.name}
            </td>
            <td>
            $!{obj.remark}
            </td>
            <td>
            #if($obj.periodBegin && !$obj.periodEnd)
            	${dateFormatUtils.format($!{obj.periodBegin},"yyyy-MM-dd")} ~ 永久有效
            #elseif($obj.periodEnd && !$obj.periodBegin)
            	${dateFormatUtils.format($!{obj.created},"yyyy-MM-dd")} ~ ${dateFormatUtils.format($!{obj.periodEnd},"yyyy-MM-dd")}
            #elseif(!$obj.periodEnd && !$obj.periodBegin)
            	永久有效
            #else
            	${dateFormatUtils.format($!{obj.periodBegin},"yyyy-MM-dd")} ~
            	${dateFormatUtils.format($!{obj.periodEnd},"yyyy-MM-dd")}
            #end
            </td>
            <td>
                #if($!{toEditValueFlag})
                    <a href="${webUtils.getLocalPath("DataDictionary/toEditValue.do")}?id=${obj.id}">编辑</a>
                    ##<a href="javascript:deleteValue(${obj.id})">删除</a>
                #end
            </td>
        </tr>
        #end
    </tbody>
</table>
<div class="row">
    <div class="col-sm-6">
        #if($!{toSaveValueFlag})
            <a href="${webUtils.getLocalPath("DataDictionary/toSaveValue.do")}?ddid=${ddid}" class="btn btn-success btn-sm">添加</a>
        #end
    </div>
    <div class="col-sm-6">
    </div>
</div>
</div>
</div>
</div>
</div>

<script src="$!{webUtils.getAssetsPath("/js/diligrp.form.js")}"></script>
<script>
function deleteValue(id){
	if(!confirm("确定要删除该字典值吗?")){
		return ;
	}
	$.ajax({
	  url: "$!{webUtils.getLocalPath("DataDictionary/deleteValue.do")}?id=" + id,
	  success: function (data){
		  if(data.succ){
			  alert("删除成功!");
			  location.reload();
		  }else {
			  alert("删除失败!");
		  }
	  }
	});
}
</script>