Просмотр исходного кода

数据检查,筛选类型,根据页面调整

MaiXinRong 4 лет назад
Родитель
Сommit
9263233a78
4 измененных файлов с 76 добавлено и 63 удалено
  1. 21 20
      app/public/js/ledger.js
  2. 9 0
      app/public/js/ledger_check.js
  3. 21 20
      app/public/js/revise.js
  4. 25 23
      app/public/js/stage.js

+ 21 - 20
app/public/js/ledger.js

@@ -34,6 +34,25 @@ function getExprInfo (field) {
 function transExpr(expr) {
     return expr.replace('=', '').replace('%', '/100');
 }
+const checkOption = {
+    sibling: { enable: 1 },
+    empty_code: { enable: 1 },
+    calc: {
+        enable: 1,
+        fields: ['sgfh_qty', 'qtcl_qty', 'sjcl_qty', 'quantity'],
+    },
+    zero: { enable: 1 },
+    tp: {
+        enable: 1,
+        fields: [
+            {qty: 'sgfh_qty', tp: 'sgfh_tp'},
+            {qty: 'sjcl_qty', tp: 'sjcl_tp'},
+            {qty: 'qtcl_qty', tp: 'qtcl_tp'},
+            {qty: 'quantity', tp: 'total_price'},
+            {qty: 'deal_qty', tp: 'deal_tp'},
+        ],
+    }
+};
 
 $(document).ready(function() {
     let stdXmj, stdGcl, dealBills, searchLedger;
@@ -101,7 +120,7 @@ $(document).ready(function() {
         selector: '#check-list',
         relaSpread: ledgerSpread,
         storeKey: 'ledger-check-' + getTenderId(),
-        checkType: ledgerCheckType,
+        checkType: getCheckType(checkOption),
         afterLocated:  function () {
             posOperationObj.loadCurPosData();
         },
@@ -3394,25 +3413,7 @@ $(document).ready(function() {
             ledgerPos: pos,
             checkList: checkList,
             decimal: tenderInfo.decimal,
-            checkOption: {
-                sibling: { enable: 1 },
-                empty_code: { enable: 1 },
-                calc: {
-                    enable: 1,
-                    fields: ['sgfh_qty', 'qtcl_qty', 'sjcl_qty', 'quantity'],
-                },
-                zero: { enable: 1 },
-                tp: {
-                    enable: 1,
-                    fields: [
-                        {qty: 'sgfh_qty', tp: 'sgfh_tp'},
-                        {qty: 'sjcl_qty', tp: 'sjcl_tp'},
-                        {qty: 'qtcl_qty', tp: 'qtcl_tp'},
-                        {qty: 'quantity', tp: 'total_price'},
-                        {qty: 'deal_qty', tp: 'deal_tp'},
-                    ],
-                },
-            }
+            checkOption: checkOption,
         });
         check2Viewing({
             extra: ZhCalc.div(ledgerTree.datas.length + pos.datas.length, 10000, 0),

+ 9 - 0
app/public/js/ledger_check.js

@@ -189,4 +189,13 @@ const ledgerCheck2 = function (setting) {
         setting.checkList.hide();
     }
     return progressData;
+};
+const getCheckType = function (option) {
+    const result = {};
+    for (const o in option) {
+        if (option[o].enable) {
+            result[o] = ledgerCheckType[o];
+        }
+    }
+    return result;
 };

+ 21 - 20
app/public/js/revise.js

@@ -28,6 +28,25 @@ function transExpr(expr) {
     return $.trim(expr).replace('\t', '').replace('=', '').replace('%', '/100');
 }
 const copyBlockTag = 'zh.calc.copyBlock';
+const checkOption = {
+    sibling: { enable: 1 },
+    empty_code: { enable: 1 },
+    calc: {
+        enable: 1,
+        fields: ['sgfh_qty', 'qtcl_qty', 'sjcl_qty', 'quantity'],
+    },
+    zero: { enable: 1 },
+    tp: {
+        enable: 1,
+        fields: [
+            {qty: 'sgfh_qty', tp: 'sgfh_tp'},
+            {qty: 'sjcl_qty', tp: 'sjcl_tp'},
+            {qty: 'qtcl_qty', tp: 'qtcl_tp'},
+            {qty: 'quantity', tp: 'total_price'},
+            {qty: 'deal_qty', tp: 'deal_tp'},
+        ],
+    },
+};
 
 $(document).ready(() => {
     let stdXmj, stdGcl, searchLedger;
@@ -65,7 +84,7 @@ $(document).ready(() => {
         selector: '#check-list',
         relaSpread: billsSpread,
         storeKey: 'revise-check-' + window.location.pathname.split('/')[2] + '-' + window.location.pathname.split('/')[4],
-        checkType: ledgerCheckType,
+        checkType: getCheckType(checkOption),
         afterLocated:  function () {
             posSpreadObj.loadCurPosData();
         },
@@ -2565,25 +2584,7 @@ $(document).ready(() => {
             ledgerPos: pos,
             checkList: checkList,
             decimal: decimal,
-            checkOption: {
-                sibling: { enable: 1 },
-                empty_code: { enable: 1 },
-                calc: {
-                    enable: 1,
-                    fields: ['sgfh_qty', 'qtcl_qty', 'sjcl_qty', 'quantity'],
-                },
-                zero: { enable: 1 },
-                tp: {
-                    enable: 1,
-                    fields: [
-                        {qty: 'sgfh_qty', tp: 'sgfh_tp'},
-                        {qty: 'sjcl_qty', tp: 'sjcl_tp'},
-                        {qty: 'qtcl_qty', tp: 'qtcl_tp'},
-                        {qty: 'quantity', tp: 'total_price'},
-                        {qty: 'deal_qty', tp: 'deal_tp'},
-                    ],
-                },
-            }
+            checkOption: checkOption,
         });
         check2Viewing({
             extra: ZhCalc.div(billsTree.datas.length + pos.datas.length, 10000, 0),

+ 25 - 23
app/public/js/stage.js

@@ -166,8 +166,31 @@ function getDaglText(data) {
     return def ? def.name : '';
 }
 
+
 $(document).ready(() => {
     let detail, searchLedger, checkedChanges;
+    const checkOption = {
+        sibling: { enable: 0 },
+        empty_code: { enable: 0 },
+        calc: {
+            enable: 1,
+            fields: ['contract_qty', 'qc_qty'],
+        },
+        zero: { enable: 0 },
+        tp: {
+            enable: 1,
+            fields: [
+                {qty: 'contract_qty', tp: 'contract_tp'},
+                {qty: 'qc_qty', tp: 'qc_tp'},
+            ],
+            filter: function (node) {
+                return node.is_tp;
+            }
+        },
+        over: {
+            enable: 1, isTz: checkTzMeasureType(),
+        }
+    };
     // 界面布局
     autoFlashHeight();
     // 初始化 台账树结构 数据结构
@@ -677,7 +700,7 @@ $(document).ready(() => {
         selector: '#check-list',
         relaSpread: slSpread,
         storeKey: 'stage-check-' + window.location.pathname.split('/')[2] + '-' + window.location.pathname.split('/')[4],
-        checkType: ledgerCheckType,
+        checkType: getCheckType(checkOption),
         afterLocated:  function () {
             stagePosSpreadObj.loadCurPosData();
         },
@@ -3716,28 +3739,7 @@ $(document).ready(() => {
         ledgerPos: stagePos,
         checkList: checkList,
         decimal: tenderInfo.decimal,
-        checkOption: {
-            sibling: { enable: 0 },
-            empty_code: { enable: 0 },
-            calc: {
-                enable: 1,
-                fields: ['contract_qty', 'qc_qty'],
-            },
-            zero: { enable: 0 },
-            tp: {
-                enable: 1,
-                fields: [
-                    {qty: 'contract_qty', tp: 'contract_tp'},
-                    {qty: 'qc_qty', tp: 'qc_tp'},
-                ],
-                filter: function (node) {
-                    return node.is_tp;
-                }
-            },
-            over: {
-                enable: 1, isTz: checkTzMeasureType(),
-            }
-        }
+        checkOption: checkOption,
     };
     if (!checkTzMeasureType()) {
         stageCheckerSetting.checkOption.calc.fields.push('sgfh_qty', 'sjcl_qty', 'qtcl_qty', 'quantity');