From acdff03246ce648082192dfb069c3a006a7fbee6 Mon Sep 17 00:00:00 2001
From: yangfeng <wanwan926_4@163.com>
Date: 星期三, 09 八月 2023 18:46:06 +0800
Subject: [PATCH] 客户管理模块 批量删除、推进、跟进接口联调

---
 src/views/client/client/AddClientManageDialog.vue |  128 ++++++++++++++++++++++++------------------
 1 files changed, 74 insertions(+), 54 deletions(-)

diff --git a/src/views/client/client/AddClientManageDialog.vue b/src/views/client/client/AddClientManageDialog.vue
index d586e99..7200b7d 100644
--- a/src/views/client/client/AddClientManageDialog.vue
+++ b/src/views/client/client/AddClientManageDialog.vue
@@ -5,6 +5,8 @@
       :visible.sync="editConfig.visible"
       :width="dialogWidth"
       :before-close="handleClose"
+      append-to-body
+      custom-class="iframe-dialog"
     >
       <el-form
         ref="form"
@@ -23,7 +25,7 @@
             <el-row>
               <el-col :span="12">
                 <el-form-item label="瀹㈡埛鍚嶇О" prop="name">
-                  <div class="client-name">
+                  <div class="custom-name">
                     <el-input v-model="editConfig.infomation.name"></el-input>
                     <div class="common-select-btn"><i class="el-icon-house" title="宸ュ晢鏌ヨ"></i></div>
                     <div class="common-select-btn"><i class="el-icon-search" title="鏌ラ噸"></i></div>
@@ -157,7 +159,12 @@
               </el-col>
               <el-col :span="12">
                 <el-form-item label="鑱旂郴浜烘墜鏈�" prop="contact_phone">
-                  <el-input v-model="editConfig.infomation.contact_phone"></el-input>
+                  <el-input
+                    v-model="editConfig.infomation.contact_phone"
+                    maxlength="11"
+                    show-word-limit
+                    oninput="value=value.replace(/[^\d]/g,'')"
+                  ></el-input>
                 </el-form-item>
               </el-col>
               <el-col :span="12">
@@ -470,7 +477,7 @@
       <div slot="footer" class="dialog-footer">
         <!-- <el-button type="primary" size="small" @click="editConfig.visible = false">淇濆苟鎻愪氦瀹℃壒</el-button> -->
         <el-button type="primary" size="small" @click="saveClick('form')">淇濆瓨</el-button>
-        <el-button size="small" @click="editConfig.visible = false">鍙栨秷</el-button>
+        <el-button size="small" @click="handleClose">鍙栨秷</el-button>
       </div>
     </el-dialog>
   </div>
@@ -487,6 +494,7 @@
         return {
           visible: false,
           title: "鏂板缓",
+          isSalesOpportunity: false,
           infomation: {}
         }
       }
@@ -506,7 +514,16 @@
         name: [{ required: true, message: "璇疯緭鍏ュ鎴峰悕绉�", trigger: "blur" }],
         client_status_id: [{ required: true, message: "璇烽�夋嫨瀹㈡埛鐘舵��", trigger: "change" }],
         member_id: [{ required: true, message: "璇烽�夋嫨閿�鍞礋璐d汉", trigger: "change" }],
-        approvalOpinion: [{ required: true, message: "璇疯緭鍏ュ鎵规剰瑙�", trigger: "blur" }]
+        approvalOpinion: [{ required: true, message: "璇疯緭鍏ュ鎵规剰瑙�", trigger: "blur" }],
+        contact_phone: [
+          { required: false, message: "", trigger: "blur" },
+          { len: 11, message: "闀垮害鍦�11涓瓧绗�", trigger: "blur" },
+          {
+            pattern: /^1(3\d|4[5-9]|5[0-35-9]|6[2567]|7[0-8]|8\d|9[0-35-9])\d{8}$/,
+            message: "璇疯緭鍏ユ纭殑鎵嬫満鍙�",
+            trigger: "blur"
+          }
+        ]
       },
       memberOptions: [],
       clientStatusOptions: [], // 瀹㈡埛鐘舵��
