You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

FormEdit.js 2.6 KiB

4 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2019-01-29 17:31
  5. * 描 述:教师信息管理
  6. */
  7. var acceptClick;
  8. var keyValue = request('keyValue');
  9. var bootstrap = function ($, learun) {
  10. "use strict";
  11. var ue;
  12. var page = {
  13. init: function () {
  14. $('.lr-form-wrap').lrscroll();
  15. page.bind();
  16. //page.initData();
  17. },
  18. bind: function () {
  19. //校区
  20. $('#F_CompanyId').lrDataSourceSelect({
  21. code: 'company', value: 'f_companyid', text: 'f_fullname',
  22. select: function (item) {
  23. if (!!item) {
  24. // 部门
  25. $('#F_DepartmentId').lrselectRefresh({
  26. type: 'tree',
  27. // 是否允许搜索
  28. allowSearch: true,
  29. // 访问数据接口地址
  30. url: top.$.rootUrl + '/LR_OrganizationModule/Department/GetTree',
  31. // 访问数据接口参数
  32. param: { companyId: item.f_companyid, parentId: '0' }
  33. });
  34. }
  35. }
  36. });
  37. $('#F_DepartmentId').lrselect();
  38. },
  39. initData: function () {
  40. if (!!keyValue) {
  41. $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/EmpInfo/GetFormData?keyValue=' + keyValue, function (data) {
  42. for (var id in data) {
  43. if (!!data[id].length && data[id].length > 0) {
  44. $('#' + id).jfGridSet('refreshdata', data[id]);
  45. }
  46. else {
  47. $('[data-table="' + id + '"]').lrSetFormData(data[id]);
  48. }
  49. }
  50. });
  51. }
  52. }
  53. };
  54. // 保存数据
  55. acceptClick = function (callBack) {
  56. if (!$('body').lrValidform()) {
  57. return false;
  58. }
  59. var postData = $('body').lrGetFormData();
  60. var postDatas = {
  61. strEntity: JSON.stringify(postData)
  62. };
  63. $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/EmpInfo/SaveFormEdit?keyValue=' + keyValue, postDatas, function (res) {
  64. // 保存成功后才回调
  65. if (!!callBack) {
  66. callBack();
  67. }
  68. });
  69. };
  70. page.init();
  71. }