|
@@ -99,9 +99,9 @@
|
|
|
<a-input v-model="record.endamount" placeholder="请输入结束量" ></a-input>
|
|
|
</a-form-model-item>
|
|
|
</template>
|
|
|
- <template slot="operation" slot-scope="text, record">
|
|
|
+ <template slot="operation" slot-scope="text, record, index">
|
|
|
<span>
|
|
|
- <a-popconfirm title="是否要删除此行?" @confirm="remove(record)">
|
|
|
+ <a-popconfirm title="是否要删除此行?" @confirm="remove(record, index)">
|
|
|
<a>删除</a>
|
|
|
</a-popconfirm>
|
|
|
</span>
|
|
@@ -567,17 +567,18 @@
|
|
|
console.log(this.model.data)
|
|
|
}
|
|
|
},
|
|
|
- remove(record) {
|
|
|
- if (record.id) {
|
|
|
- const key = record.id
|
|
|
- const newData = this.model.data.filter(item => item.id !== key)
|
|
|
- this.model.data = newData
|
|
|
- console.log(this.model.data)
|
|
|
- } else {
|
|
|
- const key = record.key
|
|
|
- const newData = this.model.data.filter(item => item.key !== key)
|
|
|
- this.model.data = newData
|
|
|
- }
|
|
|
+ remove(record, index) {
|
|
|
+ this.model.data.splice(index, 1)
|
|
|
+ // if (record.id) {
|
|
|
+ // const key = record.id
|
|
|
+ // const newData = this.model.data.filter(item => item.id !== key)
|
|
|
+ // this.model.data = newData
|
|
|
+ // console.log(this.model.data)
|
|
|
+ // } else {
|
|
|
+ // const key = record.key
|
|
|
+ // const newData = this.model.data.filter(item => item.key !== key)
|
|
|
+ // this.model.data = newData
|
|
|
+ // }
|
|
|
// console.log(key)
|
|
|
// const newData = this.model.data.filter(item => item.key !== key)
|
|
|
// this.model.data = newData
|