Index: ssts-web/src/main/webapp/disinfectsystem/recyclingdamagerecord/damageMaterialAdditionalForm.js
===================================================================
diff -u -r26166 -r41489
--- ssts-web/src/main/webapp/disinfectsystem/recyclingdamagerecord/damageMaterialAdditionalForm.js (.../damageMaterialAdditionalForm.js) (revision 26166)
+++ ssts-web/src/main/webapp/disinfectsystem/recyclingdamagerecord/damageMaterialAdditionalForm.js (.../damageMaterialAdditionalForm.js) (revision 41489)
@@ -1,9 +1,9 @@
var additionalMaterialStore;
var idCardLostName = "器械包标识牌";
-function deleteItem(id){
- for(var i = 0;i < additionalMaterialStore.getCount();i++){
+function deleteItem(id) {
+ for (var i = 0; i < additionalMaterialStore.getCount(); i++) {
var record = additionalMaterialStore.getAt(i);
- if(record.get("id") == id){
+ if (record.get("id") == id) {
additionalMaterialStore.remove(record);
break;
}
@@ -12,420 +12,420 @@
/**
* 打印丢失标识牌
*/
-function suppleIDCard(tousseDefinitionId,errorId,taskId){
+function suppleIDCard(tousseDefinitionId, errorId, taskId) {
forSupplement = true;
tousseDefinitionID = tousseDefinitionId;
recyclingErrorID = errorId;
packingTaskID = taskId;
showIDCardListView();
-
-
+
+
suppleIDCardWin = new top.Ext4.Window({
- id : 'suppleIDCardWin',
- layout : 'fit',
- title : '标识牌补充',
- modal : true,
- border : false,
- width : 950,
- height : 660,
- items : [signBoardForm]
- });
+ id: 'suppleIDCardWin',
+ layout: 'fit',
+ title: '标识牌补充',
+ modal: true,
+ border: false,
+ width: 950,
+ height: 660,
+ items: [signBoardForm]
+ });
suppleIDCardWin.show();
}
/******** 补充器械 start********/
-function additionalMaterial(type,packingTaskId,errorOrDamageRemark) {
-
+function additionalMaterial(type, packingTaskId, errorOrDamageRemark) {
+
additionalMaterialStore = new Ext.data.Store({
- proxy : new Ext.data.HttpProxy({
- url : WWWROOT + '/disinfectSystem/MaterialErrorDamageAction!loadAdditionalMaterialStore.do',
- method : 'POST'
+ proxy: new Ext.data.HttpProxy({
+ url: WWWROOT + '/disinfectSystem/MaterialErrorDamageAction!loadAdditionalMaterialStore.do',
+ method: 'POST'
}),
- baseParams : {type : type , packingTaskId : packingTaskId},
- reader : new Ext.data.JsonReader({
- totalProperty : 'total',
- root : 'data'
- },[
- {name : 'id',mapping : 'id'},
- {name : 'materialName',mapping : 'materialName'},
- {name : 'amount',mapping : 'amount'},
- {name : 'packingTaskId',mapping : 'packingTaskId'},
- {name : 'type',mapping : 'type'},
- {name : 'tousseDefinitionId',mapping : 'tousseDefinitionId'},
- {name : 'materialDefinitionId',mapping : 'materialDefinitionId'},
- {name : 'packingTaskId',mapping : 'packingTaskId'},
- {name : 'materialType',mapping : 'materialType'},
- {name : 'departType',mapping : 'departType'}
+ baseParams: { type: type, packingTaskId: packingTaskId },
+ reader: new Ext.data.JsonReader({
+ totalProperty: 'total',
+ root: 'data'
+ }, [
+ { name: 'id', mapping: 'id' },
+ { name: 'materialName', mapping: 'materialName' },
+ { name: 'amount', mapping: 'amount' },
+ { name: 'packingTaskId', mapping: 'packingTaskId' },
+ { name: 'type', mapping: 'type' },
+ { name: 'tousseDefinitionId', mapping: 'tousseDefinitionId' },
+ { name: 'materialDefinitionId', mapping: 'materialDefinitionId' },
+ { name: 'packingTaskId', mapping: 'packingTaskId' },
+ { name: 'materialType', mapping: 'materialType' },
+ { name: 'departType', mapping: 'departType' }
])
});
additionalMaterialStore.load();
-
+
var materialTypeStore = new top.Ext.data.Store({
- proxy : new Ext.data.HttpProxy({
- url : WWWROOT + '/disinfectSystem/packingAction!getMaterialTypeType.do',
- method : 'POST'
- }),
- reader : new Ext.data.JsonReader({
- root : 'data'
- },[
- {name : 'value'}
- ]
- )
+ proxy: new Ext.data.HttpProxy({
+ url: WWWROOT + '/disinfectSystem/packingAction!getMaterialTypeType.do',
+ method: 'POST'
+ }),
+ reader: new Ext.data.JsonReader({
+ root: 'data'
+ }, [
+ { name: 'value' }
+ ]
+ )
});
materialTypeStore.load();
-
+
var departTypeStore = new top.Ext.data.Store({
- proxy : new Ext.data.HttpProxy({
- url : WWWROOT + '/disinfectSystem/packingAction!getDamageErrorDepartType.do',
- method : 'POST'
- }),
- reader : new Ext.data.JsonReader({
- root : 'data'
- },[
- {name : 'value'}
- ]
- )
+ proxy: new Ext.data.HttpProxy({
+ url: WWWROOT + '/disinfectSystem/packingAction!getDamageErrorDepartType.do',
+ method: 'POST'
+ }),
+ reader: new Ext.data.JsonReader({
+ root: 'data'
+ }, [
+ { name: 'value' }
+ ]
+ )
});
departTypeStore.load();
-
- var cm = new top.Ext.grid.ColumnModel([new top.Ext.grid.RowNumberer({header:"序号",width:40}),
- {
- name:'id',
- hidden :true,
- dataIndex : 'id'
- },{
- hidden : true,
- dataIndex : 'packingTaskId'
- },{
- header : "器械名称",
- width:180,
- dataIndex : 'materialName'
- },{
- header : "待补充数量",
- width:80,
- dataIndex : 'amount'
- },{
- header : "分类类型",
- width:100,
- dataIndex : 'departType',
- sortable: false,
- editor : new top.Ext.form.ComboBox({
- allowBlank : false,
- forceSelection : true,
- allowBlank : false,
- triggerAction : 'all',
- valueField : 'value',
- displayField : 'value',
- mode : 'local',
- store : departTypeStore,
- listeners : {
-// change:function( thiz, newValue, oldValue ){
-// alert("22")
-// if(oldValue != newValue){
-// var record = top.Ext.getCmp('configGrid').getSelectionModel().getSelected();
-// record.set('materialType',"");
-// }
-// }
- select:function( combo, record, index ){
- var record = top.Ext.getCmp('configGrid').getSelectionModel().getSelected();
- record.set('materialType',"");
- }
+
+ var cm = new top.Ext.grid.ColumnModel([new top.Ext.grid.RowNumberer({ header: "序号", width: 40 }),
+ {
+ name: 'id',
+ hidden: true,
+ dataIndex: 'id'
+ }, {
+ hidden: true,
+ dataIndex: 'packingTaskId'
+ }, {
+ header: "器械名称",
+ width: 180,
+ dataIndex: 'materialName'
+ }, {
+ header: "待补充数量",
+ width: 80,
+ dataIndex: 'amount'
+ }, {
+ header: "分类类型",
+ width: 100,
+ dataIndex: 'departType',
+ sortable: false,
+ editor: new top.Ext.form.ComboBox({
+ allowBlank: false,
+ forceSelection: true,
+ allowBlank: false,
+ triggerAction: 'all',
+ valueField: 'value',
+ displayField: 'value',
+ mode: 'local',
+ store: departTypeStore,
+ listeners: {
+ // change:function( thiz, newValue, oldValue ){
+ // alert("22")
+ // if(oldValue != newValue){
+ // var record = top.Ext.getCmp('configGrid').getSelectionModel().getSelected();
+ // record.set('materialType',"");
+ // }
+ // }
+ select: function (combo, record, index) {
+ var record = top.Ext.getCmp('configGrid').getSelectionModel().getSelected();
+ record.set('materialType', "");
}
- })
- },{
- header : "器械类型",
- width:90,
- dataIndex : 'materialType',
- sortable: false,
- editor : new top.Ext.form.ComboBox({
- allowBlank : false,
- forceSelection : true,
- allowBlank : false,
- triggerAction : 'all',
- valueField : 'value',
- displayField : 'value',
- mode : 'local',
- store : materialTypeStore,
- listeners : {
- focus:function(thiz){
- // 选择材料类型,根据选择的科室类型加载
- var record = top.Ext.getCmp('configGrid').getSelectionModel().getSelected();
- var value = record.get('departType');
- materialTypeStore.baseParams.departTypeName = value;
- materialTypeStore.load();
- }
+ }
+ })
+ }, {
+ header: "器械类型",
+ width: 90,
+ dataIndex: 'materialType',
+ sortable: false,
+ editor: new top.Ext.form.ComboBox({
+ allowBlank: false,
+ forceSelection: true,
+ allowBlank: false,
+ triggerAction: 'all',
+ valueField: 'value',
+ displayField: 'value',
+ mode: 'local',
+ store: materialTypeStore,
+ listeners: {
+ focus: function (thiz) {
+ // 选择材料类型,根据选择的科室类型加载
+ var record = top.Ext.getCmp('configGrid').getSelectionModel().getSelected();
+ var value = record.get('departType');
+ materialTypeStore.baseParams.departTypeName = value;
+ materialTypeStore.load();
}
- })
- },{
- header:'操作',
- width :50,
- menuDisabled: true,
- dataIndex:'id',
- renderer: function(v,p,record){
- var element = "";
- var materialName = record.get("materialName");
- var tousseDefinitionId = record.get("tousseDefinitionId");
- if(idCardLostName == materialName){
- element += "";
- }
- if(packingTaskId == ""){
- element += "  
";
- }
- return element;
}
+ })
+ }, {
+ header: '操作',
+ width: 50,
+ menuDisabled: true,
+ dataIndex: 'id',
+ renderer: function (v, p, record) {
+ var element = "";
+ var materialName = record.get("materialName");
+ var tousseDefinitionId = record.get("tousseDefinitionId");
+ if (idCardLostName == materialName) {
+ element += "";
+ }
+ if (packingTaskId == "") {
+ element += "  
";
+ }
+ return element;
}
+ }
]);
var goodsRecord = Ext.data.Record.create([
- {name : 'id'},
- {name : 'materialName'},
- {name : 'amount'}
+ { name: 'id' },
+ { name: 'materialName' },
+ { name: 'amount' }
]);
//仓库
var warehouseStore = new Ext.data.Store({
- proxy : new Ext.data.HttpProxy({
- url:WWWROOT + '/disinfectSystem/baseData/wareHouseAction!getWareHouseData.do',
- method : 'POST'
+ proxy: new Ext.data.HttpProxy({
+ url: WWWROOT + '/disinfectSystem/baseData/wareHouseAction!getWareHouseData.do',
+ method: 'POST'
}),
- reader : new Ext.data.JsonReader({
- root : 'data'
+ reader: new Ext.data.JsonReader({
+ root: 'data'
}, [
- {name : 'id',mapping : 'id'},
- {name : 'name',mapping : 'name'}
+ { name: 'id', mapping: 'id' },
+ { name: 'name', mapping: 'name' }
]),
- listeners :{
- load:function(store,record,opts){
- if(record.length > 0) {
+ listeners: {
+ load: function (store, record, opts) {
+ if (record.length > 0) {
top.Ext.getCmp('warehouse').setValue(record[0].data.id);
}
}
- }
- });
+ }
+ });
warehouseStore.load();
- var tbar = [
- {
- text : '篮筐条码: '
- },{
- xtype : 'hidden',
- id : 'scanedBarcode',
- name : 'scanedBarcode',
- value : ""
- },{
- xtype : 'textfield',
- allowBlank : true,
- name : "inputText",
- id : "inputText",
- width : 150,
- listeners : {
- specialkey : function(field, ee) {
+ var tbar = [
+ {
+ text: '篮筐条码: '
+ }, {
+ xtype: 'hidden',
+ id: 'scanedBarcode',
+ name: 'scanedBarcode',
+ value: ""
+ }, {
+ xtype: 'textfield',
+ allowBlank: true,
+ name: "inputText",
+ id: "inputText",
+ width: 150,
+ listeners: {
+ specialkey: function (field, ee) {
if (ee.getKey() == Ext.EventObject.ENTER) {
var barcode = top.Ext.getCmp('inputText').getValue();
- if(barcode != null && barcode != ""){
+ if (barcode != null && barcode != "") {
Ext.Ajax.request({
- url : WWWROOT + '/disinfectSystem/washAndDisinfect/washAndDisinfectRecordAction!loadClassifyBasket.do',
- params : {basketBarcode : barcode},
- success : function(response, options) {
+ url: WWWROOT + '/disinfectSystem/washAndDisinfect/washAndDisinfectRecordAction!loadClassifyBasket.do',
+ params: { basketBarcode: barcode },
+ success: function (response, options) {
var result = Ext.decode(response.responseText);
- if(result.message != ""){
- showResult(result.message , null , sstsConfig.messagePauseTimeOnPackingPage);
- }else{
+ if (result.message != "") {
+ showResult(result.message, null, sstsConfig.messagePauseTimeOnPackingPage);
+ } else {
top.Ext.getCmp("scanedBarcode").setValue(barcode);
- top.Ext.getCmp("showBasketName").setText("清洗篮筐名称:"+result.data.containerName);
+ top.Ext.getCmp("showBasketName").setText("清洗篮筐名称:" + result.data.containerName);
top.Ext.getCmp("inputText").setValue("");
}
},
- failure : function(response, options) {
- showResult("系统加载失败,请稍候再试" , null , sstsConfig.messagePauseTimeOnPackingPage);
+ failure: function (response, options) {
+ showResult("系统加载失败,请稍候再试", null, sstsConfig.messagePauseTimeOnPackingPage);
}
});
- }else{
- showResult('请扫描篮筐条码!' , null , sstsConfig.messagePauseTimeOnPackingPage);
+ } else {
+ showResult('请扫描篮筐条码!', null, sstsConfig.messagePauseTimeOnPackingPage);
}
}
}
}
- },{
- xtype : 'button',
- id : 'showBasketName'
- },"->",{
- text : '仓库: '
- },"->",{
- xtype : 'combo',
- id : 'warehouse',
- name : 'warehouse',
- queryParam : 'spell',
- fieldLabel : '仓库',
- minChars : 0,
- valueField : 'id',
- displayField : 'name',
- store : warehouseStore,
+ }, {
+ xtype: 'button',
+ id: 'showBasketName'
+ }, "->", {
+ text: '仓库: '
+ }, "->", {
+ xtype: 'combo',
+ id: 'warehouse',
+ name: 'warehouse',
+ queryParam: 'spell',
+ fieldLabel: '仓库',
+ minChars: 0,
+ valueField: 'id',
+ displayField: 'name',
+ store: warehouseStore,
//forceSelection : false,
- selectOnFocus:true,
- lazyInit : true,
- anchor : '95%',
- listWidth:200,
- triggerAction : 'all',
- hideTrigger : false,
- typeAhead : false,
- allowBlank : true,
- editable : false,
- enableKeyEvents:true
+ selectOnFocus: true,
+ lazyInit: true,
+ anchor: '95%',
+ listWidth: 200,
+ triggerAction: 'all',
+ hideTrigger: false,
+ typeAhead: false,
+ allowBlank: true,
+ editable: false,
+ enableKeyEvents: true
}
];
-
+
formObj = new top.Ext.FormPanel({
- id : 'deviceMaintenanceForm',
- frame : true,
- labelAlign:'right',
- labelSeparator : ':',
- bodyStyle : 'padding:5px 5px 0px 5px',
- autoWidth : true,
- autoHeight : true,
- autoScroll : true,
- items:[{
- layout : 'column',
- items : [{
- xtype : 'hidden',
- name : 'id',
- id : 'id'
- },{
- columnWidth : 1,
+ id: 'deviceMaintenanceForm',
+ frame: true,
+ labelAlign: 'right',
+ labelSeparator: ':',
+ bodyStyle: 'padding:5px 5px 0px 5px',
+ autoWidth: true,
+ autoHeight: true,
+ autoScroll: true,
+ items: [{
+ layout: 'column',
+ items: [{
+ xtype: 'hidden',
+ name: 'id',
+ id: 'id'
+ }, {
+ columnWidth: 1,
layout: 'form',
- items : [
+ items: [
new top.Ext.grid.EditorGridPanel({
- id : 'configGrid',
- store : additionalMaterialStore,
- tbar : tbar,
- cm : cm,
- width : 100,
+ id: 'configGrid',
+ store: additionalMaterialStore,
+ tbar: tbar,
+ cm: cm,
+ width: 100,
height: 240,
- clicksToEdit : 1,
- isCheckboxSelectionModel : true,
- frame : false,
- bodyStyle : 'border:1px solid #afd7af',
- anchor : '100%',
- selModel : new top.Ext.grid.RowSelectionModel({
- singleSelect : false
+ clicksToEdit: 1,
+ isCheckboxSelectionModel: true,
+ frame: false,
+ bodyStyle: 'border:1px solid #afd7af',
+ anchor: '100%',
+ selModel: new top.Ext.grid.RowSelectionModel({
+ singleSelect: false
})
})
]
- },{
- columnWidth : 1,
+ }, {
+ columnWidth: 1,
layout: 'form',
- hidden:(!sstsConfig.enablePackingMaterialErrorDamageRemark || type != "丢失"),
- items:[{
- xtype : 'textfield',
- fieldLabel : '丢失备注',
- componentCls:'formItemMgn',
- id : 'errorRemark',
- name : 'errorRemark',
- maxLength : '30',
- labelWidth:30,
- anchor : '95%',
- allowBlank : true,
- readOnly : true,
- value:errorOrDamageRemark,
- cls : 'fieldReadOnlyNoRemove',
- labelAlign:'right'
+ hidden: (!sstsConfig.enablePackingMaterialErrorDamageRemark || type != "丢失"),
+ items: [{
+ xtype: 'textfield',
+ fieldLabel: '丢失备注',
+ componentCls: 'formItemMgn',
+ id: 'errorRemark',
+ name: 'errorRemark',
+ maxLength: '30',
+ labelWidth: 30,
+ anchor: '95%',
+ allowBlank: true,
+ readOnly: true,
+ value: errorOrDamageRemark,
+ cls: 'fieldReadOnlyNoRemove',
+ labelAlign: 'right'
}]
- },{
- columnWidth : 1,
+ }, {
+ columnWidth: 1,
layout: 'form',
- hidden:(!sstsConfig.enablePackingMaterialErrorDamageRemark || type != "报损"),
- items:[{
- xtype : 'textfield',
- fieldLabel : '报损备注',
- componentCls:'formItemMgn',
- id : 'damageRemark',
- name : 'damageRemark',
- maxLength : '30',
- labelWidth:30,
- anchor : '95%',
- allowBlank : true,
- readOnly : true,
- value:errorOrDamageRemark,
- cls : 'fieldReadOnlyNoRemove',
- labelAlign:'right'
+ hidden: (!sstsConfig.enablePackingMaterialErrorDamageRemark || type != "报损"),
+ items: [{
+ xtype: 'textfield',
+ fieldLabel: '报损备注',
+ componentCls: 'formItemMgn',
+ id: 'damageRemark',
+ name: 'damageRemark',
+ maxLength: '30',
+ labelWidth: 30,
+ anchor: '95%',
+ allowBlank: true,
+ readOnly: true,
+ value: errorOrDamageRemark,
+ cls: 'fieldReadOnlyNoRemove',
+ labelAlign: 'right'
}]
}]
}],
- buttons : [{
- id : 'saveBtn',
- text : '确定',
- handler : function(){
+ buttons: [{
+ id: 'saveBtn',
+ text: '确定',
+ handler: function () {
var length = additionalMaterialStore.getCount();
var warehouseId = top.Ext.getCmp("warehouse").getValue();
- if(length == 0){
- showResult("没有待补充的器械!" , null , sstsConfig.messagePauseTimeOnPackingPage);
+ if (length == 0) {
+ showResult("没有待补充的器械!", null, sstsConfig.messagePauseTimeOnPackingPage);
return false;
}
var materialArray = [];
- for(var i = 0 ; i < length ; i++){
+ for (var i = 0; i < length; i++) {
var record = additionalMaterialStore.getAt(i);
var id = record.get("id");
var materialName = record.get("materialName");
var amount = record.get("amount");
materialArray.push({
- id : id,
+ id: id,
materialName: materialName,
- amount : amount,
- materialType : record.get("materialType"),
- departType : record.get("departType"),
- packingTaskId : record.get("packingTaskId"),
- materialDefinitionId : record.get("materialDefinitionId")
+ amount: amount,
+ materialType: record.get("materialType"),
+ departType: record.get("departType"),
+ packingTaskId: record.get("packingTaskId"),
+ materialDefinitionId: record.get("materialDefinitionId")
});
}
-
+
var washBasketBarcode = top.Ext.getCmp("scanedBarcode").getValue();
-
+
var params = {
- packingTaskId : packingTaskId,
- suppleStr : Ext.encode(materialArray),
- type : type,
- washBasketBarcode : washBasketBarcode,
- warehouseId:warehouseId
+ packingTaskId: packingTaskId,
+ suppleStr: Ext.encode(materialArray),
+ type: type,
+ washBasketBarcode: washBasketBarcode,
+ warehouseId: warehouseId
}
-
+
Ext.Ajax.request({
- url : WWWROOT + '/disinfectSystem/MaterialErrorDamageAction!materialSupplement.do',
- params : params,
- success : function(response, options) {
- var result = Ext.decode(response.responseText);
- showResult(result.message , null , sstsConfig.messagePauseTimeOnPackingPage);
- if(result.success){
- additionalMaterialCallback(result.success,type,packingTaskId);
-
- if(packingTaskId == ""){
- reflushGrid()
- }
-
- top.Ext.getCmp("additionalMaterialWin").close();
- }
- },
- failure : function(response, options) {
- var result = Ext.decode(response.responseText);
- showResult(result.message , null , sstsConfig.messagePauseTimeOnPackingPage);
- }
- });
+ url: WWWROOT + '/disinfectSystem/MaterialErrorDamageAction!materialSupplement.do',
+ params: params,
+ success: function (response, options) {
+ var result = Ext.decode(response.responseText);
+ showResult(result.message, null, sstsConfig.messagePauseTimeOnPackingPage);
+ if (result.success) {
+ additionalMaterialCallback(result.success, type, packingTaskId);
+
+ if (packingTaskId == "") {
+ reflushGrid()
+ }
+
+ top.Ext.getCmp("additionalMaterialWin").close();
+ }
+ },
+ failure: function (response, options) {
+ var result = Ext.decode(response.responseText);
+ showResult(result.message, null, sstsConfig.messagePauseTimeOnPackingPage);
+ }
+ });
}
- },{
- id : 'cancleBtn',
- text : '取消',
- handler : function() {
+ }, {
+ id: 'cancleBtn',
+ text: '取消',
+ handler: function () {
formWindow.close();
}
}]
});
-
- formWindow = new top.Ext.Window( {
- id : 'additionalMaterialWin',
- layout : 'fit',
- title : '器械补充',
- width : 600,
- modal : true,
- autoHeight : true,
- border : false,
- plain : true,
- items : [formObj]
+
+ formWindow = new top.Ext.Window({
+ id: 'additionalMaterialWin',
+ layout: 'fit',
+ title: '器械补充',
+ width: 600,
+ modal: true,
+ autoHeight: true,
+ border: false,
+ plain: true,
+ items: [formObj]
});
formWindow.show();