Index: ssts-web/src/main/webapp/disinfectsystem/foreigntousseapplication/modifyPatientOfForeignTousseInfoForm.js =================================================================== diff -u -r31227 -r31278 --- ssts-web/src/main/webapp/disinfectsystem/foreigntousseapplication/modifyPatientOfForeignTousseInfoForm.js (.../modifyPatientOfForeignTousseInfoForm.js) (revision 31227) +++ ssts-web/src/main/webapp/disinfectsystem/foreigntousseapplication/modifyPatientOfForeignTousseInfoForm.js (.../modifyPatientOfForeignTousseInfoForm.js) (revision 31278) @@ -2,13 +2,21 @@ var originalPatientInfo = {}; //修改后的病人信息 var patientInfo = {}; - +var foreignToussGrid; /** * 更改病人信息提交 * @param id 外来器械申请单id */ function submitModifyPatientInfo(id) { - + var records = foreignToussGrid.getSelectionModel().getSelection(); + if (records.length == 0) { + showResult("请勾选需要修改的器械包!", null, sstsConfig.messagePauseTimeOnPackingPage); + return false; + } + var ids = []; + for (var i = 0; i < records.length; i++) { + ids[i] = records[i].get('id'); + } //记录修改提交后的病人信息 patientInfo.patientName = top.Ext4.getCmp("patient").getValue(); patientInfo.patientSex = top.Ext4.getCmp("patientSex").getValue(); @@ -31,7 +39,7 @@ top.Ext4.Ajax.request({ url: WWWROOT + '/disinfectSystem/foreigntousseapplication/foreignTousseApplicationAction!modifyPatientInfoOfForeignTousseApplication.do', method: 'post', - params: { id: id, originalPatientInfo: JSON.stringify(originalPatientInfo), patientInfo: JSON.stringify(patientInfo) }, + params: { id: id, originalPatientInfo: JSON.stringify(originalPatientInfo), patientInfo: JSON.stringify(patientInfo), tousseItemIds: ids.join(';') }, success: function (action) { loadMask.hide(); var result = Ext.decode(action.responseText); @@ -100,6 +108,78 @@ } }]; + var listStore = new top.Ext4.data.JsonStore({ + proxy: { + type: 'ajax', + url: WWWROOT + '/disinfectSystem/foreigntousseapplication/foreignTousseApplicationAction!loadForeignTousseItems.do', + reader: { + root: 'data' + }, + extraParams: { + applicationId: id, + confirmRecycle: false + } + }, + fields: [ + { name: 'supplierName' }, + { name: 'tousseName' }, + { name: 'used' }, + { name: 'id' } + ] + }); + + listStore.load({ + callback: function (records, p, s) { + var model = foreignToussGrid.getSelectionModel(); + if (foreignToussGrid.getStore().count() == 1) { + var record = foreignToussGrid.getStore().getAt(0); + if (!record.get('used')) { + model.selectRange(0, 0, true); + } + } + } + }); + + var sm = Ext4.create('Ext4.selection.CheckboxModel', { + listeners: { + beforeselect: function (event, record, rowIndex) { + if (record.get('used')) { + return false + } + } + } + }); + + foreignToussGrid = new top.Ext4.grid.Panel({ + store: listStore, + height: 160, + width: 730, + frame: false, + bodyStyle: 'border:1px solid #afd7af;background:#fff', + viewConfig: { + autoFill: true + }, + selModel: sm, + viewConfig: { + getRowClass: function (record, rowIndex, rowParams, store) { + if (record.get('used')) { + return 'gridRowColor'; + } else { + return "" + } + } + }, + columns: [{ + text: '器械包名称', + width: 350, + dataIndex: 'tousseName' + }, { + text: '供应商', + width: 350, + dataIndex: 'supplierName' + }] + }) + foreignTousseForm = new top.Ext4.form.Panel({ id: 'foreignToussForm', frame: true, @@ -117,6 +197,14 @@ }, items: [{ xtype: 'fieldset', + title: '器械包信息', + collapsible: false, + height: 190, + width: 750, + layout: 'fit', + items: [foreignToussGrid] + }, { + xtype: 'fieldset', title: '基础信息', collapsible: false, height: 160, @@ -322,7 +410,7 @@ foreignTousseApplyWindow = new top.Ext4.window.Window({ id: 'foreignTousseApplicationWin', title: '外来器械单-更改病人信息', - height: 250, + height: 450, width: 780, resizable: false, modal: true,