Browse Source

客户添加弹窗封装成组件

cz 1 year ago
parent
commit
b84e9d3689

+ 1 - 0
package.json

@@ -26,6 +26,7 @@
     "@antv/x6-plugin-stencil": "^2.0.2",
     "@antv/x6-plugin-transform": "^2.1.6",
     "@antv/x6-vue-shape": "^2.0.11",
+    "@imengyu/vue3-context-menu": "^1.3.5",
     "@tinymce/tinymce-vue": "^5.1.0",
     "@vue-flow/additional-components": "^1.3.3",
     "@vue-flow/core": "^1.18.2",

+ 174 - 139
src/components/headerBar/header-bar.vue

@@ -3,92 +3,48 @@
     <header>
       <ul class="nav">
         <!-- <div class="logo">尔泓时代</div> -->
-        <div
-          class="logo"
-          style="display: flex; align-items: center; justify-content: center"
-        >
+        <div class="logo" style="display: flex; align-items: center; justify-content: center">
           <img v-if="!logoUrl" :src="'/img/logo2.png'" />
-          <el-image
-            v-else
-            style="width: 120px; height: 30px"
-            :src="logoUrl"
-            fit="scale-down"
-          />
+          <el-image v-else style="width: 120px; height: 30px" :src="logoUrl" fit="scale-down" />
         </div>
-        <li
-          class="header-bar-hover-warp nav-li"
-          :class="isChildMenu ? 'active' : ''"
-        >
+        <li class="header-bar-hover-warp nav-li" :class="isChildMenu ? 'active' : ''">
           <div @click.stop="isChildMenu = !isChildMenu" class="menu-modal">
-            <i
-              class="iconfont icon-icomx_gongndh"
-              style="margin: 0 5px 0 0"
-            ></i>
+            <i class="iconfont icon-icomx_gongndh" style="margin: 0 5px 0 0"></i>
             {{ $t("header.functionGuide") }}
-            <i
-              class="iconfont icon-iconm_xialan1"
-              style="margin: 0 0 0 3px"
-            ></i>
+            <i class="iconfont icon-iconm_xialan1" style="margin: 0 0 0 3px"></i>
           </div>
         </li>
         <div class="auto-list">
-          <li
-            class="nav-li"
-            @click="commonsBannerToRouter(i)"
-            v-for="(i, index) in commonsRouterList"
-            v-show="index < autoListChidrenNum - 1"
-            :key="i.id"
-          >
+          <li class="nav-li" @click="commonsBannerToRouter(i)" v-for="(i, index) in commonsRouterList" v-show="index < autoListChidrenNum - 1"
+              :key="i.id">
             <span>{{ i.menuName }}</span>
           </li>
-          <li
-            class="nav-li more-box"
-            v-show="commonsRouterList.length > autoListChidrenNum - 1"
-          >
+          <li class="nav-li more-box" v-show="commonsRouterList.length > autoListChidrenNum - 1">
             {{ $t("header.more") }}
             <i class="iconfont icon-iconm_xialan1"></i>
             <ul class="more-list">
-              <li
-                v-for="(i, index) in commonsRouterList"
-                v-show="index >= autoListChidrenNum - 1"
-                :key="i.id"
-              >
+              <li v-for="(i, index) in commonsRouterList" v-show="index >= autoListChidrenNum - 1" :key="i.id">
                 <span @click="commonsBannerToRouter(i)">{{ i.menuName }}</span>
               </li>
             </ul>
           </li>
         </div>
-        <div
-          class="header-bar-warp"
-          v-if="isChildMenu"
-          @click.stop="isChildMenu = false"
-        >
+        <div class="header-bar-warp" v-if="isChildMenu" @click.stop="isChildMenu = false">
           <div class="header-bar-hover" @click.stop>
             <div class="header-bar-hover-content">
               <div class="left-banner">
                 <!-- :style="leftBanerType == 2 ? 'color:#0084ff' : ''" -->
                 <div class="first-order" @click="leftBanerType = 2">
-                  <i
-                    class="iconfont icon-iconm_changycd"
-                    style="position: relative; top: -1px"
-                  ></i>
+                  <i class="iconfont icon-iconm_changycd" style="position: relative; top: -1px"></i>
                   {{ $t("header.commonFunctions") }}
                 </div>
                 <div class="first-order">
-                  <i
-                    class="iconfont icon-iconm_gongncd"
-                    style="position: relative; top: -1px"
-                  ></i>
+                  <i class="iconfont icon-iconm_gongncd" style="position: relative; top: -1px"></i>
                   {{ $t("header.functionMenu") }}
                 </div>
                 <ul>
-                  <li
-                    :class="menuName == i.menuName ? 'active' : ''"
-                    @click="openLeftBaner(i, index)"
-                    v-for="(i, index) in sidebarRoutersCopy"
-                    :key="i.name"
-                    v-show="i.type == 1 && i.status == '0'"
-                  >
+                  <li :class="menuName == i.menuName ? 'active' : ''" @click="openLeftBaner(i, index)" v-for="(i, index) in sidebarRoutersCopy"
+                      :key="i.name" v-show="i.type == 1 && i.status == '0'">
                     <!-- <i
                       :class="'iconfont icon-' + i.icon"
                       style="position: relative; top: -1px"
@@ -120,34 +76,18 @@
 								</ul> -->
                 <ul class="second-level">
                   <div v-for="(i, index) in activeLeftData" :key="index">
-                    <li
-                      v-if="i.isNone"
-                      class="menu-ul"
-                      style="cursor: auto"
-                    ></li>
+                    <li v-if="i.isNone" class="menu-ul" style="cursor: auto"></li>
                     <li class="menu-title" v-else-if="i.isTitle">
-                      <a
-                        v-if="i.icon && i.icon !== '#'"
-                        :class="'iconfont icon-' + i.icon"
-                        style="margin-right: 4px"
-                      ></a
-                      ><span>{{ i.menuName }}</span>
+                      <a v-if="i.icon && i.icon !== '#'" :class="'iconfont icon-' + i.icon"
+                         style="margin-right: 4px"></a><span>{{ i.menuName }}</span>
                     </li>
-                    <li
-                      v-else
-                      class="menu-ul"
-                      @click="commonsBannerToRouter(i)"
-                      style="cursor: pointer; display: flex"
-                    >
-                      <a
-                        :class="'iconfont icon-' + i.icon"
-                        style="
+                    <li v-else class="menu-ul" @click="commonsBannerToRouter(i)" style="cursor: pointer; display: flex">
+                      <a :class="'iconfont icon-' + i.icon" style="
                           margin-right: 4px;
                           width: 20px;
                           min-height: 20px;
                           display: block;
-                        "
-                      ></a>
+                        "></a>
                       <span>{{ i.menuName }}</span>
                     </li>
                   </div>
@@ -159,28 +99,16 @@
                 </div>
                 <div class="commons-warp">
                   <div>
-                    <div
-                      class="header-button-box cp"
-                      v-for="(i, index) in commonsRouterList"
-                      :key="i.name"
-                      @click="commonsBannerToRouter(i)"
-                    >
+                    <div class="header-button-box cp" v-for="(i, index) in commonsRouterList" :key="i.name" @click="commonsBannerToRouter(i)">
                       <span>{{ i.menuName }}</span>
-                      <div
-                        class="right-icon"
-                        @click.stop="deleteCommonsRouter(i, index)"
-                      >
+                      <div class="right-icon" @click.stop="deleteCommonsRouter(i, index)">
                         <!-- <el-icon color="#46A6FF"><CirclePlus /></el-icon> -->
                         <el-icon color="#BBBBBB" v-show="isEidtType">
                           <Close />
                         </el-icon>
                       </div>
                     </div>
-                    <div
-                      class="header-add-button-box"
-                      v-if="!isEidtType"
-                      @click="isEidtType = true"
-                    >
+                    <div class="header-add-button-box" v-if="!isEidtType" @click="isEidtType = true">
                       <el-icon color="#46A6FF">
                         <CirclePlus />
                       </el-icon>
@@ -192,32 +120,16 @@
                   {{ $t("header.toAdd") }}
                 </div>
                 <div class="all-menu-warp" v-if="isEidtType">
-                  <div
-                    v-for="(i, index) in sidebarRoutersCopy"
-                    :key="i.name"
-                    v-show="i.type === 1"
-                  >
-                    <div
-                      class="all-menu-title"
-                      v-for="(j, jindex) in i.children"
-                      :key="j.name"
-                    >
+                  <div v-for="(i, index) in sidebarRoutersCopy" :key="i.name" v-show="i.type === 1">
+                    <div class="all-menu-title" v-for="(j, jindex) in i.children" :key="j.name">
                       <div class="title">
                         {{ j.menuName }}
                       </div>
                       <div class="all-menu-lists">
-                        <div
-                          class="header-button-box"
-                          v-for="(n, nindex) in j.children"
-                          v-show="n.visible == '0'"
-                          :key="n.name"
-                        >
+                        <div class="header-button-box" v-for="(n, nindex) in j.children" v-show="n.visible == '0'" :key="n.name">
                           <span>{{ n.menuName }}</span>
 
-                          <div
-                            class="right-icon"
-                            @click="addCommonsRouter(index, jindex, nindex, n)"
-                          >
+                          <div class="right-icon" @click="addCommonsRouter(index, jindex, nindex, n)">
                             <el-icon color="#46A6FF">
                               <CirclePlus />
                             </el-icon>
@@ -228,12 +140,8 @@
                   </div>
                 </div>
                 <div class="btn-warp" v-if="isEidtType">
-                  <el-button type="" @click="isEidtType = false"
-                    >取消</el-button
-                  >
-                  <el-button type="primary" @click="userMenuEdit"
-                    >保存</el-button
-                  >
+                  <el-button type="" @click="isEidtType = false">取消</el-button>
+                  <el-button type="primary" @click="userMenuEdit">保存</el-button>
                 </div>
               </div>
             </div>
@@ -241,27 +149,22 @@
         </div>
       </ul>
       <div class="fr">
+        <div style="float:right;height: 50px;padding-right:20px">
+          <el-badge :value="12" style="cursor: pointer;margin-top:15px;" @click="handleOpenDrawer">
+            <el-icon :size="20" color="#fff">
+              <Opportunity />
+            </el-icon>
+          </el-badge>
+        </div>
         <!-- :value="12" -->
-        <el-badge
-          :value="badgeNum"
-          style="cursor: pointer"
-          class="badge"
-          @click="noticeTableModal = true"
-        >
-          <el-icon :size="20">
+        <el-badge :value="badgeNum" style="cursor: pointer" class="badge" @click="noticeTableModal = true">
+          <el-icon :size="20" color="#fff">
             <BellFilled />
           </el-icon>
         </el-badge>
-        <notice
-          v-model="noticeTableModal"
-          @changeNum="(e) => (badgeNum = e)"
-        ></notice>
-        <el-dropdown
-          @command="handleCommand"
-          class="right-menu-item hover-effect"
-          trigger="click"
-        >
-          <div class="dropdown-box">
+        <notice v-model="noticeTableModal" @changeNum="(e) => (badgeNum = e)"></notice>
+        <el-dropdown @command="handleCommand" class="right-menu-item hover-effect" trigger="click">
+          <div class="dropdown-box" style="color:#fff">
             {{ userData }}
           </div>
           <template #dropdown>
@@ -282,6 +185,96 @@
         </el-dropdown>
       </div>
     </header>
+    <el-drawer v-model="openDrawer" direction="rtl" :show-close="false" custom-class="drawerClass" modal-class="modelClass">
+      <!-- <template #header>
+        <h4>set title by slot</h4>
+      </template> -->
+      <template #default>
+        <div style="color:#fff;margin-bottom:20px">
+          通知提醒
+        </div>
+        <div style="color:#fff;margin-bottom:20px">开发中</div>
+        <div class="job-box">
+          <div style="color:#fff;margin-bottom:20px">
+            工作事项
+          </div>
+          <div class="job-list">
+            <div class="job-item" style="margin-right:5px">
+              <el-badge :value="10" style="margin-right:20px;margin-top:10px">
+                <div style="margin-top:-10px">
+                  <el-icon size="20" color="#fff">
+                    <Reading />
+                  </el-icon>
+                </div>
+              </el-badge>
+              <div>未读邮件</div>
+            </div>
+            <div class="job-item" style="margin-right:5px">
+              <el-badge :value="10" style="margin-right:20px;margin-top:10px">
+                <div style="margin-top:-10px">
+                  <el-icon size="20" color="#fff">
+                    <CopyDocument />
+                  </el-icon>
+                </div>
+              </el-badge>
+              <div>待审批</div>
+            </div>
+            <div class="job-item">
+              <el-badge :value="10" style="margin-right:20px;margin-top:10px">
+                <div style="margin-top:-10px">
+                  <el-icon size="20" color="#fff">
+                    <Notebook />
+                  </el-icon>
+                </div>
+              </el-badge>
+              <div>待认领</div>
+            </div>
+            <div class="job-item" style="margin-right:5px">
+              <el-badge :value="10" style="margin-right:20px;margin-top:10px">
+                <div style="margin-top:-10px">
+                  <el-icon size="20" color="#fff">
+                    <ShoppingCart />
+                  </el-icon>
+                </div>
+              </el-badge>
+              <div>待采购</div>
+            </div>
+            <div class="job-item" style="margin-right:5px">
+              <el-badge :value="10" style="margin-right:20px;margin-top:10px">
+                <div style="margin-top:-10px">
+                  <el-icon size="20" color="#fff">
+                    <Tickets />
+                  </el-icon>
+                </div>
+              </el-badge>
+              <div>样品交接单</div>
+            </div>
+            <div class="job-item">
+              <el-badge :value="10" style="margin-right:20px;margin-top:10px">
+                <div style="margin-top:-10px">
+                  <el-icon size="20" color="#fff">
+                    <Memo />
+                  </el-icon>
+                </div>
+              </el-badge>
+              <div>合同交接单</div>
+            </div>
+            <div class="job-item" style="margin-right:5px">
+              <el-badge :value="10" style="margin-right:20px;margin-top:10px">
+                <div style="margin-top:-10px">
+                  <el-icon size="20" color="#fff">
+                    <Money />
+                  </el-icon>
+                </div>
+              </el-badge>
+              <div>待打款</div>
+            </div>
+          </div>
+
+        </div>
+      </template>
+    </el-drawer>
+
   </div>
 </template>
 
