|
@@ -2739,7 +2739,7 @@ export default {
|
|
|
if (!elem.is_metal) {
|
|
|
// elem.part_detail = elem.sub_part;
|
|
|
if (!elem.part_detail) {
|
|
|
- elem.part_detail = elem.sub_part;
|
|
|
+ elem.part_detail = elem.sub_part || [];
|
|
|
}
|
|
|
elem.part_detail.map((el) => {
|
|
|
el.material_num = el.material_detail_num;
|
|
@@ -2818,8 +2818,7 @@ export default {
|
|
|
} else {
|
|
|
v.material_id = v.ext_id;
|
|
|
v.product_id = v.ext_id;
|
|
|
- v.single_price = v.price;
|
|
|
- v.price = v.num * v.single_price;
|
|
|
+ v.single_price = v.price / v.num;
|
|
|
}
|
|
|
});
|
|
|
} else {
|
|
@@ -3080,12 +3079,12 @@ export default {
|
|
|
elem.procedure_properties_str = [];
|
|
|
if (elem.process) {
|
|
|
elem.process.forEach((item, index) => {
|
|
|
- let _temp = [];
|
|
|
if (item.cld) {
|
|
|
+ let _temp = [];
|
|
|
item.cld.filter((_cld) => _cld.id == item.value);
|
|
|
+ elem.procedure_properties_str[index] =
|
|
|
+ _temp.length > 0 ? _temp[0].title : "";
|
|
|
}
|
|
|
- elem.procedure_properties_str[index] =
|
|
|
- _temp.length > 0 ? _temp[0].title : "";
|
|
|
});
|
|
|
elem.process_str = elem.procedure_properties_str.join("/");
|
|
|
elem.procedure_properties = {};
|
|
@@ -3854,11 +3853,7 @@ export default {
|
|
|
flag = true;
|
|
|
}
|
|
|
});
|
|
|
- if (flag) {
|
|
|
- return;
|
|
|
- } else {
|
|
|
- this.handleTableAdd();
|
|
|
- }
|
|
|
+ !flag && this.handleTableAdd();
|
|
|
},
|
|
|
handleTableAdd() {
|
|
|
if (this.info.custom_id) {
|
|
@@ -3992,6 +3987,7 @@ export default {
|
|
|
obj = this.deepClone(row);
|
|
|
obj.isCopied = true;
|
|
|
if (row.is_metal) {
|
|
|
+ console.log(`123`, 123);
|
|
|
} else {
|
|
|
obj.position = "";
|
|
|
obj.measure.map((v) => {
|
|
@@ -4008,11 +4004,12 @@ export default {
|
|
|
//复制一条数据,更换了产品之后,
|
|
|
//线条的内容要保留(不管更换的这个产品的默认线条是什么,都是只展示复制下来的)
|
|
|
//摘自Tower #2004
|
|
|
- obj.part.map((v) => {
|
|
|
- if (v.title.indexOf("线条") != -1) {
|
|
|
- this.copiedLinePart = this.deepClone(v);
|
|
|
- }
|
|
|
- });
|
|
|
+ obj.part &&
|
|
|
+ obj.part.map((v) => {
|
|
|
+ if (v.title.indexOf("线条") != -1) {
|
|
|
+ this.copiedLinePart = this.deepClone(v);
|
|
|
+ }
|
|
|
+ });
|
|
|
//因为是复制,插件id为_XID会相同导致bug,置空后会自动生成
|
|
|
obj._XID = "";
|
|
|
this.tableData.splice(index + 1, 0, obj);
|
|
@@ -4264,8 +4261,9 @@ export default {
|
|
|
},
|
|
|
changeEditMetal(row, rowIndex, $event, scope) {
|
|
|
row.ext_id = row.product_id;
|
|
|
- row.title = this.metalList.filter((v) => v.id == $event.value)[0].title;
|
|
|
- row.unit = this.metalList.filter((v) => v.id == $event.value)[0].unit;
|
|
|
+ const match_id = $event.value.split("_")[0];
|
|
|
+ row.title = this.metalList.filter((v) => v.id == match_id)[0].title;
|
|
|
+ row.unit = this.metalList.filter((v) => v.id == match_id)[0].unit;
|
|
|
},
|
|
|
changeEditMetalNum(e, row) {
|
|
|
row.price = (1 * e.target.value * row.single_price).toFixed(2);
|
|
@@ -4421,9 +4419,7 @@ export default {
|
|
|
(row.ext_price * 1 || 0);
|
|
|
row.price = row.price.toFixed(2);
|
|
|
row.selected_ids = [];
|
|
|
- // row.part = [];
|
|
|
- // row.part = res.data.part;
|
|
|
- res.data.part.forEach((element, index) => {
|
|
|
+ res.data.part.forEach((element) => {
|
|
|
// 选择不是附加项目的,
|
|
|
if (!element.is_metal) {
|
|
|
// 选择不是线条、或者基础档案中要默认为空的部件
|
|
@@ -4431,17 +4427,27 @@ export default {
|
|
|
element.isChoosed = true;
|
|
|
element.title = element.part_title;
|
|
|
element.process = JSON.parse(JSON.stringify(this.bpp_list));
|
|
|
- element.process.forEach((elem, index) => {
|
|
|
+ element.process.forEach((elem) => {
|
|
|
for (const key in res.data.process.title) {
|
|
|
const ele = res.data.process.title[key];
|
|
|
if (elem.name == ele) {
|
|
|
- elem.value = this.pre_process_obj[key] * 1;
|
|
|
- elem.process_id = key;
|
|
|
+ elem.value = "";
|
|
|
+ //tower #2056
|
|
|
+ // 开始需求是新增之后带上一条填过的工艺属性,后来又不需要,代码保留。
|
|
|
+ // 后来又改成只保留颜色跟线条 颜色的key 为2
|
|
|
+ if (key == 2 && row.isCopied) {
|
|
|
+ // elem.value = this.pre_process_obj[key] * 1;
|
|
|
+ elem.process_id = key;
|
|
|
+ }
|
|
|
if (!element.procedure_properties) {
|
|
|
element.procedure_properties = {};
|
|
|
}
|
|
|
- element.procedure_properties[key] =
|
|
|
- this.pre_process_obj[key] * 1;
|
|
|
+ //tower #2056
|
|
|
+ if (key == 2 && row.isCopied) {
|
|
|
+ element.procedure_properties[key] =
|
|
|
+ this.pre_process_obj[key] * 1;
|
|
|
+ // element.procedure_properties[key] = "";
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
});
|
|
@@ -4452,16 +4458,20 @@ export default {
|
|
|
} else {
|
|
|
for (const key in this.pre_process_obj) {
|
|
|
const item = this.pre_process_obj[key];
|
|
|
- row[key] = item * 1;
|
|
|
+ if (key == 2 && row.isCopied) {
|
|
|
+ row[key] = item * 1;
|
|
|
+ }
|
|
|
}
|
|
|
element.change_id = element.change[0].id;
|
|
|
}
|
|
|
if (isCopied && element.title.indexOf("线条") != -1) {
|
|
|
+ delete this.copiedLinePart.change;
|
|
|
+ delete this.copiedLinePart.change_id;
|
|
|
element = Object.assign(element, this.copiedLinePart);
|
|
|
}
|
|
|
element.part_detail = element.sub_part;
|
|
|
//展示非拆分部件
|
|
|
- // 默认替换部件 pre_process_obj
|
|
|
+ // 默认替换部件
|
|
|
//存计算公式
|
|
|
element.long ? "" : (element.long = 0);
|
|
|
element.wide ? "" : (element.wide = 0);
|
|
@@ -4511,7 +4521,6 @@ export default {
|
|
|
// this.$forceUpdate();
|
|
|
});
|
|
|
}
|
|
|
- // row.part=[]
|
|
|
},
|
|
|
changeEditProduct($event) {
|
|
|
if ($event) {
|
|
@@ -4825,7 +4834,6 @@ export default {
|
|
|
})
|
|
|
.then((res) => {
|
|
|
this.modalData.part.map((part) => {
|
|
|
- console.log(`part`, part);
|
|
|
if (part.part_id === 25) {
|
|
|
res.data.sub_part.map((v) => {
|
|
|
v.material_detail_id =
|