Commit e25d2ff3 by LJM

打包箱号不能重复

parent 45a6858f
Showing with 11 additions and 0 deletions
......@@ -1355,6 +1355,17 @@
return false;
}
// 使用 Set 和 Array.prototype.map() 来获取所有 box_name 的集合
const boxNames = new Set(this.packList.map(item => item.box_name));
// 如果 Set 的大小不等于原始数组长度,则表示有重复的 box_name
if (boxNames.size !== this.packList.length) {
uni.showToast({
title: '打包箱号不能重复',
icon: 'none'
});
return false;
}
this.request(API.updatePackInfo, 'POST', parmas, true).then(res => {
if (res.code === 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment