Index: ssts-web/src/main/webapp/disinfectsystem/interfere/interfereUseRecordView.js =================================================================== diff -u --- ssts-web/src/main/webapp/disinfectsystem/interfere/interfereUseRecordView.js (revision 0) +++ ssts-web/src/main/webapp/disinfectsystem/interfere/interfereUseRecordView.js (revision 17497) @@ -0,0 +1,455 @@ +var entityName = "使用记录"; +var grid; + +function newUseRecord() { + addAndEditUseRecord('', ''); + setTimeout("top.Ext.getCmp('hospitalNum').focus(true)", 500); +} + +// 删除 +function deleteUseRecord(grid) { + var records = grid.getSelectionModel().getSelections(); + if (records.length == 0) { + showResult("请选择要删除的" + entityName + "!"); + return false; + } + var ids = null; + for (var i = 0, len = records.length; i < len; i++) { + if (records[i].data['status'] != '未审核') { + showResult('病人名称为“' + records[i].data['patientName'] + '”的使用记录' + + records[i].data['status'] + '不能删除'); + return false; + } + if (ids == null) { + ids = records[i].data['id']; + } else { + ids = ids + ';' + records[i].data['id']; + } + } + top.Ext.MessageBox.confirm("请确认", "是否确定要删除选中的" + entityName + "信息?", + function (button, text) { + if ("yes" == button) { + Ext.Ajax.request({ + url: WWWROOT + '/disinfectSystem/useRecordAction!deleteUseRecord.do', + params: {ids: ids}, + success: function (response, options) { + var result = Ext.decode(response.responseText); + var success = result.success; + if (true != success) { + MsgTip.msg('提示', result.cause, true, 3); + return; + } else { + MsgTip.msg('提示', '删除成功', true, 3); + grid.dwrReload(); + } + }, + failure: function (response, options) { + var result = Ext.decode(response.responseText); + MsgTip.msg('提示', result.cause, true, 3); + } + }); + } + }); + +} +var mask = null; +function getMask() { + if (!mask) { + mask = new Ext.LoadMask(Ext.getBody(), { + msg: '正在处理打印请求,请稍候...' + }); + } + return mask; +} +//批量审核 +function audit(grid) { + var records = grid.getSelectionModel().getSelections(); + if (records.length == 0) { + showResult("请选择要审核的" + entityName + "!"); + return false; + } + var ids = null; + for (var i = 0, len = records.length; i < len; i++) { + + if (records[i].data['status'] != '已审核' && records[i].data['status'] != '已申请') { + if (ids == null) { + ids = records[i].data['id']; + } else { + ids = ids + ';' + records[i].data['id']; + } + } else { + showResult("所选的记录已经审核,请选择未审核记录!"); + return false; + } + } + + top.Ext.MessageBox.confirm("请确认", "确定要审核所选的使用记录吗?", + function (button, text) { + if ("yes" == button) { + +// var mask = new Ext.LoadMask(Ext.getBody(), +// {msg:'正在处理审核请求,请稍候...'} +// ); + getMask(); + mask.msg = '正在处理审核请求,请稍候...'; + mask.show(); + Ext.Ajax.request({ + url: WWWROOT + '/disinfectSystem/useRecordAction!updateRecordStatus.do', + params: {ids: ids}, + success: function (response, options) { + mask.hide(); + var result = Ext.decode(response.responseText); + if (result.msg.length != 0) { + showResult("所选的记录已经审核,请选择未审核记录!"); + } else { + MsgTip.msg('提示', '审核成功!', true, 3); + grid.dwrReload(); + } + }, + failure: function (response, options) { + mask.hide(); + var result = Ext.decode(response.responseText); + MsgTip.msg('提示', result.cause, true, 3); + } + }); + } + }); + +} + +/** + * (陈家儒改) + * 把"已审核"转成"未审核"的方法 + * + */ +function becomeNotAudited(grid) { + var records = grid.getSelectionModel().getSelections(); + if (records.length == 0) { + showResult("请选择要返回的" + entityName + "!"); + return false; + } + var ids = null; + for (var i = 0, len = records.length; i < len; i++) { + if (records[i].data['status'] != '未审核' && records[i].data['status'] != '已申请') { + if (ids == null) { + ids = records[i].data['id']; + } else { + ids = ids + ';' + records[i].data['id']; + } + } else { + showResult("所选的记录不是已审核状态,请选择已审核的记录!"); + return false; + } + } + + + top.Ext.MessageBox.confirm("请确认", "确定要返回成未审核状态吗?", function (button, text) { + if ("yes" == button) { + +// var mask = new Ext.LoadMask(Ext.getBody(), +// {msg:'正在处理请求,请稍候...'} +// ); + getMask(); + mask.msg = '正在处理请求,请稍候...'; + mask.show(); + Ext.Ajax.request({ + url: WWWROOT + '/disinfectSystem/useRecordAction!updateRecordStatus.do', + params: {ids: ids, type: 'becomeNotAudited'}, + success: function (response, options) { + mask.hide(); + var result = Ext.decode(response.responseText); + if (result.msg.length != 0) { + showResult("所选的记录不是已审核状态,请选择已审核的记录!"); + } else { + MsgTip.msg('提示', '所选的记录已成功返回成未审核状态!', true, 3); + grid.dwrReload(); + } + }, + failure: function (response, options) { + mask.hide(); + var result = Ext.decode(response.responseText); + MsgTip.msg('提示', result.cause, true, 3); + } + }); + } + + }); + +} + +/** + * 修改记录 modifyRecord函数 触发modify函数调用,并传入当前列的值以及record.data对象 页面中需要定义 + * modify(v,data) 函数 + */ +function renderCallModifyFunction(v, p, record) { + var data = record.data; + return "" + v + ""; +} + +function rendererColor(v, p, record) { + var data = record.data; + if (audited == data['status']) { + return "

" + v + ""; + } else if (unAudited == data['status']) { + return "

