Bläddra i källkod

提交客户管家代码

Lijy 1 år sedan
förälder
incheckning
db8291926a

+ 0 - 5
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/business/detail/index.vue

@@ -159,10 +159,5 @@ function handleScroll(event: any) { // 滚表横向滚动
     padding-top: 4px;
     padding-bottom: 4px;
   }
-
-  .selectClas >>> .el-select__wrapper {
-    background-color: none !important;
-    box-shadow: none !important;
-  }
 }
 </style>

+ 11 - 2
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/thread/index.vue

@@ -81,8 +81,10 @@
             <el-table-column label="操作" fixed="right" width="200">
               <template #default="scope">
                 <el-button link type="primary" size="large" @click="editClue(scope.row)">编辑</el-button>
+                <!-- <el-button link type="primary" size="large"
+                  @click="dialogVisible.taskModalVisible = true">新建任务</el-button> -->
                 <el-button link type="primary" size="large"
-                  @click="dialogVisible.taskModalVisible = true">新建任务</el-button>
+                  @click="newTask(scope.row)">新建任务</el-button>
                 <el-button link type="danger" size="large" @click.prevent="deleteRow(scope.row)">删除</el-button>
               </template>
             </el-table-column>
@@ -138,7 +140,7 @@
 
     <DeteleTables :visibles="dialogVisible.deteleClueDialogVisible" @showDeteleClue="showDeteleClue" />
 
-    <TaskModal :visible="dialogVisible.taskModalVisible" :edit-form="createTaskFromType(3)" :save-loading="'1'"
+    <TaskModal :visible="dialogVisible.taskModalVisible" :edit-form="taskModalForm" :save-loading="'1'"
       @close="closeTaskModal" @submit="submitForm" :title="'新建任务'" :disabled-list="['taskType', 'clueId']" />
   </div>
 </template>
@@ -218,6 +220,7 @@ const clueTemplate = ref({
   config: {}
 }) // 线索模板
 const editForm = ref({}) // 编辑表单
+const taskModalForm = ref({}) // 任务弹窗表单
 
 // 批量变量
 const transferForm = reactive({
@@ -227,6 +230,12 @@ const transferForm = reactive({
 
 
 // 定义方法
+function newTask(item: any) {
+  const { id } = item
+  taskModalForm.value = { ...createTaskFromType(3), clueId: id, }
+  dialogVisible.taskModalVisible = true
+}
+
 function showDeteleClue(flag: boolean) {
   dialogVisible.deteleClueDialogVisible = flag
 }

+ 4 - 56
fhKeeper/formulahousekeeper/customerBuler-crm/src/router/index.ts

@@ -1,5 +1,6 @@
 import { RouteRecordRaw, createRouter, createWebHistory } from "vue-router";
 import { useStore } from "@/store/index";
+import { createRouterGuards } from "./routerGuards";
 export const routes: RouteRecordRaw[] = [
   {
     path: "/",
@@ -44,60 +45,7 @@ const router = createRouter({
   history: createWebHistory(),
   routes,
 });
-router.beforeEach((to, _from, next) => {
-  const routerList = useStore().routers;
-  const routers = router.getRoutes();
-  const { setAsyncRoutesMark, asyncRoutesMark, getToken } = useStore();
-  const token = getToken;
-  const skipPath = ["/login", "/register", "/test", "/testEcharts"];
-  if (skipPath.includes(to.path)) {
-    next();
-  } else {
-    if (token && routerList && routerList.length > 0) {
-      if (asyncRoutesMark) {
-        next();
-      } else {
-        setAsyncRoutesMark(true);
-        const newRouters: any = routers;
-        const addNewRouter = newRouters.find(
-          (item: any) => item.path == "/home"
-        );
-      
-        let modules = import.meta.glob("@/pages/**/*.vue");
-        console.log(modules);
-        routerList.forEach((item: any) => {
-          let filePath = item.path.replace("/", "")
-          if (item.children && item.children.length > 0) {
-            item.children.forEach((child: any) => {
-              let childFilePath = child.path.replace("/", "");
-              addNewRouter?.children.push({
-                path: child.path,
-                name: child.name,
-                meta: {},
-                component: modules[`/src/pages/${childFilePath}/index.vue`]
-              });
-            });
-          } else {
-            addNewRouter?.children.push({
-              path: item.path,
-              name: item.name,
-              meta: {},
-              component: modules[`/src/pages/${filePath}/index.vue`],
-            });
-          }
-        });
-        router.addRoute(addNewRouter);
-        router.addRoute({
-          path: '/:catchAll(.*)',
-          name: 'NotFound',
-          component: () => import("../pages/404.vue"),
-        })
-        next({ ...to, replace: true });
-      }
-    } else {
-      //console.log("无登录信息,跳转到登录页");
-      next(`/login`);
-    }
-  }
-});
+const { beforeEach } = createRouterGuards(router);
+
+router.beforeEach(beforeEach);
 export default router;

+ 66 - 0
fhKeeper/formulahousekeeper/customerBuler-crm/src/router/routerGuards.ts

@@ -0,0 +1,66 @@
+// src/router/routerGuards.ts
+import { RouteLocationNormalized, NavigationGuardNext, Router } from "vue-router";
+import { useStore } from "@/store/index";
+
+export function createRouterGuards(router: Router) {
+  const beforeEach = (to: RouteLocationNormalized, _from: RouteLocationNormalized, next: NavigationGuardNext) => {
+    const routerList = useStore().routers;
+    const routers = router.getRoutes();
+    const { setAsyncRoutesMark, asyncRoutesMark, getToken } = useStore();
+    const token = getToken;
+    const skipPath = ["/login", "/register", "/test", "/testEcharts"];
+    if (skipPath.includes(to.path)) {
+      next();
+    } else {
+      if (token && routerList && routerList.length > 0) {
+        if (asyncRoutesMark) {
+          next();
+        } else {
+          setAsyncRoutesMark(true);
+          const newRouters: any = routers;
+          const addNewRouter = newRouters.find(
+            (item: any) => item.path == "/home"
+          );
+
+          let modules = import.meta.glob("@/pages/**/*.vue");
+          console.log(modules);
+          routerList.forEach((item: any) => {
+            let filePath = item.path.replace("/", "")
+            if (item.children && item.children.length > 0) {
+              item.children.forEach((child: any) => {
+                let childFilePath = child.path.replace("/", "");
+                addNewRouter?.children.push({
+                  path: child.path,
+                  name: child.name,
+                  meta: {},
+                  component: modules[`/src/pages/${childFilePath}/index.vue`]
+                });
+              });
+            } else {
+              addNewRouter?.children.push({
+                path: item.path,
+                name: item.name,
+                meta: {},
+                component: modules[`/src/pages/${filePath}/index.vue`],
+              });
+            }
+          });
+          router.addRoute(addNewRouter);
+          router.addRoute({
+            path: '/:catchAll(.*)',
+            name: 'NotFound',
+            component: () => import("../pages/404.vue"),
+          })
+          next({ ...to, replace: true });
+        }
+      } else {
+        //console.log("无登录信息,跳转到登录页");
+        next(`/login`);
+      }
+    }
+  };
+
+  return {
+    beforeEach,
+  };
+}