list.php 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <?php
  2. use yii\widgets\LinkPager;
  3. ?>
  4. <div class="page-title">
  5. <div class="title-env">
  6. <h1 class="title">门店管理</h1>
  7. </div>
  8. <div class="breadcrumb-env">
  9. <ol class="breadcrumb bc-1">
  10. <li>
  11. <a href="/"><i class="fa-home"></i>Home</a>
  12. </li>
  13. <li>
  14. <a href="javascript:void(0)">商家管理</a>
  15. </li>
  16. <li class="active">
  17. <strong>门店管理</strong>
  18. </li>
  19. </ol>
  20. </div>
  21. </div>
  22. <div class="panel panel-default">
  23. <div class="panel-body">
  24. <div class="dataTables_wrapper form-inline dt-bootstrap no-footer">
  25. <div class="row">
  26. <form action="" method="GET">
  27. <div class="col-xs-6" style="width:90%;">
  28. <div class="dataTables_length">
  29. </div>
  30. </div>
  31. </form>
  32. </div>
  33. <div class="table-responsive">
  34. <table class="table table-bordered table-striped table-hover" >
  35. <thead>
  36. <tr class="active">
  37. <th class="no-sorting hidden-xs"><input type="checkbox"></th>
  38. <th class="hidden-xs">ID</th>
  39. <th>门店名称</th>
  40. <th class="hidden-xs">图片</th>
  41. <th class="hidden-xs">地址</th>
  42. <th class="hidden-xs">电话</th>
  43. <th class="hidden-xs">创建时间</th>
  44. <th class="hidden-xs">状态</th>
  45. <th>操作</th>
  46. </tr>
  47. </thead>
  48. <tbody class="middle-align">
  49. <?php
  50. if(!empty($models)){
  51. foreach($models as $key => $val){
  52. ?>
  53. <tr>
  54. <td class="hidden-xs"><input type="checkbox"></td>
  55. <td class="hidden-xs"><?= $val['id'] ?></td>
  56. <td><?= $val['branchName'] ?></td>
  57. <td class="hidden-xs"> </td>
  58. <td class="hidden-xs"><?= $val['shopAddress'] ?></td>
  59. <td class="hidden-xs"><?= $val['telephone'] ?></td>
  60. <td class="hidden-xs"><?= date("Y-m-d H:i",strtotime($val['createTime'])) ?></td>
  61. <td class="hidden-xs"><?php if($val['status'] == 0){echo '待审';}else{echo '未通过';}?></td>
  62. <td>
  63. <a href="javascript:void(0)" onclick="pass(<?= $val['id'] ?>, $(this))" data-url="/shop/check-store" data-msg="确定门店通过审批" class="btn btn-secondary btn-sm btn-icon icon-left">通过</a>
  64. </td>
  65. </tr>
  66. <?php
  67. }
  68. }
  69. ?>
  70. </tbody>
  71. </table>
  72. </div>
  73. <div class="row">
  74. <div>
  75. <div class="dataTables_paginate paging_simple_numbers" style="float:right;padding-top:0px;margin-right:15px;">
  76. <!--显示分页页码-->
  77. <?php
  78. echo LinkPager::widget([
  79. 'pagination' => $pages,
  80. 'maxButtonCount' => 5,
  81. 'nextPageLabel' => '下一页',
  82. 'prevPageLabel' => '上一页'
  83. ]);
  84. ?>
  85. </div>
  86. </div>
  87. </div>
  88. </div>
  89. </div>
  90. </div>
  91. <!-- footer -->
  92. <?php
  93. use backend\widgets\FooterWidget;
  94. ?>
  95. <?= FooterWidget::widget()?>
  96. <!-- footer -->
  97. <script>
  98. function pass(id, currentObj) {
  99. var title = '提示';
  100. var response = currentObj.attr('data-msg');
  101. var url = currentObj.attr('data-url');
  102. $('#platform-modal .modal-title').html(title);
  103. $('#platform-modal .modal-body').html(response);
  104. $('#platform-modal .btn-white').html('取消');
  105. $('#platform-modal .btn-info').html('确定');
  106. $('#platform-modal').modal('show', {
  107. backdrop: 'static'
  108. });
  109. $('#platform-modal .btn-info').attr("disabled", false);
  110. $('#platform-modal .btn-info').on('click', function() {
  111. $(this).attr("disabled", true);
  112. $.ajax({
  113. type: "POST",
  114. url: url,
  115. data: {
  116. 'shopId': id,
  117. '_csrf': "<?= Yii::$app->request->csrfToken;?>"
  118. },
  119. dataType: "json",
  120. success: function(data) {
  121. //console.log(data);
  122. if (data.errcode == 0) {
  123. $('#platform-modal').modal('hide');
  124. currentObj.parents('tr').remove();
  125. xhPopMsg('操作成功!');
  126. } else {
  127. xhPopMsg(data.errmsg);
  128. }
  129. },
  130. error: function(msg) {
  131. xhPopMsg('error');
  132. }
  133. });
  134. })
  135. }
  136. </script>