Bläddra i källkod

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

seyason 1 år sedan
förälder
incheckning
a6eebc06e7

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

+ 12 - 4
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectServiceImpl.java

@@ -13041,6 +13041,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                             Map<String,Object> item=new HashMap<>();
                             item.put("projectId",project.getId());
                             item.put("projectName",project.getProjectName());
+                            item.put("projectCode",project.getProjectCode());
                             item.put("groupName",groupName);
                             item.put("corpwxDeptId",corpwxDeptid);
                             item.put("department_name",departmentName);
@@ -13095,6 +13096,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                             Map<String,Object> item=new HashMap<>();
                             item.put("projectId",project.getId());
                             item.put("projectName",project.getProjectName());
+                            item.put("projectCode",project.getProjectCode());
                             item.put("groupName",groupName);
                             item.put("corpwxDeptId",corpwxDeptid);
                             item.put("department_name",departmentName);
@@ -13153,6 +13155,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                             Map<String,Object> item=new HashMap<>();
                             item.put("projectId",project.getId());
                             item.put("projectName",project.getProjectName());
+                            item.put("projectCode",project.getProjectCode());
                             item.put("groupName",groupName);
                             item.put("corpwxDeptId",corpwxDeptid);
                             item.put("department_name",departmentName);
@@ -13298,6 +13301,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         row0.setHeight((short)500);
         List<String> row_first =new ArrayList<>();
         row_first.add("项目名称");
+        row_first.add("项目编码");
         row_first.add("负责部门");
         row_first.add("任务分组");
         row_first.add("计划工时(财务)");
@@ -13312,12 +13316,13 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
             tempCell.setCellValue(row_first.get(i));
             tempCell.setCellStyle(headStyle);
         }
-        sheet.addMergedRegion(new CellRangeAddress(0,0,4,8));
+        sheet.addMergedRegion(new CellRangeAddress(0,0,5,9));
         sheet.addMergedRegion(new CellRangeAddress(0,1,0,0));
         sheet.addMergedRegion(new CellRangeAddress(0,1,1,1));
         sheet.addMergedRegion(new CellRangeAddress(0,1,2,2));
         sheet.addMergedRegion(new CellRangeAddress(0,1,3,3));
-        sheet.addMergedRegion(new CellRangeAddress(0,1,9,9));
+        sheet.addMergedRegion(new CellRangeAddress(0,1,4,4));
+        sheet.addMergedRegion(new CellRangeAddress(0,1,10,10));
         //第二行
         SXSSFRow row1 = sheet.createRow(rowNum++);
         row1.setHeight((short)500);
@@ -13326,6 +13331,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         row_second.add("");
         row_second.add("");
         row_second.add("");
+        row_second.add("");
         row_second.add("增补工时");
         row_second.add("正常工时");
         row_second.add("加班工时");
@@ -13346,6 +13352,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
             List<Map<String, Object>> maps = listMapGroupList.get(pid);
             if(maps.size()>1){
                 sheet.addMergedRegion(new CellRangeAddress(projectNum,projectNum+maps.size()-1,0,0));
+                sheet.addMergedRegion(new CellRangeAddress(projectNum,projectNum+maps.size()-1,1,1));
             }
             Map<String, List<Map<String, Object>>> listMapGroupDeptList = maps.stream().collect(Collectors.groupingBy(m -> String.valueOf(m.get("corpwxDeptId"))));
             List<String> deptIdList = maps.stream().map(m -> String.valueOf(m.get("corpwxDeptId"))).distinct().collect(Collectors.toList());
@@ -13353,7 +13360,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
             for (String deptId : deptIdList) {
                 List<Map<String, Object>> maps1 = listMapGroupDeptList.get(deptId);
                 if(maps1.size()>1){
-                    sheet.addMergedRegion(new CellRangeAddress(deptNum,deptNum+maps1.size()-1,1,1));
+                    sheet.addMergedRegion(new CellRangeAddress(deptNum,deptNum+maps1.size()-1,2,2));
                 }
                 deptNum+=maps1.size();
             }
