Index: ssts-web/src/main/webapp/disinfectsystem/equipmentInspection/formdefinitionForm.js =================================================================== diff -u -r40949 -r41067 --- ssts-web/src/main/webapp/disinfectsystem/equipmentInspection/formdefinitionForm.js (.../formdefinitionForm.js) (revision 40949) +++ ssts-web/src/main/webapp/disinfectsystem/equipmentInspection/formdefinitionForm.js (.../formdefinitionForm.js) (revision 41067) @@ -685,6 +685,7 @@ Ext.getCmp('remindStartTimeBox').hide(); Ext.getCmp('remindEndTimeBox').hide(); } + Ext.getCmp('formName').el.dom.setAttribute("readOnly", true); }, failure: function (form, action) { showResult("加载出错,请联系管理员!"); Index: ssts-web/src/main/webapp/disinfectsystem/equipmentInspection/forminstanceForm.jsp =================================================================== diff -u -r41048 -r41067 --- ssts-web/src/main/webapp/disinfectsystem/equipmentInspection/forminstanceForm.jsp (.../forminstanceForm.jsp) (revision 41048) +++ ssts-web/src/main/webapp/disinfectsystem/equipmentInspection/forminstanceForm.jsp (.../forminstanceForm.jsp) (revision 41067) @@ -46,32 +46,32 @@ function loadPage(){ //selectDevice('清洗机', 16271, '手工清洗'); - if(Android){ - try{ + try{ + if(Android){ Android.loadPage(); - }catch(e){ - } + }catch(e){ + } } /** * 接收到设备条码(通常来自嵌入端,比如android) */ function receiveScannedDeviceBarcode(barcode){ - + setDeviceSelected(barcode); } //Android.callAndroid("hello android安卓您好吗,我是js"); function backToAndroidListPage() { //Android.callAndroid("closeWindow"); - if(Android){ - try{ - //speakContentThrouhtAndroid("关闭窗口"); + try{ + //speakContentThrouhtAndroid("关闭窗口"); + if(Android){ Android.backToListPage(); - }catch(e){ - } + }catch(e){ + } } Index: ssts-web/src/main/webapp/disinfectsystem/equipmentInspection/forminstanceForm.js =================================================================== diff -u -r41048 -r41067 --- ssts-web/src/main/webapp/disinfectsystem/equipmentInspection/forminstanceForm.js (.../forminstanceForm.js) (revision 41048) +++ ssts-web/src/main/webapp/disinfectsystem/equipmentInspection/forminstanceForm.js (.../forminstanceForm.js) (revision 41067) @@ -261,7 +261,7 @@ /** * 根据value选中设备并触发选中事件 */ -function setComboSelectedByValue(id, type){ +function setComboSelectedByValue(id, type) { Ext.Ajax.request({ url: WWWROOT + '/disinfectSystem/equipmentInspectionDefAction!loadEquipmentInspectionDefByEquipment.do', params: { equipmentId: id, type: type }, @@ -281,33 +281,40 @@ } /** - * 选中某个设备(通常来自嵌入端,比如android) - * @param deviceType 设备类型 - * @param deviceId 设备id - * @param deviceName 设备名称 + * 根据条码选中某个设备(通常来自嵌入端,比如android) + * @param barcode 设备条码 */ -function setDeviceSelected(deviceType, deviceId, deviceName){ - /*deviceInfoStore.load(function(records, operation, success){ - - });*/ - deviceInfoStore.load({ - params: { - +function setDeviceSelected(barcode) { + deviceInfoStore = new Ext.data.Store({ + proxy: new Ext.data.HttpProxy({ + url: WWWROOT + '/disinfectSystem/equipmentInspectionDefAction!loadEquipmentInspectionDefDeviceInfo.do', + method: 'POST' + }), + baseParams: { + barcode: barcode }, - callback: function (records, operation, success) { - if (records.length && records.length >= 1) { - for(var i = 0;i < records.length;i++){ - var record = records[i]; - if(deviceType == record.data.type && deviceId == record.data.id){ - Ext.getCmp("equipmentName").setValue(deviceName); - Ext.getCmp("equipmentID").setValue(deviceId); - Ext.getCmp("equipmentType").setValue(deviceType); - setComboSelectedByValue(deviceId, deviceType); - } + reader: new Ext.data.JsonReader({ + totalProperty: 'totalCount', + root: 'data' + }, [ + { name: 'id', mapping: 'id' }, + { name: 'name', mapping: 'name' }, + { name: 'type', mapping: 'type' } + ]), + listeners: { + load: function (store, records) { + if (records.length && records.length >= 1) { + var record = records[0]; + Ext.getCmp("equipmentName").setValue(record.data.name); + Ext.getCmp("equipmentID").setValue(record.data.id); + Ext.getCmp("equipmentType").setValue(record.data.type); + setComboSelectedByValue(record.data.id, record.data.type); } } } }); + + deviceInfoStore.load(); } Ext.onReady(function () {