|
@@ -458,8 +458,17 @@
|
|
|
v-else
|
|
|
v-for="(item, index) in tableData"
|
|
|
:key="item.title + '' + index"
|
|
|
- v-show="item.is_metal"
|
|
|
- >{{ item.title }}:{{ item.num }}{{ item.unit }}
|
|
|
+ v-show="item.type == 1"
|
|
|
+ >{{
|
|
|
+ metalList.filter((v) => v.id == item.ext_id).length > 0
|
|
|
+ ? metalList.filter((v) => v.id == item.ext_id)[0].title
|
|
|
+ : ""
|
|
|
+ }}:{{ item.num
|
|
|
+ }}{{
|
|
|
+ metalList.filter((v) => v.id == item.ext_id).length > 0
|
|
|
+ ? metalList.filter((v) => v.id == item.ext_id)[0].unit
|
|
|
+ : ""
|
|
|
+ }}
|
|
|
<span v-show="index < parts_title_count.length - 1">;</span>
|
|
|
</span>
|
|
|
</div>
|
|
@@ -530,13 +539,12 @@
|
|
|
{{ scope.row.is_metal ? "" : scope.row.position }}
|
|
|
</template>
|
|
|
</vxe-column>
|
|
|
- <vxe-column title="产品名称" min-width="150" :edit-render="{}">
|
|
|
+ <vxe-column title="产品名称/五金" min-width="150" :edit-render="{}">
|
|
|
<template #edit="scope">
|
|
|
<Select
|
|
|
filterable
|
|
|
clearable
|
|
|
transfer
|
|
|
- filter-by-label
|
|
|
label-in-value
|
|
|
v-if="!scope.row.is_metal"
|
|
|
v-model="scope.row.product_id"
|
|
@@ -762,11 +770,11 @@
|
|
|
v-show="!part_detail.is_metal"
|
|
|
>
|
|
|
<div
|
|
|
- v-for="(sub_part_detail, idx) in part_detail.sub_part"
|
|
|
- :key="idx + 'sub_part'"
|
|
|
+ v-for="(sub_part_detail, idx) in part_detail.part_detail"
|
|
|
+ :key="idx + 'part_detail'"
|
|
|
v-show="sub_part_detail.title.indexOf('线条') > 0"
|
|
|
:style="
|
|
|
- idx != part_detail.sub_part.length - 1
|
|
|
+ idx != part_detail.part_detail.length - 1
|
|
|
? {
|
|
|
borderBottom: '1px solid #e8eaec',
|
|
|
padding: '10px 0',
|
|
@@ -793,11 +801,11 @@
|
|
|
v-show="!part_detail.is_metal"
|
|
|
>
|
|
|
<div
|
|
|
- v-for="(sub_part_detail, idx) in part_detail.sub_part"
|
|
|
- :key="idx + 'sub_part'"
|
|
|
+ v-for="(sub_part_detail, idx) in part_detail.part_detail"
|
|
|
+ :key="idx + 'part_detail'"
|
|
|
v-show="sub_part_detail.title.indexOf('线条') > 0"
|
|
|
:style="
|
|
|
- idx != part_detail.sub_part.length - 1
|
|
|
+ idx != part_detail.part_detail.length - 1
|
|
|
? {
|
|
|
borderBottom: '1px solid #e8eaec',
|
|
|
padding: '10px 0',
|
|
@@ -833,11 +841,11 @@
|
|
|
v-show="!part_detail.is_metal"
|
|
|
>
|
|
|
<div
|
|
|
- v-for="(sub_part_detail, idx) in part_detail.sub_part"
|
|
|
- :key="idx + 'sub_part'"
|
|
|
+ v-for="(sub_part_detail, idx) in part_detail.part_detail"
|
|
|
+ :key="idx + 'part_detail'"
|
|
|
v-show="sub_part_detail.title.indexOf('线条') > 0"
|
|
|
:style="
|
|
|
- idx != part_detail.sub_part.length - 1
|
|
|
+ idx != part_detail.part_detail.length - 1
|
|
|
? {
|
|
|
borderBottom: '1px solid #e8eaec',
|
|
|
padding: '10px 0',
|
|
@@ -858,11 +866,11 @@
|
|
|
v-show="!part_detail.is_metal"
|
|
|
>
|
|
|
<div
|
|
|
- v-for="(sub_part_detail, idx) in part_detail.sub_part"
|
|
|
- :key="idx + 'sub_part'"
|
|
|
+ v-for="(sub_part_detail, idx) in part_detail.part_detail"
|
|
|
+ :key="idx + 'part_detail'"
|
|
|
v-show="sub_part_detail.title.indexOf('线条') > 0"
|
|
|
:style="
|
|
|
- idx != part_detail.sub_part.length - 1
|
|
|
+ idx != part_detail.part_detail.length - 1
|
|
|
? {
|
|
|
borderBottom: '1px solid #e8eaec',
|
|
|
padding: '10px 0',
|
|
@@ -912,12 +920,16 @@
|
|
|
/>
|
|
|
<Input
|
|
|
v-else
|
|
|
- v-model="scope.row.price"
|
|
|
+ v-model="scope.row.single_price"
|
|
|
@on-change="(e) => handleMetailPriceChange(e, scope.row)"
|
|
|
/>
|
|
|
</template>
|
|
|
<template #default="scope">
|
|
|
- {{ scope.row.is_metal ? scope.row.price : scope.row.unit_price }}
|
|
|
+ {{
|
|
|
+ scope.row.is_metal
|
|
|
+ ? scope.row.single_price
|
|
|
+ : scope.row.unit_price
|
|
|
+ }}
|
|
|
</template>
|
|
|
</vxe-column>
|
|
|
<vxe-column title="附加项" min-width="150" :edit-render="{}">
|
|
@@ -934,6 +946,7 @@
|
|
|
}
|
|
|
: { padding: '10px 0' }
|
|
|
"
|
|
|
+ v-show="ext_detail.type == 2"
|
|
|
>
|
|
|
<Select
|
|
|
filterable
|
|
@@ -964,44 +977,52 @@
|
|
|
>
|
|
|
<span slot="content">
|
|
|
<div
|
|
|
- v-for="_item in scope.row.extArray"
|
|
|
+ v-for="_item in scope.row.ext"
|
|
|
:key="_item.ext_id + 'ext'"
|
|
|
+ v-show="_item.type == 2"
|
|
|
>
|
|
|
<div style="display:flex;justify-content: space-between;">
|
|
|
- <div style="width:120px">{{ _item.title }}</div>
|
|
|
+ <div style="width:120px">
|
|
|
+ {{
|
|
|
+ extList.filter((v) => v.id == _item.ext_id).length > 0
|
|
|
+ ? extList.filter((v) => v.id == _item.ext_id)[0]
|
|
|
+ .title
|
|
|
+ : ""
|
|
|
+ }}
|
|
|
+ </div>
|
|
|
<div style="width:80px">数量:{{ _item.num }}</div>
|
|
|
<div style="width:100px">单价:{{ _item.price }}</div>
|
|
|
<div style="width:120px">
|
|
|
- 金额:{{ _item.total_price }}
|
|
|
+ 金额:{{ _item.num * 1 * _item.price }}
|
|
|
</div>
|
|
|
<div style="width:160px">备注:{{ _item.remark }}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</span>
|
|
|
{{
|
|
|
- scope.row.ext
|
|
|
- .map((v) => {
|
|
|
- return v.title;
|
|
|
- })
|
|
|
- .join("/")
|
|
|
+ scope.row.ext_list
|
|
|
+ ? scope.row.ext_list
|
|
|
+ .filter((v) => v.type == 2)
|
|
|
+ .map((v) => v.title)
|
|
|
+ .join("/")
|
|
|
+ : scope.row.ext
|
|
|
+ .filter((v) => v.type == 2)
|
|
|
+ .map((v) => v.title)
|
|
|
+ .join("/")
|
|
|
}}
|
|
|
</Tooltip>
|
|
|
</template>
|
|
|
</vxe-column>
|
|
|
<vxe-column title="附加金额" min-width="80">
|
|
|
<template #default="scope"
|
|
|
- >{{
|
|
|
- scope.row.is_metal ? scope.row.total_price : scope.row.ext_price
|
|
|
- }}
|
|
|
+ >{{ scope.row.is_metal ? scope.row.price : scope.row.ext_price }}
|
|
|
</template>
|
|
|
</vxe-column>
|
|
|
<vxe-column field="over_price" title="超标金额" min-width="80">
|
|
|
</vxe-column>
|
|
|
<vxe-column title="总金额" min-width="80">
|
|
|
<template #default="scope"
|
|
|
- >{{
|
|
|
- scope.row.is_metal ? scope.row.total_price : scope.row.price
|
|
|
- }}
|
|
|
+ >{{ scope.row.is_metal ? scope.row.price : scope.row.price }}
|
|
|
</template>
|
|
|
</vxe-column>
|
|
|
<vxe-column
|
|
@@ -1017,6 +1038,8 @@
|
|
|
v-if="!scope.row.is_metal"
|
|
|
transfer
|
|
|
v-model="scope.row.remark"
|
|
|
+ allow-create
|
|
|
+ @on-create="handleRemarkCreate"
|
|
|
@on-change="changeEditRemark(scope.row)"
|
|
|
>
|
|
|
<Option
|
|
@@ -2492,9 +2515,6 @@ export default {
|
|
|
let sendData = JSON.parse(JSON.stringify(this.info));
|
|
|
// sendData.custom_detail_id = sendData.custom_id
|
|
|
let sendList = JSON.parse(JSON.stringify(this.tableData));
|
|
|
- sendList.map((item) => {
|
|
|
- delete item.part;
|
|
|
- });
|
|
|
this.tableData.map((item, index) => {
|
|
|
if (!item.is_metal) {
|
|
|
item.part.map((it, idx) => {
|
|
@@ -2502,17 +2522,16 @@ export default {
|
|
|
if (!sendList[index].part) {
|
|
|
sendList[index].part = [];
|
|
|
}
|
|
|
- sendList[index].part.push(it);
|
|
|
+ sendList[index].part[idx] = it;
|
|
|
}
|
|
|
});
|
|
|
- } else {
|
|
|
- item.type = 1;
|
|
|
- this.sendList[0].part.extArray.push(item);
|
|
|
}
|
|
|
});
|
|
|
// sendList= this.tableData.filter(item)
|
|
|
- sendList.map((element) => {
|
|
|
- if (element.is_metal) {
|
|
|
+ let tempMetalArr = [];
|
|
|
+
|
|
|
+ sendList.map((element, index) => {
|
|
|
+ if (!element.is_metal) {
|
|
|
element.part.map((elem) => {
|
|
|
if (!elem.is_metal) {
|
|
|
// elem.part_detail = elem.sub_part;
|
|
@@ -2524,8 +2543,31 @@ export default {
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
+ if (!element.measurement) {
|
|
|
+ element.measurement = "";
|
|
|
+ }
|
|
|
+ if (!element.measurement_no_letter) {
|
|
|
+ element.measurement_no_letter = "";
|
|
|
+ }
|
|
|
+ let tempStr = "";
|
|
|
+ let tempStr_no_letter = "";
|
|
|
+ element.measure.forEach((elem) => {
|
|
|
+ element[elem.e_title] = elem.value;
|
|
|
+ tempStr += elem.measureCalc + elem.value + "*";
|
|
|
+ tempStr_no_letter += elem.value + "*";
|
|
|
+ });
|
|
|
+ element.measurement = tempStr.substring(0, tempStr.length - 1);
|
|
|
+ element.measurement_no_letter = tempStr_no_letter.substring(
|
|
|
+ 0,
|
|
|
+ tempStr_no_letter.length - 1
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ element.type = 1;
|
|
|
+ tempMetalArr.push(element);
|
|
|
+ sendList.splice(index, 1);
|
|
|
}
|
|
|
});
|
|
|
+ sendList[0].ext.push(...tempMetalArr);
|
|
|
try {
|
|
|
sendData.start_time = new Date(sendData.start_time)
|
|
|
.toLocaleDateString()
|
|
@@ -2560,9 +2602,14 @@ export default {
|
|
|
//表格编辑用数据
|
|
|
element.num_temp_save = element.num;
|
|
|
element.ext.map((v, k) => {
|
|
|
- v.id = v.ext_id;
|
|
|
- v = Object.assign(v, element.ext_list[k]);
|
|
|
- v.total_price = v.num * v.price;
|
|
|
+ if (v.type == 2) {
|
|
|
+ v.id = v.ext_id;
|
|
|
+ v.total_price = v.num * v.price;
|
|
|
+ } else {
|
|
|
+ v.material_id = v.ext_id;
|
|
|
+ v.single_price = v.price;
|
|
|
+ v.price = v.num * v.single_price;
|
|
|
+ }
|
|
|
});
|
|
|
element.extArray = element.ext;
|
|
|
element.type_name = element.title;
|
|
@@ -2654,6 +2701,16 @@ export default {
|
|
|
this.originalData.forEach((element) => {
|
|
|
element.total_price = (element.num * element.price).toFixed(2);
|
|
|
});
|
|
|
+ console.log("this.tableData[0].ext :>> ", this.tableData[0].ext);
|
|
|
+ this.tableData[0].ext.map((v) => {
|
|
|
+ if (v.type === 1) {
|
|
|
+ v.is_metal = true;
|
|
|
+ v.material_id = v.ext_id;
|
|
|
+ console.log("v :>> ", v);
|
|
|
+ this.tableData.push(v);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ console.log("this.tableData :>> ", this.tableData);
|
|
|
this.handleCalcCount();
|
|
|
//获取客户信息
|
|
|
this.axios
|
|
@@ -2837,8 +2894,8 @@ export default {
|
|
|
this.wood_title_count = [];
|
|
|
let total_line_unit = "";
|
|
|
this.tableData.forEach((element) => {
|
|
|
+ sum += element.price * 1;
|
|
|
if (!element.is_metal) {
|
|
|
- sum += element.price * 1;
|
|
|
element.part.forEach((elem) => {
|
|
|
if (!elem.is_metal) {
|
|
|
// 统计部件
|
|
@@ -3280,12 +3337,14 @@ export default {
|
|
|
});
|
|
|
}
|
|
|
// 拆分五金、附加信息
|
|
|
- if (!curData.ext) {
|
|
|
- curData.ext = curData.ext_list;
|
|
|
- }
|
|
|
- curData.ext.forEach((element) => {
|
|
|
- element.type == 2 && modalData.extArray.push(element);
|
|
|
- });
|
|
|
+ // if (!curData.ext) {
|
|
|
+ // curData.ext = curData.ext_list;
|
|
|
+ // }
|
|
|
+ curData.ext &&
|
|
|
+ curData.ext.length > 0 &&
|
|
|
+ curData.ext.forEach((element) => {
|
|
|
+ element.type == 2 && modalData.extArray.push(element);
|
|
|
+ });
|
|
|
modalData.extArray.forEach((element) => {
|
|
|
element.id = element.ext_id;
|
|
|
element.total_price = (element.price * element.num).toFixed(2);
|
|
@@ -3381,6 +3440,7 @@ export default {
|
|
|
route_id_at_copy,
|
|
|
then: (subAddProductData) => {
|
|
|
console.log("subAddProductData :>> ", subAddProductData);
|
|
|
+ this.support_remark = subAddProductData[0].support_remark;
|
|
|
this.modalArray = subAddProductData;
|
|
|
this.modalArray.map((element) => {
|
|
|
// 工艺属性
|
|
@@ -3497,41 +3557,48 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
handleTableAdd() {
|
|
|
- let obj = {
|
|
|
- position: "", //位置
|
|
|
- over_price: "", //超标单价
|
|
|
- unit_price: "", //单价
|
|
|
- ext_price: "", //附加金额
|
|
|
- price: "", //总金额
|
|
|
- remark: "", //备注
|
|
|
- measurement: "", //测量字段拼接
|
|
|
- total_num: "", //数量
|
|
|
- num: "", //核算数量
|
|
|
- num_formula: "", //核算数量公式
|
|
|
- url_number: "", //图号
|
|
|
- url: [], //图纸
|
|
|
- unit: "", //单位
|
|
|
- title: "", //产品名
|
|
|
- process: "", //工艺属性拼接
|
|
|
- procedure_properties: {}, //工艺属性对象
|
|
|
- overdraft: [], //超标公式
|
|
|
- measure: this._measure, //测量字段数组
|
|
|
- support_remark: this.support_remark, //备注列表
|
|
|
- ext: [],
|
|
|
- process_obj: JSON.parse(JSON.stringify(this.process_obj)), //工艺属性含选项对象
|
|
|
- };
|
|
|
- this.process_obj.map(
|
|
|
- (v) => ((obj[v.id] = ""), (obj.procedure_properties[v.id] = ""))
|
|
|
- );
|
|
|
- this.tableData.push(obj);
|
|
|
+ if (this.info.custom_id) {
|
|
|
+ this.currentTabIndex = "0";
|
|
|
+ let obj = {
|
|
|
+ position: "", //位置
|
|
|
+ over_price: "", //超标单价
|
|
|
+ unit_price: "", //单价
|
|
|
+ ext_price: "", //附加金额
|
|
|
+ price: "", //总金额
|
|
|
+ remark: "", //备注
|
|
|
+ measurement: "", //测量字段拼接
|
|
|
+ total_num: "", //数量
|
|
|
+ num: "", //核算数量
|
|
|
+ num_formula: "", //核算数量公式
|
|
|
+ url_number: "", //图号
|
|
|
+ url: [], //图纸
|
|
|
+ unit: "", //单位
|
|
|
+ title: "", //产品名
|
|
|
+ process: "", //工艺属性拼接
|
|
|
+ procedure_properties: {}, //工艺属性对象
|
|
|
+ overdraft: [], //超标公式
|
|
|
+ measure: this._measure, //测量字段数组
|
|
|
+ support_remark: this.support_remark, //备注列表
|
|
|
+ ext: [],
|
|
|
+ extArray: [],
|
|
|
+ process_obj: JSON.parse(JSON.stringify(this.process_obj)), //工艺属性含选项对象
|
|
|
+ };
|
|
|
+ obj.process_obj.map(
|
|
|
+ (v) => ((obj[v.id] = ""), (obj.procedure_properties[v.id] = ""))
|
|
|
+ );
|
|
|
+ this.tableData.push(obj);
|
|
|
+ } else {
|
|
|
+ this.$Message.warning("请先选择客户");
|
|
|
+ }
|
|
|
},
|
|
|
handleMetalAdd() {
|
|
|
this.tableData.push({
|
|
|
+ type: 1,
|
|
|
is_metal: true,
|
|
|
material_id: "",
|
|
|
title: "",
|
|
|
- total_price: 0,
|
|
|
price: 0,
|
|
|
+ single_price: 0,
|
|
|
num: 0,
|
|
|
unit: "",
|
|
|
});
|
|
@@ -3558,12 +3625,10 @@ export default {
|
|
|
this.title_state = 2;
|
|
|
this.isCheck = false;
|
|
|
if (this.type == 1) {
|
|
|
- console.log("1 :>> ", 1);
|
|
|
this.showEditProduct = true;
|
|
|
this.modalData = JSON.parse(JSON.stringify(row));
|
|
|
this.currencyIndex = index;
|
|
|
} else if (this.type == 2) {
|
|
|
- console.log("2 :>> ", 2);
|
|
|
//订单编辑点产品编辑
|
|
|
if (row.get_first_data && !row.isEdit) {
|
|
|
this.axios
|
|
@@ -3579,7 +3644,6 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
} else {
|
|
|
- console.log("3 :>> ", 3);
|
|
|
// 订单新增点产品编辑
|
|
|
if (row.isEdit) {
|
|
|
row.measure.map((v) => {
|
|
@@ -3598,8 +3662,20 @@ export default {
|
|
|
}
|
|
|
break;
|
|
|
case 3:
|
|
|
- this.tableData.splice(index, 1);
|
|
|
- this.handleCalcCount();
|
|
|
+ if (!row.is_metal) {
|
|
|
+ this.$Modal.confirm({
|
|
|
+ title: "确认删除?",
|
|
|
+ content: "请确认!",
|
|
|
+ onOk: () => {
|
|
|
+ this.tableData.splice(index, 1);
|
|
|
+ this.handleCalcCount();
|
|
|
+ },
|
|
|
+ onCancel: () => {},
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.tableData.splice(index, 1);
|
|
|
+ this.handleCalcCount();
|
|
|
+ }
|
|
|
break;
|
|
|
case 4:
|
|
|
obj = JSON.parse(JSON.stringify(row));
|
|
@@ -3783,6 +3859,7 @@ export default {
|
|
|
if (!item.is_metal) {
|
|
|
//赋值默认工艺属性
|
|
|
item.process = JSON.parse(JSON.stringify(this.bpp_list));
|
|
|
+ item.procedure_properties[obj.id] = row[obj.id];
|
|
|
item.process.forEach((elem, index) => {
|
|
|
elem.value = row.process_obj.filter(
|
|
|
(v) => v.id == elem.id
|
|
@@ -3793,6 +3870,11 @@ export default {
|
|
|
},
|
|
|
changeEditMeasure(e, row, measure) {
|
|
|
row.isEdit = true;
|
|
|
+ row.measure.map((v) => {
|
|
|
+ if (v.e_title == measure.e_title) {
|
|
|
+ v.value = e.target.value;
|
|
|
+ }
|
|
|
+ });
|
|
|
this.handleProductMeasureChange(
|
|
|
e,
|
|
|
row,
|
|
@@ -3803,15 +3885,16 @@ export default {
|
|
|
row.isEdit = true;
|
|
|
},
|
|
|
changeEditMetal(row, rowIndex, $event, scope) {
|
|
|
+ row.ext_id = $event.value;
|
|
|
row.title = this.metalList.filter((v) => v.id == $event.value)[0].title;
|
|
|
row.unit = this.metalList.filter((v) => v.id == $event.value)[0].unit;
|
|
|
},
|
|
|
changeEditMetalNum(e, row) {
|
|
|
- row.total_price = 1 * e.target.value * row.price;
|
|
|
+ row.price = 1 * e.target.value * row.single_price;
|
|
|
this.handleCalcCount();
|
|
|
},
|
|
|
handleMetailPriceChange(e, row) {
|
|
|
- row.total_price = 1 * e.target.value * row.num;
|
|
|
+ row.price = 1 * e.target.value * row.num;
|
|
|
this.handleCalcCount();
|
|
|
},
|
|
|
changeEditTotalNum(e, row) {
|
|
@@ -3831,9 +3914,11 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
changeEditPart(row, part_type, part_detail, e) {
|
|
|
- row.isEdit = true;
|
|
|
- part_detail.change_id = e.value;
|
|
|
- this.handlePartChange(e, part_detail, row.measure, row.total_num);
|
|
|
+ if (e) {
|
|
|
+ row.isEdit = true;
|
|
|
+ part_detail.change_id = e.value;
|
|
|
+ this.handlePartChange(e, part_detail, row.measure, row.total_num);
|
|
|
+ }
|
|
|
},
|
|
|
changeEditTableData(row, rowIndex, $event, scope) {
|
|
|
if ($event) {
|
|
@@ -3849,6 +3934,7 @@ export default {
|
|
|
this.process_all_list = res.data.process_list;
|
|
|
this.support_remark = res.data.support_remark;
|
|
|
this.bpp_list.map((v) => (row[v.id] = ""));
|
|
|
+ this.measure_total.map((v) => (row[v.e_title] = ""));
|
|
|
row.url = res.data.url;
|
|
|
row.total_num = res.data.total_num || 1;
|
|
|
row.ext_price = res.data.ext_price || 0;
|
|
@@ -3895,46 +3981,47 @@ export default {
|
|
|
});
|
|
|
if (element.is_null == 1) {
|
|
|
element.change_id = "";
|
|
|
+ element.part_title = "";
|
|
|
+ element.title = "";
|
|
|
} else {
|
|
|
- element.part_detail = element.sub_part;
|
|
|
- //展示非拆分部件
|
|
|
- // 默认替换部件
|
|
|
element.change_id = element.change[0].id;
|
|
|
- //存计算公式
|
|
|
- element.long ? "" : (element.long = 0);
|
|
|
- element.wide ? "" : (element.wide = 0);
|
|
|
- element.high ? "" : (element.high = 0);
|
|
|
- element.longCalc = element.long + "";
|
|
|
- element.wideCalc = element.wide + "";
|
|
|
- element.highCalc = element.high + "";
|
|
|
- element.part_detail.forEach((elem) => {
|
|
|
- elem.material_detail_title =
|
|
|
- elem.material_detail_list[0].title;
|
|
|
- elem.material_detail_id =
|
|
|
- elem.material_detail_list[0].material_detail_id;
|
|
|
- elem.part_detail_option = [];
|
|
|
- elem.material_detail_list.map((v) => {
|
|
|
- elem.part_detail_option.push({
|
|
|
- label: `${v.long}*${v.wide}*${v.high}`,
|
|
|
- value: v.material_detail_id,
|
|
|
- });
|
|
|
- });
|
|
|
- elem.org_num = elem.num;
|
|
|
- elem.material_detail_org_num = elem.num || 0;
|
|
|
- elem.material_detail_num = elem.num || 0;
|
|
|
- elem.long ? "" : (elem.long = 0);
|
|
|
- elem.wide ? "" : (elem.wide = 0);
|
|
|
- elem.high ? "" : (elem.high = 0);
|
|
|
- elem.longCalc = elem.long + "";
|
|
|
- elem.wideCalc = elem.wide + "";
|
|
|
- elem.highCalc = elem.high + "";
|
|
|
- elem.material_detail_list.forEach((el) => {
|
|
|
- el.long = el.long || "0";
|
|
|
- el.wide = el.wide || "0";
|
|
|
- el.high = el.high || "0";
|
|
|
+ }
|
|
|
+ element.part_detail = element.sub_part;
|
|
|
+ //展示非拆分部件
|
|
|
+ // 默认替换部件
|
|
|
+ //存计算公式
|
|
|
+ element.long ? "" : (element.long = 0);
|
|
|
+ element.wide ? "" : (element.wide = 0);
|
|
|
+ element.high ? "" : (element.high = 0);
|
|
|
+ element.longCalc = element.long + "";
|
|
|
+ element.wideCalc = element.wide + "";
|
|
|
+ element.highCalc = element.high + "";
|
|
|
+ element.part_detail.forEach((elem) => {
|
|
|
+ elem.material_detail_title = elem.material_detail_list[0].title;
|
|
|
+ elem.material_detail_id =
|
|
|
+ elem.material_detail_list[0].material_detail_id;
|
|
|
+ elem.part_detail_option = [];
|
|
|
+ elem.material_detail_list.map((v) => {
|
|
|
+ elem.part_detail_option.push({
|
|
|
+ label: `${v.long}*${v.wide}*${v.high}`,
|
|
|
+ value: v.material_detail_id,
|
|
|
});
|
|
|
});
|
|
|
- }
|
|
|
+ elem.org_num = elem.num;
|
|
|
+ elem.material_detail_org_num = elem.num || 0;
|
|
|
+ elem.material_detail_num = elem.num || 0;
|
|
|
+ elem.long ? "" : (elem.long = 0);
|
|
|
+ elem.wide ? "" : (elem.wide = 0);
|
|
|
+ elem.high ? "" : (elem.high = 0);
|
|
|
+ elem.longCalc = elem.long + "";
|
|
|
+ elem.wideCalc = elem.wide + "";
|
|
|
+ elem.highCalc = elem.high + "";
|
|
|
+ elem.material_detail_list.forEach((el) => {
|
|
|
+ el.long = el.long || "0";
|
|
|
+ el.wide = el.wide || "0";
|
|
|
+ el.high = el.high || "0";
|
|
|
+ });
|
|
|
+ });
|
|
|
}
|
|
|
});
|
|
|
row.part = JSON.parse(JSON.stringify(res.data.part));
|
|
@@ -3946,7 +4033,7 @@ export default {
|
|
|
});
|
|
|
this.tableData.splice(rowIndex, 1, row);
|
|
|
row.get_first_data = false;
|
|
|
- this.$forceUpdate();
|
|
|
+ // this.$forceUpdate();
|
|
|
});
|
|
|
}
|
|
|
// row.part=[]
|
|
@@ -4019,6 +4106,7 @@ export default {
|
|
|
// 选择不是线条、或者基础档案中要默认为空的部件
|
|
|
element.isBP = true;
|
|
|
element.isChoosed = true;
|
|
|
+
|
|
|
if (element.is_null == 1) {
|
|
|
element.change_id = "";
|
|
|
} else {
|
|
@@ -4054,6 +4142,17 @@ export default {
|
|
|
el.high = el.high || "0";
|
|
|
});
|
|
|
});
|
|
|
+ element.part_detail.map((_part_detail) => {
|
|
|
+ _part_detail.material_detail_org_num =
|
|
|
+ _part_detail.num || 0;
|
|
|
+ _part_detail.part_detail_option = [];
|
|
|
+ _part_detail.material_detail_list.map((v) => {
|
|
|
+ _part_detail.part_detail_option.push({
|
|
|
+ label: `${v.long}*${v.wide}*${v.high}`,
|
|
|
+ value: v.material_detail_id,
|
|
|
+ });
|
|
|
+ });
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
});
|
|
@@ -4113,16 +4212,14 @@ export default {
|
|
|
if (column.title == "附加金额") {
|
|
|
let sum = 0;
|
|
|
data.map((v) => {
|
|
|
- v.is_metal
|
|
|
- ? (sum += v.total_price * 1)
|
|
|
- : (sum += v.ext_price * 1);
|
|
|
+ v.is_metal ? (sum += v.price * 1) : (sum += v.ext_price * 1);
|
|
|
});
|
|
|
return sum;
|
|
|
}
|
|
|
if (column.title == "总金额") {
|
|
|
let sum = 0;
|
|
|
data.map((v) => {
|
|
|
- v.is_metal ? (sum += v.total_price * 1) : (sum += v.price * 1);
|
|
|
+ v.is_metal ? (sum += v.price * 1) : (sum += v.price * 1);
|
|
|
});
|
|
|
return sum;
|
|
|
}
|
|
@@ -4272,6 +4369,16 @@ export default {
|
|
|
((elem.material_detail_org_num || elem.num) * product_num) | 0;
|
|
|
elem.material_detail_num = elem.material_detail_org_num * product_num;
|
|
|
});
|
|
|
+ row.part_detail.map((_part_detail) => {
|
|
|
+ _part_detail.material_detail_org_num = _part_detail.num || 0;
|
|
|
+ _part_detail.part_detail_option = [];
|
|
|
+ _part_detail.material_detail_list.map((v) => {
|
|
|
+ _part_detail.part_detail_option.push({
|
|
|
+ label: `${v.long}*${v.wide}*${v.high}`,
|
|
|
+ value: v.material_detail_id,
|
|
|
+ });
|
|
|
+ });
|
|
|
+ });
|
|
|
measure.forEach((element) => {
|
|
|
if ((row.long + "").indexOf(element.measureCalc) != -1) {
|
|
|
if (typeof (element.value * 1) == "number") {
|
|
@@ -4523,128 +4630,126 @@ export default {
|
|
|
//当前测量字段 L W H 修改部件测量字段
|
|
|
product.part.forEach((element) => {
|
|
|
if (!element.is_metal) {
|
|
|
- if (!element.is_null == 1) {
|
|
|
- element.highCalc = element.highCalc + "";
|
|
|
- element.longCalc = element.longCalc + "";
|
|
|
- element.wideCalc = element.wideCalc + "";
|
|
|
- //处理公式
|
|
|
- if (element.highCalc.indexOf(cur_measure) != -1) {
|
|
|
- element.high = element.highCalc.replace(
|
|
|
+ element.highCalc = element.highCalc + "";
|
|
|
+ element.longCalc = element.longCalc + "";
|
|
|
+ element.wideCalc = element.wideCalc + "";
|
|
|
+ //处理公式
|
|
|
+ if (element.highCalc.indexOf(cur_measure) != -1) {
|
|
|
+ element.high = element.highCalc.replace(
|
|
|
+ new RegExp(cur_measure, "g"),
|
|
|
+ cur_value || ""
|
|
|
+ );
|
|
|
+ }
|
|
|
+ if (element.longCalc.indexOf(cur_measure) != -1) {
|
|
|
+ element.long = element.longCalc.replace(
|
|
|
+ new RegExp(cur_measure, "g"),
|
|
|
+ cur_value || ""
|
|
|
+ );
|
|
|
+ }
|
|
|
+ if (element.wideCalc.indexOf(cur_measure) != -1) {
|
|
|
+ element.wide = element.wideCalc.replace(
|
|
|
+ new RegExp(cur_measure, "g"),
|
|
|
+ cur_value || ""
|
|
|
+ );
|
|
|
+ }
|
|
|
+ //判断测量字段公式中是否还含有字母
|
|
|
+ let flag_high = false;
|
|
|
+ let flag_long = false;
|
|
|
+ let flag_wide = false;
|
|
|
+ for (let index = 0; index < product.measure.length; index++) {
|
|
|
+ const item = product.measure[index];
|
|
|
+ if (element.high.indexOf(item.measureCalc) != -1) {
|
|
|
+ flag_high = true;
|
|
|
+ }
|
|
|
+ if (element.long.indexOf(item.measureCalc) != -1) {
|
|
|
+ flag_long = true;
|
|
|
+ }
|
|
|
+ if (element.wide.indexOf(item.measureCalc) != -1) {
|
|
|
+ flag_wide = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (flag_high) {
|
|
|
+ } else {
|
|
|
+ element.high = eval(element.high);
|
|
|
+ element.high += "";
|
|
|
+ }
|
|
|
+ if (flag_long) {
|
|
|
+ } else {
|
|
|
+ element.long = eval(element.long);
|
|
|
+ element.long += "";
|
|
|
+ }
|
|
|
+ if (flag_wide) {
|
|
|
+ } else {
|
|
|
+ element.wide = eval(element.wide);
|
|
|
+ element.wide += "";
|
|
|
+ }
|
|
|
+ element.part_detail.forEach((elem) => {
|
|
|
+ elem.highCalc = elem.high + "";
|
|
|
+ elem.longCalc = elem.long + "";
|
|
|
+ elem.wideCalc = elem.wide + "";
|
|
|
+ if (!elem.high) {
|
|
|
+ } else if (elem.highCalc.indexOf(cur_measure) != -1) {
|
|
|
+ elem.high = elem.highCalc.replace(
|
|
|
new RegExp(cur_measure, "g"),
|
|
|
cur_value || ""
|
|
|
);
|
|
|
}
|
|
|
- if (element.longCalc.indexOf(cur_measure) != -1) {
|
|
|
- element.long = element.longCalc.replace(
|
|
|
+ if (!elem.long) {
|
|
|
+ } else if (elem.longCalc.indexOf(cur_measure) != -1) {
|
|
|
+ elem.long = elem.longCalc.replace(
|
|
|
new RegExp(cur_measure, "g"),
|
|
|
cur_value || ""
|
|
|
);
|
|
|
}
|
|
|
- if (element.wideCalc.indexOf(cur_measure) != -1) {
|
|
|
- element.wide = element.wideCalc.replace(
|
|
|
+ if (!elem.wide) {
|
|
|
+ } else if (elem.wideCalc.indexOf(cur_measure) != -1) {
|
|
|
+ elem.wide = elem.wideCalc.replace(
|
|
|
new RegExp(cur_measure, "g"),
|
|
|
cur_value || ""
|
|
|
);
|
|
|
}
|
|
|
//判断测量字段公式中是否还含有字母
|
|
|
- let flag_high = false;
|
|
|
- let flag_long = false;
|
|
|
- let flag_wide = false;
|
|
|
+ let _flag_high = false;
|
|
|
+ let _flag_long = false;
|
|
|
+ let _flag_wide = false;
|
|
|
+ // Number类型无法使用indexOf
|
|
|
+ elem.high += "";
|
|
|
+ elem.long += "";
|
|
|
+ elem.wide += "";
|
|
|
for (let index = 0; index < product.measure.length; index++) {
|
|
|
const item = product.measure[index];
|
|
|
- if (element.high.indexOf(item.measureCalc) != -1) {
|
|
|
- flag_high = true;
|
|
|
+ if (!elem.high) {
|
|
|
+ } else if (elem.high.indexOf(item.measureCalc) != -1) {
|
|
|
+ _flag_high = true;
|
|
|
}
|
|
|
- if (element.long.indexOf(item.measureCalc) != -1) {
|
|
|
- flag_long = true;
|
|
|
+ if (!elem.long) {
|
|
|
+ } else if (elem.long.indexOf(item.measureCalc) != -1) {
|
|
|
+ _flag_long = true;
|
|
|
}
|
|
|
- if (element.wide.indexOf(item.measureCalc) != -1) {
|
|
|
- flag_wide = true;
|
|
|
+ if (!elem.wide) {
|
|
|
+ } else if (elem.wide.indexOf(item.measureCalc) != -1) {
|
|
|
+ _flag_wide = true;
|
|
|
}
|
|
|
}
|
|
|
- if (flag_high) {
|
|
|
+ if (_flag_high) {
|
|
|
} else {
|
|
|
- element.high = eval(element.high);
|
|
|
- element.high += "";
|
|
|
+ elem.high = eval(elem.high);
|
|
|
+ elem.high += "";
|
|
|
+ elem.high == "null" && (elem.high = 0);
|
|
|
}
|
|
|
- if (flag_long) {
|
|
|
+ if (_flag_long) {
|
|
|
} else {
|
|
|
- element.long = eval(element.long);
|
|
|
- element.long += "";
|
|
|
+ elem.long = eval(elem.long);
|
|
|
+ elem.long += "";
|
|
|
+ elem.long == "null" && (elem.long = 0);
|
|
|
}
|
|
|
- if (flag_wide) {
|
|
|
+ if (_flag_wide) {
|
|
|
} else {
|
|
|
- element.wide = eval(element.wide);
|
|
|
- element.wide += "";
|
|
|
- }
|
|
|
- element.part_detail.forEach((elem) => {
|
|
|
- elem.highCalc = elem.high + "";
|
|
|
- elem.longCalc = elem.long + "";
|
|
|
- elem.wideCalc = elem.wide + "";
|
|
|
- if (!elem.high) {
|
|
|
- } else if (elem.highCalc.indexOf(cur_measure) != -1) {
|
|
|
- elem.high = elem.highCalc.replace(
|
|
|
- new RegExp(cur_measure, "g"),
|
|
|
- cur_value || ""
|
|
|
- );
|
|
|
- }
|
|
|
- if (!elem.long) {
|
|
|
- } else if (elem.longCalc.indexOf(cur_measure) != -1) {
|
|
|
- elem.long = elem.longCalc.replace(
|
|
|
- new RegExp(cur_measure, "g"),
|
|
|
- cur_value || ""
|
|
|
- );
|
|
|
- }
|
|
|
- if (!elem.wide) {
|
|
|
- } else if (elem.wideCalc.indexOf(cur_measure) != -1) {
|
|
|
- elem.wide = elem.wideCalc.replace(
|
|
|
- new RegExp(cur_measure, "g"),
|
|
|
- cur_value || ""
|
|
|
- );
|
|
|
- }
|
|
|
- //判断测量字段公式中是否还含有字母
|
|
|
- let _flag_high = false;
|
|
|
- let _flag_long = false;
|
|
|
- let _flag_wide = false;
|
|
|
- // Number类型无法使用indexOf
|
|
|
- elem.high += "";
|
|
|
- elem.long += "";
|
|
|
+ elem.wide = eval(elem.wide);
|
|
|
elem.wide += "";
|
|
|
- for (let index = 0; index < product.measure.length; index++) {
|
|
|
- const item = product.measure[index];
|
|
|
- if (!elem.high) {
|
|
|
- } else if (elem.high.indexOf(item.measureCalc) != -1) {
|
|
|
- _flag_high = true;
|
|
|
- }
|
|
|
- if (!elem.long) {
|
|
|
- } else if (elem.long.indexOf(item.measureCalc) != -1) {
|
|
|
- _flag_long = true;
|
|
|
- }
|
|
|
- if (!elem.wide) {
|
|
|
- } else if (elem.wide.indexOf(item.measureCalc) != -1) {
|
|
|
- _flag_wide = true;
|
|
|
- }
|
|
|
- }
|
|
|
- if (_flag_high) {
|
|
|
- } else {
|
|
|
- elem.high = eval(elem.high);
|
|
|
- elem.high += "";
|
|
|
- elem.high == "null" && (elem.high = 0);
|
|
|
- }
|
|
|
- if (_flag_long) {
|
|
|
- } else {
|
|
|
- elem.long = eval(elem.long);
|
|
|
- elem.long += "";
|
|
|
- elem.long == "null" && (elem.long = 0);
|
|
|
- }
|
|
|
- if (_flag_wide) {
|
|
|
- } else {
|
|
|
- elem.wide = eval(elem.wide);
|
|
|
- elem.wide += "";
|
|
|
- elem.wide == "null" && (elem.wide = 0);
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
+ elem.wide == "null" && (elem.wide = 0);
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
});
|
|
|
product.part.map((item) => {
|