|
@@ -771,6 +771,30 @@
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
</vxe-column>
|
|
</vxe-column>
|
|
|
|
+ <vxe-column title="门头板" min-width="100" :edit-render="{}">
|
|
|
|
+ <template #default="scope">
|
|
|
|
+ <!-- {{
|
|
|
|
+ scope.row.part.filter(
|
|
|
|
+ (v) => v.part_title && v.part_title.indexOf("门头板")
|
|
|
|
+ )[0].part_title
|
|
|
|
+ }} -->
|
|
|
|
+ </template>
|
|
|
|
+ <template #edit="scope">
|
|
|
|
+ <div>
|
|
|
|
+ <a v-if="!scope.row.addMTB" @click="handleMTBClick(scope.row)"
|
|
|
|
+ >添加</a
|
|
|
|
+ >
|
|
|
|
+ <div v-else>
|
|
|
|
+ <a
|
|
|
|
+ @click="handleSet(scope.row, scope.rowIndex, 2)"
|
|
|
|
+ style="margin: 0 5px"
|
|
|
|
+ >编辑</a
|
|
|
|
+ >
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div></div>
|
|
|
|
+ </template>
|
|
|
|
+ </vxe-column>
|
|
<vxe-column title="原材料名称" min-width="100">
|
|
<vxe-column title="原材料名称" min-width="100">
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
<div v-if="!scope.row.is_metal">
|
|
<div v-if="!scope.row.is_metal">
|
|
@@ -1727,8 +1751,7 @@
|
|
element,
|
|
element,
|
|
modalData.measure,
|
|
modalData.measure,
|
|
modalData.total_num
|
|
modalData.total_num
|
|
- );
|
|
|
|
- handleIsSpecialPart(modalData);
|
|
|
|
|
|
+ )
|
|
"
|
|
"
|
|
v-model="element.change_id"
|
|
v-model="element.change_id"
|
|
style="width: 180px"
|
|
style="width: 180px"
|
|
@@ -1736,7 +1759,7 @@
|
|
<Option
|
|
<Option
|
|
v-for="item of element.change"
|
|
v-for="item of element.change"
|
|
:key="item.id"
|
|
:key="item.id"
|
|
- :label="item.part_title"
|
|
|
|
|
|
+ :label="item.part_title || item.title"
|
|
:value="item.id"
|
|
:value="item.id"
|
|
></Option>
|
|
></Option>
|
|
</Select>
|
|
</Select>
|
|
@@ -2454,6 +2477,7 @@ export default {
|
|
copiedLinePart: {},
|
|
copiedLinePart: {},
|
|
mentoubanList: [],
|
|
mentoubanList: [],
|
|
print_line_data: "",
|
|
print_line_data: "",
|
|
|
|
+ MTBList: [],
|
|
};
|
|
};
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
@@ -2466,11 +2490,11 @@ export default {
|
|
created() {
|
|
created() {
|
|
//获取部件分类
|
|
//获取部件分类
|
|
this.axios.get("/api/basics_parts_index").then((res) => {
|
|
this.axios.get("/api/basics_parts_index").then((res) => {
|
|
- // res.data.data.map((v, k) => {
|
|
|
|
- // if (v.title == "门头板") {
|
|
|
|
- // // this.mentoubanList = res.data.data.splice(k, 1)[0];
|
|
|
|
- // }
|
|
|
|
- // });
|
|
|
|
|
|
+ res.data.data.map((v, k) => {
|
|
|
|
+ if (v.title == "门头板") {
|
|
|
|
+ this.mentoubanList = res.data.data.splice(k, 1)[0];
|
|
|
|
+ }
|
|
|
|
+ });
|
|
this.part_type_total = res.data.data;
|
|
this.part_type_total = res.data.data;
|
|
});
|
|
});
|
|
// 获取测量字段
|
|
// 获取测量字段
|
|
@@ -2567,6 +2591,13 @@ export default {
|
|
this.tableWidth = e.target.innerWidth - 300;
|
|
this.tableWidth = e.target.innerWidth - 300;
|
|
this.$forceUpdate();
|
|
this.$forceUpdate();
|
|
});
|
|
});
|
|
|
|
+ this.axios
|
|
|
|
+ .get("/api/parts_index", { params: { type_title: "门头板" } })
|
|
|
|
+ .then((res) => {
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
+ this.MTBList = res.data.data;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
quoteRoughDraft() {
|
|
quoteRoughDraft() {
|
|
@@ -2905,7 +2936,7 @@ export default {
|
|
this.tableData.push(v);
|
|
this.tableData.push(v);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- this.handleCalcCount();
|
|
|
|
|
|
+ this.handleCalcCount(1);
|
|
this.HandleAutoCreateNewLine();
|
|
this.HandleAutoCreateNewLine();
|
|
//获取客户信息
|
|
//获取客户信息
|
|
this.axios
|
|
this.axios
|
|
@@ -3092,7 +3123,7 @@ export default {
|
|
});
|
|
});
|
|
},
|
|
},
|
|
// 合计 、 线条 统计价格
|
|
// 合计 、 线条 统计价格
|
|
- handleCalcCount() {
|
|
|
|
|
|
+ handleCalcCount(type) {
|
|
let sum = 0;
|
|
let sum = 0;
|
|
this.parts_title_count = [];
|
|
this.parts_title_count = [];
|
|
this.wood_title_count = [];
|
|
this.wood_title_count = [];
|
|
@@ -3246,18 +3277,20 @@ export default {
|
|
unit: total_line_unit,
|
|
unit: total_line_unit,
|
|
});
|
|
});
|
|
// 计算价格
|
|
// 计算价格
|
|
- this.info.predict_price = sum.toFixed(2);
|
|
|
|
- this.info.order_price = (
|
|
|
|
- (this.info.predict_price * this.fax) /
|
|
|
|
- 100
|
|
|
|
- ).toFixed(2);
|
|
|
|
- // if (this.info.order_price) {
|
|
|
|
- // console.log(`123`, 123);
|
|
|
|
- // this.info.fax_price = (
|
|
|
|
- // this.info.predict_price - this.info.order_price
|
|
|
|
- // ).toFixed(2);
|
|
|
|
- // }
|
|
|
|
- console.log(`this.info.fax_price `, this.info.fax_price);
|
|
|
|
|
|
+ if (type) {
|
|
|
|
+ this.info.order_price = (
|
|
|
|
+ this.info.predict_price - this.info.fax_price
|
|
|
|
+ ).toFixed(2);
|
|
|
|
+ } else {
|
|
|
|
+ this.info.predict_price = sum.toFixed(2);
|
|
|
|
+ this.info.order_price = (
|
|
|
|
+ (this.info.predict_price * this.fax) /
|
|
|
|
+ 100
|
|
|
|
+ ).toFixed(2);
|
|
|
|
+ this.info.fax_price = (
|
|
|
|
+ this.info.predict_price - this.info.order_price
|
|
|
|
+ ).toFixed(2);
|
|
|
|
+ }
|
|
},
|
|
},
|
|
getUsers() {
|
|
getUsers() {
|
|
this.axios("/api/employee_list").then((res) => (this.users = res.data));
|
|
this.axios("/api/employee_list").then((res) => (this.users = res.data));
|
|
@@ -3301,6 +3334,42 @@ export default {
|
|
handleRemarkCreate(val) {
|
|
handleRemarkCreate(val) {
|
|
this.support_remark.push(val);
|
|
this.support_remark.push(val);
|
|
},
|
|
},
|
|
|
|
+ handleMTBClick(row) {
|
|
|
|
+ row.addMTB = true;
|
|
|
|
+ const _obj = {
|
|
|
|
+ is_metal: false,
|
|
|
|
+ isBP: false,
|
|
|
|
+ isChoosed: false,
|
|
|
|
+ change_id: "",
|
|
|
|
+ change: this.deepClone(this.MTBList),
|
|
|
|
+ long: "",
|
|
|
|
+ wide: "",
|
|
|
|
+ high: "",
|
|
|
|
+ hide_measure: [],
|
|
|
|
+ process: [],
|
|
|
|
+ part_id: 25, //门头板ID
|
|
|
|
+ hide_process: [],
|
|
|
|
+ part_detail: [
|
|
|
|
+ {
|
|
|
|
+ title: "",
|
|
|
|
+ part_detail_title: "",
|
|
|
|
+ material_detail_title: "",
|
|
|
|
+ material_detail_id: "",
|
|
|
|
+ material_detail_list: [
|
|
|
|
+ {
|
|
|
|
+ material_detail_id: "",
|
|
|
|
+ wide: "",
|
|
|
|
+ high: "",
|
|
|
|
+ long: "",
|
|
|
|
+ material_detail_num: "",
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ };
|
|
|
|
+ row.part.push(_obj);
|
|
|
|
+ this.$forceUpdate();
|
|
|
|
+ },
|
|
getLockList() {
|
|
getLockList() {
|
|
this.axios("/api/lock_list").then((res) => (this.lock_list = res.data));
|
|
this.axios("/api/lock_list").then((res) => (this.lock_list = res.data));
|
|
},
|
|
},
|
|
@@ -4746,141 +4815,160 @@ export default {
|
|
});
|
|
});
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- handlePartChange($event, row, measure, product_num) {
|
|
|
|
- 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;
|
|
|
|
- row.highCalc = row.high;
|
|
|
|
- row.long = cur[0].long || 0;
|
|
|
|
- row.longCalc = row.long;
|
|
|
|
- row.wide = cur[0].wide || 0;
|
|
|
|
- row.wideCalc = row.wide;
|
|
|
|
- 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 || "";
|
|
|
|
- elem.highCalc = elem.high || "";
|
|
|
|
- elem.org_num = elem.num;
|
|
|
|
- elem.material_detail_org_num = elem.num || 0;
|
|
|
|
- elem.num =
|
|
|
|
- ((elem.material_detail_org_num || elem.num) * product_num) | 0;
|
|
|
|
- elem.material_detail_num = elem.material_detail_org_num * product_num;
|
|
|
|
|
|
+ handeMTBSelection($event, row) {
|
|
|
|
+ console.log(`$event`, $event);
|
|
|
|
+ this.axios
|
|
|
|
+ .post("/api/get_part_detail_material", {
|
|
|
|
+ id: $event.value,
|
|
|
|
+ })
|
|
|
|
+ .then((res) => {
|
|
|
|
+ this.modalData.part.map((part) => {
|
|
|
|
+ if (part.id === 25) {
|
|
|
|
+ part.part_detail = res.data.msg.detail;
|
|
|
|
+ part = Object.assign(part, res.data.msg);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
});
|
|
});
|
|
- 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,
|
|
|
|
|
|
+ },
|
|
|
|
+ handlePartChange($event, row, measure, product_num) {
|
|
|
|
+ if (row.part_id === 25) {
|
|
|
|
+ this.handeMTBSelection($event, row);
|
|
|
|
+ } else {
|
|
|
|
+ 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;
|
|
|
|
+ row.highCalc = row.high;
|
|
|
|
+ row.long = cur[0].long || 0;
|
|
|
|
+ row.longCalc = row.long;
|
|
|
|
+ row.wide = cur[0].wide || 0;
|
|
|
|
+ row.wideCalc = row.wide;
|
|
|
|
+ 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 || "";
|
|
|
|
+ elem.highCalc = elem.high || "";
|
|
|
|
+ elem.org_num = elem.num;
|
|
|
|
+ elem.material_detail_org_num = elem.num || 0;
|
|
|
|
+ elem.num =
|
|
|
|
+ ((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") {
|
|
|
|
- row.long = row.long.replace(
|
|
|
|
- new RegExp(element.measureCalc, "g"),
|
|
|
|
- element.value | ""
|
|
|
|
- );
|
|
|
|
- row.long = eval(row.long);
|
|
|
|
- row.long += "";
|
|
|
|
- } else {
|
|
|
|
- row.long = "";
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- if ((row.wide + "").indexOf(element.measureCalc) != -1) {
|
|
|
|
- if (typeof (element.value * 1) == "number") {
|
|
|
|
- row.wide = row.wide.replace(
|
|
|
|
- new RegExp(element.measureCalc, "g"),
|
|
|
|
- element.value | ""
|
|
|
|
- );
|
|
|
|
- row.wide = eval(row.wide);
|
|
|
|
- row.wide += "";
|
|
|
|
- } else {
|
|
|
|
- row.wide = "";
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- if ((row.high + "").indexOf(element.measureCalc) != -1) {
|
|
|
|
- if (typeof (element.value * 1) == "number") {
|
|
|
|
- row.high = row.high.replace(
|
|
|
|
- new RegExp(element.measureCalc, "g"),
|
|
|
|
- element.value | ""
|
|
|
|
- );
|
|
|
|
- row.high = eval(row.high);
|
|
|
|
- row.high += "";
|
|
|
|
- } else {
|
|
|
|
- row.high = "";
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- row.part_detail.forEach((item) => {
|
|
|
|
- item.num =
|
|
|
|
- row.material_detail_org_num || item.material_detail_org_num;
|
|
|
|
- if ((item.long || "").indexOf(element.measureCalc) != -1) {
|
|
|
|
|
|
+ measure.forEach((element) => {
|
|
|
|
+ if ((row.long + "").indexOf(element.measureCalc) != -1) {
|
|
if (typeof (element.value * 1) == "number") {
|
|
if (typeof (element.value * 1) == "number") {
|
|
- item.long = item.long.replace(
|
|
|
|
|
|
+ row.long = row.long.replace(
|
|
new RegExp(element.measureCalc, "g"),
|
|
new RegExp(element.measureCalc, "g"),
|
|
- element.value
|
|
|
|
|
|
+ element.value | ""
|
|
);
|
|
);
|
|
- try {
|
|
|
|
- item.long = eval(item.long);
|
|
|
|
- item.long += "";
|
|
|
|
- } catch (error) {
|
|
|
|
- item.long = "";
|
|
|
|
- }
|
|
|
|
|
|
+ row.long = eval(row.long);
|
|
|
|
+ row.long += "";
|
|
|
|
+ } else {
|
|
|
|
+ row.long = "";
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if ((item.wide || "").indexOf(element.measureCalc) != -1) {
|
|
|
|
|
|
+ if ((row.wide + "").indexOf(element.measureCalc) != -1) {
|
|
if (typeof (element.value * 1) == "number") {
|
|
if (typeof (element.value * 1) == "number") {
|
|
- item.wide = item.wide.replace(
|
|
|
|
|
|
+ row.wide = row.wide.replace(
|
|
new RegExp(element.measureCalc, "g"),
|
|
new RegExp(element.measureCalc, "g"),
|
|
- element.value
|
|
|
|
|
|
+ element.value | ""
|
|
);
|
|
);
|
|
- try {
|
|
|
|
- item.wide = eval(item.wide);
|
|
|
|
- item.wide += "";
|
|
|
|
- } catch (error) {
|
|
|
|
- item.wide = "";
|
|
|
|
- }
|
|
|
|
|
|
+ row.wide = eval(row.wide);
|
|
|
|
+ row.wide += "";
|
|
|
|
+ } else {
|
|
|
|
+ row.wide = "";
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if ((item.high || "").indexOf(element.measureCalc) != -1) {
|
|
|
|
|
|
+ if ((row.high + "").indexOf(element.measureCalc) != -1) {
|
|
if (typeof (element.value * 1) == "number") {
|
|
if (typeof (element.value * 1) == "number") {
|
|
- item.high = item.high.replace(
|
|
|
|
|
|
+ row.high = row.high.replace(
|
|
new RegExp(element.measureCalc, "g"),
|
|
new RegExp(element.measureCalc, "g"),
|
|
- element.value
|
|
|
|
|
|
+ element.value | ""
|
|
);
|
|
);
|
|
- try {
|
|
|
|
- item.high = eval(item.high);
|
|
|
|
- item.high += "";
|
|
|
|
- } catch (error) {
|
|
|
|
- item.high = "";
|
|
|
|
- }
|
|
|
|
|
|
+ row.high = eval(row.high);
|
|
|
|
+ row.high += "";
|
|
|
|
+ } else {
|
|
|
|
+ row.high = "";
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- item.material_detail_list.forEach((it) => {
|
|
|
|
- it.long = it.long || "0";
|
|
|
|
- it.wide = it.wide || "0";
|
|
|
|
- it.high = it.high || "0";
|
|
|
|
|
|
+ row.part_detail.forEach((item) => {
|
|
|
|
+ item.num =
|
|
|
|
+ row.material_detail_org_num || item.material_detail_org_num;
|
|
|
|
+ if ((item.long || "").indexOf(element.measureCalc) != -1) {
|
|
|
|
+ if (typeof (element.value * 1) == "number") {
|
|
|
|
+ item.long = item.long.replace(
|
|
|
|
+ new RegExp(element.measureCalc, "g"),
|
|
|
|
+ element.value
|
|
|
|
+ );
|
|
|
|
+ try {
|
|
|
|
+ item.long = eval(item.long);
|
|
|
|
+ item.long += "";
|
|
|
|
+ } catch (error) {
|
|
|
|
+ item.long = "";
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if ((item.wide || "").indexOf(element.measureCalc) != -1) {
|
|
|
|
+ if (typeof (element.value * 1) == "number") {
|
|
|
|
+ item.wide = item.wide.replace(
|
|
|
|
+ new RegExp(element.measureCalc, "g"),
|
|
|
|
+ element.value
|
|
|
|
+ );
|
|
|
|
+ try {
|
|
|
|
+ item.wide = eval(item.wide);
|
|
|
|
+ item.wide += "";
|
|
|
|
+ } catch (error) {
|
|
|
|
+ item.wide = "";
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if ((item.high || "").indexOf(element.measureCalc) != -1) {
|
|
|
|
+ if (typeof (element.value * 1) == "number") {
|
|
|
|
+ item.high = item.high.replace(
|
|
|
|
+ new RegExp(element.measureCalc, "g"),
|
|
|
|
+ element.value
|
|
|
|
+ );
|
|
|
|
+ try {
|
|
|
|
+ item.high = eval(item.high);
|
|
|
|
+ item.high += "";
|
|
|
|
+ } catch (error) {
|
|
|
|
+ item.high = "";
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ item.material_detail_list.forEach((it) => {
|
|
|
|
+ it.long = it.long || "0";
|
|
|
|
+ it.wide = it.wide || "0";
|
|
|
|
+ it.high = it.high || "0";
|
|
|
|
+ });
|
|
|
|
+ item.long = item.long || "0";
|
|
|
|
+ item.wide = item.wide || "0";
|
|
|
|
+ item.high = item.high || "0";
|
|
|
|
+ item.material_detail_title = item.material_detail_list[0].title;
|
|
|
|
+ item.material_detail_id =
|
|
|
|
+ item.material_detail_list[0].material_detail_id;
|
|
|
|
+ item.material_detail_org_num = item.num || 0;
|
|
});
|
|
});
|
|
- item.long = item.long || "0";
|
|
|
|
- item.wide = item.wide || "0";
|
|
|
|
- item.high = item.high || "0";
|
|
|
|
- item.material_detail_title = item.material_detail_list[0].title;
|
|
|
|
- item.material_detail_id =
|
|
|
|
- item.material_detail_list[0].material_detail_id;
|
|
|
|
- item.material_detail_org_num = item.num || 0;
|
|
|
|
});
|
|
});
|
|
- });
|
|
|
|
- } else {
|
|
|
|
- row.change_id = "";
|
|
|
|
|
|
+ } else {
|
|
|
|
+ row.change_id = "";
|
|
|
|
+ }
|
|
}
|
|
}
|
|
-
|
|
|
|
this.$forceUpdate();
|
|
this.$forceUpdate();
|
|
},
|
|
},
|
|
handleProductNumChange(e, product) {
|
|
handleProductNumChange(e, product) {
|