Procházet zdrojové kódy

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

Guo1B0 před 1 rokem
rodič
revize
079b9c6544
34 změnil soubory, kde provedl 1082 přidání a 502 odebrání
  1. 1 1
      fhKeeper/formulahousekeeper/customerBuler-crm/index.html
  2. 159 0
      fhKeeper/formulahousekeeper/customerBuler-crm/package-lock.json
  3. 3 0
      fhKeeper/formulahousekeeper/customerBuler-crm/package.json
  4. 18 2
      fhKeeper/formulahousekeeper/customerBuler-crm/src/App.vue
  5. binární
      fhKeeper/formulahousekeeper/customerBuler-crm/src/assets/404.png
  6. binární
      fhKeeper/formulahousekeeper/customerBuler-crm/src/assets/login/background.png
  7. binární
      fhKeeper/formulahousekeeper/customerBuler-crm/src/assets/login/login_logo.png
  8. binární
      fhKeeper/formulahousekeeper/customerBuler-crm/src/assets/login/qiyeweixin.png
  9. 3 3
      fhKeeper/formulahousekeeper/customerBuler-crm/src/components/ReEcharts/index.vue
  10. 11 2
      fhKeeper/formulahousekeeper/customerBuler-crm/src/main.ts
  11. 11 0
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/404.vue
  12. 3 0
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/api.ts
  13. 54 0
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/home.vue
  14. 0 8
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/index.vue
  15. 101 245
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/login.vue
  16. 197 0
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/register.vue
  17. 144 0
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/test/echarts.vue
  18. 3 3
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/test/index.vue
  19. 1 0
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/thread/api.ts
  20. 9 0
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/thread/index.vue
  21. 80 30
      fhKeeper/formulahousekeeper/customerBuler-crm/src/router/index.ts
  22. 14 8
      fhKeeper/formulahousekeeper/customerBuler-crm/src/store/index.ts
  23. 0 80
      fhKeeper/formulahousekeeper/customerBuler-crm/src/styles.css
  24. 13 0
      fhKeeper/formulahousekeeper/customerBuler-crm/src/styles/global.scss
  25. 6 6
      fhKeeper/formulahousekeeper/customerBuler-crm/src/utils/request.ts
  26. 22 0
      fhKeeper/formulahousekeeper/customerBuler-crm/src/utils/tools.ts
  27. 2 1
      fhKeeper/formulahousekeeper/customerBuler-crm/tsconfig.json
  28. 107 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/SysDictController.java
  29. 8 10
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/SysDict.java
  30. 29 28
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/UserServiceImpl.java
  31. 2 2
      fhKeeper/formulahousekeeper/management-crm/src/main/resources/logback.xml
  32. 3 3
      fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/SysDictMapper.xml
  33. 60 54
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectServiceImpl.java
  34. 18 16
      fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/ProjectMapper.xml

+ 1 - 1
fhKeeper/formulahousekeeper/customerBuler-crm/index.html

@@ -4,7 +4,7 @@
     <meta charset="UTF-8" />
     <link rel="icon" type="image/svg+xml" href="/vite.svg" />
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-    <title>Vite + Vue + TS</title>
+    <title>客户管家</title>
   </head>
   <body>
     <div id="app"></div>

+ 159 - 0
fhKeeper/formulahousekeeper/customerBuler-crm/package-lock.json

@@ -8,10 +8,13 @@
       "name": "customerbuler-crm",
       "version": "0.0.0",
       "dependencies": {
+        "@element-plus/icons-vue": "^2.3.1",
+        "@zmjs/form-design": "^0.1.16",
         "axios": "^1.6.7",
         "echarts": "^5.5.0",
         "element-plus": "^2.5.6",
         "pinia": "^2.1.7",
+        "pinia-plugin-persistedstate": "^3.2.1",
         "vue": "^3.4.19",
         "vue-router": "^4.3.0"
       },
@@ -1022,6 +1025,119 @@
         }
       }
     },
+    "node_modules/@zmjs/form-design": {
+      "version": "0.1.16",
+      "resolved": "https://registry.npmjs.org/@zmjs/form-design/-/form-design-0.1.16.tgz",
+      "integrity": "sha512-RCjB1JbV1BKJrQ14jxez8WI72oKN3JXsMkLskZyni7tVEPjmTP8s/R3ZfFzchV0FVuZ4FZnRYNYrSDxBnpqmuw==",
+      "dependencies": {
+        "@vueuse/core": "^8.2.3",
+        "ace-builds": "^1.4.14",
+        "element-plus": "^2.1.10",
+        "lodash-es": "^4.17.21",
+        "prismjs": "^1.28.0",
+        "vue": "^3.2.31",
+        "vue-prism-editor": "^2.0.0-alpha.2",
+        "vuedraggable": "^4.1.0"
+      },
+      "engines": {
+        "node": ">=14"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/zhiyuanzmj"
+      }
+    },
+    "node_modules/@zmjs/form-design/node_modules/@types/web-bluetooth": {
+      "version": "0.0.14",
+      "resolved": "https://registry.npmjs.org/@types/web-bluetooth/-/web-bluetooth-0.0.14.tgz",
+      "integrity": "sha512-5d2RhCard1nQUC3aHcq/gHzWYO6K0WJmAbjO7mQJgCQKtZpgXxv1rOM6O/dBDhDYYVutk1sciOgNSe+5YyfM8A=="
+    },
+    "node_modules/@zmjs/form-design/node_modules/@vueuse/core": {
+      "version": "8.9.4",
+      "resolved": "https://registry.npmjs.org/@vueuse/core/-/core-8.9.4.tgz",
+      "integrity": "sha512-B/Mdj9TK1peFyWaPof+Zf/mP9XuGAngaJZBwPaXBvU3aCTZlx3ltlrFFFyMV4iGBwsjSCeUCgZrtkEj9dS2Y3Q==",
+      "dependencies": {
+        "@types/web-bluetooth": "^0.0.14",
+        "@vueuse/metadata": "8.9.4",
+        "@vueuse/shared": "8.9.4",
+        "vue-demi": "*"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/antfu"
+      },
+      "peerDependencies": {
+        "@vue/composition-api": "^1.1.0",
+        "vue": "^2.6.0 || ^3.2.0"
+      },
+      "peerDependenciesMeta": {
+        "@vue/composition-api": {
+          "optional": true
+        },
+        "vue": {
+          "optional": true
+        }
+      }
+    },
+    "node_modules/@zmjs/form-design/node_modules/@vueuse/core/node_modules/@vueuse/shared": {
+      "version": "8.9.4",
+      "resolved": "https://registry.npmjs.org/@vueuse/shared/-/shared-8.9.4.tgz",
+      "integrity": "sha512-wt+T30c4K6dGRMVqPddexEVLa28YwxW5OFIPmzUHICjphfAuBFTTdDoyqREZNDOFJZ44ARH1WWQNCUK8koJ+Ag==",
+      "dependencies": {
+        "vue-demi": "*"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/antfu"
+      },
+      "peerDependencies": {
+        "@vue/composition-api": "^1.1.0",
+        "vue": "^2.6.0 || ^3.2.0"
+      },
+      "peerDependenciesMeta": {
+        "@vue/composition-api": {
+          "optional": true
+        },
+        "vue": {
+          "optional": true
+        }
+      }
+    },
+    "node_modules/@zmjs/form-design/node_modules/@vueuse/core/node_modules/vue-demi": {
+      "version": "0.14.7",
+      "resolved": "https://registry.npmjs.org/vue-demi/-/vue-demi-0.14.7.tgz",
+      "integrity": "sha512-EOG8KXDQNwkJILkx/gPcoL/7vH+hORoBaKgGe+6W7VFMvCYJfmF2dGbvgDroVnI8LU7/kTu8mbjRZGBU1z9NTA==",
+      "hasInstallScript": true,
+      "bin": {
+        "vue-demi-fix": "bin/vue-demi-fix.js",
+        "vue-demi-switch": "bin/vue-demi-switch.js"
+      },
+      "engines": {
+        "node": ">=12"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/antfu"
+      },
+      "peerDependencies": {
+        "@vue/composition-api": "^1.0.0-rc.1",
+        "vue": "^3.0.0-0 || ^2.6.0"
+      },
+      "peerDependenciesMeta": {
+        "@vue/composition-api": {
+          "optional": true
+        }
+      }
+    },
+    "node_modules/@zmjs/form-design/node_modules/@vueuse/metadata": {
+      "version": "8.9.4",
+      "resolved": "https://registry.npmjs.org/@vueuse/metadata/-/metadata-8.9.4.tgz",
+      "integrity": "sha512-IwSfzH80bnJMzqhaapqJl9JRIiyQU0zsRGEgnxN6jhq7992cPUJIRfV+JHRIZXjYqbwt07E1gTEp0R0zPJ1aqw==",
+      "funding": {
+        "url": "https://github.com/sponsors/antfu"
+      }
+    },
+    "node_modules/ace-builds": {
+      "version": "1.32.7",
+      "resolved": "https://registry.npmjs.org/ace-builds/-/ace-builds-1.32.7.tgz",
+      "integrity": "sha512-ziv35kaYELFw4suWlotz/Xsl1/1LhWAbwFoD3zIgCgP9gXGECEsAM4GhiB0T0xZdmQjyv6hmAzO280g0+n4vGw=="
+    },
     "node_modules/ansi-regex": {
       "version": "6.0.1",
       "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz",
@@ -2065,6 +2181,14 @@
         }
       }
     },
