define(function (require) { return function (context) { var $dlg, $form, $coma; return { xtype: 'dialog', dialogId: 'dialogEnvLog', title: '手机号变更', width: 450, height: 300, onOpen: function () { $dlg = $(this); $form.formSet({houseId:context.houseId,linkman:context.linkman,phone:context.phone}); }, center: { items: { width: 450, height: 400, autoSizeColumns: true, xtype: 'formgroup', onRender: function () { $form = $(this); }, items: [ [ {name: 'houseId', xtype: 'hidden'}, { name: 'linkman', label: '姓名', disabled: true, maxlength: 60, width: 350, }, { name: 'phone', label: '手机号', required: true, maxlength: 60, width: 350, }, ] ], } }, buttons: [ { text: "保存", iconCls: "fa fa-save", onClick: function () { $.yvan.postForm($form, { url: api('/user/editPhone'), success: function (data) { if (data.data > 0) { $.yvan.msg('保存成功'); $dlg.window('close'); if ($.type(context.confirm) === 'function') { context.confirm(); } } } }); } }, { text: "关闭", iconCls: "fa fa-times", onClick: function () { $dlg.dialog('close'); } } ] }; }; });