You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

103 lines
3.8 KiB

  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: Steven
  5. * Date: 2017/7/18
  6. * Time: 11:12
  7. */
  8. //use backend\modules\hotel\assets\hotelUIAsset;
  9. use backend\modules\hotel\assets\hotelAsset;
  10. hotelAsset::register($this);
  11. ?>
  12. <link href="/css/zyupload-1.0.0.css?v=1.1.6" type="text/css" rel="stylesheet"/>
  13. <style>
  14. th {
  15. text-align: center;
  16. }
  17. td {
  18. text-align: center;
  19. }
  20. </style>
  21. <!--搜索栏-->
  22. <div class="iframe_box" style="padding: 0 100px 0 50px;">
  23. <!--HTML-->
  24. <?php \yii\widgets\Pjax::begin(['id' => 'list', 'timeout' => false]) ?>
  25. <div class="panel panel-default" style="margin-top: 20px">
  26. <div class="panel-heading"><span id="hotel_name" style="font-weight: 900;font-size: medium;">酒店渠道排序&emsp;</span><span
  27. style="color: red;">(注意:填写排序序号后,鼠标失去焦点即可保存)</span>
  28. </div>
  29. <div class="panel-body" style="padding: 20px 100px 0 70px;">
  30. <div class="table-responsive">
  31. <table class="table table-bordered">
  32. <thead>
  33. <tr style="height: 38px">
  34. <th>编号</th>
  35. <th>渠道名称</th>
  36. <th>渠道顺序</th>
  37. </tr>
  38. </thead>
  39. <tbody>
  40. <?php
  41. if(isset($data) && !empty($data)) {
  42. foreach ($data as $key => $val) {
  43. ?>
  44. <tr style="background-color: <?= $key % 2 == 0 ? 'inherit': 'rgba(198, 215, 232, 0.1)' ?>">
  45. <td style='border-bottom: 1px; text-align: center; width: 100px;'><?= $key + 1 ?></td>
  46. <td style='border-bottom: 1px; text-align: center' class="channel_id"
  47. seq-id="<?= $val['seq_id'] ?>"
  48. channel_id="<?= $val['ID'] ?>"><?= $val['SUPPLIER_NAME'] ?></td>
  49. <td old-seq="<?= $val['seq'] ?>" style='width: 100px;background: #c1c3c3;'>
  50. <input type="text" onblur='parent_room_order(this)' style='text-align: center;'
  51. class="form-control" value="<?= $val['seq'] ?>"/>
  52. </td>
  53. </tr>
  54. <?php
  55. }
  56. }
  57. ?>
  58. </tbody>
  59. </table>
  60. </div>
  61. </div>
  62. </div>
  63. <?php
  64. foreach (Yii::$app->session->getAllFlashes() as $key => $message) {
  65. echo "<script>z.showTip('{$key}','{$message}')</script>";
  66. }
  67. ?>
  68. <?php \yii\widgets\Pjax::end() ?>
  69. <script type="text/javascript">
  70. //修改基础房型的排序
  71. function parent_room_order(e) {
  72. var re = /^[0-9]*[1-9][0-9]*$/;
  73. var old_value = $(e).closest('td').attr('old-seq');
  74. if ($(e).val() == null || $(e).val() == '' || !re.test($(e).val())) {
  75. $(e).val(old_value);
  76. z.showTip('error', '请输入有效的排序数字');
  77. return false;
  78. }
  79. if ($(e).val() == old_value) {
  80. return false;
  81. }
  82. var seq = $(e).val();
  83. var channel_id = $(e).closest('tr').find('.channel_id').attr('channel_id');
  84. var id = $(e).closest('tr').find('.channel_id').attr('seq-id');
  85. var param = {seqId: id, channel_id: channel_id, seq: seq};
  86. $.pjax.reload({
  87. container: '#list',
  88. type: 'post',
  89. url: '/hotel/hotel-room/order-channel-list',
  90. data: param,
  91. replace: false,
  92. timeout: false
  93. });
  94. }
  95. </script>
  96. </div>