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.
 
 
 
 
 
 

91 lines
3.2 KiB

  1. /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
  2. * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2022-11-07 12:26
  5. * 描 述:经费申报明细
  6. */
  7. var acceptClick;
  8. var keyValue = request('keyValue');
  9. var selectedRow;
  10. var bootstrap = function ($, learun) {
  11. "use strict";
  12. selectedRow = top["layer_formFundsApply"].selectedRow;
  13. var page = {
  14. init: function () {
  15. $('.lr-form-wrap').lrscroll();
  16. page.bind();
  17. page.initData();
  18. },
  19. bind: function () {
  20. $('#Unit').lrDataItemSelect({ allowSearch: true,code: 'sldw' });
  21. $('.calcul').blur(function () {
  22. var num = $('#Number').val();
  23. var Price = $('#Price').val();
  24. if (!!Price) {
  25. let regNeg = /^(0|[1-9]\d*|(0|[1-9]\d*)\.\d*[1-9])$/;
  26. if (regNeg.test(Price)) {
  27. $('#Price').val(parseFloat(Price).toFixed(2));
  28. } else {
  29. $('#Price').val('');
  30. learun.alert.warning("单价必须为整数或小数(不能为负数)!");
  31. return false;
  32. }
  33. }
  34. if (!!num && !!Price) {
  35. $('#Amount').val((parseInt(num) * parseFloat(Price)).toFixed(2));
  36. }
  37. });
  38. },
  39. initData: function () {
  40. if (!!keyValue) {
  41. if (!!selectedRow) {
  42. $('#form').lrSetFormData(selectedRow);
  43. //$("#AAOldCode").find('span').text(selectedRow.AAIName);
  44. }
  45. }
  46. //if (!!keyValue) {
  47. // $.lrSetForm(top.$.rootUrl + '/AssetManagementSystem/FundsApplyDetail/GetFormData?keyValue=' + keyValue, function (data) {
  48. // for (var id in data) {
  49. // if (!!data[id].length && data[id].length > 0) {
  50. // $('#' + id ).jfGridSet('refreshdata', data[id]);
  51. // }
  52. // else {
  53. // $('[data-table="' + id + '"]').lrSetFormData(data[id]);
  54. // }
  55. // }
  56. // });
  57. //}
  58. }
  59. };
  60. // 保存数据
  61. acceptClick = function (callBack) {
  62. if (!$('body').lrValidform()) {
  63. return false;
  64. }
  65. var postData = $('body').lrGetFormData();
  66. if (!!keyValue) {
  67. if (!!selectedRow) {
  68. postData.Id = selectedRow.Id;
  69. }
  70. } else {
  71. postData.Id = learun.newGuid();
  72. }
  73. if (!!callBack) {
  74. callBack(postData);
  75. return true;
  76. }
  77. //var postData = {
  78. // strEntity: JSON.stringify($('body').lrGetFormData())
  79. //};
  80. //$.lrSaveForm(top.$.rootUrl + '/AssetManagementSystem/FundsApplyDetail/SaveForm?keyValue=' + keyValue, postData, function (res) {
  81. // // 保存成功后才回调
  82. // if (!!callBack) {
  83. // callBack();
  84. // }
  85. //});
  86. };
  87. page.init();
  88. }