浏览代码

Merge branch 'master' of http://47.100.37.243:10191/wutt/manHourHousekeeper

Min 1 年之前
父节点
当前提交
bbeb435124

+ 1 - 0
fhKeeper/formulahousekeeper/customerBuler-crm/src/components/TaskModal/api.ts

@@ -117,3 +117,4 @@ export const ALL_BUSINESS = "/business-opportunity/getAll"; //商机
 export const ALL_CONTACTS = "/contacts/allContacts"; //联系人
 
 export const ALL_USERS = "/user/getSimpleActiveUserList"; //获取所有人
+export const ALL_ORDERS = "/order/list"//销售订单

+ 11 - 5
fhKeeper/formulahousekeeper/customerBuler-crm/src/components/TaskModal/index.vue

@@ -128,9 +128,9 @@
 
 <script lang="ts" setup>
 import { ref, watch } from 'vue';
-import { PRIORITY, TASK_TYPE, TASK_TYPE_FIELD, defalutModalForm, REPEAT_TYPE, CUSTOMER_FORM_URL, defaultGenerateFormData, ALL_CUSTOM, ALL_CLUE, ALL_BUSINESS, ALL_CONTACTS, ALL_USERS, getTaskType } from "./api";
+import { PRIORITY, TASK_TYPE, TASK_TYPE_FIELD, defalutModalForm, REPEAT_TYPE, CUSTOMER_FORM_URL, defaultGenerateFormData, ALL_CUSTOM, ALL_CLUE, ALL_BUSINESS, ALL_CONTACTS, ALL_ORDERS, ALL_USERS, getTaskType } from "./api";
 import { GenerateForm } from "@zmjs/form-design"
-import { get } from '@/utils/request';
+import { get, post } from '@/utils/request';
 import { Delete, Plus } from "@element-plus/icons-vue"
 import { FormInstance, dayjs } from 'element-plus';
 import { getFromValue } from '@/utils/tools';
@@ -155,10 +155,10 @@ watch(() => props.visible, (val) => {
   }
 })
 const customeData = ref<any>([])
-const clueData = ref<any>([])
 const businessData = ref<any>([])
+const orderData = ref<any>([])
+const clueData = ref<any>([])
 watch(() => props.editForm, (val) => {
-
   let taskType = 0;
   if (val) {
     taskType = getTaskType(val);
@@ -175,6 +175,12 @@ watch(() => props.editForm, (val) => {
       taskTypeValueData.value = data;
     }
   })
+  post(ALL_ORDERS, { pageIndex: -1, pageSize: -1 }).then(({ data }) => {
+    orderData.value = data.record;//销售订单
+    if (taskType == 2) {
+      taskTypeValueData.value = data;
+    }
+  })
   get(ALL_CLUE, {}).then(({ data }) => {
     clueData.value = data;//线索
     if (taskType == 3) {
@@ -270,7 +276,7 @@ function changeTaskType(value: TASK_VALUE_TYPE) {
     case 2:
       taskTypeValueData.value = [];
       setTimeout(() => {
-        taskTypeValueData.value = [{ label: "订单1", value: 1 }, { label: "订单2", value: 2 }]
+        taskTypeValueData.value = orderData.value
       }, 500)
       break;
     case 3:

+ 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>

+ 3 - 1
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/tasks/ImportModal.vue

@@ -14,9 +14,11 @@
       </div>
     </template>
     <div class="text-lg p-5">
-      <div class="pb-5">1. 点击下载 <a href="###" download class="text-[#79BBFF]">任务导入模板</a></div>
+      <div class="pb-5">1. 点击下载 <a href="" download class="text-[#79BBFF]">任务导入模板</a></div>
       <div>2. 填写excel文件, 任务名称与优先级必填</div>
     </div>
+    <!-- <el-link type="primary" style="margin-left:5px;" :underline="false" href="./upload/任务导入模板.xlsx"
+      :download="'任务导入模板.xlsx'">任务导入模板</el-link> -->
   </el-dialog>
 </template>
 <script lang="ts" setup>

+ 0 - 3
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/tasks/index.vue

@@ -194,15 +194,12 @@ function submitForm(data: any, isClose: boolean) {
       taskLogs: []
     }
   }
-  // console.log("提交的数据", getFromValue(params));
-  // return;
   taskLoading.value = "2";
   let url = isEdit.value ? UPDATE_TASK : ADD_TASK
   let msg = isEdit.value ? "修改成功" : "新建成功"
   post(url, getFromValue(params)).then(() => {
     taskLoading.value = "3";
     taskModalVisible.value = isClose;
-
     globalPopup?.showSuccess(msg)
     search();
   }).catch(err => {

+ 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,
+  };
+}