" + v + ""; + } else { + return v; + } +} +// 生成申请单按钮被点击,选中的单的状态必须是已审核才能转换 +function convertButtonClicked(grid) { + + var records = grid.getSelectionModel().getSelections(); + + if (records.length == 0) { + showResult("请选择要生成申请单的" + entityName + "!"); + return false; + } + var ids = null; + var departMap = new Map(); + for (var i = 0, len = records.length; i < len; i++) { + if (records[i].data['status'] != '已审核') { + showResult('病人名称为“' + records[i].data['patientName'] + + '”的使用记录不能生成申请单,请确认使用记录已审核且未转化成申请单'); + return false; + } + if (ids == null) { + ids = records[i].data['id']; + } else { + ids = ids + ';' + records[i].data['id']; + } + departMap.put(records[i].data['depart'], records[i].data['depart']); + } + + if (departMap.size() > 1) { + top.Ext.MessageBox.alert("请确认", "所选择的使用记录的录入科室不一致,不能转换!"); + return false; + } + var operatorStr = grid.getSelectionModel() + .getSelections()[0].data.operator; + var departStr = grid.getSelectionModel() + .getSelections()[0].data.depart; + var departCodingStr = grid.getSelectionModel() + .getSelections()[0].data.departCoding; + + var confirmMessage = "是否确定要将选中的" + entityName + "信息生成申请单?"; + if (sstsConfig.auditAndConvertUseRecordConfirmMessage) { + confirmMessage = "手术是否已完成,不需要追加器械包?"; + } + top.Ext.MessageBox.confirm("请确认", confirmMessage, + function (button, text) { + if ("yes" == button) { + convertUseRecordToApplication(null, ids, operatorStr, departStr, departCodingStr, null); + } + }); +} + +function convertUseRecordToApplication(button, ids, operatorStr, departStr, departCodingStr, win) { + + if (button != null) { + button.disable(); // 防止重复点击 + } + +// var mask = new Ext.LoadMask(Ext.getBody(), +// {msg:'正在生成申请单,请稍候...'} +// ); + getMask(); + mask.msg = '正在生成申请单,请稍候...'; + mask.show(); + + Ext.Ajax.request({ + url: WWWROOT + + '/disinfectSystem/useRecordAction!createRecyclingApplicationByUseRecords.do', + params: { + ids: ids, + operator: operatorStr, + depart: departStr, + departCoding: departCodingStr, + applicationFormType: sstsConfig.applicationFormType + }, + success: function (response, options) { + mask.hide(); + var result = Ext.decode(response.responseText); + if (result.msg.length != 0) { + showResult(result.msg); + } else { + showResult("申请成功!"); + // 关闭使用记录的窗口,打开单张使用记录进行审核 + if (win != null) { + win.close(); + } + grid.dwrReload(); + } + }, + failure: function (response, options) { + mask.hide(); + if (button != null) { + button.enable(); + } + } + }); + +} + +// 审核并转换按钮被点击 +function auditAndConvertBtnClicked(grid) { + + var records = grid.getSelectionModel().getSelections(); + + if (records.length == 0) { + showResult("请选择要生成申请单的" + entityName + "!"); + return false; + } + var ids = null; + var departMap = new Map(); + for (var i = 0, len = records.length; i < len; i++) { + if (records[i].data['status'] == '已申请') { + showResult('病人名称为“' + records[i].data['patientName'] + + '”的使用记录已经生成申请单,不能重复申请'); + return false; + } + if (ids == null) { + ids = records[i].data['id']; + } else { + ids = ids + ';' + records[i].data['id']; + } + departMap.put(records[i].data['depart'], records[i].data['depart']); + } + + if (departMap.size() > 1) { + top.Ext.MessageBox.alert("请确认", "所选择的使用记录的录入科室不一致,不能转换!"); + return false; + } + + var operatorStr = grid.getSelectionModel() + .getSelections()[0].data.operator; + var departStr = grid.getSelectionModel() + .getSelections()[0].data.depart; + var departCodingStr = grid.getSelectionModel() + .getSelections()[0].data.departCoding; + + var confirmMessage = "是否确定要将选中的" + entityName + "信息生成申请单?"; + if (sstsConfig.auditAndConvertUseRecordConfirmMessage) { + confirmMessage = "手术是否已完成,不需要追加器械包?"; + } + + top.Ext.MessageBox.confirm("请确认", confirmMessage, + function (button, text) { + if ("yes" == button) { + convertUseRecordToApplication(null, ids, operatorStr, departStr, departCodingStr, null); + + } + }); +} + +Ext.onReady(function () { + Ext.QuickTips.init(); + // 记录cookie(3步) + + var columns = [ + {header: "病人", width: 70, dataIndex: 'patientName', renderer: renderCallModifyFunction}, + {header: "状态", width: 50, dataIndex: 'status', renderer: rendererColor}, + {header: "住院号", width: 90, dataIndex: 'hospitalNum', renderer: renderCallModifyFunction}, + {header: "诊疗号", width: 90, dataIndex: 'treatmentNum', renderer: renderCallModifyFunction}, + {header: "年龄", width: 40, dataIndex: 'patientAge'}, + {header: "身份证号码", width: 120, dataIndex: 'patientIDCard'}, + {header: "医生", width: 70, dataIndex: 'doctorName'}, + {header: "手术名称", width: 150, dataIndex: 'operation'}, + {header: "录入人", width: 60, dataIndex: 'operator'}, + {header: "录入科室", width: 80, dataIndex: 'depart'}, + {header: "录入时间", width: 120, dataIndex: 'enteringDate', renderer: myDateFormatByMinute}, + {header: "申请时间", width: 120, dataIndex: 'applicationTime', renderer: myDateFormatByMinute}, + {header: "备注", width: 120, dataIndex: 'remark', id: 'autoWidth'} + ]; + + var filters = new Ext.grid.GridFilters({ + filters: [ + {type: 'string', dataIndex: 'treatmentNum'}, + {type: 'string', dataIndex: 'hospitalNum'}, + {type: 'string', dataIndex: 'patientName'}, + {type: 'numeric', dataIndex: 'patientAge'}, + {type: 'string', dataIndex: 'patientIDCard'}, + {type: 'string', dataIndex: 'doctorName'}, + {type: 'string', dataIndex: 'operation'}, + {type: 'string', dataIndex: 'operator'}, + {type: 'date', dataIndex: 'enteringDate'}, + {type: 'date', dataIndex: 'applicationTime'}, + {type: 'list', dataIndex: 'status', options: [unAudited, audited], phpMode: true}, + {type: 'string', dataIndex: 'remark'}, + {type: 'string', dataIndex: 'depart'} + ] + }); + + var readerDetail = [ + {name: 'id'}, + {name: 'treatmentNum'}, + {name: 'hospitalNum'}, + {name: 'patientName'}, + {name: 'patientAge'}, + {name: 'patientIDCard'}, + {name: 'doctorName'}, + {name: 'operation'}, + {name: 'depart'}, + {name: 'operator'}, + {name: 'enteringDate'}, + {name: 'applicationTime'}, + {name: 'status'}, + {name: 'remark'}, + {name: 'departCoding'} + ]; + + var tbar = [{ + text: '修改', + hidden: SSTS_InterfereUeserRecord_ViewMenu, + iconCls: 'btn_ext_application_edit', + id: 'editTbar', + handler: function () { + var records = grid.getSelectionModel().getSelections(); + if (records.length == 0) { + showResult("请选择需要修改的使用记录信息!"); + return false; + } + if (records.length > 1) { + showResult("一次只能修改一个使用记录信息!"); + return false; + } + var d = records[0]; + addAndEditUseRecord(d.data['id'], d.data['status']); + } + }]; + var dwrCallParams = null; + + Ext.ux.ForgonPageGrid.prototype.getGridParameterMap = function () { + }; + + grid = new Ext.ux.ForgonPageGrid({ + tbar: tbar, + pageSize: 20, + defaultSortField: 'case when statusSequence is null then 0 else statusSequence end', + title: '使用记录列表', + defaultSortDirection: 'ASC,enteringDate DESC', + isCheckboxSelectionModel: true, + rememberSelected: false, + isShowSearchField: true, + columns: columns, + plugins: filters, + autoExpandColumn: 'autoWidth', + renderTo: 'gridDiv', + frame: false + }, + readerDetail, + UseRecordTableManager.findUseRecordTableList, + dwrCallParams // 这个参数只是占位作用 + ); + + var viewport = new Ext.Viewport({ + layout: 'border', + items: [{ + region: 'center', + margins: '0 0 0 0', + layout: 'fit', + items: grid + }] + }); +}); \ No newline at end of file Index: ssts-web/src/main/webapp/disinfectsystem/interfere/interfereUseRecordForm.js =================================================================== diff -u --- ssts-web/src/main/webapp/disinfectsystem/interfere/interfereUseRecordForm.js (revision 0) +++ ssts-web/src/main/webapp/disinfectsystem/interfere/interfereUseRecordForm.js (revision 17497) @@ -0,0 +1,1534 @@ +var id; +var formObj; +var containerWin; +var useRecordOperationRoomAllowBlank = true; + +//巡回护士项的标签 +var circuitNurseLabelName = sstsConfig.circuitNurseLabelName ? sstsConfig.circuitNurseLabelName : '巡回护士'; +/** + * 自动补零的函数 + * @param value + */ +function paddingZero(value, totalLength) { + if (value != null && value.Trim().length > 0) { + var lengthOfZero = value.Trim().length; + for (var i = 0; i < totalLength - lengthOfZero; i++) { + value = '0' + value; + } + } + return value; +} +var sm = new top.Ext.grid.CheckboxSelectionModel({ + singleSelect: false +}); + +//sm属性需要单独定义出来,不能与器械包的共用 +var materialGridSm = new top.Ext.grid.CheckboxSelectionModel({ + singleSelect: false +}); + +var rd = new Ext.data.JsonReader({ + fields: [ + {name: 'id'}, + {name: 'barcode'}, + {name: 'tousseDefinitionName'}, + {name: 'amount'}, + {name: 'batchNo'}, + {name: 'packageType'}, + {name: 'goodsType'}, + {name: 'validUntil'}, + {name: 'showTousseName'}, + {name: 'tousseType'}, + {name: 'foreignTousseApp_id'}, + {name: 'isUrgentForUseRecord'}, + {name: 'includeImplant'}, + {name: 'actualUsed'} + ] +}); + +var tousseInstanceStore = new Ext.data.Store({ + proxy: new Ext.data.HttpProxy({ + url: WWWROOT + '/disinfectSystem/useRecordAction!loadTousseInstaceByUseRecordId.do', + method: 'POST' + }), + reader: rd +}); + +//器械材料数据源 +var materialStore = new Ext.data.Store({ + proxy: new Ext.data.HttpProxy({ + url: WWWROOT + '/disinfectSystem/useRecordAction!loadMaterialGoodsByUseRecordId.do', + method: 'POST' + }), + reader: new Ext.data.JsonReader({ + fields: [ + {name: 'externalCode'}, + {name: 'name'}, + {name: 'amount'}, + {name: 'goodsType'}, + {name: 'materialInvoiceSerialNumber'} + ] + }) +}); + +var userReader = new Ext.data.JsonReader({ + fields: [ + {name: 'id'}, + {name: 'fullName'}, + {name: 'orgUnitName'} + ] +}); + +// 查找某科室的人员的store +var departUsersStore = new Ext.data.Store({ + proxy: new Ext.data.HttpProxy({ + url: WWWROOT + '/systemmanage/user/userAction!loadUsersBySearchString.do', + method: 'POST' + }), + reader: userReader +}); + +var departUsersStore2 = new Ext.data.Store({ + proxy: new Ext.data.HttpProxy({ + url: WWWROOT + '/systemmanage/user/userAction!loadUsersBySearchString.do', + method: 'POST' + }), + reader: userReader +}); + +var addTousseInstance = Ext.data.Record.create([ + {name: 'id'}, + {name: 'barcode'}, + {name: 'tousseDefinitionName'}, + {name: 'packageType'}, + {name: 'validUntil'}, + {name: 'showTousseName'}, + {name: 'amount'}, + {name: 'batchNo'}, + {name: 'includeImplant'} +]); + +var useAmount = 0; +function loadScanGoods() { + var barcode = top.Ext.getCmp('tempBarcode').getValue(); + top.Ext.getCmp('tempBarcode').setValue(''); + if (barcode != '') { + if (checkBarcodeIsExist(barcode)) { + showResult('条码为:' + barcode + '的物品已在当前扫描物品里!'); + top.Ext.getCmp('tempBarcode').setValue(''); + return; + } + Ext.Ajax.request({ + url: WWWROOT + '/disinfectSystem/useRecordAction!loadScanedGoods.do', + params: { + barcode: barcode, + scanedBarcodes: getTousseGridData() + }, + success: function (response, options) { + var result = response.responseText; + if (result != "" && result != "{}") { + var goodsInfo = Ext.util.JSON.decode(result); + + if (!goodsInfo.success || goodsInfo.success != true) { + showResult(goodsInfo.error); + return; + } + if (goodsInfo.tousseType != '一次性物品') { + //检测该器械包有没有被召回 + if ('msg' in goodsInfo) { + showResult(goodsInfo.msg); + return; + } + var validTime = goodsInfo.validUntil; + var currentTime = Ext.util.Format.date(new Date(), + 'Y-m-d'); + if (goodsInfo.status == '已退货') { + showResult('该器械包已退货,不能被使用!'); + return; + } + // 未签收的器械包不能登记使用记录 + if (goodsInfo.status == hadShipped && sstsConfig.notSignedItemsCanRegistUseRecord == false) { + showResult('该器械包未签收,不能被使用!'); + return; + } + if ((goodsInfo.status == hadShipped && sstsConfig.notSignedItemsCanRegistUseRecord != false) || goodsInfo.status == hadSigned) { + if (!compareDate(currentTime, validTime)) { + showResult('该器械包已过期!'); + } /*else if(goodsInfo.locationForDisplay != top.Ext.getCmp('depart').getValue()){ + if(top.Ext.getCmp('depart').getValue() == ''){ + showResult('该器械包不属于本科室!'); + }else{ + showResult('该器械包不属于'+top.Ext.getCmp('depart').getValue()+'!'); + } + }*/ else { + function addTousse() { + var record = new addTousseInstance({ + id: goodsInfo.id, + barcode: goodsInfo.barcode, + amount: 1, + batchNo: '', + tousseDefinitionName: goodsInfo.tousseDefinitionName, + showTousseName: goodsInfo.showTousseName, + packageType: goodsInfo.packageType, + validUntil: validTime, + tousseType: goodsInfo.tousseType, + foreignTousseApp_id: goodsInfo.foreignTousseApp_id, + includeImplant: goodsInfo.includeImplant, + actualUsed: goodsInfo.actualUsed + }); + tousseInstanceStore.insert(0, record); + useAmount++; + top.Ext.getCmp('useAmount').setValue(useAmount); + } + + if (sstsConfig.olderTousseComfirmForUserecord && goodsInfo.older) { + if (confirm(goodsInfo.older.tousseName + "[条码:" + goodsInfo.older.barcode + "]更接近失效期,是否继续?")) { + addTousse(); + } + } else { + addTousse(); + } + } + } else { + if (sstsConfig.notSignedItemsCanRegistUseRecord == false) { + showResult('器械包状态为【' + goodsInfo.status + '】,只能登记已签收并且未被使用的器械包!'); + } + else { + showResult('器械包状态为【' + goodsInfo.status + '】,只能登记已发货并且未被使用的器械包!'); + } + } + //一次性物品 + } else { + var record = new addTousseInstance({ + id: '', + barcode: goodsInfo.barcode, + tousseDefinitionName: '', + amount: 1, + batchNo: goodsInfo.batchNo, + showTousseName: goodsInfo.showTousseName, + packageType: '', + validUntil: goodsInfo.validUntil, + tousseType: goodsInfo.tousseType, + goodsType: goodsInfo.goodsType, + foreignTousseApp_id: '', + includeImplant: '否', + actualUsed: '是' + }); + tousseInstanceStore.add(record); + useAmount++; + top.Ext.getCmp('useAmount').setValue(useAmount); + } + } else { + showResult('找不到该条码的器械包或一次性物品!'); + } + }, + failure: function (response, options) { + showResult('加载出错!请稍候再试。'); + } + }); + } +} + +function showPatientInfo(patientInfo) { + top.Ext.getCmp('patientName').setValue(patientInfo.patientName); + top.Ext.getCmp('patientAge').setValue(patientInfo.patientAge); + top.Ext.getCmp('patientIDCard').setValue(patientInfo.patientIDCard); + if (patientInfo.patientSex == '男') { + top.Ext.getCmp('patientSex').setValue('男'); + } else if (patientInfo.patientSex == '女') { + top.Ext.getCmp('patientSex').setValue('女'); + } else { + top.Ext.getCmp('patientSex').setValue(''); + } + top.Ext.getCmp('bedNumber').setValue(patientInfo.bedNumber); + top.Ext.getCmp('doctorName').setValue(patientInfo.doctorName); + top.Ext.getCmp('operation').setValue(patientInfo.operation); + top.Ext.getCmp('roomNumber').setValue(patientInfo.roomNumber); + top.Ext.getCmp('visitId').setValue(patientInfo.visitId); + top.Ext.getCmp('operationRoom').setValue(patientInfo.opRoomId); + top.Ext.getCmp('remark').setValue(patientInfo.remark); + top.Ext.getCmp('circuitNurse').setValue(patientInfo.circuitNurse); + top.Ext.getCmp('washHandNurse').setValue(patientInfo.washHandNurse); + top.Ext.getCmp('specialInfection').setValue(patientInfo.specialInfection); + if (patientInfo.hospitalNumber) { + top.Ext.getCmp('hospitalNum').setValue(patientInfo.hospitalNumber); + } +} + +// 获取扫描的物品所有条码 +function getTousseGridData() { + var tousseInstanceBarcodes = ""; + for (var i = 0; i < tousseInstanceStore.getCount(); i++) { + var barcode = tousseInstanceStore.getAt(i).get('barcode'); + if (tousseInstanceBarcodes == "") { + tousseInstanceBarcodes = barcode; + } else { + tousseInstanceBarcodes += ("," + barcode); + } + } + top.Ext.getCmp('tousseInstanceBarcodes').setValue(tousseInstanceBarcodes); + return tousseInstanceBarcodes; +} + +// 检测该条码是否已在扫描的物品里 +function checkBarcodeIsExist(currentBarcode) { + var exist = false; + if (currentBarcode == "") + return exist; + for (var i = 0; i < tousseInstanceStore.getCount(); i++) { + var barcode = tousseInstanceStore.getAt(i).get('barcode'); + if (currentBarcode == barcode) { + exist = true; + break; + } + } + return exist; +} + +// 检测器械包当前状态是否为已发货 +function checkTousseInstanceIsHaveShipped(barcodes, id, callBack) { + var pass = true; + Ext.Ajax.request({ + url: WWWROOT + '/disinfectSystem/tousseInstanceAction!checkTousseInstancesStatus.do', + params: { + tousseInstanceBarcodes: barcodes, + useRecordID: id + }, + success: function (response, options) { + var result = Ext.decode(response.responseText); + var success = result.success; + if (false == success) { + showResult('条码为:' + result.barcode + '的' + result.tousseType + '状态必须为' + + hadShipped + '。'); + pass = false; + } + callBack(pass); + }, + failure: function (response, options) { + showResult('检测条码状态出错!请稍候再试。'); + pass = false; + callBack(pass); + } + }); +} + +function removeGridItem(id) { + var rows = top.Ext.getCmp('tousseInstanceGrid').getSelectionModel() + .getSelections();// 返回值为 + if (rows) { + for (var i = 0; i < rows.length; i++) { + tousseInstanceStore.remove(rows[i]); + useAmount--; + top.Ext.getCmp('useAmount').setValue(useAmount); + + } + } +} + +function loadTousseImages(tousseName) { + if (tousseName.indexOf('_') != -1) { + tousseName = tousseName.substring(0, tousseName.lastIndexOf('_')); + } + showTousseImageWin(tousseName); +} + + +function formatDateYear(v, p, record) { + try { + return Ext.util.Format.date(new Date(v.time), 'Y-m-d H:i'); + } catch (e) { + } +} + +function checkForSave() { + var enteringTime = top.Ext.getCmp('enteringTime').getValue(); + if (!formObj.getForm().isValid()) { + showResult('请正确填写表单各值'); + return false; + } + if (!sstsConfig.noInputTreatmentNumOrHospitalNum && top.Ext.getCmp('treatmentNum').getValue() == '' && top.Ext.getCmp('hospitalNum').getValue() == '' && top.Ext.getCmp('patientName').getValue() == '') { + showResult('请输入诊疗号或者住院号或者病人姓名'); + return false; + } + // 获取扫描的物品所有条码 + var barcodes = getTousseGridData(); + if (barcodes != "") { + return true; + } else { + showResult('器械包列表信息不能为空'); + return false; + } + return false; + +} +function submitUseRecordForm(btObj, win, id, createNew) { + var enteringTime = top.Ext.getCmp('enteringTime').getValue(); + btObj.disable(); + if (!formObj.getForm().isValid()) { + showResult('请正确填写表单各值'); + btObj.enable(); + return false; + } + if (!sstsConfig.noInputTreatmentNumOrHospitalNum && top.Ext.getCmp('treatmentNum').getValue() == '' && top.Ext.getCmp('hospitalNum').getValue() == '' && top.Ext.getCmp('patientName').getValue() == '') { + showResult('请输入诊疗号或者住院号或者病人姓名'); + btObj.enable(); + return false; + } + // 获取扫描的物品所有条码 + var barcodes = getTousseGridData(); + if (barcodes == "") { + showResult('器械包列表信息不能为空'); + btObj.enable(); + return false; + } + // 保存时,检测当前所有器械包的状态是否为已发货 + checkTousseInstanceIsHaveShipped(barcodes, id, function callBack(pass) { + if (!pass) { + btObj.enable(); + return false; + } + top.Ext.MessageBox.confirm("请确认", "是否提交" + entityName + "信息?", function (btn) { + if (btn != 'yes') { + btObj.enable(); + return false; + } + if (sstsConfig.saveUseRecordPrompt && !id) { + if (sstsConfig.useRecordAuditMode == 2) { + alert('请点击"审核并生成申请单"按钮,否则无法发送供应室'); + } else { + alert('请点击"审核"和"生成申请单"按钮,否则无法发送供应室'); + } + } + top.Ext.getCmp('depart').enable(); + setFormParams(formObj.form, ['id', 'washHandNurse', 'circuitNurse', 'operationRoom', 'treatmentNum', + 'hospitalNum', 'patientName', 'patientAge', 'patientSex', 'roomNumber', + 'bedNumber', 'patientIDCard', 'doctorName', 'operationName', 'specialInfection', 'remark']); + // 设置表单上的item参数 + setFormItems(tousseInstanceStore); + formObj.form.submit({ + url: WWWROOT + '/disinfectSystem/useRecordAction!saveUseRecord2.do', + method: 'POST', + params: {'useInterfere': true}, + waitMsg: '正在保存数据,请稍候', + waitTitle: '提交表单', + success: function (form, action) { + if (action.result.success) { + showResult('保存成功'); + } + else { + showResult(action.result.message); + } + win.close(); + grid.dwrReload(); + // 如果保存成功,并且点击的是保存并新建按钮,则打开新的登记使用记录窗口 + if (action.result.success && createNew) { + newUseRecord(); + } + }, + failure: function (form, action) { + if (!isUndefinedOrNullOrEmpty(action.result) && !isUndefinedOrNullOrEmpty(action.result.message)) { + showResult(action.result.message); + } + else { + showResult(action.failureType); + } + btObj.enable(); + top.Ext.getCmp('depart').disable(); + } + }); + }); + return true; + }); +} + +// 审核使用记录 +function reviewUseRecordForm(button, win, id) { + + top.Ext.MessageBox.confirm("请确认", "是否审核" + entityName + "信息?", function (btn) { + if (btn == 'yes') { + button.disable(); + formObj.form.submit({ + url: WWWROOT + '/disinfectSystem/useRecordAction!updateRecordStatus.do', + method: 'POST', + params: {ids: id}, + waitMsg: '正在保存数据,请稍候', + waitTitle: '审核表单', + success: function (form, action) { + if (action.result.msg.length != 0) { + showResult(action.result.msg); + } else { + win.close(); + showResult('审核成功'); + grid.dwrReload(); + } + }, + failure: function (form, action) { + button.enable(); + showResult('提交失败,错误信息:' + action.failureType); + } + }); + } else { + return false; + } + }); +} +// 审核并转换使用记录 +function reviewAndConvertUseRecordForm(button, win, id) { + var confirmMessage = "是否审核" + entityName + "信息?"; + if (sstsConfig.auditAndConvertUseRecordConfirmMessage) { + confirmMessage = "手术是否已完成,不需要追加器械包?"; + } + top.Ext.MessageBox.confirm("请确认", confirmMessage, function (btn) { + if (btn == 'yes') { + var operatorStr = top.Ext.getCmp('operator').getValue(); + var departStr = top.Ext.getCmp('depart').getValue(); + var departCodingStr = top.Ext.getCmp('departCoding').getValue(); + + convertUseRecordToApplication(button, id, operatorStr, departStr, departCodingStr, win); + + } else { + return false; + } + }); +} +// 保存审核并转换使用记录 +function saveAndReviewAndConvertUseRecordForm(btObj, win, createNew) { + if (!checkForSave()) { + return false; + } + var enteringTime = top.Ext.getCmp('enteringTime').getValue(); + btObj.disable(); + + var confirmMessage = "是否提交" + entityName + "信息?"; + if (sstsConfig.auditAndConvertUseRecordConfirmMessage) { + confirmMessage = "手术是否已完成,不需要追加器械包?"; + } + top.Ext.MessageBox.confirm("请确认", confirmMessage, function (btn) { + if (btn == 'yes') { + top.Ext.getCmp('depart').enable(); + setFormParams(formObj.form, ['id', 'washHandNurse', 'circuitNurse', 'operationRoom', 'treatmentNum', + 'hospitalNum', 'patientName', 'patientAge', 'patientSex', 'roomNumber', + 'bedNumber', 'patientIDCard', 'doctorName', 'operationName', 'specialInfection', 'remark']); + // 设置表单上的item参数 + setFormItems(tousseInstanceStore); + formObj.form.submit({ + url: WWWROOT + '/disinfectSystem/useRecordAction!saveAndReviewAndConvertUseRecordForm.do', + method: 'POST', + waitMsg: '正在保存数据,请稍候', + waitTitle: '提交表单', + success: function (form, action) { + if (action.result.success) { + if (createNew) { + showResult('保存成功,并新建使用记录'); + } + else { + showResult('保存成功'); + } + } else { + showResult(action.result.errMsg); + } + + win.close(); + grid.dwrReload(); + // 如果保存成功,并且点击的是保存并新建按钮,则打开新的登记使用记录窗口 + if (action.result.success && createNew) { + newUseRecord(); + } + }, + failure: function (form, action) { + if (!isUndefinedOrNullOrEmpty(action.result.errMsg)) { + showResult(action.result.errMsg); + } else { + showResult(action.failureType); + } + top.Ext.getCmp('depart').disable(); + } + }); + } else { + btObj.enable(); + return false; + } + }); + return true; +} + + +function quickRecycing(window, useRecordID, barcodes) { + Ext.Ajax.request({ + url: WWWROOT + '/disinfectSystem/useRecordAction!quickRecycing.do', + params: {id: useRecordID, barcodes: barcodes}, + success: function (response, options) { + var result = Ext.decode(response.responseText); + if (result.success == 'true' || result.success == true) { + showResult('回收成功'); + window.close(); + grid.dwrReload(); + } else { + showResult(result.msg) +// showResult('选中的器械包已被快速回收,请刷新页面并确认。'); + } + + }, failure: function (response, options) { + var result = Ext.decode(response.responseText); + showResult('选中的器械包已被快速回收,请刷新页面并确认。'); + } + }); +} +/** + * 根据条码查找器械包记录,找到了返回记录,没找到,返回null + * @param barcode + * @returns + */ +function getTousseInstanceRecord(barcode, tousseInstanceGrid) { + var store = tousseInstanceGrid.getStore(); + for (var i = 0; i < store.getCount(); ++i) { + var record = store.getAt(i); + if (record.data.barcode == barcode) { + return record; + } + } + return null; +} +function urgentBtnClick(barcode) { + var tousseInstanceGrid = top.Ext.getCmp('tousseInstanceGrid'); + var record = getTousseInstanceRecord(barcode, tousseInstanceGrid); + + if (record == null) { + return; + } + if (record.data.isUrgentForUseRecord == '是') { + record.data.isUrgentForUseRecord = '否'; + } else { + record.data.isUrgentForUseRecord = '是'; + } + + tousseInstanceGrid.getView().refresh(); +} +function actualUsedClick(barcode, value) { + var tousseInstanceGrid = top.Ext.getCmp('tousseInstanceGrid'); + var record = getTousseInstanceRecord(barcode, tousseInstanceGrid); + if (record != null) { + record.data.actualUsed = value; + } +} +/** + * 如果点击添加按钮,则传过来的ID为空 + * + * @param id + * @param status + * 审核状态 + * @return + */ +function addAndEditUseRecord(id, status) { + useRecordOperationRoomAllowBlank = getBoolValueFromJs('sstsConfig.useRecordOperationRoomAllowBlank', true); + tousseInstanceStore.removeAll(); + useAmount = 0; + var tbar; + var saveBtn = { + text: '保存', + handler: function () { + top.Ext.getCmp("audited").setValue(""); + submitUseRecordForm(this, window, id, false); + } + }; + var saveAndNewBtn = { + text: '保存并新建', + handler: function () { + top.Ext.getCmp("audited").setValue(""); + submitUseRecordForm(this, window, id, true); + } + }; + var reviewBtn = { + text: '审核', + handler: function () { + top.Ext.getCmp("audited").setValue("true");// action里则会根据audited的值判断用户是点击申述还是保存按钮,true为审核 + reviewUseRecordForm(this, window, id); + } + }; + var createApplicationBtn = { + text: '生成申请单', + handler: function () { + + var operatorStr = top.Ext.getCmp('operator').getValue(); + var departStr = top.Ext.getCmp('depart').getValue(); + var departCodingStr = top.Ext.getCmp('departCoding').getValue(); + var btn = this; + var confirmMessage = "确定要将本使用记录生成申请单吗?"; + if (sstsConfig.auditAndConvertUseRecordConfirmMessage) { + confirmMessage = "手术是否已完成,不需要追加器械包?"; + } + top.Ext.MessageBox.confirm("请确认", confirmMessage, + function (button, text) { + if ("yes" == button) { + convertUseRecordToApplication(btn, id, operatorStr, departStr, departCodingStr, window); + } + }); + + } + } + var reviewAndConvertBtn = { + text: '审核并生成申请单', + handler: function () { + top.Ext.getCmp("audited").setValue("true");// action里则会根据audited的值判断用户是点击审核还是保存按钮,true为审核 + reviewAndConvertUseRecordForm(this, window, id); + } + }; + var saveAndReviewAndConvertBtn = { + text: '保存并审核生成申请单', + handler: function () { + top.Ext.getCmp("audited").setValue("true");// action里则会根据audited的值判断用户是点击审核还是保存按钮,true为审核 + saveAndReviewAndConvertUseRecordForm(this, window, false); + } + }; + var saveAndReviewAndConvertAndNewBtn = { + text: '保存并审核生成申请单并新建', + handler: function () { + top.Ext.getCmp("audited").setValue("true");// action里则会根据audited的值判断用户是点击审核还是保存按钮,true为审核 + saveAndReviewAndConvertUseRecordForm(this, window, true); + } + } + var fastRecyclingBtn = { + text: '快速回收', + id: 'quickRecycingID', + handler: function () { + var records = top.Ext.getCmp('tousseInstanceGrid').getSelectionModel().getSelections(); + if (records.length == 0) { + showResult('请选择要快速回收的器械包。'); + return false; + } + var barcodes = ""; + for (var i = 0; i < records.length; i++) { + barcodes += records[i].get('barcode') + ";"; + } + var qrButton = top.Ext.getCmp('quickRecycingID'); + qrButton.disable(); + quickRecycing(window, id, barcodes); + + } + + }; + + var cancelBtn = { + text: '取消', + handler: function () { + window.close(); + } + }; + + tousseInstanceStore.on("beforeload", function (thiz, options) { + thiz.baseParams["useRecordId"] = id; + }); + tousseInstanceStore.on("load", function (store, recordArry, options) { + var count = tousseInstanceStore.getCount(); + useAmount = count; + top.Ext.getCmp('useAmount').setValue(useAmount); + // 保存表单上的原始item参数 + setOriginalItems(tousseInstanceStore); + }); + tousseInstanceStore.load(); + //干预模块只有保存和取消按钮 + tbar = [saveBtn, cancelBtn]; + materialStore.on("beforeload", function (thiz, options) { + thiz.baseParams["useRecordId"] = id; + }); + materialStore.on("load", function (store, recordArry, options) { + var count = materialStore.getCount(); + if (count > 0) { + top.Ext.getCmp('tousseInstanceGrid').setHeight(165); + top.Ext.getCmp('materialGridFieldset').show(); + } + }); + materialStore.load(); + var sexArray = [['男'], ['女']]; + + var operationNameStore = new Ext.data.Store({ + proxy: new Ext.data.HttpProxy({ + url: WWWROOT + '/disinfectsystem/basedatamanager/operationOrgAction!findOrgUnitOperationName.do', + method: 'POST' + }), + reader: new Ext.data.JsonReader({ + totalProperty: 'totalCount', + root: 'data' + }, [ + {name: 'id', mapping: 'id'}, + {name: 'operationName', mapping: 'operationName'}] + ) + }); + + var tousseCm = new Ext.grid.ColumnModel([sm, + {id: 'id', dataIndex: 'id', hidden: true}, + {header: "条码", dataIndex: 'barcode', width: 55, menuDisabled: true, renderer: renderTousseInstanceInfoShowFun}, + {header: "name", dataIndex: 'tousseDefinitionName', hidden: true, menuDisabled: true}, + { + header: "名称", + dataIndex: 'showTousseName', + width: 180, + menuDisabled: true, + renderer: renderTousseInstanceNameForUrgent + }, + { + header: '加急', width: 35, + renderer: function (v, p, record, rowIndex, colIndex) { + var imgName = (record.data.isUrgentForUseRecord == '是') ? 'arrow_down' : 'arrow_top'; + var str = "

