sunlupeng 1 年之前
父节点
当前提交
75c7aeb331

+ 32 - 13
src/api/personnel/attendance/info/index.js

@@ -1,54 +1,73 @@
 import request from '@/utils/request'
 
+// 获得每日考勤信息分页
+export function listInfoDaily(query) {
+  return request({
+    url: '/personnel/attendance/info/dailyPage',
+    method: 'get',
+    params: query
+  })
+}
+
+// 获得月度考勤信息分页
+export function listInfoMonthly(query) {
+  return request({
+    url: '/personnel/attendance/info/monthlyPage',
+    method: 'get',
+    params: query
+  })
+}
+
+
 // 查询列表
-export function listEntry(query) {
+export function listInfo(query) {
   return request({
-    url: '/personnel/relations/entry/page',
+    url: '/personnel/relations/info/page',
     method: 'get',
     params: query
   })
 }
 
 // 查询详细
-export function getEntry(dictId) {
+export function getInfo(dictId) {
   return request({
-    url: '/personnel/relations/entry/get?id=' + dictId,
+    url: '/personnel/relations/info/get?id=' + dictId,
     method: 'get'
   })
 }
 
 // 新增
-export function addEntry(data) {
+export function addInfo(data) {
   return request({
-    url: '/personnel/relations/entry/create',
+    url: '/personnel/relations/info/create',
     method: 'post',
     data: data
   })
 }
 
 // 修改
-export function updateEntry(data) {
+export function updateInfo(data) {
   return request({
-    url: '/personnel/relations/entry/update',
+    url: '/personnel/relations/info/update',
     method: 'put',
     data: data
   })
 }
 
 // 删除
-export function delEntry(dictId) {
+export function delInfo(dictId) {
   return request({
-    url: '/personnel/relations/entry/delete?id=' + dictId,
+    url: '/personnel/relations/info/delete?id=' + dictId,
     method: 'delete'
   })
 }
 
 // 导出
-export function exportEntry(query) {
+export function exportInfo(query) {
   return request({
-    url: '/personnel/relations/entry/export-excel',
+    url: '/personnel/relations/info/export-excel',
     method: 'get',
     params: query,
-    responseEntry: 'blob'
+    responseType: 'blob'
   })
 }

+ 150 - 0
src/views/personnel/attendance/info/daily.vue

@@ -0,0 +1,150 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="员工姓名" prop="employeeName">
+        <el-input v-model="queryParams.employeeName" placeholder="员工姓名" clearable style="width: 250px"
+          @keyup.enter.native="handleQuery" />
+      </el-form-item>
+      <el-form-item label="部门" prop="deptId">
+        <treeselect style="width: 250px" :default-expand-level="1" v-model="queryParams.deptId" :options="deptOptions"
+          :normalizer="normalizer" placeholder="选择部门" />
+      </el-form-item>
+      <el-form-item label="手机号" prop="employeePhone">
+        <el-input v-model="queryParams.employeePhone" placeholder="请输入手机号" clearable style="width: 250px"
+          @keyup.enter.native="handleQuery" />
+      </el-form-item>
+      <el-form-item label="日期" prop="attendanceDate">
+        <el-date-picker v-model="queryParams.attendanceDate" style="width: 250px" value-format="yyyy-MM-dd HH:mm:ss"
+          type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"
+          :default-time="['00:00:00', '23:59:59']" />
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button type="warning" icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"
+          v-hasPermi="['relations:renew:export']">导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" :data="typeList">
+      <el-table-column label="员工姓名" align="center" prop="employeeName" min-width="80" />
+      <el-table-column label="部门" align="center" prop="deptName" min-width="100" />
+      <el-table-column label="手机号" align="center" prop="employeePhone" min-width="100" />
+      <el-table-column label="日期" align="center" prop="attendanceDate" min-width="100" />
+      <el-table-column label="上班时间" align="center" prop="workStartTime" min-width="100" />
+      <el-table-column label="下班下班" align="center" prop="workEndTime" min-width="100" />
+      <el-table-column label="迟到时间(min)" align="center" prop="lateMinute" min-width="100" />
+      <el-table-column label="早退时间(min)" align="center" prop="earlyMinute" min-width="100" />
+      <el-table-column label="总工作时间(min)" align="center" prop="totalWorkingMinute" min-width="100" />
+    </el-table>
+    <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
+      @pagination="getList" />
+  </div>
+</template>
+
+<script>
+import { listInfoDaily, exportInfo } from "@/api/personnel/attendance/info/index";
+import Treeselect from "@riophae/vue-treeselect";
+import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+import { listDept } from "@/api/system/dept";
+export default {
+  name: "SystemDictType",
+  components: {
+    Treeselect,
+  },
+  data() {
+    return {
+      posOptions: [],
+      // 部门列表
+      deptOptions: [], // 部门属性结构
+      // 遮罩层
+      loading: true,
+      // 导出遮罩层
+      exportLoading: false,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 字典表格数据
+      typeList: [],
+      // 弹出层标题
+      title: "",
+      // 查询参数
+      queryParams: {
+        pageNo: 1,
+        pageSize: 10,
+        employeeName: undefined,
+        deptId: undefined,
+        position: undefined,
+        employeePhone: undefined,
+        attendanceDate: [],
+      },
+    };
+  },
+  created() {
+    this.getList();
+    this.getListDept();
+  },
+  methods: {
+    /** 查询部门列表 */
+    getListDept() {
+      listDept().then(response => {
+        this.deptOptions = this.handleTree(response.data, "id");
+      });
+    },
+    /** 转换部门数据结构 */
+    normalizer(node) {
+      if (node.children && !node.children.length) {
+        delete node.children;
+      }
+      return {
+        id: node.id,
+        label: node.name,
+        children: node.children
+      };
+    },
+    /** 查询列表 */
+    getList() {
+      this.loading = true;
+      // 执行查询
+      listInfoDaily(this.queryParams).then(response => {
+        this.typeList = response.data.list;
+        this.total = response.data.total;
+        this.loading = false;
+      });
+    },
+
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNo = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      // 处理查询参数
+      let params = { ...this.queryParams };
+      params.pageNo = undefined;
+      params.pageSize = undefined;
+      // 执行导出
+      this.$modal.confirm('是否确认导出所有数据项?').then(() => {
+        this.exportLoading = true;
+        return exportInfo(params);
+      }).then(response => {
+        this.$download.excel(response, '.xls');
+        this.exportLoading = false;
+      }).catch(() => { });
+    }
+  }
+};
+</script>

+ 8 - 9
src/views/personnel/attendance/info/index.vue

@@ -202,12 +202,11 @@
 </template>
 
 <script>
-import { listRenew, getRenew, delRenew, addRenew, updateRenew, exportRenew } from "@/api/personnel/relations/renew/index";
+import { listInfo, getInfo, delInfo, addInfo, updateInfo, exportInfo } from "@/api/personnel/attendance/info/index";
 import PeopleSelect from "@/components/PeopleSelect/index.vue";
 import Treeselect from "@riophae/vue-treeselect";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 import { listDept } from "@/api/system/dept";
-import { getBaseHeader } from "@/utils/request";
 export default {
   name: "SystemDictType",
   components: {
@@ -300,7 +299,7 @@ export default {
     getList() {
       this.loading = true;
       // 执行查询
-      listRenew(this.queryParams).then(response => {
+      listInfo(this.queryParams).then(response => {
         this.typeList = response.data.list;
         this.total = response.data.total;
         this.loading = false;
@@ -347,7 +346,7 @@ export default {
     handleDetail(row) {
       this.reset();
       const id = row.id;
-      getRenew(id).then(response => {
+      getInfo(id).then(response => {
         this.form = response.data;
         this.openDetail = true;
         this.title = "详情";
@@ -357,7 +356,7 @@ export default {
     handleUpdate(row) {
       this.reset();
       const id = row.id;
-      getRenew(id).then(response => {
+      getInfo(id).then(response => {
         this.form = response.data;
         this.open = true;
         this.title = "修改";
@@ -368,13 +367,13 @@ export default {
       this.$refs["form"].validate(valid => {
         if (valid) {
           if (this.form.id !== undefined) {
-            updateRenew(this.form).then(response => {
+            updateInfo(this.form).then(response => {
               this.$modal.msgSuccess("修改成功");
               this.open = false;
               this.getList();
             });
           } else {
-            addRenew(this.form).then(response => {
+            addInfo(this.form).then(response => {
               this.$modal.msgSuccess("新增成功");
               this.open = false;
               this.getList();
@@ -387,7 +386,7 @@ export default {
     handleDelete(row) {
       const ids = row.id || this.ids;
       this.$modal.confirm('是否确认删除字典编号为"' + ids + '"的数据项?').then(function () {
-        return delRenew(ids);
+        return delInfo(ids);
       }).then(() => {
         this.getList();
         this.$modal.msgSuccess("删除成功");
@@ -402,7 +401,7 @@ export default {
       // 执行导出
       this.$modal.confirm('是否确认导出所有数据项?').then(() => {
         this.exportLoading = true;
-        return exportRenew(params);
+        return exportInfo(params);
       }).then(response => {
         this.$download.excel(response, '.xls');
         this.exportLoading = false;

+ 151 - 0
src/views/personnel/attendance/info/monthly.vue

@@ -0,0 +1,151 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="员工姓名" prop="employeeName">
+        <el-input v-model="queryParams.employeeName" placeholder="员工姓名" clearable style="width: 250px"
+          @keyup.enter.native="handleQuery" />
+      </el-form-item>
+      <el-form-item label="部门" prop="deptId">
+        <treeselect style="width: 250px" :default-expand-level="1" v-model="queryParams.deptId" :options="deptOptions"
+          :normalizer="normalizer" placeholder="选择部门" />
+      </el-form-item>
+      <el-form-item label="手机号" prop="employeePhone">
+        <el-input v-model="queryParams.employeePhone" placeholder="请输入手机号" clearable style="width: 250px"
+          @keyup.enter.native="handleQuery" />
+      </el-form-item>
+      <el-form-item label="日期" prop="attendanceDate">
+        <el-date-picker v-model="queryParams.attendanceDate" style="width: 250px" value-format="yyyy-MM-dd HH:mm:ss"
+          type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"
+          :default-time="['00:00:00', '23:59:59']" />
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button type="warning" icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"
+          v-hasPermi="['relations:renew:export']">导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" :data="typeList">
+      <el-table-column label="员工姓名" align="center" prop="employeeName" min-width="80" />
+      <el-table-column label="部门" align="center" prop="deptName" min-width="100" />
+      <el-table-column label="手机号" align="center" prop="employeePhone" min-width="100" />
+      <el-table-column label="出勤天数" align="center" prop="attendanceDays" min-width="100" />
+      <el-table-column label="正常打卡次数" align="center" prop="normalClockCount" min-width="100" />
+      <el-table-column label="迟到次数" align="center" prop="lateCount" min-width="100" />
+      <el-table-column label="旷工次数" align="center" prop="absenteeismCount" min-width="100" />
+      <el-table-column label="早退次数" align="center" prop="earlyCount" min-width="100" />
+      <el-table-column label="缺卡次数" align="center" prop="missingClockCount" min-width="100" />
+      <el-table-column label="请假/出差天数" align="center" prop="leaveCount" min-width="100" />
+    </el-table>
+    <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
+      @pagination="getList" />
+  </div>
+</template>
+
+<script>
+import { listInfoMonthly, exportInfo } from "@/api/personnel/attendance/info/index";
+import Treeselect from "@riophae/vue-treeselect";
+import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+import { listDept } from "@/api/system/dept";
+export default {
+  name: "SystemDictType",
+  components: {
+    Treeselect,
+  },
+  data() {
+    return {
+      posOptions: [],
+      // 部门列表
+      deptOptions: [], // 部门属性结构
+      // 遮罩层
+      loading: true,
+      // 导出遮罩层
+      exportLoading: false,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 字典表格数据
+      typeList: [],
+      // 弹出层标题
+      title: "",
+      // 查询参数
+      queryParams: {
+        pageNo: 1,
+        pageSize: 10,
+        employeeName: undefined,
+        deptId: undefined,
+        position: undefined,
+        employeePhone: undefined,
+        attendanceDate: [],
+      },
+    };
+  },
+  created() {
+    this.getList();
+    this.getListDept();
+  },
+  methods: {
+    /** 查询部门列表 */
+    getListDept() {
+      listDept().then(response => {
+        this.deptOptions = this.handleTree(response.data, "id");
+      });
+    },
+    /** 转换部门数据结构 */
+    normalizer(node) {
+      if (node.children && !node.children.length) {
+        delete node.children;
+      }
+      return {
+        id: node.id,
+        label: node.name,
+        children: node.children
+      };
+    },
+    /** 查询列表 */
+    getList() {
+      this.loading = true;
+      // 执行查询
+      listInfoMonthly(this.queryParams).then(response => {
+        this.typeList = response.data.list;
+        this.total = response.data.total;
+        this.loading = false;
+      });
+    },
+
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNo = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      // 处理查询参数
+      let params = { ...this.queryParams };
+      params.pageNo = undefined;
+      params.pageSize = undefined;
+      // 执行导出
+      this.$modal.confirm('是否确认导出所有数据项?').then(() => {
+        this.exportLoading = true;
+        return exportInfo(params);
+      }).then(response => {
+        this.$download.excel(response, '.xls');
+        this.exportLoading = false;
+      }).catch(() => { });
+    }
+  }
+};
+</script>