Browse Source

bug

Signed-off-by: liubaiyan <632697560@qq.com>
liubaiyan 3 years ago
parent
commit
c554b72601
5 changed files with 60 additions and 33 deletions
  1. 1 1
      .env.development
  2. 1 1
      index.html
  3. 9 0
      src/api/dictionary.js
  4. 46 22
      src/views/attendanceManage/attendanceManage.vue
  5. 3 9
      vite.config.js

+ 1 - 1
.env.development

@@ -1,3 +1,3 @@
-VITE_BASE_API = "https://www.gzjlzhwy.com/"
+VITE_BASE_API = "https://www.gzjlzhwy.com:4433/"
 VITE_TIME_OUT = 60000
 VITE_MENUCODE = "AttendanceSystem"

+ 1 - 1
index.html

@@ -5,7 +5,7 @@
     <link rel="icon" href="/favicon.ico" />
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
     <title>考勤管理平台</title>
-    <script src="https://webapi.amap.com/maps?v=1.4.15&key=e8a1c4d772a95eee75b2161133e35555&plugin=AMap.CircleEditor,AMap.PolyEditor"></script>
+    <script src="https://webapi.amap.com/maps?v=1.4.15&key=73f14a1c454d2bc6358609ca99885496&plugin=AMap.CircleEditor,AMap.PolyEditor"></script>
   </head>
   <body>
     <div id="app"></div>

+ 9 - 0
src/api/dictionary.js

@@ -20,3 +20,12 @@ export function getAreaDictionary (object) {
     type: 'JSON'
   })
 }
+//  字典--获取人员字典值
+export function getUserDictionary (object) {
+  return request({
+    url: `/attendance/admin/manage/getUserListByProjectId/${object.projectId}`,
+    method: 'post',
+    data: object,
+    type: 'JSON'
+  })
+}

+ 46 - 22
src/views/attendanceManage/attendanceManage.vue

@@ -458,10 +458,19 @@
     >
       <el-row :gutter="16">
         <el-col :span="11">
-          <el-card
-            shadow="hover"
-            header="可选人员"
-          >
+          <el-card shadow="hover">
+            <template #header>
+              <div class="card-header">
+                <span>可选人员</span>
+                <span>
+                  <el-button
+                    size="mini"
+                    type="primary"
+                    @click="getUserList()"
+                  >刷新</el-button>
+                </span>
+              </div>
+            </template>
             <div class="person-box">
               <el-tree
                 ref="personTree"
@@ -484,10 +493,12 @@
           />
         </el-col>
         <el-col :span="11">
-          <el-card
-            shadow="hover"
-            header="已选人员"
-          >
+          <el-card shadow="hover">
+            <template #header>
+              <div class="card-header">
+                <span>已选人员</span>
+              </div>
+            </template>
             <div class="person-box">
               <el-table
                 :data="detailForm.employees"
@@ -541,7 +552,8 @@
 
 <script>
 import {
-  getAreaDictionary
+  getAreaDictionary,
+  getUserDictionary
 } from 'api/dictionary'
 import {
   getTableListOfAttendance,
@@ -646,21 +658,27 @@ export default {
         })
       }
     })
-    getAreaDictionary({
-      treeLevel: 4
-    }).then(res => {
-      if (res.status == 10000) {
-        this.personTree = res.data
-      } else {
-        ElNotification({
-          title: '获取考勤人员失败',
-          message: res.message,
-          type: 'error'
-        })
-      }
-    })
   },
   methods: {
+    //  获取人员数据
+    getUserList () {
+      getUserDictionary({
+        projectId: this.detailForm.projectId
+      }).then(res => {
+        if (res.status == 10000) {
+          this.personTree = [res.data]
+          if (this.personFormShow) {
+            this.selectCheckedUser()
+          }
+        } else {
+          ElNotification({
+            title: '获取考勤人员失败',
+            message: res.message,
+            type: 'error'
+          })
+        }
+      })
+    },
     //  获取表格数据
     getTableList () {
       this.tableLoading = true
@@ -716,6 +734,7 @@ export default {
               groupId: type == 'copy' ? null : row.groupId,
               workDay: res.data.workDay.split(',')
             }
+            this.getUserList()
           } else {
             ElNotification({
               title: '获取详情失败',
@@ -727,6 +746,7 @@ export default {
       } else {
         this.detailFormShow = true
         this.detailForm.projectId = this.filterForm.projectIds[1]
+        this.getUserList()
       }
     },
     //  提交表单
@@ -796,6 +816,10 @@ export default {
     //  显示考勤人员
     getPerson () {
       this.personFormShow = true
+      this.selectCheckedUser()
+    },
+    //  勾选已有
+    selectCheckedUser () {
       this.$nextTick(() => {
         if (this.$refs.personTree) {
           this.$refs.personTree.setCheckedKeys(this.detailForm.employees.length

+ 3 - 9
vite.config.js

@@ -25,25 +25,19 @@ export default ({ command, mode }) => {
         port: 3001,
         proxy:{
           '/landcrm': {
-            // target: 'http://172.18.0.23/',
-            target: 'https://www.gzjlzhwy.com/',
-            // target: 'https://ebeitest.wuyeface.com:1188/',
+            target: 'https://www.gzjlzhwy.com:4433/',
             changeOrigin: true,
             ws: true,
             rewrite: (path) => path.replace(/^\/landcrm/, '/landcrm')
           },
           '/device': {
-            // target: 'http://172.18.0.23/',
-            // target: 'http://172.18.0.24:30000/',
-            target: 'https://ebeitest.wuyeface.com:1188/',
+            target: 'https://www.gzjlzhwy.com:4433/',
             changeOrigin: true,
             ws: true,
             rewrite: (path) => path.replace(/^\/device/, '/device')
           },
           '/attendance': {
-            // target: 'http://172.18.0.23/',
-            target: 'https://www.gzjlzhwy.com/',
-            // target: 'https://ebeitest.wuyeface.com:1188/',
+            target: 'https://www.gzjlzhwy.com:4433/',
             changeOrigin: true,
             ws: true,
             rewrite: (path) => path.replace(/^\/attendance/, '/attendance')