From 6887629cbd7c09407d25a6199d8ddd878d17da4f Mon Sep 17 00:00:00 2001
From: haoxuan <haoxuan>
Date: 星期二, 24 十月 2023 17:50:11 +0800
Subject: [PATCH] 客户管理,跟进记录,线索,发票,合同管理,总单,报价单,退款单,明细单,机会,退货单,子单,客户服务单,服务合同,服务回访单连天

---
 src/views/client/followupRecords/AddFollowupRecordsDialog.vue |  154 +++++++++++++++++++++++++++++++--------------------
 1 files changed, 94 insertions(+), 60 deletions(-)

diff --git a/src/views/client/followupRecords/AddFollowupRecordsDialog.vue b/src/views/client/followupRecords/AddFollowupRecordsDialog.vue
index 3b5c634..5758864 100644
--- a/src/views/client/followupRecords/AddFollowupRecordsDialog.vue
+++ b/src/views/client/followupRecords/AddFollowupRecordsDialog.vue
@@ -24,12 +24,23 @@
             <el-row>
               <el-col :span="12" v-if="isUnflod">
                 <el-form-item label="璺熻繘璁板綍缂栧彿" prop="number">
-                  <WordInput
+                  <el-input
                     v-if="
-                      codenumer &&
-                      (explain != '' || isIdDisabled) &&
-                      method == 0
+                      editConfig.title == '缂栬緫' ||
+                      (editConfig.title == '鏂板缓' &&
+                        codenumer &&
+                        (explain != '' || isIdDisabled))
                     "
+                    :disabled="editConfig.title == '缂栬緫'"
+                    v-model="editConfig.infomation.number"
+                    placeholder="璇疯緭鍏ョ紪鐮�"
+                  >
+                  </el-input>
+                  <span  v-else-if="editConfig.title == '鏂板缓'" style="color: #f56c6c"
+                    >璇蜂紭鍏堥厤缃紪鐮佽鑼� <el-button type="text" @click="numberClick"> 閰嶇疆瑙勮寖 </el-button></span
+                  >
+                  <!-- <WordInput
+                    v-if="codenumer && (explain != '' || isIdDisabled) && method == 0"
                     :codenumer="codenumer"
                     :sum="sum"
                     :disabled="this.editConfig.title !== '鏂板缓' || isIdDisabled"
@@ -37,12 +48,9 @@
                     @codeList="codeList"
                   />
                   <span v-else-if="method == 0" style="color: #f56c6c"
-                    >璇蜂紭鍏堥厤缃紪鐮佽鑼�
-                    <el-button type="text" @click="numberClick">
-                      閰嶇疆瑙勮寖
-                    </el-button></span
+                    >璇蜂紭鍏堥厤缃紪鐮佽鑼� <el-button type="text" @click="numberClick"> 閰嶇疆瑙勮寖 </el-button></span
                   >
-                  <span v-else>鑷姩鐢熸垚</span>
+                  <span v-else>鑷姩鐢熸垚</span> -->
                 </el-form-item>
               </el-col>
               <el-col :span="12">
@@ -397,12 +405,11 @@
 import SelectContactDialog from "@/views/other/commonDialog/SelectContactDialog";
 import SelectChanceDialog from "@/views/other/commonDialog/SelectChanceDialog";
 import SelectLeadDialog from "@/views/other/commonDialog/SelectLeadDialog";
-import codeMixin from "./mixin/codeMixin";
-import { getContactList } from "@/api/client/contacts"
+import codeMixin from "@/components/makepager/mixin/codeMixin";
+import { getContactList } from "@/api/client/contacts";
 import { mapActions } from "vuex";
 import { getSaleChanceList } from "@/api/sales/salesOpportunity";
