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.

Form.js 3.0 KiB

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