From 0a9160ff7f91d63b5d55a5abee8efe93b68d78dd Mon Sep 17 00:00:00 2001
From: LSH
Date: 星期三, 22 十一月 2023 15:18:05 +0800
Subject: [PATCH] #

---
 src/main/webapp/static/js/cstmr/cstmr2.js |   45 ++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 40 insertions(+), 5 deletions(-)

diff --git a/src/main/webapp/static/js/cstmr/cstmr2.js b/src/main/webapp/static/js/cstmr/cstmr2.js
index fe89e10..b116de5 100644
--- a/src/main/webapp/static/js/cstmr/cstmr2.js
+++ b/src/main/webapp/static/js/cstmr/cstmr2.js
@@ -59,7 +59,7 @@
                 case 1:
                     // 妯℃澘涓嬭浇
                     layer.load(1, {shade: [0.1,'#fff']});
-                    location.href = baseUrl + "/mould/鐢叉柟鍗曚綅瀵煎叆妯℃澘.xls";
+                    location.href = baseUrl + "/mould/瀹㈡埛淇℃伅瀵煎叆妯℃澘.xls";
                     layer.closeAll('loading');
                     break
                 case 2:
@@ -196,6 +196,19 @@
     });
 
     // 娣诲姞
+    $("#cstmrAddBtn1").click(function () {
+        form.verify({
+            account: function(value, item){
+                var min = item.getAttribute('lay-min');
+                if(value.length < min){
+                    return '瀹㈡埛鍚嶇О涓嶈兘灏忎簬'+min+'涓瓧绗︾殑闀垮害';
+                }
+            }
+        });
+        showEditModel2();
+    });
+
+    // 娣诲姞
     $("#cstmrAddBtn").click(function () {
         form.verify({
             account: function(value, item){
@@ -273,7 +286,7 @@
         admin.open({
             type: 1,
             area: '1500px',
-            title: (mData ? '淇敼' : '娣诲姞') + '鐢叉柟鍗曚綅',
+            title: (mData ? '淇敼' : '娣诲姞') + '瀹㈡埛淇℃伅',
             content: $('#editDialog').html(),
             success: function (layero, dIndex) {
                 let loadNameXml = loadNameXmlSel()
@@ -349,7 +362,7 @@
         admin.open({
             type: 1,
             area: '1500px',
-            title: (mData ? '淇敼' : '娣诲姞') + '鐢叉柟鍗曚綅',
+            title: (mData ? '淇敼' : '娣诲姞') + '瀹㈡埛淇℃伅',
             content: $('#editDialog2').html(),
             success: function (layero, dIndex) {
                 let loadNameXml = loadNameXmlSel2()
@@ -395,7 +408,7 @@
                     }
                     var loadIndex = layer.load(2);
                     $.ajax({
-                        url: baseUrl+"/cstmr/"+(mData?'update':'add')+"/auth",
+                        url: baseUrl+"/cstmr/"+(mData?'update':'add2')+"/auth",
                         headers: {'token': localStorage.getItem('token')},
                         data: data.field,
                         method: 'POST',
@@ -552,7 +565,7 @@
             radio: true,
             remoteMethod: function (val, cb, show) {
                 $.ajax({
-                    url: baseUrl + "/cstmr2/all/get/kv",
+                    url: baseUrl + "/cstmrSearch/auth",
                     headers: {'token': localStorage.getItem('token')},
                     data: {
                         condition: val
@@ -568,6 +581,28 @@
                     }
                 });
             },
+            on: function (data) {
+                console.log(data)
+                let arr = data.arr
+                let change = data.change;
+                if (arr.length > 0 && change.length>0) {
+                    let name = arr[0].name;
+                    $.ajax({
+                        url: baseUrl + "/cstmr/name/check/auth",
+                        headers: {'token': localStorage.getItem('token')},
+                        data: {
+                            name: name
+                        },
+                        method: 'POST',
+                        success: function (res) {
+                            if (res.code === 200) {
+                            } else {
+                                layer.msg(res.msg, {icon: 2});
+                            }
+                        }
+                    });
+                }
+            }
         });
     }
 

--
Gitblit v1.9.1