|
@@ -2996,98 +2996,116 @@ export default {
|
|
|
this.tableData.forEach((element) => {
|
|
|
sum += element.price * 1;
|
|
|
if (!element.is_metal) {
|
|
|
- element.part&&
|
|
|
- element.part.forEach((elem) => {
|
|
|
- if (!elem.is_metal) {
|
|
|
- // 统计部件
|
|
|
- const temp = this.parts_title_count.filter(
|
|
|
- (item) => item.title == elem.title
|
|
|
- );
|
|
|
- if (temp && temp.length > 0) {
|
|
|
- this.parts_title_count.map((v) => {
|
|
|
- v.title == elem.title && v.num++;
|
|
|
- });
|
|
|
- } else {
|
|
|
- this.parts_title_count.push({
|
|
|
- change_id: elem.change_id,
|
|
|
- title: elem.title,
|
|
|
- num: elem.num || 1,
|
|
|
- unit: elem.unit,
|
|
|
- });
|
|
|
- }
|
|
|
- // 如果没有点开产品详情的话找不到 part_detail
|
|
|
- if (!elem.part_detail) {
|
|
|
- elem.part_detail = elem.sub_part;
|
|
|
- }
|
|
|
- // 部件中要统计所有线条数量
|
|
|
- elem.part_detail &&
|
|
|
- elem.part_detail.length > 0 &&
|
|
|
- elem.part_detail.forEach((el) => {
|
|
|
- if (el.material_detail_title.indexOf("线条") != -1) {
|
|
|
- const temp = this.wood_title_count.filter(
|
|
|
- (item) => item.title == el.material_detail_title
|
|
|
- );
|
|
|
- if (temp && temp.length > 0) {
|
|
|
- // 匹配规格是否已存在
|
|
|
- const _temp = temp[0].measure_str.filter(
|
|
|
- (item) => item.id == el.material_detail_id
|
|
|
+ element.part &&
|
|
|
+ element.part.forEach((elem) => {
|
|
|
+ if (!elem.is_metal) {
|
|
|
+ // 统计部件
|
|
|
+ const temp = this.parts_title_count.filter(
|
|
|
+ (item) => item.title == elem.title
|
|
|
+ );
|
|
|
+ if (temp && temp.length > 0) {
|
|
|
+ this.parts_title_count.map((v) => {
|
|
|
+ v.title == elem.title && v.num++;
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.parts_title_count.push({
|
|
|
+ change_id: elem.change_id,
|
|
|
+ title: elem.title,
|
|
|
+ num: elem.num || 1,
|
|
|
+ unit: elem.unit,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ // 如果没有点开产品详情的话找不到 part_detail
|
|
|
+ if (!elem.part_detail) {
|
|
|
+ elem.part_detail = elem.sub_part;
|
|
|
+ }
|
|
|
+ // 部件中要统计所有线条数量
|
|
|
+ elem.part_detail &&
|
|
|
+ elem.part_detail.length > 0 &&
|
|
|
+ elem.part_detail.forEach((el) => {
|
|
|
+ if (el.material_detail_title.indexOf("线条") != -1) {
|
|
|
+ const temp = this.wood_title_count.filter(
|
|
|
+ (item) => item.title == el.material_detail_title
|
|
|
);
|
|
|
- if (_temp && _temp.length > 0) {
|
|
|
- this.wood_title_count.map((v) => {
|
|
|
- v.title == el.material_detail_title &&
|
|
|
- v.measure_str.map((item) => {
|
|
|
- if (item.id == el.material_detail_id) {
|
|
|
- item.num =
|
|
|
- item.num * 1 + el.material_detail_num * 1;
|
|
|
- }
|
|
|
+ if (temp && temp.length > 0) {
|
|
|
+ // 匹配规格是否已存在
|
|
|
+ const _temp = temp[0].measure_str.filter(
|
|
|
+ (item) => item.id == el.material_detail_id
|
|
|
+ );
|
|
|
+ if (_temp && _temp.length > 0) {
|
|
|
+ this.wood_title_count.map((v) => {
|
|
|
+ v.title == el.material_detail_title &&
|
|
|
+ v.measure_str.map((item) => {
|
|
|
+ if (item.id == el.material_detail_id) {
|
|
|
+ item.num =
|
|
|
+ item.num * 1 + el.material_detail_num * 1;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ // 不存在一样规格
|
|
|
+ if (
|
|
|
+ el.material_detail_list &&
|
|
|
+ el.material_detail_list.length > 0
|
|
|
+ ) {
|
|
|
+ const __temp = el.material_detail_list.filter(
|
|
|
+ (item) =>
|
|
|
+ item.material_detail_id == el.material_detail_id
|
|
|
+ );
|
|
|
+ this.wood_title_count.map((v) => {
|
|
|
+ v.title == el.material_detail_title &&
|
|
|
+ ((v.unit = __temp[0].unit),
|
|
|
+ v.measure_str.push({
|
|
|
+ num: el.material_detail_num,
|
|
|
+ id: __temp[0].material_detail_id,
|
|
|
+ measure: `${__temp[0].long || 0}*${__temp[0]
|
|
|
+ .wide || 0}*${__temp[0].high || 0}`,
|
|
|
+ }));
|
|
|
});
|
|
|
- });
|
|
|
+ } else {
|
|
|
+ this.wood_title_count.map((v) => {
|
|
|
+ v.title == el.material_detail_title &&
|
|
|
+ ((v.unit = el.unit),
|
|
|
+ v.measure_str.push({
|
|
|
+ num: el.material_detail_num,
|
|
|
+ id: el.material_detail_id,
|
|
|
+ measure: `${el.long || 0}*${el.wide ||
|
|
|
+ 0}*${el.high || 0}`,
|
|
|
+ }));
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
} else {
|
|
|
- // 不存在一样规格
|
|
|
+ // 不存在就新增
|
|
|
if (
|
|
|
el.material_detail_list &&
|
|
|
el.material_detail_list.length > 0
|
|
|
) {
|
|
|
- const __temp = el.material_detail_list.filter(
|
|
|
+ const _temp = el.material_detail_list.filter(
|
|
|
(item) =>
|
|
|
item.material_detail_id == el.material_detail_id
|
|
|
);
|
|
|
- this.wood_title_count.map((v) => {
|
|
|
- v.title == el.material_detail_title &&
|
|
|
- ((v.unit = __temp[0].unit),
|
|
|
- v.measure_str.push({
|
|
|
- num: el.material_detail_num,
|
|
|
- id: __temp[0].material_detail_id,
|
|
|
- measure: `${__temp[0].long || 0}*${__temp[0]
|
|
|
- .wide || 0}*${__temp[0].high || 0}`,
|
|
|
- }));
|
|
|
- });
|
|
|
+ if (_temp && _temp.length > 0) {
|
|
|
+ if (!total_line_unit) {
|
|
|
+ total_line_unit = _temp[0].unit;
|
|
|
+ }
|
|
|
+ this.wood_title_count.push({
|
|
|
+ title: el.material_detail_title,
|
|
|
+ unit: total_line_unit,
|
|
|
+ measure_str: [
|
|
|
+ {
|
|
|
+ num: el.material_detail_num,
|
|
|
+ id: _temp[0].material_detail_id,
|
|
|
+ measure: `${_temp[0].long || 0}*${_temp[0]
|
|
|
+ .wide || 0}*${_temp[0].high || 0}`,
|
|
|
+ unit: _temp[0].unit,
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ });
|
|
|
+ }
|
|
|
} else {
|
|
|
- this.wood_title_count.map((v) => {
|
|
|
- v.title == el.material_detail_title &&
|
|
|
- ((v.unit = el.unit),
|
|
|
- v.measure_str.push({
|
|
|
- num: el.material_detail_num,
|
|
|
- id: el.material_detail_id,
|
|
|
- measure: `${el.long || 0}*${el.wide ||
|
|
|
- 0}*${el.high || 0}`,
|
|
|
- }));
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
- } else {
|
|
|
- // 不存在就新增
|
|
|
- if (
|
|
|
- el.material_detail_list &&
|
|
|
- el.material_detail_list.length > 0
|
|
|
- ) {
|
|
|
- const _temp = el.material_detail_list.filter(
|
|
|
- (item) =>
|
|
|
- item.material_detail_id == el.material_detail_id
|
|
|
- );
|
|
|
- if (_temp && _temp.length > 0) {
|
|
|
if (!total_line_unit) {
|
|
|
- total_line_unit = _temp[0].unit;
|
|
|
+ total_line_unit = el.unit;
|
|
|
}
|
|
|
this.wood_title_count.push({
|
|
|
title: el.material_detail_title,
|
|
@@ -3095,37 +3113,19 @@ export default {
|
|
|
measure_str: [
|
|
|
{
|
|
|
num: el.material_detail_num,
|
|
|
- id: _temp[0].material_detail_id,
|
|
|
- measure: `${_temp[0].long || 0}*${_temp[0]
|
|
|
- .wide || 0}*${_temp[0].high || 0}`,
|
|
|
- unit: _temp[0].unit,
|
|
|
+ id: el.material_detail_id,
|
|
|
+ measure: `${el.long || 0}*${el.wide ||
|
|
|
+ 0}*${el.high || 0}`,
|
|
|
+ unit: el.unit,
|
|
|
},
|
|
|
],
|
|
|
});
|
|
|
}
|
|
|
- } else {
|
|
|
- if (!total_line_unit) {
|
|
|
- total_line_unit = el.unit;
|
|
|
- }
|
|
|
- this.wood_title_count.push({
|
|
|
- title: el.material_detail_title,
|
|
|
- unit: total_line_unit,
|
|
|
- measure_str: [
|
|
|
- {
|
|
|
- num: el.material_detail_num,
|
|
|
- id: el.material_detail_id,
|
|
|
- measure: `${el.long || 0}*${el.wide ||
|
|
|
- 0}*${el.high || 0}`,
|
|
|
- unit: el.unit,
|
|
|
- },
|
|
|
- ],
|
|
|
- });
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
});
|
|
|
// 数线条
|
|
@@ -4014,6 +4014,7 @@ export default {
|
|
|
changeEditProcess(row, obj) {
|
|
|
row.isEdit = true;
|
|
|
row.procedure_properties[obj.id] = row[obj.id];
|
|
|
+ this.pre_process_obj[obj.id] = row[obj.id];
|
|
|
row.process_obj.filter((v) => v.id == obj.id)[0].value = row[obj.id];
|
|
|
row.part.map((item) => {
|
|
|
if (!item.is_metal) {
|