Procházet zdrojové kódy

修复重复生成bug

laiguoran před 3 roky
rodič
revize
ceaa3d9687
1 změnil soubory, kde provedl 3 přidání a 2 odebrání
  1. 3 2
      app/public/js/material_checklist.js

+ 3 - 2
app/public/js/material_checklist.js

@@ -149,8 +149,9 @@ $(document).ready(() => {
             });
             if (gcl) {
                 const mc = _.find(materialChecklistData, { b_code: gcl.b_code, name: gcl.name, unit: gcl.unit, unit_price: gcl.unit_price });
-                const newOrder = _.indexOf(gclGatherData, gcl);
-                if (!mc && _.findIndex(pushData, { order: newOrder }) === -1) {
+                // const newOrder = _.indexOf(gclGatherData, gcl);
+                // console.log(newOrder);
+                if (!mc && _.findIndex(pushData, { b_code: gcl.b_code, name: gcl.name, unit: gcl.unit, unit_price: gcl.unit_price }) === -1) {
                     pushData.push({ b_code: gcl.b_code, name: gcl.name, unit: gcl.unit, unit_price: gcl.unit_price, quantity: (gcl.quantity ? gcl.quantity : null), total_price: (gcl.total_price ? gcl.total_price : null), had_bills: 1 });
                 }
             }