dk_userlist_edit.blade.php 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. @extends('base.base')
  2. @section('base')
  3. <!-- 内容区域 -->
  4. <div class="main-panel">
  5. <div class="content-wrapper">
  6. <div class="row">
  7. <div class="col-12 grid-margin stretch-card">
  8. <div class="card">
  9. <div class="card-body">
  10. <h4 class="card-title">{{ __('auto.用户金额输赢控制') }}</h4>
  11. <form class="forms-sample" id="form">
  12. <div class="form-group" style="width: 48%;float: left">
  13. <label>{{ __('auto.控制金额') }}</label>
  14. <input type="number" class="form-control required"
  15. value="{{$ControlScore ?? '0'}}" name="ControlScore">
  16. </div>
  17. <div class="form-group" style="width: 48%;float: right">
  18. <label>{{ __('auto.控制概率(0-100)') }}</label>
  19. <input type="number" class="form-control required"
  20. value="{{$Probability ?? '0'}}" name="Probability" min="0" max="100">
  21. </div>
  22. <div style="clear: both"></div>
  23. <br>
  24. <div class="form-group">
  25. <label>{{ __('auto.备注信息') }}</label>
  26. <textarea id="Remarks" name="Remarks" class="form-control"
  27. rows="3"></textarea>
  28. </div>
  29. <input type="hidden" name="UserID" value="{{$UserID ?? ''}}">
  30. <br><br>
  31. <button type="button" onclick="commit()"
  32. class="btn btn-sm btn-gradient-primary btn-icon-text">
  33. <i class="mdi mdi-file-check btn-icon-prepend"></i>
  34. {{ __('auto.提交') }}
  35. </button>
  36. <button type="button" onclick="cancel()"
  37. class="btn btn-sm btn-gradient-warning btn-icon-text">
  38. <i class="mdi mdi-reload btn-icon-prepend"></i>
  39. {{ __('auto.取消') }}
  40. </button>
  41. <button type="button" onclick="cancel_dk({{$UserID}})"
  42. class="btn btn-sm btn-google btn-icon-text">
  43. {{ __('auto.取消单控') }}
  44. </button>
  45. </form>
  46. </div>
  47. </div>
  48. </div>
  49. </div>
  50. </div>
  51. </div>
  52. <script>
  53. function commit(id) {
  54. if (!checkForm()) {
  55. return false;
  56. }
  57. var data = $("#form").serializeObject();
  58. // 概率校验 0-100
  59. var prob = parseFloat(data.Probability || 0);
  60. if (isNaN(prob) || prob < 0 || prob > 100) {
  61. layer.msg('概率必须在0-100之间');
  62. return false;
  63. }
  64. myConfirm("{{ __('auto.操作不可逆,是否继续') }}?", function () {
  65. myRequest("/admin/global/dk_userlist_edit", "post", data, function (res) {
  66. layer.msg(res.msg)
  67. if (res.code == 200) {
  68. setTimeout(function () {
  69. // parent.location.reload();
  70. var index = parent.layer.getFrameIndex(window.name);
  71. parent.layer.close(index);
  72. }, 1500)
  73. }
  74. });
  75. })
  76. }
  77. function cancel_dk(id) {
  78. console.log(id)
  79. myConfirm("{{ __('auto.取消单控操作不可逆,是否继续') }}?", function () {
  80. myRequest("/admin/global/cancel_dk", "post", {id}, function (res) {
  81. layer.msg(res.msg)
  82. setTimeout(function () {
  83. // parent.location.reload();
  84. var index = parent.layer.getFrameIndex(window.name);
  85. parent.layer.close(index);
  86. }, 1500)
  87. });
  88. });
  89. }
  90. function cancel() {
  91. var index = parent.layer.getFrameIndex(window.name);
  92. parent.layer.close(index);
  93. }
  94. </script>
  95. @endsection