@@ -532,7 +549,6 @@
     getCommonData() {
       getAllData()
         .then((res) => {
-          console.log(res)
           this.memberOptions = res.data.member
           this.clientSourceOptions = res.data.client_origin
           this.clientStatusOptions = res.data.client_status
@@ -553,6 +569,9 @@
     },
     handleClose() {
       this.editConfig.visible = false
+      if (this.editConfig.title === "鏂板缓" && this.editConfig.infomation.sales_leads_id) {
+        this.$parent.handleClose()
+      }
     },
     // 淇濆瓨
     saveClick(formName) {
@@ -571,7 +590,13 @@
                     message: "娣诲姞鎴愬姛",
                     type: "success"
                   })
-                  this.$parent.getData()
+                  if (this.editConfig.isSalesOpportunity) {
+                    this.$emit("salesOpportunityClick", this.editConfig.infomation)
+                  } else if (this.editConfig.title === "鏂板缓" && this.editConfig.infomation.sales_leads_id) {
+                    this.$parent.handleClose()
+                  } else {
+                    this.$parent.getData()
+                  }
                 }
               })
               .catch((err) => {
@@ -643,7 +668,8 @@
         registration_time: data.registration_time || "",
         remark: data.remark || "",
         representative: data.representative || "",
-        service_member_id: data.service_member_id || 0
+        service_member_id: data.service_member_id || 0,
+        sales_leads_id: data.sales_leads_id || 0
       }
       return params
     },
@@ -663,62 +689,56 @@
 
 <!-- Add "scoped" attribute to limit CSS to this component only -->
 <style lang="scss" scoped>
-.add-client-manage {
-  .basic-info {
-    .basic-info-title {
-      background-color: #f4f8fe;
-      padding-left: 10px;
-      font-size: 15px;
-      font-weight: bold;
-      color: #666;
-      height: 42px;
-      line-height: 42px;
-    }
-    .basic-info-view {
-      margin-top: 10px;
-      padding-right: 40px;
-      .client-name {
-        display: flex;
-        .common-select-btn {
-          margin-left: 5px;
-          font-size: 18px;
+::v-deep {
+  .iframe-dialog .el-dialog__body {
+    .basic-info {
+      .basic-info-title {
+        background-color: #f4f8fe;
+        padding-left: 10px;
+        font-size: 15px;
+        font-weight: bold;
+        color: #666;
+        height: 42px;
+        line-height: 42px;
+      }
+      .basic-info-view {
+        margin-top: 10px;
+        padding-right: 40px;
+        .custom-name,
+        .common-select {
+          display: flex;
+          .common-select-btn {
+            margin-left: 5px;
+            font-size: 18px;
+            cursor: pointer;
+          }
+        }
+        .common-select {
+          .common-select-sel {
+            width: 270px;
+          }
         }
       }
-      .common-select {
+      .annex-view {
         display: flex;
-        .common-select-sel {
-          width: 270px;
-        }
-        .common-select-btn {
-          margin-left: 5px;
-          font-size: 16px;
-          cursor: pointer;
+        color: #6166d3;
+        .setFormat {
+          margin-left: 10px;
         }
       }
     }
-    // .address-view {
-    //   margin-top: 10px;
-    //   padding-right: 40px;
-    // }
-    .annex-view {
+    .unflod-collapse {
       display: flex;
+      height: 30px;
+      justify-content: center;
+      align-items: center;
       color: #6166d3;
-      .setFormat {
-        margin-left: 10px;
-      }
     }
-  }
-  .unflod-collapse {
-    display: flex;
-    height: 30px;
-    justify-content: center;
-    align-items: center;
-    color: #6166d3;
-  }
-  .dialog-footer {
-    background-color: #f5f5f5;
-    height: 55px;
-    line-height: 55px;
+    .dialog-footer {
+      background-color: #f5f5f5;
+      height: 55px;
+      line-height: 55px;
+    }
   }
 }
 </style>

--
Gitblit v1.8.0