|
@@ -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) {
|