Index: ssts-web/src/main/webapp/disinfectsystem/config/gdsy/print/printConfig.js
===================================================================
diff -u -r12799 -r13067
--- ssts-web/src/main/webapp/disinfectsystem/config/gdsy/print/printConfig.js (.../printConfig.js) (revision 12799)
+++ ssts-web/src/main/webapp/disinfectsystem/config/gdsy/print/printConfig.js (.../printConfig.js) (revision 13067)
@@ -681,118 +681,150 @@
var idCardLargeLabelConfig = {
customPrint:printIDCardLargeLabel
}
- function printIDCardLargeLabel(idCardInstance){
- if(isUndefinedOrNullOrEmpty(idCardInstance.tousseDefinition)){
- alert('包定义不能为空!');
- return;
+function printIDCardLargeLabel(idCardInstance){
+ if(isUndefinedOrNullOrEmpty(idCardInstance.tousseDefinition)){
+ alert('包定义不能为空!');
+ return;
+ }
+ doGetLodop();
+ var barcode = idCardInstance.barcode;
+ var date = idCardInstance.printDate;
+ var name = idCardInstance.tousseDefinition.name;
+ var userName = idCardInstance.userName;
+ var unit = idCardInstance.unit;
+
+ var tableHtml = "
";
+ tableHtml += "";
+ tableHtml += ""+unit+" | ";
+ tableHtml += "
";
+ tableHtml += "";
+ tableHtml += ""+name+" | ";
+ tableHtml += "
";
+ tableHtml += "
";
+ tableHtml += "";
+ tableHtml += "";
+ tableHtml += "器械名称 | ";
+ tableHtml += "数量 | ";
+ tableHtml += "器械名称 | ";
+ tableHtml += "数量 | ";
+ tableHtml += "
";
+
+ var materials = [];
+ if(!isUndefinedOrNullOrEmpty(idCardInstance.tousseDefinition) && !isUndefinedOrNullOrEmpty(idCardInstance.tousseDefinition.materialInstances)){
+ materials = idCardInstance.tousseDefinition.materialInstances;
+ }
+ var total = materials.length;
+ var isEven = true; //判断材料的数量是奇数还是偶数
+ if(total%2 != 0){
+ isEven = false;
+ total++;
+ }
+ total /= 2;
+ var amount = 0;
+ //之所以用这种方式是因为用户习惯从上往下清点材料,而不是从左往右
+ for(var i=0;i";
- tableHtml += ""+unit+" | ";
- tableHtml += "";
- tableHtml += "";
- tableHtml += ""+name+" | ";
- tableHtml += "
";
- tableHtml += "
";
- tableHtml += "";
- tableHtml += "";
- tableHtml += "器械名称 | ";
- tableHtml += "数量 | ";
- tableHtml += "器械名称 | ";
- tableHtml += "数量 | ";
- tableHtml += "
";
+ tableHtml += ""+materialName;
+ tableHtml += " | "+count+" | ";
- var materials = [];
- if(!isUndefinedOrNullOrEmpty(idCardInstance.tousseDefinition) && !isUndefinedOrNullOrEmpty(idCardInstance.tousseDefinition.materialInstances)){
- materials = idCardInstance.tousseDefinition.materialInstances;
- }
- var total = materials.length;
- var isEven = true; //判断材料的数量是奇数还是偶数
- if(total%2 != 0){
- isEven = false;
- total++;
- }
- total /= 2;
- var amount = 0;
- //之所以用这种方式是因为用户习惯从上往下清点材料,而不是从左往右
- for(var i=0;i";
+ tableHtml += " | ";
+ }else{
+ var record2 = materials[i+total];
+ var materialName2 = record2.materialDefinition.name;
+ var specification2 = record2.materialDefinition.specification;
+ var type2 = record2.materialDefinition.type;
+ if(specification2 != 'null' && specification2 != ""){
+ materialName2 += "["+specification2+"]";
}
- var count = materialInstance.count;
- if(type != '一次性物品'){
- amount += parseInt(count);
+ var count2 = record2.count;
+ if(type2 != '一次性物品'){
+ amount += parseInt(count2);
}
-
- tableHtml += "";
- tableHtml += ""+materialName;
- tableHtml += " | "+count+" | ";
-
- if(i==total-1 && !isEven){
- tableHtml += " | ";
- tableHtml += " | ";
- }else{
- var record2 = materials[i+total];
- var materialName2 = record2.materialDefinition.name;
- var specification2 = record2.materialDefinition.specification;
- var type2 = record2.materialDefinition.type;
- if(specification2 != 'null' && specification2 != ""){
- materialName2 += "["+specification2+"]";
- }
- var count2 = record2.count;
- if(type2 != '一次性物品'){
- amount += parseInt(count2);
- }
- tableHtml += ""+materialName2;
- tableHtml += " | "+count2+"";
- tableHtml += " | ";
- }
-
- tableHtml += "
";
- }
-
- tableHtml += "
";
-
- tableHtml += "";
- //条码,打印人和时间和器械数量
- if(barcode != '' && userName != '' && date != ''){
- tableHtml += "";
- tableHtml += "";
- tableHtml += " ";
- tableHtml += ""+barcode;
- tableHtml += " | ";
+ tableHtml += ""+materialName2;
+ tableHtml += " | "+count2+"";
tableHtml += " | ";
- tableHtml += "器械总数量:"+amount+"件";
- tableHtml += " | ";
- tableHtml += "
";
- }else{
- tableHtml += "";
- tableHtml += "器械总数量:"+amount+"件";
- tableHtml += " | ";
- tableHtml += "
";
}
- //告警语(已注释不打印,经省医护长与封枫、关总确认 since 2016-01-25 SYF)
- /*tableHtml += "";
- tableHtml += "***需要回收,切勿丢失*** | ";
- tableHtml += "
";*/
- tableHtml += "
";
+ tableHtml += "";
+ }
+
+ tableHtml += "";
- LODOP.ADD_PRINT_HTM(0,0,"95%","100%",""+tableHtml+"");
- LODOP.PRINT();
+ tableHtml += "";
+ //条码,打印人和时间和器械数量
+ if(barcode != '' && userName != '' && date != ''){
+ tableHtml += "";
+ tableHtml += "";
+ tableHtml += " ";
+ tableHtml += ""+barcode;
+ tableHtml += " | ";
+ tableHtml += "";
+ tableHtml += "器械总数量:"+amount+"件";
+ tableHtml += " | ";
+ tableHtml += "
";
+ }else{
+ tableHtml += "";
+ tableHtml += "器械总数量:"+amount+"件";
+ tableHtml += " | ";
+ tableHtml += "
";
}
+
+ //告警语(已注释不打印,经省医护长与封枫、关总确认 since 2016-01-25 SYF)
+ /*tableHtml += "";
+ tableHtml += "***需要回收,切勿丢失*** | ";
+ tableHtml += "
";*/
+ tableHtml += "
";
+
+ LODOP.ADD_PRINT_HTM(0,0,"95%","100%",""+tableHtml+"");
+ LODOP.PRINT();
+}
+var idCardSmallLabelConfig = {
+ customPrint:printIDCardSmallLabel_gdsy
+ }
+function printIDCardSmallLabel_gdsy(idCardInstance){
+ if(isUndefinedOrNullOrEmpty(idCardInstance.tousseDefinition)){
+ alert('包定义不能为空!');
+ return;
+ }
+ var barcode = idCardInstance.barcode;
+ var name = idCardInstance.tousseDefinition.name;
+
+ doGetLodop();
+ // 设置默认字体
+ setDefaultFontNameSizeBold('宋体',12,1);
+ // 默认条码属性
+ LODOP.SET_PRINT_STYLE('ShowBarText', true);
+ LODOP.SET_PRINT_STYLE('FontSize', 6);
+ LODOP.SET_PRINT_STYLE('NotOnlyHighPrecision', true);
+
+ var fontSize = getFontSizeByStr(name,[
+ {maxLen:10,fontSize:12},
+ {maxLen:20,fontSize:10},
+ {maxLen:30,fontSize:8},
+ {maxLen:1000,fontSize:6}
+ ]);
+ LODOP.ADD_PRINT_TEXT("1mm","1mm","RightMargin:0mm","12mm", name);
+ setFontSizeBold(fontSize,1);// 设置字体
+ setAlignment('center');// 对齐
+
+ LODOP.ADD_PRINT_BARCODE("14mm","5mm","40mm","10mm","128Auto", barcode);// 条码1
+ LODOP.PRINT();
+}
var printConfig = {
//发货计划单
invoicePlan : invoicePlanPrintConfig,
@@ -831,5 +863,6 @@
// 外来器械包中标签
foreignTousseMiddleLable:foreignTousseMiddleLableConfig,
// 标识牌
- idCardLargeLabel:idCardLargeLabelConfig
+ idCardLargeLabel:idCardLargeLabelConfig,
+ idCardSmallLabel:idCardSmallLabelConfig// 小标签
};
Index: ssts-web/src/main/webapp/disinfectsystem/basedatamanager/tousse/tousseForm.js
===================================================================
diff -u -r12809 -r13067
--- ssts-web/src/main/webapp/disinfectsystem/basedatamanager/tousse/tousseForm.js (.../tousseForm.js) (revision 12809)
+++ ssts-web/src/main/webapp/disinfectsystem/basedatamanager/tousse/tousseForm.js (.../tousseForm.js) (revision 13067)
@@ -106,6 +106,13 @@
}
}
+function setIdCardPaperType2(){
+ var idCardPaperType = top.Ext.getCmp("idCardPaperType").getValue();
+ var idCardPaperType2 = top.Ext.getCmp("idCardPaperType2");
+ if(idCardPaperType2 != null){
+ idCardPaperType2.setValue(idCardPaperType);
+ }
+}
function addAndEditTousse(id,isUploadVideo) {
this.id = id;
tousseDefinitionID = id;
@@ -1635,6 +1642,7 @@
method : 'GET',
waitMsg : '正在加载数据,请稍候',
success : function(form, action) {
+ setIdCardPaperType2();
var tousseDefinition = action.result.data;
top.Ext.getCmp("orginalName").setValue(tousseDefinition.name);
if(hasVideo){
Index: ssts-idcard/src/main/java/com/forgon/disinfectsystem/idcarddefinition/dwr/table/IDCardDefinitionTableManager.java
===================================================================
diff -u -r12331 -r13067
--- ssts-idcard/src/main/java/com/forgon/disinfectsystem/idcarddefinition/dwr/table/IDCardDefinitionTableManager.java (.../IDCardDefinitionTableManager.java) (revision 12331)
+++ ssts-idcard/src/main/java/com/forgon/disinfectsystem/idcarddefinition/dwr/table/IDCardDefinitionTableManager.java (.../IDCardDefinitionTableManager.java) (revision 13067)
@@ -3,9 +3,12 @@
import java.util.List;
import java.util.Map;
+import net.sf.json.JSONObject;
+
import com.forgon.component.grid.GridManager;
import com.forgon.disinfectsystem.entity.idcarddefinition.IDCardDefinition;
import com.forgon.disinfectsystem.idcarddefinition.service.IDCardDefinitionManager;
+import com.forgon.tools.json.JSONUtil;
public class IDCardDefinitionTableManager {
@@ -33,4 +36,23 @@
return idCardDefinitionManager
.getAvailableDefinitionByBarcode(barcode);
}
+
+ // 重新打印标识牌实例
+ public String rePrintIDCardInstance(String params) {
+ JSONObject paramsObject = JSONObject.fromObject(params);
+ String tousseDefinitionID = JSONUtil.optString(paramsObject,"tousseDefinitionID", "");
+ String idCardInstanceID = JSONUtil.optString(paramsObject,"idCardInstanceID", "");
+ JSONObject jsonObject = new JSONObject();
+ try {
+ String json = idCardDefinitionManager
+ .rePrintIDCardInstance_TRANS_REQUIRED(tousseDefinitionID,
+ idCardInstanceID);
+ jsonObject = JSONObject.fromObject(json);
+ jsonObject.put("success", true);
+ } catch (Exception e) {
+ e.printStackTrace();
+ jsonObject.put("success", false);
+ }
+ return jsonObject.toString();
+ }
}
Index: ssts-web/src/main/webapp/disinfectsystem/basedatamanager/tousse/idCardForm.js
===================================================================
diff -u -r12926 -r13067
--- ssts-web/src/main/webapp/disinfectsystem/basedatamanager/tousse/idCardForm.js (.../idCardForm.js) (revision 12926)
+++ ssts-web/src/main/webapp/disinfectsystem/basedatamanager/tousse/idCardForm.js (.../idCardForm.js) (revision 13067)
@@ -195,8 +195,9 @@
showResult('请选择要打印的标识牌实例!');
return;
}
- top.Ext.MessageBox.wait('正在打印,请稍候……', '请等待');
+ top.Ext.MessageBox.progress('打印中', '请稍候...');
printIDCardInstanceByID(records[0].data.id);
+ hideMessageBox(true);
}
}, {
text : '转换',
@@ -407,7 +408,33 @@
handler : function(){
printNewIDCardInstanceForSupplement();
}
- }]
+ },{
+ text : '打印全部',
+ iconCls : 'icon_print',
+ hidden:forSupplement,
+ handler : function() {
+ printAllIdCard();
+ }
+ },{
+ text : '标识牌标签:',
+ hidden:forSupplement
+ },{
+ xtype : 'combo',
+ id : 'idCardPaperType2',
+ name : 'idCardPaperType2',
+ editable:false,
+ valueField : 'value',
+ displayField : 'value',
+ store : new Ext.data.SimpleStore( {
+ fields : [ 'value'],
+ data : [['大标签'],['中标签'],['小标签']]
+ }),
+ value : '大标签',
+ forceSelection : true,
+ mode : 'local',
+ triggerAction : 'all',
+ anchor : '100%'
+ }]
},{
anchor:'100% 50%',
layout : 'fit',
@@ -539,30 +566,67 @@
DWREngine.setAsync(true);
idCardInstance.unit = unit;
idCardInstance.userName = userName;
+ // 设置打印的标签类型
+ var idCardPaperType2 = top.Ext.getCmp("idCardPaperType2").getValue();
+ if(!isUndefinedOrNullOrEmpty(idCardPaperType2)){
+ idCardInstance.idCardPaperType = idCardPaperType2;
+ }
+
printIDCardInstance(idCardInstance);
}
function printIDCardInstanceByID(idCardInstanceID){
var id = idCardInstanceID;
var printResult = false;
- Ext.Ajax.request({
- url : WWWROOT + '/disinfectSystem/idCardDefinitionAction!rePrintIDCardInstance.do',
- params : {idCardInstanceID : id,tousseDefinitionID : tousseDefinitionID},
- success : function(response, options) {
- var result = JSON.parse(response.responseText);
- if(!isUndefinedOrNullOrEmpty(result.idCardInstance)){
- printIDCardInstanceObj(result.idCardInstance);
- }
- },
- failure : function(response, options) {
- },
- callback : function(options,response,success) {
- //打印后不用重新加载
- //reLoadIDCardDefinitions();// 重新加载所有数据
- hideMessageBox(true);
+ DWREngine.setAsync(false);
+ var params = {idCardInstanceID : id,tousseDefinitionID : tousseDefinitionID};
+ IDCardDefinitionTableManager.rePrintIDCardInstance(JSON.stringify(params),function(jsonStr){
+ var result = JSON.parse(jsonStr);
+ if(!isUndefinedOrNullOrEmpty(result.idCardInstance)){
+ printIDCardInstanceObj(result.idCardInstance);
}
});
+ DWREngine.setAsync(true);
}
-
+ function printIDCardInstanceByIDs(idCards){
+ top.Ext.MessageBox.progress('打印中', '请稍候...');
+ for(var i=0;i
";
}
@@ -949,17 +1013,17 @@
}
if(idCardInstances !=null && idCardInstances.length > 0 ){
for(var i=0;i
+