From 06d6b563f01636476c48aae5cbb01f06b24c0e36 Mon Sep 17 00:00:00 2001
From: whycq <10027870+whycq@user.noreply.gitee.com>
Date: 星期五, 21 七月 2023 11:03:28 +0800
Subject: [PATCH] # 客户名称长度限制

---
 src/main/webapp/static/js/cstmr/cstmr.js |   16 ++++++++++++++++
 src/main/webapp/views/cstmr/cstmr.html   |    2 +-
 2 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/src/main/webapp/static/js/cstmr/cstmr.js b/src/main/webapp/static/js/cstmr/cstmr.js
index d53d7a0..6a19a12 100644
--- a/src/main/webapp/static/js/cstmr/cstmr.js
+++ b/src/main/webapp/static/js/cstmr/cstmr.js
@@ -193,6 +193,14 @@
 
     // 娣诲姞
     $("#cstmrAddBtn").click(function () {
+        form.verify({
+            account: function(value, item){
+                var min = item.getAttribute('lay-min');
+                if(value.length < min){
+                    return '瀹㈡埛鍚嶇О涓嶈兘灏忎簬'+min+'涓瓧绗︾殑闀垮害';
+                }
+            }
+        });
         showEditModel();
     });
 
@@ -255,6 +263,14 @@
             title: (mData ? '淇敼' : '娣诲姞') + '鐢叉柟鍗曚綅',
             content: $('#editDialog').html(),
             success: function (layero, dIndex) {
+                form.verify({
+                    name: function(value, item){
+                        var min = item.getAttribute('lay-min');
+                        if(value.length < min){
+                            return '瀹㈡埛鍚嶇О涓嶈兘灏忎簬'+min+'涓瓧绗︾殑闀垮害';
+                        }
+                    }
+                });
                 if (mData) {
                     $('#cascaderVal').val(mData.pcd);
                 }
diff --git a/src/main/webapp/views/cstmr/cstmr.html b/src/main/webapp/views/cstmr/cstmr.html
index 5e568c4..528876d 100644
--- a/src/main/webapp/views/cstmr/cstmr.html
+++ b/src/main/webapp/views/cstmr/cstmr.html
@@ -117,7 +117,7 @@
                 <div class="layui-form-item">
                     <label class="layui-form-label layui-form-required">瀹㈡埛鍚嶇О: </label>
                     <div class="layui-input-block">
-                        <input class="layui-input" name="name" placeholder="璇疯緭鍏ュ鎴峰悕绉�" lay-vertype="tips" lay-verify="required" autocomplete="off">
+                        <input class="layui-input" name="name" placeholder="璇疯緭鍏ュ鎴峰悕绉�" lay-vertype="tips" lay-verify="required|name" lay-min="8" autocomplete="off">
                     </div>
                 </div>
                 <div class="layui-form-item">

--
Gitblit v1.9.1