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.

FormPeople.js 3.4 KiB

3 years ago
3 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
  2. * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2021-06-21 18:39
  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. $('#lrPeople')[0].lrvalue = learun.clientdata.get(['userinfo']).userId;
  19. $('#lrPeople').val(learun.clientdata.get(['userinfo']).realName);
  20. $('#lrTime').val(learun.formatDate(new Date(), 'yyyy-MM-dd hh:mm:ss'));
  21. $('#FillingDept').lrDataSourceSelect({
  22. code: 'classdata',
  23. value: 'id',
  24. text: 'name',
  25. select: function (item) {
  26. var DeptCode = $('#FillingDept').lrselectGet();
  27. if (DeptCode != null && DeptCode != "" && DeptCode != undefined) {
  28. $('#FillingPeople').lrselectRefresh({
  29. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=teacheruserdata',
  30. value: 'f_userid',
  31. text: 'f_realname',
  32. param: { strWhere: " 1=1 and f_departmentid in ('" + DeptCode + "')" }
  33. });
  34. }
  35. }
  36. });
  37. $("#FillingPeople").lrselect();
  38. //设置周期
  39. $('#FillingCycle').lrDataItemSelect({
  40. code: 'ThisCycle',
  41. select: function (item) {
  42. var Cycles = $("#FillingCycle").lrselectGet();
  43. if (Cycles != null && Cycles != "" && Cycles != undefined && Cycles == 2) {
  44. $('#FillingTime').lrDataItemSelect({ code: 'CycleTime' });
  45. } else {
  46. $('#FillingTime').lrDataItemSelect({ code: 'undefined' });
  47. }
  48. }
  49. });
  50. },
  51. initData: function () {
  52. if (!!keyValue) {
  53. $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/FillinFrom/GetFormData?keyValue=' + keyValue, function (data) {
  54. for (var id in data) {
  55. if (!!data[id].length && data[id].length > 0) {
  56. $('#' + id).jfGridSet('refreshdata', data[id]);
  57. }
  58. else {
  59. $('[data-table="' + id + '"]').lrSetFormData(data[id]);
  60. }
  61. }
  62. });
  63. }
  64. $('#State').val('0');
  65. $('#IsFlag').val('0');
  66. }
  67. };
  68. // 保存数据
  69. acceptClick = function (callBack) {
  70. if (!$('body').lrValidform()) {
  71. return false;
  72. }
  73. var postData = {
  74. strEntity: JSON.stringify($('body').lrGetFormData())
  75. };
  76. $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/FillinFrom/SaveForm?keyValue=' + keyValue, postData, function (res) {
  77. // 保存成功后才回调
  78. if (!!callBack) {
  79. callBack();
  80. }
  81. });
  82. };
  83. page.init();
  84. }