Index: ssts-web/src/main/webapp/disinfectsystem/sterilizationmanager/sterilizationrecord/proxyDisinfectionView.js =================================================================== diff -u -r32834 -r32844 --- ssts-web/src/main/webapp/disinfectsystem/sterilizationmanager/sterilizationrecord/proxyDisinfectionView.js (.../proxyDisinfectionView.js) (revision 32834) +++ ssts-web/src/main/webapp/disinfectsystem/sterilizationmanager/sterilizationrecord/proxyDisinfectionView.js (.../proxyDisinfectionView.js) (revision 32844) @@ -128,7 +128,6 @@ var id = records[i].data['id']; idsArr.push(id); } - getPrintProxyDisinfectionInfo(idsArr.join(';')); } @@ -614,10 +613,19 @@ Ext.QuickTips.init(); var columns = [ + { header: "流水号", width: 120, dataIndex: 'serialNumber'}, { header: "操作员", width: 120, dataIndex: 'applicant', renderer: modifyRecord }, { header: "申请时间", width: 120, dataIndex: 'applicationTime', renderer: myDateFormatByMinute }, { header: "申请部门", width: 120, dataIndex: 'depart' }, { header: "器械包总数", width: 100, dataIndex: 'totalAmountOfTousses' }, + { header: "是否打印", width: 100, dataIndex: 'printed',renderer:function(v, p, record){ + var printed = record.data.printed; + if(printed == 1){ + return '否'; + }else { + return '是'; + } + } }, { header: "状态", width: 80, dataIndex: 'deliverStatus' }, { header: '查看发货单', align: 'center', renderer: function (v, p, record) { @@ -639,7 +647,9 @@ var readerDetail = [ { name: 'id' }, + { name: 'serialNumber'}, { name: 'applicant' }, + { name: 'printed'}, { name: 'applicationTime' }, { name: 'depart' }, { name: 'totalAmountOfTousses' }, @@ -698,7 +708,6 @@ top.Ext.MessageBox.confirm("请确认", "要打印本申请单吗?",function(btn) { if (btn == 'yes') { printApplication(grid); - grid.dwrReload(); } }); } @@ -772,40 +781,6 @@ }); -//获取代理灭菌单的数据 -function getPrintProxyDisinfectionInfo(ids){ - top.Ext.MessageBox.show({ - title:'请等待', - msg:'打印中……', - width:350, - progress:true, - closable:false - }); - - Ext.Ajax.request({ - url: WWWROOT + '/disinfectSystem/proxyDisinfectionAction!printProxyDisinfection.do', - params: { - ids: ids - }, - success: function (response, options) { - var result = Ext.decode(response.responseText); - if (result.success) { - for(var i=0;i 0) { - top.Ext.getCmp('receiveToussesIDs').setValue(receiveToussesArray.join(',')); - } - if (isExistNotInBasketTousseInstance) { - var r = confirm("有器械包未放入灭菌筐,是否继续?") - if (r != true) { - return false; - } - } - // 结束:判断是否有器械包未入筐 - var confirmMessage = "是否提交" + entityName + "单信息?"; - top.Ext.MessageBox.confirm("请确认", confirmMessage, function (btn) { - if (btn == 'yes') { - var validation = getBasketAndTousseInfo(); - if (validation != null) { - showResult(validation); - return false; - } - - var submitActionUrl = WWWROOT + '/disinfectSystem/proxyDisinfectionAction!saveProxyDisinfection.do'; - form.form.submit({ - url: submitActionUrl, - method: 'POST', - waitMsg: '正在保存数据,请稍候', - waitTitle: '提交表单', - success: function (form, action) { - showResult(action.result.message); - window.close(); - if (pageName == 'packingView') { - var store = Ext4.getCmp("todayHisPackingRecordPanel").getStore(); - store.reload(); - } else if(pageName == 'historyPackingView'){ - recordGrid.dwrReload(); - } else { - grid.dwrReload(); - } - }, - failure: function (form, action) { - if (action.result && action.result.message) { - showResult(action.result.message); - } - } - }); - } - }); + saveProxyDisinfection(form,window,false); } + },{ + id: 'saveBtn2', + text: '保存并打印', + disabled: SSTS_ProxyDisinfection_Update, + handler: function () { + saveProxyDisinfection(form,window,true); + } }, { text: '打印', + hidden:((id || '') == '')?true:false, handler: function () { getPrintProxyDisinfectionInfo(id); } @@ -702,6 +634,92 @@ top.Ext.getCmp('package1').focus(false, 100); } +//保存 +function saveProxyDisinfection(form,window,isPrint){ + if (!form.getForm().isValid()) { + showResult('请正确填写表单各值'); + return false; + } + + var basketName = checkEmptyBasket(); + if (basketName) { + var msg = basketName + "中还未放入任何器械包,是否提交?"; + var r = confirm(msg) + if (r != true) { + return false; + } + } + + // 开始:判断是否有器械包未入筐 + var rootNode = top.Ext.getCmp('proxyDisinfectionTree').getRootNode(); + var isExistNotInBasketTousseInstance = false; + var receiveToussesArray = []; + rootNode.eachChild(function (pNode) { + if (pNode.attributes.type == '器械包') { + isExistNotInBasketTousseInstance = true; + if (pNode.attributes.receiveTousse == true || pNode.attributes.hasReceived == '是') { + receiveToussesArray.push(pNode.attributes.id); + } + } else { + for (var i = 0; i < pNode.childNodes.length; i++) { + if (pNode.childNodes[i].attributes.receiveTousse == true || pNode.childNodes[i].attributes.hasReceived == '是') { + receiveToussesArray.push(pNode.childNodes[i].attributes.id); + } + } + } + }); + if (receiveToussesArray.length > 0) { + top.Ext.getCmp('receiveToussesIDs').setValue(receiveToussesArray.join(',')); + } + if (isExistNotInBasketTousseInstance) { + var r = confirm("有器械包未放入灭菌筐,是否继续?") + if (r != true) { + return false; + } + } + // 结束:判断是否有器械包未入筐 + var confirmMessage = "是否提交" + entityName + "单信息?"; + top.Ext.MessageBox.confirm("请确认", confirmMessage, function (btn) { + if (btn == 'yes') { + var validation = getBasketAndTousseInfo(); + if (validation != null) { + showResult(validation); + return false; + } + + var submitActionUrl = WWWROOT + '/disinfectSystem/proxyDisinfectionAction!saveProxyDisinfection.do'; + form.form.submit({ + url: submitActionUrl, + method: 'POST', + waitMsg: '正在保存数据,请稍候', + waitTitle: '提交表单', + success: function (form, action) { + showResult(action.result.message); + if(action.result.success){ + window.close(); + if (pageName == 'packingView') { + var store = Ext4.getCmp("todayHisPackingRecordPanel").getStore(); + store.reload(); + } else if(pageName == 'historyPackingView'){ + recordGrid.dwrReload(); + } else { + grid.dwrReload(); + } + if(isPrint){ + getPrintProxyDisinfectionInfo(action.result.id); + } + } + }, + failure: function (form, action) { + if (action.result && action.result.message) { + showResult(action.result.message); + } + } + }); + } + }); +} + function loadProxyDisinfection(form, id, isFirstRoomPeople) { DWREngine.setAsync(true); form.form.load({ @@ -716,10 +734,12 @@ if (isFirstRoomPeople) { if ((status != '待发货' && status != '待接收' && status != '部分接收') || editMode == false) { top.Ext.getCmp('saveBtn').disable(); + top.Ext.getCmp('saveBtn2').disable(); } } else { if ((status == '待发货') || editMode == false) { top.Ext.getCmp('saveBtn').disable(); + top.Ext.getCmp('saveBtn2').disable(); } } var rootNode = top.Ext.getCmp('proxyDisinfectionTree').getRootNode();