Ver código fonte

数据检查,检查计量单元图册号

MaiXinRong 2 anos atrás
pai
commit
5f1d04785f

+ 1 - 0
app/public/js/ledger.js

@@ -43,6 +43,7 @@ const checkOption = {
     },
     zero: { enable: 1 },
     zeroPos: { enable: 1 },
+    pos_drawingCode: { enable: 1 },
     tp: {
         enable: 1,
         fields: [

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

@@ -15,6 +15,7 @@ const ledgerCheckType = {
     calc: {value: 3, text: '清单数量不等于计量单元之和', fun: 'checkCalc', },
     zero: {value: 4, text: '清单数量或单价为0', fun: 'checkZero', },
     zeroPos: {value: 12, text: '计量单元数量为0', fun: 'checkZeroPos', },
+    pos_drawingCode: {value: 13, text: '计量单元图册号未空', fun: 'checkPosDrawingCode', },
     tp: {value: 5, text: '清单金额≠数量×单价', fun: 'checkTp', },
     over: {value: 6, text: '超计', fun: 'checkOver', },
     same_code: {value: 7, text: '重复项目节', fun: 'checkSameCode', },
@@ -112,6 +113,23 @@ const ledgerCheckUtil = {
         }
         return error;
     },
+    checkPosDrawingCode: function (ledgerTree, ledgerPos, decimal, option) {
+        const error = [];
+        for (const node of ledgerTree.nodes) {
+            if (node.children && node.children.length > 0) continue;
+
+            const nodePos = ledgerPos.getLedgerPos(node.id);
+            if (!nodePos || nodePos.length === 0) continue;
+
+            for (const np of nodePos) {
+                if (!np.drawing_code) {
+                    error.push(node);
+                    break;
+                }
+            }
+        }
+        return error;
+    },
     checkTp: function (ledgerTree, ledgerPos, decimal, option) {
         const error = [];
         for (const node of ledgerTree.nodes) {

+ 1 - 0
app/public/js/revise.js

@@ -37,6 +37,7 @@ const checkOption = {
     },
     zero: { enable: 1 },
     zeroPos: { enable: 1 },
+    pos_drawingCode: { enable: 1 },
     tp: {
         enable: 1,
         fields: [

+ 0 - 1
app/view/shares/check_modal2.ejs

@@ -157,7 +157,6 @@
         }
         const doSomeCheck = function (setting, index) {
             const check = setting.checks[index];
-            console.log(check.wait);
             if (!check) return;
 
             setting.total = setting.total + (check.error || 0);