Index: ssts-diposablegoods/src/main/java/com/forgon/disinfectsystem/diposablegoods/service/DiposableGoodsManagerImpl.java =================================================================== diff -u -r14454 -r14526 --- ssts-diposablegoods/src/main/java/com/forgon/disinfectsystem/diposablegoods/service/DiposableGoodsManagerImpl.java (.../DiposableGoodsManagerImpl.java) (revision 14454) +++ ssts-diposablegoods/src/main/java/com/forgon/disinfectsystem/diposablegoods/service/DiposableGoodsManagerImpl.java (.../DiposableGoodsManagerImpl.java) (revision 14526) @@ -275,13 +275,13 @@ } setUpdatingProperties(curDisposableGoods, disposableGoods); saveOrUpdate(curDisposableGoods); - if(!StringUtils.equals(originalGoodsType, goodsType)){ - if(DisposableGoods.TYPE_DIPOSABLEGOODS.equals(originalGoodsType)){ - changeGoodsToExpensiveDiposablegoods_internal(curDisposableGoods); - }else if(DisposableGoods.TYPE_EXPENSIVEDIPOSABLEGOODS.equals(originalGoodsType)){ - changeExpensiveDiposablegoodsToGoods_internal(curDisposableGoods); - } - } +// if(!StringUtils.equals(originalGoodsType, goodsType)){ +// if(DisposableGoods.TYPE_DIPOSABLEGOODS.equals(originalGoodsType)){ +// changeGoodsToExpensiveDiposablegoods_internal(curDisposableGoods); +// }else if(DisposableGoods.TYPE_EXPENSIVEDIPOSABLEGOODS.equals(originalGoodsType)){ +// changeExpensiveDiposablegoodsToGoods_internal(curDisposableGoods); +// } +// } if(!StringUtils.isBlank(oldName) || !StringUtils.isBlank(newName)){ nameChanged = !StringUtils.equals(oldName, newName); } Index: ssts-web/src/main/webapp/disinfectsystem/assestManagement/disposableGoods/interfere/diposableGoodsView.js =================================================================== diff -u --- ssts-web/src/main/webapp/disinfectsystem/assestManagement/disposableGoods/interfere/diposableGoodsView.js (revision 0) +++ ssts-web/src/main/webapp/disinfectsystem/assestManagement/disposableGoods/interfere/diposableGoodsView.js (revision 14526) @@ -0,0 +1,1104 @@ +var entityName = "一次性物品"; +var grid; +var root; +var formObj; +var formWindow; +var autoFillExternalCodeOfDisposableGoods = false; +function addDiposableGoods(id) { + autoFillExternalCodeOfDisposableGoods = getBoolValueFromJs('sstsConfig.autoFillExternalCodeOfDisposableGoods',autoFillExternalCodeOfDisposableGoods); + var dType = document.getElementById("parm_s_type").value; + var diposableGooodsStore = new Ext.data.SimpleStore({ + fields : [ 'typeName' ], + url : WWWROOT + '/disinfectSystem/diposableGoodsAction!getDiposableGoodsType.do' + }); + + //能否作为器械包材料 + var isPartOfTousseMaterialStore = new Ext.data.SimpleStore( { + fields : [ 'value'], + data : [[CONSTANT_YES],[CONSTANT_NO]] + }); + var goodsTypeStore = new Ext.data.SimpleStore( { + fields : [ 'value'], + data : [['普通物品'],['高值耗材']] + }); + + //能否被科室申请 + var isApplicationMaterialStore = new Ext.data.SimpleStore( { + fields : [ 'value'], + data : [[CONSTANT_YES],[CONSTANT_NO]] + }); + + //是否供应室物品 + var yesNoStore = new Ext.data.SimpleStore( { + fields : [ 'value'], + data : [[STR_YES],[STR_NO]] + }); + + var godownEntryItemStore = new top.Ext.data.Store({ + proxy : new top.Ext.data.HttpProxy({ + url : WWWROOT + '/disinfectSystem/diposableGoodsAction!loadDisposableGoodsBatchesByDisposableGoodsID.do?id=' + id, + method : 'POST' + }), + reader : new top.Ext.data.JsonReader({ + fields : [ + {name : 'id'}, + {name : 'barcode'}, + {name : 'storage'}, + {name : 'batchNumber'}, + {name : 'cost'}, + {name : 'expDate'}, + {name : 'supplierName'} + ] + }) + }); + + + var selectModel = new top.Ext.grid.CheckboxSelectionModel(); + formObj = new top.Ext.FormPanel( { + id : 'diposableGoodsForm', + frame : true, + labelAlign:'right', + labelSeparator : ':', + bodyStyle : 'padding:5px 5px 0px 5px', + autoHeight : true, + autoScroll : true, + items:[{ + layout : 'column', + items : [{ + columnWidth : 0.4, + layout : 'form', + labelWidth : 70, + items : [{ + xtype : 'hidden', + name : 'id', + id : 'id' + },{ + xtype : 'hidden', + name : 'originalFormParams', + id : 'originalFormParams' + },{ + xtype : 'hidden', + name : 'originalGoodsType', + id : 'originalGoodsType' + },{ + xtype : 'hidden', + name : 'orginalName', + id : 'orginalName' + },{ + xtype : 'hidden', + name : 'orginalSpecification', + id : 'orginalSpecification' + },{ + xtype : 'hidden', + name : 'items', + id : 'items' + },{ + columnWidth : 1, + layout : 'form', + labelWidth : 110, + items : [{ + xtype : 'textfield', + fieldLabel : '名称', + maxLength : '41', + id : 'name', + name : 'name', + allowBlank : false, + anchor : '95%', + listeners:{ + change:function(field,nV,oV){ + var value = nV.trim(); + field.setValue(value); + } + } + }] + },{ + columnWidth : 1, + layout : 'form', + labelWidth : 110, + items : [{ + xtype : 'textfield', + fieldLabel : '规格', + maxLength : '41', + id : 'specification', + name : 'specification', + allowBlank : true, + anchor : '95%' + }] + },{ + columnWidth : 1, + layout : 'form', + labelWidth : 110, + items : [{ + xtype : 'textfield', + fieldLabel : '单位转换调整系数', + maxLength : '41', + id : 'unitConvertCoefficient', + name : 'unitConvertCoefficient', + allowBlank : true, + anchor : '95%' + }] + },{ + columnWidth : 1, + layout : 'form', + labelWidth : 110, + items : [{ + xtype : 'textfield', + fieldLabel : '包装规格', + maxLength : '41', + id : 'packageSpec', + name : 'packageSpec', + allowBlank : true, + anchor : '95%' + }] + },{ + columnWidth : 1, + layout : 'form', + labelWidth : 110, + items : [{ + xtype : 'combo', + fieldLabel : "类型", + valueField : 'typeName', + displayField : 'typeName', + store : diposableGooodsStore, + forceSelection : true, + editable : false, + triggerAction : 'all', + name : "type", + id : "type", + value : dType, + anchor : '95%', + listeners : { + select : function(combo , record , index){ + // 如果类型不为空,并且配置为自动增加外部编码,那么获取下一个编码,并且填上 + if(!isUndefinedOrNullOrEmpty(combo.value) && autoFillExternalCodeOfDisposableGoods){ + DiposableGoodsTableManager.getNextExternalCodeOfDisposableGoods(combo.value,function(externalCode){ + if(!isUndefinedOrNullOrEmpty(externalCode)){ + top.Ext.getCmp("externalCode").setValue(externalCode); + } + }); + } + } + } + }] + },{ + columnWidth : 1, + layout : 'form', + labelWidth : 110, + items : [{ + xtype : 'combo', + fieldLabel : "物品类型", + valueField : 'value', + displayField : 'value', + store : goodsTypeStore, + forceSelection : true, + allowBlank : false, + mode : 'local', + triggerAction : 'all', + name : "goodsType", + id : "goodsType", + anchor : '95%' + }] + },{ + columnWidth : 1, + layout : 'form', + labelWidth : 110, + items : [{ + xtype : 'combo', + fieldLabel : "类别", + valueField : 'name', + displayField : 'name', + store : new Ext.data.SimpleStore({ + data:[['一类'],['二类'],['三类']], + fields:['name'] + }), + mode : 'local', + forceSelection : true, + editable : false, + triggerAction : 'all', + name : "grade", + id : "grade", + anchor : '95%' + }] + },{ + columnWidth : 1, + layout : 'form', + labelWidth : 110, + items : [{ + xtype : 'combo', + fieldLabel : "能否配包", + valueField : 'value', + displayField : 'value', + store : isPartOfTousseMaterialStore, + forceSelection : true, + allowBlank : false, + mode : 'local', + triggerAction : 'all', + name : "isPartOfTousseMaterial", + id : "isPartOfTousseMaterial", + anchor : '95%' + }] + }, { + columnWidth : 1, + layout : 'form', + labelWidth : 110, + items : [{ + xtype : 'combo', + fieldLabel : '能否申请', + valueField : 'value', + displayField : 'value', + store : isApplicationMaterialStore, + forceSelection : true, + allowBlank : false, + mode : 'local', + triggerAction : 'all', + name : "isApplicationMaterial", + id : "isApplicationMaterial", + anchor : '95%' + }] + },{ + columnWidth : 1, + layout : 'form', + labelWidth : 110, + items : [{ + xtype : 'combo', + fieldLabel : '消毒供应中心物品', + valueField : 'value', + displayField : 'value', + store : yesNoStore, + forceSelection : true, + allowBlank : false, + mode : 'local', + triggerAction : 'all', + name : "isSupplyRoomGoods", + id : "isSupplyRoomGoods", + anchor : '95%' + }] + },{ + columnWidth : 1, + layout : 'form', + labelWidth : 110, + items : [{ + xtype : 'combo', + fieldLabel : '包外标签是否打印', + valueField : 'value', + displayField : 'value', + store : yesNoStore, + forceSelection : true, + allowBlank : false, + mode : 'local', + triggerAction : 'all', + name : "printInLabel", + id : "printInLabel", + anchor : '95%' + }] + },{ + columnWidth : 1, + layout : 'form', + labelWidth : 110, + items : [{ + xtype : 'numberfield', + fieldLabel : '最小库存', + allowDecimals : false, + maxLength : '16', + id : 'minStorage', + name : 'minStorage', + anchor : '95%' + }] + }, { + columnWidth : 1, + layout : 'form', + labelWidth : 110, + items : [{ + xtype : 'numberfield', + fieldLabel : '最大库存', + allowDecimals : false, + maxLength : '16', + id : 'maxStorage', + name : 'maxStorage', + anchor : '95%' + }] + }, { + columnWidth : 1, + layout : 'form', + labelWidth : 110, + items : [{ + xtype : 'textfield', + fieldLabel : '拼音码', + id : 'spelling', + name : 'spelling', + readOnly : true, + allowBlank : true, + anchor : '95%' + }] + }, { + columnWidth : 1, + layout : 'form', + labelWidth : 110, + items : [{ + xtype : 'textfield', + fieldLabel : '五笔码', + id : 'wbCode', + name : 'wbCode', + readOnly : true, + allowBlank : true, + anchor : '95%' + }] + }, { + columnWidth : 1, + layout : 'form', + labelWidth : 110, + items : [{ + xtype : 'textfield', + fieldLabel : '外部编码', + maxLength : '16', + id : 'externalCode', + name : 'externalCode', + allowBlank : true, + anchor : '95%' + }] + }, { + columnWidth : 1, + layout : 'form', + labelWidth : 110, + items : [{ + xtype : 'numberfield', + fieldLabel : '参考价', + maxLength : '16', + id : 'referencePrice', + name : 'referencePrice', + allowBlank : false, + allowNegative : false, + anchor : '95%' + }] + }, { + columnWidth : 1, + layout : 'form', + labelWidth : 110, + items : [{ + xtype : 'numberfield', + fieldLabel : '最小申请数量', + maxLength : '16', + id : 'minApplyAmount', + name : 'minApplyAmount', + allowBlank : true, + anchor : '95%' + }] + }, { + columnWidth : 1, + layout : 'form', + labelWidth : 110, + items : [{ + xtype : 'numberfield', + fieldLabel : '最大申请数量', + maxLength : '16', + id : 'maxApplyAmount', + name : 'maxApplyAmount', + allowBlank : true, + anchor : '95%' + }] + },{ + columnWidth : 1, + layout : 'form', + labelWidth : 110, + items : [{ + xtype : 'textfield', + fieldLabel : '单位', + maxLength : '16', + id : 'unit', + name : 'unit', + allowBlank : true, + anchor : '95%' + }] + } + ] + },{ + columnWidth : 0.6, + layout : 'form', + items : [ + new top.Ext.grid.GridPanel({ + id :'batchNumberGrid', + store : godownEntryItemStore , + height : 425, + width : 485, + bodyStyle : 'border:1px solid #afd7af', + sm : selectModel, + cm : new top.Ext.grid.ColumnModel([selectModel, + {header : "id",dataIndex : 'id',hidden : true}, + {header : "条码",width : 90,dataIndex : 'barcode',menuDisabled:true}, + {header : "批次",width : 90,dataIndex : 'batchNumber',menuDisabled:true}, + {header : "价格",width : 50,dataIndex : 'cost',menuDisabled:true}, + {header : "失效期",width : 90,dataIndex : 'expDate',renderer:myDateFormat,menuDisabled:true}, + {id:'supplierName',header : "供应商",width : 130,dataIndex : 'supplierName',menuDisabled:true} + ]), + autoExpandColumn : 'supplierName', + frame : false, + viewConfig: {forceFit:true}, + title : '批次列表' + }) + ] + }] + }], + buttons : [{ + id : 'saveBtn', + text : '保存', + hidden: true, + handler : save + },{ + id : 'cancleBtn', + text : '取消', + hidden: true, + handler : function() { + formWindow.close(); + } + },{ + id : 'print', + text : '打印批次', + hidden: true, + handler : function() { + var items = null; + var records = top.Ext.getCmp('batchNumberGrid').getSelectionModel().getSelections(); + if (records.length == 0) { + showResult("请选择要打印的批次!"); + return false; + } + var goodsName = top.Ext.getCmp('name').getValue(); + + for ( var i = 0, len = records.length; i < len; i++) { + if(items == null){ + items = goodsName + + ',' + records[i].data.barcode + + ',' + myDateFormat(records[i].data.expDate) + + ',' + records[i].data.supplierName + + ',' + records[i].data.batchNumber; + }else { + items += ';' + goodsName + + ',' + records[i].data.barcode + + ',' + myDateFormat(records[i].data.expDate) + + ',' + records[i].data.supplierName + + ',' + records[i].data.batchNumber; + } + } + top.Ext.getCmp("items").setValue(items); + formObj.form.submit({ + url : WWWROOT + '/disinfectSystem/diposableGoodsAction!printDiposableGoods.do', + method : 'POST', + waitMsg : '正在保存数据,请稍候', + waitTitle : '提交表单', + success : function(form, action) { + window.close(); + grid.dwrReload(); + //打印条码 + printBarcode(action.result.barcode); + + }, + failure : function(form, action) { + showResult(action.result.message); + } + }); + } + }] + }); + + if($Id("parm_s_type").value != ""){ + top.Ext.getCmp("type").setValue($Id("parm_s_type").value); + } + + formWindow = new top.Ext.Window( { + id : 'diposableGoodsWin', + layout : 'fit', + title : '一次性物品信息', + width : 850, + modal : true, + autoHeight : true, + border : false, + plain : true, + items : [ formObj ] + }); + formWindow.show(); + diposableGooodsStore.load(); + // 如果类型不为空,并且配置为自动增加外部编码,那么获取下一个编码,并且填上 + if(!isUndefinedOrNullOrEmpty(dType) && autoFillExternalCodeOfDisposableGoods){ + DiposableGoodsTableManager.getNextExternalCodeOfDisposableGoods(dType,function(externalCode){ + if(!isUndefinedOrNullOrEmpty(externalCode)){ + top.Ext.getCmp("externalCode").setValue(externalCode); + } + }); + } + if(id != 0){ + godownEntryItemStore.load(); + } +} + +function printAmount() { + top.Ext.MessageBox.prompt("输入框", "打印数量:", function(bu, txt) { + return txt; + }); +} + +function printBarcode(barcodeStr){ + if(barcodeStr!=null && barcodeStr.length > 0){ + top.Ext.Msg.show({ + title: '输入框', + msg: '打印数量:', + width: 100, + buttons: Ext.MessageBox.OKCANCEL, + prompt : true, + fn: function(bu, txt) { + if(bu == 'ok'){ + if(isNaN(txt) == false){ + var godownEntryItem = barcodeStr.split(";"); + var specification = top.Ext.getCmp('specification').getValue(); + for(var j = 0 ; j< Number(txt) ; j++){ + for ( var i = 0; i < godownEntryItem.length; i++) { + var resultItem = godownEntryItem[i].split("#&"); + var name =resultItem[0]; + var barcode = resultItem[1]; + var expDate = resultItem[2]; + var supplierName = resultItem[3]; + var batchNumber = resultItem[4]; + printDiposableGoodsInfo(barcode,name,expDate,supplierName,batchNumber,0,specification); + } + } + }else{ + showResult("打印数量必须是数字,请重新输入!"); + } + } + }, + animEl: 'addAddressBtn', + value:'1' + }); + } +} + +function submitForSaveDisposableGoods(){ + formObj.form.submit( { + url : WWWROOT + '/disinfectSystem/diposableGoodsAction!saveDiposableGoods.do', + method : 'POST', + waitMsg : '正在保存数据,请稍候', + waitTitle : '提交表单', + success : function(form, action) { + var result = Ext.decode(action.response.responseText); + if(isUndefinedOrNullOrEmpty(result.errorMessage)){ + showResult('保存成功'); + formWindow.close(); + grid.dwrReload(); + }else{ + showResult('保存出错, ' + result.errorMessage); + top.Ext.getCmp('saveBtn').enable(); + } + }, + failure : function(form, action) { + showResult('保存出错'); + top.Ext.getCmp('saveBtn').enable(); + } + }); +} +function validateAndSubmit(){ + Ext.Ajax.request({ + url : WWWROOT + '/disinfectSystem/diposableGoodsAction!validate.do', + params : { + validateId : top.Ext.getCmp('id').getValue(), + valifateName:top.Ext.getCmp('name').getValue(), + specification:top.Ext.getCmp('specification').getValue() + }, + success : function(response, options) { + var result = Ext.decode(response.responseText); + if(result.stauts==1){ + var originalGoodsType = top.Ext.getCmp("originalGoodsType").getValue(); + var goodsType = top.Ext.getCmp("goodsType").getValue(); + var orginalName = top.Ext.getCmp("orginalName").getValue(); + var orginalSpecification = top.Ext.getCmp("orginalSpecification").getValue(); + var name = top.Ext.getCmp("name").getValue(); + var specification = top.Ext.getCmp("specification").getValue(); + var msg = ''; + if(!stringLooksEquals(orginalName,name) && !stringLooksEquals(orginalSpecification,specification)){ + msg = "是否确定修改一次性物品名称和规格?" + }else if(!stringLooksEquals(orginalName,name)){ + msg = "是否确定修改一次性物品名称?" + }else if(!stringLooksEquals(orginalSpecification,specification)){ + msg = "是否确定修改一次性物品规格?" + } + if(!stringLooksEquals(originalGoodsType,goodsType)){ + msg += "是否确定更改物品类型?" + } + if(msg == ''){ + submitForSaveDisposableGoods(); + return; + } + top.Ext.MessageBox.confirm("请确认",msg, + function(button, text) { + if ("yes" == button){ + submitForSaveDisposableGoods(); + }else{ + top.Ext.getCmp('saveBtn').enable(); + } + }); + }else{ + showResult(result.message); + top.Ext.getCmp('saveBtn').enable(); + } + }, + failure : function(response, options) { + var result = Ext.decode(response.responseText); + showResult(result.cause); + } + }); +} + +function save(){ + //if(!form.getForm().isValid()){ + if(!formObj.getForm().isValid()){ + showResult('请正确填写表单各值'); + return false; + } + var unitConvertCoefficient = top.Ext.getCmp('unitConvertCoefficient').getValue(); + if(unitConvertCoefficient != null && unitConvertCoefficient != ""){ + if(unitConvertCoefficient <= 0){ + showResult("单位转换调整系数必须大于0!"); + top.Ext.getCmp('unitConvertCoefficient').setValue(""); + top.Ext.getCmp('unitConvertCoefficient').focus(); + return false; + } + } + + var max = top.Ext.getCmp('maxStorage').getValue(); + var min = top.Ext.getCmp('minStorage').getValue(); + var minApply = top.Ext.getCmp('minApplyAmount').getValue(); + var maxApply = top.Ext.getCmp('maxApplyAmount').getValue(); + if(typeof max == 'number' && typeof min == 'number'){ + if(min>max){ + showResult('最小库存不能大于最大库存'); + top.Ext.getCmp('minStorage').focus(); + return false; + } + if(minApply > maxApply){ + showResult('最小申请数不能大于最大申请数'); + top.Ext.getCmp('minApplyAmount').focus(); + return false; + } + } + this.disable(); + validateAndSubmit(); +} + +function printBatchNum(barcodeStr){ + if(barcodeStr!=null && barcodeStr.length > 0){ + Ext.Msg.show({ + title: '输入框', + msg: '打印数量:', + width: 100, + buttons: Ext.MessageBox.OKCANCEL, + prompt : true, + fn: function(bu, txt) { + if(bu == 'ok'){ + if(isNaN(txt) == false){ + var godownEntryItem = barcodeStr.split(";"); + for(var j = 0 ; j< Number(txt) ; j++){ + for ( var i = 0; i < godownEntryItem.length; i++) { + var resultItem = godownEntryItem[i].split("#&"); + var name =resultItem[0]; + var barcode = resultItem[1]; + var expDate = resultItem[2]; + var supplierName = resultItem[3]; + var batchNumber = resultItem[4]; + var specification = resultItem[5]; + printDiposableGoodsInfo(barcode,name,expDate,supplierName,batchNumber,0,specification); + } + } + }else{ + showResult("打印数量必须是数字,请重新输入!"); + } + } + }, + animEl: 'addAddressBtn', + value:'1' + }); + } +} +function onStorageRecordDetail(grid){ + var records = grid.getSelectionModel().getSelections(); + if(records.length == 0){ + showResult("请选择一次性物品"); + return; + } + if(records.length != 1){ + showResult("只能选择一个一次性物品"); + return; + } + + var storageRecord = new StorageRecord(); + storageRecord.setDisposableGoodsId(records[0].data['id']); + storageRecord.showDetail(); +} +//打印批次条码 +function printBatchStockBarcode(grid){ + var records = grid.getSelectionModel().getSelections(); + if(records.length == 0){ + showResult("请选择要打印批次条码的物品"); + }else{ + var ids = ""; + for(var i = 0,len=records.length;i 1) { + showResult("一次只能修改一个一次性物品!"); + return false; + } + id = records[0].data['id']; + addDiposableGoods(id); + top.Ext.getCmp('diposableGoodsForm').form.load({ + url : WWWROOT + '/disinfectSystem/diposableGoodsAction!loadDiposableGoods.do', + method : 'GET', + waitMsg : '正在加载数据,请稍候', + params : {id : id}, + success : function(form, action) { + var disposableGoods = action.result.data; + top.Ext.getCmp("originalGoodsType").setValue(disposableGoods.goodsType); + top.Ext.getCmp("orginalName").setValue(disposableGoods.name); + top.Ext.getCmp("orginalSpecification").setValue(disposableGoods.specification); + }, + failure : function(form, action) { + } + }); +}; + +function reloadGrid(type){ + $Id("parm_s_type").value = type; + grid.dwrReload(); +} + +function modify(){ + loadFormData(grid); +} + +function rendeColor(v, p, record){ + var data = record.data; + var amount = data.amount; + if(typeof amount=='number'){ + if((typeof data.minStorage=='number' && data.minStorage>amount) || (typeof data.maxStorage=='number' && data.maxStorage" + v + "

