赛亿提成统计系统

index.php 8.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. <!DOCTYPE html>
  2. <html lang="zh-cn">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <link rel="stylesheet" href="/static/css/base.css">
  7. <link rel="stylesheet" href="/static/css/bootstrap.min.css">
  8. <link rel="stylesheet" href="/static/css/index.css">
  9. <script src="/static/js/jquery.min.js"></script>
  10. <script src="/static/js/bootstrap.min.js"></script>
  11. <title>销售单位管理</title>
  12. </head>
  13. <body>
  14. <div class="container" style="width: 1300px;">
  15. <div class="header">
  16. <a href="/"><span><img src="/img/logo.jpg" alt=""></span></a>
  17. <span>北京赛亿科技有限公司</span>
  18. </div>
  19. <div class="aside">
  20. <div class="col-md-12 lin-height text_center"><a href="/index">提成汇总</a></div>
  21. <div class="col-md-12 lin-height text_center"><a href="/index/commission">计提数据录入</a></div>
  22. <div class="col-md-12 lin-height text_center"><a href="/index/seller">销售员管理</a></div>
  23. <div class="col-md-12 lin-height text_center"><a href="/index/company">销售单位管理</a></div>
  24. </div>
  25. <div class="content">
  26. <div class="row">
  27. <div class="col-md-3">
  28. </div>
  29. <div class="col-md-3 text_center">
  30. <h4>销售单位管理</h4>
  31. </div>
  32. <div class="col-md-3" style="text-align:right;">
  33. <div class="btn-group ">
  34. <button type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">新增</button>
  35. </div>
  36. </div>
  37. </div>
  38. <div class="row">
  39. <form action="/index/company/index" method="get">
  40. <div class="col-md-2">
  41. </div>
  42. <div class="col-md-5 text_center">
  43. <input type="text" class="form-control" name="company_name" id="company_name" value="<?php echo $company_name;?>" placeholder="请输入公司名称">
  44. </div>
  45. <div class="col-md-3" style="text-align:left;">
  46. <div class="btn-group ">
  47. <button type="submit" class="btn btn-success">搜索</button>
  48. </div>
  49. <div class="btn-group ">
  50. <button type="button" class="btn btn-danger ml-10" onclick="window.location.href='/index/company/index'">清除</button>
  51. </div>
  52. </div>
  53. </form>
  54. </div>
  55. <div class="col-md-10" style="margin-top: 20px;">
  56. <table class=" table table-hover table-bordered">
  57. <thead>
  58. <tr>
  59. <th class="text-center">序 号</th>
  60. <th class="text-center">公司名称</th>
  61. <th class="text-center">余额初期值</th>
  62. <th class="text-center">操作</th>
  63. </tr>
  64. </thead>
  65. <tbody>
  66. <?php
  67. foreach ($data as $key => $value) {
  68. ?>
  69. <tr>
  70. <td class="text-center"><?php echo $value['id'] ?></td>
  71. <td class="text-center"><?php echo $value['name'] ?></td>
  72. <td class="text-center"><?php echo $value['initial_balance'] ?></td>
  73. <td class="text-center">
  74. <button class="btn btn-primary radius btn-xs" type="button" onClick="modify(<?php echo $value['id']; ?>,'<?php echo $value['name']; ?>','<?php echo $value['initial_balance']; ?>')">修改</button>
  75. <button class="btn btn-danger radius btn-xs" type="button" onClick="del(<?php echo $value['id']; ?>)">删除</button></td>
  76. </tr>
  77. <?php
  78. }
  79. ?>
  80. </tbody>
  81. </table>
  82. </div>
  83. </div>
  84. </div>
  85. <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  86. <div class="modal-dialog" style="width: 800px;">
  87. <div class="modal-content">
  88. <div class="modal-header">
  89. <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
  90. &times;
  91. </button>
  92. <h4 class="modal-title" id="myModalLabel">
  93. 新增销售单位
  94. </h4>
  95. </div>
  96. <div class="modal-body">
  97. <form role="form" id="company-form">
  98. <input type="hidden" name="id" id="id" value="0">
  99. <div class="row">
  100. <div class="col-md-2">
  101. <div class="form-group" style="text-align:right;line-height:40px;">
  102. <label form-label for="name">公司名称:</label>
  103. </div>
  104. </div>
  105. <div class="col-md-4">
  106. <div class="form-group">
  107. <input type="text" class="form-control" name="name" id="name" value="" placeholder="公司名称">
  108. </div>
  109. </div>
  110. </div>
  111. <div class="row">
  112. <div class="col-md-2">
  113. <div class="form-group" style="text-align:right;line-height:40px;">
  114. <label form-label for="department">初期余额:</label>
  115. </div>
  116. </div>
  117. <div class="col-md-4">
  118. <div class="form-group">
  119. <input type="number" class="form-control" name="initial_balance" id="initial_balance" value="" placeholder="初期余额">
  120. </div>
  121. </div>
  122. </div>
  123. </form>
  124. </div>
  125. <div class="modal-footer">
  126. <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
  127. <button type="button" class="btn btn-primary" id="tj">提交</button>
  128. </div>
  129. </div><!-- /.modal-content -->
  130. </div><!-- /.modal -->
  131. </div>
  132. <script>
  133. function modify(id, name, initial_balance) {
  134. $("#id").val(id);
  135. $("#name").val(name);
  136. $("#initial_balance").val(initial_balance);
  137. $('#myModal').modal('show');
  138. }
  139. function del(id) {
  140. $.post('/index/company/delete', {
  141. 'id': id,
  142. }, function(res) {
  143. if (res.code == 0) {
  144. window.location.reload();
  145. } else {
  146. alert(res.msg);
  147. }
  148. return false;
  149. }, 'json');
  150. return false;
  151. }
  152. $("#tj").click(function() {
  153. var id = $("#id").val();
  154. var name = $("#name").val();
  155. var initial_balance = Number($("#initial_balance").val());
  156. $.post('/index/company/save', {
  157. 'id': id,
  158. 'name': name,
  159. 'initial_balance': initial_balance
  160. }, function(res) {
  161. if (res.code == 0) {
  162. $('#myModal').modal('hide');
  163. $("#company-form")[0].reset();
  164. window.location.reload();
  165. } else {
  166. // alert(res.msg);
  167. $("#company-form").children('div:first').append("<span style='color:red;'>" + res.msg + "</span")
  168. }
  169. return false;
  170. }, 'json');
  171. return false;
  172. })
  173. </script>
  174. </body>
  175. </html>