瀏覽代碼

新建编辑线索客户名称或者企业名称必须要填写一个

xiaohaizhao 2 年之前
父節點
當前提交
3725d4f65f
共有 3 個文件被更改,包括 36 次插入44 次删除
  1. 12 14
      packageA/publicClue/addClue.js
  2. 12 14
      packageA/saleAdmin/insert.js
  3. 12 16
      packageA/saleClue/addClue.js

+ 12 - 14
packageA/publicClue/addClue.js

@@ -25,7 +25,7 @@ Page({
             placeholder: "联系人",
             valueName: "name",
             checking: "base",
-            required: false
+            required: true
         }, {
             label: "手机号码",
             error: false,
@@ -326,29 +326,27 @@ Page({
         }
     },
     submit() {
-        this.setData({
-            loading: true
-        })
         let content = {
             ...this.data.content,
             ...this.selectComponent("#Form").submit()
         };
-        if (content.scale.length != 0 && content.scale == 0) {
-            this.setData({
-                loading: false
-            })
-            wx.showToast({
-                title: '项目规模不可为0',
-                icon: "none"
-            })
-            return;
-        }
         content.sat_campaignid = content.campaign_name ? content.campaign_name[1][0] : 0;
         content.city = content.region[1] || "";
         content.county = content.region[2] || "";
         content.province = content.region[0] || "";
         delete(content.region)
         delete(content.campaign_name)
+        if (content.enterprisename == "" && content.projectname == "") return wx.showToast({
+            title: '客户名称或项目名称为空,请完善信息',
+            icon: "none"
+        });
+        if (content.scale.length != 0 && content.scale == 0) return wx.showToast({
+            title: '项目规模不可为0',
+            icon: "none"
+        })
+        this.setData({
+            loading: true
+        })
         _Http.basic({
             "id": "20221205162402",
             content

+ 12 - 14
packageA/saleAdmin/insert.js

@@ -44,7 +44,7 @@ Page({
                 placeholder: "联系人",
                 valueName: "name",
                 checking: "base",
-                required: false
+                required: true
             }, {
                 label: "联系方式",
                 error: false,
@@ -551,9 +551,6 @@ Page({
         }
     },
     submit() {
-        this.setData({
-            loading: true
-        })
         let content = this.selectComponent("#Form").submit();
         content.sat_orderclueid = sat_orderclueid;
         content.isprivate = 0; //0表示公海,1表示私域
@@ -566,16 +563,17 @@ Page({
         content.province = content.region[0] || "";
         delete(content.region)
         delete(content.campaign_name)
-        if (content.scale.length != 0 && content.scale == 0) {
-            this.setData({
-                loading: false
-            })
-            wx.showToast({
-                title: '项目规模不可为0',
-                icon: "none"
-            })
-            return;
-        }
+        if (content.enterprisename == "" && content.projectname == "") return wx.showToast({
+            title: '客户名称或项目名称为空,请完善信息',
+            icon: "none"
+        });
+        if (content.scale.length != 0 && content.scale == 0) return wx.showToast({
+            title: '项目规模不可为0',
+            icon: "none"
+        })
+        this.setData({
+            loading: true
+        })
         _Http.basic({
             "id": "20221205162402",
             content

+ 12 - 16
packageA/saleClue/addClue.js

@@ -25,7 +25,7 @@ Page({
                 placeholder: "联系人",
                 valueName: "name",
                 checking: "base",
-                required: false
+                required: true
             }, {
                 label: "联系方式",
                 error: false,
@@ -305,31 +305,27 @@ Page({
         }
     },
     submit() {
-        this.setData({
-            loading: true
-        })
         let content = {
             ...this.data.content,
             ...this.selectComponent("#Form").submit()
         };
-
-        if (content.scale.length != 0 && content.scale == 0) {
-            this.setData({
-                loading: false
-            })
-            wx.showToast({
-                title: '项目规模不可为0',
-                icon: "none"
-            })
-            return;
-        }
-
         content.sat_campaignid = content.campaign_name ? content.campaign_name[1][0] : 0;
         content.city = content.region[1] || "";
         content.county = content.region[2] || "";
         content.province = content.region[0] || "";
         delete(content.region)
         delete(content.campaign_name)
+        if (content.enterprisename == "" && content.projectname == "") return wx.showToast({
+            title: '客户名称或项目名称为空,请完善信息',
+            icon: "none"
+        });
+        if (content.scale.length != 0 && content.scale == 0) return wx.showToast({
+            title: '项目规模不可为0',
+            icon: "none"
+        })
+        this.setData({
+            loading: true
+        })
         _Http.basic({
             "id": "20221205162402",
             content