没心没肺 5 years ago
parent
commit
66ab8e7dcc
6 changed files with 1233 additions and 1111 deletions
  1. 559 551
      index.html
  2. 54 3
      js/common/common.js
  3. 87 33
      js/root/orderSearch.js
  4. 1 2
      newSystem/newPolicy.html
  5. 4 3
      orderSearch.html
  6. 528 519
      triptoSearch.html

File diff suppressed because it is too large
+ 559 - 551
index.html


+ 54 - 3
js/common/common.js

@@ -2,7 +2,7 @@
   "function" == typeof define && define.amd ? define(["jquery", 'moment', 'clipboard', 'toastr', 'cookie', 'layer', 'WdatePicker', 'table', 'config'], fn) : fn(jQuery, moment);
 }(function ($, moment, Clipboard, toastr) {
   $(function () {
-    $.version = '1.5.3'
+    $.version = '1.5.6'
     var path = pathParse();
     if (!$.cookie('attachment')) {
       if (path) {
@@ -683,14 +683,15 @@
         }
       })
       // 轮询
-      getNews()
-      setInterval(getNews, 30000)
+      // getNews()
+      // setInterval(getNews, 30000)
     }
 
     function getNews() {
       toastr.clear()
       $.send({
         load: false,
+        data: { userName: $.attachment.name },
         url: 'http://fly.tripto.cn/jsp/utils/news.jsp',
         success(res) {
           if ($('#warningMsgContent').length) {
@@ -745,9 +746,17 @@
               }
             })
           })
+
+          if (res.notice) {
+            var cookieNotice = $.cookie('notice') && JSON.parse($.cookie('notice'))
+            if (res.status === '0' || !cookieNotice || cookieNotice.id != res.notice.id) {
+              notice(res.notice)
+            }
+          }
         }
       })
     }
+    window.getNews = getNews
 
     function renderDropdown(name, data) {
       if ($('#' + name + 'Content').length) {
@@ -780,6 +789,48 @@
       }
     }
 
