Index: ssts-web/src/main/webapp/disinfectsystem/basedatamanager/tousse/idCardForm.js =================================================================== diff -u -r34233 -r34326 --- ssts-web/src/main/webapp/disinfectsystem/basedatamanager/tousse/idCardForm.js (.../idCardForm.js) (revision 34233) +++ ssts-web/src/main/webapp/disinfectsystem/basedatamanager/tousse/idCardForm.js (.../idCardForm.js) (revision 34326) @@ -191,7 +191,7 @@ {header : '条码',dataIndex : 'barcode',width : 80}, {header : "使用次数",dataIndex : 'useAmount',width : 70}, {header : "状态",dataIndex : 'status',width : 50}, - {header : "打印时间",dataIndex : 'printDate',width : 150}, + {header : "最后打印时间",dataIndex : 'printDate',width : 150}, {header : "第一次回收时间",dataIndex : 'firstRecyclingTime',width : 120}, {id:'tousseInstanceStatusAndTime',header : "器械包状态",dataIndex : 'tousseInstanceStatusAndTime',width : 200,menuDisabled : true} ]); Index: ssts-web/src/main/webapp/disinfectsystem/basedatamanager/tousse/idCardInstanceView.jsp =================================================================== diff -u -r29513 -r34326 --- ssts-web/src/main/webapp/disinfectsystem/basedatamanager/tousse/idCardInstanceView.jsp (.../idCardInstanceView.jsp) (revision 29513) +++ ssts-web/src/main/webapp/disinfectsystem/basedatamanager/tousse/idCardInstanceView.jsp (.../idCardInstanceView.jsp) (revision 34326) @@ -16,44 +16,6 @@ request.setAttribute("foreignDefaultLabelpaper", syscfg.getBarcodePaperType()); %> @@ -63,6 +25,8 @@ + + @@ -87,6 +51,10 @@ 标识牌信息 + @@ -99,18 +67,12 @@
- - - - - - - - - - - + + + + + \
\ No newline at end of file Index: ssts-web/src/main/webapp/disinfectsystem/basedatamanager/tousse/idCardInstanceView.js =================================================================== diff -u -r34320 -r34326 --- ssts-web/src/main/webapp/disinfectsystem/basedatamanager/tousse/idCardInstanceView.js (.../idCardInstanceView.js) (revision 34320) +++ ssts-web/src/main/webapp/disinfectsystem/basedatamanager/tousse/idCardInstanceView.js (.../idCardInstanceView.js) (revision 34326) @@ -1,125 +1,53 @@ var grid; -var currentSelectedTousseName; //物品名称选择下拉框的当前所选中的值 -var barcodes = ''; -var singleScanLabel = '单次扫描'; -var repeatScanLabel = '多次扫描'; -function initQueryValueAndReload() { - $Id('parm_s_sterilizationDate').value = $Id('sterilizationDate').value; //灭菌开始时间 - $Id('parm_s_sterilizationEndDate').value = $Id('sterilizationEndDate').value; //灭菌结束时间 - $Id('parm_s_sterilizerName').value = $Id('sterilizerName').value; //灭菌炉名称 - $Id('parm_s_frequency').value = $Id('frequency').value; //炉次 - $Id('parm_s_tousseGroupName').value = $Id('tousseGroupName').value; //器械包分组 - - //如果当前所选中值与下拉框的值相同时,则采用精确匹配.否则采用模糊匹配 - if (currentSelectedTousseName == Ext.getCmp('tousseName').getRawValue()) { - $Id('parm_s_tousseName').value = Ext.getCmp('tousseName').getRawValue(); - } else { - $Id('parm_s_tousseName').value = ''; - $Id('parm_s_tousseNameFuzzy').value = Ext.getCmp('tousseName').getRawValue(); - } - - - var barcode = $Id('barcodeSearch').value; //条码字符串 - var barcodeReg = /(\d){9}/; - if (barcode.length == 9 && barcodeReg.test(barcode)) { //条码字符串为9数字,扫描码才有意义,否则清空 - if (repeatScanLabel == $Id('scanPattern').value) { //启用多次扫描模式 - if (barcodes) { - barcodes += ';' + barcode; - } else { //启用多次扫描模式的第一次扫描 - barcodes = barcode; - } - } else { - barcodes = ''; - } - } else { - barcode = ''; - barcodes = ''; - } - - $Id('parm_s_barcodeSearch').value = barcode; - $Id('parm_s_barcodes').value = (barcodes.length == 9 ? '' : barcodes); //barcodes长度为9说明用户启用多次扫描模式,并且是第一次扫描 - - Ext.getCmp('barcodeSearch').setValue(''); +function queryTable() { + $Id('parm_s_tousseName').value = Ext.getCmp('tousseName').getRawValue(); + $Id('parm_s_status').value = Ext.getCmp('status').getRawValue() == '全部' ? '' : Ext.getCmp('status').getRawValue(); + $Id('parm_s_firstRecyclingTimeStart').value = Ext.getCmp('firstRecyclingTimeStart').getRawValue(); + $Id('parm_s_firstRecyclingTimeEnd').value = Ext.getCmp('firstRecyclingTimeEnd').getRawValue(); + $Id('parm_s_lostDateStart').value = Ext.getCmp('lostDateStart').getRawValue(); + $Id('parm_s_lostDateEnd').value = Ext.getCmp('lostDateEnd').getRawValue(); grid.getStore().lastOptions.params['start'] = 0; grid.dwrReload(); - } -/** - * 显示申请单终止原因 - */ -function showSelectTousseDiscardCauseWin() { - var params = { - time: new Date().getTime() - } +function printIDCardInstanceObj(idCardInstance) { + var unit = ""; + DWREngine.setAsync(false); + SupplyRoomConfigTableManager.getUnitName(function (unitName) { + if (unitName != null && unitName != "") { + unit = unitName; + } + }); + DWREngine.setAsync(true); + idCardInstance.unit = unit; + idCardInstance.userName = userName; - var endCase = openModalWindowForExt(WWWROOT + "/disinfectsystem/recyclingApplication/selectTousseDiscardCause.jsp", params, "选择废弃原因", "760", "400"); - - return endCase; + printIDCardInstance(idCardInstance); } -function compareDate(DateOne, DateTwo) { - var OneMonth = DateOne.substring(5, DateOne.lastIndexOf("-")); - var OneDay = DateOne.substring(DateOne.length, DateOne.lastIndexOf("-") + 1); - var OneYear = DateOne.substring(0, DateOne.indexOf("-")); - var TwoMonth = DateTwo.substring(5, DateTwo.lastIndexOf("-")); - var TwoDay = DateTwo.substring(DateTwo.length, DateTwo.lastIndexOf("-") + 1); - var TwoYear = DateTwo.substring(0, DateTwo.indexOf("-")); - if (Date.parse(OneMonth + "/" + OneDay + "/" + OneYear) >= Date.parse(TwoMonth + "/" + TwoDay + "/" + TwoYear)) { - return true;//dataone>datetwo - } else { - return false; - } +function printIDCardInstanceByID(idCardInstanceID, idCardDefinitionID) { + DWREngine.setAsync(false); + var params = { idCardInstanceID: idCardInstanceID, tousseDefinitionID: idCardDefinitionID }; + IDCardDefinitionTableManager.rePrintIDCardInstance(JSON.stringify(params), function (jsonStr) { + var result = JSON.parse(jsonStr); + if (!isUndefinedOrNullOrEmpty(result.idCardInstance)) { + printIDCardInstanceObj(result.idCardInstance); + } + }); + DWREngine.setAsync(true); } -//验证器械包预警期、失效期 -function checkDate(v, p, record, rowIndex, columnIndex, store) { - var validUntil = record.data.validUntil; - var warningUntil = record.data.warningUntil; - var date = new Date(); - var currentDate = ""; - currentDate = date.getFullYear() + "-"; - currentDate += (date.getMonth() + 1) + "-"; - currentDate += date.getDate(); - var b = compareDate(myDateFormat(warningUntil, p, record), currentDate);//预警期 - var f = compareDate(myDateFormat(validUntil, p, record), currentDate);//失效期 - var color = ""; - if (!b) { - color = "yellow"; - } - if (!f) { - color = "#FF7575"; - } - if (v != null) { - return "

