fixed Mix
This commit is contained in:
@@ -614,17 +614,11 @@ $(document).ready(function () {
|
||||
partsListData.forEach((part) => {
|
||||
const partNumber = part.part_number;
|
||||
const partDescription = part.part_description;
|
||||
const isMixPart = String(part.mix || "N").toUpperCase() === "Y";
|
||||
|
||||
const partColor =
|
||||
partColors[partNumber] ||
|
||||
(partDescription.toLowerCase().startsWith("mix")
|
||||
? "#0000ff"
|
||||
: "#ff0000");
|
||||
if (
|
||||
partNumber &&
|
||||
partDescription &&
|
||||
(showMixParts ||
|
||||
!partDescription.toLowerCase().startsWith("mix"))
|
||||
) {
|
||||
partColors[partNumber] || (isMixPart ? "#0000ff" : "#ff0000");
|
||||
if (partNumber && partDescription && (showMixParts || !isMixPart)) {
|
||||
const colorOptions = predefinedColors
|
||||
.map(
|
||||
(color) =>
|
||||
@@ -922,11 +916,10 @@ $(document).ready(function () {
|
||||
) {
|
||||
partsListData = response.parts;
|
||||
response.parts.forEach((part) => {
|
||||
const defaultColor = part.part_description
|
||||
.toLowerCase()
|
||||
.startsWith("mix")
|
||||
? "#0000ff"
|
||||
: "#ff0000";
|
||||
const isMixPart =
|
||||
String(part.mix || "N").toUpperCase() === "Y";
|
||||
const defaultColor = isMixPart ? "#0000ff" : "#ff0000";
|
||||
|
||||
partColors[part.part_number] = defaultColor;
|
||||
});
|
||||
updatePartsList();
|
||||
@@ -1003,11 +996,10 @@ $(document).ready(function () {
|
||||
(p) => p.part_number == marker.partNumber,
|
||||
);
|
||||
const partDescription = part ? part.part_description : "";
|
||||
if (
|
||||
!showMixParts &&
|
||||
partDescription &&
|
||||
partDescription.toLowerCase().startsWith("mix")
|
||||
) {
|
||||
const isMixPart =
|
||||
part && String(part.mix || "N").toUpperCase() === "Y";
|
||||
|
||||
if (!showMixParts && isMixPart) {
|
||||
console.log("Ignoro marker per parte Mix:", marker.partNumber);
|
||||
return;
|
||||
}
|
||||
@@ -1115,11 +1107,10 @@ $(document).ready(function () {
|
||||
}
|
||||
|
||||
const partsList = partsListData
|
||||
.filter(
|
||||
(part) =>
|
||||
showMixParts ||
|
||||
!part.part_description.toLowerCase().startsWith("mix"),
|
||||
)
|
||||
.filter((part) => {
|
||||
const isMixPart = String(part.mix || "N").toUpperCase() === "Y";
|
||||
return showMixParts || !isMixPart;
|
||||
})
|
||||
.map((part) => `${part.part_number} ${part.part_description}`);
|
||||
|
||||
const text = partsList.join("\n");
|
||||
|
||||
Reference in New Issue
Block a user