Procházet zdrojové kódy

修改 网上受理提交工单的验证;

fanlongfei %!s(int64=7) %!d(string=před) roky
rodič
revize
1b2a48f3e1
2 změnil soubory, kde provedl 17 přidání a 11 odebrání
  1. 16 10
      WebSite/js/shouli.js
  2. 1 1
      WebSite/tousu.html

+ 16 - 10
WebSite/js/shouli.js

@@ -39,26 +39,26 @@ $(document).ready(function () {
39 39
         var type = $('#xxlb').val(); //信息类别ID
40 40
         var keys = $('#keys').val(); //主题词
41 41
         var isprotect = $("input[name='secret']:checked").val(); //(0保密1公开)
42
-        if (!cusname) {
42
+        if (!$.trim(cusname)) {
43 43
             layer.confirm('请输入姓名!', {
44 44
                 btn: ['确定']
45 45
             });
46 46
             return;
47 47
         }
48
-        if (!cusphone) {
48
+        if (!$.trim(cusphone)) {
49 49
             layer.confirm('请输入联系电话!', {
50 50
                 btn: ['确定']
51 51
             });
52 52
             return;
53 53
         }
54
-        if (!myreg.test(cusphone)) {
54
+        if (!myreg.test($.trim(cusphone))) {
55 55
             layer.confirm('联系电话格式不正确!', {
56 56
                 btn: ['确定']
57 57
             });
58 58
             return;
59 59
         }
60 60
         if (email) {
61
-            if (!reg.test(email)) {
61
+            if (!reg.test($.trim(email))) {
62 62
                 layer.confirm('邮箱格式不正确!', {
63 63
                     btn: ['确定']
64 64
                 });
@@ -66,26 +66,26 @@ $(document).ready(function () {
66 66
             }
67 67
         }
68 68
         if (zipcode) {
69
-            if (!/^[0-9][0-9]{5}$/.test(zipcode)) {
70
-                layer.confirm('邮编格式不正确!', {
69
+            if (!/^[0-9][0-9]{5}$/.test($.trim(zipcode))) {
70
+                layer.confirm('邮编格式不正确!', {
71 71
                     btn: ['确定']
72 72
                 });
73 73
                 return;
74 74
             }
75 75
         }
76
-        if (!touSuphone) {
76
+        if (!$.trim(touSuphone)) {
77 77
             layer.confirm('请输入投诉电话!', {
78 78
                 btn: ['确定']
79 79
             });
80 80
             return;
81 81
         }
82
-        if (!/^[0-9]*$/.test(touSuphone)) {
82
+        if (!/^[0-9]*$/.test($.trim(touSuphone))) {
83 83
             layer.confirm('投诉电话格式不正确!', {
84 84
                 btn: ['确定']
85 85
             });
86 86
             return;
87 87
         }
88
-        if (!title) {
88
+        if (!$.trim(title)) {
89 89
             layer.confirm('请输入主题!', {
90 90
                 btn: ['确定']
91 91
             });
@@ -97,7 +97,7 @@ $(document).ready(function () {
97 97
             });
98 98
             return;
99 99
         }
100
-        if (!content) {
100
+        if (!$.trim(content)) {
101 101
             layer.confirm('请输入内容!', {
102 102
                 btn: ['确定']
103 103
             });
@@ -109,6 +109,12 @@ $(document).ready(function () {
109 109
             });
110 110
             return;
111 111
         }
112
+        if (!$.trim(sourceaddress)) {
113
+            layer.confirm('请输入详细地址!', {
114
+                btn: ['确定']
115
+            });
116
+            return;
117
+        }
112 118
         $.post(huayi.config.callcenter_url + 'web/AddWebWorkOrder', {
113 119
             cusname: cusname,
114 120
             cussex: cussex,

+ 1 - 1
WebSite/tousu.html

@@ -352,7 +352,7 @@
352 352
                                             </td>
353 353
                                         </tr>
354 354
                                         <tr>
355
-                                            <td>事件地址:</td>
355
+                                            <td><i class="must">*</i>事件地址:</td>
356 356
                                             <td colspan="3">
357 357
                                                 <select name="" id="sourcearea"></select>
358 358
                                                 <input type="text" id="sourceaddress" placeholder="请输入详细地址..." />