Index: ssts-web/src/main/webapp/disinfectsystem/assestManagement/disposableGoods/disposableGoodsStockView.js
===================================================================
diff -u -r13519 -r13585
--- ssts-web/src/main/webapp/disinfectsystem/assestManagement/disposableGoods/disposableGoodsStockView.js (.../disposableGoodsStockView.js) (revision 13519)
+++ ssts-web/src/main/webapp/disinfectsystem/assestManagement/disposableGoods/disposableGoodsStockView.js (.../disposableGoodsStockView.js) (revision 13585)
@@ -2,9 +2,18 @@
var grid;
var root;
var formObj;
-var formWindow;
+var formWindow = null;
+var disposableGoodsStock = null;
+var TYPE_DIPOSABLEGOODS = '普通物品';
+var TYPE_EXPENSIVEDIPOSABLEGOODS = '高值耗材';
-function addDiposableGoods(id) {
+function closeFormWindow(){
+ if(formWindow != null){
+ formWindow.close();
+ formWindow = null;
+ }
+}
+function addDiposableGoods(disposableGoodsId,disposableGoodsStockId) {
var dType = document.getElementById("parm_s_type").value;
var diposableGooodsStore = new Ext.data.SimpleStore({
fields : [ 'typeName' ],
@@ -31,7 +40,7 @@
var godownEntryItemStore = new top.Ext.data.Store({
proxy : new top.Ext.data.HttpProxy({
- url : WWWROOT + '/disinfectSystem/diposableGoodsAction!loadDisposableGoodsBatchStocksByDisposableGoodsStockID.do?id=' + id,
+ url : WWWROOT + '/disinfectSystem/diposableGoodsAction!loadDisposableGoodsBatchStocksByDisposableGoodsStockID.do?id=' + disposableGoodsStockId,
method : 'POST'
}),
reader : new top.Ext.data.JsonReader({
@@ -47,7 +56,34 @@
})
});
-
+ var tbar = [{
+ text : '查看高值耗材',
+ iconCls : 'btn_ext_refresh',
+ handler : function(){
+ var records = top.Ext.getCmp('batchNumberGrid').getSelectionModel().getSelections();
+ if (records.length == 0) {
+ showResult("请选择要查看的批次!");
+ return false;
+ }
+ var disposableGoodsBatchStockIds = '';
+ for ( var i = 0, len = records.length; i < len; i++) {
+ if(disposableGoodsBatchStockIds == ''){
+ disposableGoodsBatchStockIds = records[i].data.id;
+ }else {
+ disposableGoodsBatchStockIds += ','+ records[i].data.id;
+ }
+ }
+
+ viewExpensiveDisposablegoods(disposableGoodsId, disposableGoodsStockId, disposableGoodsBatchStockIds);
+ }
+ }, '-', {
+ text : '查看所有高值耗材',
+ iconCls : 'btn_ext_application_edit',
+ id : 'editTbar',
+ handler : function() {
+ viewExpensiveDisposablegoods(disposableGoodsId, disposableGoodsStockId, '');
+ }
+ }];
var selectModel = new top.Ext.grid.CheckboxSelectionModel();
formObj = new top.Ext.FormPanel( {
id : 'diposableGoodsForm',
@@ -352,7 +388,13 @@
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,renderer : batchRenderer},
+ {header : "批次",width : 90,dataIndex : 'batchNumber',menuDisabled:true,renderer : function batchRenderer(v, p, record){
+ return v;
+// var data = record.data;
+// var disposableGoodsBatchStockIds = data.id;
+// var params = disposableGoodsId+','+disposableGoodsStockId+','+disposableGoodsBatchStockIds;
+// return '' + v + '';
+ }},
{header : "价格",width : 50,dataIndex : 'cost',menuDisabled:true},
{header : "库存",width : 50,dataIndex : 'storage',menuDisabled:true},
{header : "失效期",width : 90,dataIndex : 'expDate',renderer:myDateFormat,menuDisabled:true},
@@ -361,20 +403,22 @@
autoExpandColumn : 'supplierName',
frame : false,
viewConfig: {forceFit:true},
+ tbar: tbar,
title : '批次列表'
})
]
}]
}],
buttons : [{
id : 'saveBtn',
+ hidden: true,
text : '保存',
handler : save
},{
id : 'cancleBtn',
text : '取消',
handler : function() {
- formWindow.close();
+ closeFormWindow();
}
},{
id : 'print',
@@ -696,6 +740,7 @@
}
var loadFormData = function(grid) {
+ disposableGoodsStock = null;
var records = grid.getSelectionModel().getSelections();
if (records.length == 0) {
showResult("请选择要修改的一次性物品!");
@@ -707,16 +752,16 @@
}
id = records[0].data['id'];
var disposableGoodsID = records[0].data.disposableGoodsID;
- addDiposableGoods(id);
+ addDiposableGoods(disposableGoodsID,id);
top.Ext.getCmp('diposableGoodsForm').form.load({
url : WWWROOT + '/disinfectSystem/diposableGoodsAction!loadDisposableGoodsStock.do',
method : 'GET',
waitMsg : '正在加载数据,请稍候',
params : {id : id},
success : function(form, action) {
- var disposableGoods = action.result.data;
- top.Ext.getCmp("orginalName").setValue(disposableGoods.name);
- top.Ext.getCmp("orginalSpecification").setValue(disposableGoods.specification);
+ disposableGoodsStock = action.result.data;
+ top.Ext.getCmp("orginalName").setValue(disposableGoodsStock.name);
+ top.Ext.getCmp("orginalSpecification").setValue(disposableGoodsStock.specification);
},
failure : function(form, action) {
}
@@ -742,12 +787,17 @@
}
return "" + v + "";
}
-function batchRenderer(v, p, record){
- return v;
- var data = record.data;
- return "" + v + "";
-}
+function viewExpensiveDisposablegoods(disposableGoodsId,disposableGoodsStockIds,disposableGoodsBatchStockIds){
+ if(isUndefinedOrNull(disposableGoodsStockIds)){
+ disposableGoodsStockIds = '';
+ }
+ if(isUndefinedOrNull(disposableGoodsBatchStockIds)){
+ disposableGoodsBatchStockIds = '';
+ }
+ closeFormWindow();
+ loadExpensiveDisposableGoodsInfo(disposableGoodsId,disposableGoodsStockIds,disposableGoodsBatchStockIds);
+}
Ext.onReady(function() {
Ext.QuickTips.init();
@@ -832,28 +882,6 @@
handler : function(){
onStorageRecordDetail(grid);
}
- }, {
- text : '添加',
- hidden: true,
- iconCls : 'btn_ext_application_add',
- handler : function() {
- addDiposableGoods(0);
- }
- }, '-', {
- text : '修改',
- hidden: true,
- iconCls : 'btn_ext_application_edit',
- id : 'editTbar',
- handler : function() {
- loadFormData(grid);
- }
- }, '-', {
- text : '删除',
- hidden: true,
- iconCls : 'btn_ext_application_del',
- handler : function() {
- deleteDiposableGoods(grid);
- }
}, '-' , {
text : '打印批次',
hidden: true,
Index: ssts-web/src/main/webapp/disinfectsystem/assestManagement/disposableGoods/disposableGoodsStockView.jsp
===================================================================
diff -u -r13445 -r13585
--- ssts-web/src/main/webapp/disinfectsystem/assestManagement/disposableGoods/disposableGoodsStockView.jsp (.../disposableGoodsStockView.jsp) (revision 13445)
+++ ssts-web/src/main/webapp/disinfectsystem/assestManagement/disposableGoods/disposableGoodsStockView.jsp (.../disposableGoodsStockView.jsp) (revision 13585)
@@ -39,6 +39,7 @@
+
Index: ssts-web/src/main/webapp/disinfectsystem/assestManagement/disposableGoods/expensiveDisposableGoodsView.js
===================================================================
diff -u
--- ssts-web/src/main/webapp/disinfectsystem/assestManagement/disposableGoods/expensiveDisposableGoodsView.js (revision 0)
+++ ssts-web/src/main/webapp/disinfectsystem/assestManagement/disposableGoods/expensiveDisposableGoodsView.js (revision 13585)
@@ -0,0 +1,401 @@
+
+function loadExpensiveDisposableGoodsForm(disposableGoodsId,disposableGoodsStockIds,disposableGoodsBatchStockIds) {
+ 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 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 params = 'disposableGoodsId='+disposableGoodsId+'&disposableGoodsStockIds='+disposableGoodsStockIds+'&disposableGoodsBatchStockIds='+disposableGoodsBatchStockIds;
+ var godownEntryItemStore = new top.Ext.data.Store({
+ proxy : new top.Ext.data.HttpProxy({
+ url : WWWROOT + '/disinfectSystem/diposableGoodsAction!loadExpensiveDisposableGoods.do?' + params,
+ method : 'POST'
+ }),
+ reader : new top.Ext.data.JsonReader({
+ fields : [
+ {name : 'id'},
+ {name : 'barcode'},
+ {name : 'batchNumber'},
+ {name : 'price'},
+ {name : 'status'},
+ {name : 'expDate'},
+ {name : 'warehouseName'},
+ {name : 'supplierName'}
+ ]
+ })
+ });
+
+ var tbar = [{
+ text : '打印高值耗材',
+ iconCls : 'btn_ext_refresh',
+ handler : function(){
+
+ }
+ }];
+ 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'
+ },{
+ 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%'
+ }]
+ },{
+ 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 : '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 : 'textfield',
+ fieldLabel : '单位',
+ maxLength : '16',
+ id : 'unit',
+ name : 'unit',
+ allowBlank : true,
+ anchor : '95%'
+ }]
+ }, {
+ columnWidth : 1,
+ layout : 'form',
+ labelWidth : 110,
+ items : [{
+ xtype : 'numberfield',
+ fieldLabel : '总数',
+ maxLength : '16',
+ id : 'amount',
+ name : 'amount',
+ readOnly : true,
+ cls : 'fieldReadOnlyNoRemove',
+ allowBlank : false,
+ value : 0,
+ anchor : '95%'
+ }]
+ }
+ ]
+ },{
+ columnWidth : 0.6,
+ layout : 'form',
+ items : [
+ new top.Ext.grid.GridPanel({
+ id :'batchNumberGrid',
+ store : godownEntryItemStore ,
+ height : 390,
+ 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 : 'price',menuDisabled:true},
+ {header : "状态",width : 50,dataIndex : 'status',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},
+ tbar: tbar,
+ title : '高值耗材列表'
+ })
+ ]
+ }]
+ }],
+ buttons : [{
+ id : 'cancleBtn',
+ text : '取消',
+ handler : function() {
+ closeFormWindow();
+ }
+ }]
+ });
+
+ 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(id != 0){
+ godownEntryItemStore.load();
+ }
+}
+
+var loadExpensiveDisposableGoodsInfo = function(disposableGoodsId,disposableGoodsStockIds,disposableGoodsBatchStockIds) {
+ loadExpensiveDisposableGoodsForm(disposableGoodsId,disposableGoodsStockIds,disposableGoodsBatchStockIds);
+ top.Ext.getCmp('diposableGoodsForm').form.load({
+ url : WWWROOT + '/disinfectSystem/diposableGoodsAction!loadDiposableGoods.do',
+ method : 'GET',
+ waitMsg : '正在加载数据,请稍候',
+ params : {id : disposableGoodsId},
+ success : function(form, action) {
+ var disposableGoods = action.result.data;
+ },
+ failure : function(form, action) {
+ }
+ });
+};