@@ -501,6 +494,48 @@ onMounted(() => {
     commonsRouterList.value = res;
   });
 });
+const openDrawer = ref(false);
+const handleOpenDrawer = () => {
+  openDrawer.value = true;
+};
 </script>
 
-<style lang="scss"></style>
+<style lang="scss">
+.drawerClass {
+  width: 350px !important;
+  background: rgba(62, 62, 62, 0.99);
+  // position: relative !important;
+}
+.modelClass {
+  background: none !important;
+}
+
+.job-box {
+  position: absolute;
+  bottom: 20px;
+  .job-list {
+    display: flex;
+    flex-wrap: wrap;
+    .job-item {
+      font-size: 14px;
+      width: 100px;
+      height: 70px;
+      margin-bottom: 5px;
+      cursor: pointer;
+      background: #515151;
+      color: #fff;
+      padding: 5px;
+      display: flex;
+      flex-direction: column;
+      justify-content: space-between;
+      &:hover {
+        background: #616161;
+        // border: 1px solid #fff;
+      }
+    }
+    .active-item {
+      background: #0077d7;
+    }
+  }
+}
+</style>

+ 1 - 1
src/components/headerBar/header.scss

@@ -366,7 +366,7 @@
 				width: 20px;
 
 				i {
-					color: #bbbbbb;
+					color: #fff;
 				}
 			}
 

+ 11 - 3
src/components/process/PurchasePayment.vue

@@ -73,7 +73,7 @@
                 <div style="width: 100%">
                   <el-form-item :prop="'payDetailList.' + $index + '.money'" :rules="rules.money" :inline-message="true">
                     <el-input-number onmousewheel="return false;" v-model="row.money" placeholder="请输入金额" style="width: 100%" :precision="2"
-                                     :controls="false" :min="0" :disabled="row.id" @change="changeMoney()" />
+                                     :controls="false" :min="0" @change="changeMoney()" />
                   </el-form-item>
                 </div>
               </template>
@@ -602,10 +602,18 @@ onMounted(async () => {
             businessIdList: [route.query.businessId],
           })
           .then((fileObj) => {
-            if (fileObj[route.query.businessId]) {
+            if (
+              fileObj[route.query.businessId] &&
+              fileObj[route.query.businessId].length > 0
+            ) {
               formData.data.fileList = fileObj[route.query.businessId].map(
-                (x) => ({ raw: x, name: x.fileName, url: x.fileUrl })
+                (x) => ({
+                  raw: x,
+                  name: x.fileName,
+                  url: x.fileUrl,
+                })
               );
+              fileList.value = formData.data.fileList;
             }
           });
       });

+ 13 - 15
src/components/selectCity/index.vue

@@ -1,6 +1,7 @@
 <template>
   <div class="select-city">
-    <el-select clearable filterable allow-create :placeholder="placeholder" @change="getCityData" @clear="getCityData" v-model="showModel" style="width: 100%">
+    <el-select clearable filterable :placeholder="placeholder" @change="getCityData" v-model="showModel" style="width: 100%"
+               :no-match-text="'无数据,请联系管理员添加'" :no-data-text="'无数据,请联系管理员添加'">
       <el-option v-for="item in data" :label="item.name" :value="item.id"> </el-option>
     </el-select>
   </div>
