没心没肺 5 years ago
parent
commit
ca559f6b94
2 changed files with 71 additions and 32 deletions
  1. 67 28
      js/root/orderSearch.js
  2. 4 4
      orderSearch.html

+ 67 - 28
js/root/orderSearch.js

@@ -353,15 +353,15 @@ require(['common', 'template', 'moment', 'clipboard', 'pinyin', 'serializeObject
           })
           result = res.rows
           //获取航段数
-          $.send({
-            data: JSON.stringify(data),
-            contentType: 'application/json',
-            coverError: true,
-            url: BASE_URL + 'qunaer/listCountFlight',
-            success: function (count) {
-              $('.segmentCount').text(count.total || 0)
-            }
-          })
+          // $.send({
+          //   data: JSON.stringify(data),
+          //   contentType: 'application/json',
+          //   coverError: true,
+          //   url: BASE_URL + 'qunaer/listCountFlight',
+          //   success: function (count) {
+          //     $('.segmentCount').text(count.total || 0)
+          //   }
+          // })
           if (sort) {
             return sort(res)
           } else {
@@ -369,7 +369,7 @@ require(['common', 'template', 'moment', 'clipboard', 'pinyin', 'serializeObject
           }
         }
       }, {
-        pageSize: 120,
+        pageSize: 60,
         pageList: [30, 60, 120, 300]
       }, [{
         field: 'orderNo',
@@ -603,7 +603,7 @@ require(['common', 'template', 'moment', 'clipboard', 'pinyin', 'serializeObject
                     <button type='button' class='btn btn-xs btn-success lock ${row.ticketLock == 0 ? "btn-outline" : ""}' ${lockDisabled} data-ordersource='${row.orderSource}' data-ticketlock='${row.ticketLock == 0 ? 1 : 0}' data-orderno='${row.orderNo}'>${row.ticketLock == 0 ? '锁单' : (row.ticketLock == 1 ? '解锁' : '已锁定')}</button>
                 </div>
                 <div class='btn-group'>
-                    <button type='button' class='btn btn-xs btn-info webGenerateOrder' ${(row.isFR || row.isAK || row.is5J) ? '' : 'disabled'} data-isreturn='${row.back.length}' data-orderno='${row.orderNo}' data-pnrcode='${row.pnrCode}' data-iscebu='${row.is5J}' data-isfr='${row.isFR}'>${row.isFR ? '生单支付' : (row.is5J ? '生单' : '官网')}</button>
+                    <button type='button' class='btn btn-xs btn-info webGenerateOrder' ${(row.isFR || row.isAK || row.is5J) ? '' : 'disabled'} data-isreturn='${row.back.length}' data-orderno='${row.orderNo}' data-pnrcode='${row.pnrCode}' data-isak='${row.isAK}' data-iscebu='${row.is5J}' data-isfr='${row.isFR}'>${row.isFR ? '生单支付' : (row.is5J ? '生单' : '官网')}</button>
                     ${(row.isAK || row.is5J) ? `<button type='button' class='btn btn-xs btn-default specialGenerateOrder' ${!/#/.test(row.orderNo) ? '' : 'disabled'} data-orderno='${row.orderNo}' data-pnrcode='${row.pnrCode}' data-carrier='${carrier}' data-type='${row.back.length ? '' : 'go'}' data-paytype='balance'>特价</button>` : ''}
                     <button type='button' class='btn btn-xs btn-danger pay' data-isze='${row.isZE}' data-isdd='${row.isDD}' data-ismm='${row.isMM}' data-is7c='${row.is7C}' data-iscebu='${row.is5J}' ${/#/.test(row.orderNo) || !(row.status == 1) ? 'disabled' : ''} data-orderno='${row.orderNo}' data-pnrcode='${row.pnrCode}' data-paytype='balance'>支付</button>
                 </div>`
@@ -2254,7 +2254,7 @@ require(['common', 'template', 'moment', 'clipboard', 'pinyin', 'serializeObject
     }
 
     // 强制执行
-    function force(option, ajaxData0, ajaxData1) {
+    function force(option, ajaxData0, ajaxData1, ajaxData2) {
       layer.confirm(option.msg, {
         title: option.title,
         skin: 'layui-layer-molv',
@@ -2292,6 +2292,24 @@ require(['common', 'template', 'moment', 'clipboard', 'pinyin', 'serializeObject
             }
             $.send(sendData)
           }
+        },
+        btn3: function () {
+          if (option.btn.length > 1 && ajaxData2) {
+            if (ajaxData2.force != undefined) {
+              ajaxData2.data.force = ajaxData2.force
+            }
+            var sendData = {
+              data: ajaxData2.data,
+              url: ajaxData2.url,
+              success: function (res) {
+                layer.msg(res.msg || res.mes)
+              }
+            }
+            if (ajaxData2.contentType != undefined) {
+              sendData.contentType = ajaxData2.contentType
+            }
+            $.send(sendData)
+          }
         }
       })
     }
@@ -2998,6 +3016,7 @@ require(['common', 'template', 'moment', 'clipboard', 'pinyin', 'serializeObject
       $('#table').on('click', '.webGenerateOrder', function () {
         var isfr = $(this).data('isfr')
         var isCebu = $(this).data('iscebu')
+        var isAk = $(this).data('isak')
         var data = {
           orderNo: $(this).data('orderno'),
           pnr: $(this).data('pnrcode'),
@@ -3012,7 +3031,25 @@ require(['common', 'template', 'moment', 'clipboard', 'pinyin', 'serializeObject
           cebuGenerateOrder(data, url, $(this).data('isreturn'))
           return false
         }
-        webGenerateOrder(data, url)
+        var html = `是否官网生单?<div><input type="text" class="form-control" id="wxid" name="wxid" placeholder="微信ID"></div>`
+        layer.confirm(html, {
+          title: '官网生单',
+          skin: 'layui-layer-molv',
+          btn: ['确认', '微信生单', '取消'],
+          yes: function () {
+            webGenerateOrder(data, url)
+          },
+          btn2: function () {
+            var wxid = $('#wxid').val()
+            if (wxid) {
+              data.wxid = wxid
+              data.force = 'wxOrder'
+              webGenerateOrder(data, url)
+            } else {
+              $('#wxid').addClass('error')
+            }
+          }
+        })
       })
 
       // 亚航 特价生单
@@ -3437,29 +3474,31 @@ require(['common', 'template', 'moment', 'clipboard', 'pinyin', 'serializeObject
             return false
           }
           if (profits <= -50) {
-            var _this = this
+            // var _this = this
             littleProfit({
               lossMoney: profits,
               editUser: data.editUser,
               orderNo: data.oaOrderInfo.orderNo
             }, function () {
-              if (orderData.orderInfo.isAK) {
-                checkOrderCB(_this, function () {
-                  editSave(JSON.stringify(data))
-                })
-              } else {
-                editSave(JSON.stringify(data))
-              }
-            })
-            return false;
-          }
-          if (orderData.orderInfo.isAK) {
-            checkOrderCB(this, function () {
+              // if (orderData.orderInfo.isAK) {
+              //   checkOrderCB(_this, function () {
+              //     editSave(JSON.stringify(data))
+              //   })
+              // } else {
+              //   editSave(JSON.stringify(data))
+              //   }
               editSave(JSON.stringify(data))
             })
-          } else {
-            editSave(JSON.stringify(data))
+            return false;
           }
+          // if (orderData.orderInfo.isAK) {
+          //   checkOrderCB(this, function () {
+          //     editSave(JSON.stringify(data))
+          //   })
+          // } else {
+          //   editSave(JSON.stringify(data))
+          // }
+          editSave(JSON.stringify(data))
         }
       })
 

+ 4 - 4
orderSearch.html

@@ -503,7 +503,7 @@
   <div class="wrapper wrapper-content">
     <div class="ibox float-e-margins">
       <div class="ibox-title">
-        <h5>搜索 v0.7.4</h5>
+        <h5>搜索 v0.7.8</h5>
         <div class="ibox-tools">
           <a class="collapse-link">
             <i class="fa fa-chevron-up searchClose"></i>
@@ -691,8 +691,8 @@
       </div>
       <div class="ibox-content">
         <div class="btn-group hidden-xs" id="tableToolbar" role="group" style="display: none">
-          <button type="button" class="btn btn-outline btn-default">总航段数</button>
-          <button type="button" class="btn btn-outline btn-default segmentCount">0</button>
+          <!-- <button type="button" class="btn btn-outline btn-default">总航段数</button> -->
+          <!-- <button type="button" class="btn btn-outline btn-default segmentCount">0</button> -->
           <button type="button" class="btn btn-outline btn-default" id="showLog">日志</button>
         </div>
         <table id="table"></table>
@@ -2662,6 +2662,6 @@
 </script>
 <script src="js/require.js"></script>
 <script src="js/require-config.js"></script>
-<script src="js/root/orderSearch.js?v=0.7.4"></script>
+<script src="js/root/orderSearch.js?v=0.7.8"></script>
 
 </html>