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.
 
 
 
 
 
 

117 lines
4.7 KiB

  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. $('#Formula').lrDataSourceSelect({ code: 'FormulaMain', value: 'id', text: 'name' });
  19. //$('#Formula').lrGirdSelect({
  20. // url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=FormulaMain',
  21. // selectWord: 'name',
  22. // value: 'id',
  23. // text: 'name',
  24. // headData:
  25. // [
  26. // { label: "公式", name: "result", width: 300, align: "left" },
  27. // { label: "公式名称", name: "name", width: 300, align: "left" }
  28. // ],
  29. // select: function (item) {
  30. // }
  31. //});
  32. $('#lrPeople')[0].lrvalue = learun.clientdata.get(['userinfo']).userId;
  33. $('#lrPeople').val(learun.clientdata.get(['userinfo']).realName);
  34. $('#lrTime').val(learun.formatDate(new Date(), 'yyyy-MM-dd hh:mm:ss'));
  35. $('#FillingDept').lrDataSourceSelect({
  36. code: 'classdata',
  37. value: 'id',
  38. text: 'name',
  39. select: function (item) {
  40. var DeptCode = $('#FillingDept').lrselectGet();
  41. if (DeptCode != null && DeptCode != "" && DeptCode != undefined) {
  42. $('#FillingPeople').lrselectRefresh({
  43. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=teacheruserdata',
  44. value: 'f_userid',
  45. text: 'f_realname',
  46. param: { strWhere: " 1=1 and f_departmentid in ('" + DeptCode + "')" },
  47. maxHeight: 200,
  48. });
  49. }
  50. }
  51. });
  52. $("#FillingPeople").lrselect();
  53. //设置周期
  54. $('#FillingCycle').lrDataItemSelect({
  55. code: 'ThisCycle',
  56. select: function (item) {
  57. var Cycles = $("#FillingCycle").lrselectGet();
  58. if (Cycles == 3) {
  59. $('#TimeHide').show();
  60. $('#FillingTime1').show();
  61. $('#FillingTime2').hide();
  62. $('#FillingTime1').lrDataItemSelect({
  63. code: 'CycleTime'
  64. });
  65. } else if (Cycles == 2) {
  66. $('#TimeHide').show();
  67. $('#FillingTime1').hide();
  68. $('#FillingTime2').show();
  69. } else if (Cycles == 1) {
  70. $('#TimeHide').hide();
  71. //$('#FillingTime1').hide();
  72. //$('#FillingTime2').hide();
  73. }
  74. }
  75. });
  76. $('#FillingTime1').lrselect();
  77. $('#FillingTime2').lrDataItemSelect({
  78. type: 'multiple',
  79. code: 'CycleTime'
  80. });
  81. $('#FillingTime2').hide();
  82. },
  83. initData: function () {
  84. if (!!keyValue) {
  85. $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/FillinFrom/GetFormData?keyValue=' + keyValue, function (data) {
  86. for (var id in data) {
  87. if (!!data[id].length && data[id].length > 0) {
  88. $('#' + id).jfGridSet('refreshdata', data[id]);
  89. }
  90. else {
  91. $('[data-table="' + id + '"]').lrSetFormData(data[id]);
  92. }
  93. }
  94. });
  95. }
  96. $('#State').val('0');
  97. $('#IsFlag').val('0');
  98. }
  99. };
  100. // 保存数据
  101. acceptClick = function (callBack) {
  102. if (!$('body').lrValidform()) {
  103. return false;
  104. }
  105. var postData = {
  106. strEntity: JSON.stringify($('body').lrGetFormData())
  107. };
  108. $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/FillinFrom/SaveForm?keyValue=' + keyValue, postData, function (res) {
  109. // 保存成功后才回调
  110. if (!!callBack) {
  111. callBack();
  112. }
  113. });
  114. };
  115. page.init();
  116. }