" + myDateFormat(v) + "

"; - } else { - return ""; - } -} - -function renderCallTousseInstanceInfoShowFun(v, p, record) { - var isComboTousse = (record.data['tousseDefinition.tousseType'] == '聚合包'); - return "" + record.data['showTousseName'] + ""; -} - -function nameAndFrequency(v, p, record) { - var name = record.data['sterilizerName']; - if (name != "" && (v != "" && v != null)) { - return record.data['sterilizerName'] + ",第" + v + "炉"; - } - return ""; -} - Ext.onReady(function () { var columns = new Array(); columns.push( { header: "器械包名称", width: 180, dataIndex: 'tousseName' }, { header: "条码", width: 70, dataIndex: 'barcode' }, { header: "状态", width: 80, dataIndex: 'status' }, { header: "使用次数", width: 80, dataIndex: 'useAmount' }, - { header: "打印时间", width: 150, dataIndex: 'printDate', renderer: myDateFormatBySecond }, - { header: "第一次回收时间", width: 150, dataIndex: 'firstRecyclingTime', renderer: myDateFormatBySecond } + { header: "最后打印时间", width: 150, dataIndex: 'printDate', renderer: myDateFormatBySecond }, + { header: "第一次回收时间", width: 150, dataIndex: 'firstRecyclingTime', renderer: myDateFormatBySecond }, + { header: "丢失时间", width: 150, dataIndex: 'lostDate', renderer: myDateFormatBySecond } ); var readerDetail = [ @@ -129,7 +57,9 @@ { name: 'status' }, { name: 'useAmount' }, { name: 'printDate' }, - { name: 'firstRecyclingTime' } + { name: 'idCardDefinitionID' }, + { name: 'firstRecyclingTime' }, + { name: 'lostDate' } ]; var filters = new Ext.grid.GridFilters({ @@ -141,122 +71,29 @@ { type: 'date', dataIndex: 'firstRecyclingTime' } ] }); - var dt = new Date(); - var v = dt.getMonth() + 1; - if (v < 10) { - v = "0" + v; - } var tbar = [{ - text: '废弃', - iconCls: 'Cancel', - hidden: SSTS_SystemWarning_TousseGoods_delete, + text: '打印标识牌', handler: function () { var selectionModel = grid.getSelectionModel(); - var selections = []; + var selections = selectionModel.getSelections(); if (!selectionModel.hasSelection()) { - showResult("未选中任何记录!"); + showResult('请选择要打印的标识牌!'); return; } else { - selectionModel.each(function (row) { - selections.push(row.data.id); - }); if (selections.length > 0) { - var remark = showSelectTousseDiscardCauseWin(); - - if (remark == undefined) { - return ''; - } else { - var loop = setInterval(function () { - if (remark.hidden) { - clearInterval(loop); - - var returnValue = remark.returnValue || ''; - - if (returnValue == '') { - return ''; - } - - var ids = selections.join(';'); - Ext.Ajax.request({ - url: WWWROOT + '/disinfectSystem/tousseInstanceAction!deleteTousseGood.do', - params: { ids: ids, reason: returnValue }, - success: function (response, options) { - showResult("废弃成功!"); - grid.dwrReload(); - }, - failure: function (response, options) { } - }); - } - }, 500); - } + printIDCardInstanceByID(selections[0].data.id, selections[0].data.idCardDefinitionID); } } } - }, - { - text: '导出', - iconCls: 'btn_ext_download', - handler: function () { - var barcodeSearch = $Id('barcodeSearch').value; - var sterilizationDate = $Id('sterilizationDate').value; - var sterilizationEndDate = $Id('sterilizationEndDate').value; - var sterilizerName = $Id('sterilizerName').value; - var frequency = $Id('frequency').value; - var tousseName = $Id('tousseName').value; - location.href = WWWROOT - + "/disinfectSystem/baseData/tousseDefinitionAction!exportTousseInstanceInfo.do?barcode=" - + barcodeSearch + "&sterilizationDate=" - + sterilizationDate - + "&sterilizationEndDate=" - + sterilizationEndDate + "&sterilizerName=" - + sterilizerName + "&frequency=" - + frequency + "&tousseName=" - + tousseName; - } - }, - { - text: '打印', - // iconCls : 'Cancel', - hidden: SSTS_HistoryPacking_Update, - handler: function () { - var selectionModel = grid.getSelectionModel(); - var selections = []; - if (!selectionModel.hasSelection()) { - showResult("未选中任何记录!"); - return; - } else { - selectionModel.each(function (row) { - selections.push(row.data.id); - }); - if (selections.length > 0) { - var ids = selections.join(','); - Ext.MessageBox.wait('正在请求数据,请稍候……', '请等待'); - Ext.Ajax.request({ - url: WWWROOT + '/disinfectSystem/packingAction!getTousseInstanceByIdsForPrint.do', - params: { ids: ids }, - success: function (response, options) { - // showResult("废弃成功!"); - // grid.dwrReload(); - hideMessageBox(false); - var tousseesToPrint = Ext.decode(response.responseText); - doPrintLabels(tousseesToPrint); - }, - failure: function (response, options) { - hideMessageBox(false); - } - }); - } - } - } }]; grid = new Ext.ux.ForgonPageGrid({ id: 'tousseInstanceGrid', pageSize: 20, renderTo: 'gridDiv', showLoadMask: true, - // tbar : tbar, + tbar: tbar, defaultSortField: 'tousseName', defaultSortDirection: 'ASC', isCheckboxSelectionModel: true, @@ -272,9 +109,177 @@ null ); + var width = 300; + var height = 130; + var labelWidth = 90; + if (fontSize == 15) { + height = 140; + } + + var form = new Ext.Panel({ + title: '标识牌信息列表', + region: 'north', + buttonAlign: 'center', + collapsible: true, + collapseMode: 'mini', + frame: true, + height: height, + items: [{ + layout: 'column', + items: [{ + layout: 'form', + width: width, + labelWidth: labelWidth, + labelAlign: 'right', + items: [{ + xtype: 'combo', + id: 'tousseName', + name: 'tousseName', + fieldLabel: '器械包名称', + queryParam: 'spell', + minChars: 0, + valueField: 'id', + displayField: 'name', + store: new Ext.data.Store({ + proxy: new Ext.data.HttpProxy({ + url: WWWROOT + '/disinfectSystem/baseData/tousseDefinitionAction!searchTousseByTypeArr.do', + method: 'POST' + }), + reader: new Ext.data.JsonReader({ + totalProperty: 'totalCount', + root: 'data' + }, [ + { name: 'id', mapping: 'id' }, + { name: 'name', mapping: 'name' }] + ) + }), + forceSelection: true, + lazyInit: true, + triggerAction: 'all', + hideTrigger: true, + typeAhead: false, + anchor: '95%' + }] + }, { + layout: 'form', + width: width, + labelWidth: labelWidth, + labelAlign: 'right', + items: [{ + xtype: 'combo', + fieldLabel: "标识牌状态", + name: "status", + id: "status", + valueField: 'value', + displayField: 'value', + allowBlank: false, + editable: false, + store: new Ext.data.SimpleStore({ + fields: ['value'], + data: [['全部'], ['使用中'], ['已丢失']] + }), + value: '全部', + forceSelection: true, + mode: 'local', + anchor: '95%', + triggerAction: 'all' + }] + }, { + layout: 'form', + width: width, + labelWidth: fontSize == 12 ? labelWidth : 120, + labelAlign: 'right', + items: [{ + xtype: 'datefieldWithMin', + fieldLabel: '第一次回收时间', + id: 'firstRecyclingTimeStart', + name: 'firstRecyclingTimeStart', + editable: false, + format: 'Y-m-d H:i', + 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', + allowBlank: false, + anchor: '95%' + }] + }, { + layout: 'form', + width: fontSize == 12 ? (width - 60) : (width - 90), + labelWidth: 30, + labelAlign: 'left', + items: [{ + xtype: 'datefieldWithMin', + fieldLabel: '至', + labelSeparator: '', + id: 'firstRecyclingTimeEnd', + name: 'firstRecyclingTimeEnd', + editable: false, + format: 'Y-m-d H:i', + 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', + allowBlank: false, + anchor: '95%' + }] + }] + }, { + layout: 'column', + items: [{ + layout: 'form', + width: width, + labelWidth: labelWidth, + labelAlign: 'right', + items: [{ + xtype: 'datefieldWithMin', + fieldLabel: '丢失时间', + id: 'lostDateStart', + name: 'lostDateStart', + editable: false, + format: 'Y-m-d H:i', + 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', + allowBlank: false, + anchor: '95%' + }] + }, { + layout: 'form', + width: width - 60, + labelWidth: 30, + labelAlign: 'left', + items: [{ + xtype: 'datefieldWithMin', + fieldLabel: '至', + labelSeparator: '', + id: 'lostDateEnd', + name: 'lostDateEnd', + editable: false, + format: 'Y-m-d H:i', + 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', + allowBlank: false, + anchor: '95%' + }] + }] + }], + buttons: [{ + text: '查询', + minWidth: 50, + iconCls: 'icon_search', + handler: function () { + queryTable(); + } + }, { + text: '重置', + minWidth: 50, + iconCls: 'icon_set', + handler: function () { + $Id('tousseName').value = ""; + $Id('status').value = "全部"; + $Id('firstRecyclingTimeStart').value = ""; + $Id('firstRecyclingTimeEnd').value = ""; + $Id('lostDateStart').value = ""; + $Id('lostDateEnd').value = ""; + } + }] + }); + new Ext.Viewport({ layout: 'border', - items: [{ + items: [form, { region: 'center', margins: '0 0 0 0', layout: 'fit',