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.
 
 
 
 
 
 

88 regels
3.5 KiB

  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2019-03-19 10:52
  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. $('#TCTypeID').lrDataItemSelect({ code: 'jszgzl' });
  19. $('#FilePath').lrUploader();
  20. $('#TCClass').lrDataItemSelect({ code: 'xkfl' });
  21. $('#Department').lrDataSourceSelect({ code: 'classdata', value: 'id', text: 'name' });
  22. $('#TCName').lrGirdSelect({
  23. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=teacheruserdata',
  24. height: 500,
  25. width: 400,
  26. selectWord: 'f_realname',
  27. value: 'f_realname',
  28. text: 'f_realname',
  29. headData:
  30. [
  31. { label: "编号", name: "f_encode", width: 100, align: "left" },
  32. { label: "姓名", name: "f_realname", width: 100, align: "left" },
  33. {
  34. label: "部门", name: "f_departmentid", width: 100, align: "left",
  35. formatterAsync: function (callback, value, row, op, $cell) {
  36. learun.clientdata.getAsync('custmerData', {
  37. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'classdata',
  38. key: value,
  39. keyId: 'id',
  40. callback: function (_data) {
  41. callback(_data['name']);
  42. }
  43. });
  44. }
  45. },
  46. ],
  47. select: function (item) {
  48. ////赋值
  49. $("#TCNo").val(item.f_encode);
  50. $("#TCName").val(item.f_realname);
  51. $("#Department").lrselectSet(item.f_departmentid);
  52. }
  53. });
  54. },
  55. initData: function () {
  56. if (!!keyValue) {
  57. $.lrSetForm(top.$.rootUrl + '/PersonnelManagement/TeacherCertificate/GetFormData?keyValue=' + keyValue, function (data) {
  58. for (var id in data) {
  59. if (!!data[id].length && data[id].length > 0) {
  60. $('#' + id).jfGridSet('refreshdata', data[id]);
  61. }
  62. else {
  63. $('[data-table="' + id + '"]').lrSetFormData(data[id]);
  64. }
  65. }
  66. });
  67. }
  68. }
  69. };
  70. // 保存数据
  71. acceptClick = function (callBack) {
  72. if (!$('body').lrValidform()) {
  73. return false;
  74. }
  75. $("#TCName").val($("#TCNo").find(".lr-select-placeholder").text());
  76. var postData = {
  77. strEntity: JSON.stringify($('body').lrGetFormData())
  78. };
  79. $.lrSaveForm(top.$.rootUrl + '/PersonnelManagement/TeacherCertificate/SaveForm?keyValue=' + keyValue, postData, function (res) {
  80. // 保存成功后才回调
  81. if (!!callBack) {
  82. callBack();
  83. }
  84. });
  85. };
  86. page.init();
  87. }