From 42c64920b10cb5b421be08ccd2eccb05979d9fb3 Mon Sep 17 00:00:00 2001 From: 15386982806 Date: Fri, 5 Jan 2024 15:54:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E5=93=81=E8=A7=84=E6=A0=BC=E5=AD=97?= =?UTF-8?q?=E7=AC=A6=E9=95=BF=E5=BA=A6=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../goods/goods-seller/goodsOperationSec.vue | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) 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) {