"; + return str; + }, + menuDisabled: true + }, { + header: "是否真正使用", + dataIndex: 'actualUsed', + width: 70, + menuDisabled: true, + hidden: !sstsConfig.enableActualUsed, + renderer: function (v, p, record, rowIndex, colIndex) { + var str = v; + var id = record.id; + if (record.data.actualUsed == '否') { + str = "是 否"; + } else if (record.data.actualUsed == '是') { + str = "是 否"; + } + return str; + } + }, + { + header: "数量", dataIndex: 'amount', width: 35, menuDisabled: true, editor: new Ext.form.NumberField({ + allowBlank: false, + listeners: { + focus: function (thiz) { + var record = top.Ext.getCmp('tousseInstanceGrid').getSelectionModel().getSelected(); + if (record.data.tousseType == '一次性物品' && record.data.goodsType != '高值耗材') { + thiz.selectText(); + } else if (record.data.tousseType != '一次性物品') { + top.Ext.MessageBox.alert("提示", "不能修改器械包数量!"); + } else if (record.data.goodsType == '高值耗材') { + top.Ext.MessageBox.alert("提示", "不能修改高值耗材数量!"); + } + } + } + }) + }, + {header: "包装类型", dataIndex: 'packageType', width: 60, menuDisabled: true}, + {header: "物品类型", dataIndex: 'goodsType', hidden: true}, + {header: "批次", dataIndex: 'batchNo', width: 60, menuDisabled: true}, + {header: "有效期", dataIndex: 'validUntil', menuDisabled: true, width: 60}, + { + header: "图片", + dataIndex: 'tousseDefinitionName', + menuDisabled: true, + width: 35, + renderer: function (v, p, record) { + if (record.data.tousseType != '一次性物品') { + var str = "
"; + return str; + } + } + }, + { + header: "植入物使用情况", + dataIndex: 'tousseDefinitionName', + menuDisabled: true, + width: 90, + renderer: function (v, p, record) { + var tousseType = record.get("tousseType"); + var includeImplant = record.get("includeImplant"); + var tousseBarcode = record.get("barcode"); + if ("外来器械包" == tousseType || "外来器械拆分小包" == tousseType || "是" == includeImplant) { + var app_id = record.get("foreignTousseApp_id"); + if (app_id == undefined) { + app_id = ""; + } + var str = "
"; + return str; + } + return ""; + } + }, + { + header: '删除操作', id: 'delAction', width: 50, + renderer: function (v, p, record) { + var str = "
"; + return str; + }, + menuDisabled: true, + dataIndex: 'button' + }]); + + //器械材料 + var materialCm = new Ext.grid.ColumnModel([materialGridSm, + {header: "外部编码", dataIndex: 'externalCode', hidden: true, width: 150}, + {header: "名称", dataIndex: 'name', id: 'name', width: 380}, + {header: "数量", dataIndex: 'amount', width: 100}, + {header: "物品类型", dataIndex: 'goodsType', width: 150}, + {header: "器械材料发货单号", dataIndex: 'materialInvoiceSerialNumber', id: 'materialInvoiceSerialNumber', width: 150} + ]); + + var formWidth = 930; + var windowWidth = 930; + var windowHeight = 550; + formObj = new top.Ext.FormPanel({ + id: 'useRecordForm', + frame: true, + labelSeparator: ':', + bodyStyle: 'padding:5px 5px 0px 5px', + labelAlign: 'right', + width: formWidth, +// autoHeight : true, + autoScroll: true, + labelWidth: 80, + items: [{ + xtype: "fieldset", + title: "基础数据", + layout: 'column', + autoHeight: true, + items: [{ + xtype: 'hidden', + name: 'id', + id: 'id' + }, { + xtype: 'hidden', + name: 'items', + id: 'items' + }, { + xtype: 'hidden', + name: 'originalItems', + id: 'originalItems' + }, { + xtype: 'hidden', + name: 'formParams', + id: 'formParams' + }, { + xtype: 'hidden', + name: 'originalFormParams', + id: 'originalFormParams' + }, { + xtype: 'hidden', + name: 'tousseInstanceBarcodes', + id: 'tousseInstanceBarcodes' + }, { + xtype: 'hidden', + name: 'applicationFormType', + id: 'applicationFormType', + value: sstsConfig.applicationFormType + }, { + xtype: 'hidden', + name: 'audited', + id: 'audited' + }, { + xtype: 'hidden', + name: 'departCoding', + id: 'departCoding', + value: $Id("currentOrgUnitCode").value + }, { + layout: 'form', + columnWidth: 0.33, + items: [{ + xtype: 'textfield', + fieldLabel: '住院号', + id: 'hospitalNum', + name: 'hospitalNum', + allowBlank: true, + enableKeyEvents: true, + maxLength: 10, + maxLengthText: '长度超过限制,不能保存!', + listeners: { + render: function (c) { + c.getEl().on('keypress', function (e, thiz) { + if (e.getKey() == 13) { + var jsonStr = "{\"patientNum\":\"" + thiz.value + + "\",\"numType\":\"" + thiz.id + "\",\"sourcePage\":\"" + + sourcePage_useRecord + "\"}"; + loadPatientInfoByValAndType(jsonStr); + + // 如果洗手护士输入框隐藏,则聚焦到巡回护士输入框,否则聚焦到洗手护士输入框 + if (sstsConfig.hideWashHandNurseOfUseRecord == true) { + top.Ext.getCmp('circuitNurse').focus(); + } + else { + top.Ext.getCmp('washHandNurse').focus(); + } + } + }); + } + }, + anchor: '96%' + }] + }, { + layout: 'form', + columnWidth: 0.33, + hidden: sstsConfig.hideTreatmentNumOfUseRecord, + items: [{ + xtype: 'textfield', + fieldLabel: '诊疗号', + id: 'treatmentNum', + name: 'treatmentNum', + allowBlank: true, + maxLength: 10, + maxLengthText: '长度超过限制,不能保存!', + enableKeyEvents: true, + listeners: { + render: function (c) { + c.getEl().on('keypress', function (e, thiz) { + if (e.getKey() == 13) { + var jsonStr = "{\"patientNum\":\"" + thiz.value + + "\",\"numType\":\"" + thiz.id + "\",\"sourcePage\":\"" + + sourcePage_useRecord + "\"}"; + loadPatientInfoByValAndType(jsonStr); + + // 如果洗手护士输入框隐藏,则聚焦到巡回护士输入框,否则聚焦到洗手护士输入框 + if (sstsConfig.hideWashHandNurseOfUseRecord == true) { + top.Ext.getCmp('circuitNurse').focus(); + } + else { + top.Ext.getCmp('washHandNurse').focus(); + } + } + }); + } + }, + anchor: '96%' + }] + }, { + layout: 'form', + columnWidth: 0.33, + hidden: sstsConfig.hideWashHandNurseOfUseRecord, + items: [{ + xtype: 'combo', + fieldLabel: '洗手护士', + id: 'washHandNurse', + name: 'washHandNurse', + hidden: sstsConfig.hideWashHandNurseOfUseRecord, +// disabled : !fillTousseName, + queryParam: 'spell', + minChars: 0, + displayField: 'fullName', + store: departUsersStore, + forceSelection: false, + lazyInit: true, + triggerAction: 'all', + hideTrigger: true, + typeAhead: false, + allowBlank: getBoolValueFromJs('sstsConfig.useRecordWashHandNurseAllowBlank', false), + anchor: '96%', + listeners: { + render: function (c) { + c.getEl().on('keypress', function (e, thiz) { + if (e.getKey() == 13) { + var text = top.Ext.getCmp('washHandNurse').getValue(); + if (isValidBarcode(text)) { + top.Ext.getCmp('washHandNurse').setValue(""); + UserTableManager.getUserObjByBarcode(text, function (responseText) { + if (responseText != null && responseText != "") { + var userName = responseText.split(",")[0]; + top.Ext.getCmp('washHandNurse').setValue(userName); + top.Ext.getCmp('circuitNurse').focus(); + } else { + showResult('找不到该条码所对应的人员信息'); + } + }); + } + else if (isValidStaffNumber(text)) { + UserTableManager.getUserObjByName(text, function (responseText) { + if (responseText != null && responseText != "") { + var userName = responseText.split(",")[0]; + top.Ext.getCmp('washHandNurse').setValue(userName); + top.Ext.getCmp('circuitNurse').focus(); + } else { + showResult('找不到该工号对应的人员信息'); + } + }); + } + else { + top.Ext.getCmp('circuitNurse').focus(); + } + } + }); + c.getEl().on('dblclick', function (e, thiz) { + c.doQuery(c.allQuery, true); + c.expand(); + }); + } + } + }] + }, { + layout: 'form', + columnWidth: 0.33, + items: [{ + xtype: 'combo', + fieldLabel: circuitNurseLabelName, + id: 'circuitNurse', + name: 'circuitNurse', +// disabled : !fillTousseName, + queryParam: 'spell', + minChars: 0, + displayField: 'fullName', + store: departUsersStore2, + forceSelection: false, + lazyInit: true, + triggerAction: 'all', + hideTrigger: true, + typeAhead: false, + allowBlank: getBoolValueFromJs('sstsConfig.useRecordCircuitNurseAllowBlank', false), + anchor: '96%', + listeners: { + render: function (c) { + c.getEl().on('keypress', function (e, thiz) { + if (e.getKey() == 13) { + var text = top.Ext.getCmp('circuitNurse').getValue(); + if (isValidBarcode(text)) { + top.Ext.getCmp('circuitNurse').setValue(""); + UserTableManager.getUserObjByBarcode(text, function (responseText) { + if (responseText != null && responseText != "") { + var userName = responseText.split(",")[0]; + top.Ext.getCmp('circuitNurse').setValue(userName); + top.Ext.getCmp('operationRoom').focus(); + + top.Ext.getCmp("tempBarcode").focus(); + + } else { + showResult('找不到该条码所对应的人员信息'); + } + + }); + } + else if (isValidStaffNumber(text)) { + UserTableManager.getUserObjByName(text, function (responseText) { + if (responseText != null && responseText != "") { + var userName = responseText.split(",")[0]; + top.Ext.getCmp('circuitNurse').setValue(userName); + top.Ext.getCmp('tempBarcode').focus(); + } else { + showResult('找不到该工号对应的人员信息'); + } + }); + } + else { + top.Ext.getCmp('tempBarcode').focus(); + } + } + }); + c.getEl().on('dblclick', function (e, thiz) { + c.doQuery(c.allQuery, true); + c.expand(); + }); + } + } + }] + }, { + layout: 'form', + columnWidth: .33, + items: [{ + xtype: 'textfield', + fieldLabel: '科室', + id: 'depart', + name: 'depart', + disabled: true, + allowBlank: false, + anchor: '96%' + }] + }, { + layout: 'form', + columnWidth: 0.33, + items: [{ + xtype: 'textfield', + fieldLabel: '手术间', + id: 'operationRoom', + name: 'operationRoom', + maxLength: 10, + maxLengthText: '长度超过限制,不能保存!', + allowBlank: useRecordOperationRoomAllowBlank, + anchor: '96%', + listeners: { + render: function (c) { + c.getEl().on('keypress', function (e) { + if (e.getKey() == 13) {// + top.Ext.getCmp("hospitalNum").focus(); + } + }); + } + } + }] + }, { + layout: 'form', + columnWidth: 0.33, + items: [{ + xtype: 'textfield', + fieldLabel: '姓名', + maxLength: '100', + id: 'patientName', + name: 'patientName', + anchor: '96%' + }] + }, { + layout: 'form', + columnWidth: 0.33, + items: [{ + xtype: 'textfield', + fieldLabel: '年龄', + maxLength: '10', + id: 'patientAge', + name: 'patientAge', + //allowDecimals : false, + //allowNegative : false, + anchor: '96%' + }] + }, { + layout: 'form', + columnWidth: .33, + items: [{ + xtype: 'combo', + fieldLabel: '性别', + valueField: 'typeName', + displayField: 'typeName', + id: 'patientSex', + name: 'patientSex', + mode: 'local', + triggerAction: 'all', + forceSelection: true, + editable: false, + store: new Ext.data.SimpleStore({ + fields: ['typeName'], + autoLoad: true, + data: sexArray + }), + anchor: '96%' + }] + }, { + layout: 'form', + columnWidth: 0.33, + hidden: sstsConfig.hideRoomNumber, + items: [{ + xtype: 'textfield', + fieldLabel: '病室', + maxLength: '16', + id: 'roomNumber', + name: 'roomNumber', + anchor: '96%' + }] + }, { + layout: 'form', + columnWidth: 0.33, + items: [{ + xtype: 'textfield', + fieldLabel: '床位', + maxLength: '16', + id: 'bedNumber', + name: 'bedNumber', + anchor: '96%' + }] + }, { + layout: 'form', + columnWidth: 0.33, + items: [{ + xtype: 'textfield', + fieldLabel: '身份证', + maxLength: '18', + id: 'patientIDCard', + name: 'patientIDCard', + allowDecimals: false, + allowNegative: false, + anchor: '96%' + }] + }, { + layout: 'form', + columnWidth: 0.33, + items: [{ + xtype: 'textfield', + fieldLabel: '医生', + maxLength: '16', + id: 'doctorName', + name: 'doctorName', + allowBlank: true, + anchor: '96%' + }] + }, { + layout: 'form', + columnWidth: 0.66, + items: [{ + xtype: 'combo', + fieldLabel: "手术名称", + queryParam: 'spell', + minChars: 0, + valueField: 'operationName', + displayField: 'operationName', + store: operationNameStore, + forceSelection: false, + lazyInit: true, + triggerAction: 'all', + hideTrigger: true, + typeAhead: false, + editable: true, + name: "operation", + id: "operation", + anchor: '98%' + }] + }, { + + layout: 'form', + columnWidth: 0.33, + items: [{ + xtype: 'textfield', + fieldLabel: '住院次数', + id: 'visitId', + name: 'visitId', + allowBlank: true, + anchor: '95%' + }] + }, { + + layout: 'form', + columnWidth: 0.33, + items: [{ + xtype: 'textfield', + fieldLabel: '录入人', + maxLength: '41', + id: 'operator', + name: 'operator', + readOnly: true, + allowBlank: false, + anchor: '96%', + cls: 'fieldReadOnlyNoRemove' + }] + }, { + layout: 'form', + columnWidth: 0.66, + items: [{ + xtype: 'datefieldWithMin', + fieldLabel: '录入时间', + id: 'enteringTime', + name: 'enteringTime', + altFormats: 'Y-m-d|Y-n-j|y-n-j|y-m-j|y-m-d|y-n-d|Y-n-d|Y-m-j|Ymd|Ynj|ynj|ymj|ymd|ynd|Ynd|Ymj|Y/m/d|Y/n/j|y/n/j|y/m/j|y/m/d|y/n/d|Y/n/d|Y/m/j', + format: 'Y-m-d H:i', + readOnly: true, + width: 150 + + +// xtype : 'textfield', +// fieldLabel : '录入时间', +// maxLength : '41', +// id : 'enteringTime', +// name : 'enteringTime', +// readOnly : true, +// allowBlank : false, +// anchor : '96%', +// cls : 'fieldReadOnlyNoRemove' + }] + }, { + layout: 'form', + columnWidth: 0.33, + items: [{ + xtype: 'textfield', + fieldLabel: '审核人', + maxLength: '41', + id: 'reviewer', + name: 'reviewer', + readOnly: true, + allowBlank: true, + anchor: '96%', + cls: 'fieldReadOnlyNoRemove' + }] + }, { + layout: 'form', + columnWidth: 0.33, + items: [{ + xtype: 'textfield', + fieldLabel: '审核时间', + maxLength: '41', + id: 'reviewTime', + name: 'reviewTime', + readOnly: true, + anchor: '96%', + cls: 'fieldReadOnlyNoRemove' + }] + }, { + layout: 'form', + columnWidth: 0.33, + items: [{ + xtype: 'textfield', + fieldLabel: '申请时间', + maxLength: '41', + id: 'applicationTime', + name: 'applicationTime', + readOnly: true, + anchor: '96%', + cls: 'fieldReadOnlyNoRemove' + }] + }, { + layout: 'form', + columnWidth: .33, + items: [{ + xtype: 'combo', + fieldLabel: '特殊感染类型', + valueField: 'specialInfection', + displayField: 'specialInfection', + id: 'specialInfection', + name: 'specialInfection', + mode: 'local', + listWidth: '200', + triggerAction: 'all', + forceSelection: true, + editable: false, + store: new Ext.data.SimpleStore({ + fields: ['specialInfection'], + autoLoad: false, + data: specialInfectionList + }), + anchor: '96%' + }] + }, { + layout: 'form', + columnWidth: 1, + items: [{ + xtype: 'textfield', + fieldLabel: '备注', + id: 'remark', + name: 'remark', + anchor: '97%', + height: 25 + }] + }] + }, { + xtype: "fieldset", + title: "器械包及一次性物品信息", + layout: 'column', + autoHeight: true, + items: [new top.Ext.grid.EditorGridPanel({ + id: 'tousseInstanceGrid', + store: tousseInstanceStore, + cm: tousseCm, + height: 265, + width: 900, + autoHeight: true, + autoExpandColumn: 'delAction', + frame: false, + viewConfig: { + forceFit: true + }, + bodyStyle: 'border:1px solid #afd7af', + selModel: sm, + tbar: [{ + text: '扫描条码:' + }, { + xtype: 'textfield', + fieldLabel: '扫描条码', + id: 'tempBarcode', + name: 'tempBarcode', + width: 200, + anchor: '99%', + enableKeyEvents: true, + listeners: { + render: function (c) { + c.getEl().on('keypress', function (e) { + if (e.getKey() == 13) {// + loadScanGoods(); + } + }); + } + } + }, { + text: '已扫描数量:' + }, { + xtype: 'textfield', + id: 'useAmount', + name: 'useAmount', + cls: 'fieldReadOnlyNoRemove', + width: 70, + value: 0, + anchor: '99%' + }] + })] + }, { + xtype: "fieldset", + id: "materialGridFieldset", + hidden: true, + title: "器械材料信息", + layout: 'column', + autoHeight: true, + items: [new top.Ext.grid.EditorGridPanel({ + id: 'materialGrid', + store: materialStore, + cm: materialCm, + height: 120, + width: 835, + autoHeight: true, + autoExpandColumn: 'materialInvoiceSerialNumber', + frame: false, + viewConfig: { + forceFit: true + }, + bodyStyle: 'border:1px solid #afd7af', + selModel: materialGridSm + })] + }], + buttons: tbar + }); + + + var window = new top.Ext.Window({ + id: 'useRecordApplicationWin', + layout: 'fit', + title: '使用记录', + width: windowWidth, + height: windowHeight, + border: false, + modal: true, + plain: true, + items: [formObj] + }); + + window.show(); + + if (id != '') {// 编辑 + formObj.form.load({ + url: WWWROOT + '/disinfectSystem/useRecordAction!loadUseRecord.do', + method: 'GET', + waitMsg: '正在加载数据,请稍候', + success: function (form, action) { + top.Ext.getCmp('enteringTime').setValue(formatDateYear(action.result.data.enteringDate)); + top.Ext.getCmp('reviewTime').setValue(formatDateYear(action.result.data.reviewTime)); + top.Ext.getCmp('applicationTime').setValue(formatDateYear(action.result.data.applicationTime)); + top.Ext.getCmp('tempBarcode').focus(true); + + // 保存原始数据,只需要保存需要修改的属性 + setOriginalFormParams(form, ['id', 'washHandNurse', 'circuitNurse', 'operationRoom', 'treatmentNum', + 'hospitalNum', 'patientName', 'patientAge', 'patientSex', 'roomNumber', + 'bedNumber', 'patientIDCard', 'doctorName', 'operationName', 'specialInfection', 'remark']); + }, + failure: function (form, action) { + + }, + params: { + id: id + } + }); + } else {// 添加 + top.Ext.getCmp('operator').setValue($Id('userName').value); + top.Ext.getCmp('depart').setValue($Id('currentOrgUnitName').value); +// top.Ext.getCmp('enteringTime').setValue(Ext.util.Format.date(new Date(), 'Y-m-d H:i')); + setStartDate(top.Ext, 'yyyy/MM/dd HH:mm', 'enteringTime'); //(录入时间,取服务器时间 cjr) + } +} + +function renderTousseInstanceInfoShowFun(v, p, record) { + var id = record.data['id']; + var tousseType = record.data['tousseType']; + var tousseDefinitionName = record.data['tousseDefinitionName']; + if (tousseType != '一次性物品') { + var isComboTousse = (tousseType == '聚合包'); + return "" + v + ""; + } else { + return v; + } +} + +function renderTousseInstanceNameForUrgent(v, p, record) { + var isUrgent = record.data['isUrgentForUseRecord']; + var tousseType = record.data['tousseType']; + var tousseDefinitionName = record.data['tousseDefinitionName']; + if (tousseType != '一次性物品' && isUrgent == '是') { + return "
" + v + "
"; + } else { + return v; + } +} Index: ssts-web/src/main/webapp/disinfectsystem/interfere/interfereUseRecordView.jsp =================================================================== diff -u --- ssts-web/src/main/webapp/disinfectsystem/interfere/interfereUseRecordView.jsp (revision 0) +++ ssts-web/src/main/webapp/disinfectsystem/interfere/interfereUseRecordView.jsp (revision 17497) @@ -0,0 +1,115 @@ +<%@page import="java.util.List" %> +<%@page import="com.forgon.systemsetting.service.HttpOptionManager" %> +<%@page import="com.forgon.disinfectsystem.basedatamanager.supplyroomconfig.service.SupplyRoomConfigManager" %> +<%@ page contentType="text/html; charset=UTF-8" %> +<%@ include file="/common/taglibs.jsp" %> +<%@ page + import="com.forgon.disinfectsystem.entity.basedatamanager.toussedefinition.TousseInstance,com.forgon.disinfectsystem.entity.useRecord.UseRecord" %> +<% + String userName = AcegiHelper.getLoginUser().getUserFullName(); + String currentOrgUnitName = AcegiHelper.getLoginUser().getCurrentOrgUnitName(); + String currentOrgUnitCode = AcegiHelper.getLoginUser().getCurrentOrgUnitCode(); + request.setAttribute("userName", userName); + + request.setAttribute("currentOrgUnitName", currentOrgUnitName); + request.setAttribute("currentOrgUnitCode", currentOrgUnitCode); + //拿特殊感染类型数据 + HttpOptionManager httpOptionManager = (HttpOptionManager) SpringBeanManger.getBean("httpOptionManager"); + List specialInfectionList = httpOptionManager.getHttpOptionTextById("specialInfection"); + String tem = "["; + if (specialInfectionList != null && specialInfectionList.size() != 0) { + for (String specialInfection : specialInfectionList) { + tem += "['" + specialInfection + "'],"; + } + tem = tem.substring(0, tem.length() - 1); + } + tem += "]"; + request.setAttribute("specialInfectionList", tem); + + //判断当前科室是否为一级供应室,如果是则parm_s_departCoding的隐藏域不传值 + SupplyRoomConfigManager supplyRoomConfigManager = (SupplyRoomConfigManager) SpringBeanManger.getBean("supplyRoomConfigManager"); + String firstRoomOrgCode = supplyRoomConfigManager.getFirstSupplyRoomConfig().getOrgUnitCoding(); + String parm_s_departCoding = currentOrgUnitCode; + if (currentOrgUnitCode.equals(firstRoomOrgCode)) { + parm_s_departCoding = ""; + } +%> + + + + + 使用记录 + + + <%@ include file="/common/includeExtJsAndCss.jsp" %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + +
+ +
+ + \ No newline at end of file