editPhone.js 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. define(function (require) {
  2. return function (context) {
  3. var $dlg, $form, $coma;
  4. return {
  5. xtype: 'dialog',
  6. dialogId: 'dialogEnvLog',
  7. title: '手机号变更',
  8. width: 450,
  9. height: 300,
  10. onOpen: function () {
  11. $dlg = $(this);
  12. $form.formSet({houseId:context.houseId,linkman:context.linkman,phone:context.phone});
  13. },
  14. center: {
  15. items: {
  16. width: 450,
  17. height: 400,
  18. autoSizeColumns: true,
  19. xtype: 'formgroup',
  20. onRender: function () {
  21. $form = $(this);
  22. },
  23. items: [
  24. [
  25. {name: 'houseId', xtype: 'hidden'},
  26. {
  27. name: 'linkman',
  28. label: '姓名',
  29. disabled: true,
  30. maxlength: 60,
  31. width: 350,
  32. },
  33. {
  34. name: 'phone',
  35. label: '手机号',
  36. required: true,
  37. maxlength: 60,
  38. width: 350,
  39. },
  40. ]
  41. ],
  42. }
  43. },
  44. buttons: [
  45. {
  46. text: "保存", iconCls: "fa fa-save", onClick: function () {
  47. $.yvan.postForm($form, {
  48. url: api('/user/editPhone'),
  49. success: function (data) {
  50. if (data.data > 0) {
  51. $.yvan.msg('保存成功');
  52. $dlg.window('close');
  53. if ($.type(context.confirm) === 'function') {
  54. context.confirm();
  55. }
  56. }
  57. }
  58. });
  59. }
  60. }, {
  61. text: "关闭", iconCls: "fa fa-times", onClick: function () {
  62. $dlg.dialog('close');
  63. }
  64. }
  65. ]
  66. };
  67. };
  68. });