Index: ssts-web/src/main/webapp/disinfectsystem/invoice/operationReservationView.js =================================================================== diff -u -r17126 -r17132 --- ssts-web/src/main/webapp/disinfectsystem/invoice/operationReservationView.js (.../operationReservationView.js) (revision 17126) +++ ssts-web/src/main/webapp/disinfectsystem/invoice/operationReservationView.js (.../operationReservationView.js) (revision 17132) @@ -32,7 +32,71 @@ {name : 'amount'} ]); -function editOperationReservation(id) { + +function saveOrSubmitForm(id,isCommit){ + var form = top.Ext.getCmp("materialInvoiceForm"); + if (!form.getForm().isValid()) { + showResult('请正确填写表单各值'); + return false; + } + var store = top.Ext.getCmp('operationReservationGrid').getStore(); + if(store.getCount() <= 0){ + showResult('请添加物品项!'); + return false; + } + var jsonArray = new Array(); + for(var i = 0;i < store.getCount();i++){ + var record = store.getAt(i); + jsonArray.push({ + itemId : record.data.itemId, + tousseDefinitionId : record.data.tousseDefinitionId, + name : record.data.name, + amount : record.data.amount + }); + } + + var params = { + id : id, + operationName : top.Ext.getCmp("operationName").getValue(), + operatingRoom : top.Ext.getCmp("operatingRoom").getValue(), + doctors : top.Ext.getCmp("doctors").getValue(), + operationTime : top.Ext.getCmp("operationTime").getRawValue(), + depart : top.Ext.getCmp("depart").getValue(), + departCoding : top.Ext.getCmp("departCoding").getValue(), + settleAccountsDepart : top.Ext.getCmp("depart").getValue(), + settleAccountsDepartCoding : top.Ext.getCmp("departCoding").getValue(), + handleDepart : top.Ext.getCmp("handleDepart").getRawValue(), + handleDepartCoding : top.Ext.getCmp("handleDepartCoding").getValue(), + consoleName : top.Ext.getCmp("consoleName").getValue(), + scheduleId : top.Ext.getCmp("scheduleId").getValue(), + deptName : top.Ext.getCmp("deptName").getValue(), + patientName : top.Ext.getCmp("patientName").getValue(), + hospitalNumber : top.Ext.getCmp("hospitalNumber").getValue(), + remark : top.Ext.getCmp("remark").getValue(), + committedStatus : isCommit, + items : jsonArray + }; + + var operationReservationWindow = top.Ext.getCmp("materialInvoiceWin"); + form.form.submit({ + url : WWWROOT + '/disinfectsystem/operationReservationAction!saveOperationReservation.do', + method : 'POST', + waitMsg : '正在保存数据,请稍候', + waitTitle : '提交表单', + params : {data : JSON.stringify(params)}, + success : function(form, action) { + showResult(action.result.message); + grid.dwrReload(); + operationReservationWindow.close(); + + }, + failure : function(form, action) { + showResult(action.result.message); + } + }); +} + +function editOperationReservation(id,committedStatus) { var useRecordOperationRoomAllowBlank = getBoolValueFromJs('sstsConfig.useRecordOperationRoomAllowBlank',true); var handleDepartStore = new Ext.data.Store({ proxy : new Ext.data.HttpProxy({ @@ -328,6 +392,71 @@ allowBlank : true, anchor : '100%' }] + },{ + columnWidth : .33, + layout : 'form', + labelWidth : 65, + items : [{ + xtype : 'textfield', + fieldLabel : '住院号', + maxLength : '41', + id : 'hospitalNumber', + name : 'hospitalNumber', + allowBlank : true, + anchor : '100%' + }] + },{ + columnWidth : .33, + layout : 'form', + labelWidth : 65, + items : [{ + xtype : 'textfield', + fieldLabel : '病人姓名', + maxLength : '41', + id : 'patientName', + name : 'patientName', + allowBlank : true, + anchor : '100%' + }] + },{ + columnWidth : .33, + layout : 'form', + labelWidth : 65, + items : [{ + xtype : 'textfield', + fieldLabel : '病区', + maxLength : '41', + id : 'deptName', + name : 'deptName', + allowBlank : true, + anchor : '100%' + }] + },{ + columnWidth : .33, + layout : 'form', + labelWidth : 65, + items : [{ + xtype : 'textfield', + fieldLabel : '手术台次', + maxLength : '41', + id : 'consoleName', + name : 'consoleName', + allowBlank : true, + anchor : '100%' + }] + },{ + columnWidth : .33, + layout : 'form', + labelWidth : 65, + items : [{ + xtype : 'textfield', + fieldLabel : '手术编号', + maxLength : '41', + id : 'scheduleId', + name : 'scheduleId', + allowBlank : true, + anchor : '100%' + }] }, { columnWidth : 1, layout : 'form', @@ -485,64 +614,17 @@ } })], buttons : [{ - id : 'btnSave', - text : '保存', + text : '暂存', + hidden : (committedStatus == 1 ? true : false), handler : function() { - - if (!form.getForm().isValid()) { - showResult('请正确填写表单各值'); - return false; - } - var store = top.Ext.getCmp('operationReservationGrid').getStore(); - if(store.getCount() <= 0){ - showResult('请添加物品项!'); - return false; - } - var jsonArray = new Array(); - for(var i = 0;i < store.getCount();i++){ - var record = store.getAt(i); - jsonArray.push({ - itemId : record.data.itemId, - tousseDefinitionId : record.data.tousseDefinitionId, - name : record.data.name, - amount : record.data.amount - }); - } - - var params = { - id : id, - operationName : top.Ext.getCmp("operationName").getValue(), - operatingRoom : top.Ext.getCmp("operatingRoom").getValue(), - doctors : top.Ext.getCmp("doctors").getValue(), - operationTime : top.Ext.getCmp("operationTime").getRawValue(), - depart : top.Ext.getCmp("depart").getValue(), - departCoding : top.Ext.getCmp("departCoding").getValue(), - settleAccountsDepart : top.Ext.getCmp("depart").getValue(), - settleAccountsDepartCoding : top.Ext.getCmp("departCoding").getValue(), - handleDepart : top.Ext.getCmp("handleDepart").getRawValue(), - handleDepartCoding : top.Ext.getCmp("handleDepartCoding").getValue(), - remark : top.Ext.getCmp("remark").getValue(), - items : jsonArray - }; - - form.form.submit({ - url : WWWROOT + '/disinfectsystem/operationReservationAction!saveOperationReservation.do', - method : 'POST', - waitMsg : '正在保存数据,请稍候', - waitTitle : '提交表单', - params : {data : JSON.stringify(params)}, - success : function(form, action) { - showResult(action.result.message); - grid.dwrReload(); - operationReservationWindow.close(); - - }, - failure : function(form, action) { - showResult(action.result.message); - } - }); + saveOrSubmitForm(id,false); } },{ + text : '提交', + handler : function() { + saveOrSubmitForm(id,true); + } + },{ text : '取消', handler : function() { operationReservationWindow.close(); @@ -581,6 +663,11 @@ top.Ext.getCmp("operationTime").setValue(data.operationTime); top.Ext.getCmp("handleDepart").setValue(data.handleDepart); top.Ext.getCmp("handleDepartCoding").setValue(data.handleDepartCoding); + top.Ext.getCmp("consoleName").setValue(data.consoleName); + top.Ext.getCmp("scheduleId").setValue(data.scheduleId); + top.Ext.getCmp("deptName").setValue(data.deptName); + top.Ext.getCmp("patientName").setValue(data.patientName); + top.Ext.getCmp("hospitalNumber").setValue(data.hospitalNumber); top.Ext.getCmp("remark").setValue(data.remark); var tousseItems = data.items; for(var i = 0 ; i < tousseItems.length ; i++){ @@ -635,17 +722,23 @@ } -function editRecord(id){ - editOperationReservation(id); +function editRecord(id,committedStatus){ + editOperationReservation(id,committedStatus); } function modify(v,data){ - editRecord(data['id']); + editRecord(data['id'],data['committedStatus']); } Ext.onReady(function() { Ext.QuickTips.init(); + Ext4.tip.QuickTipManager.init(); + Ext4.apply(Ext4.tip.QuickTipManager.getQuickTip(), { + dismissDelay: 0, + showDelay: 0 + }); + function renderColor(v, p, record){ var status = record.data['deliverStatus']; var color = ""; @@ -657,13 +750,30 @@ return "

" + v + "

"; } + function renderCommittedStatus(v, p, record){ + var color = ""; + var status = '否'; + //器械包申请单状态 + + if(v == true || v == 'true'){ + status = "是"; + }else{ + color = "yellow"; + } + return "

" + status + "

"; + } + var columns = [ {header : "流水号",width : 100,dataIndex : 'serialNumber', renderer : modifyRecord}, {header : "申请科室",width : 120,dataIndex : 'depart'}, {header : "申请人",width : 60,dataIndex : 'applicant'}, {header : "申请时间",width : 120,dataIndex : 'applicationTime', renderer : myDateFormatByMinute}, - {header : "医生",width : 120,dataIndex : 'doctors'}, + {header : "已提交",width : 60,dataIndex : 'committedStatus',renderer : renderCommittedStatus}, + {header : "医生",width : 70,dataIndex : 'doctors'}, {header : "手术间",width : 120,dataIndex : 'operatingRoom'}, + {header : "住院号",width : 100,dataIndex : 'hospitalNumber'}, + {header : "病人姓名",width : 70,dataIndex : 'patientName'}, + {header : "病区",width : 100,dataIndex : 'deptName'}, {header : "手术时间",width : 120,dataIndex : 'operationTime', renderer : myDateFormatByMinute}, {header : "手术编号",width : 120,dataIndex : 'scheduleId', renderer : myDateFormatByMinute}, {header : "手术台次",width : 120,dataIndex : 'consoleName', renderer : myDateFormatByMinute}, @@ -681,8 +791,12 @@ {name : 'doctors'}, {name : 'operatingRoom'}, {name : 'scheduleId'}, + {name : 'hospitalNumber'}, + {name : 'patientName'}, + {name : 'deptName'}, {name : 'consoleName'}, {name : 'deliverStatus'}, + {name : 'committedStatus'}, {name : 'remark'} ]; @@ -694,6 +808,9 @@ {type: 'string', dataIndex: 'doctors'}, {type: 'string', dataIndex: 'operatingRoom'}, {type: 'string', dataIndex: 'deliverStatus'}, + {type: 'string', dataIndex: 'hospitalNumber'}, + {type: 'string', dataIndex: 'patientName'}, + {type: 'string', dataIndex: 'deptName'}, {type: 'string', dataIndex: 'remark'} ]} ); @@ -704,7 +821,7 @@ hidden : SSTS_Invoice_Update, iconCls : 'btn_ext_application_add', handler : function() { - editOperationReservation(""); + editOperationReservation("",0); } }, { text : '删除', @@ -739,6 +856,48 @@ OperationReservationTableManager.findOperationReservationTableList, null ); + + grid.on('mouseover',function(e) {// 添加mouseover事件 + var index = grid.getView().findRowIndex(e.getTarget());// 根据mouse所在的target可以取到列的位置 + if (index !== false) {// 当取到了正确的列时,(因为如果传入的target列没有取到的时候会返回false) + var record = this.getStore().getAt(index); + var recordId = record.get('id'); + var tableContent = record.data['htmlContent']; + if (!tableContent) { + var content = ""; + Ext.Ajax.request({ + url : WWWROOT + '/disinfectsystem/operationReservationAction!getOperationReservationById.do', + params : { + id : recordId + }, + success : function(response, options) { + var invoiceItems = eval(response.responseText); + if (invoiceItems != null) { + for ( var i = 0; i < invoiceItems.length; i++) { + content += " " + + invoiceItems[i].name + + "" + + invoiceItems[i].amount + + ""; + } + } + tableContent = (""); + tableContent += "" + content + "

物品名称

数量


"; + // 重新查找record,有可能之前的已经不存在 + var curRecord = findRecordByNameAndValueFromStore(grid.getStore(),'id',recordId); + if(!isUndefinedOrNull(curRecord)){ + curRecord.set("htmlContent",tableContent); + } + }, + failure : function(response, options) { + } + }); + } else { + var rowEl = Ext4.fly(e.getTarget()); + rowEl.set({'data-qtip' : tableContent,'data-qwidth':420,'data-qtitle':' 发货物品列表:'},false); + } + } + }); var viewport = new Ext.Viewport( { layout : 'border', Index: ssts-web/src/main/webapp/disinfectsystem/invoice/operationReservationView.jsp =================================================================== diff -u -r15490 -r17132 --- ssts-web/src/main/webapp/disinfectsystem/invoice/operationReservationView.jsp (.../operationReservationView.jsp) (revision 15490) +++ ssts-web/src/main/webapp/disinfectsystem/invoice/operationReservationView.jsp (.../operationReservationView.jsp) (revision 17132) @@ -2,6 +2,7 @@ <%@ page contentType="text/html; charset=UTF-8"%> <%@ include file="/common/taglibs.jsp"%> <%@ include file="/common/includeExtJsAndCss.jsp"%> +<%@ include file="/common/includeExtJs4_2.jsp"%> <%@ page import="com.forgon.tools.SpringBeanManger" %> <% String userName = AcegiHelper.getLoginUser().getUserFullName(); Index: ssts-basedata/src/main/java/com/forgon/disinfectsystem/entity/operationreservation/OperationReservation.java =================================================================== diff -u -r17126 -r17132 --- ssts-basedata/src/main/java/com/forgon/disinfectsystem/entity/operationreservation/OperationReservation.java (.../OperationReservation.java) (revision 17126) +++ ssts-basedata/src/main/java/com/forgon/disinfectsystem/entity/operationreservation/OperationReservation.java (.../OperationReservation.java) (revision 17132) @@ -56,6 +56,16 @@ * 科室(病区)名称 */ private String deptName; + + /** + * 病人姓名 + */ + private String patientName; + + /** + * 住院号 + */ + private String hospitalNumber; public String getOperationName() { return operationName; @@ -121,4 +131,20 @@ this.deptName = deptName; } + public String getPatientName() { + return patientName; + } + + public void setPatientName(String patientName) { + this.patientName = patientName; + } + + public String getHospitalNumber() { + return hospitalNumber; + } + + public void setHospitalNumber(String hospitalNumber) { + this.hospitalNumber = hospitalNumber; + } + } Index: ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/operationreservation/action/OperationReservationAction.java =================================================================== diff -u -r15490 -r17132 --- ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/operationreservation/action/OperationReservationAction.java (.../OperationReservationAction.java) (revision 15490) +++ ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/operationreservation/action/OperationReservationAction.java (.../OperationReservationAction.java) (revision 17132) @@ -2,6 +2,7 @@ import java.io.IOException; import java.io.PrintWriter; +import java.util.List; import javax.servlet.http.HttpServletResponse; @@ -14,13 +15,12 @@ import org.apache.struts2.convention.annotation.ParentPackage; import com.forgon.Constants; -import com.forgon.disinfectsystem.entity.basedatamanager.operationNameManager.OperationName; -import com.forgon.disinfectsystem.entity.basedatamanager.operationNameManager.OperationUseTousseItem; import com.forgon.disinfectsystem.entity.invoicemanager.InvoicePlan; import com.forgon.disinfectsystem.entity.operationreservation.OperationReservation; import com.forgon.disinfectsystem.entity.tousseitem.TousseItem; import com.forgon.disinfectsystem.operationreservation.service.OperationReservationManager; import com.forgon.tools.StrutsParamUtils; +import com.forgon.tools.StrutsResponseUtils; import com.forgon.tools.json.JSONUtil; import com.opensymphony.xwork2.Preparable; @@ -152,6 +152,13 @@ obj.put("departCoding", po.getDepartCoding()); obj.put("handleDepart", po.getHandleDepart()); obj.put("handleDepartCoding", po.getHandleDepartCoding()); + + obj.put("consoleName", po.getConsoleName()); + obj.put("scheduleId", po.getScheduleId()); + obj.put("deptName", po.getDeptName()); + obj.put("patientName", po.getPatientName()); + obj.put("hospitalNumber", po.getHospitalNumber()); + obj.put("remark", po.getRemark()); obj.put("items", items); @@ -163,6 +170,25 @@ responseMsg(obj.toString()); } + public void getOperationReservationById() { + String id = StrutsParamUtils.getPraramValue("id", ""); + JSONArray array = new JSONArray(); + if (StringUtils.isNotBlank(id)) { + OperationReservation opr = operationReservationManager.get(id); + if (opr != null) { + List tousseInstances = opr.getApplicationItems(); + for (TousseItem tousseItem : tousseInstances) { + JSONObject json = new JSONObject(); + json.put("name", tousseItem.getTousseName()); + json.put("amount", tousseItem.getAmount()); + array.add(json); + } + } + + } + StrutsResponseUtils.output(array); + } + @Override public void prepare() throws Exception { Index: ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/operationreservation/service/OperationReservationManagerImpl.java =================================================================== diff -u -r17029 -r17132 --- ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/operationreservation/service/OperationReservationManagerImpl.java (.../OperationReservationManagerImpl.java) (revision 17029) +++ ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/operationreservation/service/OperationReservationManagerImpl.java (.../OperationReservationManagerImpl.java) (revision 17132) @@ -26,6 +26,7 @@ import com.forgon.tools.GB2WB; import com.forgon.tools.db.DatabaseUtil; import com.forgon.tools.hibernate.BasePoManagerImpl; +import com.forgon.tools.json.JSONUtil; import com.forgon.tools.string.StringTools; import com.forgon.tools.util.ForgonDateUtils; @@ -94,6 +95,12 @@ throw new RuntimeException("处理科室不能为空!"); } + String consoleName = data.optString("consoleName"); + String scheduleId = data.optString("scheduleId"); + String deptName = data.optString("deptName"); + String patientName = data.optString("patientName"); + String hospitalNumber = data.optString("hospitalNumber"); + String remark = data.optString("remark"); OperationReservation operationReservation = null; @@ -131,9 +138,19 @@ } operationReservation.setApplicant(AcegiHelper.getLoginUserFullName()); operationReservation.setSubmitTime(new Date()); - operationReservation.setCommittedStatus(true); + + boolean committedStatus = data.optBoolean("committedStatus"); + operationReservation.setCommittedStatus(committedStatus); + operationReservation.setHandleDepart(handleDepart); operationReservation.setHandleDepartCoding(handleDepartCoding); + + operationReservation.setConsoleName(consoleName); + operationReservation.setScheduleId(scheduleId); + operationReservation.setDeptName(deptName); + operationReservation.setPatientName(patientName); + operationReservation.setHospitalNumber(hospitalNumber); + operationReservation.setRemark(remark); operationReservation.setSpelling(GB2Alpha.string2Alpha(depart)); operationReservation.setWbCode(GB2WB.getWBCode(depart));