+    "node_modules/pinia-plugin-persistedstate": {
+      "version": "3.2.1",
+      "resolved": "https://registry.npmjs.org/pinia-plugin-persistedstate/-/pinia-plugin-persistedstate-3.2.1.tgz",
+      "integrity": "sha512-MK++8LRUsGF7r45PjBFES82ISnPzyO6IZx3CH5vyPseFLZCk1g2kgx6l/nW8pEBKxxd4do0P6bJw+mUSZIEZUQ==",
+      "peerDependencies": {
+        "pinia": "^2.0.0"
+      }
+    },
     "node_modules/pinia/node_modules/vue-demi": {
       "version": "0.14.7",
       "resolved": "https://registry.npmjs.org/vue-demi/-/vue-demi-0.14.7.tgz",
@@ -2247,6 +2371,14 @@
       "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==",
       "dev": true
     },
+    "node_modules/prismjs": {
+      "version": "1.29.0",
+      "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.29.0.tgz",
+      "integrity": "sha512-Kx/1w86q/epKcmte75LNrEoT+lX8pBpavuAbvJWRXar7Hz8jrtF+e3vY751p0R8H9HdArwaCTNDDzHg/ScJK1Q==",
+      "engines": {
+        "node": ">=6"
+      }
+    },
     "node_modules/proxy-from-env": {
       "version": "1.1.0",
       "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
@@ -2480,6 +2612,11 @@
         "url": "https://github.com/sponsors/isaacs"
       }
     },
+    "node_modules/sortablejs": {
+      "version": "1.14.0",
+      "resolved": "https://registry.npmjs.org/sortablejs/-/sortablejs-1.14.0.tgz",
+      "integrity": "sha512-pBXvQCs5/33fdN1/39pPL0NZF20LeRbLQ5jtnheIPN9JQAaufGjKdWduZn4U7wCtVuzKhmRkI0DFYHYRbB2H1w=="
+    },
     "node_modules/source-map-js": {
       "version": "1.0.2",
       "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz",
@@ -2841,6 +2978,17 @@
         }
       }
     },
+    "node_modules/vue-prism-editor": {
+      "version": "2.0.0-alpha.2",
+      "resolved": "https://registry.npmjs.org/vue-prism-editor/-/vue-prism-editor-2.0.0-alpha.2.tgz",
+      "integrity": "sha512-Gu42ba9nosrE+gJpnAEuEkDMqG9zSUysIR8SdXUw8MQKDjBnnNR9lHC18uOr/ICz7yrA/5c7jHJr9lpElODC7w==",
+      "engines": {
+        "node": ">=10"
+      },
+      "peerDependencies": {
+        "vue": "^3.0.0"
+      }
+    },
     "node_modules/vue-router": {
       "version": "4.3.0",
       "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-4.3.0.tgz",
@@ -2882,6 +3030,17 @@
         "typescript": "*"
       }
     },
+    "node_modules/vuedraggable": {
+      "version": "4.1.0",
+      "resolved": "https://registry.npmjs.org/vuedraggable/-/vuedraggable-4.1.0.tgz",
+      "integrity": "sha512-FU5HCWBmsf20GpP3eudURW3WdWTKIbEIQxh9/8GE806hydR9qZqRRxRE3RjqX7PkuLuMQG/A7n3cfj9rCEchww==",
+      "dependencies": {
+        "sortablejs": "1.14.0"
+      },
+      "peerDependencies": {
+        "vue": "^3.0.1"
+      }
+    },
     "node_modules/which": {
       "version": "2.0.2",
       "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",

+ 3 - 0
fhKeeper/formulahousekeeper/customerBuler-crm/package.json

@@ -10,10 +10,13 @@
     "preview": "vite preview"
   },
   "dependencies": {
+    "@element-plus/icons-vue": "^2.3.1",
+    "@zmjs/form-design": "^0.1.16",
     "axios": "^1.6.7",
     "echarts": "^5.5.0",
     "element-plus": "^2.5.6",
     "pinia": "^2.1.7",
+    "pinia-plugin-persistedstate": "^3.2.1",
     "vue": "^3.4.19",
     "vue-router": "^4.3.0"
   },

+ 18 - 2
fhKeeper/formulahousekeeper/customerBuler-crm/src/App.vue

@@ -2,6 +2,22 @@
   <router-view></router-view>
 </template>
 
-<script setup lang="ts"></script>
+<script setup lang="ts">
+import { useStore } from '@/store/index'
+const { setAsyncRoutesMark } = useStore()
+window.addEventListener('beforeunload', () => beforeunloadFn())
+const beforeunloadFn = (() => {
+  setAsyncRoutesMark(false)
+})
+</script>
 
-<style scoped></style>
+<style>
+html,
+body,
+#app,
+.layouts {
+  width: 100%;
+  height: 100%;
+  overflow: hidden;
+}
+</style>

binární
fhKeeper/formulahousekeeper/customerBuler-crm/src/assets/404.png


binární
fhKeeper/formulahousekeeper/customerBuler-crm/src/assets/login/background.png


binární
fhKeeper/formulahousekeeper/customerBuler-crm/src/assets/login/login_logo.png


binární
fhKeeper/formulahousekeeper/customerBuler-crm/src/assets/login/qiyeweixin.png


+ 3 - 3
fhKeeper/formulahousekeeper/customerBuler-crm/src/components/ReEcharts/index.vue