@@ -37,9 +38,12 @@ defineProps({
 });
 //监听modelValue的变化
 watch(
-  formData.value,
+  () => formData.value,
   () => {
-    if (!formData.value[proxy.addressId || "provinceId"] && !formData.value[proxy.addressName || "provinceName"]) {
+    if (
+      !formData.value[proxy.addressId || "provinceId"] &&
+      !formData.value[proxy.addressName || "provinceName"]
+    ) {
       if (formData.value[proxy.addressId || "provinceId"] === "-1") {
         showModel.value = "";
         formData.value[proxy.addressId || "provinceId"] = "";
@@ -49,11 +53,15 @@ watch(
       }
     } else {
       if (formData.value[proxy.addressId || "provinceId"] === "-1") {
-        showModel.value = formData.value[proxy.addressId || "provinceId"] || formData.value[proxy.addressName || "provinceName"];
+        showModel.value =
+          formData.value[proxy.addressId || "provinceId"] ||
+          formData.value[proxy.addressName || "provinceName"];
         formData.value[proxy.addressId || "provinceId"] = "";
         formData.value[proxy.addressName || "provinceName"] = "";
       } else {
-        showModel.value = formData.value[proxy.addressId || "provinceId"] || formData.value[proxy.addressName || "provinceName"];
+        showModel.value =
+          formData.value[proxy.addressId || "provinceId"] ||
+          formData.value[proxy.addressName || "provinceName"];
       }
     }
   },
@@ -62,25 +70,15 @@ watch(
   }
 );
 const getCityData = (val) => {
-  let isAddCity = true;
   //判断val是否在data里面
   proxy.data.forEach((item) => {
     if (item.id == val) {
-      isAddCity = false;
       formData.value[proxy.addressId || "provinceId"] = item.id;
       formData.value[proxy.addressName || "provinceName"] = item.name;
-      console.log(formData.value);
       emit("update:modelValue", formData.value);
       showModel.value = item.id;
       emit("change", item.id);
     }
   });
-  if (isAddCity) {
-    formData.value[proxy.addressId || "provinceId"] = null;
-    formData.value[proxy.addressName || "provinceName"] = val;
-    showModel.value = val;
-    emit("update:modelValue", formData.value);
-    emit("change", val);
-  }
 };
 </script>

+ 72 - 339
src/views/connect/E-mail/mail/com/left.vue

@@ -3,11 +3,7 @@
     <div class="top">
       <el-dropdown>
         <span class="mail">
-          <el-badge
-            :value="selectMail.allUnreadMessageCount"
-            :max="99"
-            class="item"
-          >
+          <el-badge :value="selectMail.allUnreadMessageCount" :max="99" class="item">
             {{ selectMail.mailUser }}
             <el-icon class="el-icon--right" style="margin-right: 15px">
               <arrow-down />
@@ -16,12 +12,7 @@
         </span>
         <template #dropdown>
           <el-dropdown-menu>
-            <el-dropdown-item
-              v-for="item in mailList"
-              :key="item.id"
-              @click="handleClickMail(item)"
-              >{{ item.mailUser }}</el-dropdown-item
-            >
+            <el-dropdown-item v-for="item in mailList" :key="item.id" @click="handleClickMail(item)">{{ item.mailUser }}</el-dropdown-item>
           </el-dropdown-menu>
         </template>
       </el-dropdown>
@@ -29,10 +20,7 @@
         <el-tab-pane label="邮箱" name="first">
           <template #label>
             <div>
-              <i
-                class="iconfont icon-iconm_dianzyx"
-                style="margin-right: 5px"
-              ></i>
+              <i class="iconfont icon-iconm_dianzyx" style="margin-right: 5px"></i>
               <span>邮箱</span>
             </div>
           </template>
@@ -40,10 +28,7 @@
         <el-tab-pane label="联系人" name="second">
           <template #label>
             <div>
-              <i
-                class="iconfont icon-icomm_contact"
-                style="margin-right: 5px"
-              ></i>
+              <i class="iconfont icon-icomm_contact" style="margin-right: 5px"></i>
               <span>联系人</span>
             </div>
           </template>
@@ -58,80 +43,36 @@
         </el-tab-pane>
       </el-tabs>
       <div>
-        <el-button
-          type="primary"
-          style="width: 100%; font-size: 12px"
-          @click="handleGoWrite()"
-          >写信</el-button
-        >
+        <el-button type="primary" style="width: 100%; font-size: 12px" @click="handleGoWrite()">写信</el-button>
       </div>
     </div>
     <div class="body">
       <div v-if="activeName === 'first'">
         <ul class="mail-menu">
-          <li
-            class="menu-item"
-            v-bind:class="{ 'select-menu': item.id === selectFloderId }"
-            v-for="item in selectMail.mailFolderInfoListCopy"
-            :key="item.id"
-            @click="handleOpenMenu(item, '10')"
-          >
-            <i
-              class="iconfont icon-iconm_inbox leftIcon"
-              v-if="item.sort === 1"
-            ></i>
-            <i
-              class="iconfont icon-iconm_unread leftIcon"
-              v-else-if="item.sort === 2"
-            ></i>
-            <i
-              class="iconfont icon-icomm_draftbox leftIcon"
-              v-else-if="item.sort === 3"
-            ></i>
-            <i
-              class="iconfont icon-iconm_sent leftIcon"
-              v-else-if="item.sort === 4"
-            ></i>
-            <i
-              class="iconfont icon-icomm_delete leftIcon"
-              v-else-if="item.sort === 5"
-            ></i>
-            <i
-              class="iconfont icon-iconm_ljyx leftIcon"
-              v-else-if="item.sort === 6"
-            ></i>
+          <li class="menu-item" v-bind:class="{ 'select-menu': item.id === selectFloderId }" v-for="item in selectMail.mailFolderInfoListCopy"
+              :key="item.id" @click="handleOpenMenu(item, '10')">
+            <i class="iconfont icon-iconm_inbox leftIcon" v-if="item.sort === 1"></i>
+            <i class="iconfont icon-iconm_unread leftIcon" v-else-if="item.sort === 2"></i>
+            <i class="iconfont icon-icomm_draftbox leftIcon" v-else-if="item.sort === 3"></i>
+            <i class="iconfont icon-iconm_sent leftIcon" v-else-if="item.sort === 4"></i>
+            <i class="iconfont icon-icomm_delete leftIcon" v-else-if="item.sort === 5"></i>
+            <i class="iconfont icon-iconm_ljyx leftIcon" v-else-if="item.sort === 6"></i>
             <span style="margin-left: 5px">{{ item.name }}</span>
             <div v-if="item.sort === 1" class="badge">
-              <span> {{ item.unreadMessageCount }} </span>
+              <span> {{ item.unreadMessageCount || 0 }} </span>
             </div>
           </li>
         </ul>
         <!-- 员工邮箱 -->
-        <div
-          class="tree"
-          v-if="staffMailData[0] && staffMailData[0].children.length > 0"
-        >
-          <el-tree
-            :data="staffMailData"
-            node-key="id"
-            :expand-on-click-node="false"
-            default-expand-all
-            @node-click="(data, node) => handleTreeNodeNewClick(data, node)"
-            v-loading="staffLoading"
-          >
+        <div class="tree" v-if="staffMailData[0] && staffMailData[0].children.length > 0">
+          <el-tree :data="staffMailData" node-key="id" :expand-on-click-node="false" default-expand-all
+                   @node-click="(data, node) => handleTreeNodeNewClick(data, node)" v-loading="staffLoading">
             <template #default="{ node, data }">
               <span class="tree-content">
-                <i
-                  class="iconfont icon-icomm_ygyx iconColor"
-                  v-if="data.id == '0'"
-                  style="margin-right: 5px"
-                ></i>
-                <span
-                  >{{ data.name }}
+                <i class="iconfont icon-icomm_ygyx iconColor" v-if="data.id == '0'" style="margin-right: 5px"></i>
+                <span>{{ data.name }}
                   <span v-if="data.userId && data.children.length === 0">
-                    (点击获取员工邮箱)</span
-                  ></span
-                >
+                    (点击获取员工邮箱)</span></span>
                 <div v-if="data.isMailUser" class="badge">
                   <span> {{ data.allUnreadMessageCount }} </span>
                 </div>
@@ -140,80 +81,32 @@
           </el-tree>
         </div>
         <!-- 官方文件夹 -->
-        <div
-          class="tree"
-          v-if="selectMail.otherFolder && selectMail.otherFolder.length > 0"
-        >
-          <el-tree
-            :data="selectMail.otherFolder"
-            node-key="id"
-            default-expand-all
-            :expand-on-click-node="false"
-            @node-click="(data) => handleTreeNodeClick(data, 'official')"
-          >
+        <div class="tree" v-if="selectMail.otherFolder && selectMail.otherFolder.length > 0">
+          <el-tree :data="selectMail.otherFolder" node-key="id" default-expand-all :expand-on-click-node="false"
+                   @node-click="(data) => handleTreeNodeClick(data, 'official')">
             <template #default="{ node, data }">
               <span class="tree-content">
-                <i
-                  class="iconfont icon-iconm_gfwjj iconColor"
-                  v-if="data.id == '0'"
-                  style="margin-right: 5px"
-                ></i>
+                <i class="iconfont icon-iconm_gfwjj iconColor" v-if="data.id == '0'" style="margin-right: 5px"></i>
                 <span>{{ data.name }}</span>
               </span>
-            </template></el-tree
-          >
+            </template></el-tree>
         </div>
         <!-- 我的文件夹 -->
-        <div
-          class="tree"
-          v-if="myFolderTreeData && myFolderTreeData.length > 0"
-        >
-          <el-tree
-            :data="myFolderTreeData"
-            node-key="id"
-            default-expand-all
-            :expand-on-click-node="false"
-            @node-click="(data) => handleTreeNodeClick(data, 'folder')"
-          >
+        <div class="tree" v-if="myFolderTreeData && myFolderTreeData.length > 0">
+          <el-tree :data="myFolderTreeData" node-key="id" default-expand-all :expand-on-click-node="false"
+                   @node-click="(data) => handleTreeNodeClick(data, 'folder')">
             <template #default="{ node, data }">
               <span class="tree-content">
-                <i
-                  class="iconfont icon-icomm_wdwjj iconColor"
-                  v-if="data.id == '0'"
-                  style="margin-right: 5px"
-                ></i>
+                <i class="iconfont icon-icomm_wdwjj iconColor" v-if="data.id == '0'" style="margin-right: 5px"></i>
                 <span>{{ data.label }}</span>
-                <el-popover
-                  placement="bottom-start"
-                  title=""
-                  :width="200"
-                  trigger="click"
-                >
+                <el-popover placement="bottom-start" title="" :width="200" trigger="click">
                   <div default style="display: flex">
-                    <el-button
-                      size="small"
-                      @click.stop="handleEditFolder(data, 'add')"
-                      >添加</el-button
-                    >
-                    <el-button
-                      size="small"
-                      v-if="data.id != '0'"
-                      @click.stop="handleEditFolder(data, 'edit')"
-                      >编辑</el-button
-                    >
-                    <el-button
-                      size="small"
-                      v-if="data.id != '0'"
-                      @click.stop="handleDelFolder(data)"
-                      >删除</el-button
-                    >
+                    <el-button size="small" @click.stop="handleEditFolder(data, 'add')">添加</el-button>
+                    <el-button size="small" v-if="data.id != '0'" @click.stop="handleEditFolder(data, 'edit')">编辑</el-button>
+                    <el-button size="small" v-if="data.id != '0'" @click.stop="handleDelFolder(data)">删除</el-button>
                   </div>
                   <template #reference>
-                    <span
-                      class="iconfont icon_more iconColor"
-                      style="padding-bottom: 5px; margin-left: auto"
-                      >...</span
-                    >
+                    <span class="iconfont icon_more iconColor" style="padding-bottom: 5px; margin-left: auto">...</span>
                   </template>
                 </el-popover>
               </span>
@@ -222,53 +115,20 @@
         </div>
         <!-- 我的标签 -->
         <div class="tree" v-if="tagsTreeData && tagsTreeData.length > 0">
-          <el-tree
-            :data="tagsTreeData"
-            node-key="id"
-            default-expand-all
-            :expand-on-click-node="false"
-            @node-click="(data) => handleTreeNodeClick(data, 'tag')"
-          >
+          <el-tree :data="tagsTreeData" node-key="id" default-expand-all :expand-on-click-node="false"
+                   @node-click="(data) => handleTreeNodeClick(data, 'tag')">
             <template #default="{ node, data }">
               <span class="tree-content">
-                <i
-                  class="iconfont icon-icomm_label iconColor"
-                  v-if="data.id == '0'"
-                  style="margin-right: 5px"
-                ></i>
+                <i class="iconfont icon-icomm_label iconColor" v-if="data.id == '0'" style="margin-right: 5px"></i>
                 <span>{{ data.name }}</span>
-                <el-popover
-                  placement="bottom-start"
-                  title=""
-                  :width="150"
-                  trigger="click"
-                >
+                <el-popover placement="bottom-start" title="" :width="150" trigger="click">
                   <div default style="display: flex">
-                    <el-button
-                      size="small"
-                      v-if="data.id == '0'"
-                      @click.stop="handleEditTag(data, 'add')"
-                      >添加</el-button
-                    >
-                    <el-button
-                      size="small"
-                      v-if="data.id != '0'"
-                      @click.stop="handleEditTag(data, 'edit')"
-                      >编辑</el-button
-                    >
-                    <el-button
-                      size="small"
-                      v-if="data.id != '0'"
-                      @click.stop="handleDelTag(data)"
-                      >删除</el-button
-                    >
+                    <el-button size="small" v-if="data.id == '0'" @click.stop="handleEditTag(data, 'add')">添加</el-button>
+                    <el-button size="small" v-if="data.id != '0'" @click.stop="handleEditTag(data, 'edit')">编辑</el-button>
+                    <el-button size="small" v-if="data.id != '0'" @click.stop="handleDelTag(data)">删除</el-button>
                   </div>
                   <template #reference>
-                    <span
-                      class="iconfont icon_more iconColor"
-                      style="padding-bottom: 5px; margin-left: auto"
-                      >...</span
-                    >
+                    <span class="iconfont icon_more iconColor" style="padding-bottom: 5px; margin-left: auto">...</span>
                   </template>
                 </el-popover>
               </span>
@@ -277,49 +137,20 @@
         </div>
       </div>
       <div v-if="activeName === 'second'">
-        <div
-          class="tree"
-          v-if="contactsTreeData && contactsTreeData.length > 0"
-          style="border-top: none; margin-top: 0px"
-        >
-          <el-tree
-            :data="contactsTreeData"
-            node-key="id"
-            default-expand-all
-            :expand-on-click-node="false"
-            @node-click="
+        <div class="tree" v-if="contactsTreeData && contactsTreeData.length > 0" style="border-top: none; margin-top: 0px">
+          <el-tree :data="contactsTreeData" node-key="id" default-expand-all :expand-on-click-node="false" @node-click="
               (data, node) => handleCustomerTreeClick(data, node, 'contacts')
-            "
-            v-loading="contactsTreeLoading"
-          >
+            " v-loading="contactsTreeLoading">
             <template #default="{ node, data }">
               <span class="tree-content">
                 <span>{{ data.name }}</span>
-                <el-popover
-                  placement="bottom-start"
-                  title=""
-                  :width="150"
-                  trigger="click"
-                  v-if="data.parentId === '0'"
-                >
+                <el-popover placement="bottom-start" title="" :width="150" trigger="click" v-if="data.parentId === '0'">
                   <div default style="display: flex">
-                    <el-button
-                      size="small"
-                      @click.stop="handleEditContacts(data)"
-                      >编辑</el-button
-                    >
-                    <el-button
-                      size="small"
-                      @click.stop="handleDelContacts(data)"
-                      >删除</el-button
-                    >
+                    <el-button size="small" @click.stop="handleEditContacts(data)">编辑</el-button>
+                    <el-button size="small" @click.stop="handleDelContacts(data)">删除</el-button>
                   </div>
                   <template #reference>
-                    <span
-                      class="iconfont icon_more iconColor"
-                      style="padding-bottom: 5px; margin-left: auto"
-                      >...</span
-                    >
+                    <span class="iconfont icon_more iconColor" style="padding-bottom: 5px; margin-left: auto">...</span>
                   </template>
                 </el-popover>
               </span>
@@ -327,42 +158,19 @@
           </el-tree>
         </div>
         <div style="padding: 0 10px; margin-top: 15px">
-          <el-button
-            type="primary"
-            plain
-            :icon="Plus"
-            style="width: 100%; font-size: 12px"
-            @click="handleAddContact"
-            >添加联系人</el-button
-          >
+          <el-button type="primary" plain :icon="Plus" style="width: 100%; font-size: 12px" @click="handleAddContact">添加联系人</el-button>
         </div>
       </div>
       <div v-if="activeName === 'third'">
-        <div
-          class="tree"
-          v-if="customerList && customerList.length > 0"
-          style="border-top: none; margin-top: 0px"
-        >
-          <el-tree
-            :data="customerList"
-            node-key="id"
-            :expand-on-click-node="false"
-            default-expand-all
-            @node-click="
+        <div class="tree" v-if="customerList && customerList.length > 0" style="border-top: none; margin-top: 0px">
+          <el-tree :data="customerList" node-key="id" :expand-on-click-node="false" default-expand-all @node-click="
               (data, node) => handleCustomerTreeClick(data, node, 'customer')
-            "
-            v-loading="customerLoading"
-          >
+            " v-loading="customerLoading">
             <template #default="{ node, data }">
               <span class="tree-content">
-                <span v-if="data.parentId === '0'"
-                  >{{ data.name }}
-                  <span
-                    v-if="data.parentId === '0' && data.children.length === 0"
-                  >
-                    (点击获取客户邮箱)</span
-                  ></span
-                >
+                <span v-if="data.parentId === '0'">{{ data.name }}
+                  <span v-if="data.parentId === '0' && data.children.length === 0">
+                    (点击获取客户邮箱)</span></span>
                 <span v-else> {{ data.name }} {{ data.email }} </span>
               </span>
             </template>
@@ -370,114 +178,46 @@
         </div>
       </div>
     </div>
-    <el-dialog
-      :title="editType === 'add' ? '添加文件夹' : '编辑文件夹'"
-      v-model="myFolderDialog"
-      width="300px"
-      destroy-on-close
-      v-loading="submitLoading"
-    >
-      <byForm
-        :formConfig="myFolderFormConfig"
-        :formOption="formOption"
-        v-model="formData.myFolderData"
-        :rules="rules"
-        ref="myFolderForm"
-      >
+    <el-dialog :title="editType === 'add' ? '添加文件夹' : '编辑文件夹'" v-model="myFolderDialog" width="300px" destroy-on-close v-loading="submitLoading">
+      <byForm :formConfig="myFolderFormConfig" :formOption="formOption" v-model="formData.myFolderData" :rules="rules" ref="myFolderForm">
       </byForm>
       <template #footer>
-        <el-button @click="myFolderDialog = false" size="large"
-          >取 消</el-button
-        >
-        <el-button
-          type="primary"
-          @click="submitMyFolderForm()"
-          size="large"
-          :loading="submitLoading"
-        >
+        <el-button @click="myFolderDialog = false" size="large">取 消</el-button>
+        <el-button type="primary" @click="submitMyFolderForm()" size="large" :loading="submitLoading">
           确 定
         </el-button>
       </template>
     </el-dialog>
 
-    <el-dialog
-      :title="editType === 'add' ? '添加标签' : '编辑标签'"
-      v-model="tagDialog"
-      width="300px"
-      destroy-on-close
-      v-loading="submitLoading"
-    >
-      <byForm
-        :formConfig="tagFormConfig"
-        :formOption="formOption"
-        v-model="formData.tagData"
-        :rules="tagRules"
-        ref="tagForm"
-      >
+    <el-dialog :title="editType === 'add' ? '添加标签' : '编辑标签'" v-model="tagDialog" width="300px" destroy-on-close v-loading="submitLoading">
+      <byForm :formConfig="tagFormConfig" :formOption="formOption" v-model="formData.tagData" :rules="tagRules" ref="tagForm">
       </byForm>
       <template #footer>
         <el-button @click="tagDialog = false" size="large">取 消</el-button>
-        <el-button
-          type="primary"
-          @click="submitTagForm()"
-          size="large"
-          :loading="submitLoading"
-        >
+        <el-button type="primary" @click="submitTagForm()" size="large" :loading="submitLoading">
           确 定
         </el-button>
       </template>
     </el-dialog>
 
-    <el-dialog
-      :title="editType === 'add' ? '添加联系人' : '编辑联系人'"
-      v-model="contactsDialog"
-      width="400px"
-      destroy-on-close
-      v-loading="submitLoading"
-    >
-      <byForm
-        :formConfig="contactsFormConfig"
-        :formOption="formOption"
-        v-model="formData.contactsData"
-        :rules="contactsRules"
-        ref="contactsForm"
-      >
+    <el-dialog :title="editType === 'add' ? '添加联系人' : '编辑联系人'" v-model="contactsDialog" width="400px" destroy-on-close v-loading="submitLoading">
+      <byForm :formConfig="contactsFormConfig" :formOption="formOption" v-model="formData.contactsData" :rules="contactsRules" ref="contactsForm">
         <template #mailSet>
           <div style="width: 100%">
             <el-button type="primary" @click="clickAddRow">添 加</el-button>
-            <el-table
-              :data="formData.contactsData.mailSet"
-              style="width: 100%; margin-top: 16px"
-            >
+            <el-table :data="formData.contactsData.mailSet" style="width: 100%; margin-top: 16px">
               <el-table-column label="电子邮箱">
                 <template #default="{ row, $index }">
                   <div style="width: 100%">
-                    <el-form-item
-                      :prop="'mailSet.' + $index + '.email'"
-                      :rules="contactsRules.email"
-                      :inline-message="true"
-                    >
-                      <el-input
-                        v-model="row.email"
-                        placeholder="请输入电子邮箱"
-                      />
+                    <el-form-item :prop="'mailSet.' + $index + '.email'" :rules="contactsRules.email" :inline-message="true">
+                      <el-input v-model="row.email" placeholder="请输入电子邮箱" />
                     </el-form-item>
                   </div>
                 </template>
               </el-table-column>
-              <el-table-column
-                align="center"
-                label="操作"
-                width="80"
-                fixed="right"
-              >
+              <el-table-column align="center" label="操作" width="80" fixed="right">
                 <template #default="{ row, $index }">
-                  <el-button
-                    type="primary"
-                    link
-                    @click="handleRemoveRow($index)"
-                    >删除</el-button
-                  >
+                  <el-button type="primary" link @click="handleRemoveRow($index)">删除</el-button>
                 </template>
               </el-table-column>
             </el-table>
@@ -485,15 +225,8 @@
         </template>
       </byForm>
       <template #footer>
-        <el-button @click="contactsDialog = false" size="large"
-          >取 消</el-button
-        >
-        <el-button
-          type="primary"
-          @click="submitContactsForm()"
-          size="large"
-          :loading="submitLoading"
-        >
+        <el-button @click="contactsDialog = false" size="large">取 消</el-button>
+        <el-button type="primary" @click="submitContactsForm()" size="large" :loading="submitLoading">
           确 定
         </el-button>
       </template>

+ 258 - 116
src/views/connect/E-mail/mail/com/mailList.vue

@@ -1,131 +1,143 @@
 <template>
   <div>
-    <div
-      style="padding-left: 20px; display: flex; align-items: center"
-      v-loading="btnLoading"
-    >
+    <div style="padding:0 20px; display: flex; align-items: center" v-loading="btnLoading">
       <el-icon @click="handleRefresh" style="cursor: pointer">
         <Refresh />
       </el-icon>
       <div class="vertical-line"></div>
       <div>
-        <el-checkbox
-          v-model="isCheckAll"
-          label="全选"
-          size="default"
-          @change="handleChangeCheckAll"
-        />
+        <el-checkbox v-model="isCheckAll" label="全选" size="default" @change="handleChangeCheckAll" />
       </div>
       <div style="color: #666666">
-        <span
-          >(共 {{ tableData.pagination.total }} 封,其中<span
-            style="color: #39c55a"
-          >
-            未读邮件 </span
-          ><span>{{ unReadCount }}</span> 封)</span
-        >
+        <span>(共 {{ tableData.pagination.total }} 封,其中<span style="color: #39c55a">
+            未读邮件 </span><span>{{ unReadCount }}</span> 封)</span>
       </div>
-      <el-button
-        @click="handleSetAllRead"
-        :disabled="selectData.length === 0"
-        style="margin-left: 10px"
-        >全部标为已读</el-button
-      >
-      <el-select
-        v-model="selectTag"
-        placeholder="标记为"
-        style="margin: 0 10px; width: 120px"
-        :disabled="selectData.length === 0"
-        @change="handleSetTag"
-      >
-        <el-option
-          v-for="item in tagData"
-          :key="item.id"
-          :label="item.name"
-          :value="item.id"
-        />
+      <el-button @click="handleSetAllRead" :disabled="selectData.length === 0" style="margin-left: 10px">全部标为已读</el-button>
+      <el-select v-model="selectTag" placeholder="标记为" style="margin: 0 10px; width: 120px" :disabled="selectData.length === 0"
+                 @change="handleSetTag">
+        <el-option v-for="item in tagData" :key="item.id" :label="item.name" :value="item.id" />
       </el-select>
-      <el-tree-select
-        v-model="selectFolder"
-        :data="myFolderTreeData"
-        :disabled="selectData.length === 0"
-        placeholder="移动到"
-        style="margin-right: 10px; width: 120px"
-        check-strictly
-        :render-after-expand="false"
-        @change="handleSetFolder"
-      />
-      <el-button @click="handleDeleteAll" :disabled="selectData.length === 0"
-        >删除</el-button
-      >
+      <el-tree-select v-model="selectFolder" :data="myFolderTreeData" :disabled="selectData.length === 0" placeholder="移动到"
+                      style="margin-right: 10px; width: 120px" check-strictly :render-after-expand="false" @change="handleSetFolder" />
+      <el-button @click="handleDeleteAll" :disabled="selectData.length === 0" style="margin-right:10px">删除</el-button>
+      <div class="search">
+        <el-input v-model="mailKeyword" placeholder="请输入" @keyup.enter="getList" clearable style="width:180px" />
+        <el-icon style="cursor:pointer;margin-left:5px" size="18" @click="getList">
+          <Search />
+        </el-icon>
+      </div>
     </div>
     <div style="padding: 10px 15px; width: 100%">
-      <el-table
-        :data="tableData.data"
-        style="width: 100%"
-        :height="tableHeight"
-        @selection-change="handleSelectionChange"
-        v-loading="loading"
-      >
+      <el-table :data="tableData.data" style="width: 100%" :height="tableHeight" @selection-change="handleSelectionChange" v-loading="loading"
+                @row-contextmenu="handleContextmenu">
         <el-table-column label=" " width="40" align="center">
           <template #default="{ row, $index }">
             <div>
-              <el-checkbox
-                v-model="row.isCheck"
-                label=""
-                size="default"
-                @change="handleChangeCheck"
-              />
+              <el-checkbox v-model="row.isCheck" label="" size="default" @change="handleChangeCheck" />
             </div>
           </template>
         </el-table-column>
-        <el-table-column label="状态" width="70">
+        <el-table-column label="" width="80">
           <template #default="{ row, $index }">
-            <div style="cursor: pointer" @click="handleRowClick(row, $index)">
+            <div style="display:flex;align-items:center" @click="handleRowClick(row, $index)">
               <span v-if="row.flags && !row.flags.includes('6')">
-                <img
-                  src="@/assets/images/mail/message.png"
-                  alt=""
-                  title="未读"
-                  class="messageImg"
-                />
+                <img src="@/assets/images/mail/message.png" alt="" title="未读" class="messageImg" style="cursor: pointer;" />
               </span>
-              <span
-                v-if="
+              <span v-if="
                   row.flags !== undefined &&
                   row.flags !== null &&
                   row.flags === ''
-                "
-              >
-                <img
-                  src="@/assets/images/mail/message.png"
-                  alt=""
-                  title="未读"
-                  class="messageImg"
-                />
+                ">
+                <img src="@/assets/images/mail/message.png" alt="" title="未读" class="messageImg" style="cursor: pointer;" />
               </span>
-              <span
-                v-if="
+              <span v-if="
                   row.flags &&
                   row.flags.includes('6') &&
                   row.flags.includes('1')
-                "
-              >
-                <img
-                  src="@/assets/images/mail/replied.png"
-                  alt=""
-                  title="已回复"
-                  class="messageImg"
-                />
+                ">
+                <img src="@/assets/images/mail/replied.png" alt="" title="已回复" class="messageImg" style="cursor: pointer;" />
               </span>
               <span v-if="row.flags && row.flags.includes('6')">
-                <img
-                  src="@/assets/images/mail/message-open.png"
-                  alt=""
-                  title="已读"
-                  class="messageImg"
-                />
+                <img src="@/assets/images/mail/message-open.png" alt="" title="已读" class="messageImg" style="cursor: pointer;" />
+              </span>
+              <span style="margin-left:5px;cursor: pointer;">
+                <el-popover placement="top-start" :width="300" trigger="hover">
+                  <template #default>
+                    <div v-if="row.flags" style="font-size:12px">
+                      <div style="display:flex;align-items:center">
+                        <el-icon size="26" :color="'#409eff'" style="vertical-align:middle">
+                          <UserFilled />
+                        </el-icon>
+                        <span style="margin:0 20px" class="public-color">客户名称</span>
+                        <span class="public-color">1279230601@qq.com</span>
+                      </div>
+                      <div style="border-top:1px solid #eee;border-bottom:1px solid #eee;margin-top:20px;padding-bottom:10px">
+                        <div style="margin-top:10px">
+                          国家:
+                        </div>
+                        <div style="margin-top:10px">
+                          公司:
+                        </div>
+                        <div style="margin-top:10px">
+                          职位:
+                        </div>
+                        <div style="margin-top:10px">
+                          电话:
+                        </div>
+                        <div style="margin-top:10px">
+                          来源:
+                        </div>
+                      </div>
+                      <div style="display:flex;align-items:center;margin-top:10px;justify-content:space-between">
+                        <span class="cursor-class" @click="addCustomer('edit')">
+                          <el-icon :size="16" color="#409eff" class="icon-class">
+                            <Edit />
+                          </el-icon><span class="public-color">编辑客户</span></span>
+                        <span class="cursor-class"><el-icon :size="16" color="#409eff" class="icon-class">
+                            <ChatRound />
+                          </el-icon><span class="public-color">回复</span></span>
+                        <span class="cursor-class"><el-icon :size="16" color="#409eff" class="icon-class">
+                            <EditPen />
+                          </el-icon><span class="public-color">写信</span></span>
+                      </div>
+                    </div>
+                    <div v-else style="font-size:12px">
+                      <div>
+                        <el-icon size="26" style="vertical-align:middle">
+                          <UserFilled />
+                        </el-icon>
+                        <span style="margin:0 20px">客户名称</span>
+                        <span>1279230601@qq.com</span>
+                      </div>
+                      <div
+                           style="border-top:1px solid #eee;margin-top:20px;display:flex;align-items:center;justify-content:space-between;padding-top:10px">
+                        <span class="cursor-class" @click="addCustomer('add')">
+                          <el-icon :size="16" color="#409eff" class="icon-class">
+                            <Plus />
+                          </el-icon><span class="public-color">添加为客户</span></span>
+                        <span class="cursor-class"><el-icon :size="16" color="#409eff" class="icon-class">
+                            <ChatRound />
+                          </el-icon><span class="public-color">回复</span></span>
+                        <span class="cursor-class"><el-icon :size="16" color="#409eff" class="icon-class">
+                            <EditPen />
+                          </el-icon><span class="public-color">写信</span></span>
+                      </div>
+                    </div>
+                  </template>
+                  <template #reference>
+                    <el-icon size="18" :color="row.flags?'#409eff':''" style="vertical-align:middle">
+                      <UserFilled />
+                    </el-icon>
+                  </template>
+                </el-popover>
+
+              </span>
+              <span style="margin-left:5px;cursor: pointer;">
+                <el-icon size="18" :color="row.isAttachments?'#409eff':''" style="vertical-align:middle">
+                  <Paperclip />
+                </el-icon>
               </span>
+
             </div>
           </template>
         </el-table-column>
@@ -138,12 +150,7 @@
         </el-table-column>
         <el-table-column prop="fromEmail" label="发件人地址" width="210">
           <template #default="{ row, $index }">
-            <el-tooltip
-              class="box-item"
-              effect="dark"
-              :content="row.fromEmail"
-              placement="top"
-            >
+            <el-tooltip class="box-item" effect="dark" :content="row.fromEmail" placement="top">
               <div class="contentClass" @click="handleRowClick(row, $index)">
                 {{ row.fromEmail }}
               </div>
@@ -165,19 +172,37 @@
           </template>
         </el-table-column>
       </el-table>
-      <el-pagination
-        style="margin-top: 15px"
-        v-model:current-page="tableData.pagination.pageNum"
-        v-model:page-size="tableData.pagination.pageSize"
-        :page-sizes="[15, 30, 50, 100]"
-        layout="sizes, prev, pager, next"
-        :total="tableData.pagination.total"
-        prev-text="上一页"
-        next-text="下一页"
-        @current-change="handleCurrentChange"
-        @size-change="handleSizeChange"
-      />
+      <el-pagination style="margin-top: 15px" v-model:current-page="tableData.pagination.pageNum" v-model:page-size="tableData.pagination.pageSize"
+                     :page-sizes="[15, 30, 50, 100]" layout="sizes, prev, pager, next" :total="tableData.pagination.total" prev-text="上一页"
+                     next-text="下一页" @current-change="handleCurrentChange" @size-change="handleSizeChange" />
     </div>
+
+    <el-dialog :title="editTile" v-model="editDialog" width="500">
+      <el-form ref="editFormDom" :model="editForm.data" :rules="editRules" label-width="70px" v-loading="editFormLoading">
+        <el-form-item label="标签" prop="myTagId" v-if="editType=='1'">
+          <el-select v-model="editForm.data.myTagId" placeholder="标记为" style=" width: 100%">
+            <el-option v-for="item in tagData" :key="item.id" :label="item.name" :value="item.id" />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="文件夹" prop="myFolderId" v-if="editType=='2'">
+          <el-tree-select v-model="editForm.data.myFolderId" :data="myFolderTreeData" placeholder="移动到" style="width: 100%" check-strictly
+                          :render-after-expand="false" />
+        </el-form-item>
+      </el-form>
+      <template #footer>
+        <el-button @click="editDialog = false" size="large">取 消</el-button>
+        <el-button type="primary" :loading="editFormLoading" @click="submitEditForm()" size="large">
+          确 定
+        </el-button>
+      </template>
+    </el-dialog>
+    <el-dialog :title="modalType == 'add' ? '新增客户' : '编辑客户'" v-if="addCustomerDialog" v-model="addCustomerDialog" width="800">
+      <AddCustomer ref="AddCustomerDom" :modalType="modalType" :customerId="customerId"></AddCustomer>
+      <template #footer>
+        <el-button @click="addCustomerDialog = false" size="large">取 消</el-button>
+        <el-button type="primary" @click="submitForm()" size="large">确 定</el-button>
+      </template>
+    </el-dialog>
   </div>
 </template>
 
@@ -186,7 +211,12 @@ import byTable from "@/components/byTable/index";
 import useMailStore from "@/store/modules/mail";
 import useUserStore from "@/store/modules/user";
 import { ElMessage, ElMessageBox } from "element-plus";
-
+import "@imengyu/vue3-context-menu/lib/vue3-context-menu.css";
+import ContextMenu from "@imengyu/vue3-context-menu";
+import AddCustomer from "@/views/customer/addCustomer.vue";
+const AddCustomerDom = ref(null);
+const customerId = ref("");
+const modalType = ref("add");
 const { proxy } = getCurrentInstance();
 const mailStore = useMailStore();
 let loading = ref(false);
@@ -206,6 +236,7 @@ const tableData = reactive({
     total: 0,
   },
 });
+const mailKeyword = ref("");
 const unReadCount = computed(() => mailStore.currentMenu.unReadCount);
 const config = computed(() => {
   return [
@@ -250,6 +281,7 @@ const getList = () => {
       .post("/mailService/getMessagePage", {
         ...mailStore.currentMenu,
         ...tableData.pagination,
+        keyword: mailKeyword.value,
       })
       .then((res) => {
         tableData.data = res.rows.map((x) => ({ ...x, isCheck: false }));
@@ -267,6 +299,7 @@ const getList = () => {
         myFolderId: mailStore.currentMenu.folderId,
         type: mailStore.selectMail.type,
         ...tableData.pagination,
+        keyword: mailKeyword.value,
       })
       .then((res) => {
         tableData.data = res.rows.map((x) => ({
@@ -287,6 +320,7 @@ const getList = () => {
         myTagId: mailStore.currentMenu.folderId,
         type: mailStore.selectMail.type,
         ...tableData.pagination,
+        keyword: mailKeyword.value,
       })
       .then((res) => {
         tableData.data = res.rows.map((x) => ({
@@ -501,7 +535,89 @@ const handleDeleteAll = () => {
     );
   });
 };
-
+const editFormDom = ref(null);
+const editForm = reactive({
+  data: {
+    myTagId: "",
+    myFolderId: "",
+    messageIdList: [],
+  },
+});
+const editRules = ref({
+  myTagId: [{ required: true, message: "请选择标签", trigger: "change" }],
+  myFolderId: [{ required: true, message: "请选择文件夹", trigger: "change" }],
+});
+const editFormLoading = ref(false);
+const editType = ref("1");
+const editTile = ref("添加标签");
+const editDialog = ref(false);
+const handleContextmenu = (row, column, e) => {
+  e.preventDefault();
+  editForm.data = {
+    myTagId: "",
+    myFolderId: "",
+    messageIdList: [row.id],
+  };
+  ContextMenu.showContextMenu({
+    x: e.x,
+    y: e.y,
+    items: [
+      {
+        label: "标签",
+        onClick: () => {
+          editType.value = "1";
+          editTile.value = "添加标签";
+          editDialog.value = true;
+        },
+      },
+      {
+        label: "文件夹",
+        onClick: () => {
+          editType.value = "2";
+          editTile.value = "移动文件夹";
+          editDialog.value = true;
+        },
+      },
+    ],
+  });
+};
+const submitEditForm = () => {
+  editFormDom.value.validate((valid) => {
+    if (valid) {
+      editFormLoading.value = true;
+      let requestUrl = "";
+      switch (editType.value) {
+        case "1":
+          requestUrl = "/myTagMessage/addBath";
+          break;
+        case "2":
+          requestUrl = "/myFolderMessage/addBath";
+          break;
+      }
+      proxy.post(requestUrl, editForm.data).then(
+        (res) => {
+          ElMessage({
+            message: `操作成功`,
+            type: "success",
+          });
+          editDialog.value = false;
+          editFormLoading.value = false;
+        },
+        (err) => {
+          editFormLoading.value = false;
+        }
+      );
+    }
+  });
+};
+const addCustomerDialog = ref(false);
+const addCustomer = (type, id = "") => {
+  if (id) {
+    customerId.value = id;
+  }
+  modalType.value = type;
+  addCustomerDialog.value = true;
+};
 defineExpose({
   initFn: init,
 });
@@ -531,4 +647,30 @@ defineExpose({
   background: #dddddd;
   margin: 0 10px;
 }
+.search {
+  display: flex;
+  align-items: center;
+  margin-left: auto;
+  float: right;
+}
+.icon-class {
+  vertical-align: middle;
+  margin-bottom: 2px;
+}
+.public-color {
+  color: #409eff;
+}
+.cursor-class {
+  cursor: pointer;
+}
+
+.mx-context-menu {
+  .mx-context-menu-items {
+    .mx-context-menu-item-wrapper {
+      .mx-context-menu-item {
+        border-bottom: 1px solid #eee !important;
+      }
+    }
+  }
+}
 </style>

+ 23 - 60
src/views/connect/E-mail/mail/com/right/netdisk/enterprise.vue

@@ -1,86 +1,45 @@
 <template>
   <div>
     <div style="margin-bottom: 10px; display: flex; align-items: center">
-      <el-input
-        class="input_content"
-        placeholder="请输入内容"
-        v-model="sourceList.pagination.keyword"
-        style="width: 90%"
-        clearable
-        size="small"
-      ></el-input>
+      <el-input class="input_content" placeholder="请输入内容" v-model="sourceList.pagination.keyword" style="width: 90%" clearable
+                size="small"></el-input>
       <div style="text-align: center; width: 10%">
-        <el-icon style="cursor: pointer" @click="getList"><Search /></el-icon>
+        <el-icon style="cursor: pointer" @click="getList">
+          <Search />
+        </el-icon>
       </div>
     </div>
     <el-row>
       <el-col :span="11" style="border-right: 1px solid #d7d7d7">
         <div class="mulu">
-          <el-tree
-            :data="treeListData"
-            :props="{ label: 'name', children: 'netdiskList' }"
-            ref="tree"
-            node-key="id"
-            @node-click="treeChange"
-            default-expand-all
-            :expand-on-click-node="false"
-          ></el-tree>
+          <el-tree :data="treeListData" :props="{ label: 'name', children: 'netdiskList' }" ref="tree" node-key="id" @node-click="treeChange"
+                   default-expand-all :expand-on-click-node="false"></el-tree>
         </div>
       </el-col>
       <el-col :span="13" style="padding: 0 5px">
-        <el-table
-          :data="sourceList.data"
-          style="width: 100%"
-          v-loading="loading"
-          :height="tableHeight"
-        >
+        <el-table :data="sourceList.data" style="width: 100%" v-loading="loading" :height="tableHeight">
           <el-table-column prop="name" label="文件名" />
-          <el-table-column
-            prop="createTime"
-            label="上传时间"
-            width="80"
-            align="center"
-          >
+          <el-table-column prop="createTime" label="上传时间" width="80" align="center">
             <template #default="{ row }">
-              <el-tooltip
-                class="box-item"
-                effect="dark"
-                :content="row.createTime"
-                placement="top"
-              >
+              <el-tooltip class="box-item" effect="dark" :content="row.createTime" placement="top">
                 <!-- <span
                   class="iconfont icon-iconx_kehd"
                   style="cursor: pointer; font-size: 18px"
                 ></span> -->
-                <el-icon :size="20" style="cursor: pointer"><Timer /></el-icon>
+                <el-icon :size="20" style="cursor: pointer">
+                  <Timer />
+                </el-icon>
               </el-tooltip>
             </template>
           </el-table-column>
-          <!-- <el-table-column
-            label="操作"
-            width="60"
-            fixed="right"
-            align="center"
-            v-if="isShowBtn"
-          >
+          <el-table-column label="操作" width="60" fixed="right" align="center" v-if="isShowBtn">
             <template #default="{ row }">
-              <el-button type="primary" text @click="handleClickRow(row)"
-                ><i class="iconfont icon-iconm_wofqd"></i
-              ></el-button>
+              <el-button type="primary" text @click="handleClickRow(row)"><i class="iconfont icon-iconm_wofqd"></i></el-button>
             </template>
-          </el-table-column> -->
+          </el-table-column>
         </el-table>
-
-        <el-pagination
-          style="margin-top: 10px"
-          v-model:current-page="sourceList.pagination.pageNum"
-          :page-size="10"
-          layout="total, prev, pager, next"
-          :total="sourceList.pagination.total"
-          prev-text="上一页"
-          next-text="下一页"
-          @current-change="handleCurrentChange"
-        />
+        <el-pagination style="margin-top: 10px" v-model:current-page="sourceList.pagination.pageNum" :page-size="10" layout="total, prev, pager, next"
+                       :total="sourceList.pagination.total" prev-text="上一页" next-text="下一页" @current-change="handleCurrentChange" />
       </el-col>
     </el-row>
   </div>
@@ -171,7 +130,11 @@ getTreeList();
 getList();
 
 const handleClickRow = (row) => {
-  console.log(row, "ada");
+  proxy
+    .post("/fileInfo/getList", { businessIdList: [row.parentFolderId] })
+    .then((fileObj) => {
+      console.log(fileObj, "asda");
+    });
 };
 </script>
 

+ 483 - 0
src/views/customer/addCustomer.vue

@@ -0,0 +1,483 @@
+<template>
+  <div>
+    <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="submit" v-loading="loading">
+      <template #allAddress>
+        <el-row style="width: 100%">
+          <el-col :span="8">
+            <el-form-item prop="countryId">
+              <el-select v-model="formData.data.countryId" placeholder="国家" filterable @change="(val) => getCityData(val, '20', true)">
+                <el-option v-for="item in countryData" :label="item.name" :value="item.id">
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <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="cityName">
+              <selectCity placeholder="城市" addressId="cityId" addressName="cityName" v-model="formData.data" :data="cityData"></selectCity>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row style="margin-top: 20px; width: 100%">
+          <el-col :span="24">
+            <el-form-item prop="address">
+              <el-input v-model="formData.data.address" type="textarea">
+              </el-input>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </template>
+      <template #person>
+        <div style="width: 100%">
+          <el-button type="primary" @click="clickAddPerson">添 加</el-button>
+          <el-table :data="formData.data.customerUserList" style="width: 100%; margin-top: 16px">
+            <el-table-column label="联系人" width="160">
+              <template #default="{ row, $index }">
+                <div style="width: 100%">
+                  <el-form-item :prop="'customerUserList.' + $index + '.name'" :rules="rules.name2" :inline-message="true">
+                    <el-input v-model="row.name" placeholder="请输入联系人" />
+                  </el-form-item>
+                </div>
+              </template>
+            </el-table-column>
+            <el-table-column label="电子邮箱">
+              <template #default="{ row, $index }">
+                <div style="width: 100%">
+                  <el-form-item :prop="'customerUserList.' + $index + '.email'" :rules="rules.email" :inline-message="true">
+                    <el-input v-model="row.email" placeholder="请输入电子邮箱" />
+                  </el-form-item>
+                </div>
+              </template>
+            </el-table-column>
+            <el-table-column align="center" label="操作" width="120" fixed="right">
+              <template #default="{ row, $index }">
+                <el-button type="primary" link @click="clickInformationMore(row, $index)">更多</el-button>
+                <el-button type="primary" link @click="clickDelete($index)">删除</el-button>
+              </template>
+            </el-table-column>
+          </el-table>
+        </div>
+      </template>
+    </byForm>
+
+    <el-dialog title="更多联系方式" v-if="openPerson" v-model="openPerson" width="700">
+      <el-form :label-position="'top'" :model="formPerson.data" :rules="rulesPerson" ref="person">
+        <el-form-item label="联系人" prop="name">
+          <el-input v-model="formPerson.data.name" />
+        </el-form-item>
+        <el-form-item label="电子邮箱" prop="email">
+          <el-input v-model="formPerson.data.email" />
+        </el-form-item>
+        <el-form-item label="更多联系方式">
+          <div style="width: 100%">
+            <el-button type="primary" @click="clickAddMoreInformation">添 加</el-button>
+            <el-table :data="formPerson.data.contact" style="width: 100%; margin-top: 16px">
+              <el-table-column label="类型" width="180">
+                <template #default="{ row, $index }">
+                  <div style="width: 100%">
+                    <el-form-item :prop="'contact.' + $index + '.type'" :rules="rulesPerson.type" :inline-message="true">
+                      <el-select v-model="row.type" placeholder="请选择类型" style="width: 100%">
+                        <el-option v-for="item in contactType" :key="item.value" :label="item.label" :value="item.value" />
+                      </el-select>
+                    </el-form-item>
+                  </div>
+                </template>
+              </el-table-column>
+              <el-table-column label="联系号码">
+                <template #default="{ row, $index }">
+                  <div style="width: 100%">
+                    <el-form-item :prop="'contact.' + $index + '.contactNo'" :rules="rulesPerson.contactNo" :inline-message="true">
+                      <el-input v-model="row.contactNo" placeholder="请输入联系号码" />
+                    </el-form-item>
+                  </div>
+                </template>
+              </el-table-column>
+              <el-table-column align="center" label="操作" width="120" fixed="right">
+                <template #default="{ $index }">
+                  <el-button type="primary" link @click="clickInformationDelete($index)">删除</el-button>
+                </template>
+              </el-table-column>
+            </el-table>
+          </div>
+        </el-form-item>
+      </el-form>
+      <template #footer>
+        <el-button @click="openPerson = false" size="large">取 消</el-button>
+        <el-button type="primary" @click="submitPerson()" size="large">确 定</el-button>
+      </template>
+    </el-dialog>
+  </div>
+</template>
+
+<script setup>
+import { ElMessage, ElMessageBox } from "element-plus";
+import byForm from "@/components/byForm/index";
+import useUserStore from "@/store/modules/user";
+import selectCity from "@/components/selectCity/index.vue";
+const props = defineProps({
+  modalType: String,
+  customerId: String,
+  isPrivate: {
+    type: Boolean,
+    default: false,
+  },
+  isHighseas: {
+    type: Boolean,
+    default: false,
+  },
+});
+const modalType = ref("add");
+const isHighseas = ref(false);
+isHighseas.value = props.isHighseas;
+const customerId = ref("");
+const { proxy } = getCurrentInstance();
+const loading = ref(false);
+const customerTag = ref([]);
+const customerSource = ref([]);
+const customerStatus = ref([]);
+const contactType = ref([]);
+const userList = ref([]);
+const submit = ref(null);
+const formData = reactive({
+  data: {
+    countryId: "44",
+  },
+});
+const getDict = () => {
+  proxy
+    .getDictOne([
+      "customer_tag",
+      "customer_source",
+      "customer_status",
+      "contact_type",
+    ])
+    .then((res) => {
+      customerTag.value = res["customer_tag"].map((x) => ({
+        label: x.dictValue,
+        value: x.dictKey,
+      }));
+      customerSource.value = res["customer_source"].map((x) => ({
+        label: x.dictValue,
+        value: x.dictKey,
+      }));
+      customerStatus.value = res["customer_status"].map((x) => ({
+        label: x.dictValue,
+        value: x.dictKey,
+      }));
+      contactType.value = res["contact_type"].map((x) => ({
+        label: x.dictValue,
+        value: x.dictKey,
+      }));
+    });
+  proxy
+    .get("/tenantUser/list", {
+      pageNum: 1,
+      pageSize: 10000,
+      tenantId: useUserStore().user.tenantId,
+    })
+    .then((res) => {
+      userList.value = res.rows.map((item) => {
+        return {
+          label: item.nickName,
+          value: item.userId,
+        };
+      });
+    });
+};
+getDict();
+const countryData = ref([]);
+const provinceData = ref([]);
+const cityData = ref([]);
+const getCityData = (id, type, isChange) => {
+  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;
+    }
+  });
+};
+getCityData("0");
+const getDtl = () => {
+  loading.value = true;
+  proxy.post("/customer/detail", { id: customerId.value }).then((res) => {
+    if (res.tag) {
+      res.tags = res.tag.split(",");
+    } else {
+      res.tags = [];
+    }
+    formData.data = res;
+    getCityData(formData.data.countryId, "20");
+    if (formData.data.provinceId) {
+      getCityData(formData.data.provinceId, "30");
+    }
+    loading.value = false;
+  });
+};
+if (props && props.modalType) {
+  modalType.value = props.modalType;
+  if (modalType.value == "add") {
+    formData.data = {
+      countryId: "44",
+      tags: [],
+      customerUserList: [
+        {
+          name: "",
+          email: "",
+        },
+      ],
+    };
+    getCityData(formData.data.countryId, "20");
+  } else if (modalType.value == "edit" && props.customerId) {
+    customerId.value = props.customerId;
+    getDtl();
+  }
+}
+
+const formOption = reactive({
+  inline: true,
+  labelWidth: 100,
+  itemWidth: 100,
+  rules: [],
+});
+const formConfig = computed(() => {
+  return [
+    {
+      type: "input",
+      prop: "name",
+      label: "客户名称",
+      required: true,
+      itemWidth: 100,
+      itemType: "text",
+    },
+    {
+      type: "slot",
+      slotName: "allAddress",
+      label: "详细地址",
+    },
+    {
+      type: "select",
+      label: "客户来源",
+      prop: "source",
+      itemWidth: 50,
+      data: customerSource.value,
+    },
+    {
+      type: "select",
+      label: "客户类型",
+      prop: "status",
+      itemWidth: 50,
+      data: customerStatus.value,
+    },
+    {
+      type: "select",
+      label: "业务员",
+      prop: "userId",
+      itemWidth: 100,
+      data: userList.value,
+      clearable: true,
+      disabled: modalType.value == "edit" || isHighseas.value,
+    },
+    {
+      type: "select",
+      label: "客户标签",
+      prop: "tags",
+      itemWidth: 100,
+      multiple: true,
+      data: customerTag.value,
+      style: {
+        width: "100%",
+      },
+    },
+    {
+      type: "input",
+      prop: "beneficiaryName",
+      label: "Beneficiary Name",
+      required: true,
+      itemWidth: 50,
+      itemType: "text",
+    },
+    {
+      type: "input",
+      prop: "beneficiaryAccountNumber",
+      label: "Beneficiary Account Number",
+      required: true,
+      itemWidth: 50,
+      itemType: "text",
+    },
+    {
+      type: "input",
+      prop: "beneficiaryBank",
+      label: "Beneficiary Bank",
+      required: true,
+      itemWidth: 50,
+      itemType: "text",
+    },
+    {
+      type: "input",
+      prop: "swiftCode",
+      label: "Swift Code",
+      required: true,
+      itemWidth: 50,
+      itemType: "text",
+    },
+    {
+      type: "input",
+      prop: "beneficiaryBankAddress",
+      label: "Beneficiary Bank Address",
+      required: true,
+      itemWidth: 50,
+      itemType: "text",
+    },
+    {
+      type: "input",
+      prop: "beneficiaryAddress",
+      label: "Beneficiary Address",
+      required: true,
+      itemWidth: 50,
+      itemType: "text",
+    },
+    {
+      type: "slot",
+      slotName: "person",
+      label: "客户联系人",
+    },
+  ];
+});
+
+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" }],
+  source: [{ required: true, message: "请选择客户来源", trigger: "change" }],
+  status: [{ required: true, message: "请选择类型", trigger: "change" }],
+});
+if (props.isPrivate) {
+  rules.value.userId = [
+    { required: true, message: "请选择业务员", trigger: "change" },
+  ];
+}
+const clickAddPerson = () => {
+  if (
+    formData.data.customerUserList &&
+    formData.data.customerUserList.length > 0
+  ) {
+    formData.data.customerUserList.push({
+      name: "",
+      email: "",
+    });
+  } else {
+    formData.data.customerUserList = [
+      {
+        name: "",
+        email: "",
+      },
+    ];
+  }
+};
+const formPerson = reactive({
+  data: {},
+});
+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" }],
+});
+const person = ref(null);
+const openPerson = ref(false);
+const moreIndex = ref(0);
+const clickInformationMore = (item, index) => {
+  moreIndex.value = index;
+  if (item.contactJson) {
+    item.contact = JSON.parse(item.contactJson);
+  } else {
+    item.contact = [];
+  }
+  formPerson.data = proxy.deepClone(item);
+  openPerson.value = true;
+};
+const clickDelete = (index) => {
+  formData.data.customerUserList.splice(index, 1);
+};
+const clickAddMoreInformation = () => {
+  if (formPerson.data.contact && formPerson.data.contact.length > 0) {
+    formPerson.data.contact.push({
+      type: "",
+      contactNo: "",
+    });
+  } else {
+    formPerson.data.contact = [
+      {
+        type: "",
+        contactNo: "",
+      },
+    ];
+  }
+};
+const clickInformationDelete = (index) => {
+  formPerson.data.contact.splice(index, 1);
+};
+const submitPerson = () => {
+  person.value.validate((valid) => {
+    if (valid) {
+      formPerson.data.contactJson = JSON.stringify(formPerson.data.contact);
+      formData.data.customerUserList[moreIndex.value] = formPerson.data;
+      openPerson.value = false;
+    }
+  });
+};
+
+const handleSubmit = () => {
+  submit.value.handleSubmit(() => {
+    if (
+      formData.data.customerUserList &&
+      formData.data.customerUserList.length > 0
+    ) {
+      formData.data.tag = formData.data.tags.join(",");
+      loading.value = true;
+      proxy.post("/customer/" + modalType.value, formData.data).then(
+        () => {
+          ElMessage({
+            message: modalType.value == "add" ? "添加成功" : "编辑成功",
+            type: "success",
+          });
+          proxy.$emit("refreshList");
+          loading.value = false;
+        },
+        (err) => {
+          console.log(err);
+          loading.value = false;
+        }
+      );
+    } else {
+      ElMessage("请添加客户联系人");
+    }
+  });
+};
+defineExpose({
+  handleSubmit,
+});
+</script>
+
+<style lang="scss" scoped>
+</style>

+ 17 - 382
src/views/customer/file/index.vue

@@ -199,122 +199,11 @@
       </div>
     </div>
 
-    <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 #allAddress>
-          <el-row style="width: 100%">
-            <el-col :span="8">
-              <el-form-item prop="countryId">
-                <el-select v-model="formData.data.countryId" placeholder="国家" filterable @change="(val) => getCityData(val, '20', true)">
-                  <el-option v-for="item in countryData" :label="item.name" :value="item.id">
-                  </el-option>
-                </el-select>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <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="cityName">
-                <selectCity placeholder="城市" addressId="cityId" addressName="cityName" v-model="formData.data" :data="cityData"></selectCity>
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row style="margin-top: 20px; width: 100%">
-            <el-col :span="24">
-              <el-form-item prop="address">
-                <el-input v-model="formData.data.address" type="textarea">
-                </el-input>
-              </el-form-item>
-            </el-col>
-          </el-row>
-        </template>
-        <template #person>
-          <div style="width: 100%">
-            <el-button type="primary" @click="clickAddPerson">添 加</el-button>
-            <el-table :data="formData.data.customerUserList" style="width: 100%; margin-top: 16px">
-              <el-table-column label="联系人" width="160">
-                <template #default="{ row, $index }">
-                  <div style="width: 100%">
-                    <el-form-item :prop="'customerUserList.' + $index + '.name'" :rules="rules.name2" :inline-message="true">
-                      <el-input v-model="row.name" placeholder="请输入联系人" />
-                    </el-form-item>
-                  </div>
-                </template>
-              </el-table-column>
-              <el-table-column label="电子邮箱">
-                <template #default="{ row, $index }">
-                  <div style="width: 100%">
-                    <el-form-item :prop="'customerUserList.' + $index + '.email'" :rules="rules.email" :inline-message="true">
-                      <el-input v-model="row.email" placeholder="请输入电子邮箱" />
-                    </el-form-item>
-                  </div>
-                </template>
-              </el-table-column>
-              <el-table-column align="center" label="操作" width="120" fixed="right">
-                <template #default="{ row, $index }">
-                  <el-button type="primary" link @click="clickInformationMore(row, $index)">更多</el-button>
-                  <el-button type="primary" link @click="clickDelete($index)">删除</el-button>
-                </template>
-              </el-table-column>
-            </el-table>
-          </div>
-        </template>
-      </byForm>
+    <el-dialog :title="modalType == 'add' ? '新增' : '编辑'" v-if="dialogVisible" v-model="dialogVisible" width="800">
+      <AddCustomer ref="AddCustomerDom" :modalType="modalType" :customerId="customerId" @refreshList="refreshList"></AddCustomer>
       <template #footer>
         <el-button @click="dialogVisible = false" size="large">取 消</el-button>
-        <el-button type="primary" @click="submitForm()" size="large" :loading="submitLoading">确 定</el-button>
-      </template>
-    </el-dialog>
-
-    <el-dialog title="更多联系方式" v-if="openPerson" v-model="openPerson" width="700">
-      <el-form :label-position="'top'" :model="formPerson.data" :rules="rulesPerson" ref="person">
-        <el-form-item label="联系人" prop="name">
-          <el-input v-model="formPerson.data.name" />
-        </el-form-item>
-        <el-form-item label="电子邮箱" prop="email">
-          <el-input v-model="formPerson.data.email" />
-        </el-form-item>
-        <el-form-item label="更多联系方式">
-          <div style="width: 100%">
-            <el-button type="primary" @click="clickAddMoreInformation">添 加</el-button>
-            <el-table :data="formPerson.data.contact" style="width: 100%; margin-top: 16px">
-              <el-table-column label="类型" width="180">
-                <template #default="{ row, $index }">
-                  <div style="width: 100%">
-                    <el-form-item :prop="'contact.' + $index + '.type'" :rules="rulesPerson.type" :inline-message="true">
-                      <el-select v-model="row.type" placeholder="请选择类型" style="width: 100%">
-                        <el-option v-for="item in contactType" :key="item.value" :label="item.label" :value="item.value" />
-                      </el-select>
-                    </el-form-item>
-                  </div>
-                </template>
-              </el-table-column>
-              <el-table-column label="联系号码">
-                <template #default="{ row, $index }">
-                  <div style="width: 100%">
-                    <el-form-item :prop="'contact.' + $index + '.contactNo'" :rules="rulesPerson.contactNo" :inline-message="true">
-                      <el-input v-model="row.contactNo" placeholder="请输入联系号码" />
-                    </el-form-item>
-                  </div>
-                </template>
-              </el-table-column>
-              <el-table-column align="center" label="操作" width="120" fixed="right">
-                <template #default="{ $index }">
-                  <el-button type="primary" link @click="clickInformationDelete($index)">删除</el-button>
-                </template>
-              </el-table-column>
-            </el-table>
-          </div>
-        </el-form-item>
-      </el-form>
-      <template #footer>
-        <el-button @click="openPerson = false" size="large">取 消</el-button>
-        <el-button type="primary" @click="submitPerson()" size="large">确 定</el-button>
+        <el-button type="primary" @click="submitForm()" size="large">确 定</el-button>
       </template>
     </el-dialog>
 
@@ -455,13 +344,13 @@ import { computed, ref } from "vue";
 import useUserStore from "@/store/modules/user";
 import selectCity from "@/components/selectCity/index.vue";
 import TitleInfo from "@/components/TitleInfo/index.vue";
-
+import AddCustomer from "@/views/customer/addCustomer.vue";
+const AddCustomerDom = ref(null);
+const customerId = ref("");
 const { proxy } = getCurrentInstance();
 const activeNames = ref(["1", "2", "3", "4"]);
 const loading = ref(false);
-const loadingOperation = ref(false);
 const submitLoading = ref(false);
-const openPerson = ref(false);
 const openAllocation = ref(false);
 const customerTag = ref([]);
 const customerSource = ref([]);
@@ -759,15 +648,8 @@ const config = computed(() => {
 });
 const modalType = ref("add");
 const dialogVisible = ref(false);
-const formData = reactive({
-  data: {
-    countryId: "44",
-  },
-});
+
 const openFollow = ref(false);
-const formPerson = reactive({
-  data: {},
-});
 const formAllocation = reactive({
   data: {},
 });
@@ -780,117 +662,6 @@ const formOption = reactive({
   itemWidth: 100,
   rules: [],
 });
-const formConfig = computed(() => {
-  return [
-    {
-      type: "input",
-      prop: "name",
-      label: "客户名称",
-      required: true,
-      itemWidth: 100,
-      itemType: "text",
-    },
-    {
-      type: "slot",
-      slotName: "allAddress",
-      label: "详细地址",
-    },
-    {
-      type: "select",
-      label: "客户来源",
-      prop: "source",
-      itemWidth: 50,
-      data: customerSource.value,
-    },
-    {
-      type: "select",
-      label: "客户类型",
-      prop: "status",
-      itemWidth: 50,
-      data: customerStatus.value,
-    },
-    {
-      type: "select",
-      label: "业务员",
-      prop: "userId",
-      itemWidth: 100,
-      data: userList.value,
-      clearable: true,
-    },
-    {
-      type: "select",
-      label: "客户标签",
-      prop: "tags",
-      itemWidth: 100,
-      multiple: true,
-      data: customerTag.value,
-      style: {
-        width: "100%",
-      },
-    },
-    {
-      type: "input",
-      prop: "beneficiaryName",
-      label: "Beneficiary Name",
-      required: true,
-      itemWidth: 50,
-      itemType: "text",
-    },
-    {
-      type: "input",
-      prop: "beneficiaryAccountNumber",
-      label: "Beneficiary Account Number",
-      required: true,
-      itemWidth: 50,
-      itemType: "text",
-    },
-    {
-      type: "input",
-      prop: "beneficiaryBank",
-      label: "Beneficiary Bank",
-      required: true,
-      itemWidth: 50,
-      itemType: "text",
-    },
-    {
-      type: "input",
-      prop: "swiftCode",
-      label: "Swift Code",
-      required: true,
-      itemWidth: 50,
-      itemType: "text",
-    },
-    {
-      type: "input",
-      prop: "beneficiaryBankAddress",
-      label: "Beneficiary Bank Address",
-      required: true,
-      itemWidth: 50,
-      itemType: "text",
-    },
-    {
-      type: "input",
-      prop: "beneficiaryAddress",
-      label: "Beneficiary Address",
-      required: true,
-      itemWidth: 50,
-      itemType: "text",
-    },
-    {
-      type: "slot",
-      slotName: "person",
-      label: "客户联系人",
-    },
-  ];
-});
-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" }],
-  source: [{ required: true, message: "请选择客户来源", trigger: "change" }],
-  status: [{ required: true, message: "请选择类型", trigger: "change" }],
-});
 const formConfigAllocation = computed(() => {
   return [
     {
@@ -930,18 +701,10 @@ const formConfigAFollow = computed(() => {
     },
   ];
 });
-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" }],
-});
 const rulesFollow = ref({
   date: [{ required: true, message: "请选择跟进时间", trigger: "change" }],
   content: [{ required: true, message: "请输入跟进内容", trigger: "blur" }],
 });
-const submit = ref(null);
-const person = ref(null);
 const allocation = ref(null);
 const follow = ref(null);
 const getList = async (req) => {
@@ -963,65 +726,11 @@ const getList = async (req) => {
     }, 200);
   });
 };
-const countryData = ref([]);
-const provinceData = ref([]);
-const cityData = ref([]);
-const getCityData = (id, type, isChange) => {
-  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;
-    }
-  });
-};
-getCityData("0");
+
 const openModal = () => {
   modalType.value = "add";
-  formData.data = {
-    countryId: "44",
-    tags: [],
-    customerUserList: [
-      {
-        name: "",
-        email: "",
-      },
-    ],
-  };
-  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({
-      name: "",
-      email: "",
-    });
-  } else {
-    formData.data.customerUserList = [
-      {
-        name: "",
-        email: "",
-      },
-    ];
-  }
-};
 const submitAllocation = () => {
   allocation.value.handleSubmit(() => {
     proxy.post("/customer/CustomerAllocation", formAllocation.data).then(() => {
@@ -1066,33 +775,7 @@ const submitFollow = () => {
   });
 };
 const submitForm = () => {
-  submit.value.handleSubmit(() => {
-    if (
-      formData.data.customerUserList &&
-      formData.data.customerUserList.length > 0
-    ) {
-      formData.data.tag = formData.data.tags.join(",");
-      submitLoading.value = true;
-      proxy.post("/customer/" + modalType.value, formData.data).then(
-        () => {
-          ElMessage({
-            message: modalType.value == "add" ? "添加成功" : "编辑成功",
-            type: "success",
-          });
-          dialogVisible.value = false;
-          submitLoading.value = false;
-          getList();
-          obtainStatisticalData();
-        },
-        (err) => {
-          console.log(err);
-          submitLoading.value = false;
-        }
-      );
-    } else {
-      ElMessage("请添加客户联系人");
-    }
-  });
+  AddCustomerDom.value.handleSubmit();
 };
 const getDict = () => {
   proxy
@@ -1325,47 +1008,7 @@ const judgeTotal = () => {
   }
   return false;
 };
-const moreIndex = ref(0);
-const clickInformationMore = (item, index) => {
-  moreIndex.value = index;
-  if (item.contactJson) {
-    item.contact = JSON.parse(item.contactJson);
-  } else {
-    item.contact = [];
-  }
-  formPerson.data = proxy.deepClone(item);
-  openPerson.value = true;
-};
-const clickDelete = (index) => {
-  formData.data.customerUserList.splice(index, 1);
-};
-const clickAddMoreInformation = () => {
-  if (formPerson.data.contact && formPerson.data.contact.length > 0) {
-    formPerson.data.contact.push({
-      type: "",
-      contactNo: "",
-    });
-  } else {
-    formPerson.data.contact = [
-      {
-        type: "",
-        contactNo: "",
-      },
-    ];
-  }
-};
-const clickInformationDelete = (index) => {
-  formPerson.data.contact.splice(index, 1);
-};
-const submitPerson = () => {
-  person.value.validate((valid) => {
-    if (valid) {
-      formPerson.data.contactJson = JSON.stringify(formPerson.data.contact);
-      formData.data.customerUserList[moreIndex.value] = formPerson.data;
-      openPerson.value = false;
-    }
-  });
-};
+
 const deleteTop = (item) => {
   proxy.post("/customerTop/delete", { customerId: item.id }).then(() => {
     item.isTop = 0;
@@ -1497,21 +1140,8 @@ const getNum = (val) => {
 };
 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");
-    if (formData.data.provinceId) {
-      getCityData(formData.data.provinceId, "30");
-    }
-    loadingOperation.value = false;
-    dialogVisible.value = true;
-  });
+  customerId.value = row.id;
+  dialogVisible.value = true;
 };
 const countrySearchData = ref([]);
 const provinceSearchData = ref([]);
@@ -1650,6 +1280,11 @@ onMounted(() => {
     }
   );
 });
+
+const refreshList = () => {
+  dialogVisible.value = false;
+  getList();
+};
 </script>
 
 <style lang="scss" scoped>

+ 13 - 251
src/views/customer/highseas/index.vue

@@ -196,124 +196,13 @@
     </div>
 
     <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>
-          <el-row style="width: 100%">
-            <el-col :span="8">
-              <el-form-item prop="countryId">
-                <el-select v-model="formData.data.countryId" placeholder="国家" filterable @change="(val) => getCityData(val, '20', true)">
-                  <el-option v-for="item in countryData" :label="item.name" :value="item.id">
-                  </el-option>
-                </el-select>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <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="cityName">
-                <selectCity placeholder="城市" addressId="cityId" addressName="cityName" v-model="formData.data" :data="cityData"></selectCity>
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row style="margin-top: 20px; width: 100%">
-            <el-col :span="24">
-              <el-form-item prop="address">
-                <el-input v-model="formData.data.address" type="textarea">
-                </el-input>
-              </el-form-item>
-            </el-col>
-          </el-row>
-        </template>
-        <template #person>
-          <div style="width: 100%">
-            <el-button type="primary" @click="clickAddPerson">添 加</el-button>
-            <el-table :data="formData.data.customerUserList" style="width: 100%; margin-top: 16px">
-              <el-table-column label="联系人" width="160">
-                <template #default="{ row, $index }">
-                  <div style="width: 100%">
-                    <el-form-item :prop="'customerUserList.' + $index + '.name'" :rules="rules.name2" :inline-message="true">
-                      <el-input v-model="row.name" placeholder="请输入联系人" />
-                    </el-form-item>
-                  </div>
-                </template>
-              </el-table-column>
-              <el-table-column label="电子邮箱">
-                <template #default="{ row, $index }">
-                  <div style="width: 100%">
-                    <el-form-item :prop="'customerUserList.' + $index + '.email'" :rules="rules.email" :inline-message="true">
-                      <el-input v-model="row.email" placeholder="请输入电子邮箱" />
-                    </el-form-item>
-                  </div>
-                </template>
-              </el-table-column>
-              <el-table-column align="center" label="操作" width="120" fixed="right">
-                <template #default="{ row, $index }">
-                  <el-button type="primary" link @click="clickInformationMore(row, $index)">更多</el-button>
-                  <el-button type="primary" link @click="clickDelete($index)">删除</el-button>
-                </template>
-              </el-table-column>
-            </el-table>
-          </div>
-        </template>
-      </byForm>
+      <AddCustomer ref="AddCustomerDom" :modalType="modalType" :customerId="customerId" :isHighseas="true" @refreshList="refreshList"></AddCustomer>
       <template #footer>
         <el-button @click="dialogVisible = false" size="large">取 消</el-button>
         <el-button type="primary" @click="submitForm()" size="large" :loading="submitLoading">确 定</el-button>
       </template>
     </el-dialog>
 
-    <el-dialog title="更多联系方式" v-if="openPerson" v-model="openPerson" width="700">
-      <el-form :label-position="'top'" :model="formPerson.data" :rules="rulesPerson" ref="person">
-        <el-form-item label="联系人" prop="name">
-          <el-input v-model="formPerson.data.name" />
-        </el-form-item>
-        <el-form-item label="电子邮箱" prop="email">
-          <el-input v-model="formPerson.data.email" />
-        </el-form-item>
-        <el-form-item label="更多联系方式">
-          <div style="width: 100%">
-            <el-button type="primary" @click="clickAddMoreInformation">添 加</el-button>
-            <el-table :data="formPerson.data.contact" style="width: 100%; margin-top: 16px">
-              <el-table-column label="类型" width="180">
-                <template #default="{ row, $index }">
-                  <div style="width: 100%">
-                    <el-form-item :prop="'contact.' + $index + '.type'" :rules="rulesPerson.type" :inline-message="true">
-                      <el-select v-model="row.type" placeholder="请选择类型" style="width: 100%">
-                        <el-option v-for="item in contactType" :key="item.value" :label="item.label" :value="item.value" />
-                      </el-select>
-                    </el-form-item>
-                  </div>
-                </template>
-              </el-table-column>
-              <el-table-column label="联系号码">
-                <template #default="{ row, $index }">
-                  <div style="width: 100%">
-                    <el-form-item :prop="'contact.' + $index + '.contactNo'" :rules="rulesPerson.contactNo" :inline-message="true">
-                      <el-input v-model="row.contactNo" placeholder="请输入联系号码" />
-                    </el-form-item>
-                  </div>
-                </template>
-              </el-table-column>
-              <el-table-column align="center" label="操作" width="120" fixed="right">
-                <template #default="{ $index }">
-                  <el-button type="primary" link @click="clickInformationDelete($index)">删除</el-button>
-                </template>
-              </el-table-column>
-            </el-table>
-          </div>
-        </el-form-item>
-      </el-form>
-      <template #footer>
-        <el-button @click="openPerson = false" size="large">取 消</el-button>
-        <el-button type="primary" @click="submitPerson()" size="large">确 定</el-button>
-      </template>
-    </el-dialog>
-
     <el-dialog title="添加跟进记录" v-if="openFollow" v-model="openFollow" width="500" destroy-on-close>
       <byForm :formConfig="formConfigAFollow" :formOption="formOption" v-model="formFollow.data" :rules="rulesFollow" ref="follow">
         <template #fileSlot>
@@ -442,7 +331,9 @@ import { computed, ref } from "vue";
 import useUserStore from "@/store/modules/user";
 import selectCity from "@/components/selectCity/index.vue";
 import TitleInfo from "@/components/TitleInfo/index.vue";
-
+import AddCustomer from "@/views/customer/addCustomer.vue";
+const AddCustomerDom = ref(null);
+const customerId = ref("");
 const { proxy } = getCurrentInstance();
 const activeNames = ref(["1", "2", "3", "4"]);
 const loading = ref(false);
@@ -879,63 +770,9 @@ const getList = async (req) => {
 };
 const openModal = () => {
   modalType.value = "add";
-  formData.data = {
-    countryId: "44",
-    tags: [],
-    customerUserList: [
-      {
-        name: "",
-        email: "",
-      },
-    ],
-  };
-  getCityData(formData.data.countryId, "20");
-  loadingOperation.value = false;
   dialogVisible.value = true;
 };
-const countryData = ref([]);
-const provinceData = ref([]);
-const cityData = ref([]);
-const getCityData = (id, type, isChange) => {
-  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;
-    }
-  });
-};
-getCityData("0");
-const clickAddPerson = () => {
-  if (
-    formData.data.customerUserList &&
-    formData.data.customerUserList.length > 0
-  ) {
-    formData.data.customerUserList.push({
-      name: "",
-      email: "",
-    });
-  } else {
-    formData.data.customerUserList = [
-      {
-        name: "",
-        email: "",
-      },
-    ];
-  }
-};
+
 const submitFollow = () => {
   follow.value.handleSubmit(() => {
     if (fileList.value && fileList.value.length > 0) {
@@ -967,33 +804,7 @@ const submitFollow = () => {
   });
 };
 const submitForm = () => {
-  submit.value.handleSubmit(() => {
-    if (
-      formData.data.customerUserList &&
-      formData.data.customerUserList.length > 0
-    ) {
-      formData.data.tag = formData.data.tags.join(",");
-      submitLoading.value = true;
-      proxy.post("/customer/" + modalType.value, formData.data).then(
-        () => {
-          ElMessage({
-            message: modalType.value == "add" ? "添加成功" : "编辑成功",
-            type: "success",
-          });
-          dialogVisible.value = false;
-          submitLoading.value = false;
-          getList();
-          obtainStatisticalData();
-        },
-        (err) => {
-          console.log(err);
-          submitLoading.value = false;
-        }
-      );
-    } else {
-      ElMessage("请添加客户联系人");
-    }
-  });
+  AddCustomerDom.value.handleSubmit();
 };
 const getDict = () => {
   proxy
@@ -1226,47 +1037,7 @@ const judgeTotal = () => {
   }
   return false;
 };
-const moreIndex = ref(0);
-const clickInformationMore = (item, index) => {
-  moreIndex.value = index;
-  if (item.contactJson) {
-    item.contact = JSON.parse(item.contactJson);
-  } else {
-    item.contact = [];
-  }
-  formPerson.data = proxy.deepClone(item);
-  openPerson.value = true;
-};
-const clickDelete = (index) => {
-  formData.data.customerUserList.splice(index, 1);
-};
-const clickAddMoreInformation = () => {
-  if (formPerson.data.contact && formPerson.data.contact.length > 0) {
-    formPerson.data.contact.push({
-      type: "",
-      contactNo: "",
-    });
-  } else {
-    formPerson.data.contact = [
-      {
-        type: "",
-        contactNo: "",
-      },
-    ];
-  }
-};
-const clickInformationDelete = (index) => {
-  formPerson.data.contact.splice(index, 1);
-};
-const submitPerson = () => {
-  person.value.validate((valid) => {
-    if (valid) {
-      formPerson.data.contactJson = JSON.stringify(formPerson.data.contact);
-      formData.data.customerUserList[moreIndex.value] = formPerson.data;
-      openPerson.value = false;
-    }
-  });
-};
+
 const deleteTop = (item) => {
   proxy.post("/customerTop/delete", { customerId: item.id }).then(() => {
     item.isTop = 0;
@@ -1518,21 +1289,8 @@ const changeSearchTag = (val) => {
 
 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");
-    if (formData.data.provinceId) {
-      getCityData(formData.data.provinceId, "30");
-    }
-    loadingOperation.value = false;
-    dialogVisible.value = true;
-  });
+  customerId.value = row.id;
+  dialogVisible.value = true;
 };
 
 const table = ref(null);
@@ -1545,6 +1303,10 @@ onMounted(() => {
     }
   );
 });
+const refreshList = () => {
+  dialogVisible.value = false;
+  getList();
+};
 </script>
 
 <style lang="scss" scoped>

+ 13 - 252
src/views/customer/privatesea/index.vue

@@ -195,124 +195,13 @@
     </div>
 
     <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>
-          <el-row style="width: 100%">
-            <el-col :span="8">
-              <el-form-item prop="countryId">
-                <el-select v-model="formData.data.countryId" placeholder="国家" filterable @change="(val) => getCityData(val, '20', true)">
-                  <el-option v-for="item in countryData" :label="item.name" :value="item.id">
-                  </el-option>
-                </el-select>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <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="cityName">
-                <selectCity placeholder="城市" addressId="cityId" addressName="cityName" v-model="formData.data" :data="cityData"></selectCity>
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row style="margin-top: 20px; width: 100%">
-            <el-col :span="24">
-              <el-form-item prop="address">
-                <el-input v-model="formData.data.address" type="textarea">
-                </el-input>
-              </el-form-item>
-            </el-col>
-          </el-row>
-        </template>
-        <template #person>
-          <div style="width: 100%">
-            <el-button type="primary" @click="clickAddPerson">添 加</el-button>
-            <el-table :data="formData.data.customerUserList" style="width: 100%; margin-top: 16px">
-              <el-table-column label="联系人" width="160">
-                <template #default="{ row, $index }">
-                  <div style="width: 100%">
-                    <el-form-item :prop="'customerUserList.' + $index + '.name'" :rules="rules.name2" :inline-message="true">
-                      <el-input v-model="row.name" placeholder="请输入联系人" />
-                    </el-form-item>
-                  </div>
-                </template>
-              </el-table-column>
-              <el-table-column label="电子邮箱">
-                <template #default="{ row, $index }">
-                  <div style="width: 100%">
-                    <el-form-item :prop="'customerUserList.' + $index + '.email'" :rules="rules.email" :inline-message="true">
-                      <el-input v-model="row.email" placeholder="请输入电子邮箱" />
-                    </el-form-item>
-                  </div>
-                </template>
-              </el-table-column>
-              <el-table-column align="center" label="操作" width="120" fixed="right">
-                <template #default="{ row, $index }">
-                  <el-button type="primary" link @click="clickInformationMore(row, $index)">更多</el-button>
-                  <el-button type="primary" link @click="clickDelete($index)">删除</el-button>
-                </template>
-              </el-table-column>
-            </el-table>
-          </div>
-        </template>
-      </byForm>
+      <AddCustomer ref="AddCustomerDom" :modalType="modalType" :customerId="customerId" :isPrivate="true" @refreshList="refreshList"></AddCustomer>
       <template #footer>
         <el-button @click="dialogVisible = false" size="large">取 消</el-button>
         <el-button type="primary" @click="submitForm()" size="large" :loading="submitLoading">确 定</el-button>
       </template>
     </el-dialog>
 
-    <el-dialog title="更多联系方式" v-if="openPerson" v-model="openPerson" width="700">
-      <el-form :label-position="'top'" :model="formPerson.data" :rules="rulesPerson" ref="person">
-        <el-form-item label="联系人" prop="name">
-          <el-input v-model="formPerson.data.name" />
-        </el-form-item>
-        <el-form-item label="电子邮箱" prop="email">
-          <el-input v-model="formPerson.data.email" />
-        </el-form-item>
-        <el-form-item label="更多联系方式">
-          <div style="width: 100%">
-            <el-button type="primary" @click="clickAddMoreInformation">添 加</el-button>
-            <el-table :data="formPerson.data.contact" style="width: 100%; margin-top: 16px">
-              <el-table-column label="类型" width="180">
-                <template #default="{ row, $index }">
-                  <div style="width: 100%">
-                    <el-form-item :prop="'contact.' + $index + '.type'" :rules="rulesPerson.type" :inline-message="true">
-                      <el-select v-model="row.type" placeholder="请选择类型" style="width: 100%">
-                        <el-option v-for="item in contactType" :key="item.value" :label="item.label" :value="item.value" />
-                      </el-select>
-                    </el-form-item>
-                  </div>
-                </template>
-              </el-table-column>
-              <el-table-column label="联系号码">
-                <template #default="{ row, $index }">
-                  <div style="width: 100%">
-                    <el-form-item :prop="'contact.' + $index + '.contactNo'" :rules="rulesPerson.contactNo" :inline-message="true">
-                      <el-input v-model="row.contactNo" placeholder="请输入联系号码" />
-                    </el-form-item>
-                  </div>
-                </template>
-              </el-table-column>
-              <el-table-column align="center" label="操作" width="120" fixed="right">
-                <template #default="{ $index }">
-                  <el-button type="primary" link @click="clickInformationDelete($index)">删除</el-button>
-                </template>
-              </el-table-column>
-            </el-table>
-          </div>
-        </el-form-item>
-      </el-form>
-      <template #footer>
-        <el-button @click="openPerson = false" size="large">取 消</el-button>
-        <el-button type="primary" @click="submitPerson()" size="large">确 定</el-button>
-      </template>
-    </el-dialog>
-
     <el-dialog title="添加跟进记录" v-if="openFollow" v-model="openFollow" width="500" destroy-on-close>
       <byForm :formConfig="formConfigAFollow" :formOption="formOption" v-model="formFollow.data" :rules="rulesFollow" ref="follow">
         <template #fileSlot>
@@ -441,7 +330,9 @@ import { computed, ref } from "vue";
 import useUserStore from "@/store/modules/user";
 import selectCity from "@/components/selectCity/index.vue";
 import TitleInfo from "@/components/TitleInfo/index.vue";
-
+import AddCustomer from "@/views/customer/addCustomer.vue";
+const AddCustomerDom = ref(null);
+const customerId = ref("");
 const { proxy } = getCurrentInstance();
 const activeNames = ref(["1", "2", "3", "4"]);
 const route = useRoute();
@@ -879,64 +770,9 @@ const getList = async (req) => {
 };
 const openModal = () => {
   modalType.value = "add";
-  formData.data = {
-    countryId: "44",
-    userId: useUserStore().user.userId,
-    tags: [],
-    customerUserList: [
-      {
-        name: "",
-        email: "",
-      },
-    ],
-  };
-  getCityData(formData.data.countryId, "20");
-  loadingOperation.value = false;
   dialogVisible.value = true;
 };
-const countryData = ref([]);
-const provinceData = ref([]);
-const cityData = ref([]);
-const getCityData = (id, type, isChange) => {
-  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;
-    }
-  });
-};
-getCityData("0");
-const clickAddPerson = () => {
-  if (
-    formData.data.customerUserList &&
-    formData.data.customerUserList.length > 0
-  ) {
-    formData.data.customerUserList.push({
-      name: "",
-      email: "",
-    });
-  } else {
-    formData.data.customerUserList = [
-      {
-        name: "",
-        email: "",
-      },
-    ];
-  }
-};
+
 const submitFollow = () => {
   follow.value.handleSubmit(() => {
     if (fileList.value && fileList.value.length > 0) {
@@ -968,33 +804,7 @@ const submitFollow = () => {
   });
 };
 const submitForm = () => {
-  submit.value.handleSubmit(() => {
-    if (
-      formData.data.customerUserList &&
-      formData.data.customerUserList.length > 0
-    ) {
-      formData.data.tag = formData.data.tags.join(",");
-      submitLoading.value = true;
-      proxy.post("/customer/" + modalType.value, formData.data).then(
-        () => {
-          ElMessage({
-            message: modalType.value == "add" ? "添加成功" : "编辑成功",
-            type: "success",
-          });
-          dialogVisible.value = false;
-          submitLoading.value = false;
-          getList();
-          obtainStatisticalData();
-        },
-        (err) => {
-          console.log(err);
-          submitLoading.value = false;
-        }
-      );
-    } else {
-      ElMessage("请添加客户联系人");
-    }
-  });
+  AddCustomerDom.value.handleSubmit();
 };
 const getDict = () => {
   proxy
@@ -1227,47 +1037,7 @@ const judgeTotal = () => {
   }
   return false;
 };
-const moreIndex = ref(0);
-const clickInformationMore = (item, index) => {
-  moreIndex.value = index;
-  if (item.contactJson) {
-    item.contact = JSON.parse(item.contactJson);
-  } else {
-    item.contact = [];
-  }
-  formPerson.data = proxy.deepClone(item);
-  openPerson.value = true;
-};
-const clickDelete = (index) => {
-  formData.data.customerUserList.splice(index, 1);
-};
-const clickAddMoreInformation = () => {
-  if (formPerson.data.contact && formPerson.data.contact.length > 0) {
-    formPerson.data.contact.push({
-      type: "",
-      contactNo: "",
-    });
-  } else {
-    formPerson.data.contact = [
-      {
-        type: "",
-        contactNo: "",
-      },
-    ];
-  }
-};
-const clickInformationDelete = (index) => {
-  formPerson.data.contact.splice(index, 1);
-};
-const submitPerson = () => {
-  person.value.validate((valid) => {
-    if (valid) {
-      formPerson.data.contactJson = JSON.stringify(formPerson.data.contact);
-      formData.data.customerUserList[moreIndex.value] = formPerson.data;
-      openPerson.value = false;
-    }
-  });
-};
+
 const deleteTop = (item) => {
   proxy.post("/customerTop/delete", { customerId: item.id }).then(() => {
     item.isTop = 0;
@@ -1519,21 +1289,8 @@ const changeSearchTag = (val) => {
 
 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");
-    if (formData.data.provinceId) {
-      getCityData(formData.data.provinceId, "30");
-    }
-    loadingOperation.value = false;
-    dialogVisible.value = true;
-  });
+  customerId.value = row.id;
+  dialogVisible.value = true;
 };
 
 const table = ref(null);
@@ -1546,6 +1303,10 @@ onMounted(() => {
     }
   );
 });
+const refreshList = () => {
+  dialogVisible.value = false;
+  getList();
+};
 </script>
 
 <style lang="scss" scoped>

+ 16 - 45
src/views/login.vue

@@ -7,12 +7,7 @@
           <img src="../assets/images/login-img.png" alt="" />
 
           <div class="swiper-text">
-            <el-carousel
-              height="100px"
-              direction="vertical"
-              indicator-position="none"
-              :autoplay="true"
-            >
+            <el-carousel height="100px" direction="vertical" indicator-position="none" :autoplay="true">
               <el-carousel-item>
                 <h3>{{ $t("login.li1H3") }}</h3>
                 <p>{{ $t("login.li1P") }}</p>
@@ -29,44 +24,23 @@
           </div>
         </div>
         <div class="right-bg">
-          <el-form
-            ref="loginRef"
-            :model="loginForm"
-            :rules="loginRules"
-            class="login-form"
-          >
+          <el-form ref="loginRef" :model="loginForm" :rules="loginRules" class="login-form">
             <div class="form" style="margin-top: 300px">
               <div class="">{{ $t("login.welcomeToLogin") }}~</div>
               <h2>尔泓时代 {{ $t("login.managementSystem") }}</h2>
               <el-form-item prop="tenantId" style="margin-top: 30px">
-                <el-input
-                  :placeholder="$t('login.pleaseEnterTheTenantId')"
-                  prefix-icon="user"
-                  @keyup.enter="handleLogin"
-                  autocomplete="email"
-                  v-model="loginForm.tenantId"
-                >
+                <el-input :placeholder="$t('login.pleaseEnterTheTenantId')" prefix-icon="user" @keyup.enter="handleLogin" autocomplete="email"
+                          v-model="loginForm.tenantId">
                 </el-input>
               </el-form-item>
               <el-form-item prop="username" style="margin-top: 30px">
-                <el-input
-                  :placeholder="$t('login.pleaseEnterYourAccountNumber')"
-                  prefix-icon="UserFilled"
-                  @keyup.enter="handleLogin"
-                  autocomplete="username"
-                  v-model="loginForm.username"
-                >
+                <el-input :placeholder="$t('login.pleaseEnterYourAccountNumber')" prefix-icon="UserFilled" @keyup.enter="handleLogin"
+                          autocomplete="username" v-model="loginForm.username">
                 </el-input>
               </el-form-item>
               <el-form-item prop="password" style="margin-top: 30px">
-                <el-input
-                  :placeholder="$t('login.pleaseEnterYourPassword')"
-                  prefix-icon="View"
-                  type="password"
-                  v-model="loginForm.password"
-                  autocomplete="current-password"
-                  @keyup.enter="handleLogin"
-                >
+                <el-input :placeholder="$t('login.pleaseEnterYourPassword')" prefix-icon="View" type="password" v-model="loginForm.password"
+                          autocomplete="current-password" @keyup.enter="handleLogin">
                 </el-input>
               </el-form-item>
               <!-- <el-form-item prop="code" class="code" style="margin-top:30px">
@@ -79,18 +53,9 @@
 								<img :src="codeUrl" @click="getCode" class="login-code-img"/>
 							</el-form-item> -->
               <div style="margin-top: 30px">
-                <el-checkbox
-                  v-model="loginForm.rememberMe"
-                  style="margin: 0px 0px 25px 0px"
-                  >{{ $t("login.rememberPassword") }}</el-checkbox
-                >
+                <el-checkbox v-model="loginForm.rememberMe" style="margin: 0px 0px 25px 0px">{{ $t("login.rememberPassword") }}</el-checkbox>
               </div>
-              <el-button
-                type="primary"
-                @click="handleLogin"
-                style="width: 100%; margin-top: 30px"
-                >{{ $t("login.login") }}</el-button
-              >
+              <el-button type="primary" @click="handleLogin" style="width: 100%; margin-top: 30px">{{ $t("login.login") }}</el-button>
             </div>
           </el-form>
         </div>
@@ -117,6 +82,12 @@ const loginForm = ref({
   code: "",
   uuid: "",
 });
+const env = import.meta.env.VITE_APP_ENV;
+if (env == "production") {
+  loginForm.tenantId = "EHSD";
+} else {
+  loginForm.tenantId = "ehtest";
+}
 
 const loginRules = {
   username: [{ required: true, trigger: "blur", message: "请输入您的账号" }],