Index: ssts-web/src/main/webapp/disinfectsystem/packing/packingView.js =================================================================== diff -u -r34225 -r34233 --- ssts-web/src/main/webapp/disinfectsystem/packing/packingView.js (.../packingView.js) (revision 34225) +++ ssts-web/src/main/webapp/disinfectsystem/packing/packingView.js (.../packingView.js) (revision 34233) @@ -58,6 +58,8 @@ var onErrorDamageBtnClick = null; var curSelMaterialName = null; var curSelMaterialId = null; +//显示所有配包注意事项 +var noteGrid; //判断是否ie和ie7 var isIE6OrIE7 = top.Ext4.isIE6 || top.Ext4.isIE7; @@ -191,12 +193,27 @@ function checkedAllNode(checked) { var rootNode = Ext4.getCmp('basketTreeGrid').getRootNode(); + var newChecked = checked; if (rootNode != null) { var count = 0; + var noteData = []; Ext4.each(rootNode.childNodes, function (pNode) { pNode.set('checked', checked); if (checked) { count++ + if(sstsConfig.showTousseNoteOnClickTousse){ + var tousseName = pNode.get('tousseName'); + var note = pNode.get('note'); + var tousseID = pNode.get('tousseID'); + if (!Ext.isEmpty(note) && newChecked) { + noteData.push({ + tousseID:tousseID, + tousseName:tousseName, + note:note, + status:0 + }) + } + } } else { count = 0 } @@ -213,7 +230,11 @@ Ext4.getCmp('sterilingType').disable(); Ext4.getCmp('packageType').disable(); } + if(noteData.length > 0){ + showAllNoteWindow(noteData); + } } + Ext4.getCmp('basketTreeGrid').getView().refresh(); } @@ -225,14 +246,108 @@ pNode.set('checked', checked); if (pNode.childNodes && pNode.childNodes.length > 0) { Ext4.each(pNode.childNodes, function (lastNode) { - lastNode.set('checked', checked) + lastNode.set('checked', checked); }); } }); } Ext4.getCmp('waitPackingTreeGrid').getView().refresh(); } +function checkNoteWin(tousseID){ + removeAndInsertItem(tousseID,1); +} + +function skipNote(tousseID){ + removeAndInsertItem(tousseID,2); +} + +function removeAndInsertItem(tousseID,status){ + var record; + var recordFields = Ext.data.Record.create([ + {name : 'tousseID',mapping : 'tousseID'}, + {name : 'tousseName',mapping : 'tousseName'}, + {name : 'note',mapping : 'note'}, + {name : 'status',mapping : 'status'} + ]); + var index = -1; + var sum = 0; + for(var i = 0;i= 0){ + var rows = noteGrid.getStore().getAt(index); + record = new recordFields({ + tousseID:tousseID, + tousseName:rows.data.tousseName, + note:rows.data.note, + status:status + }); + noteGrid.getStore().remove(rows) + noteGrid.getStore().insert(index, record); + if(status == 1){ + $('#hiddenNote').val(rows.data.note); + previewWangEditor('【'+rows.data.tousseName+'】'); + } + } + if(sum <= 1){ + top.Ext.getCmp('noteWindow').close(); + } +} + +function renderButton(v,p,record){ + return "查看 | 跳过"; +} + +function showAllNoteWindow(data){ + noteGrid = new top.Ext.grid.GridPanel({ + store: new top.Ext.data.Store({ + reader : new top.Ext.data.JsonReader({ + fields : [ + {name : 'tousseID',mapping : 'tousseID'}, + {name : 'tousseName',mapping : 'tousseName'}, + {name : 'note',mapping : 'note'}, + {name : 'status',mapping : 'status'} + ] + }) + }), + columns: [ + {header: "名称", width: 300, dataIndex: 'tousseName',renderer:function(v,p,record){ + if(record.get('status') == 1){ + return v + '(已查看)'; + }else if(record.get('status') == 2){ + return v + '(已跳过)'; + }else { + return v; + } + }}, + {header: "操作", width: 100,renderer:renderButton} + ], + stripeRows: true, + viewConfig: {forceFit: true}, + height : 250 + }); + noteGrid.getStore().loadData(data); + var noteWindow = new top.Ext.Window({ + autoHeight:true, + id:'noteWindow', + title : '配包注意事项', + width : 400, + draggable:true, + modal:true, + closeAction:'close', + closable:false, + items:[noteGrid] + }); + noteWindow.show(); +} + //配包教学视频 function watchVideoModel(objectId) { if (objectId !== '') { @@ -711,6 +826,7 @@ } else { Ext4.getCmp('packageType').enable(); } + showNoteWindow(idCardTaskNode.parentNode); } // 取消选中所有的装配任务,只选中该标识牌的 uncheckAllExceptCurrentIDCardPackingTask(); @@ -3238,37 +3354,33 @@ hideScanIDCardBarcode(); // 只要左边有选中的项,那么隐藏标识牌输入框 } } - function showNoteWindow(node) { + function showNoteWindow(node,hasChecked) { if (!sstsConfig.showTousseNoteOnClickTousse) { return; } - var checked = node.get('checked'); var tousseName = node.get('tousseName'); var note = node.get('note'); - if (!Ext.isEmpty(note) && checked) { - $('#hiddenNote').val(note); - Ext4.MessageBox.confirm("配包注意事项", tousseName + " 含有配包注意事项,是否查看?",function (btn) { - if (btn == 'yes') { - previewWangEditor('【'+tousseName+'】'); - } - }); + if(hasChecked){ + var checked = node.get('checked'); + if (!Ext.isEmpty(note) && checked) { + $('#hiddenNote').val(note); + Ext4.MessageBox.confirm("配包注意事项", tousseName + " 含有配包注意事项,是否查看?",function (btn) { + if (btn == 'yes') { + previewWangEditor('【'+tousseName+'】'); + } + }); + } + }else { + if (!Ext.isEmpty(note)) { + $('#hiddenNote').val(note); + Ext4.MessageBox.confirm("配包注意事项", tousseName + " 含有配包注意事项,是否查看?",function (btn) { + if (btn == 'yes') { + previewWangEditor('【'+tousseName+'】'); + } + }); + } } } - function updateNoteWindow(record) { - if (!sstsConfig.showTousseNoteOnClickTousse) { - return; - } - var note = record.data['note'];//配包注意事项 - var tousseName = record.data['tousseName']; - if (!Ext.isEmpty(note)) { - $('#hiddenNote').val(note); - Ext4.MessageBox.confirm("配包注意事项", tousseName + " 含有配包注意事项,是否查看?",function (btn) { - if (btn == 'yes') { - previewWangEditor('【'+tousseName+'】'); - } - }); - } - } function getSelAmount() { var basketTree = Ext4.getCmp('basketTreeGrid'); var waitPackingTreeGrid = Ext4.getCmp('waitPackingTreeGrid'); @@ -5297,7 +5409,7 @@ var waitPackingTreeGrid = Ext4.getCmp("waitPackingTreeGrid"); root = waitPackingTreeGrid.getRootNode(); } - updateNoteWindow(record); + showNoteWindow(record); loadTousseInfo(tousseName, imageType_tousse, vedioName, td_id, isTraceable, taskId, packedPhotographed); lastSelectTousseName = tousseName; lastSelectimageTypeTousse = imageType_tousse; @@ -5561,7 +5673,7 @@ node.parentNode.set('checked', false); } } - showNoteWindow(node); + showNoteWindow(node,true); resetScanIDCardBarcodeVisibility(node); // 显示丢失报损按钮 showOrHideErrorAndDamageBtn(); @@ -5813,7 +5925,7 @@ node.parentNode.set('checked', false); } } - showNoteWindow(node); + showNoteWindow(node,true); resetScanIDCardBarcodeVisibilityWaitPacking(node); // 显示丢失报损按钮 showOrHideErrorAndDamageBtn();