|
@@ -52,10 +52,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
</el-row>
|
|
</el-row>
|
|
|
|
|
|
|
|
|
|
|
|
@@ -127,7 +123,7 @@
|
|
|
<el-row>
|
|
<el-row>
|
|
|
|
|
|
|
|
<div class="ele-body">
|
|
<div class="ele-body">
|
|
|
- <ele-pro-table ref="table" :datasource="bomItem.materialList" :columns="columns">
|
|
|
|
|
|
|
+ <ele-pro-table ref="table" :datasource="bomItem.materialList" row-key="id" :columns="columns">
|
|
|
<!-- 表头工具栏 -->
|
|
<!-- 表头工具栏 -->
|
|
|
<template v-slot:toolbar>
|
|
<template v-slot:toolbar>
|
|
|
<el-button size="small" icon="el-icon-plus" class="ele-btn-icon" type="primary"
|
|
<el-button size="small" icon="el-icon-plus" class="ele-btn-icon" type="primary"
|
|
@@ -136,7 +132,7 @@
|
|
|
|
|
|
|
|
<!-- 操作列 -->
|
|
<!-- 操作列 -->
|
|
|
<template v-slot:action="{ row }">
|
|
<template v-slot:action="{ row }">
|
|
|
- <el-popconfirm class="ele-action" title="确定要删除当前物料吗?" @confirm="remove(row)">
|
|
|
|
|
|
|
+ <el-popconfirm class="ele-action" title="确定要删除当前物料吗?" @confirm="remove(index,row)">
|
|
|
<template v-slot:reference>
|
|
<template v-slot:reference>
|
|
|
<el-link type="danger" :underline="false" icon="el-icon-delete">
|
|
<el-link type="danger" :underline="false" icon="el-icon-delete">
|
|
|
删除
|
|
删除
|
|
@@ -308,13 +304,14 @@ export default {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- openParam() {
|
|
|
|
|
- this.tableData = this.$refs.table.getData()
|
|
|
|
|
- this.$refs.materiaRef.open(this.tableData, '选择物料', '1')
|
|
|
|
|
|
|
+ openParam(index) {
|
|
|
|
|
+ this.tableData = this.form.list[index].materialList
|
|
|
|
|
+ this.$refs.materiaRef.open(this.tableData, '选择物料', '1', index)
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
- chooseModal(data) {
|
|
|
|
|
- this.$refs.table.setData([...data, ...this.$refs.table.getData()]);
|
|
|
|
|
|
|
+ chooseModal(data, id, idx) {
|
|
|
|
|
+ this.$set(this.form.list[idx], 'materialList', data)
|
|
|
|
|
+
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
chooseBom(index) {
|
|
chooseBom(index) {
|
|
@@ -329,13 +326,9 @@ export default {
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
/* 删除 */
|
|
/* 删除 */
|
|
|
- remove(row) {
|
|
|
|
|
- const data = this.$refs.table.getData() ?? [];
|
|
|
|
|
- if (row.id) {
|
|
|
|
|
- this.removeList.push(row.id);
|
|
|
|
|
- this.$refs.table.setData(data.filter((d) => d.id !== row.id));
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
|
|
+ remove(index,row) {
|
|
|
|
|
+ console.log(row)
|
|
|
|
|
+ this.form.list[index].materialList = this.form.list[index].materialList.filter((d) => d.id !== row.id)
|
|
|
|
|
|
|
|
},
|
|
},
|
|
|
|
|
|