Index: ssts-web/src/main/webapp/systemmanage/userFormExt.js =================================================================== diff -u -r39460 -r40042 --- ssts-web/src/main/webapp/systemmanage/userFormExt.js (.../userFormExt.js) (revision 39460) +++ ssts-web/src/main/webapp/systemmanage/userFormExt.js (.../userFormExt.js) (revision 40042) @@ -269,21 +269,103 @@ }] }] },{ - xtype : 'combo', //(陈家儒改) - fieldLabel : '是否锁定', - name : 'lockStatus', - id : 'lockStatus', - triggerAction: 'all', - mode : 'local', - forceSelection : true, - store : new Ext.data.SimpleStore({ - fields: ['id', 'displayText'], - data: [['否', '否'], ['是', '是']] - }), - valueField : 'id', - displayField : 'displayText', - value : '否' - },{ + layout:'column',//两列 + items:[{ + columnWidth:.5, + layout: 'form', + items: [{ + xtype : 'combo', + fieldLabel : '是否锁定', + name : 'lockStatus', + id : 'lockStatus', + triggerAction: 'all', + mode : 'local', + forceSelection : true, + store : new Ext.data.SimpleStore({ + fields: ['id', 'displayText'], + data: [['否', '否'], ['是', '是']] + }), + width: 150, + valueField : 'id', + displayField : 'displayText', + value : '否' + }] + },{ + columnWidth:.5, + layout: 'form', + hidden:!sstsConfig.enableTheWeChatMiniProgramPlatformFunction, + items: [{ + xtype : 'combo', + fieldLabel : '允许小程序登录', + name : 'allowMiniProgramLogin', + id : 'allowMiniProgramLogin', + triggerAction: 'all', + mode : 'local', + forceSelection : true, + store : new Ext.data.SimpleStore({ + fields: ['id', 'displayText'], + data: [['否', '否'], ['是', '是']] + }), + width: 150, + valueField : 'id', + displayField : 'displayText', + value : '否', + listeners : { + select : function(combo, record, index) { + if(record.data.id == '是'){ + Ext.getCmp('supplierNameBox').show() + }else { + Ext.getCmp('supplierNameBox').hide() + } + } + } + }] + }] + },{ + columnWidth:.5, + layout: 'form', + id:'supplierNameBox', + items: [{ + xtype:'hidden', + id:'supplierId', + name:'supplierId' + },{ + xtype : 'combo', + queryParam : 'supplierName', + fieldLabel : '外来器械供应商', + name : 'supplierName', + id : 'supplierName', + minChars : 0, + valueField : 'name', + displayField : 'name', + forceSelection : true, + lazyInit : false, + triggerAction : 'all', + typeAhead : false, + allowBlank : true, + store : new Ext.data.Store({ + proxy : new Ext.data.HttpProxy({ + url : WWWROOT + '/disinfectSystem/baseData/supplierAction!getSupplierData.do', + method : 'POST' + }), + baseParams: { + supplierType: '外来器械租用商' + }, + reader : new Ext.data.JsonReader({ + totalProperty : 'totalCount', + root : 'data' + }, [ + {name : 'id',mapping : 'id'}, + {name : 'name',mapping : 'name'} + ]) + }), + listeners : { + select : function(combo, record, index) { + Ext.getCmp('supplierId').setValue(record.data.id); + } + } + }] + },{ fieldLabel: '所属部门', width: 428, xtype : 'trigger', @@ -391,11 +473,15 @@ if(msg !== ''){ Ext.getCmp('showPwdMessage').el.dom.style.color = 'red'; } + Ext.getCmp('supplierNameBox').hide() formObj.form.load({ url:WWWROOT+'/systemmanage/user/loadForm.do', method:'GET', waitMsg:'正在加载数据,请稍候', - success:function(form,action){ + success:function(form,action){ + if(sstsConfig.enableTheWeChatMiniProgramPlatformFunction && action.result.data.allowMiniProgramLogin == '是'){ + Ext.getCmp('supplierNameBox').show() + } }, failure:function(form, action){ }, @@ -440,6 +526,18 @@ return false; } + if(sstsConfig.enableTheWeChatMiniProgramPlatformFunction){ + var allowMiniProgramLogin = Ext.getCmp('allowMiniProgramLogin').getValue(); + if(allowMiniProgramLogin == '是'){ + var smsMumber = Ext.getCmp('smsMumber').getValue(); + if(smsMumber == ''){ + showResult('手机号不能为空!'); + that.enable(); + return false; + } + } + } + formObj.form.submit({ url:WWWROOT+'/systemmanage/user/save.do', method:'POST', @@ -456,7 +554,12 @@ } }, failure:function(form, action){ - alert('保存失败:'+action.failureType); + if(action.result && action.result.message){ + showResult('保存失败:'+ action.result.message); + }else { + showResult('保存失败:'+ action.failureType); + } + that.enable(); } }); }