|
@@ -4914,7 +4914,7 @@ export default {
|
|
|
// 特殊部件 门头板, 需要在原有产品测量字段H上增加门头板的H
|
|
|
if (isSpecialPart) {
|
|
|
product.part.map((v) => {
|
|
|
- if (v.title.indexOf("门头板") != -1) {
|
|
|
+ if (match_item.e_title == "H") {
|
|
|
if (
|
|
|
match_item.max > v.long * 1 + product["H"] * 1 &&
|
|
|
match_item.min <= v.long * 1 + product["H"] * 1
|
|
@@ -4930,6 +4930,22 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
+ } else {
|
|
|
+ if (
|
|
|
+ match_item.max > product[match_item.e_title] &&
|
|
|
+ match_item.min <= product[match_item.e_title]
|
|
|
+ ) {
|
|
|
+ part_arr &&
|
|
|
+ part_arr.part_detail &&
|
|
|
+ part_arr.part_detail.map((v) => {
|
|
|
+ if (v.part_detail_id == k) {
|
|
|
+ v.material_detail_id =
|
|
|
+ match_item.material_detail_id;
|
|
|
+ v.material_detail_org_num = match_item.num;
|
|
|
+ v.material_detail_num = match_item.num;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
} else {
|
|
@@ -5128,6 +5144,7 @@ export default {
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
+ product.over_price = 0;
|
|
|
product.part.map((item) => {
|
|
|
const cur_part = product.overdraft.filter(
|
|
|
(v) => v.part_id == item.part_id
|
|
@@ -5140,36 +5157,39 @@ export default {
|
|
|
item.long >= element.min &&
|
|
|
item.long < element.max
|
|
|
) {
|
|
|
- item.formula_temp = element.formula;
|
|
|
+ item.formula_temp = JSON.parse(JSON.stringify(element.formula));
|
|
|
item.formula_temp = item.formula_temp.replace(/H/g, item.long);
|
|
|
item.formula_temp = item.formula_temp.replace(/W/g, item.wide);
|
|
|
item.formula_temp = item.formula_temp.replace(/T/g, item.high);
|
|
|
item.formula_value = eval(item.formula_temp);
|
|
|
- product.over_price += item.formula_value * 1 || 0;
|
|
|
+ product.over_price =
|
|
|
+ product.over_price * 1 + item.formula_value * 1;
|
|
|
}
|
|
|
if (
|
|
|
element.type == 2 &&
|
|
|
item.wide >= element.min &&
|
|
|
item.wide < element.max
|
|
|
) {
|
|
|
- item.formula_temp = element.formula;
|
|
|
+ item.formula_temp = JSON.parse(JSON.stringify(element.formula));
|
|
|
item.formula_temp = item.formula_temp.replace(/H/g, item.long);
|
|
|
item.formula_temp = item.formula_temp.replace(/W/g, item.wide);
|
|
|
item.formula_temp = item.formula_temp.replace(/T/g, item.high);
|
|
|
- item.formula_value = eval(item.formula_temp);
|
|
|
- product.over_price += item.formula_value * 1 || 0;
|
|
|
+ item.formula_value = eval(item.formula_temp).toFixed(2);
|
|
|
+ product.over_price =
|
|
|
+ product.over_price * 1 + item.formula_value * 1;
|
|
|
}
|
|
|
if (
|
|
|
element.type == 3 &&
|
|
|
item.high >= element.min &&
|
|
|
item.high < element.max
|
|
|
) {
|
|
|
- item.formula_temp = element.formula;
|
|
|
+ item.formula_temp = JSON.parse(JSON.stringify(element.formula));
|
|
|
item.formula_temp = item.formula_temp.replace(/H/g, item.long);
|
|
|
item.formula_temp = item.formula_temp.replace(/W/g, item.wide);
|
|
|
item.formula_temp = item.formula_temp.replace(/T/g, item.high);
|
|
|
item.formula_value = eval(item.formula_temp);
|
|
|
- product.over_price += item.formula_value * 1 || 0;
|
|
|
+ product.over_price =
|
|
|
+ product.over_price * 1 + item.formula_value * 1;
|
|
|
}
|
|
|
});
|
|
|
});
|
|
@@ -5190,7 +5210,9 @@ export default {
|
|
|
product.num = eval(product.num_formula_temp);
|
|
|
}
|
|
|
product.num = Number(product.num).toFixed(2);
|
|
|
+ console.log(`product.over_price`, product.over_price);
|
|
|
product.over_price = Number(product.over_price).toFixed(2);
|
|
|
+ console.log(`product.over_price1`, product.over_price);
|
|
|
product.num_temp_save = product.num || 1;
|
|
|
product.price =
|
|
|
(product.unit_price * 1 || 0) * (product.num * 1 || 1) +
|