|
@@ -196,6 +196,7 @@ export default {
|
|
|
// 是否完成询价,新增明细行需默认明细为false
|
|
|
// rowData['whetherCompleteInquiry'] = false;
|
|
|
rowData['delFlag'] = '0';
|
|
|
+ rowData['insertId'] = new Date().getTime();
|
|
|
|
|
|
this.params[key].push(rowData);
|
|
|
}
|
|
@@ -207,8 +208,8 @@ export default {
|
|
|
// prop.push(initParams(arr, "key", "value"));
|
|
|
},
|
|
|
// 删除行
|
|
|
- async delTableRow(prop, index) {
|
|
|
- console.log(prop,'prop');
|
|
|
+ async delTableRow(prop, row) {
|
|
|
+ console.log(row,'row---------------');
|
|
|
if(prop.length === 1){
|
|
|
this.$alert('订单行不允许为空', '提示', {
|
|
|
confirmButtonText: '确定',
|
|
@@ -225,10 +226,28 @@ export default {
|
|
|
for (const key in this.params) {
|
|
|
|
|
|
// if (Array.isArray(this.params[key])) {
|
|
|
+ // params[column.key].filter(item => item.delFlag === '0')
|
|
|
if (key === 'puOrderItemList' || key === 'puOrderExecuteList') {
|
|
|
+
|
|
|
+ this.params[key] = this.params[key].map(item =>{
|
|
|
+ if(item.id && item.id === row.id){
|
|
|
+ console.log('删除已有ID的');
|
|
|
+ item['delFlag'] = '2';
|
|
|
+ return item;
|
|
|
+ }else if(item.insertId && item.insertId === row.insertId){
|
|
|
+ console.log('新增的');
|
|
|
+ return ;
|
|
|
+ }else{
|
|
|
+ return item;
|
|
|
+ }
|
|
|
+ }).filter(item2 => item2 !== undefined)
|
|
|
+
|
|
|
+ // console.log(this.params[key]);
|
|
|
+ // this.params[key][index].id ?
|
|
|
+ // (this.params[key][index]['delFlag'] = '2') :
|
|
|
+ // this.params[key].splice(index, 1);
|
|
|
|
|
|
- this.params[key][index].id ? (this.params[key][index]['delFlag'] = '2') :this.params[key].splice(index, 1);
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -956,7 +975,7 @@ export default {
|
|
|
>
|
|
|
<!-- v-if="!handleIsRevise()" -->
|
|
|
<el-button
|
|
|
- @click.native.prevent="delTableRow(params[tabName], scope.$index)"
|
|
|
+ @click.native.prevent="delTableRow(params[tabName], scope.row)"
|
|
|
type="text"
|
|
|
size="small"
|
|
|
> 删行
|