Browse Source

Merge branch 'master' of http://192.168.1.41:3000/maixinrong/Calculation

TonyKang 5 years ago
parent
commit
0380a620d9
2 changed files with 21 additions and 4 deletions
  1. 20 2
      app/public/js/shares/tender_list_order.js
  2. 1 2
      app/public/js/stage_bwtz.js

+ 20 - 2
app/public/js/shares/tender_list_order.js

@@ -11,6 +11,21 @@
 const tenderListOrder = (function () {
     let orderSetting = getLocalCache('zh-calc-tender-list-order');
     if (!orderSetting) orderSetting = 'name|up';
+    function CompareStr (x, y) {
+        // 根据mysql的GBK
+        const regASC = /^[\x00-\x7F]/;
+        if (regASC.test(x) || regASC.test(y)) {
+            if (x > y) {
+                return 1
+            } else if (x < y) {
+                return -1
+            } else {
+                return 0;
+            }
+        } else {
+            return x.localeCompare(y, 'zh-CN');
+        }
+    }
     function reOrderTenders (orderStr) {
         if (orderStr) {
             orderSetting = orderStr;
@@ -19,9 +34,12 @@ const tenderListOrder = (function () {
         const orders = orderSetting.split('|');
         if (orders[0] === 'name') {
             tenders.sort(function (a, b) {
+                // return orders[1] === 'up'
+                //     ? a[orders[0]].localeCompare(b[orders[0]], 'zh')
+                //     : -a[orders[0]].localeCompare(b[orders[0]], 'zh');
                 return orders[1] === 'up'
-                    ? a[orders[0]].localeCompare(b[orders[0]], 'zh-CN')
-                    : -a[orders[0]].localeCompare(b[orders[0]], 'zh-CN')
+                    ? CompareStr(a[orders[0]], b[orders[0]])
+                    : CompareStr(b[orders[0]], a[orders[0]]);
             });
         } else if (orders[0] === 'create_time') {
             tenders.sort(function (a, b){

+ 1 - 2
app/public/js/stage_bwtz.js

@@ -253,9 +253,8 @@ $(document).ready(() => {
                 {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'total_price', hAlign: 2, width: 80, type: 'Number'},
                 {title: '本期合同计量|数量', colSpan: '2|1', rowSpan: '1|1', field: 'contract_qty', hAlign: 2, width: 60, type: 'Number'},
                 {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'contract_tp', hAlign: 2, width: 60, type: 'Number'},
-                {title: '本期数量变更|数量', colSpan: '3|1', rowSpan: '1|1', field: 'qc_qty', hAlign: 2, width: 60, type: 'Number'},
+                {title: '本期数量变更|数量', colSpan: '2|1', rowSpan: '1|1', field: 'qc_qty', hAlign: 2, width: 60, type: 'Number'},
                 {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'qc_tp', hAlign: 2, width: 60, type: 'Number'},
-                {title: '|变更令', colSpan: '|1', rowSpan: '|1', field: 'bgl_code', hAlign: 2, width: 60, formatter: '@'},
                 {title: '本期完成计量|数量', colSpan: '2|1', rowSpan: '1|1', field: 'gather_qty', hAlign: 2, width: 60, type: 'Number'},
                 {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'gather_tp', hAlign: 2, width: 60, type: 'Number'},
                 {title: '截止本期合同计量|数量', colSpan: '2|1', rowSpan: '1|1', field: 'end_contract_qty', hAlign: 2, width: 60, type: 'Number'},