赛亿提成统计系统

index.php 7.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  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="col-md-10" style="margin-top: 20px;">
  39. <table class=" table table-hover table-bordered">
  40. <thead>
  41. <tr>
  42. <th class="text-center">序 号</th>
  43. <th class="text-center">销售员</th>
  44. <th class="text-center">所属部门</th>
  45. <th class="text-center">操作</th>
  46. </tr>
  47. </thead>
  48. <tbody>
  49. <?php
  50. foreach ($data as $key => $value) {
  51. ?>
  52. <tr>
  53. <td class="text-center"><?php echo $value['id'] ?></td>
  54. <td class="text-center"><?php echo $value['name'] ?></td>
  55. <td class="text-center"><?php echo $value['department'] ?></td>
  56. <td class="text-center">
  57. <button class="btn btn-primary radius btn-xs" type="button" onClick="modify(<?php echo $value['id']; ?>,'<?php echo $value['name']; ?>','<?php echo $value['department']; ?>')">修改</button>
  58. <button class="btn btn-danger radius btn-xs" type="button" onClick="del(<?php echo $value['id']; ?>, this)">删除</button></td>
  59. </tr>
  60. <?php
  61. }
  62. ?>
  63. </tbody>
  64. </table>
  65. </div>
  66. </div>
  67. </div>
  68. <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  69. <div class="modal-dialog" style="width: 800px;">
  70. <div class="modal-content">
  71. <div class="modal-header">
  72. <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
  73. &times;
  74. </button>
  75. <h4 class="modal-title" id="myModalLabel">
  76. 新增销售员
  77. </h4>
  78. </div>
  79. <div class="modal-body">
  80. <form role="form" id="seller-form">
  81. <input type="hidden" name="id" id="id" value="0">
  82. <div class="row">
  83. <div class="col-md-2">
  84. <div class="form-group" style="text-align:right;line-height:40px;">
  85. <label form-label for="name">姓名:</label>
  86. </div>
  87. </div>
  88. <div class="col-md-4">
  89. <div class="form-group">
  90. <input type="text" class="form-control" name="name" id="name" value="" placeholder="销售员">
  91. </div>
  92. </div>
  93. </div>
  94. <div class="row">
  95. <div class="col-md-2">
  96. <div class="form-group" style="text-align:right;line-height:40px;">
  97. <label form-label for="department">部门:</label>
  98. </div>
  99. </div>
  100. <div class="col-md-4">
  101. <div class="form-group">
  102. <select name="department" id="department" class="form-control">
  103. <option value="一部">一部</option>
  104. <option value="二部">二部</option>
  105. </select>
  106. </div>
  107. </div>
  108. </div>
  109. </form>
  110. </div>
  111. <div class="modal-footer">
  112. <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
  113. <button type="button" class="btn btn-primary" onclick="doSave()">提交</button>
  114. </div>
  115. </div><!-- /.modal-content -->
  116. </div><!-- /.modal -->
  117. </div>
  118. <script>
  119. function doSave() {
  120. var id = $("#id").val();
  121. var name = $("#name").val();
  122. var department = $("#department").val();
  123. $.post('/index/seller/save', {
  124. 'id': id,
  125. 'name': name,
  126. 'department': department
  127. }, function(res) {
  128. if (res.code == 0) {
  129. $('#myModal').modal('hide');
  130. $("#seller-form")[0].reset();
  131. window.location.reload();
  132. } else {
  133. // alert(res.msg);
  134. $("#seller-form").children('div:first').append("<span style='color:red;'>" + res.msg + "</span")
  135. }
  136. return false;
  137. }, 'json');
  138. return false;
  139. }
  140. function modify(id, name, department) {
  141. $("#id").val(id);
  142. $("#name").val(name);
  143. $("#department").val(department);
  144. $('#myModal').modal('show');
  145. }
  146. function del(id, that){
  147. $.post('/index/seller/delete', {
  148. 'id': id
  149. }, function(res) {
  150. if (res.code == 0) {
  151. $(that).parents("tr").remove();
  152. } else {
  153. alert(res.msg);
  154. }
  155. }, 'json');
  156. }
  157. </script>
  158. </body>
  159. </html>