浏览代码

客户详情-添加/编辑联系人,手机区号改为接口获取

cxmo 1 年之前
父节点
当前提交
b9ad12b24c
共有 1 个文件被更改,包括 15 次插入11 次删除
  1. 15 11
      src/views/custom_manage/compontents/Contactdialog.vue

+ 15 - 11
src/views/custom_manage/compontents/Contactdialog.vue

@@ -201,7 +201,7 @@
 
 <script>
 import { validateTel, validatePwd } from "@/utils/validate.js";
-import { customInterence } from "@/api/api.js";
+import { customInterence, departInterence } from "@/api/api.js";
 import { lang } from 'moment';
 export default {
   name: "",
@@ -276,16 +276,7 @@ export default {
       }
     };
     return {
-      telCodeArr: [
-        { value: '86', label: '+86' },
-        { value: '852', label: "+852" },
-        { value: '886', label: '+886' },
-        { value: '1', label: '+1' },
-        { value: '65', label: '+65' },
-        { value: '62', label: '+62' },
-        { value:'081',label: '+081' },
-        { value:'44',label: '+44' }
-      ],
+      telCodeArr: [],
 
       isHaveUser: false, //已存在联系人弹窗
       uploadloading: false,
@@ -329,6 +320,18 @@ export default {
     };
   },
   methods: {
+    getPhoneCode(){
+        departInterence.getPhoneAreaCode().then(res=>{
+            if(res.Ret!==200) return 
+            this.telCodeArr = res.Data||[]
+            this.telCodeArr = this.telCodeArr.map(i=>{
+                return {
+                    value:i.Value,
+                    label:i.Name
+                }
+            })
+        })
+    },
     // 领取自己的流失客户点击下一步
     handleNext() {
       this.$refs.userForm.validate((valid) => {
@@ -728,6 +731,7 @@ export default {
   },
   watch: {
     isAddContact() {
+        this.getPhoneCode()
       if (this.userForm.Source) {
         this.userFormIndeterminacy = this.userForm.Source
       } else {