Index: ssts-web/src/main/webapp/disinfectsystem/packing/packingView.js =================================================================== diff -u -r38257 -r38294 --- ssts-web/src/main/webapp/disinfectsystem/packing/packingView.js (.../packingView.js) (revision 38257) +++ ssts-web/src/main/webapp/disinfectsystem/packing/packingView.js (.../packingView.js) (revision 38294) @@ -466,6 +466,341 @@ }); } +//ZSWY-231:删除物品列表 +function removeTaskRecord(id){ + var goodsList = top.Ext.getCmp('goodsListGrid').getStore(); + for(var i=0;i"+ v +""; + }}, + {header : "申请科室",width : 80,dataIndex : 'department',menuDisabled:true}, + {id : 'autoWidth',header:'操作',dataIndex:'button',width:40,menuDisabled:true, + renderer: function(v,p,record){ + var packingTaskId = record.data.packingTaskId; + var str = ""; + return str; + } + } + ]); + + var deleteCauseStore = new Ext.data.Store({ + proxy: new Ext.data.HttpProxy({ + url : WWWROOT + '/disinfectSystem/core/httpOptionAction!getHttpOptionTextAndValueById.do?optionId=causeOfdeletePackingTask', + method: 'POST' + }), + reader: new Ext.data.JsonReader({ + fields: [ + {name : 'id',mapping : 'id'}, + {name : 'name',mapping : 'name'} + ] + }), + listeners : { + load : function(thiz, records, options){ + deleteCauseStore.insert(records.length, new deleteCauseItems({ 'id': '', 'name': '其他' })); + } + } + }); + + var form = new top.Ext.FormPanel({ + id : 'taskRecordForm', + frame : true, + border : 0, + labelSeparator : ':', + bodyStyle : 'padding:5px 5px 0px 5px', + width : 600, + labelAlign:'right', + autoHeight : true, + autoScroll : true, + items : [{ + xtype:"fieldset", + layout:'column', + title :'基础数据', + autoHeight:true, + items:[{ + layout : 'column', + items : [{ + xtype : 'hidden', + name : 'id', + id : 'id' + },{ + columnWidth : 1, + layout : 'form', + labelWidth : 70, + items : [{ + xtype : 'textfield', + fieldLabel : '操作员', + maxLength : '16', + id : 'user', + name : 'user', + allowBlank : false, + anchor : '100%', + readOnly : true, + value:userName, + cls:'fieldReadOnlyNoRemove' + }] + },{ + columnWidth : 1, + layout : 'form', + labelWidth : 70, + items:[{ + xtype : 'combo', + fieldLabel : '终止原因', + id : 'deleteCause', + name : 'deleteCause', + minChars : 0, + valueField : 'id', + displayField : 'name', + store : deleteCauseStore, + forceSelection : true, + lazyInit : true, + triggerAction : 'all', + hideTrigger : false, + typeAhead : false, + allowBlank : true, + editable:false, + anchor : '97%', + listeners : { + select : function(combo, record, index) { + if(record.data.name == '其他'){ + top.Ext.getCmp('orderCauseBox').show(); + }else { + top.Ext.getCmp('orderCauseBox').hide(); + } + } + } + }] + },{ + columnWidth : 1, + layout : 'form', + labelWidth : 70, + id:'orderCauseBox', + hidden:true, + items : [{ + xtype : 'textarea', + height : 45, + fieldLabel : '', + labelSeparator: '', + id : 'orderCause', + name : 'orderCause', + width:400, + allowBlank : true, + anchor : '100%' + }] + }] + }] + },{ + xtype:"fieldset", + layout:'column', + title :'物品列表', + autoHeight:true, + items:[{ + layout : 'form', + columnWidth : 1, + items :[new top.Ext.grid.EditorGridPanel({ + id : 'goodsListGrid', + store : goodsListStore, + bodyStyle : 'border:1px solid #afd7af', + cm : cm, + width :620, + height : 220, + viewConfig: { + forceFit:true + }, + autoExpandColumn : 'autoWidth', + border : true, + frame : false, + clicksToEdit : 1,// 设置点击几次才可编辑 + selModel : new top.Ext.grid.RowSelectionModel({ + singleSelect : false + }), + listeners:{ + beforeedit : function(e){ + tempAmount = e.record.data['oldAmount']; + }, + afteredit : function(e) { + if(e.value<1){ + showResult("输入数量不能小于1!" , null , sstsConfig.messagePauseTimeOnPackingPage); + e.record.set('amount',1); + return; + } + + //输入的数量不能小于已补充的数量 + if(e.value > tempAmount){ + showResult("终止数量不可大于待装配数量" , null , sstsConfig.messagePauseTimeOnPackingPage); + e.record.set('amount',tempAmount); + return; + } + } + } + })] + }] + }], + buttonAlign :'center', + buttons : [{ + text : '保存', + id : 'saveBtn', + hidden:false, + handler : function(){ + top.Ext.MessageBox.confirm("请确认","终止待装配数量将导致相应的发货物品数量减少,是否继续?",function(btn) { + if(btn=='yes') { + batchUpdatePackingTask(win); + } + }); + } + },{ + text : '取消', + handler : function() { + win.close(); + } + }] + }); + + var win = new top.Ext.Window({ + id : 'deleteTaskWin', + layout : 'fit', + title : '装配终止操作', + width : 680, + modal : true, + autoHeight : true, + closeAction:'close', + border : false, + height:380, + plain : true, + items : [ form ] + }); + win.show(); +} + +//ZSWY-231:装配终止 +function batchUpdatePackingTask(win){ + var deleteCause = top.Ext.getCmp('deleteCause').getRawValue(); + if(deleteCause == '其他'){ + deleteCause = top.Ext.getCmp('orderCause').getRawValue(); + } + var deleteInfo = []; + var goodsList = top.Ext.getCmp('goodsListGrid').getStore(); + for(var i=0;i"; + if(sstsConfig.enableReduceSendAmountAfterTerminatePackAmountFunction){ + var basketName = record.get('basketName'); + var department = record.get('department'); + str += ""; + }else { + str += ""; + } } } if (status == '待装配') { @@ -3676,7 +4017,7 @@ } }, "-", { text: '删除', - hidden: SSTS_PackingTask_Delete, + hidden: sstsConfig.enableReduceSendAmountAfterTerminatePackAmountFunction ? true : SSTS_PackingTask_Delete, iconCls: 'btn_ext_application_del', handler: function () { var waitPackingTreeGrid = Ext4.getCmp('waitPackingTreeGrid'); @@ -3705,6 +4046,38 @@ }); deletePackingTask(ids, null, null, true, null); } + }, { + text: '终止', + iconCls: 'btn_ext_pause', + hidden: !sstsConfig.enableReduceSendAmountAfterTerminatePackAmountFunction, + handler: function () { + var waitPackingTreeGrid = Ext4.getCmp('waitPackingTreeGrid'); + var selNodes = waitPackingTreeGrid.getView().getChecked(); + if (selNodes.length == 0) { + showMultipleResult('请先选择需要终止的待装配任务'); + return; + } + var arr = []; + Ext4.each(selNodes, function (pNode) { + if (pNode.childNodes.length == 0) { + var notLossReport = false; + var damages = pNode.data.damages; + var errors = pNode.data.errors; + if(damages.length > 0 || errors.length > 0){ + notLossReport = true; + } + arr.push({ + tousseName:pNode.data.tousseName, + amount:pNode.data.amount, + basketName:pNode.data.basketName, + department:pNode.data.department, + packingTaskId:pNode.data.taskId, + notLossReport:notLossReport + }) + } + }); + deleteTaskRecord(arr); + } }, "-", { xtype: 'triggerfield', id: 'tousseOrDepart',