Index: ssts-web/src/main/webapp/disinfectsystem/labelTemplateDesign/printCustomDesign.jsp =================================================================== diff -u -r15083 -r15105 --- ssts-web/src/main/webapp/disinfectsystem/labelTemplateDesign/printCustomDesign.jsp (.../printCustomDesign.jsp) (revision 15083) +++ ssts-web/src/main/webapp/disinfectsystem/labelTemplateDesign/printCustomDesign.jsp (.../printCustomDesign.jsp) (revision 15105) @@ -11,6 +11,7 @@ + @@ -44,15 +45,5 @@ - -生成模板
-加载模板
- -获得全部程序代码:
-
- -

- -

\ No newline at end of file Index: ssts-web/src/main/webapp/disinfectsystem/labelTemplateDesign/printCustomDesign.js =================================================================== diff -u -r15099 -r15105 --- ssts-web/src/main/webapp/disinfectsystem/labelTemplateDesign/printCustomDesign.js (.../printCustomDesign.js) (revision 15099) +++ ssts-web/src/main/webapp/disinfectsystem/labelTemplateDesign/printCustomDesign.js (.../printCustomDesign.js) (revision 15105) @@ -44,24 +44,25 @@ } function addOrRemove(add,propName) { getLODOP2(); - var vName = 'obj.'+propName + var vName = 'obj.'+propName; var value = obj[propName]; +// alert(propName) if(add){ - if(LODOP.GET_VALUE("ItemIsAdded", vName)){ - LODOP.SET_PRINT_STYLEA(vName, 'Deleted', 0);// 恢复删除的项 + if(LODOP.GET_VALUE("ItemIsAdded", propName)){ + LODOP.SET_PRINT_STYLEA(propName, 'Deleted', 0);// 恢复删除的项 }else{ - LODOP.ADD_PRINT_TEXTA(vName, 56, 32, 65, 30, value); + LODOP.ADD_PRINT_TEXTA(propName, 56, 32, 65, 30, value); LODOP.SET_PRINT_STYLEA(0, "ContentVName", vName);// 设置内容参数的变量名 } }else{ - LODOP.SET_PRINT_STYLEA(vName, 'Deleted', 1);// 删除对应的项 + LODOP.SET_PRINT_STYLEA(propName, 'Deleted', 1);// 删除对应的项 } } function CreatePage() { getLODOP2(); // alert(currentConfig.width) LODOP.PRINT_INITA(0, 0, currentConfig.width, currentConfig.height, "小标签"); - LODOP.PRINT_INITA(0, 0, '800px', '600px', "小标签"); +// LODOP.PRINT_INITA(0, 0, '800px', '600px', "小标签"); LODOP.SET_PRINT_MODE("PROGRAM_CONTENT_BYVAR", true);// 生成程序时,内容参数有变量用变量,无变量用具体值 }; function DisplayDesign() { @@ -170,19 +171,15 @@ onCurrentTableConfigChange(); // testInsertTable(tableConfig); } - +// 删除表格 +function deleteTable(){ + currentConfig.templateInfo.tableConfigs = []; + currentConfig = null; +} function onCurrentTableConfigChange(){ loadTableConfig(currentTableConfig); } -function Addhtm() { - LODOP - .ADD_PRINT_HTM( - 45, - 494, - 288, - 88, - "\n\n\n\n\n\n\n\n\n\n\n
表格11表格12表格13
表格21表格22表格23
"); -}; + function SetBKIMG() { getLODOP2(); LODOP @@ -192,24 +189,9 @@ function getProgram() { getLODOP2(); currentConfig.programCodes = LODOP.GET_VALUE("ProgramCodes", 0); - document.getElementById('S1').value = LODOP.GET_VALUE("ProgramCodes", 0); - document.getElementById('button01').style.display = ""; }; -function createTemplate() { - getLODOP2(); - document.getElementById('S1').value = LODOP.GET_VALUE("ProgramData", 0); -}; -function loadTemplate() { - getLODOP2(); - eval(document.getElementById('S1').value); - if (LODOP.CVERSION) - LODOP.On_Return = function(TaskID, Value) { - document.getElementById('S1').value = Value; - }; - document.getElementById('S1').value = LODOP.PRINT_DESIGN(); -}; function restoreDesign() { getLODOP2(); @@ -237,6 +219,7 @@ getProgram(); obj = previewObj; if(!isUndefinedOrNullOrEmpty(currentConfig.programCodes)){ +// alert(currentConfig.programCodes) eval(currentConfig.programCodes);// 执行eval方法,装载模板 } LODOP.PREVIEW(); @@ -280,14 +263,16 @@ function loadTableConfig(tableConfig){ tableConfig.loadTableConfig(); } -function saveFontConfig(cmpIdPrefix,fontConfig){ - + +function getBuiltInPropCheckedState(propName){ + var itemExist = LODOP.GET_VALUE ('ItemExist', propName); + if(itemExist){ + return true; + } + return false; } -function loadFontConfig(cmpIdPrefix,fontConfig){ - -} // 加载表格属性 -function showWindow(id) { +function showMainWindow(id) { formPanel = new Ext4.form.Panel({ id : 'configForm', @@ -302,101 +287,40 @@ labelWidth : 200 }, items : [ { - xtype : 'hidden', - id : 'id', - name : 'id' - }, { - xtype : 'button', - text : '删除所选项', - handler : function() { - deleteSelectedItems(); - } - }, { - xtype : 'button', - text : '插入文本', - handler : function() { - insertTextItem(); - } + xtype:'fieldset', + title: '工具箱', + defaultType: 'textfield', + columnWidth : 1, + items : [{ + xtype : 'button', + text : '删除所选项', + handler : function() { + deleteSelectedItems(); + } + }, { + xtype : 'button', + text : '插入文本', + handler : function() { + insertTextItem(); + } + }] },{ - xtype : 'checkboxfield', - id: 'cmp_name', - boxLabel : '包名称', - handler : function(checkbox,checked) { - addOrRemove(checked,'name'); - } - }, { - xtype : 'checkboxfield', - id: 'cmp_operator', - boxLabel : '配包人', - handler : function(checkbox,checked) { - addOrRemove(checked,'operator'); - } - }, { - xtype : 'checkboxfield', - id: 'cmp_reviewer', - boxLabel : '审核人', - handler : function(checkbox,checked) { - addOrRemove(checked,'reviewer'); - } - }, { - xtype : 'checkboxfield', - id: 'cmp_sterilizationDate', - boxLabel : '灭菌日期', - handler : function(checkbox,checked) { - addOrRemove(checked,'sterilizationDate'); - } - }, { - xtype : 'checkboxfield', - id: 'cmp_validDate', - boxLabel : '失效日期', - handler : function(checkbox,checked) { - addOrRemove(checked,'validDate'); - } - }, { - xtype : 'checkboxfield', - id: 'cmp_sterilizer', - boxLabel : '炉号', - handler : function(checkbox,checked) { - addOrRemove(checked,'sterilizer'); - } - }, { - xtype : 'checkboxfield', - id: 'cmp_frequency', - boxLabel : '炉次', - handler : function(checkbox,checked) { - addOrRemove(checked,'frequency'); - } - }, { - xtype : 'checkboxfield', - id: 'cmp_hospitalName', - boxLabel : '医院名称', - handler : function(checkbox,checked) { - addOrRemove(checked,'hospitalName'); - } - }, { - xtype : 'checkboxfield', - id: 'cmp_patient', - boxLabel : '病人姓名', - handler : function(checkbox,checked) { - addOrRemove(checked,'patient'); - } - }, { - xtype : 'checkboxfield', - id: 'cmp_toolAmount', - boxLabel : '工具件数', - handler : function(checkbox,checked) { - addOrRemove(checked,'toolAmount'); - } - }, { - xtype : 'checkboxfield', - id: 'cmp_implantAmount', - boxLabel : '植入物件数', - handler : function(checkbox,checked) { - addOrRemove(checked,'implantAmount'); - } + xtype:'fieldset', + id: 'builtInProps', + layout:'column', + title: '内置属性', + defaultType: 'textfield', + columnWidth : 1, + items : [] } ], // tbar : [], buttons : [ { + text : '表格设计器', + hidden : false, + handler : function() { + showTableDesignWindow(); + } + },{ id : 'zoomIn', text : '放大', hidden : false, @@ -411,6 +335,12 @@ prn_Preview(); } },{ + text : '打印', + hidden : false, + handler : function() { + prn_Preview(); + } + },{ id : 'saveBtn', text : '保存', hidden : false, @@ -423,6 +353,34 @@ handler : cancel } ] }); + var dataSourceName = currentConfig.dataSourceName; + if(isUndefinedOrNullOrEmpty(dataSourceName)){ + dataSourceName = '普通器械包'; + } + var dataSource = objectDataSourceManager.getDataSourceByName(dataSourceName); + var objectProperties = dataSource.objectProperties; + var pAmount = objectProperties.length; + var p = Ext4.getCmp('builtInProps'); + for(var i=0;i +