You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

218 lines
9.5 KiB

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<%@include file="/wdk/theme/je/module/public/common.jsp"%>
<!-- 上述3个meta标签*必须*放在最前面,任何其他内容都*必须*跟随其后! -->
<script type="text/javascript" src="<%=WDK_ROOT%>/theme/je/core/js/lib/ace/ace.js"></script>
<title>打印管理-打印测试</title>
<style type="text/css">
</style>
<script type="text/javascript">
var param = $.getURLParam('param');
var jparam = $.str2json($.urlparam_decode(param));
var tmpl_uuid = jparam.queryParams.tmpl_uuid;
$(function() {
//alert('row.tmpl_uuid='+tmpl_uuid)
initData();
});
/**
* [initData 初始化数据]
* @return {[type]} [无]
*/
function initData() {
$.wait_open();
//初始化供应商信息
var dataParam = {
_SRVNAME : 'service.wdk.print',
_SRVMETHOD : 'queryTemplateById',
_DATA : $.json2str({
tmpl_uuid: tmpl_uuid
})
};
$.cuajax({
url : 'wdk?action=wdk.pub&method=call_service&ajaxparam=' + new Date().getTime(),
method : "post",
timeout : WDK_Timeout,
data : dataParam,
success : function(result) {
$.wait_close();
var jres = $.str2json(result);
//加载成功
if (jres.code == "1") {
//回填数据
$.setFieldValue(jres.result, "#edit_form");
if ('' !== jres.result.tmpl_content) {
editor_content.setValue(Base64.decode(jres.result.tmpl_content));
}
if ('' !== jres.result.tmpl_data) {
editor_data.setValue(Base64.decode(jres.result.tmpl_data));
}
} else {
alert(jres.desc);
}
},
error : function(result) {
$.wait_close();
alert('网络错误!result=' + result);
}
});
}
/**
* [opt_save 保存]
* @return {[type]} [无]
*/
function opt_print() {
$.print({
tmpl_content:editor_content.getValue(),
tmpl_name:$('#tmpl_name').val(),
tmpl_code:$('#tmpl_code').val(),
action:'PRINT',
data:$.str2json(editor_data.getValue())
});
}
function opt_preview() {
$.print({
tmpl_content:editor_content.getValue(),
tmpl_name:$('#tmpl_name').val(),
tmpl_code:$('#tmpl_code').val(),
action:'PREVIEW',
data:$.str2json(editor_data.getValue())
});
}
/**
* [opt_close 关闭当前页面]
* @return {[type]} [无]
*/
function opt_close() {
$.closeActiveTab();
}
</script>
</head>
<body class="easyui-layout" data-options="fit:true">
<div data-options="region:'north',border:false,collapsed:false" class="page-title" style="overflow: hidden;height:40px;">
<div class="edit-page-toolbar">
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'fa fa-save'" onclick="opt_print()" id="btn_print">打印测试</a>
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'fa fa-save'" onclick="opt_preview()" id="btn_preview">打印预览</a>
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'fa fa-close'" onclick="opt_close()">关闭</a>
</div>
</div>
<div data-options="region:'center',border:false,collapsed:false">
<div class="easyui-layout" data-options="fit:true">
<div data-options="region:'center',border:false,collapsed:false">
<div id="edit_form" class="edit-container" style="padding: 0 20px 20px 20px;background-color: white;">
<input type="hidden" id="tmpl_uuid" name="tmpl_uuid"/>
<div class="form-title">
<span class="form-title-text">基本信息</span>
</div>
<div class="row">
<div class="formgroup">
<label class="required">名称</label>
<div>
<input type="text" id="tmpl_name" name="tmpl_name" class="easyui-validatebox" title="" data-options="required:true,validType:['length[0,100]'],tipPosition:'bottom'" />
</div>
</div>
<div class="formgroup">
<label class="required">编码</label>
<div>
<input type="text" id="tmpl_code" name="tmpl_code" class="easyui-validatebox" title="" data-options="required:true,validType:['length[0,100]'],tipPosition:'bottom'" />
</div>
</div>
</div>
<div class="row" style="height: 200px;">
<div class="formgroup" style="width: 100%;">
<label>模板内容</label>
<div>
<div id="tmpl_content" style="width:100%;height:100%;"></div>
</div>
</div>
<script type="text/javascript">
editor_content = ace.edit("tmpl_content");
editor_content.setTheme("ace/theme/twilight");
editor_content.session.setMode("ace/mode/html");
editor_content.setAutoScrollEditorIntoView(true);
//editor.setOption("maxLines", 100);
</script>
</div>
<div class="row" style="height: 200px;">
<div class="formgroup" style="width: 100%;">
<label>测试数据</label>
<div>
<div id="tmpl_data" style="width:100%;height:100%;"></div>
</div>
</div>
<script type="text/javascript">
editor_data = ace.edit("tmpl_data");
editor_data.setTheme("ace/theme/twilight");
editor_data.session.setMode("ace/mode/json");
editor_data.setAutoScrollEditorIntoView(true);
//editor.setOption("maxLines", 100);
</script>
</div>
<div class="row" style="margin-top: 3px;">
<div class="formgroup" style="width: 100%;">
<label class="required">显示顺序</label>
<div>
<input type="text" id="display_order" name="display_order" class="easyui-validatebox" title="" data-options="required:true,validType:['isInteger','length[0,100]'],tipPosition:'bottom'" />
</div>
</div>
</div>
<div class="row">
<div class="formgroup" style="height: 36px;">
<label class="required">是否启用</label>
<div>
<input type="text" id="is_active" name="is_active" class="easyui-validatebox" title="" data-options="required:true,tipPosition:'bottom'" />
</div>
</div>
<div class="formgroup">
<label class="required">明细行数</label>
<div>
<input type="text" id="detail_rows" name="detail_rows" class="easyui-validatebox" title="" data-options="required:true,validType:['isInteger','number[5,0]'],tipPosition:'bottom'" />
</div>
</div>
</div>
<div class="row">
<div class="formgroup">
<label class="required">纸张宽度</label>
<div>
<input type="text" id="paper_width" name="paper_width" class="easyui-validatebox" title="" data-options="required:true,validType:['isAllNumber','number[9,2]'],tipPosition:'bottom'" />
</div>
</div>
<div class="formgroup">
<label class="required">纸张高度</label>
<div>
<input type="text" id="paper_height" name="paper_height" class="easyui-validatebox" title="" data-options="required:true,validType:['isAllNumber','number[9,2]'],tipPosition:'bottom'" />
</div>
</div>
</div>
<div class="row-2" style="margin-top: 6px;">
<div class="formgroup" style="width: 100%;">
<label>备注</label>
<div>
<textarea class="easyui-validatebox" id="remark" name="remark" data-options="validType:['length[0,200]'],tipPosition:'bottom'" title=""></textarea>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>