选择商品弹窗优化

This commit is contained in:
Eratosici
2021-12-28 17:38:45 +08:00
parent c9b3aa1ee9
commit 77b4ece1f9

View File

@@ -51,8 +51,7 @@
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<span slot="footer">
<el-button type="primary"
@click="visible = false">取消</el-button>
<el-button @click="visible = false">取消</el-button>
<el-button type="primary"
@click="submitProds()">确定</el-button>
</span>
@@ -164,6 +163,15 @@ export default {
},
// 确定事件
submitProds () {
if (!this.dataListSelections.length) {
this.$message({
message: '请选择商品',
type: 'error',
duration: 1000,
onClose: () => {}
})
return
}
let prods = []
this.dataListSelections.forEach(item => {
let prodIndex = prods.findIndex((prod) => prod.prodId === item.prodId)