Browse Source

客户管理页面

lxf 1 year ago
parent
commit
bf8978a5d8

+ 57 - 73
src/views/customer/file/index.vue

@@ -162,27 +162,30 @@
 
     <el-dialog :title="modalType == 'add' ? '新增' : '编辑'" v-if="dialogVisible" v-model="dialogVisible" width="800" v-loading="loadingOperation">
       <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="submit">
-        <template #address>
+        <template #allAddress>
           <el-row style="width: 100%">
             <el-col :span="8">
               <el-form-item prop="countryId">
-                <el-select v-model="formData.data.countryId" placeholder="国家" @change="(val) => getCityData(val, '20', true)">
+                <el-select v-model="formData.data.countryId" placeholder="国家" filterable allow-create @change="(val) => getCityData(val, '20', true)">
                   <el-option v-for="item in countryData" :label="item.chineseName" :value="item.id"> </el-option>
                 </el-select>
               </el-form-item>
             </el-col>
             <el-col :span="8">
-              <el-form-item prop="provinceId">
-                <el-select v-model="formData.data.provinceId" placeholder="省/洲" filterable allow-create @change="(val) => getCityData(val, '30', true)">
-                  <el-option v-for="item in provinceData" :label="item.name" :value="item.id"> </el-option>
-                </el-select>
+              <el-form-item prop="provinceName">
+                <selectCity
+                  placeholder="省/洲"
+                  @change="(val) => getCityData(val, '30', true)"
+                  addressId="provinceId"
+                  addressName="provinceName"
+                  v-model="formData.data"
+                  :data="provinceData">
+                </selectCity>
               </el-form-item>
             </el-col>
             <el-col :span="8">
-              <el-form-item prop="cityId">
-                <el-select v-model="formData.data.cityId" filterable allow-create placeholder="城市">
-                  <el-option v-for="item in cityData" :label="item.name" :value="item.id"> </el-option>
-                </el-select>
+              <el-form-item prop="cityName">
+                <selectCity placeholder="城市" addressId="cityId" addressName="cityName" v-model="formData.data" :data="cityData"></selectCity>
               </el-form-item>
             </el-col>
           </el-row>
@@ -352,6 +355,7 @@ import byTable from "@/components/byTable/index";
 import byForm from "@/components/byForm/index";
 import { computed, ref } from "vue";
 import useUserStore from "@/store/modules/user";
+import selectCity from "@/components/selectCity/index.vue";
 
 const { proxy } = getCurrentInstance();
 const loading = ref(false);
@@ -586,21 +590,21 @@ const config = computed(() => {
     },
   ];
 });