@@ -6,7 +6,7 @@ import { ref, watch, onMounted, onBeforeUnmount } from 'vue';
 interface Props {
 	width?: string;
 	height?: string;
-	option: EChartsOption;
+	option: Partial<EChartsOption>;
 }
 const props = withDefaults(defineProps<Props>(), {
 	width: '100%',
@@ -18,7 +18,7 @@ const myChartsRef = ref<HTMLDivElement>();
 let myChart: ECharts;
 // eslint-disable-next-line no-undef
 // let timer: string | number | NodeJS.Timeout | undefined;
-let timer: number | undefined;
+let timer: any;
 
 // 初始化echarts
 const initChart = (): void => {
@@ -47,7 +47,7 @@ onMounted(() => {
 onBeforeUnmount(() => {
 	window.removeEventListener('resize', resizeChart);
 	clearTimeout(timer);
-	timer = 0;
+	timer = null;
 });
 
 watch(

+ 11 - 2
fhKeeper/formulahousekeeper/customerBuler-crm/src/main.ts

@@ -1,18 +1,27 @@
 import { createApp } from 'vue'
 import { createPinia } from 'pinia'
 import ElementPlus from 'element-plus'
+import "./TailWindCss/index.css";
 import 'element-plus/dist/index.css'
+import * as ElementPlusIconsVue from '@element-plus/icons-vue'
+import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
 import App from './App.vue'
 import router from './router/index'
-import "./styles.css"
-import "./TailWindCss/index.css";
 import * as echarts from 'echarts';
 
 const app = createApp(App)
+const pinia = createPinia()
+
+pinia.use(piniaPluginPersistedstate)
+
+for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
+  app.component(key, component)
+}
 
 app.config.globalProperties.$echarts = echarts;
 app
   .use(ElementPlus)
   .use(createPinia())
   .use(router)
+  .use(pinia)
   .mount('#app')

+ 11 - 0
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/404.vue

@@ -0,0 +1,11 @@
+<template>
+  <div>
+    404
+  </div>
+</template>
+
+<script lang="ts" setup>
+
+</script>
+
+<style lang="scss" scoped></style>

+ 3 - 0
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/api.ts

@@ -0,0 +1,3 @@
+export const SENDVCODE = "/user/sendVcode";     //发送验证码
+export const REGISTER = "/user/insertCompany";  //注册
+export const LOGIN = "/user/loginAdmin";        //登录

+ 54 - 0
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/home.vue

@@ -0,0 +1,54 @@
+<template>
+    <div class="common-layout layouts">
+        <el-container class="flex flex-col layouts">
+            <!-- 头部 -->
+            <el-header></el-header>
+            <!-- 左侧菜单 -->
+            <el-container class="flex-1 layouts">
+                <el-aside class="home-el-aside" width="220px">
+                    <el-menu default-active="1" class="el-menu-vertical-demo">
+                        <el-menu-item :index="(index + 1) + ''" v-for="(item, index) in 10" :key="index">
+                            <el-icon><setting /></el-icon>
+                            <span>第{{ index + 1 }}个</span>
+                        </el-menu-item>
+
+                        <el-sub-menu index="11">
+                            <template #title>
+                                <el-icon>
+                                    <location />
+                                </el-icon>
+                                <span>第十一个</span>
+                            </template>
+                            <el-menu-item :index="'11'">
+                                <el-icon><icon-menu /></el-icon>
+                                <span>第11-1个</span>
+                            </el-menu-item>
+                        </el-sub-menu>
+                    </el-menu>
+                </el-aside>
+                <!-- 主体 -->
+                <el-main>
+                    <router-view></router-view>
+                </el-main>
+            </el-container>
+        </el-container>
+    </div>
+</template>
+<script lang="ts" setup>
+
+</script>
+<style scoped lang="scss">
+.common-layout {
+    .el-header {
+        background: $darkBlue;
+    }
+
+    .el-menu-vertical-demo {
+        height: 100%;
+    }
+    .el-main {
+        padding: 0 20px;
+        background: $backColor;
+    }
+}
+</style>

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

@@ -1,8 +0,0 @@
-<template>
-    <div>
-        indexyemian
-    </div>
-</template>
-<script setup lang="ts">
-</script>
-<style scoped lang="scss"></style>

+ 101 - 245
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/login.vue

@@ -1,256 +1,112 @@
 <template>
-    <div @click="tologin">登录</div>
-    <h2> {{ store.name }}</h2>
-    <h1 @click="changeName">修改名称</h1>
-    <el-tree :data="data" :props="defaultProps" @node-click="handleNodeClick" />
-    <div @click="networkRequest()">点击发起网络请求</div>
-    <div class="abc fonsSize30">测试sass样式</div>
-    <div class="text-pink-200">1111</div>
-    <div :style="{ width: '1230px', height: '350px' }">
-        <Echarts :option="option" />
+  <div class="loginView w-screen h-screen overflow-hidden flex">
+    <div class="w-96 bg-white m-auto border-t-8 border-blue-400 shadow-xl rounded-md pl-9 pr-9">
+      <div class="m-auto pt-4">
+        <img class="w-1/5 h-1/5 m-auto" :src="loginLogo" alt="">
+      </div>
+      <h2 class="text-xl text-center pt-4 font-bold">客户管家</h2>
+      <el-form class="pt-4" ref="ruleFormRef" :model="ruleForm" :rules="rules">
+        <el-form-item prop="username">
+          <el-input clearable :prefix-icon="UserFilled" size="large" class="mt-2" v-model="ruleForm.username"
+            autocomplete="off" placeholder="账号/手机号" />
+        </el-form-item>
+        <el-form-item prop="password">
+          <el-input clearable :prefix-icon="Lock" show-password size="large" class="mt-4" v-model="ruleForm.password"
+            autocomplete="off" placeholder="密码" />
+        </el-form-item>
+        <div class="pt-4">
+          <el-button type="primary" size="large" class="w-full" :loading="loginLoading"
+            @click="login(ruleFormRef)">登录</el-button>
+        </div>
+      </el-form>
+      <el-divider content-position="center">或</el-divider>
+      <div class="m-auto mb-5">
+        <img class="w-9 m-auto p-1 rounded-full border-blue-300 border-2 cursor-pointer" :src="qiyeweixin" alt="">
+      </div>
+      <div class="flex justify-between pb-5">
+        <div class="cursor-pointer text-blue-400 hover:text-blue-300">联系客服</div>
+        <div class="flex justify-around">
+          <div class="mr-4 cursor-pointer text-blue-400 hover:text-blue-300" @click="useHelp()">使用说明</div>
+          <div class="cursor-pointer text-blue-400 hover:text-blue-300" @click="toRegister()">企业注册</div>
+        </div>
+      </div>
+      <el-dialog v-model="helpDialog" width="30%" title="使用说明">
+        <div class="p-2 text-xl">文档水水水水</div>
+        <div>文档水水水水</div>
+        <div>文档水水水水</div>
+      </el-dialog>
     </div>
+  </div>
 </template>
-<script lang="ts" setup>
-import { reactive } from 'vue';
-import Echarts from '@/components/ReEcharts/index.vue';
-import { useRoute, useRouter } from 'vue-router'
-import { useStore } from "../store/index";
-import { post } from '@/utils/request'
 
-const router = useRouter()
-const store = useStore()
-function tologin() {
-    router.push({
-        name: 'index'
-    })
-}
-function changeName(): void {
-    store.name = '索索'
-}
+<script lang="ts" setup>
+import { reactive, ref } from "vue";
+import { useRouter } from "vue-router";
+import loginLogo from "@/assets/login/login_logo.png";
+import qiyeweixin from "@/assets/login/qiyeweixin.png";
+import { UserFilled, Lock } from '@element-plus/icons-vue'
+import type { FormInstance, FormRules } from 'element-plus'
+import { useStore } from '@/store/index'
+import { post } from "@/utils/request";
+import { LOGIN } from "./api";
+const { setRouters } = useStore()
+const router = useRouter();
+const ruleFormRef = ref<FormInstance>();
+const ruleForm = ref({
+  username: "",
+  password: "",
+});
+const loginLoading = ref(false);
+const rules = reactive<FormRules<typeof ruleForm>>({
+  username: [{ required: true, trigger: "blur", message: "请输入账号/手机号" }],
+  password: [{ required: true, trigger: "blur", message: "请输入密码" }],
+})
+const helpDialog = ref(false);
 
-async function networkRequest(): Promise<void> {
-    console.log('发起请求')
-    const requestUrl = '/user/loginAdmin'
-    const data = {
-        username: '18130408100',
-        password: '220926'
+const login = (formEl: FormInstance | undefined) => {
+  if (!formEl) {
+    return
+  }
+  formEl.validate((valid) => {
+    if (!valid) {
+      return false;
     }
-    // proxy.$post(requestUrl, data)
-    // .then((response: any) => {
-    //     console.log(response, '<=== 请求返回的数据')
-    // })
-    const res = await post(requestUrl, data)
-    console.log(res, '<=== 请求返回的数据')
-}
-
-
-interface Tree {
-    label: string
-    children?: Tree[]
-}
+    loginLoading.value = true;
+    console.log(ruleForm.value);
+    post(LOGIN, { ...ruleForm.value }).then(res => {
+      console.log(res);
+      setTimeout(() => {
+        loginLoading.value = false;
+      }, 1000)
+      // loginLoading.value = false;
+    }).catch(err => {
+      loginLoading.value = false;
+    })
+    return
+    let newRouter = [
+      {
+        path: '/thread',
+        name: 'thread'
+      }
+    ]
+    setRouters(newRouter)
+    setTimeout(() => {
+      loginLoading.value = false;
+      router.push(newRouter[0].path);
+    }, 1000);
+  })
 
-const handleNodeClick = (data: Tree) => {
-    console.log(data)
+};
+const useHelp = () => {
+  helpDialog.value = true;
 }
-
-const data: Tree[] = [
-    {
-        label: 'Level one 1',
-        children: [
-            {
-                label: 'Level two 1-1',
-                children: [
-                    {
-                        label: 'Level three 1-1-1',
-                    },
-                ],
-            },
-        ],
-    },
-    {
-        label: 'Level one 2',
-        children: [
-            {
-                label: 'Level two 2-1',
-                children: [
-                    {
-                        label: 'Level three 2-1-1',
-                    },
-                ],
-            },
-            {
-                label: 'Level two 2-2',
-                children: [
-                    {
-                        label: 'Level three 2-2-1',
-                    },
-                ],
-            },
-        ],
-    },
-    {
-        label: 'Level one 3',
-        children: [
-            {
-                label: 'Level two 3-1',
-                children: [
-                    {
-                        label: 'Level three 3-1-1',
-                    },
-                ],
-            },
-            {
-                label: 'Level two 3-2',
-                children: [
-                    {
-                        label: 'Level three 3-2-1',
-                    },
-                ],
-            },
-        ],
-    },
-]
-
-const defaultProps = {
-    children: 'children',
-    label: 'label',
+const toRegister = () => {
+  router.push("/register");
 }
-
-const option = reactive({
-    tooltip: {
-        trigger: 'axis',
-        axisPointer: {
-            type: 'shadow',
-            label: {
-                show: true
-            }
-        }
-    },
-    grid: {
-        left: '4%',
-        top: '15%',
-        right: '4%',
-        bottom: '10%'
-    },
-    legend: {
-        data: ['昨日总人数', '今日实时人数'],
-        top: '4%',
-        color: '#1FC3CE',
-        fontSize: 14,
-        selected: { 昨日使用率: false } // 不需要显示的设置为false
-    },
-    xAxis: {
-        data: [
-            '会议室1',
-            '会议室2',
-            '会议室3',
-            '会议室4',
-            '会议室5',
-            '会议室6',
-            '会议室7',
-            '会议室8',
-            '会议室9'
-        ],
-        axisLine: {
-            show: true, //隐藏X轴轴线
-            lineStyle: {
-                color: '#eee',
-                width: 1
-            }
-        },
-        axisTick: {
-            show: true, //隐藏X轴刻度
-            alignWithLabel: true
-        },
-        axisLabel: {
-            show: true,
-            color: '#333', //X轴文字颜色
-            fontSize: 14
-        }
-    },
-    yAxis: [
-        {
-            type: 'value',
-            name: '人数',
-            nameTextStyle: {
-                color: '#333',
-                fontSize: 14
-            },
-            splitLine: {
-                show: true,
-                lineStyle: {
-                    width: 1,
-                    color: '#eee'
-                }
-            },
-            axisTick: {
-                show: false
-            },
-            axisLine: {
-                show: false
-            },
-            axisLabel: {
-                show: true,
-                color: '#333',
-                fontSize: 14
-            }
-        }
-    ],
-    series: [
-        {
-            name: '昨日总人数',
-            type: 'bar',
-            barWidth: 18,
-            itemStyle: {
-                color: {
-                    type: 'linear',
-                    x: 0, // 右
-                    y: 1, // 下
-                    x2: 0, // 左
-                    y2: 0, // 上
-                    colorStops: [
-                        {
-                            offset: 0,
-                            color: '#F89898' // 0% 处的颜色
-                        },
-                        {
-                            offset: 1,
-                            color: '#F56C6C' // 100% 处的颜色
-                        }
-                    ]
-                }
-            },
-            data: [24, 45, 43, 35, 76, 154, 86, 42, 68]
-        },
-        {
-            name: '今日实时人数',
-            type: 'bar',
-            barWidth: 18,
-            itemStyle: {
-                color: {
-                    type: 'linear',
-                    x: 0, // 右
-                    y: 1, // 下
-                    x2: 0, // 左
-                    y2: 0, // 上
-                    colorStops: [
-                        {
-                            offset: 0,
-                            color: '#52A7FF' // 0% 处的颜色
-                        },
-                        {
-                            offset: 1,
-                            color: '#409EFF' // 100% 处的颜色
-                        }
-                    ]
-                }
-            },
-            data: [133, 23, 114, 67, 89, 35, 67, 96, 90]
-        }
-    ]
-});
-
 </script>
 
-<style lang="scss" scoped></style>
-
+<style lang="scss" scoped>
+.loginView {
+  background: #f0f2f5 url("../assets/login/background.png") no-repeat;
+}
+</style>

+ 197 - 0
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/register.vue

@@ -0,0 +1,197 @@
+<template>
+  <div class="loginView w-screen h-screen overflow-hidden flex">
+    <div class="w-[32rem] bg-white m-auto border-t-8 border-blue-400 shadow-xl rounded-md pl-9 pr-9">
+      <h2 class="text-xl text-center pt-4 font-bold">注册</h2>
+      <el-form class="pt-4" ref="ruleFormRef" :model="ruleForm" :rules="rules">
+        <el-form-item class="pt-1" prop="companyName">
+          <el-input type="text" size="large" v-model="ruleForm.companyName" autocomplete="off" placeholder="公司名"
+            clearable :prefix-icon="HomeFilled"></el-input>
+        </el-form-item>
+        <el-form-item class="pt-1" prop="name">
+          <el-input type="text" size="large" v-model="ruleForm.name" autocomplete="off" placeholder="姓名" clearable
+            :prefix-icon="UserFilled"></el-input>
+        </el-form-item>
+        <el-form-item class="pt-1" prop="phone">
+          <el-input type="text" size="large" v-model="ruleForm.phone" autocomplete="off" placeholder="手机号" clearable
+            :prefix-icon="Iphone"></el-input>
+        </el-form-item>
+        <el-form-item class="pt-1" prop="vcode">
+          <el-input type="text" size="large" v-model="ruleForm.vcode" autocomplete="off" placeholder="验证码" clearable
+            :prefix-icon="Tickets">
+            <template #append>
+              <el-button @click="sendVcode()" :disabled="ruleForm.phone == '' || showTimer">发送验证码<span
+                  v-if="showTimer">({{ countNum }})</span></el-button>
+            </template>
+          </el-input>
+        </el-form-item>
+        <el-form-item class="pt-1" prop="password">
+          <el-input type="password" size="large" v-model="ruleForm.password" autocomplete="off"
+            placeholder="设置密码,长度不低于6位" clearable :prefix-icon="Lock">
+          </el-input>
+        </el-form-item>
+        <el-form-item class="pt-1" prop="repwd">
+          <el-input type="password" size="large" v-model="ruleForm.repwd" autocomplete="off" placeholder="重复密码"
+            clearable :prefix-icon="Lock">
+          </el-input>
+        </el-form-item>
+        <div class="pt-4 mb-5">
+          <el-button type="primary" size="large" class="w-full" :loading="registerLoading"
+            @click="register(ruleFormRef)">注册</el-button>
+        </div>
+      </el-form>
+      <div class="text-right mb-5 cursor-pointer text-blue-400 hover:text-blue-300" @click="router.push('/login')">
+        已有账号?返回登录
+      </div>
+    </div>
+  </div>
+</template>
+
+<script lang="ts" setup>
+import { reactive, ref } from "vue";
+import { useRouter, useRoute } from "vue-router";
+import { HomeFilled, UserFilled, Lock, Iphone, Tickets } from '@element-plus/icons-vue'
+import { ElNotification, ElMessage, type FormInstance, type FormRules } from 'element-plus'
+import { isValueEmpty } from "@/utils/tools";
+import { post } from "@/utils/request";
+import { REGISTER, SENDVCODE } from "./api";
+const router = useRouter();
+const route = useRoute();
+const ruleFormRef = ref<FormInstance>();
+const ruleForm = ref({
+  companyName: "",
+  name: "",
+  phone: "",
+  vcode: "",
+  password: "",
+  repwd: ""
+});
+const rules = reactive<FormRules<typeof ruleForm>>({
+  companyName: [{ required: true, message: '请输入公司名', trigger: 'blur' },],
+  name: [{ required: true, message: '请输入姓名', trigger: 'blur' },],
+  phone: [
+    { required: true, message: '请输入手机号', trigger: 'blur' },
+    { min: 11, max: 11, message: '请输入正确的手机号', trigger: 'blur' },
+  ],
+  vcode: [
+    { required: true, message: '请输入验证码', trigger: 'blur' },
+  ],
+  password: [
+    { required: true, message: '请设置密码,长度不低于6位', trigger: 'blur' },
+    { min: 6, message: '密码长度不少于6位', trigger: 'blur' },
+  ],
+  repwd: [
+    { required: true, message: '请重复输入密码', trigger: 'blur' },
+    {
+      validator: (_rule, value, callback) => {
+        if (value !== ruleForm.value.password) {
+          callback(new Error('两次密码不一致'));
+        } else {
+          callback();
+        }
+      }, trigger: 'blur'
+    }
+  ]
+})
+
+const registerLoading = ref(false);
+const showTimer = ref(false);
+const countNum = ref(10);
+const countDown = () => {
+  if (countNum.value > 0) {
+    setTimeout(() => {
+      countNum.value -= 1;
+      countDown()
+    }, 1000)
+  } else {
+    showTimer.value = false;
+    countNum.value = 10;
+  }
+}
+const sendVcode = () => {
+  showTimer.value = true;
+  countDown();
+  if (ruleForm.value.phone.trim().length != 11) {
+    ElMessage.error({
+      message: "请输入正确的手机号",
+      type: "error",
+      duration: 2000,
+    })
+    return
+  }
+  post(SENDVCODE, {
+    mobile: ruleForm.value.phone
+  }).then(res => {
+    if (res.code == "ok") {
+      ElMessage.success({
+        message: "发送成功",
+        type: "success",
+        duration: 2000,
+      })
+      showTimer.value = true;
+      countDown();
+    }
+  })
+}
+const register = (formEl: FormInstance | undefined) => {
+  if (!formEl) {
+    return
+  }
+
+  formEl.validate((valid) => {
+    if (!valid) {
+      return false;
+    }
+    registerLoading.value = true;
+    let params = {
+      ...ruleForm.value,
+    }
+    /* 如果地址栏有参数,就带上 */
+    if (!isValueEmpty(route.query)) {
+      params = {
+        ...params,
+        ...route.query
+      }
+    }
+    // console.log(params);
+    post(REGISTER, params).then(res => {
+      if (res.code == "ok") {
+        ElNotification.success({
+          title: "提示",
+          message: "注册成功",
+          type: "success",
+          duration:3000,
+          onClose: () => {
+            registerLoading.value = false;
+            router.back()
+          }
+        })
+      } else {
+        ElNotification.error({
+          title: "提示",
+          message: res.message || res.msg,
+          type: "success",
+          duration: 3000,
+        })
+        registerLoading.value = false;
+      }
+    }).catch(err => {
+      ElNotification.error({
+        title: "提示",
+        message: err.message || err.msg,
+        type: "success",
+        duration: 3000,
+      })
+      registerLoading.value = false;
+    })
+
+  })
+
+};
+
+</script>
+
+<style lang="scss" scoped>
+.loginView {
+  background: #f0f2f5 url("../assets/login/background.png") no-repeat;
+}
+</style>

+ 144 - 0
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/test/echarts.vue

@@ -0,0 +1,144 @@
+<template>
+  <div :style="{ width: '1230px', height: '350px' }">
+    <Echarts :option="option" />
+  </div>
+</template>
+
+<script lang="ts" setup>
+import Echarts from '@/components/ReEcharts/index.vue';
+import { EChartsOption } from 'echarts';
+import { reactive } from 'vue';
+const option = reactive<Partial<EChartsOption>>({
+  tooltip: {
+    trigger: 'axis',
+    axisPointer: {
+      type: 'shadow',
+      label: {
+        show: true
+      }
+    }
+  },
+  grid: {
+    left: '4%',
+    top: '15%',
+    right: '4%',
+    bottom: '10%'
+  },
+  legend: {
+    data: ['昨日总人数', '今日实时人数'],
+    top: '4%',
+    selected: { 昨日使用率: false } // 不需要显示的设置为false
+  },
+  xAxis: {
+    data: [
+      '会议室1',
+      '会议室2',
+      '会议室3',
+      '会议室4',
+      '会议室5',
+      '会议室6',
+      '会议室7',
+      '会议室8',
+      '会议室9'
+    ],
+    axisLine: {
+      show: true, //隐藏X轴轴线
+      lineStyle: {
+        color: '#eee',
+        width: 1
+      }
+    },
+    axisTick: {
+      show: true, //隐藏X轴刻度
+      alignWithLabel: true
+    },
+    axisLabel: {
+      show: true,
+      color: '#f00', //X轴文字颜色
+      fontSize: 14
+    }
+  },
+  yAxis: [
+    {
+      type: 'value',
+      name: '人数',
+      nameTextStyle: {
+        color: '#333',
+        fontSize: 14
+      },
+      splitLine: {
+        show: true,
+        lineStyle: {
+          width: 1,
+          color: '#ccc'
+        }
+      },
+      axisTick: {
+        show: false
+      },
+      axisLine: {
+        show: false
+      },
+      axisLabel: {
+        show: true,
+        color: '#333',
+        fontSize: 14
+      }
+    }
+  ],
+  series: [
+    {
+      name: '昨日总人数',
+      type: 'bar',
+      barWidth: 18,
+      itemStyle: {
+        color: {
+          type: 'linear',
+          x: 0, // 右
+          y: 1, // 下
+          x2: 0, // 左
+          y2: 0, // 上
+          colorStops: [
+            {
+              offset: 0,
+              color: '#F89898' // 0% 处的颜色
+            },
+            {
+              offset: 1,
+              color: '#F56C6C' // 100% 处的颜色
+            }
+          ]
+        }
+      },
+      data: [24, 45, 43, 35, 76, 154, 86, 42, 68]
+    },
+    {
+      name: '今日实时人数',
+      type: 'bar',
+      barWidth: 18,
+      itemStyle: {
+        color: {
+          type: 'linear',
+          x: 0, // 右
+          y: 1, // 下
+          x2: 0, // 左
+          y2: 0, // 上
+          colorStops: [
+            {
+              offset: 0,
+              color: '#52A7FF' // 0% 处的颜色
+            },
+            {
+              offset: 1,
+              color: '#409EFF' // 100% 处的颜色
+            }
+          ]
+        }
+      },
+      data: [133, 23, 114, 67, 89, 35, 67, 96, 90]
+    }
+  ]
+});
+</script>
+
+<style lang="scss" scoped></style>

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

@@ -7,14 +7,14 @@
     <div>{{ config[id].num }}</div>
   </div>
 </template>
+
 <script lang="ts" setup>
 import { config } from "./config"
 const id = 2;
 </script>
+
 <style lang="scss" scoped>
 .myClass {
-  @apply w-1/6;
-  @apply bg-red-700;
-  @apply text-white
+  @apply w-1/6 bg-red-700 text-white hover:size-20;
 }
 </style>

+ 1 - 0
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/thread/api.ts

@@ -0,0 +1 @@
+export const TEST_API = "/api/test"; //发送验证码

+ 9 - 0
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/thread/index.vue

@@ -0,0 +1,9 @@
+<template>
+<div id="" class="h100">
+    线索文件
+</div>
+</template>
+<script setup lang="ts">
+</script>
+<style scoped lang="scss">
+</style>

+ 80 - 30
fhKeeper/formulahousekeeper/customerBuler-crm/src/router/index.ts

@@ -1,32 +1,82 @@
-import { createRouter, createWebHistory, } from 'vue-router'
-import Login from '../pages/login.vue';
+import { RouteRecordRaw,createRouter, createWebHistory } from "vue-router";
+import { useStore } from "@/store/index";
+export const routes: RouteRecordRaw[] = [
+  {
+    path: "/",
+    redirect: "/login",
+  },
+  {
+    name: "login",
+    path: "/login",
+    component: () => import("../pages/login.vue"),
+  },
+  {
+    name: "register",
+    path: "/register",
+    component: () => import("../pages/register.vue"),
+  },
+  {
+    name: "home",
+    path: "/home",
+    component: () => import("../pages/home.vue"),
+    children: [
+      // {
+      //     name: 'thread',
+      //     path: '/thread',
+      //     component: () => import("../pages/thread/thread.vue")
+      // },
+    ],
+  },
+  {
+    name: "test",
+    path: "/test",
+    component: () => import("../pages/test/index.vue"),
+  },
+  {
+    name: "testEcharts",
+    path: "/testEcharts",
+    component: () => import("../pages/test/echarts.vue"),
+  },
+];
 
-export const routes = [
-    {
-        path: '/',
-        redirect: '/login'
-    },
-    {
-        name: 'login',
-        path: '/login',
-        component: Login
-    },
-    {
-        name: 'index',
-        path: '/index',
-        component: () => import("../pages/index.vue")
-    }, {
-        name: "test",
-        path: "/test",
-        component: () => import("../pages/test/index.vue")
-    }
-]
 const router = createRouter({
-    scrollBehavior: () => ({ left: 0, top: 0 }),
-    history: createWebHistory(),
-    routes,
-})
-router.beforeEach((_to, _from, next) => {
-    next()
-})
-export default router
+  scrollBehavior: () => ({ left: 0, top: 0 }),
+  history: createWebHistory(),
+  routes,
+});
+router.beforeEach((to, _from, next) => {
+  const routerList = useStore().routers;
+  const routers = router.getRoutes();
+  console.log(routerList, routers);
+  const { setAsyncRoutesMark, asyncRoutesMark } = useStore();
+  const token = true;
+  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.name == 'home')
+        routerList.forEach((item: any) => {
+          addNewRouter?.children.push({
+            path: item.path,
+            name: item.name,
+            meta: {},
+            component: () => import(`@/pages/${item.name}/index.vue`),
+          })
+        })
+        router.addRoute(addNewRouter);
+        next({ ...to, replace: true });
+      }
+    } else {
+      console.log("无登录信息,跳转到登录页");
+      next(`/login`);
+    }
+  }
+  console.log(routerList);
+});
+export default router;

+ 14 - 8
fhKeeper/formulahousekeeper/customerBuler-crm/src/store/index.ts

@@ -1,17 +1,23 @@
 import { defineStore, acceptHMRUpdate } from "pinia";
 export const useStore = defineStore({
     id: "index",
-    state: () => ({name: "old name",}),
-    getters: {
-        myName: (state) => {
-            return `getters ${state.name}`
-        }
+    state: () => ({
+        userInfo: {}, // 当前的用户信息
+        routers: [], // 返回的所有路由
+        asyncRoutesMark: false, // 是否添加过路由
+    }),
+    getters: { // 取值
+        
     },
-    actions: {
-        changeName(name: string) {
-            this.name = name
+    actions: { // 方法
+        setRouters(arr: any) {
+            this.routers = arr;
+        },
+        setAsyncRoutesMark(val: boolean) {
+            this.asyncRoutesMark = val
         }
     },
+    persist: true, // 是否持久化
 });
 if (import.meta.hot) {
     import.meta.hot.accept(acceptHMRUpdate(useStore, import.meta.hot))

+ 0 - 80
fhKeeper/formulahousekeeper/customerBuler-crm/src/styles.css

@@ -1,80 +0,0 @@
-:root {
-    font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
-    line-height: 1.5;
-    font-weight: 400;
-  
-    color-scheme: light dark;
-    color: rgba(255, 255, 255, 0.87);
-    background-color: #242424;
-  
-    font-synthesis: none;
-    text-rendering: optimizeLegibility;
-    -webkit-font-smoothing: antialiased;
-    -moz-osx-font-smoothing: grayscale;
-  }
-  
-  a {
-    font-weight: 500;
-    color: #646cff;
-    text-decoration: inherit;
-  }
-  a:hover {
-    color: #535bf2;
-  }
-  
-  body {
-    margin: 0;
-    display: flex;
-    place-items: center;
-    min-width: 320px;
-    min-height: 100vh;
-  }
-  
-  h1 {
-    font-size: 3.2em;
-    line-height: 1.1;
-  }
-  
-  button {
-    border-radius: 8px;
-    border: 1px solid transparent;
-    padding: 0.6em 1.2em;
-    font-size: 1em;
-    font-weight: 500;
-    font-family: inherit;
-    background-color: #1a1a1a;
-    cursor: pointer;
-    transition: border-color 0.25s;
-  }
-  button:hover {
-    border-color: #646cff;
-  }
-  button:focus,
-  button:focus-visible {
-    outline: 4px auto -webkit-focus-ring-color;
-  }
-  
-  .card {
-    padding: 2em;
-  }
-  
-  #app {
-    max-width: 1280px;
-    margin: 0 auto;
-    padding: 2rem;
-    text-align: center;
-  }
-  
-  @media (prefers-color-scheme: light) {
-    :root {
-      color: #213547;
-      background-color: #ffffff;
-    }
-    a:hover {
-      color: #747bff;
-    }
-    button {
-      background-color: #f9f9f9;
-    }
-  }
-  

+ 13 - 0
fhKeeper/formulahousekeeper/customerBuler-crm/src/styles/global.scss

@@ -0,0 +1,13 @@
+$darkBlue: #3475C5;
+$ashen: #FEFEFE;
+$backColor: #EEF3F6;
+$black: #000;
+$fontBlack: #333;
+$fontGray: #999;
+
+.text-gray{
+    color : $fontGray
+}
+.text-black {
+    color : $fontBlack
+}

+ 6 - 6
fhKeeper/formulahousekeeper/customerBuler-crm/src/utils/request.ts

@@ -2,10 +2,10 @@ import axios from "axios";
 import { showMessage } from "./errorStatusCode"; // 引入状态码文件
 import type { AxiosRequestConfig, AxiosResponse, AxiosError } from "axios";
 import { ElNotification } from "element-plus";
-
+const baseURL = "/api";
 // 创建axios实例
 const instance = axios.create({
-  baseURL: "/api", // 设置API的基础URL
+  baseURL, // 设置API的基础URL
 });
 
 // 请求拦截器
@@ -42,9 +42,9 @@ instance.interceptors.response.use(
 );
 
 // 封装GET请求
-export async function get<T>(url: string, params?: any): Promise<T> {
+export async function get(url: string, params?: any): Promise<any> {
   return instance
-    .get<T>(url, { params })
+    .get(url, { params })
     .then((response) => response.data)
     .catch((error) => {
       throw error;
@@ -52,9 +52,9 @@ export async function get<T>(url: string, params?: any): Promise<T> {
 }
 
 // 封装POST请求
-export async function post<T>(url: string, data?: any): Promise<T> {
+export async function post(url: string, data?: any): Promise<any> {
   return instance
-    .post<T>(url, data, {
+    .post(url, data, {
       headers: {
         "Content-type": " application/x-www-form-urlencoded; charset=UTF-8",
       },

+ 22 - 0
fhKeeper/formulahousekeeper/customerBuler-crm/src/utils/tools.ts

@@ -0,0 +1,22 @@
+export function isValueEmpty(value: any): boolean {
+  if (value === null || value === undefined) {
+    return true;
+  }
+  if (typeof value === "string" && value.trim() === "") {
+    return true;
+  }
+  if (Array.isArray(value) && value.length === 0) {
+    return true;
+  }
+  if (
+    typeof value === "object" &&
+    !Array.isArray(value) &&
+    Object.keys(value).length === 0
+  ) {
+    return true;
+  }
+  if (typeof value === "symbol" && value.toString() === "Symbol()") {
+    return true;
+  }
+  return false;
+}

+ 2 - 1
fhKeeper/formulahousekeeper/customerBuler-crm/tsconfig.json

@@ -23,7 +23,8 @@
     "noFallthroughCasesInSwitch": true,
     "paths": {
       "@/*": ["./src/*"]
-    }
+    },
+    "types": ["element-plus/global"]
   },
   "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue"],
   "references": [{ "path": "./tsconfig.node.json" }]

+ 107 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/SysDictController.java

@@ -1,10 +1,26 @@
 package com.management.platform.controller;
 
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.management.platform.entity.Clue;
+import com.management.platform.entity.Custom;
+import com.management.platform.entity.SysDict;
+import com.management.platform.entity.SysForm;
+import com.management.platform.mapper.UserMapper;
+import com.management.platform.service.ClueService;
+import com.management.platform.service.CustomService;
+import com.management.platform.service.SysDictService;
+import com.management.platform.service.SysFormService;
+import com.management.platform.util.HttpRespMsg;
 import org.springframework.web.bind.annotation.RequestMapping;
 
+import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import java.util.List;
+
 /**
  * <p>
  *  前端控制器
@@ -16,6 +32,97 @@ import org.springframework.web.bind.annotation.RestController;
 @RestController
 @RequestMapping("/sys-dict")
 public class SysDictController {
+    @Resource
+    private SysDictService sysDictService;
+    @Resource
+    private HttpServletRequest request;
+    @Resource
+    private UserMapper userMapper;
+    @Resource
+    private ClueService clueService;
+    @Resource
+    private CustomService customService;
+
+
+    @RequestMapping("/list")
+    public HttpRespMsg list(){
+        HttpRespMsg msg=new HttpRespMsg();
+        Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
+        List<SysDict> list = sysDictService.list(new LambdaQueryWrapper<SysDict>().eq(SysDict::getCompanyId, companyId));
+        msg.setData(list);
+        return msg;
+    }
+
+    @RequestMapping("/getListByCode")
+    public HttpRespMsg getListByCode(@RequestParam String code){
+        HttpRespMsg msg=new HttpRespMsg();
+        Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
+        List<SysDict> sysDictList = sysDictService.list(new LambdaQueryWrapper<SysDict>().eq(SysDict::getCompanyId, companyId).eq(SysDict::getCode, code).orderByAsc(SysDict::getSeq));
+        msg.setData(sysDictList);
+        return msg;
+    }
+
+    @RequestMapping("addOrUpdate")
+    public HttpRespMsg addOrUpdate(SysDict sysDict){
+        HttpRespMsg msg=new HttpRespMsg();
+        Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
+        sysDict.setCompanyId(companyId);
+        Integer count;
+        if(sysDict.getId()==null){
+            count = sysDictService.count(new LambdaQueryWrapper<SysDict>().eq(SysDict::getCode, sysDict.getCode()).eq(SysDict::getName,sysDict.getName()).eq(SysDict::getCompanyId, companyId));
+        }else {
+            count = sysDictService.count(new LambdaQueryWrapper<SysDict>().ne(sysDict.getId()!=null,SysDict::getId, sysDict.getId()).eq(SysDict::getName,sysDict.getName()).eq(SysDict::getCode, sysDict.getCode()).eq(SysDict::getCompanyId, companyId));
+        }
+        if(count>0){
+            msg.setError("名称为["+sysDict.getName()+"]的自定义配置名称已存在");
+            return msg;
+        }
+
+        if(!sysDictService.saveOrUpdate(sysDict)){
+            msg.setError("验证失败");
+        };
+        return msg;
+    }
 
+    @RequestMapping("/delete")
+    public HttpRespMsg delete(Integer id,String code){
+        HttpRespMsg msg=new HttpRespMsg();
+        Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
+        int count;
+        switch (code){
+            case "ClueSources":
+                count= clueService.count(new LambdaQueryWrapper<Clue>().eq(Clue::getCompanyId, companyId).eq(Clue::getClueSourceId, id));
+                if(count>0){
+                    msg.setError("当前线索来源数据已被使用无法删除");
+                    return msg;
+                }
+                break;
+            case "CustomLevel":
+                count = customService.count(new LambdaQueryWrapper<Custom>().eq(Custom::getCompanyId, companyId).eq(Custom::getCustomerLevelId, id));
+                if(count>0){
+                    msg.setError("当前客户级别数据已被使用无法删除");
+                    return msg;
+                }
+                break;
+            case "CustomSources":
+                count = customService.count(new LambdaQueryWrapper<Custom>().eq(Custom::getCompanyId, companyId).eq(Custom::getCustomSourceId, id));
+                if(count>0){
+                    msg.setError("当前客户来源数据已被使用无法删除");
+                    return msg;
+                }
+                break;
+            case "CustomIndustry":
+                count = customService.count(new LambdaQueryWrapper<Custom>().eq(Custom::getCompanyId, companyId).eq(Custom::getCustomerIndustryId, id));
+                if(count>0){
+                    msg.setError("当前客户行业数据已被使用无法删除");
+                    return msg;
+                }
+                break;
+        }
+        if(!sysDictService.removeById(id)){
+            msg.setError("验证失败");
+        }
+        return msg;
+    }
 }
 

+ 8 - 10
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/SysDict.java

@@ -1,5 +1,6 @@
 package com.management.platform.entity;
 
+import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.extension.activerecord.Model;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableField;
@@ -14,7 +15,7 @@ import lombok.experimental.Accessors;
  * </p>
  *
  * @author Seyason
- * @since 2024-02-28
+ * @since 2024-03-04
  */
 @Data
 @EqualsAndHashCode(callSuper = false)
@@ -23,17 +24,14 @@ public class SysDict extends Model<SysDict> {
 
     private static final long serialVersionUID=1L;
 
-    /**
-     * 字典代码
-     */
-    @TableId("code")
-    private String code;
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
 
     /**
-     * 字典
+     * 字典编码
      */
-    @TableField("id")
-    private String id;
+    @TableField("code")
+    private String code;
 
     /**
      * 名字
@@ -53,7 +51,7 @@ public class SysDict extends Model<SysDict> {
 
     @Override
     protected Serializable pkVal() {
-        return this.code;
+        return this.id;
     }
 
 }

+ 29 - 28
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/UserServiceImpl.java

@@ -625,30 +625,6 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
             }
             moduleList.add(findIndex,centerManageModule);
         }
-        //组装层级关系,默认只有两级
-        List<SysModule> menuList = new ArrayList<>();
-        for (SysModule module : moduleList) {
-            if (module.getParentId() == null) {
-                menuList.add(module);
-            }
-            if(timeType.getProjectCustom()==0){
-                if(module.getName().equals("项目表单设置")){
-                    continue;
-                }
-            }
-        }
-        for (SysModule mainMenu : menuList) {
-            List<SysModule> list = moduleList.stream().filter(mod -> mainMenu.getId().equals(mod.getParentId())).collect(Collectors.toList());
-            if(timeType.getProjectCustom()==0){
-                Optional<SysModule> first = list.stream().filter(l -> l.getName().equals("项目表单设置")).findFirst();
-                if(first.isPresent()){
-                    list.remove(first.get());
-                }
-            }
-            mainMenu.setChildren(list);
-        }
-
-        user.setModuleList(menuList);
         //此处返回权限集合
         List<Integer> functionIdList = new ArrayList<>();
         //获取角色所有的功能id
@@ -660,6 +636,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
         //获取当前公司开启了得报表
         List<CompanyReport> companyReportList = companyReportMapper.selectList(new QueryWrapper<CompanyReport>().eq("company_id", company.getId()));
         List<Integer> formIds = companyReportList.stream().map(CompanyReport::getReportFormId).collect(Collectors.toList());
+        List<SysFunction> functionList=new ArrayList<>();
         if (functionIdList.size() > 0) {
             //根据功能id获取可用的操作代码
             if (formIds.size() == 0) {
@@ -704,12 +681,36 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
                 return wrapper;
             });
             functionQueryWrapper.orderByAsc("seq");
-            List<SysFunction> functionList = sysFunctionMapper.selectList(functionQueryWrapper);
+            functionList = sysFunctionMapper.selectList(functionQueryWrapper);
             functionList = functionList.stream().filter(f->functionIdList.contains(f.getId())).collect(Collectors.toList());
             user.setFunctionList(functionList);
-        } else {
-            user.setFunctionList(new ArrayList<>());
         }
+        //组装层级关系,默认只有两级
+        List<SysModule> menuList = new ArrayList<>();
+        for (SysModule module : moduleList) {
+            if (module.getParentId() == null) {
+                menuList.add(module);
+            }
+            if(timeType.getProjectCustom()==0){
+                if(module.getName().equals("项目表单设置")){
+                    continue;
+                }
+            }
+            //赋予菜单对应功能列表
+            module.setFunctionList(functionList.stream().filter(item -> item.getModuleId().equals(module.getId())).collect(Collectors.toList()));
+        }
+        for (SysModule mainMenu : menuList) {
+            List<SysModule> list = moduleList.stream().filter(mod -> mainMenu.getId().equals(mod.getParentId())).collect(Collectors.toList());
+            if(timeType.getProjectCustom()==0){
+                Optional<SysModule> first = list.stream().filter(l -> l.getName().equals("项目表单设置")).findFirst();
+                if(first.isPresent()){
+                    list.remove(first.get());
+                }
+            }
+            mainMenu.setChildren(list);
+        }
+
+        user.setModuleList(menuList);
     }
 
     private boolean judgeIsLeader(String userId) {
@@ -1272,7 +1273,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
 //                task.setGroupId(taskGroup.getId());
 //                task.setSeq(0);
 //                task.setName(MessageUtils.message("Stages.example"));
-                taskMapper.insert(task);
+//                taskMapper.insert(task);
                 httpRespMsg.data = user;
             }
         }

+ 2 - 2
fhKeeper/formulahousekeeper/management-crm/src/main/resources/logback.xml

@@ -14,11 +14,11 @@
 	
 	<!-- 系统日志输出 -->
 	<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
-	    <file>${log.path}/workTime.log</file>
+	    <file>${log.path}/crm.log</file>
         <!-- 循环政策:基于时间创建日志文件 -->
 		<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
             <!-- 日志文件名格式 -->
-			<fileNamePattern>${log.path}/workTime.%d{yyyy-MM-dd}.log.gz</fileNamePattern>
+			<fileNamePattern>${log.path}/crm.%d{yyyy-MM-dd}.log.gz</fileNamePattern>
 			<!-- 日志最大的历史 2天 -->
 			<maxHistory>7</maxHistory>
 		</rollingPolicy>

+ 3 - 3
fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/SysDictMapper.xml

@@ -4,8 +4,8 @@
 
     <!-- 通用查询映射结果 -->
     <resultMap id="BaseResultMap" type="com.management.platform.entity.SysDict">
-        <id column="code" property="code" />
-        <result column="id" property="id" />
+        <id column="id" property="id" />
+        <result column="code" property="code" />
         <result column="name" property="name" />
         <result column="seq" property="seq" />
         <result column="company_id" property="companyId" />
@@ -13,7 +13,7 @@
 
     <!-- 通用查询结果列 -->
     <sql id="Base_Column_List">
-        code, id, name, seq, company_id
+        id, code, name, seq, company_id
     </sql>
 
 </mapper>

+ 60 - 54
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectServiceImpl.java

@@ -12778,31 +12778,33 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                             item.put("groupName",groupName);
                             item.put("corpwxDeptId",corpwxDeptid);
                             item.put("department_name",departmentName);
-                            if(!taskGroup.isPresent()){
-                                item.put("planHour",0);
-                                item.put("realHour",0);
-                                item.put("realCost",0);
-                                item.put("overHour",0);
-                                item.put("normalHour",0);
-                                item.put("process","0%");
-                            }else {
-                                Optional<Map<String, Object>> first = resultList.stream().filter(r -> Integer.valueOf(String.valueOf(r.get("projectId"))).equals(project.getId())
-                                        && Integer.valueOf(String.valueOf(r.get("groupId"))).equals(taskGroup.get().getId()) &&( Integer.valueOf(String.valueOf(r.get("deptId"))).equals(7459)||subDeptIds.contains( Integer.valueOf(String.valueOf(r.get("deptId")))))).findFirst();
-                                if(first.isPresent()){
-                                    item.put("planHour",first.get().get("planHour"));
-                                    item.put("realHour",first.get().get("realHour"));
-                                    item.put("realCost",first.get().get("realCost"));
-                                    item.put("overHour",first.get().get("overHour"));
-                                    item.put("normalHour",first.get().get("normalHour"));
-                                    item.put("process",first.get().get("process"));
+                            if(taskGroup.isPresent()){
+                                List<Map<String, Object>> mapList = resultList.stream().filter(r -> Integer.valueOf(String.valueOf(r.get("projectId"))).equals(project.getId())
+                                        && Integer.valueOf(String.valueOf(r.get("groupId"))).equals(taskGroup.get().getId()) && (Integer.valueOf(String.valueOf(r.get("deptId"))).equals(7459) || subDeptIds.contains(Integer.valueOf(String.valueOf(r.get("deptId")))))).collect(Collectors.toList());
+                                if(mapList!=null&&mapList.size()>0){
+                                    item.put("planHour",mapList.stream().mapToDouble(m-> Double.valueOf(String.valueOf(m.get("planHour")))).sum());
+                                    item.put("realHour",mapList.stream().mapToDouble(m-> Double.valueOf(String.valueOf(m.get("realHour")))).sum());
+                                    item.put("realCost",mapList.stream().mapToDouble(m-> Double.valueOf(String.valueOf(m.get("overHour")))).sum());
+                                    item.put("overHour",mapList.stream().mapToDouble(m-> Double.valueOf(String.valueOf(m.get("overHour")))).sum());
+                                    item.put("normalHour",mapList.stream().mapToDouble(m-> Double.valueOf(String.valueOf(m.get("normalHour")))).sum());
+                                    double realHour = mapList.stream().mapToDouble(m -> Double.valueOf(String.valueOf(m.get("realHour")))).sum();
+                                    double planHour = mapList.stream().mapToDouble(m -> Double.valueOf(String.valueOf(m.get("planHour")))).sum();
+                                    item.put("process",percentFormat.format(realHour/planHour));
                                 }else {
                                     item.put("planHour",0);
                                     item.put("realHour",0);
                                     item.put("realCost",0);
                                     item.put("overHour",0);
                                     item.put("normalHour",0);
-                                    item.put("process","0%");
+                                    item.put("process","0.00%");
                                 }
+                            }else {
+                                item.put("planHour",0);
+                                item.put("realHour",0);
+                                item.put("realCost",0);
+                                item.put("overHour",0);
+                                item.put("normalHour",0);
+                                item.put("process","0.00%");
                             }
                             itemList.add(item);
                         }
@@ -12821,31 +12823,33 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                             item.put("groupName",groupName);
                             item.put("corpwxDeptId",corpwxDeptid);
                             item.put("department_name",departmentName);
-                            if(!taskGroup.isPresent()){
-                                item.put("planHour",0);
-                                item.put("realHour",0);
-                                item.put("realCost",0);
-                                item.put("overHour",0);
-                                item.put("normalHour",0);
-                                item.put("process","0%");
-                            }else {
-                                Optional<Map<String, Object>> first = resultList.stream().filter(r -> Integer.valueOf(String.valueOf(r.get("projectId"))).equals(project.getId())
-                                        && Integer.valueOf(String.valueOf(r.get("groupId"))).equals(taskGroup.get().getId()) &&( Integer.valueOf(String.valueOf(r.get("deptId"))).equals(7460)||subDeptIds.contains( Integer.valueOf(String.valueOf(r.get("deptId")))))).findFirst();
-                                if(first.isPresent()){
-                                    item.put("planHour",first.get().get("planHour"));
-                                    item.put("realHour",first.get().get("realHour"));
-                                    item.put("realCost",first.get().get("realCost"));
-                                    item.put("overHour",first.get().get("overHour"));
-                                    item.put("normalHour",first.get().get("normalHour"));
-                                    item.put("process",first.get().get("process"));
+                            if(taskGroup.isPresent()){
+                                List<Map<String, Object>> mapList = resultList.stream().filter(r -> Integer.valueOf(String.valueOf(r.get("projectId"))).equals(project.getId())
+                                        && Integer.valueOf(String.valueOf(r.get("groupId"))).equals(taskGroup.get().getId()) && (Integer.valueOf(String.valueOf(r.get("deptId"))).equals(7460) || subDeptIds.contains(Integer.valueOf(String.valueOf(r.get("deptId")))))).collect(Collectors.toList());
+                                if(mapList!=null&&mapList.size()>0){
+                                    item.put("planHour",mapList.stream().mapToDouble(m-> Double.valueOf(String.valueOf(m.get("planHour")))).sum());
+                                    item.put("realHour",mapList.stream().mapToDouble(m-> Double.valueOf(String.valueOf(m.get("realHour")))).sum());
+                                    item.put("realCost",mapList.stream().mapToDouble(m-> Double.valueOf(String.valueOf(m.get("overHour")))).sum());
+                                    item.put("overHour",mapList.stream().mapToDouble(m-> Double.valueOf(String.valueOf(m.get("overHour")))).sum());
+                                    item.put("normalHour",mapList.stream().mapToDouble(m-> Double.valueOf(String.valueOf(m.get("normalHour")))).sum());
+                                    double realHour = mapList.stream().mapToDouble(m -> Double.valueOf(String.valueOf(m.get("realHour")))).sum();
+                                    double planHour = mapList.stream().mapToDouble(m -> Double.valueOf(String.valueOf(m.get("planHour")))).sum();
+                                    item.put("process",percentFormat.format(realHour/planHour));
                                 }else {
                                     item.put("planHour",0);
                                     item.put("realHour",0);
                                     item.put("realCost",0);
                                     item.put("overHour",0);
                                     item.put("normalHour",0);
-                                    item.put("process","0%");
+                                    item.put("process","0.00%");
                                 }
+                            }else {
+                                item.put("planHour",0);
+                                item.put("realHour",0);
+                                item.put("realCost",0);
+                                item.put("overHour",0);
+                                item.put("normalHour",0);
+                                item.put("process","0.00%");
                             }
                             itemList.add(item);
                         }
@@ -12868,31 +12872,33 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                             item.put("groupName",groupName);
                             item.put("corpwxDeptId",corpwxDeptid);
                             item.put("department_name",departmentName);
-                            if(!taskGroup.isPresent()){
-                                item.put("planHour",0);
-                                item.put("realHour",0);
-                                item.put("realCost",0);
-                                item.put("overHour",0);
-                                item.put("normalHour",0);
-                                item.put("process","0%");
-                            }else {
-                                Optional<Map<String, Object>> first = resultList.stream().filter(r -> Integer.valueOf(String.valueOf(r.get("projectId"))).equals(project.getId())
-                                        && Integer.valueOf(String.valueOf(r.get("groupId"))).equals(taskGroup.get().getId()) &&( Integer.valueOf(String.valueOf(r.get("deptId"))).equals(7458)||subDeptIds.contains( Integer.valueOf(String.valueOf(r.get("deptId")))))).findFirst();
-                                if(first.isPresent()){
-                                    item.put("planHour",first.get().get("planHour"));
-                                    item.put("realHour",first.get().get("realHour"));
-                                    item.put("realCost",first.get().get("realCost"));
-                                    item.put("overHour",first.get().get("overHour"));
-                                    item.put("normalHour",first.get().get("normalHour"));
-                                    item.put("process",first.get().get("process"));
+                            if(taskGroup.isPresent()){
+                                List<Map<String, Object>> mapList = resultList.stream().filter(r -> Integer.valueOf(String.valueOf(r.get("projectId"))).equals(project.getId())
+                                        && Integer.valueOf(String.valueOf(r.get("groupId"))).equals(taskGroup.get().getId()) && (Integer.valueOf(String.valueOf(r.get("deptId"))).equals(7458) || subDeptIds.contains(Integer.valueOf(String.valueOf(r.get("deptId")))))).collect(Collectors.toList());
+                                if(mapList!=null&&mapList.size()>0){
+                                    item.put("planHour",mapList.stream().mapToDouble(m-> Double.valueOf(String.valueOf(m.get("planHour")))).sum());
+                                    item.put("realHour",mapList.stream().mapToDouble(m-> Double.valueOf(String.valueOf(m.get("realHour")))).sum());
+                                    item.put("realCost",mapList.stream().mapToDouble(m-> Double.valueOf(String.valueOf(m.get("overHour")))).sum());
+                                    item.put("overHour",mapList.stream().mapToDouble(m-> Double.valueOf(String.valueOf(m.get("overHour")))).sum());
+                                    item.put("normalHour",mapList.stream().mapToDouble(m-> Double.valueOf(String.valueOf(m.get("normalHour")))).sum());
+                                    double realHour = mapList.stream().mapToDouble(m -> Double.valueOf(String.valueOf(m.get("realHour")))).sum();
+                                    double planHour = mapList.stream().mapToDouble(m -> Double.valueOf(String.valueOf(m.get("planHour")))).sum();
+                                    item.put("process",percentFormat.format(realHour/planHour));
                                 }else {
                                     item.put("planHour",0);
                                     item.put("realHour",0);
                                     item.put("realCost",0);
                                     item.put("overHour",0);
                                     item.put("normalHour",0);
-                                    item.put("process","0%");
+                                    item.put("process","0.00%");
                                 }
+                            }else {
+                                item.put("planHour",0);
+                                item.put("realHour",0);
+                                item.put("realCost",0);
+                                item.put("overHour",0);
+                                item.put("normalHour",0);
+                                item.put("process","0.00%");
                             }
                             itemList.add(item);
                         }

+ 18 - 16
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/ProjectMapper.xml

@@ -1890,22 +1890,24 @@
     </select>
 
     <select id="groupExpendProcessList" resultType="java.util.Map">
-        SELECT p.project_name AS projectName,p.id as projectId,tg.id as groupId,d.department_name,d.department_id as deptId,d.corpwx_deptid AS corpwxDeptId,tg.name AS groupName,
-        IFNULL(SUM(CASE WHEN (r.create_date BETWEEN #{startDate} AND #{endDate} AND r.state=1 AND r.project_id IS NOT NULL) THEN r.working_time ELSE NULL END),0) AS realHour,
-        IFNULL(SUM(CASE WHEN (r.create_date BETWEEN #{startDate} AND #{endDate} AND r.state=1 AND r.project_id IS NOT NULL) THEN r.cost ELSE NULL END),0) AS realCost,
-        IFNULL(SUM(CASE WHEN (r.create_date BETWEEN #{startDate} AND #{endDate} AND r.state=1 AND r.project_id IS NOT NULL) THEN r.overtime_hours ELSE NULL END),0) AS overHour,
-        IFNULL(SUM(CASE WHEN (r.create_date BETWEEN #{startDate} AND #{endDate} AND r.state=1 AND r.project_id IS NOT NULL) THEN r.working_time ELSE NULL END)
-              -SUM(CASE WHEN (r.create_date BETWEEN #{startDate} AND #{endDate} AND r.state=1 AND r.project_id IS NOT NULL) THEN r.overtime_hours ELSE NULL END),0) AS normalHour,
-        IFNULL(tg.man_day*8,0) AS planHour,
-        CONCAT(ROUND((IFNULL(SUM(CASE WHEN (r.create_date BETWEEN #{startDate} AND #{endDate} AND r.state=1 AND r.project_id IS NOT NULL) THEN r.working_time ELSE NULL END),0)/IFNULL(tg.man_day*8,0))*100,2),'%') as process
-        FROM  task_group tg
-        LEFT JOIN task t ON t.group_id=tg.id
-        LEFT JOIN report r  ON r.task_id=t.id
-        LEFT JOIN project p ON p.id=r.project_id
-        LEFT JOIN department d ON d.department_id=r.dept_id
-        WHERE r.company_id=#{companyId}  AND tg.name IN ('生产部电气','生产部车间','工程部现场安装施工','工程部配合调试','研发部工艺设计','研发部结构设计','研发部BIM设计','研发部电气设计','研发部工艺调试验收','研发部电气调试验收')
+        SELECT p.project_name AS projectName,p.id AS projectId,tg.id AS groupId,d.department_name,d.department_id AS deptId,d.corpwx_deptid AS corpwxDeptId,tg.name AS groupName,
+        IFNULL((SELECT SUM(working_time) FROM report  WHERE task_id=t.id AND dept_id=d.department_id AND create_date BETWEEN #{startDate} AND #{endDate} AND state=1 AND project_id IS NOT NULL),0) AS realHour,
+        IFNULL((SELECT SUM(cost) FROM report  WHERE task_id=t.id AND dept_id=d.department_id AND create_date BETWEEN #{startDate} AND #{endDate} AND state=1 AND project_id IS NOT NULL) ,0) AS realCost,
+        IFNULL((SELECT SUM(overtime_hours) FROM report  WHERE task_id=t.id AND dept_id=d.department_id AND create_date BETWEEN #{startDate} AND #{endDate} AND state=1 AND project_id IS NOT NULL ),0) AS overHour,
+        (IFNULL((SELECT SUM(working_time) FROM report  WHERE task_id=t.id AND dept_id=d.department_id AND create_date BETWEEN #{startDate} AND #{endDate} AND state=1 AND project_id IS NOT NULL),0)
+        -IFNULL((SELECT SUM(overtime_hours) FROM report  WHERE task_id=t.id AND dept_id=d.department_id AND create_date BETWEEN #{startDate} AND #{endDate} AND state=1 AND project_id IS NOT NULL ),0)) as normalHour,
+        IFNULL(SUM(te.plan_hours),0) AS planHour
+        FROM task_executor te
+        LEFT JOIN task t ON t.id=te.task_id
+        LEFT JOIN USER u ON te.executor_id=u.id
+        LEFT JOIN task_group tg ON tg.id=t.group_id
+        LEFT JOIN project p ON p.id=tg.project_id
+        LEFT JOIN department d ON d.department_id=u.department_id
+        WHERE u.company_id=#{companyId}
+        AND tg.name IN ('生产部电气','生产部车间','工程部现场安装施工','工程部配合调试','研发部工艺设计','研发部结构设计','研发部BIM设计','研发部电气设计','研发部工艺调试验收','研发部电气调试验收')
+        AND d.department_id IN ( 7458, 7459, 7902, 7903, 7460, 7813, 7814, 7815, 7816)
         <if test="userId!=null and userId!=''">
-            and r.creator_id=#{userId}
+            and t.executor_id=#{userId}
         </if>
         <if test="list!=null and list.size()>0">
             and d.department_id in
@@ -1919,7 +1921,7 @@
                 #{item}
             </foreach>
         </if>
-        GROUP BY tg.id ORDER BY p.id,d.department_id
+        GROUP BY p.id,tg.id,d.department_id ORDER BY p.id,d.department_id
     </select>
 
     <select id="projectExpendProcessList" resultType="java.util.Map">