Forráskód Böngészése

修复导入清单bug

laiguoran 2 éve
szülő
commit
b3a5c6f34a
1 módosított fájl, 8 hozzáadás és 7 törlés
  1. 8 7
      app/public/js/material_checklist.js

+ 8 - 7
app/public/js/material_checklist.js

@@ -1165,9 +1165,9 @@ $(document).ready(() => {
                 for (const t of tree) {
                     if(t.children.length === 0) continue;
                     const findObject = {
-                        b_code: t.b_code,
-                        name: t.name,
-                        unit: t.unit,
+                        b_code: t.b_code ? t.b_code.toString() : t.b_code,
+                        name: t.name.toString() ? t.name.toString() : t.name,
+                        unit: t.unit.toString() ? t.unit.toString() : t.unit,
                     };
                     if (!ignoreUnitPrice) findObject.unit_price = t.unit_price ? parseFloat(t.unit_price) : null;
                     const order = _.findIndex(gclGatherData, findObject);
@@ -1336,9 +1336,9 @@ $(document).ready(() => {
                 if (mbList.length === 0) {
                     continue;
                 }
-                const findObject = { b_code: t.b_code,
-                    name: t.name,
-                    unit: t.unit,
+                const findObject = { b_code: t.b_code ? t.b_code.toString() : t.b_code,
+                    name: t.name ? t.name.toString() : t.name,
+                    unit: t.unit ? t.unit.toString() : t.unit,
                 };
                 if (!ignoreUnitPrice) findObject.unit_price = t.unit_price ? parseFloat(t.unit_price) : null;
                 const gclIndex = _.findIndex(gclGatherData, findObject);
@@ -1363,7 +1363,8 @@ $(document).ready(() => {
                     const gclData = gclGatherData[gclIndex];
                     for (const [index, ms] of materialStageData.entries()) {
                         if (ms.id !== ms_id) {
-                            const gclFindObject = { b_code: gclData.b_code, name: gclData.name, unit: gclData.unit };
+                            const gclFindObject = { b_code: gclData.b_code ? gclData.b_code.toString() : gclData.b_code,
+                                name: gclData.name ? gclData.name.toString() : gclData.name, unit: gclData.unit ? gclData.unit.toString() : gclData.unit };
                             if (!ignoreUnitPrice) gclFindObject.unit_price = gclData.unit_price;
                             const gclOther = _.find(gclGatherListData[index], gclFindObject);
                             if (gclOther) {