|
@@ -524,28 +524,31 @@
|
|
transfer
|
|
transfer
|
|
filter-by-label
|
|
filter-by-label
|
|
label-in-value
|
|
label-in-value
|
|
- v-if="!scope.row.is_metal"
|
|
|
|
v-model="scope.row.product_id"
|
|
v-model="scope.row.product_id"
|
|
@change="$refs.xTable.updateStatus(scope)"
|
|
@change="$refs.xTable.updateStatus(scope)"
|
|
@on-change="
|
|
@on-change="
|
|
- changeEditTableData(scope.row, scope.rowIndex, $event, scope)
|
|
|
|
|
|
+ handleSelectProductMetail(
|
|
|
|
+ scope.row,
|
|
|
|
+ scope.rowIndex,
|
|
|
|
+ $event,
|
|
|
|
+ scope
|
|
|
|
+ )
|
|
"
|
|
"
|
|
>
|
|
>
|
|
<Option
|
|
<Option
|
|
- v-for="item in productList"
|
|
|
|
- :tag="item.img_url"
|
|
|
|
|
|
+ v-for="item in product_metailList"
|
|
|
|
+ :tag="item.key"
|
|
:value="item.id"
|
|
:value="item.id"
|
|
:label="item.title"
|
|
:label="item.title"
|
|
- :key="item.id"
|
|
|
|
|
|
+ :key="item.key"
|
|
></Option>
|
|
></Option>
|
|
</Select>
|
|
</Select>
|
|
- <Select
|
|
|
|
|
|
+ <!-- <Select
|
|
filterable
|
|
filterable
|
|
clearable
|
|
clearable
|
|
transfer
|
|
transfer
|
|
filter-by-label
|
|
filter-by-label
|
|
label-in-value
|
|
label-in-value
|
|
- v-else
|
|
|
|
v-model="scope.row.material_id"
|
|
v-model="scope.row.material_id"
|
|
@change="$refs.xTable.updateStatus(scope)"
|
|
@change="$refs.xTable.updateStatus(scope)"
|
|
@on-change="
|
|
@on-change="
|
|
@@ -558,12 +561,22 @@
|
|
:key="item.id"
|
|
:key="item.id"
|
|
:label="item.title"
|
|
:label="item.title"
|
|
></Option>
|
|
></Option>
|
|
- </Select>
|
|
|
|
|
|
+ </Select> -->
|
|
</template>
|
|
</template>
|
|
<template #default="{ row }">{{
|
|
<template #default="{ row }">{{
|
|
row.is_metal
|
|
row.is_metal
|
|
- ? getSelectedLabel(row.material_id, metalList, "id", "title")
|
|
|
|
- : getSelectedLabel(row.product_id, productList, "id", "title")
|
|
|
|
|
|
+ ? getSelectedLabel(
|
|
|
|
+ row.product_id,
|
|
|
|
+ product_metailList,
|
|
|
|
+ "id",
|
|
|
|
+ "title"
|
|
|
|
+ )
|
|
|
|
+ : getSelectedLabel(
|
|
|
|
+ row.product_id,
|
|
|
|
+ product_metailList,
|
|
|
|
+ "id",
|
|
|
|
+ "title"
|
|
|
|
+ )
|
|
}}</template>
|
|
}}</template>
|
|
</vxe-column>
|
|
</vxe-column>
|
|
<vxe-column
|
|
<vxe-column
|
|
@@ -2126,6 +2139,7 @@ export default {
|
|
modalArray: [],
|
|
modalArray: [],
|
|
modalData: {},
|
|
modalData: {},
|
|
productList: [],
|
|
productList: [],
|
|
|
|
+ product_metailList: [],
|
|
metalList: [],
|
|
metalList: [],
|
|
extList: [],
|
|
extList: [],
|
|
coumstList: [],
|
|
coumstList: [],
|
|
@@ -2571,6 +2585,7 @@ export default {
|
|
let _save_metal = this.tableData.filter((v) => v.is_metal && v.id);
|
|
let _save_metal = this.tableData.filter((v) => v.is_metal && v.id);
|
|
_save_metal.map((v) => {
|
|
_save_metal.map((v) => {
|
|
v.type = 1;
|
|
v.type = 1;
|
|
|
|
+ v.material_id = v.product_id;
|
|
});
|
|
});
|
|
// this.tableData.map((item, index) => {
|
|
// this.tableData.map((item, index) => {
|
|
// if (!item.is_metal) {
|
|
// if (!item.is_metal) {
|
|
@@ -2663,6 +2678,7 @@ export default {
|
|
v.total_price = v.num * v.price;
|
|
v.total_price = v.num * v.price;
|
|
} else {
|
|
} else {
|
|
v.material_id = v.ext_id;
|
|
v.material_id = v.ext_id;
|
|
|
|
+ v.product_id = v.ext_id;
|
|
v.single_price = v.price;
|
|
v.single_price = v.price;
|
|
v.price = v.num * v.single_price;
|
|
v.price = v.num * v.single_price;
|
|
}
|
|
}
|
|
@@ -2776,10 +2792,13 @@ export default {
|
|
if (v.type === 1) {
|
|
if (v.type === 1) {
|
|
v.is_metal = true;
|
|
v.is_metal = true;
|
|
v.material_id = v.ext_id;
|
|
v.material_id = v.ext_id;
|
|
|
|
+ v.product_id = v.ext_id;
|
|
|
|
+
|
|
this.tableData.push(v);
|
|
this.tableData.push(v);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
this.handleCalcCount();
|
|
this.handleCalcCount();
|
|
|
|
+ this.HandleAutoCreateNewLine();
|
|
//获取客户信息
|
|
//获取客户信息
|
|
this.axios
|
|
this.axios
|
|
.get("/api/custom_detail", { params: { id: res.data.custom_id } })
|
|
.get("/api/custom_detail", { params: { id: res.data.custom_id } })
|
|
@@ -2842,6 +2861,9 @@ export default {
|
|
v.value = v.id;
|
|
v.value = v.id;
|
|
});
|
|
});
|
|
});
|
|
});
|
|
|
|
+ this.axios("/api/get_select_all").then((res) => {
|
|
|
|
+ this.product_metailList = res.data;
|
|
|
|
+ });
|
|
},
|
|
},
|
|
cancelModal() {
|
|
cancelModal() {
|
|
this.showEditProduct = false;
|
|
this.showEditProduct = false;
|
|
@@ -2974,6 +2996,7 @@ export default {
|
|
this.tableData.forEach((element) => {
|
|
this.tableData.forEach((element) => {
|
|
sum += element.price * 1;
|
|
sum += element.price * 1;
|
|
if (!element.is_metal) {
|
|
if (!element.is_metal) {
|
|
|
|
+ element.part&&
|
|
element.part.forEach((elem) => {
|
|
element.part.forEach((elem) => {
|
|
if (!elem.is_metal) {
|
|
if (!elem.is_metal) {
|
|
// 统计部件
|
|
// 统计部件
|
|
@@ -3641,12 +3664,14 @@ export default {
|
|
HandleAutoCreateNewLine() {
|
|
HandleAutoCreateNewLine() {
|
|
let flag = false;
|
|
let flag = false;
|
|
this.tableData.map((v) => {
|
|
this.tableData.map((v) => {
|
|
- if (!v.position || !v.product_id || !v.material_id) {
|
|
|
|
|
|
+ if (!v.position && !v.product_id) {
|
|
flag = true;
|
|
flag = true;
|
|
}
|
|
}
|
|
});
|
|
});
|
|
if (flag) {
|
|
if (flag) {
|
|
- this.handleTableAdd()
|
|
|
|
|
|
+ return;
|
|
|
|
+ } else {
|
|
|
|
+ this.handleTableAdd();
|
|
}
|
|
}
|
|
},
|
|
},
|
|
handleTableAdd() {
|
|
handleTableAdd() {
|
|
@@ -3673,6 +3698,7 @@ export default {
|
|
overdraft: [], //超标公式
|
|
overdraft: [], //超标公式
|
|
measure: this._measure, //测量字段数组
|
|
measure: this._measure, //测量字段数组
|
|
support_remark: this.support_remark, //备注列表
|
|
support_remark: this.support_remark, //备注列表
|
|
|
|
+ is_metal: false,
|
|
ext: [],
|
|
ext: [],
|
|
extArray: [
|
|
extArray: [
|
|
{
|
|
{
|
|
@@ -3701,6 +3727,7 @@ export default {
|
|
type: 1,
|
|
type: 1,
|
|
is_metal: true,
|
|
is_metal: true,
|
|
material_id: "",
|
|
material_id: "",
|
|
|
|
+ product_id: "",
|
|
title: "",
|
|
title: "",
|
|
price: 0,
|
|
price: 0,
|
|
single_price: 0,
|
|
single_price: 0,
|
|
@@ -4072,6 +4099,73 @@ export default {
|
|
this.handleCalcCount();
|
|
this.handleCalcCount();
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ handleSelectProductMetail(row, rowIndex, $event, scope) {
|
|
|
|
+ const arr = $event.tag.split("_");
|
|
|
|
+ let obj = {};
|
|
|
|
+ // 分类 1产品 2五金
|
|
|
|
+ if (arr[1] === "1") {
|
|
|
|
+ obj = {
|
|
|
|
+ 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 = {
|
|
|
|
+ type: 1,
|
|
|
|
+ is_metal: true,
|
|
|
|
+ material_id: "",
|
|
|
|
+ product_id: "",
|
|
|
|
+ title: "",
|
|
|
|
+ price: 0,
|
|
|
|
+ single_price: 0,
|
|
|
|
+ num: 0,
|
|
|
|
+ unit: "",
|
|
|
|
+ };
|
|
|
|
+ }
|
|
|
|
+ obj.product_id = $event.value;
|
|
|
|
+ this.tableData.splice(rowIndex, 1, obj);
|
|
|
|
+ if (arr[1] === "1") {
|
|
|
|
+ this.changeEditTableData(row, rowIndex, $event, scope);
|
|
|
|
+ } else {
|
|
|
|
+ this.changeEditMetal(row, rowIndex, $event, scope);
|
|
|
|
+ }
|
|
|
|
+ this.HandleAutoCreateNewLine();
|
|
|
|
+ },
|
|
changeEditTableData(row, rowIndex, $event, scope) {
|
|
changeEditTableData(row, rowIndex, $event, scope) {
|
|
if ($event) {
|
|
if ($event) {
|
|
let id = $event.value;
|
|
let id = $event.value;
|