|
@@ -545,6 +545,7 @@
|
|
|
filterable
|
|
|
clearable
|
|
|
transfer
|
|
|
+ filter-by-label
|
|
|
label-in-value
|
|
|
v-if="!scope.row.is_metal"
|
|
|
v-model="scope.row.product_id"
|
|
@@ -557,9 +558,9 @@
|
|
|
v-for="item in productList"
|
|
|
:tag="item.img_url"
|
|
|
:value="item.id"
|
|
|
+ :label="item.title"
|
|
|
:key="item.id"
|
|
|
- >{{ item.title }}</Option
|
|
|
- >
|
|
|
+ ></Option>
|
|
|
</Select>
|
|
|
<Select
|
|
|
filterable
|
|
@@ -578,8 +579,8 @@
|
|
|
v-for="item in metalList"
|
|
|
:value="item.id"
|
|
|
:key="item.id"
|
|
|
- >{{ item.title }}</Option
|
|
|
- >
|
|
|
+ :label="item.title"
|
|
|
+ ></Option>
|
|
|
</Select>
|
|
|
</template>
|
|
|
<template #default="{ row }">{{
|
|
@@ -623,8 +624,8 @@
|
|
|
)[0].cld"
|
|
|
:value="item.id"
|
|
|
:key="item.id + 'cld'"
|
|
|
- >{{ item.title }}</Option
|
|
|
- >
|
|
|
+ :label="item.title"
|
|
|
+ ></Option>
|
|
|
</Select>
|
|
|
</template>
|
|
|
<template #default="{ row }">
|
|
@@ -686,7 +687,7 @@
|
|
|
clearable
|
|
|
transfer
|
|
|
label-in-value
|
|
|
- :value="part_detail.change_id"
|
|
|
+ v-model="part_detail.change_id"
|
|
|
@on-change="
|
|
|
(e) =>
|
|
|
changeEditPart(scope.row, part_type, part_detail, e)
|
|
@@ -818,7 +819,7 @@
|
|
|
clearable
|
|
|
transfer
|
|
|
label-in-value
|
|
|
- @on-change="changeEditLines(row)"
|
|
|
+ @on-change="changeEditLines(scope.row)"
|
|
|
v-model="sub_part_detail.material_detail_id"
|
|
|
>
|
|
|
<Option
|
|
@@ -978,8 +979,8 @@
|
|
|
>
|
|
|
<span slot="content">
|
|
|
<div
|
|
|
- v-for="_item in scope.row.ext"
|
|
|
- :key="_item.ext_id + 'ext'"
|
|
|
+ v-for="(_item, _index) in scope.row.extArray"
|
|
|
+ :key="_item.ext_id + 'ext' + _index"
|
|
|
v-show="_item.type == 2"
|
|
|
>
|
|
|
<div style="display:flex;justify-content: space-between;">
|
|
@@ -1001,15 +1002,12 @@
|
|
|
</div>
|
|
|
</span>
|
|
|
{{
|
|
|
- scope.row.ext_list
|
|
|
- ? scope.row.ext_list
|
|
|
- .filter((v) => v.type == 2)
|
|
|
- .map((v) => v.title)
|
|
|
- .join("/")
|
|
|
- : scope.row.ext
|
|
|
+ scope.row.extArray
|
|
|
+ ? scope.row.extArray
|
|
|
.filter((v) => v.type == 2)
|
|
|
.map((v) => v.title)
|
|
|
.join("/")
|
|
|
+ : ""
|
|
|
}}
|
|
|
</Tooltip>
|
|
|
</template>
|
|
@@ -1326,7 +1324,7 @@
|
|
|
<Tooltip style="width: 120px" transfer>
|
|
|
<span slot="content">
|
|
|
<span
|
|
|
- v-for="_item in ele.processList"
|
|
|
+ v-for="_item in ele.cld"
|
|
|
:key="_item.id + '999'"
|
|
|
v-show="_item.id == ele.value"
|
|
|
>{{ _item.title }}</span
|
|
@@ -1923,6 +1921,7 @@
|
|
|
:model="element"
|
|
|
v-for="(element, idx) in modalData.extArray"
|
|
|
:key="element.id"
|
|
|
+ v-show="element.type == 2"
|
|
|
:label-width="80"
|
|
|
>
|
|
|
<FormItem label="附加项目:">
|
|
@@ -2486,10 +2485,10 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
back() {
|
|
|
- // this.$router.go(-1);
|
|
|
- this.$router.push({
|
|
|
- path: "/cms/ordermannage/businessorderlist/list",
|
|
|
- });
|
|
|
+ this.$router.go(-1);
|
|
|
+ // this.$router.push({
|
|
|
+ // path: "/cms/ordermannage/businessorderlist/list",
|
|
|
+ // });
|
|
|
},
|
|
|
postForms(n) {
|
|
|
this.post_formSetTableData.forEach((element, index) => {
|
|
@@ -2515,60 +2514,58 @@ export default {
|
|
|
postData() {
|
|
|
let sendData = JSON.parse(JSON.stringify(this.info));
|
|
|
// sendData.custom_detail_id = sendData.custom_id
|
|
|
- let sendList = JSON.parse(JSON.stringify(this.tableData));
|
|
|
- this.tableData.map((item, index) => {
|
|
|
- if (!item.is_metal) {
|
|
|
- item.part.map((it, idx) => {
|
|
|
- if (!it.is_metal) {
|
|
|
- if (!sendList[index].part) {
|
|
|
- sendList[index].part = [];
|
|
|
- }
|
|
|
- sendList[index].part[idx] = it;
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
+ // let sendList = JSON.parse(JSON.stringify(this.tableData));
|
|
|
+ let sendList = this.tableData.filter((v) => !v.is_metal);
|
|
|
+ let _save_metal = this.tableData.filter((v) => v.is_metal);
|
|
|
+ _save_metal.map((v) => {
|
|
|
+ v.type = 1;
|
|
|
});
|
|
|
+ // this.tableData.map((item, index) => {
|
|
|
+ // if (!item.is_metal) {
|
|
|
+ // item.part.map((it, idx) => {
|
|
|
+ // if (!it.is_metal) {
|
|
|
+ // if (!sendList[index].part) {
|
|
|
+ // sendList[index].part = [];
|
|
|
+ // }
|
|
|
+ // sendList[index].part[idx] = it;
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ // });
|
|
|
// sendList= this.tableData.filter(item)
|
|
|
- let tempMetalArr = [];
|
|
|
-
|
|
|
sendList.map((element, index) => {
|
|
|
- if (!element.is_metal) {
|
|
|
- element.part.map((elem) => {
|
|
|
- if (!elem.is_metal) {
|
|
|
- // elem.part_detail = elem.sub_part;
|
|
|
- if (!elem.part_detail) {
|
|
|
- elem.part_detail = elem.sub_part;
|
|
|
- }
|
|
|
- elem.part_detail.map((el) => {
|
|
|
- el.material_num = el.material_detail_num;
|
|
|
- });
|
|
|
+ element.part.map((elem) => {
|
|
|
+ if (!elem.is_metal) {
|
|
|
+ // elem.part_detail = elem.sub_part;
|
|
|
+ if (!elem.part_detail) {
|
|
|
+ elem.part_detail = elem.sub_part;
|
|
|
}
|
|
|
- });
|
|
|
- if (!element.measurement) {
|
|
|
- element.measurement = "";
|
|
|
- }
|
|
|
- if (!element.measurement_no_letter) {
|
|
|
- element.measurement_no_letter = "";
|
|
|
+ elem.part_detail.map((el) => {
|
|
|
+ el.material_num = el.material_detail_num;
|
|
|
+ });
|
|
|
}
|
|
|
- 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);
|
|
|
+ });
|
|
|
+ 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
|
|
|
+ );
|
|
|
});
|
|
|
- sendList[0].ext.push(...tempMetalArr);
|
|
|
+ sendList[0].ext = sendList[0].ext.filter((v) => v.type == 2);
|
|
|
+ sendList[0].ext.push(..._save_metal);
|
|
|
try {
|
|
|
sendData.start_time = new Date(sendData.start_time)
|
|
|
.toLocaleDateString()
|
|
@@ -2601,7 +2598,7 @@ export default {
|
|
|
this.support_remark = res.data.product_list[0].support_remark;
|
|
|
this.tableData.forEach((element) => {
|
|
|
//表格编辑用数据
|
|
|
- element.num_temp_save = element.num;
|
|
|
+ element.num_temp_save = element.num || 1;
|
|
|
element.ext.map((v, k) => {
|
|
|
if (v.type == 2) {
|
|
|
v.id = v.ext_id;
|
|
@@ -2641,6 +2638,7 @@ export default {
|
|
|
element.part.forEach((elem) => {
|
|
|
if (!elem.is_metal) {
|
|
|
// 表格数据展示字段
|
|
|
+ element.isBP = true;
|
|
|
elem.process_str = elem.process;
|
|
|
elem.process = JSON.parse(JSON.stringify(this.process_obj));
|
|
|
elem.process.map((v) => {
|
|
@@ -2655,16 +2653,18 @@ export default {
|
|
|
elem.wide = measure_arr[1];
|
|
|
elem.high = measure_arr[2];
|
|
|
elem.part_detail = elem.sub_part;
|
|
|
- elem.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,
|
|
|
+ elem.part_detail &&
|
|
|
+ elem.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,
|
|
|
+ });
|
|
|
});
|
|
|
});
|
|
|
- });
|
|
|
}
|
|
|
});
|
|
|
// 拆分测量字段
|
|
@@ -2680,7 +2680,7 @@ export default {
|
|
|
elem.unit_price = elem.price;
|
|
|
elem.ext_price = elem.num * elem.price;
|
|
|
elem.is_metal = true;
|
|
|
- element.part.push(elem);
|
|
|
+ // element.part.push(elem);
|
|
|
} else {
|
|
|
if (!element.extra) {
|
|
|
element.extra = "";
|
|
@@ -2702,16 +2702,13 @@ 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
|
|
@@ -2909,6 +2906,7 @@ export default {
|
|
|
});
|
|
|
} else {
|
|
|
this.parts_title_count.push({
|
|
|
+ change_id: elem.change_id,
|
|
|
title: elem.title,
|
|
|
num: elem.num || 1,
|
|
|
unit: elem.unit,
|
|
@@ -3272,8 +3270,8 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
getEditData(modalData, curData) {
|
|
|
- console.log("modalData :>> ", modalData);
|
|
|
- console.log("curData :>> ", curData);
|
|
|
+ // console.log("modalData :>> ", modalData);
|
|
|
+ // console.log("curData :>> ", curData);
|
|
|
modalData.ext_price = curData.ext_price * 1 || 0;
|
|
|
modalData.model = curData.model;
|
|
|
modalData.num = curData.num || 1;
|
|
@@ -3440,7 +3438,7 @@ export default {
|
|
|
custom_id,
|
|
|
route_id_at_copy,
|
|
|
then: (subAddProductData) => {
|
|
|
- console.log("subAddProductData :>> ", subAddProductData);
|
|
|
+ // console.log("subAddProductData :>> ", subAddProductData);
|
|
|
this.support_remark = subAddProductData[0].support_remark;
|
|
|
this.modalArray = subAddProductData;
|
|
|
this.modalArray.map((element) => {
|
|
@@ -3561,6 +3559,7 @@ export default {
|
|
|
if (this.info.custom_id) {
|
|
|
this.currentTabIndex = "0";
|
|
|
let obj = {
|
|
|
+ type_name: "", //展示用产品名称
|
|
|
position: "", //位置
|
|
|
over_price: "", //超标单价
|
|
|
unit_price: "", //单价
|
|
@@ -3605,7 +3604,7 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
handleSet(row, index, type) {
|
|
|
- console.log("row :>> ", row);
|
|
|
+ // console.log("row :>> ", row);
|
|
|
let obj;
|
|
|
// 1 新增 2 编辑 3 删除 4复制 5详情
|
|
|
switch (type) {
|
|
@@ -3631,90 +3630,104 @@ export default {
|
|
|
this.currencyIndex = index;
|
|
|
} else if (this.type == 2) {
|
|
|
//订单编辑点产品编辑
|
|
|
- if (row.get_first_data && !row.isEdit) {
|
|
|
- this.axios
|
|
|
- .get("/api/order_product_detail_new", {
|
|
|
- params: { order_product_id: row.order_product_id },
|
|
|
- })
|
|
|
- .then((res) => {
|
|
|
- if (res.code == 200) {
|
|
|
- this.currencyIndex = index;
|
|
|
- this.modalData = JSON.parse(JSON.stringify(row));
|
|
|
- this.editForm = res.data;
|
|
|
- this.changeProductOnEdit(res.data, 0);
|
|
|
- }
|
|
|
- });
|
|
|
- } else {
|
|
|
- // 订单新增点产品编辑
|
|
|
- if (row.isEdit) {
|
|
|
- row.measure.map((v) => {
|
|
|
- v.value = row[v.e_title];
|
|
|
- });
|
|
|
- row.process_obj.map((v) => {
|
|
|
- v.title = v.name;
|
|
|
- v.value = row[v.id];
|
|
|
- });
|
|
|
- }
|
|
|
- this.modalData = JSON.parse(JSON.stringify(row));
|
|
|
- console.log("this.modalData :>> ", this.modalData);
|
|
|
- this.currencyIndex = index;
|
|
|
- this.showEditProduct = true;
|
|
|
- }
|
|
|
+ // if (row.get_first_data && !row.isEdit) {
|
|
|
+ // this.axios
|
|
|
+ // .get("/api/order_product_detail_new", {
|
|
|
+ // params: { order_product_id: row.order_product_id },
|
|
|
+ // })
|
|
|
+ // .then((res) => {
|
|
|
+ // if (res.code == 200) {
|
|
|
+ // this.currencyIndex = index;
|
|
|
+ // this.modalData = JSON.parse(JSON.stringify(row));
|
|
|
+ // this.editForm = res.data;
|
|
|
+ // this.changeProductOnEdit(res.data, 0);
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // } else {
|
|
|
+ // 订单新增点产品编辑
|
|
|
+ row.measure.map((v) => {
|
|
|
+ v.value = row[v.e_title];
|
|
|
+ });
|
|
|
+ row.process_obj.map((v) => {
|
|
|
+ v.title = v.name;
|
|
|
+ v.value = row[v.id];
|
|
|
+ });
|
|
|
+ this.modalData = JSON.parse(JSON.stringify(row));
|
|
|
+ this.currencyIndex = index;
|
|
|
+ this.showEditProduct = true;
|
|
|
+ // }
|
|
|
}
|
|
|
break;
|
|
|
case 3:
|
|
|
- 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();
|
|
|
- }
|
|
|
+ this.$Modal.confirm({
|
|
|
+ title: "确认删除?",
|
|
|
+ content: "请确认!",
|
|
|
+ onOk: () => {
|
|
|
+ this.tableData.splice(index, 1);
|
|
|
+ this.handleCalcCount();
|
|
|
+ },
|
|
|
+ onCancel: () => {},
|
|
|
+ });
|
|
|
break;
|
|
|
case 4:
|
|
|
- obj = JSON.parse(JSON.stringify(row));
|
|
|
- this.route_id_at_copy = row.route_id;
|
|
|
- obj.index = obj.index + 1;
|
|
|
- this.handleSetCopyId(obj, "_XID");
|
|
|
+ console.log("row :>> ", row);
|
|
|
+ obj = this.deepClone(row);
|
|
|
+ console.log("obj :>> ", obj);
|
|
|
+ if (!row.is_metal) {
|
|
|
+ this.route_id_at_copy = row.route_id;
|
|
|
+ }
|
|
|
this.tableData.splice(index, 0, obj);
|
|
|
this.handleCalcCount();
|
|
|
break;
|
|
|
case 5:
|
|
|
this.title_state = 3;
|
|
|
this.isCheck = true;
|
|
|
- if (row.get_first_data) {
|
|
|
- this.axios
|
|
|
- .get("/api/order_product_detail_new", {
|
|
|
- params: { order_product_id: row.order_product_id },
|
|
|
- })
|
|
|
- .then((res) => {
|
|
|
- if (res.code == 200) {
|
|
|
- this.currencyIndex = index;
|
|
|
- this.modalData = JSON.parse(JSON.stringify(row));
|
|
|
- this.editForm = res.data;
|
|
|
- this.changeProductOnEdit(res.data, 0);
|
|
|
- }
|
|
|
- });
|
|
|
- } else {
|
|
|
- this.modalData = JSON.parse(JSON.stringify(row));
|
|
|
- this.currencyIndex = index;
|
|
|
- this.showEditProduct = true;
|
|
|
- }
|
|
|
+ // if (row.get_first_data) {
|
|
|
+ // this.axios
|
|
|
+ // .get("/api/order_product_detail_new", {
|
|
|
+ // params: { order_product_id: row.order_product_id },
|
|
|
+ // })
|
|
|
+ // .then((res) => {
|
|
|
+ // if (res.code == 200) {
|
|
|
+ // this.currencyIndex = index;
|
|
|
+ // this.modalData = JSON.parse(JSON.stringify(row));
|
|
|
+ // this.editForm = res.data;
|
|
|
+ // this.changeProductOnEdit(res.data, 0);
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // } else {
|
|
|
+ row.measure.map((v) => {
|
|
|
+ v.value = row[v.e_title];
|
|
|
+ });
|
|
|
+ row.process_obj.map((v) => {
|
|
|
+ v.title = v.name;
|
|
|
+ v.value = row[v.id];
|
|
|
+ });
|
|
|
+ this.modalData = JSON.parse(JSON.stringify(row));
|
|
|
+ this.currencyIndex = index;
|
|
|
+ this.showEditProduct = true;
|
|
|
+ // }
|
|
|
break;
|
|
|
}
|
|
|
},
|
|
|
- handleSetCopyId(obj, key) {
|
|
|
- // 浅拷贝,不需要返回
|
|
|
- const temp = obj[key].split("_");
|
|
|
- temp[1]++;
|
|
|
- obj[key] = temp.join("_");
|
|
|
+ deepClone(obj) {
|
|
|
+ //定义对象来判断当前的参数是数组还是对象
|
|
|
+ let objClone = Array.isArray(obj) ? [] : {};
|
|
|
+ //如果obj存在并且为对象
|
|
|
+ if (obj && typeof obj == "object") {
|
|
|
+ for (let key in obj) {
|
|
|
+ if (Object.hasOwnProperty.call(obj, key)) {
|
|
|
+ //如果obj的子元素为对象,那么递归(层级遍历)
|
|
|
+ if (obj[key] && typeof obj[key] == "object") {
|
|
|
+ objClone[key] = this.deepClone(obj[key]);
|
|
|
+ } else {
|
|
|
+ //如果不是,直接赋值
|
|
|
+ objClone[key] = obj[key];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return objClone;
|
|
|
},
|
|
|
async handleBeforeUpload(row) {
|
|
|
// row.name
|
|
@@ -3862,9 +3875,14 @@ export default {
|
|
|
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
|
|
|
- )[0].value;
|
|
|
+ row.process_obj.map((v) => {
|
|
|
+ if (elem.id == v.id) {
|
|
|
+ elem.value = v.value;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ // elem.value = row.process_obj.filter(
|
|
|
+ // (v) => v.id == elem.id
|
|
|
+ // )[0].value;
|
|
|
});
|
|
|
}
|
|
|
});
|
|
@@ -3909,6 +3927,7 @@ export default {
|
|
|
},
|
|
|
changeEditDetailNum(row) {
|
|
|
row.isEdit = true;
|
|
|
+ this.handleCalcCount();
|
|
|
},
|
|
|
changeEditExt(row, e, item) {
|
|
|
if (e) {
|
|
@@ -3923,7 +3942,14 @@ export default {
|
|
|
if (e) {
|
|
|
row.isEdit = true;
|
|
|
part_detail.change_id = e.value;
|
|
|
+ part_detail.sub_part = part_detail.change.filter(
|
|
|
+ (v) => v.id == e.value
|
|
|
+ )[0].sub_part;
|
|
|
+ part_detail.title = part_detail.change.filter(
|
|
|
+ (v) => v.id == e.value
|
|
|
+ )[0].part_title;
|
|
|
this.handlePartChange(e, part_detail, row.measure, row.total_num);
|
|
|
+ this.handleCalcCount();
|
|
|
}
|
|
|
},
|
|
|
changeEditTableData(row, rowIndex, $event, scope) {
|
|
@@ -3953,6 +3979,9 @@ export default {
|
|
|
row.url_number = res.data.url_number || "";
|
|
|
row.overdraft = res.data.overdraft;
|
|
|
row.num_formula = res.data.num_formula;
|
|
|
+ if (!row.num_formula) {
|
|
|
+ row.num_temp_save = 1;
|
|
|
+ }
|
|
|
row.bp_id = res.data.bp_id;
|
|
|
// 金额=(产品单价)*核算数量 +附加金额 + 超标金额
|
|
|
row.price =
|
|
@@ -4093,6 +4122,9 @@ export default {
|
|
|
this.modalData.url_number = res.data.url_number || "";
|
|
|
this.modalData.overdraft = res.data.overdraft;
|
|
|
this.modalData.num_formula = res.data.num_formula;
|
|
|
+ if (!this.modalData.num_formula) {
|
|
|
+ this.modalData.num_temp_save = 1;
|
|
|
+ }
|
|
|
this.modalData.bp_id = res.data.bp_id;
|
|
|
// 金额=(产品单价)*核算数量 +附加金额 + 超标金额
|
|
|
this.modalData.price =
|
|
@@ -4273,9 +4305,7 @@ export default {
|
|
|
this.modalData.ext_price = res.data.ext_price || 0;
|
|
|
this.modalData.unit_price = res.data.price || 0;
|
|
|
this.modalData.num = res.data.num || 1;
|
|
|
- this.modalData.num_temp_save = JSON.parse(
|
|
|
- JSON.stringify(res.data.num || 1)
|
|
|
- );
|
|
|
+ this.modalData.num_temp_save = res.data.num || 1;
|
|
|
this.modalData.over_price = res.data.over_price || 0;
|
|
|
this.modalData.position = res.data.position | "";
|
|
|
this.modalData.unit = res.data.unit || "";
|
|
@@ -4297,15 +4327,9 @@ export default {
|
|
|
// 数据第一次通过接口获取
|
|
|
//展示非拆分部件
|
|
|
//存计算公式
|
|
|
- element.longCalc = JSON.parse(
|
|
|
- JSON.stringify(element.long || "")
|
|
|
- );
|
|
|
- element.wideCalc = JSON.parse(
|
|
|
- JSON.stringify(element.wide || "")
|
|
|
- );
|
|
|
- element.highCalc = JSON.parse(
|
|
|
- JSON.stringify(element.high || "")
|
|
|
- );
|
|
|
+ element.longCalc = element.long || "";
|
|
|
+ element.wideCalc = element.wide || "";
|
|
|
+ element.highCalc = element.high || "";
|
|
|
element.part_detail.forEach((elem) => {
|
|
|
elem.org_num = elem.num;
|
|
|
elem.material_detail_id = 0;
|
|
@@ -4358,6 +4382,7 @@ export default {
|
|
|
if ($event) {
|
|
|
let cur = row.change.filter((item) => item.id == row.change_id);
|
|
|
row.part_title = cur[0].part_title;
|
|
|
+ // row.title = cur[0].part_title;
|
|
|
row.org_part_id = row.part_id;
|
|
|
row.part_id = cur[0].part_id;
|
|
|
row.high = cur[0].high || 0;
|
|
@@ -4366,7 +4391,8 @@ export default {
|
|
|
row.longCalc = row.long;
|
|
|
row.wide = cur[0].wide || 0;
|
|
|
row.wideCalc = row.wide;
|
|
|
- row.part_detail = cur[0].sub_part;
|
|
|
+ row.sub_part = cur[0].sub_part;
|
|
|
+ row.part_detail = row.sub_part;
|
|
|
row.part_detail.forEach((elem) => {
|
|
|
elem.longCalc = elem.long || "";
|
|
|
elem.wideCalc = elem.wide || "";
|
|
@@ -4441,7 +4467,6 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- console.log("item.long :>> ", item.long);
|
|
|
if ((item.wide || "").indexOf(element.measureCalc) != -1) {
|
|
|
if (typeof (element.value * 1) == "number") {
|
|
|
item.wide = item.wide.replace(
|
|
@@ -4533,7 +4558,6 @@ export default {
|
|
|
this.$forceUpdate();
|
|
|
},
|
|
|
handleGetProductMeasure(val, index, product, ele) {
|
|
|
- console.log("ele :>> ", ele);
|
|
|
if (val) {
|
|
|
let change = [];
|
|
|
if (product.part.filter((v) => !v.change_id).length > 0) {
|
|
@@ -4805,7 +4829,6 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
- console.log("123 :>> ", 123);
|
|
|
//修改核算数量
|
|
|
// 如果没有核算数量公式,核算数量取产品数量
|
|
|
if (product.num_formula == "") {
|
|
@@ -4823,7 +4846,7 @@ export default {
|
|
|
product.num = eval(product.num_formula_temp);
|
|
|
product.num = product.num.toFixed(2);
|
|
|
product.over_price = product.over_price.toFixed(2);
|
|
|
- product.num_temp_save = product.num;
|
|
|
+ product.num_temp_save = product.num || 1;
|
|
|
product.price =
|
|
|
(product.unit_price * 1 || 0) * (product.num * 1 || 1) +
|
|
|
(product.over_price * 1 || 0) +
|
|
@@ -4839,8 +4862,10 @@ export default {
|
|
|
},
|
|
|
//修改材质/颜色/工艺的
|
|
|
handleProductProcessChange(e, n, modelData, ele) {
|
|
|
+ console.log("e :>> ", e);
|
|
|
if (e) {
|
|
|
this.pre_process_obj[ele.id] = e.value;
|
|
|
+ modelData[ele.id] = e.value;
|
|
|
if (!modelData.procedure_properties_str) {
|
|
|
modelData.procedure_properties_str = [];
|
|
|
}
|
|
@@ -4886,7 +4911,6 @@ export default {
|
|
|
}
|
|
|
// 产品 - 部件 工艺属性联动
|
|
|
modelData.part.forEach((element) => {
|
|
|
- // 此处有错误,产品选择完工艺路线之后部件的展示跟着改了但是procedure_properties没有
|
|
|
if (!element.is_metal) {
|
|
|
element.process.forEach((elem) => {
|
|
|
if (elem.name == ele.name) {
|
|
@@ -4911,6 +4935,7 @@ export default {
|
|
|
);
|
|
|
}
|
|
|
modelData.procedure_properties[ele.id] = "";
|
|
|
+ modelData[ele.id] = "";
|
|
|
}
|
|
|
this.$forceUpdate();
|
|
|
},
|