-let modalType = ref("add");
-let dialogVisible = ref(false);
-let openFollow = ref(false);
-let formData = reactive({
+const modalType = ref("add");
+const dialogVisible = ref(false);
+const openFollow = ref(false);
+const formData = reactive({
   data: {
-    countryId: "China",
+    countryId: "44",
   },
 });
-let formPerson = reactive({
+const formPerson = reactive({
   data: {},
 });
-let formAllocation = reactive({
+const formAllocation = reactive({
   data: {},
 });
-let formFollow = reactive({
+const formFollow = reactive({
   data: {},
 });
 const formOption = reactive({
@@ -621,8 +625,7 @@ const formConfig = computed(() => {
     },
     {
       type: "slot",
-      slotName: "address",
-      prop: "countryId",
+      slotName: "allAddress",
       label: "详细地址",
     },
     {
@@ -673,13 +676,11 @@ const formConfig = computed(() => {
     },
   ];
 });
-let rules = ref({
+const rules = ref({
   name: [{ required: true, message: "请输入客户名称", trigger: "blur" }],
   name2: [{ required: true, message: "请输入联系人", trigger: "blur" }],
   email: [{ required: true, message: "请输入电子邮箱", trigger: "blur" }],
   countryId: [{ required: true, message: "请选择国家", trigger: "change" }],
-  provinceId: [{ required: true, message: "请选择省/州", trigger: "change" }],
-  cityId: [{ required: true, message: "请选择城市", trigger: "change" }],
   source: [{ required: true, message: "请选择客户来源", trigger: "change" }],
   status: [{ required: true, message: "请选择类型", trigger: "change" }],
 });
@@ -695,7 +696,7 @@ const formConfigAllocation = computed(() => {
     },
   ];
 });
-let rulesAllocation = ref({
+const rulesAllocation = ref({
   userId: [{ required: true, message: "请选择业务员", trigger: "change" }],
 });
 const formConfigAFollow = computed(() => {
@@ -722,13 +723,13 @@ const formConfigAFollow = computed(() => {
     },
   ];
 });
-let rulesPerson = ref({
+const rulesPerson = ref({
   name: [{ required: true, message: "请输入联系人", trigger: "blur" }],
   email: [{ required: true, message: "请输入电子邮箱", trigger: "blur" }],
   type: [{ required: true, message: "请选择类型", trigger: "change" }],
   contactNo: [{ required: true, message: "请输入联系号码", trigger: "blur" }],
 });
-let rulesFollow = ref({
+const rulesFollow = ref({
   date: [{ required: true, message: "请选择跟进时间", trigger: "change" }],
   content: [{ required: true, message: "请输入跟进内容", trigger: "blur" }],
 });
@@ -755,47 +756,24 @@ const getList = async (req) => {
     }, 200);
   });
 };
-const openModal = () => {
-  modalType.value = "add";
-  formData.data = {
-    countryId: "China",
-    tags: [],
-  };
-  getCityData(formData.data.countryId, "20");
-  loadingOperation.value = false;
-  dialogVisible.value = true;
-};
-const update = (row) => {
-  modalType.value = "edit";
-  loadingOperation.value = true;
-  proxy.post("/customer/detail", { id: row.id }).then((res) => {
-    if (res.tag) {
-      res.tags = res.tag.split(",");
-    } else {
-      res.tags = [];
-    }
-    formData.data = res;
-    getCityData(formData.data.countryId, "20");
-    getCityData(formData.data.provinceId, "30");
-    loadingOperation.value = false;
-  });
-  dialogVisible.value = true;
-};
 const countryData = ref([]);
 const provinceData = ref([]);
 const cityData = ref([]);
 const getCityData = (id, type, isChange) => {
-  proxy.post("/areaInfo/list", { parentId: id }).then((res) => {
+  proxy.post("/customizeArea/list", { parentId: id }).then((res) => {
     if (type === "20") {
       provinceData.value = res;
       if (isChange) {
         formData.data.provinceId = "";
+        formData.data.provinceName = "";
         formData.data.cityId = "";
+        formData.data.cityName = "";
       }
     } else if (type === "30") {
       cityData.value = res;
       if (isChange) {
         formData.data.cityId = "";
+        formData.data.cityName = "";
       }
     } else {
       countryData.value = res;
@@ -803,6 +781,16 @@ const getCityData = (id, type, isChange) => {
   });
 };
 getCityData("0");
+const openModal = () => {
+  modalType.value = "add";
+  formData.data = {
+    countryId: "44",
+    tags: [],
+  };
+  getCityData(formData.data.countryId, "20");
+  loadingOperation.value = false;
+  dialogVisible.value = true;
+};
 const clickAddPerson = () => {
   if (formData.data.customerUserList && formData.data.customerUserList.length > 0) {
     formData.data.customerUserList.push({
@@ -1036,26 +1024,6 @@ const recordShow = (item) => {
 const openFile = (path) => {
   window.open(path, "_blank");
 };
-const judgeWidth = (item, index) => {
-  if (item && item.id) {
-    let dom = document.querySelector(".getWidth" + item.id);
-    if (dom) {
-      let width = getComputedStyle(dom).width.replace("px", "");
-      let num = parseInt(width / 118);
-      let num2 = parseInt((width - 52) / 118);
-      if (num2 === num) {
-        if (index + 1 > num) {
-          return "display: none";
-        }
-      } else {
-        if (index + 1 >= num) {
-          return "display: none";
-        }
-      }
-    }
-  }
-  return "";
-};
 const recordList = ref([]);
 const rowData = ref({});
 const openRecordMore = ref(false);
@@ -1180,6 +1148,22 @@ const getNum = (val) => {
   }
   return num;
 };
+const update = (row) => {
+  modalType.value = "edit";
+  loadingOperation.value = true;
+  proxy.post("/customer/detail", { id: row.id }).then((res) => {
+    if (res.tag) {
+      res.tags = res.tag.split(",");
+    } else {
+      res.tags = [];
+    }
+    formData.data = res;
+    getCityData(formData.data.countryId, "20");
+    getCityData(formData.data.provinceId, "30");
+    loadingOperation.value = false;
+    dialogVisible.value = true;
+  });
+};
 </script>
 
 <style lang="scss" scoped>

+ 19 - 48
src/views/customer/highseas/index.vue

@@ -166,23 +166,26 @@
           <el-row style="width: 100%">
             <el-col :span="8">
               <el-form-item prop="countryId">
-                <el-select v-model="formData.data.countryId" placeholder="国家" @change="(val) => getCityData(val, '20', true)">
+                <el-select v-model="formData.data.countryId" placeholder="国家" filterable allow-create @change="(val) => getCityData(val, '20', true)">
                   <el-option v-for="item in countryData" :label="item.chineseName" :value="item.id"> </el-option>
                 </el-select>
               </el-form-item>
             </el-col>
             <el-col :span="8">
-              <el-form-item prop="provinceId">
-                <el-select v-model="formData.data.provinceId" placeholder="省/洲" filterable allow-create @change="(val) => getCityData(val, '30', true)">
-                  <el-option v-for="item in provinceData" :label="item.name" :value="item.id"> </el-option>
-                </el-select>
+              <el-form-item prop="provinceName">
+                <selectCity
+                  placeholder="省/洲"
+                  @change="(val) => getCityData(val, '30', true)"
+                  addressId="provinceId"
+                  addressName="provinceName"
+                  v-model="formData.data"
+                  :data="provinceData">
+                </selectCity>
               </el-form-item>
             </el-col>
             <el-col :span="8">
-              <el-form-item prop="cityId">
-                <el-select v-model="formData.data.cityId" filterable allow-create placeholder="城市">
-                  <el-option v-for="item in cityData" :label="item.name" :value="item.id"> </el-option>
-                </el-select>
+              <el-form-item prop="cityName">
+                <selectCity placeholder="城市" addressId="cityId" addressName="cityName" v-model="formData.data" :data="cityData"></selectCity>
               </el-form-item>
             </el-col>
           </el-row>
@@ -344,6 +347,7 @@ import byTable from "@/components/byTable/index";
 import byForm from "@/components/byForm/index";
 import { computed, ref } from "vue";
 import useUserStore from "@/store/modules/user";
+import selectCity from "@/components/selectCity/index.vue";
 
 const { proxy } = getCurrentInstance();
 const loading = ref(false);
@@ -557,7 +561,7 @@ let dialogVisible = ref(false);
 let openFollow = ref(false);
 let formData = reactive({
   data: {
-    countryId: "China",
+    countryId: "44",
   },
 });
 let formPerson = reactive({
@@ -706,44 +710,31 @@ const getList = async (req) => {
 const openModal = () => {
   modalType.value = "add";
   formData.data = {
-    countryId: "China",
+    countryId: "44",
     tags: [],
   };
   getCityData(formData.data.countryId, "20");
   loadingOperation.value = false;
   dialogVisible.value = true;
 };
-const update = (row) => {
-  modalType.value = "edit";
-  loadingOperation.value = true;
-  proxy.post("/customer/detail", { id: row.id }).then((res) => {
-    if (res.tag) {
-      res.tags = res.tag.split(",");
-    } else {
-      res.tags = [];
-    }
-    formData.data = res;
-    getCityData(formData.data.countryId, "20");
-    getCityData(formData.data.provinceId, "30");
-    loadingOperation.value = false;
-  });
-  dialogVisible.value = true;
-};
 const countryData = ref([]);
 const provinceData = ref([]);
 const cityData = ref([]);
 const getCityData = (id, type, isChange) => {
-  proxy.post("/areaInfo/list", { parentId: id }).then((res) => {
+  proxy.post("/customizeArea/list", { parentId: id }).then((res) => {
     if (type === "20") {
       provinceData.value = res;
       if (isChange) {
         formData.data.provinceId = "";
+        formData.data.provinceName = "";
         formData.data.cityId = "";
+        formData.data.cityName = "";
       }
     } else if (type === "30") {
       cityData.value = res;
       if (isChange) {
         formData.data.cityId = "";
+        formData.data.cityName = "";
       }
     } else {
       countryData.value = res;
@@ -971,26 +962,6 @@ const recordShow = (item) => {
 const openFile = (path) => {
   window.open(path, "_blank");
 };
-const judgeWidth = (item, index) => {
-  if (item && item.id) {
-    let dom = document.querySelector(".getWidth" + item.id);
-    if (dom) {
-      let width = getComputedStyle(dom).width.replace("px", "");
-      let num = parseInt(width / 118);
-      let num2 = parseInt((width - 52) / 118);
-      if (num2 === num) {
-        if (index + 1 > num) {
-          return "display: none";
-        }
-      } else {
-        if (index + 1 >= num) {
-          return "display: none";
-        }
-      }
-    }
-  }
-  return "";
-};
 const recordList = ref([]);
 const rowData = ref({});
 const openRecordMore = ref(false);

+ 19 - 12
src/views/customer/privatesea/index.vue

@@ -166,23 +166,26 @@
           <el-row style="width: 100%">
             <el-col :span="8">
               <el-form-item prop="countryId">
-                <el-select v-model="formData.data.countryId" placeholder="国家" @change="(val) => getCityData(val, '20', true)">
+                <el-select v-model="formData.data.countryId" placeholder="国家" filterable allow-create @change="(val) => getCityData(val, '20', true)">
                   <el-option v-for="item in countryData" :label="item.chineseName" :value="item.id"> </el-option>
                 </el-select>
               </el-form-item>
             </el-col>
             <el-col :span="8">
-              <el-form-item prop="provinceId">
-                <el-select v-model="formData.data.provinceId" placeholder="省/洲" filterable allow-create @change="(val) => getCityData(val, '30', true)">
-                  <el-option v-for="item in provinceData" :label="item.name" :value="item.id"> </el-option>
-                </el-select>
+              <el-form-item prop="provinceName">
+                <selectCity
+                  placeholder="省/洲"
+                  @change="(val) => getCityData(val, '30', true)"
+                  addressId="provinceId"
+                  addressName="provinceName"
+                  v-model="formData.data"
+                  :data="provinceData">
+                </selectCity>
               </el-form-item>
             </el-col>
             <el-col :span="8">
-              <el-form-item prop="cityId">
-                <el-select v-model="formData.data.cityId" filterable allow-create placeholder="城市">
-                  <el-option v-for="item in cityData" :label="item.name" :value="item.id"> </el-option>
-                </el-select>
+              <el-form-item prop="cityName">
+                <selectCity placeholder="城市" addressId="cityId" addressName="cityName" v-model="formData.data" :data="cityData"></selectCity>
               </el-form-item>
             </el-col>
           </el-row>
@@ -344,6 +347,7 @@ import byTable from "@/components/byTable/index";
 import byForm from "@/components/byForm/index";
 import { computed, ref } from "vue";
 import useUserStore from "@/store/modules/user";
+import selectCity from "@/components/selectCity/index.vue";
 
 const { proxy } = getCurrentInstance();
 const route = useRoute();
@@ -558,7 +562,7 @@ let dialogVisible = ref(false);
 let openFollow = ref(false);
 let formData = reactive({
   data: {
-    countryId: "China",
+    countryId: "44",
   },
 });
 let formPerson = reactive({
@@ -706,7 +710,7 @@ const getList = async (req) => {
 const openModal = () => {
   modalType.value = "add";
   formData.data = {
-    countryId: "China",
+    countryId: "44",
     userId: useUserStore().user.userId,
     tags: [],
   };
@@ -718,17 +722,20 @@ const countryData = ref([]);
 const provinceData = ref([]);
 const cityData = ref([]);
 const getCityData = (id, type, isChange) => {
-  proxy.post("/areaInfo/list", { parentId: id }).then((res) => {
+  proxy.post("/customizeArea/list", { parentId: id }).then((res) => {
     if (type === "20") {
       provinceData.value = res;
       if (isChange) {
         formData.data.provinceId = "";
+        formData.data.provinceName = "";
         formData.data.cityId = "";
+        formData.data.cityName = "";
       }
     } else if (type === "30") {
       cityData.value = res;
       if (isChange) {
         formData.data.cityId = "";
+        formData.data.cityName = "";
       }
     } else {
       countryData.value = res;

+ 3 - 0
src/views/publicModule/contractTemplate/index.vue

@@ -317,12 +317,15 @@ const getCityData = (id, type, isChange) => {
       provinceData.value = res;
       if (isChange) {
         formData.data.provinceId = "";
+        formData.data.provinceName = "";
         formData.data.cityId = "";
+        formData.data.cityName = "";
       }
     } else if (type === "30") {
       cityData.value = res;
       if (isChange) {
         formData.data.cityId = "";
+        formData.data.cityName = "";
       }
     } else {
       countryData.value = res;