Index: ssts-web/src/main/webapp/disinfectsystem/labelTemplateDesign/printCustomDesign.js
===================================================================
diff -u -r15012 -r15022
--- ssts-web/src/main/webapp/disinfectsystem/labelTemplateDesign/printCustomDesign.js (.../printCustomDesign.js) (revision 15012)
+++ ssts-web/src/main/webapp/disinfectsystem/labelTemplateDesign/printCustomDesign.js (.../printCustomDesign.js) (revision 15022)
@@ -1,4 +1,5 @@
- var LODOP; //声明为全局变量
+var currentConfig = null;
+var LODOP; //声明为全局变量
var obj = {};
obj.name = '缝合包';
obj.operator = '张三';
@@ -23,7 +24,7 @@
}
function CreatePage(){
LODOP=getLodop(document.getElementById('LODOP2'),document.getElementById('LODOP_EM2'));
- LODOP.PRINT_INITA(0,0,'50mm','30mm',"小标签");
+ LODOP.PRINT_INITA(0,0,currentConfig.width,currentConfig.height,"小标签");
LODOP.SET_PRINT_MODE("PROGRAM_CONTENT_BYVAR",true);//生成程序时,内容参数有变量用变量,无变量用具体值
LODOP.ADD_PRINT_TEXT(10,50,175,30,"先加的内容");
};
@@ -40,6 +41,14 @@
LODOP.SET_SHOW_MODE("MESSAGE_NOSET_PROPERTY",'不能设置属性,请用打印设计(本提示可修改)!');
LODOP.PRINT_SETUP();
};
+ // 删除所选项
+ function deleteSelectedItems(){
+ LODOP.SET_PRINT_STYLEA('Selected','Deleted',true);
+ }
+ // 插入文本项
+ function insertTextItem(){
+ LODOP.ADD_PRINT_TEXTA('a',0,0,75,30,'文本');
+ }
function Addhtm() {
LODOP.ADD_PRINT_HTM(45,494,288,88,"
\n\n表格11 | \n表格12 | \n表格13 | \n
\n\n表格21 | \n表格22 | \n表格23 | \n
\n
");
};
@@ -82,7 +91,98 @@
};
function prn_Preview() {
LODOP=getLodop(document.getElementById('LODOP1'),document.getElementById('LODOP_EM1'));
+ LODOP.SET_PRINT_MODE("PROGRAM_CONTENT_BYVAR",true);//生成程序时,内容参数有变量用变量,无变量用具体值
eval(document.getElementById('S1').value);
LODOP.PREVIEW();
LODOP=getLodop(document.getElementById('LODOP2'),document.getElementById('LODOP_EM2'));
};
+
+ function cancel() {
+ }
+ function showWindow(id) {
+ formPanel = new Ext4.form.Panel({
+ id : 'configForm',
+ frame : true,
+ labelSeparator : ':',
+ bodyStyle : 'padding:5px 5px 0px 5px;',
+ width : 800,
+
+ renderTo : 'bottomDiv',
+ fieldDefaults : {
+ labelAlign : 'left',
+ labelWidth : 200
+ },
+ items : [ {
+ xtype : 'hidden',
+ id : 'id',
+ name : 'id'
+ } ],
+ tbar : [ {
+ xtype : 'button',
+ text : '删除所选项',
+ handler : function() {
+ deleteSelectedItems();
+ }
+ }, {
+ xtype : 'button',
+ text : '插入文本',
+ handler : function() {
+ insertTextItem();
+ }
+ } ],
+ buttons : [ {
+ id : 'saveBtn',
+ text : '保存',
+ hidden : false,
+ handler : function() {
+ if (formPanel.getForm().isValid()) {
+
+ } else {
+ showResult('请填写表单!');
+ return false;
+ }
+ }
+ }, {
+ text : '取消',
+ id : 'saveAndNewBtn',
+ handler : cancel
+ } ]
+ });
+}
+
+ function loadConfigAndInitDesign(){
+
+ if(!Ext4.isEmpty(id)){
+ top.Ext.MessageBox.wait('正在加载……', '请等待');
+
+ Ext4.Ajax.request({
+ url : WWWROOT + '/disinfectSystem/labelTemplateAction!loadData.do',
+ params : {id : id},
+ success : function(response,options){
+ hideMessageBox(true);
+ var result = Ext4.JSON.decode(response.responseText);
+ if(result.success && result.data){
+// top.Ext4.ComponentQuery.query("#configForm #id")[0].setValue(result.data.id);
+// top.Ext4.ComponentQuery.query("#configForm #name")[0].setValue(result.data.name);
+ currentConfig = result.data;
+// top.Ext4.ComponentQuery.query("#configForm #width")[0].setValue(result.data.width);
+// top.Ext4.ComponentQuery.query("#configForm #height")[0].setValue(result.data.height);
+// top.Ext4.ComponentQuery.query("#configForm #description")[0].setValue(result.data.description);
+// top.Ext4.ComponentQuery.query("#configForm #programCodes")[0].setValue(result.data.programCodes);
+ DisplayDesign();
+ }else{
+ showResult('系统加载出错,请稍候再试');
+ }
+ },
+ failure : function(response, options) {
+ hideMessageBox(true);
+ showResult('系统加载出错,请稍候再试');
+ }
+ });
+ }
+ }
+ Ext4.onReady(function() {
+ Ext4.QuickTips.init();
+ showWindow('');
+ loadConfigAndInitDesign();
+ });
Index: ssts-web/src/main/webapp/disinfectsystem/labelTemplateDesign/labelTemplateForm.js
===================================================================
diff -u -r15010 -r15022
--- ssts-web/src/main/webapp/disinfectsystem/labelTemplateDesign/labelTemplateForm.js (.../labelTemplateForm.js) (revision 15010)
+++ ssts-web/src/main/webapp/disinfectsystem/labelTemplateDesign/labelTemplateForm.js (.../labelTemplateForm.js) (revision 15022)
@@ -182,7 +182,7 @@
buttons : [{
id : 'saveBtn',
text : '保存',
- hidden:SSTS_printApplication_manager,
+ hidden:false,
handler : function(){
if(formPanel.getForm().isValid()){
saveConfig();
@@ -216,3 +216,4 @@
configWin.show();
}
+
Index: ssts-web/src/main/webapp/disinfectsystem/labelTemplateDesign/printCustomDesign.jsp
===================================================================
diff -u -r15012 -r15022
--- ssts-web/src/main/webapp/disinfectsystem/labelTemplateDesign/printCustomDesign.jsp (.../printCustomDesign.jsp) (revision 15012)
+++ ssts-web/src/main/webapp/disinfectsystem/labelTemplateDesign/printCustomDesign.jsp (.../printCustomDesign.jsp) (revision 15022)
@@ -3,6 +3,7 @@
pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<%@ include file="/common/includeExtJsAndCss.jsp"%>
+<%@ include file="/common/includeExtJs4_2.jsp"%>
@@ -13,33 +14,32 @@
+
-
-标签设计器:
-
+
-
-
-标签名称:
-标签宽度(毫米):
-标签高度(毫米):
-
-
-
-
-
-
-
-
-删除所选项
-
-插入文本
-
+
包名称
配包人
审核人
@@ -62,9 +62,6 @@
-
-
-
\ No newline at end of file
Index: ssts-web/src/main/webapp/disinfectsystem/labelTemplateDesign/labelTemplateView.js
===================================================================
diff -u -r15010 -r15022
--- ssts-web/src/main/webapp/disinfectsystem/labelTemplateDesign/labelTemplateView.js (.../labelTemplateView.js) (revision 15010)
+++ ssts-web/src/main/webapp/disinfectsystem/labelTemplateDesign/labelTemplateView.js (.../labelTemplateView.js) (revision 15022)
@@ -8,6 +8,11 @@
editConfig(data.id);
}
+// 打印设计
+function printCustomDesign(id){
+ var href = WWWROOT+'/disinfectsystem/labelTemplateDesign/printCustomDesign.jsp?id='+id;
+ location.href = href;
+}
Ext.onReady(function() {
Ext.QuickTips.init();
var columns = [
@@ -61,6 +66,22 @@
handler : function() {
deleteConfig(grid);
}
+ },'-',{
+ text : '打印设计',
+ iconCls : 'btn_ext_application_edit',
+ handler : function() {
+ var records = grid.getSelectionModel().getSelections();
+ if (records.length == 0) {
+ showResult("请选择要修改的数据!");
+ return false;
+ }
+ if (records.length > 1) {
+ showResult("请选择要修改的数据!");
+ return false;
+ }
+ id = records[0].data['id'];
+ printCustomDesign(id);
+ }
}];
var dwrCallParams = null;
Ext.ux.ForgonPageGrid.prototype.getGridParameterMap = function() {};