Index: ssts-web/src/main/webapp/buttjoint/useRecord/useRecordForm.js =================================================================== diff -u -r21034 -r21802 --- ssts-web/src/main/webapp/buttjoint/useRecord/useRecordForm.js (.../useRecordForm.js) (revision 21034) +++ ssts-web/src/main/webapp/buttjoint/useRecord/useRecordForm.js (.../useRecordForm.js) (revision 21802) @@ -22,15 +22,17 @@ /** * 移除对象 */ -function removeGridItem() { - var rows = Ext4.getCmp('tousseInstanceGrid').getSelectionModel() - .getSelections();// 返回值为 - if (rows) { - for ( var i = 0; i < rows.length; i++) { - useItemsStore.remove(rows[i]); - useAmount--; - Ext4.getCmp('useAmount').setValue(useAmount); - +function removeGridItem(barcode) { + var tousseInstanceGridStore = Ext4.getCmp('tousseInstanceGrid').getStore();// 返回值为 + if (tousseInstanceGridStore) { + for ( var i = 0; i < tousseInstanceGridStore.getCount(); i++) { + var tempRecord = tousseInstanceGridStore.getAt(i); + if(tempRecord.data["barcode"] == barcode){ + useItemsStore.remove(tempRecord); + useAmount--; + Ext4.getCmp('useAmount').setValue(useAmount); + break; + } } } } @@ -126,6 +128,10 @@ actualUsed : goodsInfo.actualUsed, haveUnSupplementMaterials : goodsInfo.haveUnSupplementMaterials }); + if (checkBarcodeIsExist(goodsInfo.barcode)) { + showResult('条码为:' + barcode + '的物品已在当前扫描物品里!'); + return; + } useItemsStore.insert(0 , record); useAmount++; Ext4.getCmp('useAmount').setValue(useAmount); @@ -288,10 +294,10 @@ data : [{value:'男',text:'男'}, {value:'女',text:'女'}] }); - var tousseCm = [{id : 'id',dataIndex : 'id',hidden : true}, - {header : "条码",dataIndex : 'barcode',width : 100,menuDisabled : true/*,renderer : renderTousseInstanceInfoShowFun*/}, + var tousseCm = [ {header : "name",dataIndex : 'tousseDefinitionName',hidden : true,menuDisabled : true}, - {header : "名称",dataIndex : 'showTousseName',width : 150,menuDisabled : true/*,renderer : renderTousseInstanceNameForUrgent*/}, + {header : "条码",dataIndex : 'barcode',width : 120/*,menuDisabled : true,renderer : renderTousseInstanceInfoShowFun*/}, + {id:'showTousseName' , header : "名称",dataIndex : 'showTousseName',width : 150,menuDisabled : true/*,renderer : renderTousseInstanceNameForUrgent*/}, {header : '加急',width : 35,hidden : true, renderer : function(v, p, record,rowIndex, colIndex) { var imgName = (record.data.isUrgentForUseRecord=='是')?'arrow_down':'arrow_top'; @@ -310,7 +316,7 @@ } return str; }}, - {header : "数量",dataIndex : 'amount',width : 80,menuDisabled : true,editor : new Ext4.form.NumberField({ + {header : "数量",dataIndex : 'amount',width : 50,menuDisabled : true,editor : new Ext4.form.NumberField({ allowBlank : false, listeners : { focus : function(thiz){ @@ -325,10 +331,10 @@ } } })}, - {header : "包装类型",dataIndex : 'packageType',width : 100,menuDisabled : true}, + {header : "包装类型",dataIndex : 'packageType',width : 90,menuDisabled : true}, {header : "物品类型",dataIndex : 'goodsType',hidden : true}, // {header : "批次",dataIndex : 'batchNo',width : 100,menuDisabled : true}, - {header : "有效期",dataIndex : 'validUntil',menuDisabled : true,width : 100}, + {header : "有效期",dataIndex : 'validUntil',menuDisabled : true,width : 110}, {hidden : true,header : "图片",dataIndex : 'tousseDefinitionName',menuDisabled : true,width : 35,renderer : function(v, p, record){ if(record.data.tousseType != '一次性物品'){ var str = "
"; @@ -349,9 +355,9 @@ } return ""; }}, - {header : '删除操作',id : 'delAction',width : 100, + {header : '删除操作',id : 'delAction',width : 90, renderer : function(v, p, record) { - var str = "
"; + var str = "
"; return str; }, menuDisabled : true, @@ -882,7 +888,7 @@ fieldLabel : '扫描条码', id : 'tempBarcode', name : 'tempBarcode', - width : 200, + width : 260, anchor : '99%', enableKeyEvents : true, listeners : { @@ -911,11 +917,20 @@ buttons: [{ id:'saveBtn', + text: '保存', + handler: saveUseRecordForm + },{ + id:'saveAndReviewAndConvertBtn', text: '保存并审核生成申请单', + hidden : true, handler: saveAndReviewAndConvertUseRecordForm },{ - text: '取消', - handler:function(){history.go(-1);} + text: '清空物品', + handler:function(){ + useItemsStore.removeAll(); + Ext4.getCmp('useAmount').setValue(0); + useAmount = 0; + } }] }); @@ -1001,8 +1016,8 @@ return jsonStr; } - // 保存审核并转换使用记录 - function saveAndReviewAndConvertUseRecordForm(btObj,win,createNew){ + //保存使用记录 + function saveUseRecordForm(btObj,win,createNew){ if(!checkForSave()){ return false; } @@ -1023,13 +1038,19 @@ setFormItems(useItemsStore); formObj.submit({ clientValidation: true, - url: WWWROOT + '/buttjoint/buttjointUseRecordAction!saveAndReviewAndConvertUseRecordForm.do', + url: WWWROOT + '/buttjoint/buttjointUseRecordAction!saveUseRecord.do', waitMsg : '正在保存数据,请稍候', waitTitle : '提交表单', success: function(form, action) { - showResult(action.result.message); - if(action.result.success){ - useItemsStore.removeAll(); + if(action && action.result){ + if(action.result.message){ + showResult(action.result.message); + } + if(action.result.success){ + useItemsStore.removeAll(); + Ext4.getCmp('useAmount').setValue(0); + useAmount = 0; + } } }, failure: function(form, action) { @@ -1046,7 +1067,55 @@ } }); return true; - } + } + // 保存审核并转换使用记录 + function saveAndReviewAndConvertUseRecordForm(btObj,win,createNew){ + if(!checkForSave()){ + return false; + } + var enteringTime = Ext4.getCmp('enteringTime').getValue(); +// btObj.disable(); + + var confirmMessage = "是否提交"+entityName+"信息?"; + if(sstsConfig.auditAndConvertUseRecordConfirmMessage){ + confirmMessage = "手术是否已完成,不需要追加器械包?"; + } + Ext4.MessageBox.confirm("请确认",confirmMessage,function(btn) { + if(btn=='yes') { + Ext4.getCmp('depart').enable(); + setFormParams(formObj.form, [ 'id', 'washHandNurse','circuitNurse', 'operationRoom','treatmentNum', + 'hospitalNum', 'patientName','patientAge', 'patientSex', 'roomNumber', + 'bedNumber', 'patientIDCard', 'doctorName','operationName','specialInfection','operationTime','operationScheduleId', 'remark' ]); + // 设置表单上的item参数 + setFormItems(useItemsStore); + formObj.submit({ + clientValidation: true, + url: WWWROOT + '/buttjoint/buttjointUseRecordAction!saveAndReviewAndConvertUseRecordForm.do', + waitMsg : '正在保存数据,请稍候', + waitTitle : '提交表单', + success: function(form, action) { + showResult(action.result.message); + if(action.result.success){ + useItemsStore.removeAll(); + Ext4.getCmp('useAmount').setValue(0); + useAmount = 0; + } + }, + failure: function(form, action) { + if(action.result.message){ + showResult(action.result.message); + }else{ + showResult('保存失败'); + } + } + }); + }else{ + btObj.enable(); + return false; + } + }); + return true; + } function loadPatientInfo(patientNum,isHospitalNum){ var patientParams = {}; @@ -1056,7 +1125,7 @@ loadPatientInfoByValAndType(JSON.stringify(patientParams)); } var patientNum = isHospitalNum ? hospitalNum : clinicNum; - loadPatientInfo(patientNum,isHospitalNum); + //loadPatientInfo(patientNum,isHospitalNum); // UserTableManager.getUserObjByName(userCode,function(result){ // if(result) Index: ssts-userecord/src/main/java/com/forgon/disinfectsystem/useRecord/action/ButtJointUseRecordAction.java =================================================================== diff -u -r20686 -r21802 --- ssts-userecord/src/main/java/com/forgon/disinfectsystem/useRecord/action/ButtJointUseRecordAction.java (.../ButtJointUseRecordAction.java) (revision 20686) +++ ssts-userecord/src/main/java/com/forgon/disinfectsystem/useRecord/action/ButtJointUseRecordAction.java (.../ButtJointUseRecordAction.java) (revision 21802) @@ -1,5 +1,6 @@ package com.forgon.disinfectsystem.useRecord.action; +import java.text.SimpleDateFormat; import java.util.Date; import net.sf.json.JSONObject; @@ -10,15 +11,19 @@ import org.apache.struts2.convention.annotation.Namespace; import org.apache.struts2.convention.annotation.ParentPackage; +import com.forgon.directory.acegi.tools.AcegiHelper; import com.forgon.directory.service.OrgUnitManager; import com.forgon.disinfectsystem.common.CssdUtils; import com.forgon.disinfectsystem.datasynchronization.model.PatientInfoVO; import com.forgon.disinfectsystem.datasynchronization.service.DataSynchronizationManager; import com.forgon.disinfectsystem.entity.useRecord.UseRecord; +import com.forgon.log.model.Log; +import com.forgon.log.service.LogManager; import com.forgon.security.model.User; import com.forgon.security.service.UserManager; import com.forgon.tools.StrutsParamUtils; import com.forgon.tools.StrutsResponseUtils; +import com.forgon.tools.date.DateTools; import com.forgon.tools.json.JSONUtil; import com.forgon.tools.string.StringTools; import com.forgon.treenode.model.THTreeNode; @@ -39,6 +44,7 @@ private UserManager userManager; private OrgUnitManager orgUnitManager; private DataSynchronizationManager dataSynchronizationManager; + private LogManager appLogManager; // 使用记录 private UseRecord useRecord = new UseRecord(); @@ -55,6 +61,9 @@ this.dataSynchronizationManager = dataSynchronizationManager; } + public void setAppLogManager(LogManager appLogManager) { + this.appLogManager = appLogManager; + } /** * 根据病人号(一般为住院号)加载病人信息 */ @@ -125,6 +134,39 @@ } } + + /** + * 新增使用记录(用于pda录入使用记录页面) + * 增加并发控制 + */ + public void saveUseRecord() { + JSONObject json = JSONUtil.buildJsonObject(false); + try { + String id = StrutsParamUtils.getPraramValue("id", ""); + //因为struts2版本会对前台传过来日期的时分秒部分截掉,所以手术时间需要单独传,然后解析出来 + String operationTimeStr = StrutsParamUtils.getPraramValue("operationTimeStr", ""); + UseRecord modified = useRecord; + if(StringUtils.isNotBlank(operationTimeStr)){ + try{ + modified.setOperationTime(DateTools.convertTime(operationTimeStr, new SimpleDateFormat(DateTools.COMMON_DATE_HM))); + }catch(Exception e){ + e.printStackTrace(); + } + } + modified = useRecord; + buildUseRecordParamsForSave(modified); + useRecordManager.saveUseRecord_TRANS_REQUIRED(modified); + //记录操作日志 + appLogManager.saveLog(AcegiHelper.getLoginUser(), Log.MODEL_USERECORD, "pda客户端html5新增使用记录", + "id=" + id + ",useRecord=" + useRecord.toString()); + JSONUtil.addSuccess(json, true); + } catch (Exception e) { + e.printStackTrace(); + JSONUtil.addMessage(json, e.getMessage()); + } + StrutsResponseUtils.output(json); + } + // 保存并审核生成申请单 public void saveAndReviewAndConvertUseRecordForm() { // 申请表单的类型:1 : 通用申请单(组合申请单),2:分开的申请单 Index: ssts-web/src/main/webapp/buttjoint/useRecord/useRecord.jsp =================================================================== diff -u -r20686 -r21802 --- ssts-web/src/main/webapp/buttjoint/useRecord/useRecord.jsp (.../useRecord.jsp) (revision 20686) +++ ssts-web/src/main/webapp/buttjoint/useRecord/useRecord.jsp (.../useRecord.jsp) (revision 21802) @@ -33,8 +33,8 @@ - - + + - +