|
- <?php
- /**
- * Created by PhpStorm.
- * User: Steven
- * Date: 2017/7/18
- * Time: 11:12
- */
-
- //use backend\modules\hotel\assets\hotelUIAsset;
- use backend\modules\hotel\assets\hotelAsset;
-
- hotelAsset::register($this);
-
- ?>
- <link href="/css/zyupload-1.0.0.css?v=1.1.6" type="text/css" rel="stylesheet"/>
- <style>
- th {
- text-align: center;
- }
-
- td {
- text-align: center;
- }
- </style>
- <!--搜索栏-->
- <div class="iframe_box" style="padding: 0 100px 0 50px;">
- <!--HTML-->
- <?php \yii\widgets\Pjax::begin(['id' => 'list', 'timeout' => false]) ?>
- <div class="panel panel-default" style="margin-top: 20px">
- <div class="panel-heading"><span id="hotel_name" style="font-weight: 900;font-size: medium;">酒店渠道排序 </span><span
- style="color: red;">(注意:填写排序序号后,鼠标失去焦点即可保存)</span>
- </div>
- <div class="panel-body" style="padding: 20px 100px 0 70px;">
- <div class="table-responsive">
- <table class="table table-bordered">
- <thead>
- <tr style="height: 38px">
- <th>编号</th>
- <th>渠道名称</th>
- <th>渠道顺序</th>
- </tr>
- </thead>
- <tbody>
- <?php
- if(isset($data) && !empty($data)) {
- foreach ($data as $key => $val) {
- ?>
- <tr style="background-color: <?= $key % 2 == 0 ? 'inherit': 'rgba(198, 215, 232, 0.1)' ?>">
- <td style='border-bottom: 1px; text-align: center; width: 100px;'><?= $key + 1 ?></td>
- <td style='border-bottom: 1px; text-align: center' class="channel_id"
- seq-id="<?= $val['seq_id'] ?>"
- channel_id="<?= $val['ID'] ?>"><?= $val['SUPPLIER_NAME'] ?></td>
- <td old-seq="<?= $val['seq'] ?>" style='width: 100px;background: #c1c3c3;'>
- <input type="text" onblur='parent_room_order(this)' style='text-align: center;'
- class="form-control" value="<?= $val['seq'] ?>"/>
- </td>
-
- </tr>
- <?php
- }
- }
- ?>
- </tbody>
- </table>
- </div>
- </div>
- </div>
- <?php
- foreach (Yii::$app->session->getAllFlashes() as $key => $message) {
- echo "<script>z.showTip('{$key}','{$message}')</script>";
- }
- ?>
- <?php \yii\widgets\Pjax::end() ?>
- <script type="text/javascript">
- //修改基础房型的排序
- function parent_room_order(e) {
- var re = /^[0-9]*[1-9][0-9]*$/;
- var old_value = $(e).closest('td').attr('old-seq');
- if ($(e).val() == null || $(e).val() == '' || !re.test($(e).val())) {
- $(e).val(old_value);
- z.showTip('error', '请输入有效的排序数字');
- return false;
- }
-
- if ($(e).val() == old_value) {
- return false;
- }
-
- var seq = $(e).val();
- var channel_id = $(e).closest('tr').find('.channel_id').attr('channel_id');
- var id = $(e).closest('tr').find('.channel_id').attr('seq-id');
- var param = {seqId: id, channel_id: channel_id, seq: seq};
- $.pjax.reload({
- container: '#list',
- type: 'post',
- url: '/hotel/hotel-room/order-channel-list',
- data: param,
- replace: false,
- timeout: false
- });
- }
- </script>
- </div>
|