ledger_list_modal.ejs 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <div class="modal" id="add-qi" data-backdrop="static" aria-modal="true" role="dialog">
  2. <div class="modal-dialog" role="document">
  3. <form class="modal-content" action="addStage" method="POST" onsubmit="return checkAddValid();">
  4. <div class="modal-header">
  5. <h5 class="modal-title">新建报审</h5>
  6. </div>
  7. <div class="modal-body">
  8. <div class="form-group form-group-sm">
  9. <label>期数</label>
  10. <input class="form-control form-control-sm" value="第 <%- (stages.length + 1) %> 期" type="text" readonly="">
  11. <input type="hidden" value="<%- (stages.length + 1) %>" name="stage_order">
  12. </div>
  13. <div class="form-group form-group-sm">
  14. <label>报审年月</label>
  15. <input class="datepicker-here form-control form-control-sm" autocomplete="off" name="date" placeholder="点击选择年月" data-view="months" data-min-view="months" data-date-format="yyyy-MM" data-language="zh" type="text">
  16. </div>
  17. </div>
  18. <div class="modal-footer">
  19. <input type="hidden" name="_csrf_j" value="<%= ctx.csrf %>" />
  20. <input type="hidden" name="stage_type" value="<%- stage_type %>" />
  21. <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">关闭</button>
  22. <button type="submit" class="btn btn-sm btn-primary">确定</button>
  23. </div>
  24. </form>
  25. </div>
  26. </div>
  27. <!--审批流程/结果-->
  28. <div class="modal fade" id="sp-list" data-backdrop="static">
  29. <div class="modal-dialog modal-lg" role="document">
  30. <div class="modal-content">
  31. <div class="modal-header">
  32. <h5 class="modal-title">审批流程</h5>
  33. </div>
  34. <div class="modal-body">
  35. <div class="row">
  36. <div class="col-4 modal-height-500" style="overflow: auto">
  37. <div class="card mt-3">
  38. <ul class="list-group list-group-flush" id="auditor-list">
  39. </ul>
  40. </div>
  41. </div>
  42. <div class="col-8 modal-height-500" style="overflow: auto" id="audit-list">
  43. </div>
  44. </div>
  45. </div>
  46. <div class="modal-footer">
  47. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
  48. </div>
  49. </div>
  50. </div>
  51. </div>
  52. <div class="modal" id="cost-ledger-col" data-backdrop="static" aria-modal="true" role="dialog">
  53. <div class="modal-dialog" role="document">
  54. <form class="modal-content" action="colSet" method="POST" onsubmit="return convertColSet();">
  55. <div class="modal-header">
  56. <h5 class="modal-title">列设置</h5>
  57. </div>
  58. <div class="modal-body">
  59. <div class="form-group form-check mb-0">
  60. <input type="checkbox" class="form-check-input group-checkbox" id="col_cur" <% if (colSet.cur) { %> checked <%} %>>
  61. <label class="form-check-label" for="col_cur">本期</label>
  62. </div>
  63. <div class="form-group form-check mb-0">
  64. <input type="checkbox" class="form-check-input group-checkbox" id="col_cur_excl_tax" <% if (colSet.cur_excl_tax) { %> checked <%} %>>
  65. <label class="form-check-label" for="col_cur_excl_tax">本期(不含税)</label>
  66. </div>
  67. <div class="form-group form-check mb-0">
  68. <input type="checkbox" class="form-check-input group-checkbox" id="col_end" <% if (colSet.end) { %> checked <%} %>>
  69. <label class="form-check-label" for="col_end">截止本期</label>
  70. </div>
  71. <div class="form-group form-check mb-0">
  72. <input type="checkbox" class="form-check-input group-checkbox" id="col_end_excl_tax" <% if (colSet.end_excl_tax) { %> checked <%} %>>
  73. <label class="form-check-label" for="col_end_excl_tax">截止本期(不含税)</label>
  74. </div>
  75. </div>
  76. <div class="modal-footer">
  77. <input type="hidden" name="_csrf_j" value="<%= ctx.csrf %>" />
  78. <input type="hidden" name="col_cur" value="<%- colSet.cur %>" />
  79. <input type="hidden" name="col_cur_excl_tax" value="<%- colSet.cur_excl_tax %>" />
  80. <input type="hidden" name="col_end" value="<%- colSet.end %>" />
  81. <input type="hidden" name="col_end_excl_tax" value="<%- colSet.end_excl_tax %>" />
  82. <input type="hidden" name="stage_type" value="<%- stage_type %>" />
  83. <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">关闭</button>
  84. <button type="submit" class="btn btn-sm btn-primary">确定</button>
  85. </div>
  86. </form>
  87. </div>
  88. </div>
  89. <script>
  90. $('.datepicker-here').datepicker({
  91. autoClose: true,
  92. });
  93. const checkAddValid = function() {
  94. if ($('[name=date]', '#add-qi').val() == '') {
  95. toastr.error('请选择报审年月');
  96. return false;
  97. }
  98. }
  99. const checkEditValid = function() {
  100. if ($('[name=date]', '#edit-qi').val() == '') {
  101. toastr.error('请选择报审年月');
  102. return false;
  103. }
  104. }
  105. const convertColSet = function() {
  106. const check = $('input[type=checkbox]', '#cost-ledger-col');
  107. for (const c of check) {
  108. const id = c.getAttribute('id');
  109. $(`input[name=${id}]`).val(c.checked ? 1 : 0);
  110. }
  111. return true;
  112. }
  113. </script>