9.17增加考勤信息记录
parent
1996c60781
commit
a864d3aec3
|
@ -5,6 +5,8 @@ import com.yanzhu.common.core.web.domain.BaseEntity;
|
|||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 员工出入场记录对象 pro_user_inout_record
|
||||
*
|
||||
|
@ -73,6 +75,49 @@ public class ProUserInoutRecord extends BaseEntity
|
|||
@Excel(name = "用户岗位")
|
||||
private String userPost;
|
||||
|
||||
/** 工种类型名称 */
|
||||
@Excel(name = "工种类型名称")
|
||||
private String craftTypeName;
|
||||
|
||||
/** 工种岗位名称 */
|
||||
@Excel(name = "工种岗位名称")
|
||||
private String craftPostName;
|
||||
|
||||
private Date startDate;
|
||||
private Date endDate;
|
||||
|
||||
public Date getStartDate() {
|
||||
return startDate;
|
||||
}
|
||||
|
||||
public void setStartDate(Date startDate) {
|
||||
this.startDate = startDate;
|
||||
}
|
||||
|
||||
public Date getEndDate() {
|
||||
return endDate;
|
||||
}
|
||||
|
||||
public void setEndDate(Date endDate) {
|
||||
this.endDate = endDate;
|
||||
}
|
||||
|
||||
public String getCraftTypeName() {
|
||||
return craftTypeName;
|
||||
}
|
||||
|
||||
public void setCraftTypeName(String craftTypeName) {
|
||||
this.craftTypeName = craftTypeName;
|
||||
}
|
||||
|
||||
public String getCraftPostName() {
|
||||
return craftPostName;
|
||||
}
|
||||
|
||||
public void setCraftPostName(String craftPostName) {
|
||||
this.craftPostName = craftPostName;
|
||||
}
|
||||
|
||||
public String getUserPost() {
|
||||
return userPost;
|
||||
}
|
||||
|
|
|
@ -28,37 +28,47 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="craftTypeName" column="craft_type_name" />
|
||||
<result property="craftPostName" column="craft_post_name" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectProUserInoutRecordVo">
|
||||
select id, project_id, user_id, user_name, user_phone,user_post, user_picture, user_sex, use_status, sub_dept_id, sub_dept_name, sub_dept_type, sub_dept_group, sub_dept_group_name, craft_type, craft_post, is_del, remark, state, create_by, create_time, update_by, update_time from pro_user_inout_record
|
||||
select pur.id, pur.project_id, pur.user_id, pur.user_name, pur.user_phone,pur.user_post, pur.user_picture, pur.user_sex, pur.use_status,
|
||||
pur.sub_dept_id, pur.sub_dept_name, pur.sub_dept_type, pur.sub_dept_group, pur.sub_dept_group_name,
|
||||
pur.craft_type, pur.craft_post, pur.is_del, pur.remark, pur.state, pur.create_by, pur.create_time, pur.update_by, pur.update_time,
|
||||
dic1.dict_label as craft_type_name,dic2.dict_label as craft_post_name
|
||||
from pro_user_inout_record pur
|
||||
left join sys_dict_data dic1 on pur.`craft_type`=dic1.`dict_value` and dic1.`dict_type`='pro_craft_type'
|
||||
left join sys_dict_data dic2 on pur.`craft_post`=dic2.`dict_value` and dic2.`dict_type`='pro_craft_post'
|
||||
</sql>
|
||||
|
||||
<select id="selectProUserInoutRecordList" parameterType="ProUserInoutRecord" resultMap="ProUserInoutRecordResult">
|
||||
<include refid="selectProUserInoutRecordVo"/>
|
||||
<where>
|
||||
<if test="projectId != null "> and project_id = #{projectId}</if>
|
||||
<if test="userId != null "> and user_id = #{userId}</if>
|
||||
<if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
|
||||
<if test="userPhone != null and userPhone != ''"> and user_phone = #{userPhone}</if>
|
||||
<if test="userPicture != null and userPicture != ''"> and user_picture = #{userPicture}</if>
|
||||
<if test="userSex != null and userSex != ''"> and user_sex = #{userSex}</if>
|
||||
<if test="useStatus != null and useStatus != ''"> and use_status = #{useStatus}</if>
|
||||
<if test="subDeptId != null "> and sub_dept_id = #{subDeptId}</if>
|
||||
<if test="subDeptName != null and subDeptName != ''"> and sub_dept_name like concat('%', #{subDeptName}, '%')</if>
|
||||
<if test="subDeptType != null and subDeptType != ''"> and sub_dept_type = #{subDeptType}</if>
|
||||
<if test="subDeptGroup != null "> and sub_dept_group = #{subDeptGroup}</if>
|
||||
<if test="subDeptGroupName != null and subDeptGroupName != ''"> and sub_dept_group_name like concat('%', #{subDeptGroupName}, '%')</if>
|
||||
<if test="craftType != null and craftType != ''"> and craft_type = #{craftType}</if>
|
||||
<if test="craftPost != null and craftPost != ''"> and craft_post = #{craftPost}</if>
|
||||
<if test="isDel != null "> and is_del = #{isDel}</if>
|
||||
<if test="state != null "> and state = #{state}</if>
|
||||
<if test="projectId != null "> and pur.project_id = #{projectId}</if>
|
||||
<if test="userId != null "> and pur.user_id = #{userId}</if>
|
||||
<if test="userName != null and userName != ''"> and pur.user_name like concat('%', #{userName}, '%')</if>
|
||||
<if test="userPhone != null and userPhone != ''"> and pur.user_phone = #{userPhone}</if>
|
||||
<if test="userPicture != null and userPicture != ''"> and pur.user_picture = #{userPicture}</if>
|
||||
<if test="userSex != null and userSex != ''"> and pur.user_sex = #{userSex}</if>
|
||||
<if test="useStatus != null and useStatus != ''"> and pur.use_status = #{useStatus}</if>
|
||||
<if test="subDeptId != null "> and pur.sub_dept_id = #{subDeptId}</if>
|
||||
<if test="subDeptName != null and subDeptName != ''"> and pur.sub_dept_name like concat('%', #{subDeptName}, '%')</if>
|
||||
<if test="subDeptType != null and subDeptType != ''"> and pur.sub_dept_type = #{subDeptType}</if>
|
||||
<if test="subDeptGroup != null "> and pur.sub_dept_group = #{subDeptGroup}</if>
|
||||
<if test="subDeptGroupName != null and subDeptGroupName != ''"> and pur.sub_dept_group_name like concat('%', #{subDeptGroupName}, '%')</if>
|
||||
<if test="craftType != null and craftType != ''"> and pur.craft_type = #{craftType}</if>
|
||||
<if test="craftPost != null and craftPost != ''"> and pur.craft_post = #{craftPost}</if>
|
||||
<if test="isDel != null "> and pur.is_del = #{isDel}</if>
|
||||
<if test="state != null "> and pur.state = #{state}</if>
|
||||
<if test="startDate != null"> and date(pur.create_time) >= date(#{startDate})</if>
|
||||
<if test="endDate != null"> and date(pur.create_time) <= date(#{endDate})</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectProUserInoutRecordById" parameterType="Long" resultMap="ProUserInoutRecordResult">
|
||||
<include refid="selectProUserInoutRecordVo"/>
|
||||
where id = #{id}
|
||||
where pur.id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertProUserInoutRecord" parameterType="ProUserInoutRecord" useGeneratedKeys="true" keyProperty="id">
|
||||
|
|
|
@ -0,0 +1,105 @@
|
|||
package com.yanzhu.manage.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.yanzhu.common.core.utils.poi.ExcelUtil;
|
||||
import com.yanzhu.common.core.web.controller.BaseController;
|
||||
import com.yanzhu.common.core.web.domain.AjaxResult;
|
||||
import com.yanzhu.common.core.web.page.TableDataInfo;
|
||||
import com.yanzhu.common.log.annotation.Log;
|
||||
import com.yanzhu.common.log.enums.BusinessType;
|
||||
import com.yanzhu.common.security.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.yanzhu.manage.domain.ProMobileAttendanceData;
|
||||
import com.yanzhu.manage.service.IProMobileAttendanceDataService;
|
||||
|
||||
/**
|
||||
* 人员考勤记录Controller
|
||||
*
|
||||
* @author yanzhu
|
||||
* @date 2025-09-17
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mobileAttendanceData")
|
||||
public class ProMobileAttendanceDataController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IProMobileAttendanceDataService proMobileAttendanceDataService;
|
||||
|
||||
/**
|
||||
* 查询人员考勤记录列表
|
||||
*/
|
||||
@RequiresPermissions("manage:mobileAttendanceData:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ProMobileAttendanceData proMobileAttendanceData)
|
||||
{
|
||||
startPage();
|
||||
List<ProMobileAttendanceData> list = proMobileAttendanceDataService.selectProMobileAttendanceDataList(proMobileAttendanceData);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出人员考勤记录列表
|
||||
*/
|
||||
@RequiresPermissions("manage:mobileAttendanceData:export")
|
||||
@Log(title = "人员考勤记录", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, ProMobileAttendanceData proMobileAttendanceData)
|
||||
{
|
||||
List<ProMobileAttendanceData> list = proMobileAttendanceDataService.selectProMobileAttendanceDataList(proMobileAttendanceData);
|
||||
ExcelUtil<ProMobileAttendanceData> util = new ExcelUtil<ProMobileAttendanceData>(ProMobileAttendanceData.class);
|
||||
util.exportExcel(response, list, "人员考勤记录数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取人员考勤记录详细信息
|
||||
*/
|
||||
@RequiresPermissions("manage:mobileAttendanceData:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(proMobileAttendanceDataService.selectProMobileAttendanceDataById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增人员考勤记录
|
||||
*/
|
||||
@RequiresPermissions("manage:mobileAttendanceData:add")
|
||||
@Log(title = "人员考勤记录", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody ProMobileAttendanceData proMobileAttendanceData)
|
||||
{
|
||||
return toAjax(proMobileAttendanceDataService.insertProMobileAttendanceData(proMobileAttendanceData));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改人员考勤记录
|
||||
*/
|
||||
@RequiresPermissions("manage:mobileAttendanceData:edit")
|
||||
@Log(title = "人员考勤记录", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody ProMobileAttendanceData proMobileAttendanceData)
|
||||
{
|
||||
return toAjax(proMobileAttendanceDataService.updateProMobileAttendanceData(proMobileAttendanceData));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除人员考勤记录
|
||||
*/
|
||||
@RequiresPermissions("manage:mobileAttendanceData:remove")
|
||||
@Log(title = "人员考勤记录", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(proMobileAttendanceDataService.deleteProMobileAttendanceDataByIds(ids));
|
||||
}
|
||||
}
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
-- 菜单 SQL
|
||||
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('员工出入场记录', '2484', '1', 'userInOutRecord', 'manage/userInOutRecord/index', 1, 0, 'C', '0', '0', 'manage:userInOutRecord:list', '#', 'admin', sysdate(), '', null, '员工出入场记录菜单');
|
||||
values('员工出入场记录', '50', '1', 'userInOutRecord', 'manage/userInOutRecord/index', 1, 0, 'C', '0', '0', 'manage:userInOutRecord:list', '#', 'admin', sysdate(), '', null, '员工出入场记录菜单');
|
||||
|
||||
-- 按钮父菜单ID
|
||||
SELECT @parentId := LAST_INSERT_ID();
|
||||
|
@ -24,3 +24,26 @@ values('员工出入场记录删除', @parentId, '4', '#', '', 1, 0, 'F', '0',
|
|||
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('员工出入场记录导出', @parentId, '5', '#', '', 1, 0, 'F', '0', '0', 'manage:userInOutRecord:export', '#', 'admin', sysdate(), '', null, '');
|
||||
|
||||
--9.17 增加人员考勤记录
|
||||
-- 菜单 SQL
|
||||
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('人员考勤记录', '50', '1', 'mobileAttendanceData', 'manage/mobileAttendanceData/index', 1, 0, 'C', '0', '0', 'manage:mobileAttendanceData:list', '#', 'admin', sysdate(), '', null, '人员考勤记录菜单');
|
||||
|
||||
-- 按钮父菜单ID
|
||||
SELECT @parentId := LAST_INSERT_ID();
|
||||
|
||||
-- 按钮 SQL
|
||||
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('人员考勤记录查询', @parentId, '1', '#', '', 1, 0, 'F', '0', '0', 'manage:mobileAttendanceData:query', '#', 'admin', sysdate(), '', null, '');
|
||||
|
||||
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('人员考勤记录新增', @parentId, '2', '#', '', 1, 0, 'F', '0', '0', 'manage:mobileAttendanceData:add', '#', 'admin', sysdate(), '', null, '');
|
||||
|
||||
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('人员考勤记录修改', @parentId, '3', '#', '', 1, 0, 'F', '0', '0', 'manage:mobileAttendanceData:edit', '#', 'admin', sysdate(), '', null, '');
|
||||
|
||||
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('人员考勤记录删除', @parentId, '4', '#', '', 1, 0, 'F', '0', '0', 'manage:mobileAttendanceData:remove', '#', 'admin', sysdate(), '', null, '');
|
||||
|
||||
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('人员考勤记录导出', @parentId, '5', '#', '', 1, 0, 'F', '0', '0', 'manage:mobileAttendanceData:export', '#', 'admin', sysdate(), '', null, '');
|
|
@ -0,0 +1,44 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询人员考勤记录列表
|
||||
export function listMobileAttendanceData(query) {
|
||||
return request({
|
||||
url: '/manage/mobileAttendanceData/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询人员考勤记录详细
|
||||
export function getMobileAttendanceData(id) {
|
||||
return request({
|
||||
url: '/manage/mobileAttendanceData/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增人员考勤记录
|
||||
export function addMobileAttendanceData(data) {
|
||||
return request({
|
||||
url: '/manage/mobileAttendanceData',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改人员考勤记录
|
||||
export function updateMobileAttendanceData(data) {
|
||||
return request({
|
||||
url: '/manage/mobileAttendanceData',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除人员考勤记录
|
||||
export function delMobileAttendanceData(id) {
|
||||
return request({
|
||||
url: '/manage/mobileAttendanceData/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
|
@ -0,0 +1,363 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="用户ID" prop="userId">
|
||||
<el-input
|
||||
v-model="queryParams.userId"
|
||||
placeholder="请输入用户ID"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="项目ID" prop="projectId">
|
||||
<el-input
|
||||
v-model="queryParams.projectId"
|
||||
placeholder="请输入项目ID"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="配置ID" prop="cfgId">
|
||||
<el-input
|
||||
v-model="queryParams.cfgId"
|
||||
placeholder="请输入配置ID"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="进还是出" prop="inOut">
|
||||
<el-input
|
||||
v-model="queryParams.inOut"
|
||||
placeholder="请输入进还是出"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="经度" prop="longitude">
|
||||
<el-input
|
||||
v-model="queryParams.longitude"
|
||||
placeholder="请输入经度"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="纬度" prop="latitude">
|
||||
<el-input
|
||||
v-model="queryParams.latitude"
|
||||
placeholder="请输入纬度"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="考勤时间" prop="attDate">
|
||||
<el-date-picker clearable
|
||||
v-model="queryParams.attDate"
|
||||
type="date"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="请选择考勤时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="${comment}" prop="isDel">
|
||||
<el-input
|
||||
v-model="queryParams.isDel"
|
||||
placeholder="请输入${comment}"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="${comment}" prop="state">
|
||||
<el-input
|
||||
v-model="queryParams.state"
|
||||
placeholder="请输入${comment}"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button 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="primary"
|
||||
plain
|
||||
icon="Plus"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['manage:mobileAttendanceData:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="Edit"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['manage:mobileAttendanceData:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Delete"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['manage:mobileAttendanceData:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="Download"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['manage:mobileAttendanceData:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="mobileAttendanceDataList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="${comment}" align="center" prop="id" />
|
||||
<el-table-column label="用户ID" align="center" prop="userId" />
|
||||
<el-table-column label="项目ID" align="center" prop="projectId" />
|
||||
<el-table-column label="配置ID" align="center" prop="cfgId" />
|
||||
<el-table-column label="进还是出" align="center" prop="inOut" />
|
||||
<el-table-column label="经度" align="center" prop="longitude" />
|
||||
<el-table-column label="纬度" align="center" prop="latitude" />
|
||||
<el-table-column label="考勤时间" align="center" prop="attDate" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.attDate, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="考勤照片" align="center" prop="attImg" />
|
||||
<el-table-column label="${comment}" align="center" prop="isDel" />
|
||||
<el-table-column label="${comment}" align="center" prop="remark" />
|
||||
<el-table-column label="${comment}" align="center" prop="state" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['manage:mobileAttendanceData:edit']">修改</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['manage:mobileAttendanceData:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改人员考勤记录对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||
<el-form ref="mobileAttendanceDataRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="用户ID" prop="userId">
|
||||
<el-input v-model="form.userId" placeholder="请输入用户ID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="项目ID" prop="projectId">
|
||||
<el-input v-model="form.projectId" placeholder="请输入项目ID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="配置ID" prop="cfgId">
|
||||
<el-input v-model="form.cfgId" placeholder="请输入配置ID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="进还是出" prop="inOut">
|
||||
<el-input v-model="form.inOut" placeholder="请输入进还是出" />
|
||||
</el-form-item>
|
||||
<el-form-item label="经度" prop="longitude">
|
||||
<el-input v-model="form.longitude" placeholder="请输入经度" />
|
||||
</el-form-item>
|
||||
<el-form-item label="纬度" prop="latitude">
|
||||
<el-input v-model="form.latitude" placeholder="请输入纬度" />
|
||||
</el-form-item>
|
||||
<el-form-item label="考勤时间" prop="attDate">
|
||||
<el-date-picker clearable
|
||||
v-model="form.attDate"
|
||||
type="date"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="请选择考勤时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="考勤照片" prop="attImg">
|
||||
<el-input v-model="form.attImg" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
<el-form-item label="${comment}" prop="isDel">
|
||||
<el-input v-model="form.isDel" placeholder="请输入${comment}" />
|
||||
</el-form-item>
|
||||
<el-form-item label="${comment}" prop="remark">
|
||||
<el-input v-model="form.remark" placeholder="请输入${comment}" />
|
||||
</el-form-item>
|
||||
<el-form-item label="${comment}" prop="state">
|
||||
<el-input v-model="form.state" placeholder="请输入${comment}" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="MobileAttendanceData">
|
||||
import { listMobileAttendanceData, getMobileAttendanceData, delMobileAttendanceData, addMobileAttendanceData, updateMobileAttendanceData } from "@/api/manage/mobileAttendanceData";
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
const mobileAttendanceDataList = ref([]);
|
||||
const open = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const title = ref("");
|
||||
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
userId: null,
|
||||
projectId: null,
|
||||
cfgId: null,
|
||||
inOut: null,
|
||||
longitude: null,
|
||||
latitude: null,
|
||||
attDate: null,
|
||||
attImg: null,
|
||||
isDel: null,
|
||||
state: null,
|
||||
},
|
||||
rules: {
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询人员考勤记录列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
listMobileAttendanceData(queryParams.value).then(response => {
|
||||
mobileAttendanceDataList.value = response.rows;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
// 取消按钮
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
}
|
||||
|
||||
// 表单重置
|
||||
function reset() {
|
||||
form.value = {
|
||||
id: null,
|
||||
userId: null,
|
||||
projectId: null,
|
||||
cfgId: null,
|
||||
inOut: null,
|
||||
longitude: null,
|
||||
latitude: null,
|
||||
attDate: null,
|
||||
attImg: null,
|
||||
isDel: null,
|
||||
remark: null,
|
||||
state: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null
|
||||
};
|
||||
proxy.resetForm("mobileAttendanceDataRef");
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm("queryRef");
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
// 多选框选中数据
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map(item => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset();
|
||||
open.value = true;
|
||||
title.value = "添加人员考勤记录";
|
||||
}
|
||||
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
reset();
|
||||
const _id = row.id || ids.value
|
||||
getMobileAttendanceData(_id).then(response => {
|
||||
form.value = response.data;
|
||||
open.value = true;
|
||||
title.value = "修改人员考勤记录";
|
||||
});
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs["mobileAttendanceDataRef"].validate(valid => {
|
||||
if (valid) {
|
||||
if (form.value.id != null) {
|
||||
updateMobileAttendanceData(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
} else {
|
||||
addMobileAttendanceData(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("新增成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const _ids = row.id || ids.value;
|
||||
proxy.$modal.confirm('是否确认删除人员考勤记录编号为"' + _ids + '"的数据项?').then(function() {
|
||||
return delMobileAttendanceData(_ids);
|
||||
}).then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download('manage/mobileAttendanceData/export', {
|
||||
...queryParams.value
|
||||
}, `mobileAttendanceData_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
|
||||
getList();
|
||||
</script>
|
|
@ -1,7 +1,6 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
|
||||
|
||||
<el-form-item label="用户名" prop="userName">
|
||||
<el-input v-model="queryParams.userName" placeholder="请输入用户名" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
|
@ -9,10 +8,14 @@
|
|||
<el-input v-model="queryParams.userPhone" placeholder="请输入用户手机" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="类型" prop="useStatus">
|
||||
<el-select v-model="queryParams.useStatus" placeholder="请选择类型" clearable>
|
||||
<el-option label="进场" :value="0" />
|
||||
<el-option label="离场" :value="1" />
|
||||
</el-select>
|
||||
<el-select v-model="queryParams.useStatus" placeholder="请选择类型" clearable>
|
||||
<el-option label="进场" :value="0" />
|
||||
<el-option label="离场" :value="1" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="日期" style="width: 308px">
|
||||
<el-date-picker v-model="dateRange" value-format="YYYY-MM-DD" type="daterange" range-separator="-"
|
||||
start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
|
@ -39,33 +42,50 @@
|
|||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row> -->
|
||||
|
||||
<el-table v-loading="loading" :data="userInOutRecordList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="${comment}" align="center" prop="id" />
|
||||
<el-table-column label="${comment}" align="center" prop="projectId" />
|
||||
<el-table-column label="用户ID" align="center" prop="userId" />
|
||||
<el-table v-loading="loading" :data="userInOutRecordList">
|
||||
<el-table-column label="用户名" align="center" prop="userName" />
|
||||
<el-table-column label="用户手机" align="center" prop="userPhone" />
|
||||
<el-table-column label="用户图像" align="center" prop="userPicture" />
|
||||
<el-table-column label="用户性别" align="center" prop="userSex" />
|
||||
<el-table-column label="进场状态" align="center" prop="useStatus" />
|
||||
<el-table-column label="分包单位ID" align="center" prop="subDeptId" />
|
||||
<el-table-column label="分包单位" align="center" prop="subDeptName" />
|
||||
<el-table-column label="分包类型" align="center" prop="subDeptType" />
|
||||
<el-table-column label="班组编号" align="center" prop="subDeptGroup" />
|
||||
<el-table-column label="班组名称" align="center" prop="subDeptGroupName" />
|
||||
<el-table-column label="工种类型" align="center" prop="craftType" />
|
||||
<el-table-column label="工种岗位" align="center" prop="craftPost" />
|
||||
<el-table-column label="${comment}" align="center" prop="isDel" />
|
||||
<el-table-column label="${comment}" align="center" prop="remark" />
|
||||
<el-table-column label="${comment}" align="center" prop="state" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<el-table-column label="性别" align="center" prop="userSex">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['manage:userInOutRecord:edit']">修改</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['manage:userInOutRecord:remove']">删除</el-button>
|
||||
<span v-if="!isNaN(scope.row.userSex)"><dict-tag :options="sys_user_sex" :value="scope.row.userSex" /></span>
|
||||
<span v-if="isNaN(scope.row.userSex)">{{
|
||||
scope.row.userSex == "女" ? "女" : "男"
|
||||
}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="所属单位" align="center" prop="subDeptName" />
|
||||
<el-table-column label="班组" align="center" prop="subDeptGroupName" />
|
||||
<el-table-column label="状态" align="center" prop="useStatus">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.useStatus == 0" style="color: green;">在场</span>
|
||||
<span v-else style="color: red">离场</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="工种类型" align="center" prop="craftType">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="pro_craft_type" :value="scope.row.craftType" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="工种岗位" align="center" prop="craftPost">
|
||||
<template #default="scope">
|
||||
<div>
|
||||
<el-button v-if="scope.row.userPost == '3'" link type="warning" disabled>班组长</el-button>
|
||||
</div>
|
||||
<dict-tag :options="pro_craft_post" :value="scope.row.craftPost" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作时间" align="center">
|
||||
<template #default="scope">
|
||||
<div>
|
||||
{{ scope.row.createTime }}
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="头像" align="center">
|
||||
<template #default="scope">
|
||||
<el-image :src="scope.row.userPicture" style="height: 60px" :preview-teleported="true"
|
||||
:preview-src-list="[scope.row.userPicture]"></el-image>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
@ -136,7 +156,26 @@ import {
|
|||
} from "@/api/manage/userInOutRecord";
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
const {
|
||||
sys_use_status,
|
||||
pro_craft_type,
|
||||
sys_is_del,
|
||||
pro_craft_post,
|
||||
certificate_type,
|
||||
educational_type,
|
||||
sys_user_sex,
|
||||
user_work_type,
|
||||
} = proxy.useDict(
|
||||
"sys_use_status",
|
||||
"pro_craft_type",
|
||||
"sys_is_del",
|
||||
"pro_craft_post",
|
||||
"certificate_type",
|
||||
"educational_type",
|
||||
"sys_user_sex",
|
||||
"user_work_type"
|
||||
);
|
||||
const dateRange = ref([]);
|
||||
const userInOutRecordList = ref([]);
|
||||
const open = ref(false);
|
||||
const loading = ref(true);
|
||||
|
@ -177,7 +216,15 @@ const { queryParams, form, rules } = toRefs(data);
|
|||
/** 查询员工出入场记录列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
listUserInOutRecord(queryParams.value).then((response) => {
|
||||
console.log(dateRange)
|
||||
let postData={
|
||||
...queryParams.value
|
||||
};
|
||||
if(dateRange.value.length>0){
|
||||
postData.startDate=dateRange.value[0];
|
||||
postData.endDate=dateRange.value[1];
|
||||
}
|
||||
listUserInOutRecord(postData).then((response) => {
|
||||
userInOutRecordList.value = response.rows;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
|
|
Loading…
Reference in New Issue