From 88d56c7c74be121a11e3760e4fc7a058ea2f6c47 Mon Sep 17 00:00:00 2001
From: nickchange <126672920+nickchange@users.noreply.github.com>
Date: 星期四, 26 十月 2023 10:45:30 +0800
Subject: [PATCH] 10.26.2

---
 cloud-server-management/src/main/webapp/static/modular/system/tShop/tShop_info.js |   58 +++++++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 55 insertions(+), 3 deletions(-)

diff --git a/cloud-server-management/src/main/webapp/static/modular/system/tShop/tShop_info.js b/cloud-server-management/src/main/webapp/static/modular/system/tShop/tShop_info.js
index dc85985..d8fd5ba 100644
--- a/cloud-server-management/src/main/webapp/static/modular/system/tShop/tShop_info.js
+++ b/cloud-server-management/src/main/webapp/static/modular/system/tShop/tShop_info.js
@@ -148,6 +148,8 @@
     var ajax = new $ax(Feng.ctxPath + "/tShop/saveImg", function(data){
         if(data.code == 200){
             Feng.success("保存成功")
+            TCarInfoDlg.close();
+
         }
     });
     ajax.set("id",id);
@@ -159,6 +161,17 @@
  * 提交添加
  */
 TCarInfoDlg.addSubmit = function() {
+
+    const textarea = document.getElementById('introduce');
+    const text = textarea.value;
+
+    if (text.length > 1000) {
+        console.log('The text is longer than 1000 characters.');
+        Feng.error("门店介绍要求小于1000字")
+        return
+    } else {
+        console.log('The text is not longer than 1000 characters.');
+    }
 
     this.clearData();
     this.collectData();
@@ -203,6 +216,12 @@
         Feng.info("门店名称不能为空")
         return;
     }
+
+    var phonePattern = /^1[3-9]\d{9}$/;
+    if (!phonePattern.test(phone)) {
+        Feng.info("请输入合法手机号")
+        return ;
+    }
     if(phone==''){
         Feng.info("联系电话不能为空")
         return;
@@ -232,7 +251,15 @@
         Feng.info("请输入店长姓名")
         return;
     }
+
+
     let userPhone = $("#userPhone").val()
+    if (!phonePattern.test(userPhone)) {
+
+        Feng.info("请输入正确手机号")
+        return false;
+    }
+
 
     if(userPhone==''){
         Feng.info("请输入店长手机号")
@@ -278,7 +305,7 @@
         }
 
     },function(data){
-        Feng.error("添加失败!" + data.responseJSON.message + "!");
+
     });
     ajax.set(this.tCarInfoData);
     ajax.set("provinceCode",pCode);
@@ -404,6 +431,17 @@
  */
 TCarInfoDlg.editSubmit = function() {
 
+    const textarea = document.getElementById('introduce');
+    const text = textarea.value;
+
+    if (text.length > 1000) {
+        console.log('The text is longer than 1000 characters.');
+        Feng.error("门店介绍要求小于1000字")
+        return
+    } else {
+        console.log('The text is not longer than 1000 characters.');
+    }
+
     this.clearData();
     this.collectData();
     if(!this.validate()){
@@ -446,6 +484,13 @@
         Feng.info("门店名称不能为空")
         return;
     }
+
+    var phonePattern = /^1[3-9]\d{9}$/;
+    if (!phonePattern.test(phone)) {
+        Feng.info("请输入合法手机号")
+        return ;
+    }
+
     if(phone==''){
         Feng.info("联系电话不能为空")
         return;
@@ -477,6 +522,11 @@
     }
     let userPhone = $("#userPhone").val()
 
+    if (!phonePattern.test(userPhone)) {
+        Feng.info("请输入合法手机号")
+        return ;
+    }
+
     if(userPhone==''){
         Feng.info("请输入店长手机号")
         return;
@@ -498,6 +548,8 @@
         }
 
     }
+
+
     //提交信息
     var ajax = new $ax(Feng.ctxPath + "/tShop/update", function(data){
         if(data=="5001"){
@@ -765,7 +817,7 @@
                 var content='<option value="">Pilih franchisee Anda</option>';
             }
             $.each(data, function(k,v) {
-                content += "<option value='"+v.id+"'>"+v.name+"</option>";
+                content += "<option value='"+v.code+"'>"+v.name+"</option>";
             });
             $("#pCode").empty().append(content);
         }
@@ -807,7 +859,7 @@
                 var content='<option value="">Pilih franchisee Anda</option>';
             }
             $.each(data, function(k,v) {
-                content += "<option value='"+v.id+"'>"+v.name+"</option>";
+                content += "<option value='"+v.code+"'>"+v.name+"</option>";
             });
             $("#cCode").empty().append(content);
         }

--
Gitblit v1.7.1