@@ -13361,6 +13368,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         }
         for (Map<String, Object> map : mapList) {
             list.add(String.valueOf(map.get("projectName")));
+            list.add(String.valueOf(map.get("projectCode")));
             if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
                 list.add("$departmentName="+map.get("corpwxDeptId")+"$");
             }else if(dingding!=null&&dingding.getSyncContact()==1){
@@ -13381,7 +13389,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         for(int i = 0;i<mapList.size();i++){
             SXSSFRow tempRow = sheet.createRow(rowNum++);
             tempRow.setHeight((short)500);
-            for(int j=0;j<10;j++){
+            for(int j=0;j<11;j++){
                 SXSSFCell tempCell = tempRow.createCell(j);
                 String cellValue = "";
                 tempCell.setCellStyle(cellStyle);

+ 6 - 2
fhKeeper/formulahousekeeper/timesheet/src/components/translationOpenData.vue

@@ -6,7 +6,7 @@
                 <ww-open-data :type='configuration.openType' :openid='translationValue'></ww-open-data>
             </span>
             <span v-else-if="dingdingPlatform && !noRender.includes(translationValue)">
-                <dt-open-data :open-type='configuration.openType' :open-id='translationValue'></dt-open-data>
+                <dt-open-data :open-type='dingdingOpenType[configuration.openType]' :open-id='translationValue'></dt-open-data>
             </span>
             <span v-else>{{ translationValue }}</span>
         </template>
@@ -54,7 +54,11 @@ export default {
                 renderIndex: 0,
             }, // 配置对象
 
-            noRender: ['全部人员', '未分配']
+            noRender: ['全部人员', '未分配'],
+            dingdingOpenType: {
+                userName: 'userName',
+                departmentName: 'deptName',
+            }
         }
     },
     computed: {},

+ 9 - 5
fhKeeper/formulahousekeeper/timesheet/src/components/translationOpenDataText.vue

@@ -1,11 +1,11 @@
 <template>
     <div class="translation">
         <!-- 文本 -->
-        <span v-if="corporateWeChat">
+        <span v-if="corporateWeChat && !noRender.includes(openIdValue)">
             <ww-open-data :type='type' :openid='openIdValue'></ww-open-data>
         </span>
-        <span v-else-if="dingdingPlatform">
-            <dt-open-data :open-type='type' :open-id='openIdValue'></dt-open-data>
+        <span v-else-if="dingdingPlatform && !noRender.includes(openIdValue)">
+            <dt-open-data :open-type='dingdingOpenType[type]' :open-id='openIdValue'></dt-open-data>
         </span>
         <span v-else>{{ openIdValue }}</span>
     </div>
@@ -32,7 +32,12 @@ export default {
             corporateWeChat: false, // 企业微信转译
             dingdingPlatform: false, // 钉钉转译
 
-            openIdValue: ''
+            openIdValue: '',
+            noRender: ['全部人员', '未分配'],
+            dingdingOpenType: {
+                userName: 'userName',
+                departmentName: 'deptName',
+            }
         }
     },
     computed: {},
@@ -49,7 +54,6 @@ export default {
     },
     methods: {
         dealWith() {
-            console.log(this.user)
             const { userNameNeedTranslate, dingdingUserid } = this.user
             if (userNameNeedTranslate) {
                 this.corporateWeChat = true

+ 2 - 0
fhKeeper/formulahousekeeper/timesheet_h5/public/index.html

@@ -9,6 +9,8 @@
     <link rel="shortcut icon" type="image/x-icon" href="./favicon.ico"/>
     <title>工时管家</title>
     <!-- <script src="/axios.min.js"></script> -->
+    <!--接入钉钉前端组件,进行通讯录组件展示-->
+    <script src="https://auth.dingtalk.com/opendata-1.1.0.js"></script>
     <link rel="stylesheet" href="https://at.alicdn.com/t/font_1456778_1mgn5degp7t.css">
     <!-- <script src="https://cdn.bootcss.com/axios/0.19.0-beta.1/axios.min.js"></script> -->
     <!-- <script src="https://cdn.bootcdn.net/ajax/libs/axios/0.25.0/axios.min.js"></script> -->

+ 9 - 4
fhKeeper/formulahousekeeper/timesheet_h5/src/components/translationOpenDataText.vue

@@ -1,11 +1,11 @@
 <template>
     <div class="translation">
         <!-- 文本 -->
-        <span v-if="corporateWeChat">
+        <span v-if="corporateWeChat && !noRender.includes(openIdValue)">
             <ww-open-data :type='type' :openid='openIdValue'></ww-open-data>
         </span>
-        <span v-else-if="dingdingPlatform">
-            <dt-open-data :open-type='type' :open-id='openIdValue'></dt-open-data>
+        <span v-else-if="dingdingPlatform && !noRender.includes(openIdValue)">
+            <dt-open-data :open-type='dingdingOpenType[type]' :open-id='openIdValue'></dt-open-data>
         </span>
         <span v-else>{{ openIdValue }}</span>
     </div>
@@ -33,7 +33,12 @@ export default {
             corporateWeChat: false, // 企业微信转译
             dingdingPlatform: false, // 钉钉转译
 
-            openIdValue: ''
+            openIdValue: '',
+            noRender: ['全部人员', '未分配'],
+            dingdingOpenType: {
+                userName: 'userName',
+                departmentName: 'deptName',
+            }
         }
     },
     computed: {},