Browse Source

导出工料处理

ellisran 3 months ago
parent
commit
8a6883974a
1 changed files with 4 additions and 4 deletions
  1. 4 4
      app/public/js/material_checklist.js

+ 4 - 4
app/public/js/material_checklist.js

@@ -1499,10 +1499,6 @@ $(document).ready(() => {
         };
         };
         if (!materialChecklistData || materialChecklistData.length === 0) return;
         if (!materialChecklistData || materialChecklistData.length === 0) return;
         for (const ml of materialChecklistData) {
         for (const ml of materialChecklistData) {
-            data.push({
-                b_code: ml.b_code, name: ml.name, unit: ml.unit,
-                unit_price: ml.unit_price,
-            });
             const index = _.findIndex(gclGatherData, { b_code: ml.b_code, name: ml.name, unit: ml.unit, unit_price: ml.unit_price });
             const index = _.findIndex(gclGatherData, { b_code: ml.b_code, name: ml.name, unit: ml.unit, unit_price: ml.unit_price });
             if (index === -1) continue;
             if (index === -1) continue;
             const gcl = gclGatherData[index];
             const gcl = gclGatherData[index];
@@ -1520,6 +1516,10 @@ $(document).ready(() => {
                     }
                     }
                 }
                 }
                 if (newMaterialList.length > 0) {
                 if (newMaterialList.length > 0) {
+                    data.push({
+                        b_code: ml.b_code, name: ml.name, unit: ml.unit,
+                        unit_price: ml.unit_price,
+                    });
                     for (const nm of newMaterialList) {
                     for (const nm of newMaterialList) {
                         data.push({
                         data.push({
                             gljcode: nm.code, name: nm.name, unit: nm.unit,
                             gljcode: nm.code, name: nm.name, unit: nm.unit,