Index: ssts-web/src/main/webapp/disinfectsystem/basedatamanager/container/containerForm.js
===================================================================
diff -u -r36412 -r40658
--- ssts-web/src/main/webapp/disinfectsystem/basedatamanager/container/containerForm.js (.../containerForm.js) (revision 36412)
+++ ssts-web/src/main/webapp/disinfectsystem/basedatamanager/container/containerForm.js (.../containerForm.js) (revision 40658)
@@ -6,357 +6,433 @@
function addAndEditContainer(id) {
this.id = id;
-
- var isDeposableStore = new Ext.data.SimpleStore( {
- fields : [ 'value' ],
- data : [['篮筐'], ['灭菌架']]
+
+ var isDeposableStore = new Ext.data.SimpleStore({
+ fields: ['value'],
+ data: [['篮筐'], ['灭菌架']]
});
- var containerUseageStore = new Ext.data.SimpleStore( {
- fields : [ 'value' ],
- data : [['清洗筐'], ['灭菌筐']]
+ var containerUseageStore = new Ext.data.SimpleStore({
+ fields: ['value'],
+ data: [['清洗筐'], ['灭菌筐']]
});
-
+
var departInfoStore = new Ext.data.Store({
- proxy : new top.Ext.data.HttpProxy({
- url : WWWROOT + '/disinfectSystem/baseData/rinserAction!getDepartmentInfo.do',
- method : "POST"
+ proxy: new top.Ext.data.HttpProxy({
+ url: WWWROOT + '/disinfectSystem/baseData/rinserAction!getDepartmentInfo.do',
+ method: "POST"
}),
- reader : new top.Ext.data.JsonReader({
- fields : [ "orgUnitCoding", "orgUnitName"]
+ reader: new top.Ext.data.JsonReader({
+ fields: ["orgUnitCoding", "orgUnitName"]
})
});
var washClassifyStore = new Ext.data.JsonStore({
- url : WWWROOT + '/disinfectSystem/baseData/materialDefinitionAction!getHttpOptionResultSet.do',
- root: 'data',
- baseParams : {optionType : optionType_washClassify},
- fields: [
- {name : 'value',mapping : 'value'},
- ]
+ url: WWWROOT + '/disinfectSystem/baseData/materialDefinitionAction!getHttpOptionResultSet.do',
+ root: 'data',
+ baseParams: { optionType: optionType_washClassify },
+ fields: [
+ { name: 'value', mapping: 'value' },
+ ]
});
var sterilingModeStore = new Ext.data.JsonStore({
- url : WWWROOT + '/disinfectSystem/core/httpOptionController/getHttpOptionList.mhtml',
- root: 'data',
- baseParams : {optionListId: 'sterilizationMode'},
- fields: [
- {name : 'value',mapping : 'value'},
- ],
- listeners: {
- load:function(store){
- var data = {'id': '0', 'value': ' '};
- var rs = [new Ext.data.Record(data)];
- store.insert(0, rs);
- }
- }
+ url: WWWROOT + '/disinfectSystem/core/httpOptionController/getHttpOptionList.mhtml',
+ root: 'data',
+ baseParams: { optionListId: 'sterilizationMode' },
+ fields: [
+ { name: 'value', mapping: 'value' },
+ ],
+ listeners: {
+ load: function (store) {
+ var data = { 'id': '0', 'value': ' ' };
+ var rs = [new Ext.data.Record(data)];
+ store.insert(0, rs);
+ }
+ }
});
formObj = new top.Ext.FormPanel({
- id : 'containerForm',
- frame : true,
- labelSeparator : ':',
- labelAlign:'right',
- bodyStyle : 'padding:5px 5px 0px 5px',
- autoHeight:true,
- autoScroll : true,
- items : [ {
- xtype : 'hidden',
- name : 'id',
- id : 'id'
- },{
- xtype : 'hidden',
- name : 'departCode',
- id : 'departCode'
- },{
- xtype : 'hidden',//科室编码隐藏域
- name : "bindDepartCodes",
- id : "bindDepartCodes"
+ id: 'containerForm',
+ frame: true,
+ labelSeparator: ':',
+ labelAlign: 'right',
+ bodyStyle: 'padding:5px 5px 0px 5px',
+ autoHeight: true,
+ autoScroll: true,
+ items: [{
+ xtype: 'hidden',
+ name: 'id',
+ id: 'id'
}, {
- layout : 'column',
- items : [{
- columnWidth : 0.5,
- layout : 'form',
- labelWidth:80,
- items : [{
- xtype : 'textfield',
- fieldLabel : "条形码",
- name : "barcode",
- id : "barcode",
- anchor : '95%',
- readOnly : true,
- cls : 'fieldReadOnlyNoRemove'
- },{
- xtype : 'textfield',
- fieldLabel : "名称",
- allowBlank : false,
- name : "containerName",
- id : "containerName",
- anchor : '95%'
- },{
- xtype : 'combo',
- fieldLabel : '处理科室',
- id : 'departName',
- name : 'departName',
- width : 120,
- valueField : 'orgUnitCoding',
- displayField : 'orgUnitName',
- store : departInfoStore,
- forceSelection : true,
- editable:false,
- triggerAction : 'all',
- allowBlank : false,
- anchor : '95%',
- listeners : {
- select : function(combo, record, index) {
+ xtype: 'hidden',
+ name: 'departCode',
+ id: 'departCode'
+ }, {
+ xtype: 'hidden',//科室编码隐藏域
+ name: "bindDepartCodes",
+ id: "bindDepartCodes"
+ }, {
+ layout: 'column',
+ items: [{
+ columnWidth: 0.5,
+ layout: 'form',
+ labelWidth: 80,
+ items: [{
+ xtype: 'textfield',
+ fieldLabel: "条形码",
+ name: "barcode",
+ id: "barcode",
+ anchor: '95%',
+ readOnly: true,
+ cls: 'fieldReadOnlyNoRemove'
+ }]
+ }, {
+ columnWidth: 0.5,
+ layout: 'form',
+ labelWidth: 80,
+ items: [{
+ xtype: 'combo',
+ fieldLabel: '类型',
+ id: 'containerType',
+ name: 'containerType',
+ width: 110,
+ editable: false,
+ valueField: 'value',
+ displayField: 'value',
+ store: isDeposableStore,
+ forceSelection: true,
+ mode: 'local',
+ triggerAction: 'all',
+ allowBlank: false,
+ anchor: '95%'
+ }]
+ }, {
+ columnWidth: 0.5,
+ layout: 'form',
+ labelWidth: 80,
+ items: [{
+ xtype: 'textfield',
+ fieldLabel: "名称",
+ allowBlank: false,
+ name: "containerName",
+ id: "containerName",
+ anchor: '95%'
+ }]
+ }, {
+ columnWidth: 0.5,
+ layout: 'form',
+ labelWidth: 80,
+ items: [{
+ xtype: 'combo',
+ fieldLabel: '用作',
+ id: 'purpose',
+ name: 'purpose',
+ width: 110,
+ editable: false,
+ valueField: 'value',
+ displayField: 'value',
+ store: containerUseageStore,
+ forceSelection: true,
+ mode: 'local',
+ triggerAction: 'all',
+ allowBlank: false,
+ anchor: '95%',
+ listeners: {
+ select: function (combo, record, index) {
+ var selectedType = record.data.value;
+ if (selectedType == "灭菌筐") {
+ top.Ext.getCmp("sterilingModeBox").show();
+ top.Ext.getCmp("sterilingMode").setValue('');
+ if (sstsConfig.enbaleLoadAutomaticallyIntoBasketsAfterAssembly) {
+ top.Ext.getCmp("bindBasketBox").show();
+ }
+ }
+ else {
+ top.Ext.getCmp("sterilingModeBox").hide();
+ top.Ext.getCmp("sterilingMode").setValue('');
+ if (sstsConfig.enbaleLoadAutomaticallyIntoBasketsAfterAssembly) {
+ top.Ext.getCmp("bindBasketBox").hide();
+ }
+ }
+ }
+ }
+ }]
+ }, {
+ columnWidth: 0.5,
+ layout: 'form',
+ labelWidth: 80,
+ items: [{
+ xtype: 'combo',
+ fieldLabel: '处理科室',
+ id: 'departName',
+ name: 'departName',
+ width: 120,
+ valueField: 'orgUnitCoding',
+ displayField: 'orgUnitName',
+ store: departInfoStore,
+ forceSelection: true,
+ editable: false,
+ triggerAction: 'all',
+ allowBlank: false,
+ anchor: '95%',
+ listeners: {
+ select: function (combo, record, index) {
top.Ext.getCmp('departCode').setValue((record.data.orgUnitCoding));
}
}
- },{
- xtype : 'combo',
- fieldLabel : '灭菌方式',
- id : 'sterilingMode',
- name : 'sterilingMode',
- width : 130,
- valueField : 'value',
- displayField : 'value',
- hidden : isDisinfectionBasket,
- store : sterilingModeStore,
+ }]
+ }, {
+ columnWidth: 0.5,
+ layout: 'form',
+ labelWidth: 80,
+ items: [{
+ xtype: 'combo',
+ fieldLabel: '清洗分类类型',
+ id: 'washClassifyType',
+ name: 'washClassifyType',
+ width: 130,
+ valueField: 'value',
+ displayField: 'value',
+ store: washClassifyStore,
allowBlank: true,
- editable:false,
- forceSelection : true,
- triggerAction : 'all',
- anchor : '95%',
- listeners : {
- select : function(combo, record, index) {
- if(record.data.id == 0 && record.data.value == " "){
+ editable: true,
+ forceSelection: true,
+ triggerAction: 'all',
+ anchor: '95%'
+ }]
+ }, {
+ columnWidth: 0.5,
+ layout: 'form',
+ labelWidth: 80,
+ id: 'sterilingModeBox',
+ items: [{
+ xtype: 'combo',
+ fieldLabel: '灭菌方式',
+ id: 'sterilingMode',
+ name: 'sterilingMode',
+ width: 130,
+ valueField: 'value',
+ displayField: 'value',
+ hidden: isDisinfectionBasket,
+ store: sterilingModeStore,
+ allowBlank: true,
+ editable: false,
+ forceSelection: true,
+ triggerAction: 'all',
+ anchor: '95%',
+ listeners: {
+ select: function (combo, record, index) {
+ if (record.data.id == 0 && record.data.value == " ") {
top.Ext.getCmp("sterilingMode").setValue('');
}
- },
- render:function(){
- /* setTimeout(function(){
- top.Ext.getCmp("sterilingMode").hide();
- },200) */
}
}
- }]
- },{
- columnWidth : 0.5,
- layout : 'form',
- labelWidth : 80,
- items : [{
- xtype : 'combo',
- fieldLabel : '类型',
- id : 'containerType',
- name : 'containerType',
- width : 110,
- editable:false,
- valueField : 'value',
- displayField : 'value',
- store : isDeposableStore,
- forceSelection : true,
- mode : 'local',
- triggerAction : 'all',
- allowBlank : false,
- anchor : '95%'
- },{
- xtype : 'combo',
- fieldLabel : '用作',
- id : 'purpose',
- name : 'purpose',
- width : 110,
- editable:false,
- valueField : 'value',
- displayField : 'value',
- store : containerUseageStore,
- forceSelection : true,
- mode : 'local',
- triggerAction : 'all',
- allowBlank : false,
- anchor : '95%',
- listeners : {
- select : function(combo, record, index) {
- var selectedType = record.data.value;
- if(selectedType == "灭菌筐"){
- top.Ext.getCmp("sterilingMode").show();
- top.Ext.getCmp("sterilingMode").setValue('');
- }
- else{
- top.Ext.getCmp("sterilingMode").hide();
- top.Ext.getCmp("sterilingMode").setValue('');
- }
- }
- }
- },{
- xtype : 'combo',
- fieldLabel : '清洗分类类型',
- id : 'washClassifyType',
- name : 'washClassifyType',
- width : 130,
- valueField : 'value',
- displayField : 'value',
- store : washClassifyStore,
+ }]
+ }, {
+ columnWidth: 1,
+ layout: 'form',
+ labelWidth: 80,
+ id: 'bindBasketBox',
+ hidden: !sstsConfig.enbaleLoadAutomaticallyIntoBasketsAfterAssembly,
+ items: [{
+ xtype: 'hidden',
+ id: 'containerBindingInfo',
+ name: 'containerBindingInfo'
+ }, {
+ xtype: 'hidden',
+ id: 'cleaningContainerIds',
+ name: 'cleaningContainerIds'
+ }, {
+ xtype: 'trigger',
+ fieldLabel: "绑定清洗篮筐",
allowBlank: true,
- editable:true,
- forceSelection : true,
- triggerAction : 'all',
- anchor : '95%'
- }]
- },{
- columnWidth :1,
- layout : 'form',
- labelWidth : 80,
- items : [{
- xtype : 'trigger',
- fieldLabel : "绑定科室",
- allowBlank : true,
- name : "bindDepartNames",
- id : "bindDepartNames",
- msgTarget:'side',
- readOnly:true,
- onTriggerClick : function(){
- setDepartOrgUnit('bindDepartCodes' , 'bindDepartNames' , top.Ext.getCmp('bindDepartCodes').getValue());
+ name: "cleaningContainerNames",
+ id: "cleaningContainerNames",
+ msgTarget: 'side',
+ readOnly: true,
+ onTriggerClick: function () {
+ setBindBaskets('cleaningContainerIds', 'cleaningContainerNames', top.Ext.getCmp('containerBindingInfo').getValue());
},
- triggerClass : 'x-form-search-trigger',
- anchor : '97.5%'
+ triggerClass: 'x-form-search-trigger',
+ anchor: '97.5%'
}]
+ }, {
+ columnWidth: 1,
+ layout: 'form',
+ labelWidth: 80,
+ items: [{
+ xtype: 'trigger',
+ fieldLabel: "绑定科室",
+ allowBlank: true,
+ name: "bindDepartNames",
+ id: "bindDepartNames",
+ msgTarget: 'side',
+ readOnly: true,
+ onTriggerClick: function () {
+ setDepartOrgUnit('bindDepartCodes', 'bindDepartNames', top.Ext.getCmp('bindDepartCodes').getValue());
+ },
+ triggerClass: 'x-form-search-trigger',
+ anchor: '97.5%'
+ }]
}]
}],
- buttons : [{
- id : 'preview',
- hidden : SSTS_ContainerBarcode_Print,
- text : '打印预览',
- handler : printBarcode
- },{
- id : 'saveAndPrint',
- hidden : SSTS_ContainerBarcode_Print,
- text : '保存并打印',
- handler : saveAndPrint
- },{
- id : 'saveBtn',
- text : '保存',
- handler : save
- },{
- id : 'reSetStatus',
- text : '重置状态',
- handler : resetStatus
- },{
- id : 'cleanPackingTask',
- text : '清除待装配任务',
- handler : cleanPackingTask,
- hidden:true
+ buttons: [{
+ id: 'preview',
+ hidden: SSTS_ContainerBarcode_Print,
+ text: '打印预览',
+ handler: printBarcode
}, {
- text : '取消',
- id : 'saveAndNewBtn',
- handler : cancel
+ id: 'saveAndPrint',
+ hidden: SSTS_ContainerBarcode_Print,
+ text: '保存并打印',
+ handler: saveAndPrint
+ }, {
+ id: 'saveBtn',
+ text: '保存',
+ handler: save
+ }, {
+ id: 'reSetStatus',
+ text: '重置状态',
+ handler: resetStatus
+ }, {
+ id: 'cleanPackingTask',
+ text: '清除待装配任务',
+ handler: cleanPackingTask,
+ hidden: true
+ }, {
+ text: '取消',
+ id: 'saveAndNewBtn',
+ handler: cancel
}]
});
-
- containerWin = new top.Ext.Window( {
- id : 'containerWin',
- layout : 'fit',
- title : '容器信息',
- width : 600,
- border : false,
- modal : true,
- autoHeight : true,
- plain : true,
- items : [ formObj ]
+
+ containerWin = new top.Ext.Window({
+ id: 'containerWin',
+ layout: 'fit',
+ title: '容器信息',
+ width: 600,
+ border: false,
+ modal: true,
+ autoHeight: true,
+ plain: true,
+ items: [formObj]
});
containerWin.show();
-
+
+ top.Ext.getCmp('bindBasketBox').hide();
+ top.Ext.getCmp('sterilingModeBox').hide();
+
formObj.form.load({
- url : WWWROOT + '/disinfectSystem/baseData/containerAction!loadContainer.do',
- method : 'GET',
- waitMsg : '正在加载数据,请稍候',
- success : function(form, action) {
- if(id==0) {
+ url: WWWROOT + '/disinfectSystem/baseData/containerAction!loadContainer.do',
+ method: 'GET',
+ waitMsg: '正在加载数据,请稍候',
+ success: function (form, action) {
+ if (id == 0) {
top.Ext.getCmp('containerType').setValue('篮筐');
- }else {
- if(action.result.data.purpose == '清洗筐'){
+ } else {
+ if (action.result.data.purpose == '清洗筐') {
top.Ext.getCmp('cleanPackingTask').show();
- }else {
+ top.Ext.getCmp('bindBasketBox').hide();
+ top.Ext.getCmp('sterilingModeBox').hide();
+ } else {
top.Ext.getCmp('cleanPackingTask').hide();
+ top.Ext.getCmp('bindBasketBox').show();
+ top.Ext.getCmp('sterilingModeBox').show();
}
+ if (action.result.containerBindingInfo && action.result.containerBindingInfo.length > 0) {
+ top.Ext.getCmp('containerBindingInfo').setValue(Ext.encode(action.result.containerBindingInfo));
+ var containerNameArr = [];
+ var containerBarcodeArr = [];
+ var containerIdArr = [];
+ var containerBindingInfo = action.result.containerBindingInfo;
+ for (var i = 0; i < containerBindingInfo.length; i++) {
+ containerNameArr.push(containerBindingInfo[i]["containerName"]);
+ containerBarcodeArr.push(containerBindingInfo[i]["barcode"]);
+ containerIdArr.push(containerBindingInfo[i]["id"]);
+ }
+ top.Ext.getCmp('cleaningContainerIds').setValue(containerIdArr.join(';'));
+ top.Ext.getCmp('cleaningContainerNames').setValue(containerNameArr.join(';'));
+ }
}
},
- failure : function(form, action) {
+ failure: function (form, action) {
},
- params : {
- id : id
+ params: {
+ id: id
}
});
}
-function printBarcode(){
+function printBarcode() {
var barcode = top.Ext.getCmp('barcode').getValue();
var name = top.Ext.getCmp('containerName').getValue();
var unitName2 = "";
DWREngine.setAsync(false);
- SupplyRoomConfigTableManager.getUnitName(function(unitName){
- if(unitName != null && unitName != ""){
+ SupplyRoomConfigTableManager.getUnitName(function (unitName) {
+ if (unitName != null && unitName != "") {
unitName2 = unitName;
}
});
DWREngine.setAsync(true);
- print_container(barcode,name,unitName2,PRINT_TYPE_PREVIEW);
+ print_container(barcode, name, unitName2, PRINT_TYPE_PREVIEW);
}
-function containerDefaultPrint(barcodeStr){
+function containerDefaultPrint(barcodeStr) {
var name = top.Ext.getCmp('containerName').getValue();
var unitName2 = "";
DWREngine.setAsync(false);
- SupplyRoomConfigTableManager.getUnitName(function(unitName){
- if(unitName != null && unitName != ""){
+ SupplyRoomConfigTableManager.getUnitName(function (unitName) {
+ if (unitName != null && unitName != "") {
unitName2 = unitName;
}
});
- print_container(barcodeStr,name,unitName2,PRINT_TYPE_PRINT);//打印条码
+ print_container(barcodeStr, name, unitName2, PRINT_TYPE_PRINT);//打印条码
}
-function validateAndSubmit(print){
+function validateAndSubmit(print) {
/*Annie 判断使用空格,特殊符号*/
- var bindDepartCodes = top.Ext.getCmp('bindDepartCodes').getValue();
- if(bindDepartCodes != ''){
- var pattern = new RegExp("[`~!@#$^&*()=|{}':',\\[\\].<>/?~!@#¥\\\\……&*()——|{}【】‘;:”“'。,、?]");
- if(pattern.test(bindDepartCodes)){
- showResult('存在使用非法字符,如果有多个科室编码请使用分号;隔开');
- return false;
- }
- if(bindDepartCodes.indexOf(' ')!== -1 ){
- showResult('不能使用空格,如果有多个科室编码请使用分号;隔开');
- return false;
+ var bindDepartCodes = top.Ext.getCmp('bindDepartCodes').getValue();
+ if (bindDepartCodes != '') {
+ var pattern = new RegExp("[`~!@#$^&*()=|{}':',\\[\\].<>/?~!@#¥\\\\……&*()——|{}【】‘;:”“'。,、?]");
+ if (pattern.test(bindDepartCodes)) {
+ showResult('存在使用非法字符,如果有多个科室编码请使用分号;隔开');
+ return false;
}
+ if (bindDepartCodes.indexOf(' ') !== -1) {
+ showResult('不能使用空格,如果有多个科室编码请使用分号;隔开');
+ return false;
+ }
}
Ext.Ajax.request({
- url : WWWROOT + '/disinfectSystem/baseData/containerAction!validate.do',
- params : {validateId : top.Ext.getCmp('id').getValue(),valifateName:top.Ext.getCmp('containerName').getValue()},
- success : function(response, options) {
+ url: WWWROOT + '/disinfectSystem/baseData/containerAction!validate.do',
+ params: { validateId: top.Ext.getCmp('id').getValue(), valifateName: top.Ext.getCmp('containerName').getValue() },
+ success: function (response, options) {
var result = Ext.decode(response.responseText);
- if(result.stauts==1){
- formObj.form.submit( {
- url : WWWROOT + '/disinfectSystem/baseData/containerAction!saveContainer.do',
- method : 'POST',
- waitMsg : '正在保存数据,请稍候',
- waitTitle : '提交表单',
- success : function(form, action) {
+ if (result.stauts == 1) {
+ formObj.form.submit({
+ url: WWWROOT + '/disinfectSystem/baseData/containerAction!saveContainer.do',
+ method: 'POST',
+ waitMsg: '正在保存数据,请稍候',
+ waitTitle: '提交表单',
+ success: function (form, action) {
var barcodeStr = action.result.barcode;
- if(print){
+ if (print) {
containerDefaultPrint(barcodeStr);
}
containerWin.close();
showResult('保存成功');
grid.dwrReload();
},
- failure : function(form, action) {
+ failure: function (form, action) {
showResult(action.result.message);
top.Ext.getCmp('saveBtn').enable();
top.Ext.getCmp('saveAndPrint').enable();
}
});
- }else{
+ } else {
showResult(result.message);
top.Ext.getCmp('saveBtn').enable();
top.Ext.getCmp('saveAndPrint').enable();
}
},
- failure : function(response, options) {
+ failure: function (response, options) {
var result = Ext.decode(response.responseText);
showResult(result.cause);
}
@@ -370,19 +446,19 @@
this.enable();
return false;
}
-
+
var print = false;
validateAndSubmit(print);
}
-function saveAndPrint(){
+function saveAndPrint() {
this.disable();
if (!formObj.form.isValid()) {
showResult('请正确填写表单各值');
this.enable();
return false;
}
-
+
var print = true;
validateAndSubmit(print);
}
Index: ssts-web/src/main/webapp/disinfectsystem/config/gdskqyy/config.js
===================================================================
diff -u -r40595 -r40658
--- ssts-web/src/main/webapp/disinfectsystem/config/gdskqyy/config.js (.../config.js) (revision 40595)
+++ ssts-web/src/main/webapp/disinfectsystem/config/gdskqyy/config.js (.../config.js) (revision 40658)
@@ -157,6 +157,8 @@
hideTrainingManage:false,
//包装区工作量及不合格率月报,按包统计并显示消毒物品
showDisinfectionByPackage:true,
+ //启用装配后自动装载到篮筐
+ enbaleLoadAutomaticallyIntoBasketsAfterAssembly:true,
//是否允许部分回收
enablePartRecycle:true
}
\ No newline at end of file
Index: ssts-web/src/main/webapp/disinfectsystem/basedatamanager/container/setDepartForm.js
===================================================================
diff -u -r26414 -r40658
--- ssts-web/src/main/webapp/disinfectsystem/basedatamanager/container/setDepartForm.js (.../setDepartForm.js) (revision 26414)
+++ ssts-web/src/main/webapp/disinfectsystem/basedatamanager/container/setDepartForm.js (.../setDepartForm.js) (revision 40658)
@@ -8,7 +8,7 @@
}
}
//删除多个
-function removeGridItem(supplyRoom){
+function removeGridItem(supplyRoom) {
var obj = top.Ext.getCmp('select_DepartsGrid');
var rows = obj.getSelectionModel().getSelections();// 返回值为
var store = obj.getStore();
@@ -17,7 +17,7 @@
return false;
}
if (rows) {
- for ( var i = 0; i < rows.length; i++) {
+ for (var i = 0; i < rows.length; i++) {
store.remove(rows[i]);
}
}
@@ -29,7 +29,7 @@
* @param departsCodes 页面上传回来的科室编码,多个情况用","
*/
function setDepartOrgUnit(extHiddenElementId, extComboElementId, departsCodes) {
-
+
//科室的窗口
var formWindowDeparts;
//确定保存
@@ -58,17 +58,17 @@
//科室record
var departAndTaskGroupRecord = Ext.data.Record.create([{
- name: 'departCode'
- },
- {
- name: 'departName'
- }
+ name: 'departCode'
+ },
+ {
+ name: 'departName'
+ }
]);
/**
* 添加所选择的科室名称
*/
- function addSelect_Depart(name,departId) {
+ function addSelect_Depart(name, departId) {
var departCode = top.Ext.getCmp('select_departCode').getValue();
var departName = top.Ext.getCmp('select_departCode').getRawValue();
if (departCode || (name != undefined && departId != undefined)) {
@@ -77,91 +77,91 @@
for (var i = 0; i < select_DepartsGridStore.getCount(); i++) {
var record = select_DepartsGridStore.getAt(i);
var tempName = record.get('departCode');
- if (tempName == departCode || tempName == departId) {
+ if (tempName == departCode || tempName == departId) {
isExist = true;
break;
}
}
if (!isExist) {
- if( name != undefined && departId != undefined){
+ if (name != undefined && departId != undefined) {
var record2 = new departAndTaskGroupRecord({
departCode: departId,
departName: name
});
select_DepartsGridStore.add(record2);
- }else{
+ } else {
var record = new departAndTaskGroupRecord({
departCode: departCode,
departName: departName
});
select_DepartsGridStore.add(record);
}
-
+
top.Ext.getCmp('select_departCode').setValue('');
top.Ext.getCmp('select_departCode').setRawValue('');
- }else {
- if(name != undefined && departId != undefined){
- showResult('科室:['+name+'] 已存在!');
- }else{
+ } else {
+ if (name != undefined && departId != undefined) {
+ showResult('科室:[' + name + '] 已存在!');
+ } else {
showResult("供应编码:" + departCode + ",供应室名称:" + departName + "已添加,请不要重复添加!");
}
-
+
}
} else {
showResult("请选择供应室");
}
- /* var departCode = top.Ext.getCmp('select_departCode').getValue();
- var departName = top.Ext.getCmp('select_departCode').getRawValue();
- if (departCode) {
- var isExist = false;
- for (var i = 0; i < select_DepartsGridStore.getCount(); i++) {
- var record = select_DepartsGridStore.getAt(i);
- if (record.get('departCode') == departCode) {
- isExist = true;
- break;
+ /* var departCode = top.Ext.getCmp('select_departCode').getValue();
+ var departName = top.Ext.getCmp('select_departCode').getRawValue();
+ if (departCode) {
+ var isExist = false;
+ for (var i = 0; i < select_DepartsGridStore.getCount(); i++) {
+ var record = select_DepartsGridStore.getAt(i);
+ if (record.get('departCode') == departCode) {
+ isExist = true;
+ break;
+ }
}
- }
- if (!isExist) {
- var record = new departAndTaskGroupRecord({
- departCode: departCode,
- departName: departName
- });
- select_DepartsGridStore.add(record);
- top.Ext.getCmp('select_departCode').setValue('');
- top.Ext.getCmp('select_departCode').setRawValue('');
+ if (!isExist) {
+ var record = new departAndTaskGroupRecord({
+ departCode: departCode,
+ departName: departName
+ });
+ select_DepartsGridStore.add(record);
+ top.Ext.getCmp('select_departCode').setValue('');
+ top.Ext.getCmp('select_departCode').setRawValue('');
+ } else {
+ showResult("供应编码:" + departCode + ",供应室名称:" + departName + "已添加,请不要重复添加!");
+ }
} else {
- showResult("供应编码:" + departCode + ",供应室名称:" + departName + "已添加,请不要重复添加!");
- }
- } else {
- showResult("请选择供应室");
- } */
+ showResult("请选择供应室");
+ } */
}
select_DepartsGridStore = new top.Ext.data.Store({
reader: departAndTaskGroupRecord
});
var smCheckbox = new top.Ext.grid.CheckboxSelectionModel({
- singleSelect : false,
+ singleSelect: false,
checkOnly: true
});
var cm = new top.Ext.grid.ColumnModel([
smCheckbox,
- {
- header: "科室编码",
- width: 140,
- dataIndex: 'departCode'
- }, {
- header: "科室名称",
- width: 140,
- dataIndex: 'departName'
- }, {
- header: '删除',
- width: 40,
- menuDisabled: true,
- dataIndex: 'button',
- renderer: function (v, p, record, index) {
- return "
";
- }
- }]);
+ {
+ header: "科室编码",
+ width: 140,
+ dataIndex: 'departCode'
+ }, {
+ header: "科室名称",
+ width: 140,
+ dataIndex: 'departName'
+ }, {
+ header: '删除',
+ width: 40,
+ menuDisabled: true,
+ dataIndex: 'button',
+ renderer: function (v, p, record, index) {
+ return "
";
+ }
+ }]);
//科室数据源
var departJsonStore = new Ext.data.Store({
@@ -172,13 +172,13 @@
reader: new Ext.data.JsonReader({
root: 'data'
}, [{
- name: 'departCode',
- mapping: 'id'
- },
- {
- name: 'name',
- mapping: 'name'
- }
+ name: 'departCode',
+ mapping: 'id'
+ },
+ {
+ name: 'name',
+ mapping: 'name'
+ }
])
});
@@ -212,49 +212,49 @@
}
}, {
text: '添加',
- iconCls : 'btn_ext_add',
+ iconCls: 'btn_ext_add',
handler: function () {
addSelect_Depart();
}
- },{
+ }, {
text: '添加全部',
- iconCls : 'icon_systemset',
+ iconCls: 'icon_systemset',
handler: function () {
Ext.Ajax.request({
- url : WWWROOT + '/disinfectSystem/baseData/supplyRoomConfigAction!getAllOrgUnitName.do',
- success : function(response, options) {
+ url: WWWROOT + '/disinfectSystem/baseData/supplyRoomConfigAction!getAllOrgUnitName.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;
+ for (var index = 0; index < lenth; index++) {
+ var name = result.data[index].name;
var departId = result.data[index].id;
- addSelect_Depart(name,departId);
+ addSelect_Depart(name, departId);
//addGridItem(supplyRoomStoreApply,name,departId,"");
}
},
- failure : function(response, options) {
+ failure: function (response, options) {
}
});
}
- },{
+ }, {
text: '删除',
- iconCls : 'btn_ext_application_del',
- handler : function() {
+ iconCls: 'btn_ext_application_del',
+ handler: function () {
removeGridItem("select_DepartsGrid");
}
- },{
+ }, {
text: '删除全部',
- iconCls : 'btn_ext_application_del',
- handler : function() {
- top.Ext.MessageBox.confirm("请确认","确定要删除所有科室吗?",function(btn){
- if(btn == "yes"){
+ iconCls: 'btn_ext_application_del',
+ handler: function () {
+ top.Ext.MessageBox.confirm("请确认", "确定要删除所有科室吗?", function (btn) {
+ if (btn == "yes") {
select_DepartsGridStore.removeAll();
}
});
}
}
-];
-
+ ];
+
var select_DepartsGridStoreFormObj = new top.Ext.FormPanel({
id: 'departAndTaskGroupForm',
frame: true,
@@ -284,7 +284,7 @@
},
bodyStyle: 'border:1px solid #afd7af',
anchor: '100%',
- sm:smCheckbox,
+ sm: smCheckbox,
selModel: new top.Ext.grid.RowSelectionModel({
singleSelect: false,
checkOnly: true
@@ -323,7 +323,7 @@
formWindowDeparts.show();
//根据传递的科室编码获取科室信息
if (departsCodes) {
- departsCodes = departsCodes.replace(/;/g,",");
+ departsCodes = departsCodes.replace(/;/g, ",");
Ext.Ajax.request({
url: WWWROOT + '/disinfectSystem/baseData/supplyRoomConfigAction!loadOrgUnitInfoByOrgUnitCodings.do',
params: {
@@ -351,4 +351,301 @@
}
})
};
+}
+
+function removeSelect_BasketItem() {
+ var records = top.Ext.getCmp('select_BasketGrid').getSelectionModel().getSelections();
+ var select_BasketStore = top.Ext.getCmp('select_BasketGrid').getStore();
+ if (records.length > 0) {
+ select_BasketStore.remove(records[0]);
+ }
+}
+
+function removeAllGridItem(supplyRoom) {
+ var obj = top.Ext.getCmp('select_BasketGrid');
+ 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]);
+ }
+ }
+};
+
+//GDSKQYY-8:设置篮筐
+function setBindBaskets(extHiddenElementId, extComboElementId, containerBindingInfoStr) {
+
+ //科室的窗口
+ var formWindowBaskets;
+ var select_BasketStore;
+ //确定保存
+ function saveSelect(extHiddenElementId, extComboElementId) {
+ var valueArr = [];
+ var showArr = [];
+ for (var i = 0; i < select_BasketStore.getCount(); i++) {
+ var record = select_BasketStore.getAt(i);
+ valueArr.push(record.get('id'));
+ showArr.push(record.get('containerName'));
+ }
+ 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_BasketStore.removeAll();
+ formWindowBaskets.close();
+ }
+
+ var basketRecord = Ext.data.Record.create([{
+ name: 'id'
+ }, {
+ name: 'barcode'
+ }, {
+ name: 'containerName'
+ }
+ ]);
+
+ /**
+ * 添加所选择的科室名称
+ */
+ function addSelect_Basket(name, code, id) {
+ var isExist = false;
+ for (var i = 0; i < select_BasketStore.getCount(); i++) {
+ var record = select_BasketStore.getAt(i);
+ var barcode = record.get('barcode');
+ if (code == barcode) {
+ isExist = true;
+ break;
+ }
+ }
+ if (!isExist) {
+ var record = new basketRecord({
+ barcode: code,
+ id: id,
+ containerName: name
+ });
+ select_BasketStore.add(record);
+
+ top.Ext.getCmp('select_basketName').setValue('');
+ top.Ext.getCmp('select_basketCode').setValue('');
+ top.Ext.getCmp('select_basketId').setValue('');
+ } else {
+ showResult("篮筐条码:" + code + ",篮筐名称:" + name + "已添加,请不要重复添加!");
+ }
+ }
+ select_BasketStore = new top.Ext.data.Store({
+ reader: basketRecord
+ });
+ var smCheckbox = new top.Ext.grid.CheckboxSelectionModel({
+ singleSelect: false,
+ checkOnly: true
+ });
+ var cm = new top.Ext.grid.ColumnModel([
+ smCheckbox,
+ {
+ header: "篮筐条码",
+ width: 140,
+ dataIndex: 'barcode'
+ }, {
+ header: "篮筐名称",
+ width: 140,
+ dataIndex: 'containerName'
+ }, {
+ header: '删除',
+ width: 40,
+ menuDisabled: true,
+ dataIndex: 'button',
+ renderer: function (v, p, record, index) {
+ return "
";
+ }
+ }
+ ]);
+
+ var basketJsonStore = new Ext.data.Store({
+ proxy: new Ext.data.HttpProxy({
+ url: WWWROOT + '/disinfectSystem/baseData/containerAction!getAllContainersByPurpose.do?purpose=清洗筐&searchColumns=containerName',
+ method: 'POST'
+ }),
+ reader: new Ext.data.JsonReader({
+ root: 'items',
+ totalProperty: 'totalCount'
+ }, [{
+ name: 'id',
+ mapping: 'id'
+ }, {
+ name: 'barcode',
+ mapping: 'barcode'
+ },
+ {
+ name: 'containerName',
+ mapping: 'containerName'
+ }])
+ });
+
+ var tbar = [{
+ text: '选择篮筐'
+ }, {
+ xtype: 'hidden',
+ id: 'select_basketId',
+ name: 'select_basketId'
+ }, {
+ xtype: 'hidden',
+ id: 'select_basketCode',
+ name: 'select_basketCode'
+ }, {
+ xtype: 'combo',
+ id: 'select_basketName',
+ name: 'select_basketName',
+ queryParam: 'searchKeyWord',
+ fieldLabel: '篮筐名称',
+ minChars: 0,
+ valueField: 'containerName',
+ displayField: 'containerName',
+ anchor: '100%',
+ width: 200,
+ store: basketJsonStore,
+ lazyInit: true,
+ triggerAction: 'all',
+ hideTrigger: true,
+ typeAhead: false,
+ allowBlank: true,
+ listeners: {
+ select: function (combo, record, index) {
+ var barcode = record.data.barcode;
+ var containerName = record.data.containerName;
+ var id = record.data.id;
+ top.Ext.getCmp('select_basketName').setValue(containerName);
+ top.Ext.getCmp('select_basketCode').setValue(barcode);
+ top.Ext.getCmp('select_basketId').setValue(id);
+ }
+ }
+ }, {
+ text: '添加',
+ iconCls: 'btn_ext_add',
+ handler: function () {
+ var basketId = top.Ext.getCmp('select_basketId').getValue() || '';
+ var basketName = top.Ext.getCmp('select_basketName').getValue() || '';
+ var basketCode = top.Ext.getCmp('select_basketCode').getValue() || '';
+ if (basketId == '') {
+ showResult("请选择篮筐");
+ return
+ }
+ addSelect_Basket(basketName, basketCode, basketId);
+ }
+ }, {
+ text: '添加全部',
+ iconCls: 'icon_systemset',
+ handler: function () {
+ Ext.Ajax.request({
+ url: WWWROOT + '/disinfectSystem/baseData/containerAction!getAllContainersByPurpose.do?purpose=清洗筐',
+ success: function (response, options) {
+ var result = Ext.decode(response.responseText);
+ var lenth = result.items.length;
+ for (var index = 0; index < lenth; index++) {
+ var containerName = result.items[index].containerName;
+ var barcode = result.items[index].barcode;
+ var id = result.items[index].id;
+ addSelect_Basket(containerName, barcode, id);
+ }
+ }
+ });
+ }
+ }, {
+ text: '删除',
+ iconCls: 'btn_ext_application_del',
+ handler: function () {
+ removeAllGridItem("select_BasketGrid");
+ }
+ }, {
+ text: '删除全部',
+ iconCls: 'btn_ext_application_del',
+ handler: function () {
+ top.Ext.MessageBox.confirm("请确认", "确定要删除所有篮筐吗?", function (btn) {
+ if (btn == "yes") {
+ select_BasketStore.removeAll();
+ }
+ });
+ }
+ }
+ ];
+
+ var select_BasketStoreFormObj = new top.Ext.FormPanel({
+ 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_BasketGrid',
+ store: select_BasketStore,
+ tbar: tbar,
+ cm: cm,
+ width: 140,
+ height: 240,
+ isCheckboxSelectionModel: true,
+ frame: false,
+ viewConfig: {
+ forceFit: true
+ },
+ bodyStyle: 'border:1px solid #afd7af',
+ anchor: '100%',
+ sm: smCheckbox,
+ selModel: new top.Ext.grid.RowSelectionModel({
+ singleSelect: false,
+ checkOnly: true
+ })
+ })
+ ]
+ }]
+ }],
+ buttons: [{
+ text: '确定',
+ handler: function () {
+ saveSelect(extHiddenElementId, extComboElementId);
+ }
+ }, {
+ text: '取消',
+ handler: function () {
+ select_BasketStore.removeAll();
+ formWindowBaskets.close();
+ }
+ }]
+ });
+
+ formWindowBaskets = new top.Ext.Window({
+ layout: 'fit',
+ title: '选择篮筐',
+ width: 650,
+ modal: true,
+ autoHeight: true,
+ border: false,
+ plain: true,
+ items: [select_BasketStoreFormObj]
+ });
+ formWindowBaskets.show();
+ if (containerBindingInfoStr && containerBindingInfoStr !== '') {
+ var containerBindingInfo = Ext.decode(containerBindingInfoStr);
+ for (var i = 0; i < containerBindingInfo.length; i++) {
+ var record = new basketRecord({
+ id: containerBindingInfo[i]["id"],
+ barcode: containerBindingInfo[i]["barcode"],
+ containerName: containerBindingInfo[i]["containerName"]
+ });
+ select_BasketStore.add(record);
+ }
+ };
}
\ No newline at end of file