|
|
@@ -339,7 +339,7 @@
|
|
|
<Input
|
|
|
v-model="info.fax_price"
|
|
|
v-if="type != 3"
|
|
|
- readonly
|
|
|
+ @on-change="handleFaxPriceChange"
|
|
|
class="auto-width"
|
|
|
placeholder="自动生成"
|
|
|
/>
|
|
|
@@ -357,7 +357,7 @@
|
|
|
<Input
|
|
|
v-model="info.order_price"
|
|
|
v-if="type != 3"
|
|
|
- @on-change="handleOrderPriceChange($event, info)"
|
|
|
+ @on-change="handleOrderPriceChange($event)"
|
|
|
class="auto-width"
|
|
|
placeholder="自动生成"
|
|
|
/>
|
|
|
@@ -494,6 +494,35 @@
|
|
|
:edit-config="type == 3 ? {} : { trigger: 'click', mode: 'row' }"
|
|
|
:data="tableData"
|
|
|
>
|
|
|
+ <vxe-column title="操作" min-width="200">
|
|
|
+ <template #default="{ row, rowIndex }">
|
|
|
+ <a
|
|
|
+ @click="handleSet(row, rowIndex, 5)"
|
|
|
+ style="margin: 0 5px"
|
|
|
+ v-show="!row.is_metal"
|
|
|
+ >详情</a
|
|
|
+ >
|
|
|
+ <a
|
|
|
+ @click="handleSet(row, rowIndex, 4)"
|
|
|
+ v-show="type != 3"
|
|
|
+ style="margin: 0 5px"
|
|
|
+ >复制</a
|
|
|
+ >
|
|
|
+ <a
|
|
|
+ @click="handleSet(row, rowIndex, 2)"
|
|
|
+ v-show="type != 3 && !row.is_metal"
|
|
|
+ style="margin: 0 5px"
|
|
|
+ >编辑</a
|
|
|
+ >
|
|
|
+
|
|
|
+ <a
|
|
|
+ @click="handleSet(row, rowIndex, 3)"
|
|
|
+ v-show="type != 3"
|
|
|
+ style="margin: 0 5px"
|
|
|
+ >删除</a
|
|
|
+ >
|
|
|
+ </template>
|
|
|
+ </vxe-column>
|
|
|
<vxe-column type="seq" min-width="45">
|
|
|
<template #header>
|
|
|
<span>序号</span>
|
|
|
@@ -1064,35 +1093,6 @@
|
|
|
{{ row.remark }}
|
|
|
</template>
|
|
|
</vxe-column>
|
|
|
- <vxe-column title="操作" min-width="200">
|
|
|
- <template #default="{ row, rowIndex }">
|
|
|
- <a
|
|
|
- @click="handleSet(row, rowIndex, 5)"
|
|
|
- style="margin: 0 5px"
|
|
|
- v-show="!row.is_metal"
|
|
|
- >详情</a
|
|
|
- >
|
|
|
- <a
|
|
|
- @click="handleSet(row, rowIndex, 4)"
|
|
|
- v-show="type != 3"
|
|
|
- style="margin: 0 5px"
|
|
|
- >复制</a
|
|
|
- >
|
|
|
- <a
|
|
|
- @click="handleSet(row, rowIndex, 2)"
|
|
|
- v-show="type != 3 && !row.is_metal"
|
|
|
- style="margin: 0 5px"
|
|
|
- >编辑</a
|
|
|
- >
|
|
|
-
|
|
|
- <a
|
|
|
- @click="handleSet(row, rowIndex, 3)"
|
|
|
- v-show="type != 3"
|
|
|
- style="margin: 0 5px"
|
|
|
- >删除</a
|
|
|
- >
|
|
|
- </template>
|
|
|
- </vxe-column>
|
|
|
</vxe-table>
|
|
|
<!-- <vxe-table resizable border ref="xTree" :data="tableData">
|
|
|
<vxe-table-column
|
|
|
@@ -2409,6 +2409,8 @@ export default {
|
|
|
bpp_list: [],
|
|
|
process_obj: [],
|
|
|
timeout: null,
|
|
|
+ copiedLinePart: {},
|
|
|
+ mentoubanList: [],
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -2421,6 +2423,12 @@ export default {
|
|
|
created() {
|
|
|
//获取部件分类
|
|
|
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];
|
|
|
+ }
|
|
|
+ });
|
|
|
+ console.log(`this.mentoubanList`, this.mentoubanList);
|
|
|
this.part_type_total = res.data.data;
|
|
|
});
|
|
|
// 获取测量字段
|
|
|
@@ -2516,6 +2524,13 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
methods: {
|
|
|
+ handleFaxPriceChange(e) {
|
|
|
+ this.info.fax_price = e.target.value;
|
|
|
+ this.info.order_price = (
|
|
|
+ this.info.predict_price - e.target.value
|
|
|
+ ).toFixed(2);
|
|
|
+ this.$forceUpdate();
|
|
|
+ },
|
|
|
getSelectedLabel(value, list, valueProp, labelField) {
|
|
|
const item = list.find((item) => item[valueProp] == value);
|
|
|
return item ? item[labelField] : null;
|
|
|
@@ -2596,6 +2611,7 @@ export default {
|
|
|
});
|
|
|
sendList.length > 0 &&
|
|
|
sendList.map((element, index) => {
|
|
|
+ element.ext = element.extArray;
|
|
|
element.part.map((elem) => {
|
|
|
if (!elem.is_metal) {
|
|
|
// elem.part_detail = elem.sub_part;
|
|
|
@@ -2836,9 +2852,12 @@ export default {
|
|
|
(this.info.predict_price * this.fax) /
|
|
|
100
|
|
|
).toFixed(2);
|
|
|
- this.info.fax_price = (
|
|
|
- this.info.predict_price - this.info.order_price
|
|
|
- ).toFixed(2);
|
|
|
+ const temp_fax_price =
|
|
|
+ (this.info.predict_price - this.info.order_price).toFixed(2) ||
|
|
|
+ 0;
|
|
|
+ if (!this.info.fax_price) {
|
|
|
+ this.info.fax_price = temp_fax_price;
|
|
|
+ }
|
|
|
this.$forceUpdate();
|
|
|
});
|
|
|
}
|
|
|
@@ -3146,15 +3165,18 @@ export default {
|
|
|
(this.info.predict_price * this.fax) /
|
|
|
100
|
|
|
).toFixed(2);
|
|
|
- this.info.fax_price = (
|
|
|
- this.info.predict_price - this.info.order_price
|
|
|
- ).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);
|
|
|
},
|
|
|
getUsers() {
|
|
|
this.axios("/api/employee_list").then((res) => (this.users = res.data));
|
|
|
},
|
|
|
handleExtraAdd(array, type) {
|
|
|
- console.log(`array`, array);
|
|
|
array.push({
|
|
|
num: 0,
|
|
|
price: 0,
|
|
|
@@ -3165,11 +3187,13 @@ export default {
|
|
|
id: "",
|
|
|
is_metal: true,
|
|
|
});
|
|
|
+ this.handleCalcCount();
|
|
|
this.$forceUpdate();
|
|
|
},
|
|
|
handleExtraDele(array, row, index, modalData) {
|
|
|
array.splice(index, 1);
|
|
|
this.handleTotalPriceCalc(row, modalData);
|
|
|
+ this.handleCalcCount();
|
|
|
this.$forceUpdate();
|
|
|
},
|
|
|
getCoumstList() {
|
|
|
@@ -3545,7 +3569,6 @@ export default {
|
|
|
custom_id,
|
|
|
route_id_at_copy,
|
|
|
then: (subAddProductData, support_remark) => {
|
|
|
- console.log("subAddProductData :>> ", subAddProductData);
|
|
|
this.support_remark = Array.from(
|
|
|
new Set([...support_remark, ...this.support_remark])
|
|
|
);
|
|
|
@@ -3807,6 +3830,7 @@ export default {
|
|
|
break;
|
|
|
case 4:
|
|
|
obj = this.deepClone(row);
|
|
|
+ obj.isCopied = true;
|
|
|
if (row.is_metal) {
|
|
|
} else {
|
|
|
obj.position = "";
|
|
|
@@ -3821,6 +3845,16 @@ export default {
|
|
|
JSON.stringify(row.procedure_properties)
|
|
|
);
|
|
|
}
|
|
|
+ //复制一条数据,更换了产品之后,
|
|
|
+ //线条的内容要保留(不管更换的这个产品的默认线条是什么,都是只展示复制下来的)
|
|
|
+ //摘自Tower #2004
|
|
|
+ obj.part.map((v) => {
|
|
|
+ if (v.title.indexOf("线条") != -1) {
|
|
|
+ this.copiedLinePart = this.deepClone(v);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ //因为是复制,插件id为_XID会相同导致bug,置空后会自动生成
|
|
|
+ obj._XID = "";
|
|
|
this.tableData.splice(index + 1, 0, obj);
|
|
|
this.handleCalcCount();
|
|
|
break;
|
|
|
@@ -3903,6 +3937,7 @@ export default {
|
|
|
row.price = element[0].price;
|
|
|
row.total_price = (row.num * row.price).toFixed(2);
|
|
|
this.handleTotalPriceCalc(row, item);
|
|
|
+ this.handleCalcCount();
|
|
|
},
|
|
|
handleSameProcessDisabled(array, currencyChooseValue, currencyChooseIndex) {
|
|
|
let matchIds = array.selected_ids;
|
|
|
@@ -3986,7 +4021,7 @@ export default {
|
|
|
item.position = e.target.value;
|
|
|
this.$forceUpdate();
|
|
|
},
|
|
|
- handleOrderPriceChange(e, info) {
|
|
|
+ handleOrderPriceChange(e) {
|
|
|
this.info.order_price = e.target.value;
|
|
|
this.info.fax_price = (this.info.predict_price - e.target.value).toFixed(
|
|
|
2
|
|
|
@@ -4096,6 +4131,7 @@ export default {
|
|
|
} else {
|
|
|
row.ext_id = "";
|
|
|
row.title = "";
|
|
|
+ this.handleCalcCount();
|
|
|
}
|
|
|
},
|
|
|
changeEditPart(row, part_type, part_detail, e, rowIndex) {
|
|
|
@@ -4114,80 +4150,80 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
handleSelectProductMetail(row, rowIndex, $event, scope) {
|
|
|
- console.log(`$event`, $event);
|
|
|
- const arr = $event.tag.split("_");
|
|
|
- let obj = {};
|
|
|
- console.log(`arr[1]`, arr[1]);
|
|
|
- // 分类 1产品 2五金
|
|
|
- if (arr[1] == "1") {
|
|
|
- obj = {
|
|
|
- select_all_id: $event.value,
|
|
|
- product_id: "",
|
|
|
- type_name: "", //展示用产品名称
|
|
|
- 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, //备注列表
|
|
|
- is_metal: false,
|
|
|
- ext: [],
|
|
|
- extArray: [
|
|
|
- {
|
|
|
- num: 0,
|
|
|
- price: 0,
|
|
|
- total_price: 0,
|
|
|
- type: 2,
|
|
|
- remark: "",
|
|
|
- title: "",
|
|
|
- id: "",
|
|
|
- is_metal: true,
|
|
|
- },
|
|
|
- ],
|
|
|
- process_obj: JSON.parse(JSON.stringify(this.process_obj)), //工艺属性含选项对象
|
|
|
- };
|
|
|
- obj.process_obj.map(
|
|
|
- (v) => ((obj[v.id] = ""), (obj.procedure_properties[v.id] = ""))
|
|
|
- );
|
|
|
- } else {
|
|
|
- console.log(`2`, 2);
|
|
|
- obj = {
|
|
|
- select_all_id: $event.value,
|
|
|
- type: 1,
|
|
|
- is_metal: true,
|
|
|
- material_id: "",
|
|
|
- product_id: "",
|
|
|
- title: "",
|
|
|
- price: 0,
|
|
|
- single_price: 0,
|
|
|
- num: 0,
|
|
|
- unit: "",
|
|
|
- };
|
|
|
- }
|
|
|
- console.log(`arr[0]`, arr[0]);
|
|
|
- obj.product_id = arr[0];
|
|
|
- this.tableData.splice(rowIndex, 1, obj);
|
|
|
- if (arr[1] === "1") {
|
|
|
- this.changeEditTableData(row, rowIndex, $event, scope);
|
|
|
- } else {
|
|
|
- this.changeEditMetal(row, rowIndex, $event, scope);
|
|
|
+ if ($event) {
|
|
|
+ const arr = $event.tag.split("_");
|
|
|
+ let obj = {};
|
|
|
+ // 分类 1产品 2五金
|
|
|
+ if (arr[1] == "1") {
|
|
|
+ obj = {
|
|
|
+ isCopied: row.isCopied,
|
|
|
+ select_all_id: $event.value,
|
|
|
+ product_id: "",
|
|
|
+ type_name: "", //展示用产品名称
|
|
|
+ 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, //备注列表
|
|
|
+ is_metal: false,
|
|
|
+ ext: [],
|
|
|
+ extArray: [
|
|
|
+ {
|
|
|
+ num: 0,
|
|
|
+ price: 0,
|
|
|
+ total_price: 0,
|
|
|
+ type: 2,
|
|
|
+ remark: "",
|
|
|
+ title: "",
|
|
|
+ id: "",
|
|
|
+ is_metal: true,
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ process_obj: JSON.parse(JSON.stringify(this.process_obj)), //工艺属性含选项对象
|
|
|
+ };
|
|
|
+ obj.process_obj.map(
|
|
|
+ (v) => ((obj[v.id] = ""), (obj.procedure_properties[v.id] = ""))
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ obj = {
|
|
|
+ select_all_id: $event.value,
|
|
|
+ type: 1,
|
|
|
+ is_metal: true,
|
|
|
+ material_id: "",
|
|
|
+ product_id: "",
|
|
|
+ title: "",
|
|
|
+ price: 0,
|
|
|
+ single_price: 0,
|
|
|
+ num: 0,
|
|
|
+ unit: "",
|
|
|
+ };
|
|
|
+ }
|
|
|
+ obj.product_id = arr[0];
|
|
|
+ this.tableData.splice(rowIndex, 1, obj);
|
|
|
+ if (arr[1] === "1") {
|
|
|
+ this.changeEditTableData(obj, rowIndex, $event, scope);
|
|
|
+ } else {
|
|
|
+ this.changeEditMetal(obj, rowIndex, $event, scope);
|
|
|
+ }
|
|
|
+ this.HandleAutoCreateNewLine();
|
|
|
}
|
|
|
- this.HandleAutoCreateNewLine();
|
|
|
},
|
|
|
changeEditTableData(row, rowIndex, $event, scope) {
|
|
|
+ const isCopied = row.isCopied || false;
|
|
|
if ($event) {
|
|
|
row.type_name = $event.label;
|
|
|
row.title = $event.label;
|
|
|
@@ -4254,8 +4290,8 @@ export default {
|
|
|
});
|
|
|
if (element.is_null == 1) {
|
|
|
element.change_id = "";
|
|
|
- element.part_title = "";
|
|
|
- element.title = "";
|
|
|
+ // element.part_title = "";
|
|
|
+ // element.title = "";
|
|
|
} else {
|
|
|
for (const key in this.pre_process_obj) {
|
|
|
const item = this.pre_process_obj[key];
|
|
|
@@ -4263,6 +4299,9 @@ export default {
|
|
|
}
|
|
|
element.change_id = element.change[0].id;
|
|
|
}
|
|
|
+ if (isCopied && element.title.indexOf("线条") != -1) {
|
|
|
+ element = Object.assign(element, this.copiedLinePart);
|
|
|
+ }
|
|
|
element.part_detail = element.sub_part;
|
|
|
//展示非拆分部件
|
|
|
// 默认替换部件 pre_process_obj
|
|
|
@@ -4308,7 +4347,6 @@ export default {
|
|
|
element.value = "";
|
|
|
element.measureCalc = element.e_title;
|
|
|
});
|
|
|
- console.log("row :>> ", row);
|
|
|
this.tableData.splice(rowIndex, 1, row);
|
|
|
this.handleClearExtInfo(row, this.pre_bp_id, res.data.bp_id);
|
|
|
row.get_first_data = false;
|
|
|
@@ -5222,9 +5260,7 @@ export default {
|
|
|
product.num = eval(product.num_formula_temp);
|
|
|
}
|
|
|
product.num = Number(product.num).toFixed(2);
|
|
|
- console.log(`product.over_price`, product.over_price);
|
|
|
product.over_price = Number(product.over_price).toFixed(2);
|
|
|
- console.log(`product.over_price1`, product.over_price);
|
|
|
product.num_temp_save = product.num || 1;
|
|
|
product.price =
|
|
|
(product.unit_price * 1 || 0) * (product.num * 1 || 1) +
|
|
|
@@ -5240,7 +5276,6 @@ 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;
|