+    function notice(data) {
+      if ($.noticeData && $.noticeData.active) {
+        return false
+      }
+      $.noticeData = data
+      $.noticeData.active = true
+      var html = `<div>
+                    <div>${data.content}</div>
+                    <div class="m-t">
+                      <label><input type="checkbox" class="read"> 我已阅读公告</label>
+                      <button type="button" class="btn btn-primary btn-sm pull-right disabled confirm">确认</button>
+                    </div>
+                  </div>`
+      var title = '公告: ' + (data.title != undefined ? data.title : '')
+      var noticeAlert = layer.open({
+        title: title,
+        skin: 'layui-layer-molv',
+        content: html,
+        closeBtn: 0,
+        btn: [],
+        success: function (h) {
+          $(h).find('button.confirm').on('click', function () {
+            if (!$(this).hasClass('disabled') && $(h).find('.read')[0].checked) {
+              $.noticeData.active = false
+              $.cookie('notice', JSON.stringify(data), { expires: 1 })
+              layer.close(noticeAlert)
+            }
+          })
+          var count = 15
+          $(h).find('button.confirm').html(`确认 (${count}s)`)
+          var timer = setInterval(() => {
+            if (count-- <= 0) {
+              clearInterval(timer)
+              $(h).find('button.confirm').html(`确认`).removeClass('disabled')
+            } else {
+              $(h).find('button.confirm').html(`确认 (${count}s)`)
+            }
+          }, 1000)
+        }
+      })
+    }
+
     function renderToolBar(_data) {
       $('<div id="toolBar" move=false style="background:#2e8ded;cursor:pointer;position:fixed;top:120px;right:-20px;z-index:999999999;opacity:.5;border-radius:50%;color:#fff;text-align:center;width:40px;line-height:40px;"><span><i class="fa fa-cny" title="汇率计算"></i></span></div>')
         .on('mouseover', function () {

+ 87 - 33
js/root/orderSearch.js

@@ -339,12 +339,16 @@ require(['common', 'template', 'momentLocale', 'clipboard', 'pinyin', 'serialize
           return attr
         },
         responseHandler(res) {
+          // var single = ['AK', 'FD', 'QZ', 'Z2', 'I5', 'D7', 'XJ', 'XT', 'DJ', '5J', 'DG']
           res.rows.forEach(function (e) {
             if (e.receiver) {
               e.receiver.split('#').forEach(function (item) {
                 var arr = item.split(':')
                 e['receiver_' + arr[0]] = arr[1]
               })
+              // var isSingle = single.includes(e.go[0].flightNum.slice(0, 2))
+              // isSingle &&
+              e.receiver_PRICE && (e.receiver_PRICE = Number((e.receiver_PRICE * e.passengerCount).toFixed(2)))
             }
           })
           result = res.rows
@@ -504,28 +508,33 @@ require(['common', 'template', 'momentLocale', 'clipboard', 'pinyin', 'serialize
           format: function (value, row, index) {
             return '<div class="outPnrCode">' + (row.receiver ? row.receiver.split('#')[0].split(':')[1] : '无') + '</div>'
           }
-        }, {
-          field: 'receiver',
-          title: '占座价格',
-          format: function (value, row) {
-            var isSingle = ['AK', 'FD', 'QZ', 'Z2', 'I5', 'D7', 'XJ', 'XT', 'DJ', '5J', 'DG'].includes(row.go[0].flightNum.slice(0, 2))
-            if (/#/.test(value)) {
-              var temp = value.split('#').map(function (e) { return e.split(':') })
-              if (temp[4] && temp[4][1]) {
-                var price = temp[4][1]
-                if (isSingle) {
-                  price = Number(Number(price * row.passengerCount).toFixed(2))
-                } else {
-                  price = Number(Number(price).toFixed(2))
-                }
-                return price
-              } else {
-                return '-'
-              }
-            } else {
-              return '-'
-            }
-          }
+        },
+        // {
+        //   field: 'receiver',
+        //   title: '占座价格',
+        //   format: function (value, row) {
+        //     var isSingle = ['AK', 'FD', 'QZ', 'Z2', 'I5', 'D7', 'XJ', 'XT', 'DJ', '5J', 'DG'].includes(row.go[0].flightNum.slice(0, 2))
+        //     if (/#/.test(value)) {
+        //       var temp = value.split('#').map(function (e) { return e.split(':') })
+        //       if (temp[4] && temp[4][1]) {
+        //         var price = temp[4][1]
+        //         if (isSingle) {
+        //           price = Number(Number(price * row.passengerCount).toFixed(2))
+        //         } else {
+        //           price = Number(Number(price).toFixed(2))
+        //         }
+        //         return price
+        //       } else {
+        //         return '-'
+        //       }
+        //     } else {
+        //       return '-'
+        //     }
+        //   }
+        // },
+        {
+          field: 'receiver_PRICE',
+          title: '占座价格'
         }, {
           field: 'allPrice',
           title: '订单总价'
@@ -540,14 +549,17 @@ require(['common', 'template', 'momentLocale', 'clipboard', 'pinyin', 'serialize
           title: '乘客总数'
         }, {
           field: 'receiver_STATUS',
-          title: `<div class="btn-group">
-                                <button data-toggle="dropdown" class="btn btn-link btn-xs dropdown-toggle" style="font-size:13px;font-weight:700;margin-bottom:0;">是否占座 <span class="caret"></span></button>
-                                <ul class="dropdown-menu"><li><a href=#" class="receiver_sort">不限</a></li><li><a href=#" class="receiver_sort">未占仓</a></li><li><a href=#" class="receiver_sort">占位中</a></li><li><a href=#" class="receiver_sort">占位成功</a></li><li><a href=#" class="receiver_sort">占位失败</a></li></ul>
-                            </div>`,
+          title: `占座状态`,
           state: SEAT_STATUS
         }, {
           field: 'profits',
-          title: '利润'
+          title: '利润',
+          format(v, row) {
+            if (!v && row.receiver_PRICE && row.status === 1) {
+              return `[${Number((row.allPrice - row.receiver_PRICE).toFixed(2))}]`
+            }
+            return v
+          }
         }, {
           field: 'addService',
           title: '附加服务',
@@ -615,6 +627,8 @@ require(['common', 'template', 'momentLocale', 'clipboard', 'pinyin', 'serialize
             var isAk = airasia.indexOf(row.go[0].flightNum.slice(0, 2)) >= 0
             var is7c = row.go[0].flightNum.slice(0, 2) === '7C'
             var ismm = row.go[0].flightNum.slice(0, 2) === 'MM'
+            var dd = ['DD', 'XW']
+            var isdd = dd.includes(row.go[0].flightNum.slice(0, 2))
             var priceDisabled = !/#/.test(row.orderNo) && isAk
             var status = row.receiver ? (row.receiver.split('#')[3] ? row.receiver.split('#')[3].split(':')[1] : '') : ''
             var payDisabled = !/#/.test(row.orderNo) && ['BOOKSUC', 'BIGBOOKSUC', 'PAYING', 'PaySuccess', 'PayError'].indexOf(status) >= 0 && isAk
@@ -628,7 +642,7 @@ require(['common', 'template', 'momentLocale', 'clipboard', 'pinyin', 'serialize
                             <div class='btn-group'>
                                 <button type='button' class='btn btn-xs btn-info webGenerateOrder' ${(!/行李/.test(row.addService) && (isAk || isFr) || isCebu) ? '' : 'disabled'} data-isreturn='${row.back.length}' data-orderno='${row.orderNo}' data-pnrcode='${row.pnrCode}' data-iscebu='${isCebu}' data-isfr='${isFr}'>${isFr ? '生单支付' : (isCebu ? '特价生单' : '官网')}</button>
                                 ${isAk ? `<button type='button' class='btn btn-xs btn-default specialGenerateOrder' ${!/#/.test(row.orderNo) ? '' : 'disabled'} data-orderno='${row.orderNo}' data-pnrcode='${row.pnrCode}' data-paytype='balance'>特价</button>` : ''}
-                                <button type='button' class='btn btn-xs btn-danger pay' data-ismm='${ismm}' data-is7c='${is7c}' data-iscebu='${isCebu}' ${!/#/.test(row.orderNo) ? '' : 'disabled'} data-orderno='${row.orderNo}' data-pnrcode='${row.pnrCode}' data-paytype='balance'>支付</button>
+                                <button type='button' class='btn btn-xs btn-danger pay' data-isdd='${isdd}' data-ismm='${ismm}' data-is7c='${is7c}' data-iscebu='${isCebu}' ${!/#/.test(row.orderNo) ? '' : 'disabled'} data-orderno='${row.orderNo}' data-pnrcode='${row.pnrCode}' data-paytype='balance'>支付</button>
                             </div>
                         `
             // <button type='button' class='btn btn-xs btn-info pay' ${payDisabled ? '' : 'disabled'} data-orderno='${row.orderNo}' data-pnrcode='${row.pnrCode}' data-paytype='merge'>组合支付</button>
@@ -1298,6 +1312,35 @@ require(['common', 'template', 'momentLocale', 'clipboard', 'pinyin', 'serialize
       })
     }
 
+    // 获取短信验证码
+    function getVerifyCode(data) {
+      var html = `<form id="getVerifyCodeForm">
+                    <div>原始金额</div>
+                    <input type="number" name="money" class="form-control" placeholder="请输入原始金额" required>
+                  </form>`
+      var confirm = layer.confirm(html, {
+        shade: 0.3,
+        btn: ['确定', '取消'],
+        title: '获取短信验证码',
+        skin: 'layui-layer-molv',
+        yes: function () {
+          if ($('#getVerifyCodeForm').valid()) {
+            data.money = $('#getVerifyCodeForm').serializeObject().money
+            $.send({
+              data: data,
+              url: JSP_URL + 'pay/smsVerificationCode.jsp',
+              success: function (res) {
+                layer.alert(res.msg || '获取短信验证码失败', {
+                  title: '获取短信验证码',
+                  skin: 'layui-layer-molv'
+                })
+              }
+            })
+          }
+        }
+      })
+    }
+
     //增加出票-支付信息
     function addPayInfo(data) {
       if (data.ticketInfos.length != 0) {
@@ -1927,7 +1970,7 @@ require(['common', 'template', 'momentLocale', 'clipboard', 'pinyin', 'serialize
       return data
     }
 
-    // // 其他收入自动计算
+    // 其他收入自动计算
     // function otherRevenueCalculation() {
     //     $('#payContent input[name="paymentAmount"]').each(function(index) {
     //         var payType = $(this).attr('payType')
@@ -2671,7 +2714,7 @@ require(['common', 'template', 'momentLocale', 'clipboard', 'pinyin', 'serialize
     // 占座信息
     function seatInfo(data) {
       tableRender(data, 'modalBody', 'seatInfo', '占座信息', [
-        { title: '订单价格', field: 'totalprice' },
+        { title: '生单报价', field: 'totalprice' },
         { title: '官网价格', field: 'priceinfo' },
         { title: '占座价格', field: 'bagprice' },
         { title: '内部PNR', field: 'qunarorderno' },
@@ -2945,10 +2988,12 @@ require(['common', 'template', 'momentLocale', 'clipboard', 'pinyin', 'serialize
         var orderno = that.data('orderno')
         var is7c = that.data('is7c')
         var ismm = that.data('ismm')
-        var noTicketno = that.data('iscebu') || is7c || ismm
+        var isdd = that.data('isdd')
+        var iscebu = that.data('iscebu')
+        var noTicketno = iscebu || is7c || ismm || isdd
         getTicketno(JSON.stringify({ size: 1, pageNum: 1, qunarorderno: pnrCode }), that, function (res) {
           res.orderno = orderno
-          payConfirm(res, that, payType, noTicketno, is7c || ismm)
+          payConfirm(res, that, payType, noTicketno, is7c || ismm || isdd)
         })
       })
 
@@ -3084,10 +3129,19 @@ require(['common', 'template', 'momentLocale', 'clipboard', 'pinyin', 'serialize
         if ($(this).data('operator') === $.attachment.name) {
           virtualCard({ orderNo: $(this).data('orderno'), totalprice: $(this).data('totalprice'), currency: 'CNY', operator: $.attachment.name })
         } else {
-          layer.msg('您未锁定订单,无法获取虚拟卡.')
+          layer.msg('您未锁定订单,无法获取虚拟卡')
         }
       })
 
+      // 获取短信验证码
+      $('#modal').on('click', '#getVerifyCode', function () {
+        // if ($(this).data('operator') === $.attachment.name) {
+        getVerifyCode({ orderNo: $(this).data('orderno'), operator: $.attachment.name })
+        // } else {
+        //   layer.msg('您未锁定订单,无法获取短信验证码')
+        // }
+      })
+
       // 政策
       $('#modal').on('click', '.goPolicy', function () {
         var id = $(this).data('id')

+ 1 - 2
newSystem/newPolicy.html

@@ -1504,7 +1504,7 @@ require(['common', 'template', 'WebUploader', 'serializeObject', 'validateZh', '
                 $('#modal').on('click', '.save', function() {
                     var url = $(this).data('url');
                     var oData = $(this).data('oData');
-                    if (1 || $('#modalForm').valid()) {
+                    if ($('#modalForm').valid()) {
                         var data = $('#modalForm').serializeObject();
                         if (Array.isArray(data.cabin)) {
                             var canbinAddInfo = []
@@ -1520,7 +1520,6 @@ require(['common', 'template', 'WebUploader', 'serializeObject', 'validateZh', '
                         delete data.cabin
                         delete data.cabinPrice
                         data.platform = $.isArray(data.platform) ? data.platform.join('/') : data.platform
-                        console.log(data)
                         check(oData, data, function() {
                             save(url, data)
                         })

+ 4 - 3
orderSearch.html

@@ -486,7 +486,7 @@
   <div class="wrapper wrapper-content">
     <div class="ibox float-e-margins">
       <div class="ibox-title">
-        <h5>搜索 v0.4.0</h5>
+        <h5>搜索 v0.4.2</h5>
         <div class="ibox-tools">
           <a class="collapse-link">
             <i class="fa fa-chevron-up searchClose"></i>
@@ -956,7 +956,8 @@
                 <button type="button" class="btn btn-link btn-xs" id="passengerCopy"><i class="fa fa-clipboard"></i> 复制乘机人信息</button>{{if orderInfo.isAK||orderInfo.is5J}}
                 <button type="button" class="btn btn-danger btn-xs fl-r m-f" id="checkOrder">核验订单</button>{{/if}}
                 <button type="button" class="btn btn-primary btn-xs fl-r m-f" id="rewrite" {{orderInfo.isRewrite? 'disabled': ''}}>{{orderInfo.isRewrite==1?'回填完成':orderInfo.isRewrite==2?'回填失败':'回填票号'}}</button>{{if orderInfo.status==1}}
-                <button type="button" class="btn btn-success btn-xs fl-r m-f" id="virtualCard" data-operator="{{orderInfo.operator}}" data-orderno="{{orderInfo.orderNo}}" data-totalprice="{{orderInfo.allPrice}}">查看虚拟卡</button>{{/if}}
+                <button type="button" class="btn btn-success btn-xs fl-r m-f" id="virtualCard" data-operator="{{orderInfo.operator}}" data-orderno="{{orderInfo.orderNo}}" data-totalprice="{{orderInfo.allPrice}}">查看虚拟卡</button>
+                <button type="button" class="btn btn-success btn-xs fl-r m-f" id="getVerifyCode" data-operator="{{orderInfo.operator}}" data-orderno="{{orderInfo.orderNo}}">获取短信验证码</button>{{/if}}
                 <div class="bootstrap-table">
                     <div class="fixed-table-container" style="padding-bottom: 0px;">
                         <div class="fixed-table-body">
@@ -2648,6 +2649,6 @@
 </script>
 <script src="js/require.js"></script>
 <script src="js/require-config.js"></script>
-<script src="js/root/orderSearch.js?v=0.4.0"></script>
+<script src="js/root/orderSearch.js?v=0.4.2"></script>
 
 </html>

File diff suppressed because it is too large
+ 528 - 519
triptoSearch.html