"; + } + } + return "" + v + ""; +} + +Ext.onReady(function() { + Ext.QuickTips.init(); + + //********* 1、Tree *********** + root = new Ext.tree.AsyncTreeNode({ + text:'一次性物品类型', + id:'0', + draggable:false, + listeners:{ + click:function(node,event){ + reloadGrid(""); + } + } + }); + + var myLoader = new Ext.tree.TreeLoader({dataUrl:WWWROOT + '/disinfectSystem/diposableGoodsAction!treeLoad.do'}); + + //********* 2、ForgonGrid *********** + var columns = [ + {header : "编码",width : 60,dataIndex : 'externalCode'}, + {header : "名称",width : 150,dataIndex : 'name', renderer : rendeColor}, + {header : "规格",width : 100,dataIndex : 'specification'}, + {header : "类型",width : 80,dataIndex : 'type'}, + {header : "类别",width : 80,dataIndex : 'grade'}, + {header : "包装规格",width : 80,dataIndex : 'packageSpec'}, + {header : "参考价",width : 60,dataIndex : 'referencePrice'}, + {header : "总数",width : 50,dataIndex : 'amount',hidden:true}, + {header : "最小申请数量",width : 80,dataIndex : 'minApplyAmount'}, + {header : "最大申请数量",width : 80,dataIndex : 'maxApplyAmount'}, + {header : "单位",width : 50,dataIndex : 'unit'}, + {header : "拼音码",width : 90,dataIndex : 'spelling'}, + {header : "五笔码",width : 90,dataIndex : 'wbCode'}, + {header : "能否作为器械包材料",width : 120,dataIndex : 'isPartOfTousseMaterial'}, + {header : "能否被科室申请",width : 100,dataIndex : 'isApplicationMaterial'}, + {header : "是否消毒供应中心领用物品",width : 100,dataIndex : 'isSupplyRoomGoods'}, + {header : "最小库存",width : 60,dataIndex : 'minStorage'}, + {id : 'operationRemark',header : "最大库存",width : 60,dataIndex : 'maxStorage'} + + ]; + + var readerDetail = [ + {name : 'id'}, + {name : 'name'}, + {name : 'externalCode'}, + {name : 'specification'}, + {name : 'type'}, + {name : 'grade'}, + {name : 'packageSpec'}, + {name : 'amount'}, + {name : 'minApplyAmount'}, + {name : 'maxApplyAmount'}, + {name : 'unit'}, + {name : 'minStorage'}, + {name : 'maxStorage'}, + {name : 'spelling'}, + {name : 'wbCode'}, + {name : 'isPartOfTousseMaterial'}, + {name : 'referencePrice'}, + {name : 'isApplicationMaterial'}, + {name : 'isSupplyRoomGoods'} + ]; + + var filters = new Ext.grid.GridFilters({ + filters:[ + {type: 'string', dataIndex: 'name'}, + {type: 'string', dataIndex: 'externalCode'}, + {type: 'numeric', dataIndex: 'amount'}, + {type: 'numeric', dataIndex: 'minApplyAmount'}, + {type: 'numeric', dataIndex: 'maxApplyAmount'}, + {type: 'string', dataIndex: 'unit'}, + {type: 'numeric', dataIndex: 'minStorage'}, + {type: 'numeric', dataIndex: 'maxStorage'}, + {type: 'string', dataIndex: 'spelling'}, + {type: 'string', dataIndex: 'wbCode'}, + {type: 'string', dataIndex: 'isPartOfTousseMaterial'}, + {type: 'string', dataIndex: 'isApplicationMaterial'}, + {type: 'string', dataIndex: 'isSupplyRoomGoods'}, + {type: 'numeric', dataIndex: 'referencePrice'} + ]} + ); + + var tbar = [ { + text : '转换为普通物品', + iconCls : 'btn_ext_refresh', + handler : function() { + changeExpensiveDiposablegoodsToGoods(grid); + } + },'-',{ + text : '转换为高值耗材', + iconCls : 'btn_ext_refresh', + handler : function(){ + changeGoodsToExpensiveDiposablegoods(grid); + } + } + ]; + + grid = new Ext.ux.ForgonPageGrid( { + tbar : tbar, + pageSize : 20, + defaultSortField : 'externalCode', + title : '一次性物品列表', + defaultSortDirection : 'ASC', + isCheckboxSelectionModel : true, + rememberSelected : false, + isShowSearchField : true, + plugins: filters, + columns : columns, + autoExpandColumn : 'operationRemark', + renderTo : 'gridDiv', + frame : false + }, readerDetail, + DiposableGoodsTableManager.findDisposableGoodsTableList, + null + ); + + var viewport = new Ext.Viewport({ + layout:'border', + items:[{ + region:'west', + id:'west-panel', + lines : false, + margins : '0 0 5 5', + cmargins : '0 0 0 0', + layout : 'accordion', + layoutConfig : {animate : true}, + collapsible: true, //允许折叠 + animCollapse:true, //折叠时是否有动画效果 + split: true, //是否允许拖动大小,与下面的折叠形式配合 + collapseMode:'mini', //折叠形式 + width: 200, + minSize : 130, + maxSize : 400, + xtype: 'treepanel', + loader: myLoader, //数据加载 + autoScroll: true, + root: root, + tbar:[ + new Ext.Action({ + text: '展开所有', + handler: function(){ + var treePanel = viewport.findById('west-panel'); + treePanel.expandAll(); + } + }), + new Ext.Action({ + text: '折叠所有', + handler: function(){ + var treePanel = viewport.findById('west-panel'); + treePanel.collapseAll(); + } + }) + ] + },{ + region:'center', + margins:'0 5 5 0', + xtype : 'panel', + autoScroll:true, + layout: 'fit', + items:grid + }] + }); + + root.expand(false, /*no anim*/ false); +}); \ No newline at end of file Index: ssts-web/src/main/webapp/homepage/menuconfigure.js =================================================================== diff -u -r14407 -r14526 --- ssts-web/src/main/webapp/homepage/menuconfigure.js (.../menuconfigure.js) (revision 14407) +++ ssts-web/src/main/webapp/homepage/menuconfigure.js (.../menuconfigure.js) (revision 14526) @@ -316,6 +316,22 @@ singleClickExpand:singleClickExpandTree, hidden:SSTS_InterfereManagerView, children:[ + { + text:"一次性物品管理", + singleClickExpand:singleClickExpandTree, + hidden:SSTS_Warehouse_Menu, + children:[ + {hidden :SSTS_DiposableGoodsNode_Menu,text:"一次性物品管理",href:WWWROOT+'/disinfectsystem/assestManagement/disposableGoods/interfere/diposableGoodsView.jsp',hrefTarget:linkTarget,leaf:true} +// {hidden :SSTS_DiposableGoodsNode_Menu,text:"一次性物品库存",href:WWWROOT+'/disinfectsystem/assestManagement/disposableGoods/disposableGoodsStockView.jsp',hrefTarget:linkTarget,leaf:true}, +// {hidden :SSTS_DiposableGoodsNode_Menu,text:"一次性物品出入库记录",href:WWWROOT+'/disinfectsystem/assestManagement/disposableGoods/storageRecordView.jsp',hrefTarget:linkTarget,leaf:true}, +// {hidden :SSTS_godownEntryNode_Menu,text:"入库单管理",href:WWWROOT+'/disinfectsystem/assestManagement/godownEntry/godownEntryView.jsp',hrefTarget:linkTarget,leaf:true}, +// {hidden :SSTS_WarehouseEntryOut_Menu,text:"退库单管理",href:WWWROOT+'/disinfectsystem/assestManagement/godownEntry/godownOutView.jsp',hrefTarget:linkTarget,leaf:true}, +// {hidden :SSTS_WarehouseEntryOut_Menu,text:"调拨单管理",href:WWWROOT+'/disinfectsystem/assestManagement/godownEntry/appropriationView.jsp',hrefTarget:linkTarget,leaf:true}, +// {hidden :SSTS_WarehouseEntryOut_Menu,text:"盘盈盘亏管理",href:WWWROOT+'/disinfectsystem/assestManagement/godownEntry/godownStockTakeView.jsp',hrefTarget:linkTarget,leaf:true}, +// {hidden :SSTS_JJJL_Menu,text:"一次性物品盘点管理",href:WWWROOT+'/disinfectsystem/stocktakerecordmanager/inventoryrecordView.jsp?type=disposableGoods',hrefTarget:linkTarget,leaf:true}, +// {hidden :SSTS_stockTakeInfoNode_Menu,text:"一次性物品结算管理",href:WWWROOT+'/disinfectsystem/reportforms/stocktakeView.jsp',hrefTarget:linkTarget,leaf:true} + ] + }, {hidden :SSTS_InterfereSterilizationRecord_ViewMenu,text:"灭菌记录干预管理",href:WWWROOT+'/disinfectsystem/interfere/interfereSterilizationView.jsp',hrefTarget:linkTarget,leaf:true}, {hidden :SSTS_InterfereRecyclingApplication_ViewMenu,text:"申请单干预管理",href:WWWROOT+'/disinfectsystem/interfere/interfereGoodsApplicationView.jsp',hrefTarget:linkTarget,leaf:true}, {hidden :SSTS_InterfereForeigntousseApplication_ViewMenu,text:"外来器械干预管理",href:WWWROOT+'/disinfectsystem/interfere/interfereForeignTousseApplicationView.jsp',hrefTarget:linkTarget,leaf:true} Index: ssts-diposablegoods/src/main/java/com/forgon/disinfectsystem/diposablegoods/action/DiposableGoodsAction.java =================================================================== diff -u -r13947 -r14526 --- ssts-diposablegoods/src/main/java/com/forgon/disinfectsystem/diposablegoods/action/DiposableGoodsAction.java (.../DiposableGoodsAction.java) (revision 13947) +++ ssts-diposablegoods/src/main/java/com/forgon/disinfectsystem/diposablegoods/action/DiposableGoodsAction.java (.../DiposableGoodsAction.java) (revision 14526) @@ -337,6 +337,80 @@ e.printStackTrace(); } } + + public void interfere_changeGoodsToExpensiveDiposablegoods() { + String idStr = StrutsParamUtils.getPraramValue("ids", ""); + int successCount = 0; + int totalCount = 0; + String message = ""; + try { + if(StringUtils.isBlank(idStr)){ + throw new RuntimeException("参数错误,ids不能为空!"); + } + String[] idsArr = idStr.split(","); + totalCount = idsArr.length; + for (String id : idsArr) { + try { + diposableGoodsManager.changeGoodsToExpensiveDiposablegoods_TRANS_NEW(id); + ++successCount; + } catch (Exception e) { + e.printStackTrace(); + message = "转换失败!"+e.getMessage(); + } + } + } catch (Exception e) { + message = "转换失败!"+e.getMessage(); + e.printStackTrace(); + } + if(successCount > 0){ + message = String.format("成功%s个,失败%s个!", successCount,totalCount-successCount); + } + HttpServletResponse httpServletResponse = StrutsParamUtils + .getResponse(); + httpServletResponse.setCharacterEncoding("UTF-8"); + try { + httpServletResponse.getWriter().print(message); + } catch (IOException e) { + e.printStackTrace(); + } + } + + public void interfere_changeExpensiveDiposablegoodsToGoods() { + String idStr = StrutsParamUtils.getPraramValue("ids", ""); + int successCount = 0; + int totalCount = 0; + String message = ""; + try { + if(StringUtils.isBlank(idStr)){ + throw new RuntimeException("参数错误,ids不能为空!"); + } + String[] idsArr = idStr.split(","); + totalCount = idsArr.length; + for (String id : idsArr) { + try { + diposableGoodsManager.changeExpensiveDiposablegoodsToGoods_TRANS_NEW(id); + ++successCount; + } catch (Exception e) { + e.printStackTrace(); + message = "转换失败!"+e.getMessage(); + } + } + } catch (Exception e) { + message = "转换失败!"+e.getMessage(); + e.printStackTrace(); + } + if(successCount > 0){ + message = String.format("成功%s个,失败%s个!", successCount,totalCount-successCount); + } + HttpServletResponse httpServletResponse = StrutsParamUtils + .getResponse(); + httpServletResponse.setCharacterEncoding("UTF-8"); + try { + httpServletResponse.getWriter().print(message); + } catch (IOException e) { + e.printStackTrace(); + } + } public void printBatchNumOfDiposableGoodsByIds() { String idStr = StrutsParamUtils.getPraramValue("diposableIds", ""); Index: ssts-web/src/main/webapp/disinfectsystem/assestManagement/disposableGoods/interfere/diposableGoodsView.jsp =================================================================== diff -u --- ssts-web/src/main/webapp/disinfectsystem/assestManagement/disposableGoods/interfere/diposableGoodsView.jsp (revision 0) +++ ssts-web/src/main/webapp/disinfectsystem/assestManagement/disposableGoods/interfere/diposableGoodsView.jsp (revision 14526) @@ -0,0 +1,63 @@ +<%@ page contentType="text/html; charset=UTF-8"%> +<%@ include file="/common/taglibs.jsp"%> +<%@page import="com.forgon.disinfectsystem.entity.assestmanagement.DisposableGoods,com.forgon.Constants"%> + + + + +一次性物品信息 + + +<%@ include file="/common/includeExtJsAndCss.jsp"%> + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+ + \ No newline at end of file Index: ssts-web/src/main/webapp/disinfectsystem/assestManagement/diposableGoods/diposableGoodsView.js =================================================================== diff -u -r14211 -r14526 --- ssts-web/src/main/webapp/disinfectsystem/assestManagement/diposableGoods/diposableGoodsView.js (.../diposableGoodsView.js) (revision 14211) +++ ssts-web/src/main/webapp/disinfectsystem/assestManagement/diposableGoods/diposableGoodsView.js (.../diposableGoodsView.js) (revision 14526) @@ -184,16 +184,27 @@ columnWidth : 1, layout : 'form', labelWidth : 110, - items : [{ - xtype : 'combo', + items : [ + isUndefinedOrNullOrEmpty(id)?{ + xtype : 'combo', + fieldLabel : "物品类型", + valueField : 'value', + displayField : 'value', + store : goodsTypeStore, + forceSelection : true, + allowBlank : false, + mode : 'local', + triggerAction : 'all', + name : "goodsType", + id : "goodsType", + anchor : '95%' + }:{ + xtype : 'textfield', fieldLabel : "物品类型", - valueField : 'value', - displayField : 'value', - store : goodsTypeStore, - forceSelection : true, + readOnly: true, + cls : 'fieldReadOnlyNoRemove', allowBlank : false, mode : 'local', - triggerAction : 'all', name : "goodsType", id : "goodsType", anchor : '95%' @@ -601,8 +612,8 @@ success : function(response, options) { var result = Ext.decode(response.responseText); if(result.stauts==1){ - var originalGoodsType = top.Ext.getCmp("originalGoodsType").getValue(); - var goodsType = top.Ext.getCmp("goodsType").getValue(); +// var originalGoodsType = top.Ext.getCmp("originalGoodsType").getValue(); +// var goodsType = top.Ext.getCmp("goodsType").getValue(); var orginalName = top.Ext.getCmp("orginalName").getValue(); var orginalSpecification = top.Ext.getCmp("orginalSpecification").getValue(); var name = top.Ext.getCmp("name").getValue(); @@ -615,9 +626,9 @@ }else if(!stringLooksEquals(orginalSpecification,specification)){ msg = "是否确定修改一次性物品规格?" } - if(!stringLooksEquals(originalGoodsType,goodsType)){ - msg += "是否确定更改物品类型?" - } +// if(!stringLooksEquals(originalGoodsType,goodsType)){ +// msg += "是否确定更改物品类型?" +// } if(msg == ''){ submitForSaveDisposableGoods(); return;