-import { getSalesLeadsList } from "@/api/client/salesLead"
-
+import { getSalesLeadsList } from "@/api/client/salesLead";
 
 export default {
   name: "AddFollowupRecordsDialog",
@@ -420,8 +427,8 @@
     },
     isDetail: {
       type: Boolean,
-      default: false
-    }
+      default: false,
+    },
   },
   components: {
     SelectClientDialog,
@@ -436,15 +443,15 @@
     clientList() {
       return this.$store.state.getClientName.clientList;
     },
-    contactNamelist() {
-      return this.$store.state.getClientName.contactNamelist;
-    },
+    // contactNamelist() {
+    //   return this.$store.state.getClientName.contactNamelist
+    // },
     // saleChancelist() {
     //   return this.$store.state.getClientName.saleChancelist
     // },
-    saleLeadlist() {
-      return this.$store.state.getClientName.saleLeadlist;
-    },
+    // saleLeadlist() {
+    //   return this.$store.state.getClientName.saleLeadlist
+    // }
   },
   data() {
     return {
@@ -452,7 +459,7 @@
       editConfig: this.editContactsConfig,
       rules: {
         number: [
-          { required: true, message: "璇疯緭鍏ヨ窡杩涜褰曠紪鍙�", trigger: "blur" },
+          { required: true, validator: this.validateCheckCode, trigger: ["blur",'change'] },
         ],
         member_id: [
           { required: true, message: "璇烽�夋嫨璐熻矗浜�", trigger: "change" },
@@ -461,7 +468,7 @@
           { required: true, message: "璇疯緭鍏ヨ窡杩涜褰�", trigger: "blur" },
         ],
         client_name: [
-          { required: true, message: "璇烽�夋嫨瀹㈡埛鍚嶇О", trigger: "change" },
+          { required: true, validator: this.checkClient, trigger: "change" },
         ],
         contact_name: [
           { required: true, message: "璇烽�夋嫨鑱旂郴浜哄鍚�", trigger: "change" },
@@ -498,19 +505,19 @@
         editVisible: false,
         title: "",
         infomation: {},
-        search_map:{}
+        search_map: {},
       },
       editSelectChanceConfig: {
         editVisible: false,
         title: "",
         infomation: {},
-        search_map:{},
+        search_map: {},
       },
       editSelectLeadConfig: {
         editVisible: false,
         title: "",
         infomation: {},
-        search_map:{},
+        search_map: {},
       },
       clientId: this.editContactsConfig.infomation.client_id,
       contactId: this.editContactsConfig.infomation.contact_id,
@@ -522,9 +529,9 @@
   },
   created() {
     this.$store.dispatch("geClient");
-    this.$store.dispatch("geContact");
+    // this.$store.dispatch("geContact")
     // this.$store.dispatch("geChance")
-    this.$store.dispatch("geLead");
+    // this.$store.dispatch("geLead")
     this.getCommonData();
     this.getContactInfoList();
     this.formInfo();
@@ -535,12 +542,9 @@
         this.formInfo();
       }
     },
-    "editContactsConfig.infomation.codeStandID"() {
-      this.formInfo();
-    },
   },
   methods: {
-    ...mapActions(["getContactFilter","getLeadFilter"]),
+    ...mapActions(["getContactFilter", "getLeadFilter"]),
     formInfo() {
       this.objCode.type = "璺熻繘璁板綍缂栫爜";
       this.objCode.codeStandID = "";
@@ -554,7 +558,7 @@
         console.log(res);
         this.clientStatusOptions = res.data.client_status;
         this.memberOptions = res.data.member;
-        this.dataProcess();
+        // this.dataProcess()
       });
     },
     async getContactInfoList() {
@@ -582,7 +586,6 @@
     // 淇濆瓨
     saveClick(formName) {
       this.$refs[formName].validate((valid) => {
-        this.validateFormNumber()
         if (valid) {
           const params = this.saveParams();
           if (this.editConfig.title === "鏂板缓") {
@@ -627,7 +630,6 @@
           sales_leads_id: this.saleLeadId || 0,
           topic: data.topic || "",
           codeStandID: data.ID,
-          codeRule: this.codeRule,
         },
       };
       let params = {};
@@ -676,32 +678,42 @@
         );
       };
     },
-    async handleSelectClient(value, item) {
-      if (value === "client") {
-        console.log(item,"item")
-        this.editSelectContactConfig.search_map.client_id=item.id
-        this.editSelectChanceConfig.search_map.client_id=item.id
-        this.editSelectLeadConfig.search_map.name=item.name
-        await getContactList({
-        search_map:{
-          client_id:item.id
+    // 鑱旂郴浜哄垪琛�
+    async getContactList(item) {
+      await getContactList({
+        search_map: {
+          client_id: item.id,
         },
         page: 1,
-        pageSize: 15
-        }).then((res) => {
-          if (res.code === 200) {
-            this.getContactFilter(res.data.list);
-          }
-        });
-        await getSalesLeadsList({
-          search_map:{
-            name:item.name
-          },
-        }).then((res) => {
-          if (res.code === 200) {
-            this.getLeadFilter(res.data.list);
-          }
-        });
+        pageSize: 15,
+      }).then((res) => {
+        if (res.code === 200) {
+          this.contactNamelist = res.data.list;
+        }
+      });
+    },
+    // 閿�鍞嚎绱�
+    async getSalesLeadsList(item) {
+      await getSalesLeadsList({
+        search_map: {
+          name: item.name,
+        },
+      }).then((res) => {
+        if (res.code === 200) {
+          this.saleLeadlist = res.data.list;
+        }
+      });
+    },
+    async handleSelectClient(value, item) {
+      if (value === "client") {
+        this.editConfig.infomation.contact_name = "";
+        this.editConfig.infomation.sales_leads_name = "";
+        this.editConfig.infomation.sale_chance_name = "";
+        this.editSelectContactConfig.search_map.client_id = item.id;
+        this.editSelectChanceConfig.search_map.client_id = item.id;
+        this.editSelectLeadConfig.search_map.name = item.name;
+        this.getContactList(item);
+        this.getSalesLeadsList(item);
         this.clientId = item.id;
         this.editConfig.infomation.client_name = item.name;
         this.isChance = false;
@@ -733,8 +745,16 @@
         this.editConfig.infomation.contact_name = row.name;
         this.contactId = row.id;
       } else if (value === "client") {
-        this.editConfig.infomation.client_name = row.name;
+        this.editConfig.infomation.contact_name = "";
+        this.editConfig.infomation.sales_leads_name = "";
+        this.editConfig.infomation.sale_chance_name = "";
+        this.editSelectContactConfig.search_map.client_id = row.id;
+        this.editSelectChanceConfig.search_map.client_id = row.id;
+        this.editSelectLeadConfig.search_map.name = row.name;
+        this.getContactList(row);
+        this.getSalesLeadsList(row);
         this.clientId = row.id;
+        this.editConfig.infomation.client_name = row.name;
         this.isChance = false;
         this.getChanceList(row.id);
       } else if (value === "chance") {
@@ -748,6 +768,9 @@
     // 娓呴櫎宸查�夋嫨鐢ㄦ埛
     clearupClient(value) {
       if (value === "client") {
+        this.editConfig.infomation.contact_name = "";
+        this.editConfig.infomation.sales_leads_name = "";
+        this.editConfig.infomation.sale_chance_name = "";
         this.editConfig.infomation.client_name = "";
         this.clientId = 0;
         this.isChance = true;
@@ -778,6 +801,17 @@
         this.isUnflod = true;
       }
     },
+    // 瀹㈡埛鍚嶇О鍗曠嫭鏍¢獙
+    checkClient(rule, value, callback) {
+      if (
+        this.editConfig.infomation.client_name &&
+        this.editConfig.infomation.client_name.length > 0
+      ) {
+        callback();
+      } else {
+        callback(new Error("璇烽�夋嫨瀹㈡埛鍚嶇О"));
+      }
+    },
   },
 };
 </script>

--
Gitblit v1.8.0