diff --git a/seller/src/views/goods/goods-seller/goodsOperationSec.vue b/seller/src/views/goods/goods-seller/goodsOperationSec.vue index 12ed8d09..0c1eeddd 100644 --- a/seller/src/views/goods/goods-seller/goodsOperationSec.vue +++ b/seller/src/views/goods/goods-seller/goodsOperationSec.vue @@ -1131,6 +1131,10 @@ export default { this.$Message.error("已存在相同规格项!"); return; } + if (this.zz(0, val) > 20) { + this.$Message.error("规格项最多十个字符长度!"); + return; + } this.skuTableData = this.skuTableData.map((e) => { e[val] = e[this.currentSkuItem]; delete e[this.currentSkuItem]; @@ -1139,6 +1143,18 @@ export default { this.currentSkuItem = val; this.renderTableData(this.skuTableData); }, + // 正则验证(中文超过10个英文数字超过20个) + zz(len, value) { + for(let i=0; i i[val.name] === val.value)) { @@ -1149,6 +1165,10 @@ export default { this.$Message.error("规格值不能为空!"); return; } + if (this.zz(0, val.value) > 20) { + this.$Message.error("规格值最多十个字符长度!"); + return; + } let curVal = this.currentSkuVal; this.skuTableData = this.skuTableData.map((e) => { if (e[val.name] === curVal) {