|
@@ -696,7 +696,8 @@
|
|
|
{{ row.is_metal ? "" : row[measure.e_title] }}</template
|
|
{{ row.is_metal ? "" : row[measure.e_title] }}</template
|
|
|
>
|
|
>
|
|
|
</vxe-column>
|
|
</vxe-column>
|
|
|
- <vxe-column
|
|
|
|
|
|
|
+ <!-- 线条门套门扇 -->
|
|
|
|
|
+ <vxe-column
|
|
|
v-for="part_type in part_type_total"
|
|
v-for="part_type in part_type_total"
|
|
|
:key="part_type.id + '999'"
|
|
:key="part_type.id + '999'"
|
|
|
:title="part_type.title"
|
|
:title="part_type.title"
|
|
@@ -710,8 +711,8 @@
|
|
|
:key="part_index"
|
|
:key="part_index"
|
|
|
v-show="part_detail.type_id == part_type.id"
|
|
v-show="part_detail.type_id == part_type.id"
|
|
|
:style="
|
|
:style="
|
|
|
- part_index != scope.row.part.filter(v=>{return v.type_id == part_type.id}).length - 1 &&
|
|
|
|
|
- scope.row.part.filter(v=>{return v.type_id == part_type.id}).length > 1
|
|
|
|
|
|
|
+ scope.row.part.filter(v=>{return v.type_id == part_type.id}).length > 1 &&
|
|
|
|
|
+ part_detail.part_id!=scope.row.part.filter(v=>(v.type_id==part_type.id))[scope.row.part.filter(v=>(v.type_id==part_type.id)).length-1].part_id
|
|
|
? {
|
|
? {
|
|
|
borderBottom: '1px solid #e8eaec',
|
|
borderBottom: '1px solid #e8eaec',
|
|
|
padding: '10px 0',
|
|
padding: '10px 0',
|
|
@@ -722,7 +723,7 @@
|
|
|
<Select
|
|
<Select
|
|
|
clearable
|
|
clearable
|
|
|
transfer
|
|
transfer
|
|
|
- filter
|
|
|
|
|
|
|
+ filterable
|
|
|
filter-by-label
|
|
filter-by-label
|
|
|
label-in-value
|
|
label-in-value
|
|
|
v-model="part_detail.change_id"
|
|
v-model="part_detail.change_id"
|
|
@@ -754,8 +755,8 @@
|
|
|
:key="part_index"
|
|
:key="part_index"
|
|
|
v-show="part_detail.type_id == part_type.id"
|
|
v-show="part_detail.type_id == part_type.id"
|
|
|
:style="
|
|
:style="
|
|
|
- part_index != scope.row.part.filter(v=>{return v.type_id == part_type.id}).length - 1 &&
|
|
|
|
|
- scope.row.part.filter(v=>{return v.type_id == part_type.id}).length > 1
|
|
|
|
|
|
|
+ scope.row.part.filter(v=>{return v.type_id == part_type.id}).length > 1 &&
|
|
|
|
|
+ part_detail.part_id!=scope.row.part.filter(v=>(v.type_id==part_type.id))[scope.row.part.filter(v=>(v.type_id==part_type.id)).length-1].part_id
|
|
|
? {
|
|
? {
|
|
|
borderBottom: '1px solid #e8eaec',
|
|
borderBottom: '1px solid #e8eaec',
|
|
|
padding: '10px 0',
|
|
padding: '10px 0',
|
|
@@ -809,15 +810,16 @@
|
|
|
>
|
|
>
|
|
|
<template #edit="scope">
|
|
<template #edit="scope">
|
|
|
<Input
|
|
<Input
|
|
|
- v-if="!scope.row.is_metal"
|
|
|
|
|
|
|
+
|
|
|
v-model="scope.row.total_num"
|
|
v-model="scope.row.total_num"
|
|
|
@on-change="(e) => changeEditTotalNum(e, scope.row)"
|
|
@on-change="(e) => changeEditTotalNum(e, scope.row)"
|
|
|
/>
|
|
/>
|
|
|
- <Input
|
|
|
|
|
|
|
+ <!-- v-if="!scope.row.is_metal" -->
|
|
|
|
|
+ <!-- <Input
|
|
|
v-else
|
|
v-else
|
|
|
v-model="scope.row.num"
|
|
v-model="scope.row.num"
|
|
|
@on-change="(e) => changeEditMetalNum(e, scope.row)"
|
|
@on-change="(e) => changeEditMetalNum(e, scope.row)"
|
|
|
- />
|
|
|
|
|
|
|
+ /> -->
|
|
|
</template>
|
|
</template>
|
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
|
{{ scope.row.is_metal ? scope.row.num : scope.row.total_num }}
|
|
{{ scope.row.is_metal ? scope.row.num : scope.row.total_num }}
|
|
@@ -1316,7 +1318,6 @@
|
|
|
<div label="线条:" style="margin-left:20px;width:95%">
|
|
<div label="线条:" style="margin-left:20px;width:95%">
|
|
|
<div style="font-size:20px">
|
|
<div style="font-size:20px">
|
|
|
<span>线条:</span>
|
|
<span>线条:</span>
|
|
|
- <!-- <span>{{ print_line_data === "" ? "无" : print_line_data }}</span> -->
|
|
|
|
|
<span v-if="wood_title_count.length < 1">无</span>
|
|
<span v-if="wood_title_count.length < 1">无</span>
|
|
|
<span
|
|
<span
|
|
|
v-else
|
|
v-else
|
|
@@ -1535,7 +1536,7 @@
|
|
|
<Input
|
|
<Input
|
|
|
size="small"
|
|
size="small"
|
|
|
v-model="modalData.num"
|
|
v-model="modalData.num"
|
|
|
- :disabled='!modalData.addMTB'
|
|
|
|
|
|
|
+ :disabled='!modalData.surePrice'
|
|
|
@on-change='handleModalTotalPrice'
|
|
@on-change='handleModalTotalPrice'
|
|
|
style="width: 120px"
|
|
style="width: 120px"
|
|
|
placeholder="自动带出"
|
|
placeholder="自动带出"
|
|
@@ -2575,7 +2576,6 @@ export default {
|
|
|
timeout: null,
|
|
timeout: null,
|
|
|
copiedLinePart: {},
|
|
copiedLinePart: {},
|
|
|
mentoubanList: [],
|
|
mentoubanList: [],
|
|
|
- print_line_data: "",
|
|
|
|
|
MTBList: [],
|
|
MTBList: [],
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
@@ -2683,9 +2683,6 @@ export default {
|
|
|
this.initData(this.order_no);
|
|
this.initData(this.order_no);
|
|
|
}
|
|
}
|
|
|
this.getProducts();
|
|
this.getProducts();
|
|
|
- if (this.$route.query.type != 1) {
|
|
|
|
|
- this.print_line();
|
|
|
|
|
- }
|
|
|
|
|
addEventListener("resize", (e) => {
|
|
addEventListener("resize", (e) => {
|
|
|
this.tableWidth = e.target.innerWidth - 300;
|
|
this.tableWidth = e.target.innerWidth - 300;
|
|
|
this.$forceUpdate();
|
|
this.$forceUpdate();
|
|
@@ -2736,12 +2733,15 @@ export default {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
changeNum(row,index,arr){
|
|
changeNum(row,index,arr){
|
|
|
|
|
+ let sum = 0;
|
|
|
|
|
+ arr.extArray.map((v) => {
|
|
|
|
|
+ return (sum += v.total_price * 1);
|
|
|
|
|
+ });
|
|
|
if(row.MTBnum&&row.MTBsize&&row.MTBprice){
|
|
if(row.MTBnum&&row.MTBsize&&row.MTBprice){
|
|
|
-
|
|
|
|
|
row.MTBtotal = (row.MTBnum*1*row.MTBsize*row.MTBprice).toFixed(2)
|
|
row.MTBtotal = (row.MTBnum*1*row.MTBsize*row.MTBprice).toFixed(2)
|
|
|
arr.part[index].MTBtotal = (row.MTBnum*1*row.MTBsize*row.MTBprice).toFixed(2)
|
|
arr.part[index].MTBtotal = (row.MTBnum*1*row.MTBsize*row.MTBprice).toFixed(2)
|
|
|
- this.MTBtotal = arr.part[index].MTBtotal*1
|
|
|
|
|
- arr.ext_price = this.ext_sum*1 + this.MTBtotal*1;
|
|
|
|
|
|
|
+ this.MTBtotal = arr.part[index].MTBtotal*1;
|
|
|
|
|
+ arr.ext_price = sum*1 + this.MTBtotal*1;
|
|
|
arr.price =
|
|
arr.price =
|
|
|
(arr.unit_price * 1 || 0) * (arr.num * 1 || 1) +
|
|
(arr.unit_price * 1 || 0) * (arr.num * 1 || 1) +
|
|
|
(arr.over_price_total * 1 || 0) +
|
|
(arr.over_price_total * 1 || 0) +
|
|
@@ -2749,7 +2749,15 @@ export default {
|
|
|
arr.price = arr.price.toFixed(2);
|
|
arr.price = arr.price.toFixed(2);
|
|
|
this.$forceUpdate();
|
|
this.$forceUpdate();
|
|
|
}else{
|
|
}else{
|
|
|
- return
|
|
|
|
|
|
|
+ row.MTBtotal = '';
|
|
|
|
|
+ this.MTBtotal = 0;
|
|
|
|
|
+ arr.ext_price = sum*1;
|
|
|
|
|
+ arr.price =
|
|
|
|
|
+ (arr.unit_price * 1 || 0) * (arr.num * 1 || 1) +
|
|
|
|
|
+ (arr.over_price_total * 1 || 0) +
|
|
|
|
|
+ (arr.ext_price * 1 || 0);
|
|
|
|
|
+ arr.price = arr.price.toFixed(2);
|
|
|
|
|
+ this.$forceUpdate();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
},
|
|
},
|
|
@@ -2786,18 +2794,6 @@ export default {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
- print_line() {
|
|
|
|
|
- this.axios({
|
|
|
|
|
- method: "get",
|
|
|
|
|
- url: "/api/printe_order_detail",
|
|
|
|
|
- params: {
|
|
|
|
|
- order_no: this.$route.query.order_no,
|
|
|
|
|
- box_id: "",
|
|
|
|
|
- },
|
|
|
|
|
- }).then((res) => {
|
|
|
|
|
- this.print_line_data = res.msg.foot.amount_detail;
|
|
|
|
|
- });
|
|
|
|
|
- },
|
|
|
|
|
handleFaxPriceChange(e) {
|
|
handleFaxPriceChange(e) {
|
|
|
this.info.fax_price = e.target.value;
|
|
this.info.fax_price = e.target.value;
|
|
|
this.info.order_price = (
|
|
this.info.order_price = (
|
|
@@ -3021,9 +3017,9 @@ export default {
|
|
|
this._measure = JSON.parse(JSON.stringify(element.measure));
|
|
this._measure = JSON.parse(JSON.stringify(element.measure));
|
|
|
element.part.forEach((elem) => {
|
|
element.part.forEach((elem) => {
|
|
|
if (!elem.is_metal) {
|
|
if (!elem.is_metal) {
|
|
|
- if (elem.title.indexOf("门头板") != -1) {
|
|
|
|
|
- elem.addMTB = true;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // if (elem.title.indexOf("门头板") != -1) {
|
|
|
|
|
+ // elem.addMTB = true;
|
|
|
|
|
+ // }
|
|
|
// 表格数据展示字段
|
|
// 表格数据展示字段
|
|
|
elem.isBP = true;
|
|
elem.isBP = true;
|
|
|
elem.process_str = elem.process;
|
|
elem.process_str = elem.process;
|
|
@@ -4181,25 +4177,49 @@ export default {
|
|
|
if (row.is_metal) {
|
|
if (row.is_metal) {
|
|
|
|
|
|
|
|
} else {
|
|
} else {
|
|
|
|
|
+ obj.addMTB = false;
|
|
|
obj.position = "";
|
|
obj.position = "";
|
|
|
obj.measure.map((v) => {
|
|
obj.measure.map((v) => {
|
|
|
v.value = "";
|
|
v.value = "";
|
|
|
obj[v.e_title] = "";
|
|
obj[v.e_title] = "";
|
|
|
});
|
|
});
|
|
|
|
|
+ // console.log(row.process_obj)
|
|
|
|
|
+ // console.log(row);
|
|
|
|
|
+ let arr = row.process_obj.filter(v=>(v.name!=='颜色'))
|
|
|
|
|
+ let process =JSON.parse(JSON.stringify(obj.process)).split('/');
|
|
|
|
|
+ arr.forEach(v=>{
|
|
|
|
|
+ obj[v.id] = '';
|
|
|
|
|
+ obj.procedure_properties[v.id]='';
|
|
|
|
|
+ })
|
|
|
|
|
+ for(let key in obj.procedure_properties){
|
|
|
|
|
+ if(!obj.procedure_properties[key]){
|
|
|
|
|
+ process[Number(key)-1]='';
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ obj.process = process.join('/').toString();
|
|
|
|
|
+ obj.process_str = obj.process;
|
|
|
|
|
+ console.log(obj);
|
|
|
if (!row.is_metal) {
|
|
if (!row.is_metal) {
|
|
|
this.route_id_at_copy = row.route_id;
|
|
this.route_id_at_copy = row.route_id;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
this.pre_process_obj = JSON.parse(
|
|
this.pre_process_obj = JSON.parse(
|
|
|
- JSON.stringify(row.procedure_properties)
|
|
|
|
|
|
|
+ JSON.stringify(obj.procedure_properties)
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
|
//复制一条数据,更换了产品之后,
|
|
//复制一条数据,更换了产品之后,
|
|
|
//线条的内容要保留(不管更换的这个产品的默认线条是什么,都是只展示复制下来的)
|
|
//线条的内容要保留(不管更换的这个产品的默认线条是什么,都是只展示复制下来的)
|
|
|
//摘自Tower #2004
|
|
//摘自Tower #2004
|
|
|
obj.part &&
|
|
obj.part &&
|
|
|
- obj.part.map((v) => {
|
|
|
|
|
- if (v.title.indexOf("线条") != -1) {
|
|
|
|
|
|
|
+ obj.part.map((v,idx) => {
|
|
|
|
|
+ if (v.title.indexOf("线条") != -1||(v.part_title?v.part_title.indexOf("线条") != -1:false)) {
|
|
|
this.copiedLinePart = this.deepClone(v);
|
|
this.copiedLinePart = this.deepClone(v);
|
|
|
|
|
+ }else{
|
|
|
|
|
+ if(v.addMTB){
|
|
|
|
|
+ obj.part.splice(idx,1);
|
|
|
|
|
+ }
|
|
|
|
|
+ v.change_id ='';
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
//因为是复制,插件id为_XID会相同导致bug,置空后会自动生成
|
|
//因为是复制,插件id为_XID会相同导致bug,置空后会自动生成
|
|
@@ -4279,6 +4299,7 @@ export default {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
handleExtChange(row, e, item) {
|
|
handleExtChange(row, e, item) {
|
|
|
|
|
+ //item 就是tableData那一行的数据 row附加项那一行那个的数据 e选择的值;
|
|
|
if(e){
|
|
if(e){
|
|
|
row.ext_id = e.value;
|
|
row.ext_id = e.value;
|
|
|
row.title = e.label;
|
|
row.title = e.label;
|
|
@@ -4457,7 +4478,7 @@ export default {
|
|
|
this.handleCalcCount();
|
|
this.handleCalcCount();
|
|
|
},
|
|
},
|
|
|
changeEditMeasure(e, row, measure) {
|
|
changeEditMeasure(e, row, measure) {
|
|
|
-
|
|
|
|
|
|
|
+ console.log(row);
|
|
|
if (e.target.value) {
|
|
if (e.target.value) {
|
|
|
row.isEdit = true;
|
|
row.isEdit = true;
|
|
|
row.measure.map((v) => {
|
|
row.measure.map((v) => {
|
|
@@ -4465,13 +4486,13 @@ export default {
|
|
|
v.value = e.target.value;
|
|
v.value = e.target.value;
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
- if(this.measure_total.every((v)=>(row[v.e_title]))){
|
|
|
|
|
|
|
+ // if(this.measure_total.every((v)=>(row[v.e_title]))){
|
|
|
this.handleProductMeasureBlur(
|
|
this.handleProductMeasureBlur(
|
|
|
e,
|
|
e,
|
|
|
row,
|
|
row,
|
|
|
row.measure.filter((v) => v.id == measure.id)[0]
|
|
row.measure.filter((v) => v.id == measure.id)[0]
|
|
|
);
|
|
);
|
|
|
- }
|
|
|
|
|
|
|
+ // }
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
@@ -4490,6 +4511,7 @@ export default {
|
|
|
this.handleCalcCount();
|
|
this.handleCalcCount();
|
|
|
},
|
|
},
|
|
|
handleMetailPriceChange(e, row) {
|
|
handleMetailPriceChange(e, row) {
|
|
|
|
|
+ row.isEdit = true;
|
|
|
row.price = 1 * e.target.value * row.num;
|
|
row.price = 1 * e.target.value * row.num;
|
|
|
this.handleCalcCount();
|
|
this.handleCalcCount();
|
|
|
},
|
|
},
|
|
@@ -4503,7 +4525,9 @@ export default {
|
|
|
this.handleCalcCount();
|
|
this.handleCalcCount();
|
|
|
},
|
|
},
|
|
|
changeEditExt(row, e, item,arr,idx) {
|
|
changeEditExt(row, e, item,arr,idx) {
|
|
|
- if (e) {
|
|
|
|
|
|
|
+ //e 是选择的附加项 row是附加项里的每一条数据 item是table那一行的数据 arr是附加项所有的数据 idx是附加项改动的当前行
|
|
|
|
|
+ this.$nextTick(()=>{
|
|
|
|
|
+ if (e) {
|
|
|
item.isEdit = true;
|
|
item.isEdit = true;
|
|
|
row.ext_id = e.value;
|
|
row.ext_id = e.value;
|
|
|
this.handleExtChange(row, e, item);
|
|
this.handleExtChange(row, e, item);
|
|
@@ -4519,6 +4543,8 @@ export default {
|
|
|
item
|
|
item
|
|
|
)
|
|
)
|
|
|
}
|
|
}
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
},
|
|
},
|
|
|
changeEditPart(row, part_type, part_detail, e, rowIndex) {
|
|
changeEditPart(row, part_type, part_detail, e, rowIndex) {
|
|
|
if (e) {
|
|
if (e) {
|
|
@@ -4602,13 +4628,17 @@ export default {
|
|
|
unit: "",
|
|
unit: "",
|
|
|
};
|
|
};
|
|
|
}
|
|
}
|
|
|
- this.tableData.splice(rowIndex, 1, obj);
|
|
|
|
|
|
|
+ this.$nextTick(()=>{
|
|
|
|
|
+ this.tableData.splice(rowIndex, 1, obj);
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
// this.handleTableAdd();
|
|
// this.handleTableAdd();
|
|
|
if (arr[1] === "1") {
|
|
if (arr[1] === "1") {
|
|
|
this.changeEditTableData(obj, rowIndex, $event, scope);
|
|
this.changeEditTableData(obj, rowIndex, $event, scope);
|
|
|
} else {
|
|
} else {
|
|
|
this.changeEditMetal(obj, rowIndex, $event, scope);
|
|
this.changeEditMetal(obj, rowIndex, $event, scope);
|
|
|
}
|
|
}
|
|
|
|
|
+ console.log(row)
|
|
|
this.HandleAutoCreateNewLine();
|
|
this.HandleAutoCreateNewLine();
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
@@ -4656,7 +4686,7 @@ export default {
|
|
|
(row.ext_price * 1 || 0);
|
|
(row.ext_price * 1 || 0);
|
|
|
row.price = row.price.toFixed(2);
|
|
row.price = row.price.toFixed(2);
|
|
|
row.selected_ids = [];
|
|
row.selected_ids = [];
|
|
|
- res.data.part.forEach((element) => {
|
|
|
|
|
|
|
+ res.data.part.forEach((element,eleIndex) => {
|
|
|
// 选择不是附加项目的,
|
|
// 选择不是附加项目的,
|
|
|
if (!element.is_metal) {
|
|
if (!element.is_metal) {
|
|
|
// 选择不是线条、或者基础档案中要默认为空的部件
|
|
// 选择不是线条、或者基础档案中要默认为空的部件
|
|
@@ -4701,12 +4731,20 @@ export default {
|
|
|
}
|
|
}
|
|
|
element.change_id = element.change[0].id;
|
|
element.change_id = element.change[0].id;
|
|
|
}
|
|
}
|
|
|
- if (isCopied && element.title.indexOf("线条") != -1) {
|
|
|
|
|
|
|
+ if(isCopied&&this.tableData[rowIndex-1].part.filter(v=>(v.title.indexOf('线条')!=-1)).length==res.data.part.filter(c=>(c.part_title.indexOf('线条')!=-1)).length&&this.bpp_list.filter(v=>(v.name=='颜色'))[0].cld.filter(e=>(e.id==row.procedure_properties[2])).length!=0){
|
|
|
|
|
+
|
|
|
|
|
+ if (element.title.indexOf("线条") != -1) {
|
|
|
|
|
+ if(res.data.part[eleIndex].change.filter(x=>(x.id==element.change_id)).length!=0){
|
|
|
|
|
+ element = Object.assign(element, this.copiedLinePart);
|
|
|
|
|
+ }
|
|
|
//2020.3.15 有线条的产品线条需要保留
|
|
//2020.3.15 有线条的产品线条需要保留
|
|
|
// delete this.copiedLinePart.change;
|
|
// delete this.copiedLinePart.change;
|
|
|
// delete this.copiedLinePart.change_id;
|
|
// delete this.copiedLinePart.change_id;
|
|
|
- element = Object.assign(element, this.copiedLinePart);
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
element.part_detail = element.sub_part;
|
|
element.part_detail = element.sub_part;
|
|
|
//展示非拆分部件
|
|
//展示非拆分部件
|
|
|
// 默认替换部件
|
|
// 默认替换部件
|
|
@@ -4752,7 +4790,7 @@ export default {
|
|
|
element.value = "";
|
|
element.value = "";
|
|
|
element.measureCalc = element.e_title;
|
|
element.measureCalc = element.e_title;
|
|
|
});
|
|
});
|
|
|
- res.data.title.indexOf('门头板')!=-1&&this.handleMTBClick(row);
|
|
|
|
|
|
|
+ res.data.title.indexOf('门头板')!=-1&&(row.surePrice=true);
|
|
|
this.tableData.splice(rowIndex, 1, row);
|
|
this.tableData.splice(rowIndex, 1, row);
|
|
|
this.handleClearExtInfo(row, this.pre_bp_id, res.data.bp_id);
|
|
this.handleClearExtInfo(row, this.pre_bp_id, res.data.bp_id);
|
|
|
row.get_first_data = false;
|
|
row.get_first_data = false;
|
|
@@ -5093,6 +5131,7 @@ export default {
|
|
|
part.part_title = res.data.part_title;
|
|
part.part_title = res.data.part_title;
|
|
|
// part.process = res.data.process;
|
|
// part.process = res.data.process;
|
|
|
}
|
|
}
|
|
|
|
|
+ console.log(this.modalData.part)
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
@@ -5247,13 +5286,24 @@ export default {
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
product.total_num = e.target.value;
|
|
product.total_num = e.target.value;
|
|
|
- product.num = (product.total_num*1*product.num_temp_save*1).toFixed(2);
|
|
|
|
|
|
|
+ console.log(product)
|
|
|
|
|
+ if(product.num_temp_save&&product.measure.every(v=>(product[v.e_title||v.measureCalc]!=''))){
|
|
|
|
|
+ product.num = (product.total_num*1*product.num_temp_save*1);
|
|
|
|
|
+ if(product.num>=0.01){
|
|
|
|
|
+ product.num = product.num.toFixed(2)
|
|
|
|
|
+ }else{
|
|
|
|
|
+ product.num = product.num.toFixed(4);
|
|
|
|
|
+ }
|
|
|
|
|
+ }else{
|
|
|
|
|
+ return this.$Message.warning('请先确定测量字段!')
|
|
|
|
|
+ }
|
|
|
product.over_price_total = (product.total_num*1*product.over_price).toFixed(2);
|
|
product.over_price_total = (product.total_num*1*product.over_price).toFixed(2);
|
|
|
product.price =
|
|
product.price =
|
|
|
- (product.unit_price * 1 || 0) * (product.num * 1 || 1) +
|
|
|
|
|
|
|
+ (product.unit_price * 1 || 0) * (product.num * 1||1) +
|
|
|
(product.over_price_total * 1 || 0) +
|
|
(product.over_price_total * 1 || 0) +
|
|
|
(product.ext_price * 1 || 0);
|
|
(product.ext_price * 1 || 0);
|
|
|
product.price = product.price.toFixed(2);
|
|
product.price = product.price.toFixed(2);
|
|
|
|
|
+ console.log(product);
|
|
|
this.handleCalcCount();
|
|
this.handleCalcCount();
|
|
|
this.$forceUpdate();
|
|
this.$forceUpdate();
|
|
|
},
|
|
},
|
|
@@ -5349,15 +5399,20 @@ export default {
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- // 查找最接近
|
|
|
|
|
- handleFindNearest(array, value) {
|
|
|
|
|
- const temp = JSON.parse(JSON.stringify(array));
|
|
|
|
|
- temp.sort((a, b) => {
|
|
|
|
|
- return Math.abs(a.long - value) - Math.abs(b.long - value);
|
|
|
|
|
- });
|
|
|
|
|
- return temp[0].material_detail_id;
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ // // 查找最接近
|
|
|
|
|
+ // handleFindNearest(array, value) {
|
|
|
|
|
+ // const temp = JSON.parse(JSON.stringify(array));
|
|
|
|
|
+ // temp.sort((a, b) => {
|
|
|
|
|
+ // return Math.abs(a.long - value) - Math.abs(b.long - value);
|
|
|
|
|
+ // });
|
|
|
|
|
+ // return temp[0].material_detail_id;
|
|
|
|
|
+ // },
|
|
|
handleCalcPartDetailLong(part_detail, product) {
|
|
handleCalcPartDetailLong(part_detail, product) {
|
|
|
|
|
+ console.log(part_detail,123123);
|
|
|
|
|
+ console.log(product,5555555);
|
|
|
|
|
+ if(!part_detail.material_detail_id){
|
|
|
|
|
+ return this.$Message.warning('请先选择部件!')
|
|
|
|
|
+ }
|
|
|
for (const key in product.measure) {
|
|
for (const key in product.measure) {
|
|
|
const element = product.measure[key];
|
|
const element = product.measure[key];
|
|
|
if (element.value) {
|
|
if (element.value) {
|
|
@@ -5384,12 +5439,21 @@ export default {
|
|
|
let line = [];
|
|
let line = [];
|
|
|
let flag = false;
|
|
let flag = false;
|
|
|
product.part.map((part) => {
|
|
product.part.map((part) => {
|
|
|
- part.part_title.indexOf("线条") != -1 && (line = part.change);
|
|
|
|
|
|
|
+ if(part.part_title){
|
|
|
|
|
+ part.part_title.indexOf("线条") != -1 && (line = part.change);
|
|
|
part.part_title.indexOf("门头板") != -1 && (flag = true);
|
|
part.part_title.indexOf("门头板") != -1 && (flag = true);
|
|
|
|
|
+ this.handleCalcLines(product, line, flag);
|
|
|
|
|
+ }else{
|
|
|
|
|
+ part.title.indexOf("线条") != -1 && (line = part.change);
|
|
|
|
|
+ part.title.indexOf("门头板") != -1 && (flag = true);
|
|
|
|
|
+ this.handleCalcLines(product, line, flag);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
});
|
|
});
|
|
|
- this.handleCalcLines(product, line, flag);
|
|
|
|
|
|
|
+ // this.handleCalcLines(product, line, flag); //会有多个部件,要放在循环里面
|
|
|
},
|
|
},
|
|
|
handleCalcLines(product, line, isSpecialPart) {
|
|
handleCalcLines(product, line, isSpecialPart) {
|
|
|
|
|
+ console.log(product,'hw');
|
|
|
const process_ids = product.process_obj.map((v) => {
|
|
const process_ids = product.process_obj.map((v) => {
|
|
|
return v.value;
|
|
return v.value;
|
|
|
});
|
|
});
|
|
@@ -5466,7 +5530,7 @@ export default {
|
|
|
part_arr.part_detail &&
|
|
part_arr.part_detail &&
|
|
|
part_arr.part_detail.map((v) => {
|
|
part_arr.part_detail.map((v) => {
|
|
|
if (v.part_detail_id == k) {
|
|
if (v.part_detail_id == k) {
|
|
|
-
|
|
|
|
|
|
|
+ //part_arr就是part中part_id与接口中的key一样的对象,里面有sub_part或者part_detail; k是第二层的键值
|
|
|
v.material_detail_id = match_item.material_detail_id;
|
|
v.material_detail_id = match_item.material_detail_id;
|
|
|
v.material_detail_org_num = match_item.num*product.total_num*1;
|
|
v.material_detail_org_num = match_item.num*product.total_num*1;
|
|
|
v.material_detail_num = match_item.num*product.total_num*1;
|
|
v.material_detail_num = match_item.num*product.total_num*1;
|
|
@@ -5484,6 +5548,7 @@ export default {
|
|
|
handleProductMeasureBlur(e, product, measure_detail) {
|
|
handleProductMeasureBlur(e, product, measure_detail) {
|
|
|
console.log(product);
|
|
console.log(product);
|
|
|
this.handleProductMeasureChange(e, product, measure_detail);
|
|
this.handleProductMeasureChange(e, product, measure_detail);
|
|
|
|
|
+ console.log(product,11111);
|
|
|
if (e.target.value) {
|
|
if (e.target.value) {
|
|
|
try {
|
|
try {
|
|
|
measure_detail.value = eval(e.target.value);
|
|
measure_detail.value = eval(e.target.value);
|
|
@@ -5495,9 +5560,11 @@ export default {
|
|
|
if(!part.addMTB){
|
|
if(!part.addMTB){
|
|
|
part.part_title.indexOf("线条") != -1 && (line = part.change);
|
|
part.part_title.indexOf("线条") != -1 && (line = part.change);
|
|
|
}
|
|
}
|
|
|
|
|
+ if(!part.addMTB){
|
|
|
part.part_detail &&
|
|
part.part_detail &&
|
|
|
part.part_detail.length > 0 &&
|
|
part.part_detail.length > 0 &&
|
|
|
part.part_detail.map((part_detail) => {
|
|
part.part_detail.map((part_detail) => {
|
|
|
|
|
+
|
|
|
part_detail._longCalc = this.handleCalcPartDetailLong(
|
|
part_detail._longCalc = this.handleCalcPartDetailLong(
|
|
|
part_detail,
|
|
part_detail,
|
|
|
product
|
|
product
|
|
@@ -5514,17 +5581,26 @@ export default {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
+ }
|
|
|
});
|
|
});
|
|
|
|
|
+
|
|
|
product.process_obj.map((v) => {
|
|
product.process_obj.map((v) => {
|
|
|
v.value ? "" : (v.value = product[v.id]);
|
|
v.value ? "" : (v.value = product[v.id]);
|
|
|
});
|
|
});
|
|
|
let line = [];
|
|
let line = [];
|
|
|
let flag = false;
|
|
let flag = false;
|
|
|
product.part.map((part) => {
|
|
product.part.map((part) => {
|
|
|
- part.part_title&&part.part_title.indexOf("线条") != -1 && (line = part.change);
|
|
|
|
|
- part.part_title&&part.part_title.indexOf("门头板") != -1 && (flag = true);
|
|
|
|
|
|
|
+ if(part.part_title){//新增订单
|
|
|
|
|
+ part.part_title&&part.part_title.indexOf("线条") != -1 && (line = part.change);
|
|
|
|
|
+ part.part_title&&part.part_title.indexOf("门头板") != -1 && (flag = true);
|
|
|
|
|
+ this.handleCalcLines(product, line, flag);
|
|
|
|
|
+ }else{
|
|
|
|
|
+ part.title&&part.title.indexOf("线条") != -1 && (line = part.change);
|
|
|
|
|
+ part.title&&part.title.indexOf("门头板") != -1 && (flag = true);
|
|
|
|
|
+ this.handleCalcLines(product, line, flag);
|
|
|
|
|
+ }
|
|
|
});
|
|
});
|
|
|
- this.handleCalcLines(product, line, flag);
|
|
|
|
|
|
|
+ // this.handleCalcLines(product, line, flag);
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
handleProductMeasureChange(e, product, measure_detail) {//对应高宽厚的值,整行数据,T字段的数据
|
|
handleProductMeasureChange(e, product, measure_detail) {//对应高宽厚的值,整行数据,T字段的数据
|
|
@@ -5534,7 +5610,7 @@ export default {
|
|
|
product[cur_measure] = cur_value;
|
|
product[cur_measure] = cur_value;
|
|
|
//当前测量字段 L W H 修改部件测量字段
|
|
//当前测量字段 L W H 修改部件测量字段
|
|
|
product.part.forEach((element) => {
|
|
product.part.forEach((element) => {
|
|
|
- if (!element.is_metal) {
|
|
|
|
|
|
|
+ if (!element.is_metal&&!element.addMTB) {
|
|
|
element.highCalc = element.highCalc + "";
|
|
element.highCalc = element.highCalc + "";
|
|
|
element.longCalc = element.longCalc + "";
|
|
element.longCalc = element.longCalc + "";
|
|
|
element.wideCalc = element.wideCalc + "";
|
|
element.wideCalc = element.wideCalc + "";
|
|
@@ -5709,7 +5785,7 @@ export default {
|
|
|
//修改核算数量
|
|
//修改核算数量
|
|
|
// 如果没有核算数量公式,核算数量取产品数量
|
|
// 如果没有核算数量公式,核算数量取产品数量
|
|
|
if (product.num_formula == "") {
|
|
if (product.num_formula == "") {
|
|
|
- product.total_num = product.num;
|
|
|
|
|
|
|
+ product.num = product.total_num;
|
|
|
} else {
|
|
} else {
|
|
|
product.num_formula_temp = product.num_formula;
|
|
product.num_formula_temp = product.num_formula;
|
|
|
product.measure.forEach((element) => {
|
|
product.measure.forEach((element) => {
|
|
@@ -5721,16 +5797,26 @@ export default {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
product.num = eval(product.num_formula_temp);
|
|
product.num = eval(product.num_formula_temp);
|
|
|
- if(product.num<0.3&&product.addMTB){
|
|
|
|
|
- product.num = 0.3
|
|
|
|
|
- }
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
// product.over_price = Number(product.over_price*product.total_num*1).toFixed(2);
|
|
// product.over_price = Number(product.over_price*product.total_num*1).toFixed(2);
|
|
|
// product.save_over_price = JSON.parse(JSON.stringify(product.over_price*1/product.total_num*1));
|
|
// product.save_over_price = JSON.parse(JSON.stringify(product.over_price*1/product.total_num*1));
|
|
|
- product.num_temp_save = product.num*1 || 1;
|
|
|
|
|
- product.num = (Number(product.num)*(product.total_num*1)).toFixed(2);
|
|
|
|
|
|
|
+ if(product.num<0.3&&product.surePrice){
|
|
|
|
|
+ product.num_temp_save = 0.3;
|
|
|
|
|
+ }else{
|
|
|
|
|
+ product.num_temp_save = product.num*1 || 1;
|
|
|
|
|
+ }
|
|
|
|
|
+ product.num = (Number(product.num)*(product.total_num*1));
|
|
|
|
|
+ if(product.num>=0.01){
|
|
|
|
|
+ product.num = product.num.toFixed(2);
|
|
|
|
|
+ }else{
|
|
|
|
|
+ product.num = product.num.toFixed(4);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if(product.num<0.3&&product.surePrice){
|
|
|
|
|
+ product.num = 0.3
|
|
|
|
|
+ }
|
|
|
product.over_price_total = (product.total_num*1*product.over_price).toFixed(2);
|
|
product.over_price_total = (product.total_num*1*product.over_price).toFixed(2);
|
|
|
product.price =
|
|
product.price =
|
|
|
(product.unit_price * 1 || 0) * (product.num * 1 || 1) +
|
|
(product.unit_price * 1 || 0) * (product.num * 1 || 1) +
|
|
@@ -5970,11 +6056,11 @@ export default {
|
|
|
top: 0px;
|
|
top: 0px;
|
|
|
color: red;
|
|
color: red;
|
|
|
}
|
|
}
|
|
|
-/deep/.ivu-tooltip-rel {
|
|
|
|
|
- overflow: hidden;
|
|
|
|
|
- text-overflow: ellipsis;
|
|
|
|
|
- white-space: nowrap;
|
|
|
|
|
-}
|
|
|
|
|
|
|
+// /deep/.ivu-tooltip-rel {
|
|
|
|
|
+// overflow: hidden;
|
|
|
|
|
+// text-overflow: ellipsis;
|
|
|
|
|
+// white-space: nowrap;
|
|
|
|
|
+// }
|
|
|
.page-edit {
|
|
.page-edit {
|
|
|
overflow: hidden;
|
|
overflow: hidden;
|
|
|
overflow-y: auto;
|
|
overflow-y: auto;
|