|
@@ -35,11 +35,15 @@
|
|
|
<!-- <template v-else> {{ record.accountPrice }} </template> -->
|
|
|
</template>
|
|
|
<!-- 操作 -->
|
|
|
- <template slot="action" slot-scope="text, record">
|
|
|
+ <template slot="action" slot-scope="text,index, record">
|
|
|
<div class="editable-row-operations">
|
|
|
<span >
|
|
|
<!-- <a @click="() => save(record.id, record.accountPrice)" style="margin-right: 8px;">保存</a> -->
|
|
|
- <a-popconfirm title="确定要保存吗?" @confirm="() => save(record.id,record.advicePrice)">
|
|
|
+ <a-popconfirm title="确定要保存吗?" @confirm="() => save(record.id,record.advicePrice)" @cancel="cancel(record,index)">
|
|
|
+ <template slot="title">
|
|
|
+ <p> 保存</p>
|
|
|
+ <p> 取消 </p>
|
|
|
+ </template>
|
|
|
<a>保存</a>
|
|
|
</a-popconfirm>
|
|
|
</span>
|
|
@@ -83,6 +87,7 @@ export default {
|
|
|
this.loadData = res.data
|
|
|
this.loadData.forEach((item, index) => {
|
|
|
item.no = index + 1
|
|
|
+ item.currentValue = item.advicePrice
|
|
|
})
|
|
|
}
|
|
|
})
|
|
@@ -95,12 +100,14 @@ export default {
|
|
|
this.loadData = res.data
|
|
|
this.loadData.forEach((item, index) => {
|
|
|
item.no = index + 1
|
|
|
+ item.currentValue = item.advicePrice
|
|
|
})
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
// 改变回收价格
|
|
|
handleChange (value, id) {
|
|
|
+ console.log(value)
|
|
|
const newData = [...this.loadData]
|
|
|
const target = newData.filter(item => id === item.id)[0]
|
|
|
console.log(target, '-----------')
|
|
@@ -119,6 +126,7 @@ export default {
|
|
|
this.loadData = res.data
|
|
|
this.loadData.forEach((item, index) => {
|
|
|
item.no = index + 1
|
|
|
+ item.currentValue = item.advicePrice
|
|
|
})
|
|
|
}
|
|
|
})
|
|
@@ -126,6 +134,18 @@ export default {
|
|
|
this.$message.warning(res.message)
|
|
|
}
|
|
|
})
|
|
|
+ },
|
|
|
+ cancel (item, index) {
|
|
|
+ console.log(index, this.loadData, '------lllllllll')
|
|
|
+ if (item.currentValue) {
|
|
|
+ item.advicePrice = item.currentValue
|
|
|
+ } else {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ item.advicePrice = ''
|
|
|
+ this.loadData[index].advicePrice = ''
|
|
|
+ console.log(item.advicePrice, '-----pppppp')
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
}
|