Index: ssts-web/src/main/webapp/disinfectsystem/storageLocationManage/setPutInGoodsForm.js =================================================================== diff -u --- ssts-web/src/main/webapp/disinfectsystem/storageLocationManage/setPutInGoodsForm.js (revision 0) +++ ssts-web/src/main/webapp/disinfectsystem/storageLocationManage/setPutInGoodsForm.js (revision 26725) @@ -0,0 +1,298 @@ +//器械包grid表格的数据源 +var select_GoodsNameGridStore; +//删除 +function removeSelect_DepartItem(p) { + var records = top.Ext.getCmp('select_GoodsNameGrid').getSelectionModel().getSelections(); + if (records.length > 0) { + select_GoodsNameGridStore.remove(records[0]); + } +} +//删除多个 +function removeGridItem(supplyRoom){ + var obj = top.Ext.getCmp('select_GoodsNameGrid'); + var rows = obj.getSelectionModel().getSelections();// 返回值为 + var store = obj.getStore(); + if (rows.length == 0) { + showResult("请选择要删除的器械包!"); + return false; + } + if (rows) { + for ( var i = 0; i < rows.length; i++) { + store.remove(rows[i]); + } + } +}; + +function setPutInGoods(extHiddenElementId, extComboElementId, goodsCodes){ + //器械包的窗口 + var formWindowGoodsName; + //确定保存 + function saveSelect(extHiddenElementId, extComboElementId) { + var valueArr = []; + var showArr = []; + for (var i = 0; i < select_GoodsNameGridStore.getCount(); i++) { + var record = select_GoodsNameGridStore.getAt(i); + var obj = {}; + valueArr.push(record.get('goodsCode')); + showArr.push(record.get('goodsName')); + } + if (valueArr.length != 0) { + top.Ext.getCmp(extHiddenElementId).setValue(valueArr.join(";")); + top.Ext.getCmp(extComboElementId).setValue(showArr.join(" ; ")); + } else { + top.Ext.getCmp(extHiddenElementId).setValue(""); + top.Ext.getCmp(extComboElementId).setValue(""); + } + select_GoodsNameGridStore.removeAll(); + formWindowGoodsName.close(); + } + + //器械包record + var goodsNameRecord = Ext.data.Record.create([{ + name: 'goodsCode' + }, + { + name: 'goodsName' + } + ]); + + /** + * 添加所选择的器械包名称 + */ + function addSelect_goods(name,goodsNameId) { + var goodsCode = top.Ext.getCmp('goodsName').getValue(); + var goodsName = top.Ext.getCmp('goodsName').getRawValue(); + if (goodsCode || (name != undefined && goodsNameId != undefined)) { + var isExist = false; + var isExistAll = false; + for (var i = 0; i < select_GoodsNameGridStore.getCount(); i++) { + var record = select_GoodsNameGridStore.getAt(i); + var tempName = record.get('goodsCode'); + if (tempName == goodsCode || tempName == goodsNameId) { + isExist = true; + break; + } + } + if (!isExist) { + if( name != undefined && goodsNameId != undefined){ + var record2 = new goodsNameRecord({ + goodsCode: goodsNameId, + goodsName: name + }); + select_GoodsNameGridStore.add(record2); + }else{ + var record = new goodsNameRecord({ + goodsCode: goodsCode, + goodsName: goodsName + }); + select_GoodsNameGridStore.add(record); + } + + top.Ext.getCmp('goodsName').setValue(''); + top.Ext.getCmp('goodsName').setRawValue(''); + }else { + if(name != undefined && goodsNameId != undefined){ + showResult('器械包:['+name+'] 已存在!'); + }else{ + showResult("器械包名称:" + goodsName + "已添加,请不要重复添加!"); + } + + } + } else { + showResult("请选择器械包"); + } + } + select_GoodsNameGridStore = new top.Ext.data.Store({ + reader: goodsNameRecord + }); + var cm = new top.Ext.grid.ColumnModel([{ + header: "器械包名称", + width: 140, + dataIndex: 'goodsName' + }, { + header: '删除', + width: 40, + menuDisabled: true, + dataIndex: 'button', + renderer: function (v, p, record, index) { + return ""; + } + }]); + + //器械包数据源 + var tousseStore = new Ext.data.Store({ + proxy : new Ext.data.HttpProxy({ + url : WWWROOT + '/disinfectSystem/baseData/tousseDefinitionAction!searchAllTousse.do', + method : 'POST' + }), + reader : new Ext.data.JsonReader({ + root : 'data' + },[ + {name : 'id',mapping : 'id'}, + {name : 'name',mapping : 'name'} + ] + ) + }); + + //顶部的工具栏 + var tbar = [{ + text: '选择器械包' + }, { + xtype: 'combo', + name : "goodsName", + id : "goodsName", + queryParam: 'spell', + fieldLabel: '器械包名称', + minChars: 0, + valueField : 'id', + displayField : 'name', + anchor: '100%', + width: 200, + store: tousseStore, + lazyInit: true, + triggerAction: 'all', + hideTrigger: true, + typeAhead: false, + allowBlank: true, + listeners: { + select: function (combo, record, index) { + var tem = record.data.id; + var name = record.data.name; + top.Ext.getCmp('goodsName').setValue(tem); + top.Ext.getCmp('goodsName').setRawValue(name); + } + } + }, { + text: '添加', + iconCls : 'btn_ext_add', + handler: function () { + addSelect_goods(); + } + },/* { + text: '添加全部', + iconCls : 'icon_systemset', + handler: function () { + Ext.Ajax.request({ + url : WWWROOT + '/disinfectSystem/baseData/tousseDefinitionAction!searchAllTousseAndAllDisposableGoods.do', + success : function(response, options) { + var result = Ext.decode(response.responseText); + var lenth = result.data.length; + for(var index = 0;index < lenth;index++){ + var name = result.data[index].name; + var goodsNameId = result.data[index].id; + addSelect_goods(name,goodsNameId); + } + }, + failure : function(response, options) { + } + }); + } + }, */{ + text: '删除全部', + iconCls : 'btn_ext_application_del', + handler : function() { + top.Ext.MessageBox.confirm("请确认","确定要删除所有器械包吗?",function(btn){ + if(btn == "yes"){ + select_GoodsNameGridStore.removeAll(); + } + }); + } + } +]; + + var select_GoodsNameGridStoreFormObj = new top.Ext.FormPanel({ + id: 'goodsNameForm', + frame: true, + labelAlign: 'right', + labelSeparator: ':', + bodyStyle: 'padding:5px 5px 0px 5px', + autoWidth: true, + autoHeight: true, + autoScroll: true, + items: [{ + layout: 'column', + items: [{ + columnWidth: 1, + layout: 'form', + items: [ + new top.Ext.grid.GridPanel({ + id: 'select_GoodsNameGrid', + store: select_GoodsNameGridStore, + tbar: tbar, + cm: cm, + width: 140, + height: 240, + isCheckboxSelectionModel: true, + frame: false, + viewConfig: { + forceFit: true + }, + bodyStyle: 'border:1px solid #afd7af', + anchor: '100%', + selModel: new top.Ext.grid.RowSelectionModel({ + singleSelect: false, + checkOnly: true + }) + }) + ] + }] + }], + buttons: [{ + id: 'saveBtn2', + text: '确定', + handler: function () { + saveSelect(extHiddenElementId, extComboElementId); + } + }, { + id: 'cancleBtn2', + text: '取消', + handler: function () { + select_GoodsNameGridStore.removeAll(); + formWindowGoodsName.close(); + } + }] + }); + + formWindowGoodsName = new top.Ext.Window({ + id: 'goodsNameWin', + layout: 'fit', + title: '选择器械包', + width: 650, + modal: true, + autoHeight: true, + border: false, + plain: true, + items: [select_GoodsNameGridStoreFormObj] + }); + formWindowGoodsName.show(); + //根据传递的科室编码获取科室信息 + if (goodsCodes) { + goodsCodes = goodsCodes.replace(/;/g,","); + Ext.Ajax.request({ + url: WWWROOT + '/disinfectSystem/baseData/storageLocationAction!loadTousseDefinitionForStorage.do', + params: { + goodsCodes: goodsCodes + }, + success: function (response, options) { + var result = Ext.decode(response.responseText); + var data = result.data; + if (result.success) { + if (data) { + for (var i = 0; i < data.length; i++) { + var record = new goodsNameRecord({ + goodsCode: data[i]["id"], + goodsName: data[i]["name"] + }); + select_GoodsNameGridStore.add(record); + } + } + } else { + showResult("加载器械包信息" + result.message) + } + }, + failure: function (response, options) { + showResult("加载器械包信息报错"); + } + }) + }; +} \ No newline at end of file Index: ssts-web/src/main/webapp/disinfectsystem/storageLocationManage/goodsAccess.jsp =================================================================== diff -u --- ssts-web/src/main/webapp/disinfectsystem/storageLocationManage/goodsAccess.jsp (revision 0) +++ ssts-web/src/main/webapp/disinfectsystem/storageLocationManage/goodsAccess.jsp (revision 26725) @@ -0,0 +1,38 @@ +<%@ page contentType="text/html; charset=UTF-8"%> +<%@ include file="/common/taglibs.jsp"%> +<%@ include file="/common/includeExtJsAndCss.jsp"%> + + + 物品存取 + + + + + + + + + + + +
+
+
+
+ + + + + + +
+
+
+
+ +
+ + \ No newline at end of file Index: ssts-web/src/main/webapp/themes/portalPage/img/drawer.png =================================================================== diff -u Binary files differ Index: ssts-web/src/main/resources/systemset/portalPage.xml =================================================================== diff -u -r26626 -r26725 --- ssts-web/src/main/resources/systemset/portalPage.xml (.../portalPage.xml) (revision 26626) +++ ssts-web/src/main/resources/systemset/portalPage.xml (.../portalPage.xml) (revision 26725) @@ -49,6 +49,7 @@ + Index: ssts-web/src/main/webapp/disinfectsystem/labelTemplateDesign/dataSource.js =================================================================== diff -u -r25571 -r26725 --- ssts-web/src/main/webapp/disinfectsystem/labelTemplateDesign/dataSource.js (.../dataSource.js) (revision 25571) +++ ssts-web/src/main/webapp/disinfectsystem/labelTemplateDesign/dataSource.js (.../dataSource.js) (revision 26725) @@ -689,4 +689,22 @@ textForPreview: '妇幼医院' })] }); -objectDataSourceManager.registerDataSource(containerDataSource); \ No newline at end of file +objectDataSourceManager.registerDataSource(containerDataSource); +//库位 +var storageLocationDataSource = new ObjectDataSource({ + name: '库位', + objectProperties: [new ObjectDataSourceProperty({ + propName: 'barcode', + displayName: '条码', + textForPreview: '010000110' + }),new ObjectDataSourceProperty({ + propName: 'name', + displayName: '名字', + textForPreview: '抽屉01' + }),new ObjectDataSourceProperty({ + propName: 'unitName', + displayName: '单位名称', + textForPreview: '妇幼医院' + })] +}); +objectDataSourceManager.registerDataSource(storageLocationDataSource); Index: ssts-web/src/main/webapp/disinfectsystem/storageLocationManage/storageLocationLookView.js =================================================================== diff -u --- ssts-web/src/main/webapp/disinfectsystem/storageLocationManage/storageLocationLookView.js (revision 0) +++ ssts-web/src/main/webapp/disinfectsystem/storageLocationManage/storageLocationLookView.js (revision 26725) @@ -0,0 +1,488 @@ +var grid; +var windowObj; +var preciseQuery = '精确查询'; +var fuzzyQuery = '模糊查询'; +/** + * 点击某个库位列表点执行的函数 + * @param id id + * @param orgUnitRoomName 树节点 + * @param orgUnitName 所属科室名称 + * @param orgUnitCoding 所属科室编码 + * @param type 子节点类型 + * @param warse 仓库名称 + * @param warseCode 仓库编码 + * @param parentStorageLocation 上级库位 + * @param parentStorageLocationId 上级库位Id + */ +function reloadGrid(id, orgUnitRoomName, orgUnitName, orgUnitCoding,type,warse,warseCode,parentStorageLocation,parentStorageLocationId){ + $Id("parm_s_id").value = id; + $Id("parm_s_orgUnitRoomName").value = orgUnitRoomName; + $Id("parm_s_orgUnitNameTree").value = orgUnitName; + $Id("parm_s_orgUnitCoding").value = orgUnitCoding; + $Id("parm_s_nodeType").value = type; + $Id("parm_s_warse").value = warse; + $Id("parm_s_warseCode").value = warseCode; + $Id("parm_s_parentStorageLocation").value = parentStorageLocation; + $Id("parm_s_parentStorageLocationId").value = parentStorageLocationId; + grid.dwrReload(); +} + +/** + * 库位的搜索手术间,搜索对应的搜索间节点,并且点击自动一下 + */ +function search(nodeType){ + var searchId = Ext.getCmp('searchField').getValue(); + if(searchId){ + var treePanel = Ext.getCmp('west-panel'); + Ext.Ajax.request({ + url: WWWROOT + '/disinfectSystem/baseData/storageLocationAction!getTreePathById.do', + params: { + searchId: searchId, + nodeType:nodeType + }, + success: function(response ,options){ + var jsonObj = Ext.decode(response.responseText); + if(jsonObj != null && jsonObj.length != 0){ + if(jsonObj.success){ + treePanel.expandPath(jsonObj.nodePath, 'id', function(bSuccess, oLastNode){ + if(!bSuccess) return; + //focus 节点,并选中节点!,以下代码不可少 + oLastNode.on('click',function(node,event){ + var attributes = node.attributes; + var ids = attributes.id; + ids = ids.split(";"); + reloadGrid(ids[1], attributes.name, attributes.orgUnitName, attributes.orgUnitCode, attributes.type, attributes.wareHouseName, attributes.wareHouseId, attributes.parentStorageLocation, attributes.parentStorageLocationId); + + }); + oLastNode.ensureVisible(); + oLastNode.select(); + oLastNode.fireEvent('click', oLastNode); + Ext.getCmp('searchField').setValue(""); + }); + }else{ + alert('没有找到相关的库位!'); + } + } + }, + failure: function(){ + alert('没有找到相关的库位!'); + } + }); + }else{ + alert('请输入库位名称'); + } +} + +function queryStorageLocation(){ + var goodsName = Ext.getCmp("goodsName").getValue(); + var barcode = Ext.getCmp("barcode").getValue(); + var warseHouseNames = Ext.getCmp("warseHouseName").getValue(); + var queryMode = Ext.getCmp("queryMode").getValue(); + $Id("parm_s_goodsName").value = goodsName; + $Id("parm_s_barcode").value = barcode; + $Id("parm_s_warseHouseNames").value = warseHouseNames; + $Id("parm_s_queryMode").value = queryMode; + + grid.dwrReload(); +} + +Ext.onReady(function(){ + Ext.QuickTips.init(); + + //所有grid之外的参数用这个方法传入,返回的是Map> + Ext.ux.ForgonPageGrid.prototype.getGridParameterMap = function(){}; + + var readerDetail = [{ + name : 'tousseName' + },{ + name : 'sterileEndTime' + },{ + name : 'validUntil' + },{ + name : 'tousseBarcode' + }/* ,{ + name : 'barcode' + } */,{ + name : 'storageLocationName' + },{ + name : 'parentStorageLocationPath' + },{ + name : 'wareHouseName' + },{ + name : 'orgUnitName' + }]; + + var columns = [{ + header : "物品名称",width : 200,dataIndex : 'tousseName'}, + {header : "灭菌日期",width :150,dataIndex : 'sterileEndTime' }, + {header : "失效日期",width : 150,dataIndex : 'validUntil'}, + {header : "器械包条码",width : 120,dataIndex : 'tousseBarcode'}, + /* {header : "库位条码",width : 120,dataIndex : 'barcode'}, */ + {header : "抽屉名称",width : 100,dataIndex : 'storageLocationName'}, + {header : "上级库位",width : 200,dataIndex : 'parentStorageLocationPath'}, + {header : "仓库",width : 120,dataIndex : 'wareHouseName'}, + {header : "所属科室",width : 120,dataIndex : 'orgUnitName',id:"orgUnitName"} + ]; + + var filters = new Ext.grid.GridFilters({ + filters : [ + {type : 'string', dataIndex : 'tousseName'}, + {type : 'date', dataIndex : 'sterileEndTime'}, + {type : 'date', dataIndex : 'validUntil'}, + {type : 'string', dataIndex : 'tousseBarcode'}, + /* {type : 'string', dataIndex : 'barcode'}, */ + {type : 'string', dataIndex : 'storageLocationName'}, + {type : 'string', dataIndex : 'parentStorageLocationPath'}, + {type : 'string', dataIndex : 'wareHouseName'}, + {type : 'string', dataIndex : 'orgUnitName'} + ] + }); + + var tousseStore = new Ext.data.Store({ + proxy : new Ext.data.HttpProxy({ + url : WWWROOT + '/disinfectSystem/baseData/tousseDefinitionAction!searchAllTousseAndAllDisposableGoods.do', + method : 'POST' + }), + reader : new Ext.data.JsonReader({ + root : 'data' + },[ + {name : 'id',mapping : 'id'}, + {name : 'name',mapping : 'name'} + ] + ) + }); + + var form = new Ext.Panel({ + region : 'north', + labelAlign : 'right', + buttonAlign : 'center', + collapsible : true, + collapseMode : 'mini', + split : true, + border : 0, + frame : true, + bodyStyle : 'padding:0px auto;margin:0px', + height : 120, + items : [{ + layout : 'column', + //labelWidth : 90, + width:document.body.clientWidth, + height:100, + items : [{ + columnWidth : .4, + layout : 'form', + labelAlign:"right", + height:30, + items:[{ + xtype : 'combo', + name : "goodsName", + id : "goodsName", + fieldLabel : '器械包名称', + minChars : 0, + valueField : 'name', + displayField : 'name', + store : tousseStore, + forceSelection : false, + lazyInit : true, + triggerAction : 'all', + hideTrigger : true, + typeAhead : false, + anchor : '95%', + queryParam : 'spell', + listeners : { + blur:function(thiz){ + if(Ext.getCmp('goodsName').getRawValue() == "" || Ext.getCmp('goodsName').getRawValue() == null){ + Ext.getCmp('goodsName').setValue(""); + }else{ + Ext.getCmp('goodsName').setValue(Ext.getCmp('goodsName').getRawValue()); + } + }, + specialkey : function(field, e) { + var key = e.getKey(); + if (key == Ext.EventObject.ENTER) { + Ext.getCmp('barcode').focus(); + } + } + } + }] + },{ + columnWidth : .4, + layout : 'form', + labelAlign:"right", + height:30, + items:[{ + xtype : 'textfield', + fieldLabel : "器械包条码", + allowBlank : true, + name : "barcode", + id : "barcode", + width:150, + listeners : { + specialkey : function(field, e) { + var key = e.getKey(); + if (key == Ext.EventObject.ENTER) { + Ext.getCmp('warseHouseName').focus(); + } + } + } + }] + },{ + columnWidth : .4, + layout : 'form', + labelAlign:"right", + height:30, + items:[{ + xtype : 'combo', + id : 'warseHouseName', + name : 'warseHouseName', + fieldLabel : '库位名称', + queryParam : 'keyword', + minChars : 0, + valueField : 'id', + displayField : 'storageLocationPath', + anchor : '95%', + store : new Ext.data.Store({ + proxy : new Ext.data.HttpProxy({ + url : WWWROOT + '/disinfectSystem/baseData/storageLocationAction!searchStorageLocationByKeyword.do', + method : 'POST' + }), + reader : new Ext.data.JsonReader({ + totalProperty : 'totalCount', + root : 'data' + }, [ + {name : 'id',mapping : 'id'}, + {name : 'storageLocationName',mapping : 'storageLocationName'}, + {name : 'storageLocationPath',mapping : 'storageLocationPath'} + ] + ) + }), + forceSelection : false, + lazyInit : true, + triggerAction : 'all', + hideTrigger : true, + typeAhead : false, + listWidth:400, + listeners : { + select : function(combo, record, index) { + combo.setValue(record.data.storageLocationName); + }, + blur:function(thiz){ + if(Ext.getCmp('warseHouseName').getRawValue() == "" || Ext.getCmp('warseHouseName').getRawValue() == null){ + Ext.getCmp('warseHouseName').setValue(""); + }else{ + Ext.getCmp('warseHouseName').setValue(Ext.getCmp('warseHouseName').getRawValue()); + } + }, + specialkey : function(field, e) { + var key = e.getKey(); + if (key == Ext.EventObject.ENTER) { + Ext.getCmp('queryMode').focus(); + } + } + } + }] + },{ + columnWidth : .4, + layout : 'form', + labelAlign:"right", + height:30, + items : [{ + xtype : 'combo', + id : 'queryMode', + name : 'queryMode', + valueField : 'queryMode', + displayField : 'queryMode', + width:150, + fieldLabel : '器械包查询模式', + mode : 'local', + readOnly : true, + value : fuzzyQuery, + triggerAction : 'all', + forceSelection : true, + store : new Ext.data.SimpleStore({ + fields : ['queryMode'], + data : [[preciseQuery],[fuzzyQuery]] + }) + }] + }] + }], + buttons : [{ + xtype : 'button', + text : '查询', + minWidth : 70, + iconCls : 'icon_search', + handler : function() { + queryStorageLocation(); + } + },{ + xtype : 'button', + text : '重置', + minWidth : 70, + iconCls : 'icon_set', + handler : function() { //查询条件全部重置 + Ext.getCmp("goodsName").setValue(""); + Ext.getCmp("barcode").setValue(""); + Ext.getCmp("warseHouseName").setValue(""); + $Id("parm_s_barcode").value = ""; + $Id("parm_s_goodsName").value = ""; + $Id("parm_s_warseHouseNames").value = ""; + } + }] + }); + + var root = new Ext.tree.AsyncTreeNode({ + text:'库位列表', + id:'orgUnit;0', + type: 'orgUnit', + listeners :{ + click : function(thisNode, e) { + $Id("parm_s_id").value = thisNode.attributes.id; + $Id("parm_s_orgUnitRoomName").value = thisNode.text; + $Id("parm_s_nodeType").value = thisNode.attributes.type; + $Id("parm_s_orgUnitNameTree").value = ""; + $Id("parm_s_orgUnitCoding").value = ""; + $Id("parm_s_warse").value = ""; + $Id("parm_s_warseCode").value = ""; + $Id("parm_s_parentStorageLocation").value = ""; + $Id("parm_s_parentStorageLocationId").value = ""; + grid.dwrReload(); + } + } + }); + + var myLoader = new Ext.tree.TreeLoader({ + dataUrl:WWWROOT + '/disinfectSystem/baseData/storageLocationAction!loadStorageLocationTree.do' + }); + + myLoader.on("beforeload", function(treeLoader, node){ + treeLoader.baseParams.id = node.attributes.id; + treeLoader.baseParams.nodeType = node.attributes.type; + }); + + /** + * 库位的Store + */ + var storageLocationStore = new Ext.data.Store({ + proxy : new Ext.data.HttpProxy({ + url : WWWROOT + '/disinfectSystem/baseData/storageLocationAction!searchStorageLocationByKeyword.do', + method : 'POST' + }), + reader : new Ext.data.JsonReader({ + root : 'data' + },[ + {name : 'id',mapping : 'id'}, + {name : 'storageLocationPath',mapping : 'storageLocationPath'}, + {name : 'storageLocationName',mapping : 'storageLocationName'} + ] + ) + }); + + grid = new Ext.ux.ForgonPageGrid({ + id : 'tousseInstanceGrid', + pageSize : 20, + renderTo : 'gridDiv', + showLoadMask : true, + defaultSortField : 'id', + defaultSortDirection : 'DESC', + isCheckboxSelectionModel : true, + rememberSelected : false, + isShowSearchField : true, + columns : columns, + plugins : filters, + frame : false, + autoExpandColumn: 'orgUnitName', + border : false + }, + readerDetail, + StorageLocationTableManager.findGoodsAndStorageLocationTableList, + 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 : 100, + maxSize : 400, + xtype: 'treepanel', + autoScroll: true, + loader: myLoader, //数据加载 + 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(); + } + }),'-',{ + xtype : 'combo', + id : 'searchField', + name : 'searchField', + queryParam : 'keyword', + minChars : 0, + hideLabel :true, + valueField : 'id', + displayField : 'storageLocationPath', + store : storageLocationStore, + forceSelection : true, + lazyInit : true, + width:60, + listWidth:400, + emptyText:'输入库位名称', + triggerAction : 'all', + hideTrigger : true, + typeAhead : false, + allowBlank : true, + anchor : '100%', + listeners:{ + select:function(combo, record, index){ + search("storageLocationChild"); + combo.setValue(record.data.storageLocationName); + } + } + },{ + text:'查询', + handler:function(){ + search("storageLocationChild"); + //queryStorageLocation(); + } + } + ] + },{ //中间的数据表格 + region:'center', + xtype : 'panel', + margins : '0 0 0 0', + layout : 'border', + items : [form, { + region : 'center', + margins : '0 0 0 0', + layout : 'fit', + items : grid + }] + }] + }); + root.expand(false, /*no anim*/ false); + Ext.getCmp('goodsName').focus(false,100); +}); + Index: ssts-web/src/main/webapp/homepage/menu.jsp =================================================================== diff -u -r26636 -r26725 --- ssts-web/src/main/webapp/homepage/menu.jsp (.../menu.jsp) (revision 26636) +++ ssts-web/src/main/webapp/homepage/menu.jsp (.../menu.jsp) (revision 26725) @@ -2176,6 +2176,36 @@ /** + * 《库位管理》权限 + */ +var SSTS_storageLocationManager = true; + + if (sstsConfig.enableWarehousePositionModule){ + SSTS_storageLocationManager = false; + } + + +/** + * 《库存查看》权限 + */ +var SSTS_storageLocationLook = true; + + if (sstsConfig.enableWarehousePositionModule){ + SSTS_storageLocationLook = false; + } + + +/** + * 《物品存取》权限 + */ +var SSTS_tousseAccess = true; + + if (sstsConfig.enableWarehousePositionModule){ + SSTS_tousseAccess = false; + } + + +/** * 使用记录转换配置管理的权限 */ var SSTS_UseRecordConvertConfig_Manager = true; Index: ssts-web/src/main/webapp/disinfectsystem/storageLocationManage/storageLocationManageView.jsp =================================================================== diff -u --- ssts-web/src/main/webapp/disinfectsystem/storageLocationManage/storageLocationManageView.jsp (revision 0) +++ ssts-web/src/main/webapp/disinfectsystem/storageLocationManage/storageLocationManageView.jsp (revision 26725) @@ -0,0 +1,71 @@ +<%@ page contentType="text/html; charset=UTF-8"%> +<%@ include file="/common/taglibs.jsp"%> + + + 库位管理 + + + + + + <%@ include file="/common/includeExtJsAndCss.jsp"%> + <%@ include file="/common/include_Ext42_Js.jsp"%> + <%@ include file="/disinfectsystem/print/print.jsp"%> + + + + + + + + + + + + + + + + + +
+
+
+
+ + +
+ + + + + + + + + + + + + + + +
+ + \ No newline at end of file Index: ssts-web/src/main/webapp/disinfectsystem/print/print.js =================================================================== diff -u -r26259 -r26725 --- ssts-web/src/main/webapp/disinfectsystem/print/print.js (.../print.js) (revision 26259) +++ ssts-web/src/main/webapp/disinfectsystem/print/print.js (.../print.js) (revision 26725) @@ -1182,6 +1182,19 @@ obj.defaultPrintFun(); } } +//库位打印 +function printObjStorageLocation(obj){ + var t = getTemplateByDatasourceAndStyle(obj.dataSourceName, obj.styleName); + if(t){ + var pageType = t.fullName; + if(invokeTemplatePrintFunction(pageType,obj)){ + return; + } + }else{ + obj.defaultPrintFun(); + } +} + // 打印预览 function preview(barcode,name,unitName) { if (barcode != null && barcode != '') { Index: ssts-web/src/main/webapp/homepage/menuconfigure.js =================================================================== diff -u -r26636 -r26725 --- ssts-web/src/main/webapp/homepage/menuconfigure.js (.../menuconfigure.js) (revision 26636) +++ ssts-web/src/main/webapp/homepage/menuconfigure.js (.../menuconfigure.js) (revision 26725) @@ -178,6 +178,16 @@ {hidden :SSTS_chargeRecordManage_MENU,text:"收费记录管理",href:WWWROOT+'/disinfectsystem/chargeRecord/chargeRecord.jsp',hrefTarget:linkTarget,leaf:true} ] }; +DisinfectsystemTreeData[15] = { + text:"库位管理", + singleClickExpand:singleClickExpandTree, + hidden:SSTS_storageLocationManager && SSTS_storageLocationLook && SSTS_tousseAccess, + children:[ + {hidden :SSTS_storageLocationManager,text:"库位管理",href:WWWROOT+'/disinfectsystem/storageLocationManage/storageLocationManageView.jsp',hrefTarget:linkTarget,leaf:true}, + {hidden :SSTS_storageLocationLook,text:"库存查看",href:WWWROOT+'/disinfectsystem/storageLocationManage/storageLocationLookView.jsp',hrefTarget:linkTarget,leaf:true}, + {hidden :SSTS_tousseAccess,text:"物品存取",href:WWWROOT+'/disinfectsystem/storageLocationManage/goodsAccess.jsp',hrefTarget:linkTarget,leaf:true} + ] + }; DWREngine.setAsync(false); PackingTableManager.getAllTaskGroup(setTaskGroup); function setTaskGroup(taskGroup){ Index: ssts-web/src/main/webapp/disinfectsystem/storageLocationManage/storageLocationManageView.js =================================================================== diff -u --- ssts-web/src/main/webapp/disinfectsystem/storageLocationManage/storageLocationManageView.js (revision 0) +++ ssts-web/src/main/webapp/disinfectsystem/storageLocationManage/storageLocationManageView.js (revision 26725) @@ -0,0 +1,402 @@ +var grid; + +/** + * 点击修改时执行的方法 + * + */ +function loadFormDataAndUpdate(grid) { + var records = grid.getSelectionModel().getSelections(); + if (records.length == 0) { + showResult("请选择要修改的记录!"); + return false; + } + if (records.length > 1) { + showResult("一次只能修改一条记录!"); + return false; + } + var id = records[0].data['id']; + addAndModify(id); +} + +/** + * 修改记录 + * modifyRecord函数 触发modify函数调用,并传入当前列的值以及record.data对象 + * 页面中需要定义 modify(v,data) 函数 + */ +function modify(v,data){ + loadFormDataAndUpdate(grid); +} + +/** + * 点击某个库位列表点执行的函数 + * @param id id + * @param orgUnitRoomName 树节点 + * @param orgUnitName 所属科室名称 + * @param orgUnitCoding 所属科室编码 + * @param type 子节点类型 + * @param warse 仓库名称 + * @param warseCode 仓库编码 + * @param parentStorageLocation 上级库位 + * @param parentStorageLocationId 上级库位ID + */ +function reloadGrid(id, orgUnitRoomName, orgUnitName, orgUnitCoding,type,warse,warseCode,parentStorageLocation,parentStorageLocationId){ + $Id("parm_s_id").value = id; + $Id("parm_s_orgUnitRoomName").value = orgUnitRoomName; + $Id("parm_s_orgUnitNameTree").value = orgUnitName; + $Id("parm_s_orgUnitCoding").value = orgUnitCoding; + $Id("parm_s_nodeType").value = type; + $Id("parm_s_warse").value = warse; + $Id("parm_s_warseCode").value = warseCode; + $Id("parm_s_parentStorageLocation").value = parentStorageLocation; + $Id("parm_s_parentStorageLocationId").value = parentStorageLocationId; + grid.dwrReload(); +} + +/** + * 删除库位 + * @param grid + * @returns {Boolean} + */ +function deleteStorageLocationMsg(grid){ + var ids = grid.getSelectedValues('id', ';'); + if(ids==""){ + alert("请选择要删除的库位!"); + return false; + } + Ext.MessageBox.confirm("请确认","是否确定要删除选中的库位?",function(button, text){ + if("yes" == button){ + Ext.Ajax.request({ + url : WWWROOT + '/disinfectSystem/baseData/storageLocationAction!deleteStorageLocation.do', + params : {ids : ids}, + success : function(response, options) { + var result = Ext.decode(response.responseText); + if (result.success) { + showResult(result.message); + Ext.getCmp('west-panel').root.reload(); + grid.dwrReload(); + } else { + showResult('删除失败!'); + } + }, + failure : function(response, options) { + showResult('对不起!服务器正忙,删除失败'); + } + }); + } + }); +} + +/** + * 库位的搜索,搜索对应的库位节点,并且点击自动一下 + */ +function search(nodeType){ + var searchId = Ext.getCmp('searchField').getValue(); + if(searchId){ + var treePanel = Ext.getCmp('west-panel'); + Ext.Ajax.request({ + url: WWWROOT + '/disinfectSystem/baseData/storageLocationAction!getTreePathById.do', + params: { + searchId: searchId, + nodeType:nodeType + }, + success: function(response ,options){ + var jsonObj = Ext.decode(response.responseText); + if(jsonObj != null && jsonObj.length != 0){ + if(jsonObj.success){ + treePanel.expandPath(jsonObj.nodePath, 'id', function(bSuccess, oLastNode){ + if(!bSuccess) return; + //focus 节点,并选中节点!,以下代码不可少 + oLastNode.on('click',function(node,event){ + var attributes = node.attributes; + var ids = attributes.id; + ids = ids.split(";"); + reloadGrid(ids[1], attributes.name, attributes.orgUnitName, attributes.orgUnitCode, attributes.type, attributes.wareHouseName, attributes.wareHouseId, attributes.parentStorageLocation, attributes.parentStorageLocationId); + + }); + oLastNode.ensureVisible(); + oLastNode.select(); + oLastNode.fireEvent('click', oLastNode); + Ext.getCmp('searchField').setValue(""); + }); + }else{ + alert('没有找到相关的库位!'); + } + } + }, + failure: function(){ + alert('没有找到相关的库位!'); + } + }); + }else{ + alert('请输入库位名称!'); + } +} + + +function print_storageLocation(barcode,name,unitName,printType) { + var obj = { + barcode:barcode, + name:name, + unitName:unitName, + defaultPrintFun: function(){ + if(printType == PRINT_TYPE_PREVIEW){ + preview(barcode,name,unitName); + }else{ + defaultPrint(barcode,name,unitName); + } + }, + dataSourceName: '库位', + styleName: '默认', + _printType: printType + } + printObjStorageLocation(obj); +}; + +Ext.onReady(function(){ + Ext.QuickTips.init(); + + //所有grid之外的参数用这个方法传入,返回的是Map> + Ext.ux.ForgonPageGrid.prototype.getGridParameterMap = function(){}; + + var readerDetail = [{ + name : 'id' + },{ + name : 'wareHouseId' + },{ + name : 'orgUnitCode' + },{ + name : 'parentId' + },{ + name : 'name' + },{ + name : 'barcode' + },{ + name : 'wareHouseName' + },{ + name : 'orgUnitName' + },{ + name : 'tousseDefinitionNames' + }]; + var tbar = [{ + text : '添加', + iconCls : 'btn_ext_application_add', + hidden:SSTS_storageLocation_Add, + handler : function() { + addAndModify(null); + } + }, '-', { + text : '修改', + hidden:SSTS_storageLocation_Update, + iconCls : 'btn_ext_application_edit', + + handler : function() { + loadFormDataAndUpdate(grid); + } + }, '-', { + text : '删除', + hidden:SSTS_storageLocation_Delete, + iconCls : 'btn_ext_application_del', + handler : function() { + deleteStorageLocationMsg(grid); + } + }, '-', { + text : '刷新', + iconCls : 'btn_ext_refresh1', + handler : function() { + grid.dwrReload(); + } + }, '-', { + text : '打印条码', + iconCls : 'icon_print', + handler : function() { + var sm = grid.getSelectionModel(); + if(sm.getSelected()){ + var recs=sm.getSelections(); + for(var i=0;i +<%@ include file="/common/taglibs.jsp"%> +<%@ include file="/common/includeExtJsAndCss.jsp"%> + + + 库存查看 + + + + + + + + + +
+
+
+
+ + + + + + +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + \ No newline at end of file Index: ssts-web/src/main/webapp/disinfectsystem/storageLocationManage/storageLocationManageForm.js =================================================================== diff -u --- ssts-web/src/main/webapp/disinfectsystem/storageLocationManage/storageLocationManageForm.js (revision 0) +++ ssts-web/src/main/webapp/disinfectsystem/storageLocationManage/storageLocationManageForm.js (revision 26725) @@ -0,0 +1,381 @@ +var windowObj = null; +var formObj = null; + +/** + * 保存 + */ +function save(types,wareHouseId,parentStorageLocationId) { + if (!formObj.form.isValid()) { + showResult('请正确填写表单各值'); + return false; + } + + formObj.form.submit({ + url : WWWROOT + '/disinfectSystem/baseData/storageLocationAction!saveOfUpdateStorageLocation.do', + method : 'POST', + success : function(thisForm, action) { + if (types == "orgUnit") { + Ext.getCmp('searchField').setValue(wareHouseId); + } else if(types == "storageLocation"){//仓库 + Ext.getCmp('searchField').setValue(wareHouseId); + }else if(types == "storage"){//供应室 + Ext.getCmp('searchField').setValue(wareHouseId); + }else{ + Ext.getCmp('searchField').setValue(parentStorageLocationId); + } + windowObj.close(); + showResult(action.result.message); + Ext.getCmp('west-panel').root.reload(); + search(types); + }, + failure : function(thisForm, action) { + showResult(action.result.message); + } + }); +} + + + +/** + * 新增或者修改 + * @param id 如果是新增的值为空(注意不要传0)或者不传,如果是修改,值为被修改那条记录的id + */ +function addAndModify(id) { + var orgUnitRoomName = $Id("parm_s_orgUnitRoomName").value; //这个属性只用于展示,后台会根据parentId属性重新赋值的 + var orgUnitName = $Id("parm_s_orgUnitNameTree").value; //科室名 + var orgUnitCode = $Id("parm_s_orgUnitCoding").value; //科室编码 + var types = $Id("parm_s_nodeType").value; //类型 + var warseName = $Id("parm_s_warse").value; // 仓库名称 + var wareHouseId = $Id("parm_s_warseCode").value;//仓库编码 + var parentStorageLocation = $Id("parm_s_parentStorageLocation").value; //上级库位 + var parentStorageLocationId = $Id("parm_s_parentStorageLocationId").value; //上级库位ID + + /** + * 所属科室combo的store + */ + var orgUnitSimpleStore = new Ext.data.SimpleStore({ + fields : [ 'orgUnitValue', 'orgUnitDisplay' ], + url : WWWROOT + '/systemmanage/orgUnit/getOrgUnitCodingAndNameByName.do', + listeners : { + beforeload : function(thisCombo, options) { + orgUnitSimpleStore.baseParams.orgUnit = top.Ext.getCmp('orgUnit').getRawValue(); + } + } + }); + + var warehouseStore = new top.Ext.data.Store({ + proxy : new top.Ext.data.HttpProxy({ + url : WWWROOT + '/disinfectSystem/baseData/wareHouseAction!getWareHouseByOrgUnitCode.do', + method : 'POST' + }), + reader : new Ext.data.JsonReader({ + root : 'data' + }, [ + {name : 'id'}, + {name : 'name'} + ]), + listeners: { + beforeload: function(s,options){ + s.baseParams.orgUnitCode = top.Ext.getCmp('orgUnitCode').getValue(); + } + } + }); + formObj = new top.Ext.FormPanel({ + frame : true, + labelSeparator : ':', + bodyStyle : 'padding:5px 5px 0px 5px', + height : 180, + autoScroll : true, + labelAlign : 'right', + items : [{ + xtype : 'hidden', + id : 'id', + name : 'id', + value:id + },{ + xtype : 'hidden', + id : 'parentId', + name : 'parentId' + },{ + xtype : 'hidden', + id : 'orgUnitName', + name : 'orgUnitName' + },{ + xtype : 'hidden', + id : 'orgUnitCode', + name : 'orgUnitCode' + },{ + xtype : 'hidden', + id : 'wareHouseId', + name : 'wareHouseId' + },{ + xtype : 'hidden', + id : 'wareHouseName', + name : 'wareHouseName' + },{ + xtype : 'hidden',//可放物品的编码 + name : "putInGoodsCode", + id : "putInGoodsCode" + },{ + layout : 'column', + labelWidth : 90, + items : [{ + columnWidth : .5, + layout : 'form', + labelAlign:"right", + height:30, + items:[{ + xtype : 'combo', + name : "orgUnit", + id : "orgUnit", + fieldLabel : '所属科室', + valueField : 'orgUnitValue', + displayField : 'orgUnitDisplay', + store : orgUnitSimpleStore, + allowBlank : false, + blankText : '此文本框不能为空', + forceSelection : true, + triggerAction : 'all', + minChars : 0, + maxHeight : 200, + anchor : '95%', + hideTrigger : true, + listeners:{ + select:function(combo, record, index){ + orgUnitCode = record.data.orgUnitValue; + top.Ext.getCmp('orgUnitCode').setValue(orgUnitCode); + top.Ext.getCmp('orgUnitName').setValue(record.data.orgUnitDisplay); + warehouseStore.baseParams.orgUnitCode = orgUnitCode; + warehouseStore.load(); + }, + specialkey : function(field, e) { + var key = e.getKey(); + if (key == Ext.EventObject.ENTER) { + top.Ext.getCmp('wareHouseBelong').focus(); + } + } + } + }] + },{ + columnWidth : .5, + layout : 'form', + labelAlign:"right", + height:30, + items:[{ + xtype : 'combo', + id : 'wareHouseBelong', + name : 'wareHouseBelong', + fieldLabel : '所属仓库', + maxLength : '30', + minChars : 0, + valueField : 'id', + displayField : 'name', + store : warehouseStore, + forceSelection : true, + lazyInit : false, + triggerAction : 'all', + hideTrigger : true, + typeAhead : false, + selectOnFocus :true, + allowBlank : false, + anchor : '95%', + listeners:{ + select:function(combo, record, index){ + top.Ext.getCmp("wareHouseId").setValue(record.data.id); + top.Ext.getCmp('wareHouseName').setRawValue(record.data.name); + wareHouseId = record.data.id; + }, + specialkey : function(field, e) { + var key = e.getKey(); + if (key == Ext.EventObject.ENTER) { + top.Ext.getCmp('name').focus(); + } + } + } + }] + },{ + columnWidth : .5, + layout : 'form', + labelAlign:"right", + height:30, + id:"parentStorageLocationWrapper", + items:[{ + xtype : 'textfield', + name : 'parentStorageLocation', + id : 'parentStorageLocation', + fieldLabel : '上级库位', + anchor : '95%', + disabled : true, + cls:'fieldReadOnlyNoRemove', + allowBlank : false, + blankText : '此文本框不能为空' + }] + },{ + columnWidth : .5, + layout : 'form', + labelAlign:"right", + height:30, + items:[{ + xtype : 'textfield', + name : 'name', + id : 'name', + fieldLabel : '库位名称', + anchor : '95%', + allowBlank : false, + blankText : '此文本框不能为空', + listeners:{ + specialkey : function(field, e) { + var key = e.getKey(); + if (key == Ext.EventObject.ENTER) { + top.Ext.getCmp('wareHouseCode').focus(); + } + } + } + }] + },{ + columnWidth : .5, + layout : 'form', + labelAlign:"right", + height:30, + items:[{ + xtype : 'textfield', + name : 'wareHouseCode', + id : 'wareHouseCode', + fieldLabel : '库位编码', + anchor : '95%' + }] + },{ + columnWidth : 0.85, + layout : 'form', + labelAlign:"right", + height:30, + id:"putInGoodsWrapper", + items:[{ + xtype : 'textfield', + name : 'putInGoods', + id : 'putInGoods', + fieldLabel : '可放物品', + readOnly : true, + anchor : '95%' + }] + },{ + columnWidth : 0.15, + layout : 'form', + id:"putInGoodsBtn", + items : [{ + xtype : 'button', + text : '选择物品', + listeners:{ + click : function(){ + setPutInGoods('putInGoodsCode' , 'putInGoods' , top.Ext.getCmp('putInGoodsCode').getValue()); + } + } + }] + }] + }], + buttons : [{ + text : '保存', + id : 'saveBtn', + handler : function() { + save(types,wareHouseId,parentStorageLocationId); + } + }, { + text : '取消', + handler : function() { + windowObj.close(); + } + }] + }); + + windowObj = new top.Ext.Window({ + layout : 'fit', + title : '库位管理', + width : 550, + height : 230, + border : false, + modal : true, + plain : true, + items : formObj + }); + + if(types == "storage"){//供应室 + top.Ext.getCmp("parentId").setValue(0); + top.Ext.getCmp("orgUnit").disable(); + top.Ext.getCmp("orgUnit").addClass('fieldReadOnlyNoRemove'); + top.Ext.getCmp("orgUnit").setValue(orgUnitName); + top.Ext.getCmp("orgUnitName").setValue(orgUnitName); + top.Ext.getCmp("orgUnitCode").setValue(orgUnitCode); + top.Ext.getCmp("parentStorageLocation").setValue(""); + top.Ext.getCmp("parentStorageLocationWrapper").hide(); + top.Ext.getCmp("putInGoodsWrapper").hide(); + top.Ext.getCmp("putInGoodsBtn").hide(); + top.Ext.getCmp("wareHouseBelong").focus(false,200); + }else if(types == "storageLocation"){//仓库 + top.Ext.getCmp("parentId").setValue(0); + top.Ext.getCmp("orgUnit").disable(); + top.Ext.getCmp("orgUnit").addClass('fieldReadOnlyNoRemove'); + top.Ext.getCmp("orgUnit").setValue(orgUnitName); + top.Ext.getCmp("orgUnitName").setValue(orgUnitName); + top.Ext.getCmp("orgUnitCode").setValue(orgUnitCode); + top.Ext.getCmp("wareHouseId").setValue(wareHouseId); + top.Ext.getCmp("wareHouseName").setValue(warseName); + top.Ext.getCmp("wareHouseBelong").setValue(warseName); + top.Ext.getCmp("wareHouseBelong").disable(); + top.Ext.getCmp("wareHouseBelong").addClass('fieldReadOnlyNoRemove'); + top.Ext.getCmp("parentStorageLocation").setValue(""); + top.Ext.getCmp("parentStorageLocationWrapper").hide(); + top.Ext.getCmp("putInGoodsWrapper").hide(); + top.Ext.getCmp("putInGoodsBtn").hide(); + top.Ext.getCmp("name").focus(false,200); + }else if(types == "orgUnit"){//根节点 + top.Ext.getCmp("parentId").setValue(0); + top.Ext.getCmp("parentStorageLocation").setValue(""); + top.Ext.getCmp("parentStorageLocationWrapper").hide(); + top.Ext.getCmp("putInGoodsWrapper").hide(); + top.Ext.getCmp("putInGoodsBtn").hide(); + top.Ext.getCmp("orgUnit").focus(false,200); + }else{//库位或者库位以下的,比如抽屉和货架 + top.Ext.getCmp("orgUnit").disable(); + top.Ext.getCmp("orgUnit").addClass('fieldReadOnlyNoRemove'); + top.Ext.getCmp("orgUnit").setValue(orgUnitName); + top.Ext.getCmp("orgUnitName").setValue(orgUnitName); + top.Ext.getCmp("orgUnitCode").setValue(orgUnitCode); + top.Ext.getCmp("wareHouseId").setValue(wareHouseId); + top.Ext.getCmp("wareHouseName").setValue(warseName); + top.Ext.getCmp("wareHouseBelong").setValue(warseName); + top.Ext.getCmp("wareHouseBelong").disable(); + top.Ext.getCmp("wareHouseBelong").addClass('fieldReadOnlyNoRemove'); + top.Ext.getCmp("parentStorageLocation").setValue(parentStorageLocation);//改上级库位 + top.Ext.getCmp("parentId").setValue(parentStorageLocationId); + top.Ext.getCmp("putInGoodsWrapper").show(); + top.Ext.getCmp("putInGoodsBtn").show(); + top.Ext.getCmp("name").focus(false,200); + } + + windowObj.show(); + if (id){ //如果是修改就加载需要的数据 + formObj.form.load({ + url : WWWROOT + '/disinfectSystem/baseData/storageLocationAction!getStorageLocationById.do', + method : 'POST', + waitMsg : '正在加载数据,请稍候', + params : {id : id}, + success : function(form, action) { + var data = action.result.data; + top.Ext.getCmp('orgUnit').setValue(data.orgUnitName); + top.Ext.getCmp('name').setValue(data.name); + top.Ext.getCmp('wareHouseBelong').setValue(data.wareHouseName); + top.Ext.getCmp('putInGoods').setValue(data.tousseDefinitionNames); + top.Ext.getCmp('putInGoodsCode').setValue(data.tousseDefinitionIds); + if (data.parentId == 0) { + wareHouseId = data.wareHouseId; + types = "storage"; + } else { + wareHouseId = data.parentId; + types = "storageLocationChild"; + } + }, + failure : function(form, action) { + } + }); + } +} Index: ssts-web/src/main/resources/systemset/operationDefine.xml =================================================================== diff -u -r26636 -r26725 --- ssts-web/src/main/resources/systemset/operationDefine.xml (.../operationDefine.xml) (revision 26636) +++ ssts-web/src/main/resources/systemset/operationDefine.xml (.../operationDefine.xml) (revision 26725) @@ -39,6 +39,15 @@ + + + + + + + + + Index: ssts-web/src/main/webapp/disinfectsystem/config/szszlyy/config.js =================================================================== diff -u -r26675 -r26725 --- ssts-web/src/main/webapp/disinfectsystem/config/szszlyy/config.js (.../config.js) (revision 26675) +++ ssts-web/src/main/webapp/disinfectsystem/config/szszlyy/config.js (.../config.js) (revision 26725) @@ -166,6 +166,8 @@ monitorGoodsRecyclingStatusForUseRecord:true, //是否显示基数管理的桌面图标 true显示,false不显示 isShowCardinalNumManageDesktopIcon:true, + //是否启用库位管理, true启用,false不启用 + enableWarehousePositionModule:true, //回收时允许保存未入筐的消毒包(必须开启了部分回收功能enablePartRecycle:true) recyclingAllowsSaveOfNonBasketDisinfectionTousse : true } \ No newline at end of file Index: ssts-web/src/main/webapp/disinfectsystem/storageLocationManage/goodsAccess.js =================================================================== diff -u --- ssts-web/src/main/webapp/disinfectsystem/storageLocationManage/goodsAccess.js (revision 0) +++ ssts-web/src/main/webapp/disinfectsystem/storageLocationManage/goodsAccess.js (revision 26725) @@ -0,0 +1,363 @@ +var tousseListStore; +var stasticsStore; + +var tousseInstanceRecord = Ext.data.Record.create([ + {name: 'id'}, + {name: 'status'}, + {name : 'tousseName'}, + {name : 'barcode'}, + {name : 'validUntil'}/* , + {name : 'storageName'} */ +]); +function setTotalCount(grid) { + var totalMoney = 0.0; + grid.getStore().each(function(record){ + var amount = Number(record.data.amount); + totalMoney = add(amount,totalMoney);//计算精度 + }); + goodsCount = totalMoney; + Ext.getCmp('stasticsGrid').setTitle('统计信息:'+goodsCount+'个物品'); +} + +function getTousseStoreIds(){ + var ids = []; + for(var i=0;i 0){ + //判断上一次的状态和本次点击的状态是否一致,不一致就删除 + /* if(Ext.getCmp('isPutInTakeOut').getValue() != checkedType || Ext.getCmp('drawerCode').getValue() != result.barcode){ + stasticsStore.removeAll(); + tousseListStore.removeAll(); + Ext.getCmp('stasticsGrid').setTitle('统计信息:0个物品'); + } */ + if(Ext.getCmp('drawerCode').getValue() != result.barcode){ + stasticsStore.removeAll(); + tousseListStore.removeAll(); + Ext.getCmp('stasticsGrid').setTitle('统计信息:0个物品'); + } + } + Ext.getCmp("drawerName").setValue(result.name);//抽屉名称 + Ext.getCmp('warsehouse').setValue(result.wareHouseName);//仓库 + Ext.getCmp('superiorWarsehouse').setValue(result.parentStorageLocationPath);//上级库位 + Ext.getCmp('drawerCode').setValue(result.barcode);//库位条码 + Ext.getCmp('barcode').setValue(""); + Ext.getCmp('barcode').focus(); + + }else if(returnType == "storageRecord"){//扫描物品条码 + + if(stasticsStore.getCount() > 0){ + //判断上一次的状态和本次点击的状态是否一致,不一致就删除 + if(Ext.getCmp('isPutInTakeOut').getValue() != checkedType){ + stasticsStore.removeAll(); + tousseListStore.removeAll(); + Ext.getCmp('stasticsGrid').setTitle('统计信息:0个物品'); + } + + //计算数量 + var existsStasticsData = false; + for(var i = 0;i < stasticsStore.getCount();i++){ + var stasticsRowData = stasticsStore.getAt(i); + if(stasticsRowData.data.tousseName == result.tousseName){ + stasticsRowData.set("amount",parseInt(stasticsRowData.data.amount) + 1); + existsStasticsData = true; + break; + } + } + + if(!existsStasticsData){ + var newStasticsData = new Ext.data.Record({ + tousseName:result.tousseName, + amount:1 + }); + Ext.getCmp('isPutInTakeOut').setValue(checkedType); + Ext.getCmp('oldBarcode').setValue(barcode); + stasticsStore.insert(0,newStasticsData); + } + //更改titile数量 + setTotalCount(Ext.getCmp('stasticsGrid')); + }else{ + var newStasticsData = new Ext.data.Record({ + tousseName:result.tousseName, + amount:1 + }); + stasticsStore.insert(0,newStasticsData); + Ext.getCmp('isPutInTakeOut').setValue(checkedType); + Ext.getCmp('oldBarcode').setValue(barcode); + //更改titile数量 + setTotalCount(Ext.getCmp('stasticsGrid')); + } + + var currentTousseInstance = new tousseInstanceRecord({ + id:result.id, + tousseName:result.tousseName, + barcode:result.barcode, + validUntil: result.validUntil + }); + tousseListStore.insert(0,currentTousseInstance);//最新扫描的器械包放到第一行 + Ext.getCmp('isPutInTakeOut').setValue(checkedType); + Ext.getCmp('oldBarcode').setValue(barcode); + Ext.getCmp('barcode').setValue(""); + Ext.getCmp('barcode').focus(); + + msg = result.tousseName + "已" + checkedType; + } + speaker.speak(msg); + }else{ + showResult(obj.message); + Ext.getCmp('barcode').setValue(""); + Ext.getCmp('barcode').focus(); + } + if(stasticsStore.getCount() > 0){ + //判断上一次的状态和本次点击的状态是否一致,不一致就删除 + if(Ext.getCmp('isPutInTakeOut').getValue() != checkedType){ + stasticsStore.removeAll(); + tousseListStore.removeAll(); + Ext.getCmp('stasticsGrid').setTitle('统计信息:0个物品'); + } + } + }); +} + +Ext.onReady(function() { + var contentHeight = document.body.scrollHeight; + var goodsCount = 0; + var stasticsItem = Ext.data.Record.create([ + {name : 'id'}, + {name : 'status'}, + {name : 'tousseName'}, + {name : 'amount'} + ]); + + var stasticsColumns = [ + {header : "包名称",width : 200,dataIndex : 'tousseName'}, + {header : "数量",dataIndex : 'amount',id:"amount"} + ]; + + stasticsStore = new Ext.data.Store({ + reader: new Ext.data.JsonReader({ + fields : [ + {name : 'id'}, + {name : 'status'}, + {name : 'tousseName'}, + {name : 'amount'} + ] + }) + }); + + var stasticsGrid = new Ext.grid.GridPanel({ + id : 'stasticsGrid', + title : '统计信息:'+goodsCount+'个物品', + height : (contentHeight-160)/2, + bodyStyle : 'border:1px solid #afd7af', + autoExpandColumn : 'amount', + width:document.body.clientWidth, + store: stasticsStore, + columns: stasticsColumns, + sm : new Ext.grid.RowSelectionModel({singleSelect:true}) + }); + + tousseListStore = new Ext.data.Store({ + reader: new Ext.data.JsonReader({ + type:'json', + root:'root', + totalProperty:'totalProperty', + fields: [ + {name: 'id'}, + {name: 'status'}, + {name: 'tousseName'}, + {name: 'barcode'}, + {name: 'validUntil'} + ] + }) + }); + + var tousseListColumns = [ + {header : "包名称",width :200,dataIndex : 'tousseName'}, + {header : "条码",width :150,dataIndex : 'barcode'}, + {header : "失效期",dataIndex : 'validUntil',id:"validUntil"} + ]; + + var tousseListGrid = new Ext.grid.GridPanel({ + id : 'tousseListGrid', + title : '扫描物品列表', + autoScroll:true, + height : (contentHeight-160)/2, + width:document.body.clientWidth, + bodyStyle : 'border:1px solid #afd7af', + store: tousseListStore, + autoExpandColumn: 'validUntil', + columns:tousseListColumns, + sm : new Ext.grid.RowSelectionModel({singleSelect:true}) + }); + + var basketPanel = new Ext.FormPanel({ + frame : true, + border : 0, + labelSeparator : ':', + bodyStyle : 'padding:5px 5px 0px 5px', + labelAlign:'right', + autoScroll : false, + layout: 'column', + items : [{ + layout : 'column', + width:document.body.clientWidth, + height:100, + items : [{ + xtype : 'hidden', + id : 'drawerCode', + name : 'drawerCode' + },{ + xtype : 'hidden', + id : 'isPutInTakeOut', + name : 'isPutInTakeOut' + },{ + xtype : 'hidden', + id : 'oldBarcode', + name : 'oldBarcode' + },{ + columnWidth : 0.5, + layout : 'form', + items : [{ + xtype : 'textfield', + fieldLabel : '仓库', + id : 'warsehouse', + name : 'warsehouse', + disabled : true + }] + },{ + columnWidth : .4, + layout : 'form', + items : [{ + xtype : 'textfield', + fieldLabel : '上级库位', + id : 'superiorWarsehouse', + name : 'superiorWarsehouse', + disabled : true + }] + },{ + columnWidth : 0.5, + layout : 'form', + items : [{ + xtype : 'textfield', + id : 'barcode', + name : 'barcode', + fieldLabel : '扫描条码', + listeners : { + specialkey : function(field, e) { + var key = e.getKey(); + if (key == Ext.EventObject.ENTER) { + var barcode = Ext.getCmp('barcode').getValue(); + if(barcode == '') { + showResult('条码为空' , null); + return; + } + var checkedType = Ext.getCmp('queryType').getValue(); + var hiddenCheckedType = Ext.getCmp('isPutInTakeOut').getValue(); + //如果扫描相同的条码就提示,并且不允许展示和提交 + if(tousseListStore.getCount() > 0){ + for(var i=0;i