上传文件前代码保存
This commit is contained in:
@@ -141,6 +141,17 @@ public class SysOaAttendanceController extends BaseController {
|
|||||||
return toAjax(iSysOaAttendanceService.deleteWithValidByIds(Arrays.asList(ids), true));
|
return toAjax(iSysOaAttendanceService.deleteWithValidByIds(Arrays.asList(ids), true));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除人员考勤
|
||||||
|
*
|
||||||
|
* @param ids 主键串
|
||||||
|
*/
|
||||||
|
@Log(title = "人员考勤", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/all/{day}")
|
||||||
|
public R<Void> delOaAttendanceAll(@PathVariable Long day) {
|
||||||
|
return toAjax(iSysOaAttendanceService.delOaAttendanceAll(day));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增人员考勤
|
* 新增人员考勤
|
||||||
|
|||||||
@@ -17,4 +17,6 @@ import java.util.List;
|
|||||||
public interface SysOaAttendanceMapper extends BaseMapperPlus<SysOaAttendanceMapper, SysOaAttendance, SysOaAttendanceVo> {
|
public interface SysOaAttendanceMapper extends BaseMapperPlus<SysOaAttendanceMapper, SysOaAttendance, SysOaAttendanceVo> {
|
||||||
|
|
||||||
List<SysOaAttendanceVo> selectVoListAndTime(@Param("userId") Long userId, @Param("firstDay") Date firstDay, @Param("lastDay") Date lastDay);
|
List<SysOaAttendanceVo> selectVoListAndTime(@Param("userId") Long userId, @Param("firstDay") Date firstDay, @Param("lastDay") Date lastDay);
|
||||||
|
|
||||||
|
int delOaAttendanceAll(@Param("firstDay") Date firstDay, @Param("lastDay")Date lastDay,@Param("day")Long day);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,4 +70,10 @@ public interface ISysOaAttendanceService {
|
|||||||
*/
|
*/
|
||||||
List<LaborCostData> workerCalc(Date time);
|
List<LaborCostData> workerCalc(Date time);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除当月某日所有人的签到记录
|
||||||
|
* @param day 日期
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int delOaAttendanceAll(Long day);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -197,21 +197,11 @@ public class SysOaAttendanceServiceImpl implements ISysOaAttendanceService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<LaborCostData> workerCalc(Date time) {
|
public List<LaborCostData> workerCalc(Date time) {
|
||||||
|
|
||||||
String firstDay = DateUtils.parseDateToStr("yyyy-MM-01", time);
|
|
||||||
|
|
||||||
String format = "yyyy-MM-";
|
|
||||||
// 计算某月的天数
|
|
||||||
Calendar calendar = Calendar.getInstance();
|
|
||||||
calendar.setTime(time);
|
|
||||||
String dateLength = String.valueOf(calendar.getActualMaximum(Calendar.DAY_OF_MONTH));
|
|
||||||
// 将字符串拼接
|
|
||||||
format +=dateLength;
|
|
||||||
String lastDay = DateUtils.parseDateToStr(format, time);
|
|
||||||
// 查询所有的工人
|
// 查询所有的工人
|
||||||
List<Long> userIds = sysUserRoleMapper.selectUserIdsByRoleId(1852970465740505090L);
|
List<Long> userIds = sysUserRoleMapper.selectUserIdsByRoleId(1852970465740505090L);
|
||||||
|
|
||||||
|
Date firstDay = getFirstDay(time);
|
||||||
|
Date lastDay = getLastDay(time);
|
||||||
List<LaborCostData> costDataList = new ArrayList<>();
|
List<LaborCostData> costDataList = new ArrayList<>();
|
||||||
for (Long userId : userIds) {
|
for (Long userId : userIds) {
|
||||||
SysUserVo sysUser = BeanUtil.toBean(sysUserService.selectUserById(userId), SysUserVo.class);
|
SysUserVo sysUser = BeanUtil.toBean(sysUserService.selectUserById(userId), SysUserVo.class);
|
||||||
@@ -219,12 +209,10 @@ public class SysOaAttendanceServiceImpl implements ISysOaAttendanceService {
|
|||||||
sysOaAttendanceVo.setUserId(sysUser.getUserId());
|
sysOaAttendanceVo.setUserId(sysUser.getUserId());
|
||||||
|
|
||||||
// 查询某月记录
|
// 查询某月记录
|
||||||
List<SysOaAttendanceVo> sysOaAttendanceVos = baseMapper.selectVoListAndTime(userId, DateUtils.parseDate(firstDay),DateUtils.parseDate(lastDay));
|
List<SysOaAttendanceVo> sysOaAttendanceVos = baseMapper.selectVoListAndTime(userId, firstDay,lastDay);
|
||||||
|
|
||||||
List<SysOaProjectVo> projectVos = new ArrayList<>();
|
List<SysOaProjectVo> projectVos = new ArrayList<>();
|
||||||
|
|
||||||
Double workTimes = 0.0;
|
Double workTimes = 0.0;
|
||||||
System.out.println(sysOaAttendanceVos);
|
|
||||||
for (SysOaAttendanceVo oaAttendanceVo : sysOaAttendanceVos) {
|
for (SysOaAttendanceVo oaAttendanceVo : sysOaAttendanceVos) {
|
||||||
SysOaProjectVo sysOaProjectVo = projectService.queryById(oaAttendanceVo.getProjectId());
|
SysOaProjectVo sysOaProjectVo = projectService.queryById(oaAttendanceVo.getProjectId());
|
||||||
oaAttendanceVo.setColor(sysOaProjectVo.getColor());
|
oaAttendanceVo.setColor(sysOaProjectVo.getColor());
|
||||||
@@ -247,4 +235,33 @@ public class SysOaAttendanceServiceImpl implements ISysOaAttendanceService {
|
|||||||
|
|
||||||
return costDataList;
|
return costDataList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除当月某日所有人的记录
|
||||||
|
* @param day 日期
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int delOaAttendanceAll(Long day) {
|
||||||
|
|
||||||
|
Date now = new Date();
|
||||||
|
return baseMapper.delOaAttendanceAll(getFirstDay(now),getLastDay(now),day);
|
||||||
|
}
|
||||||
|
|
||||||
|
private Date getFirstDay(Date time){
|
||||||
|
String firstDay = DateUtils.parseDateToStr("yyyy-MM-01", time);
|
||||||
|
return DateUtils.parseDate(firstDay);
|
||||||
|
}
|
||||||
|
|
||||||
|
private Date getLastDay(Date time){
|
||||||
|
String format = "yyyy-MM-";
|
||||||
|
// 计算某月的天数
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.setTime(time);
|
||||||
|
String dateLength = String.valueOf(calendar.getActualMaximum(Calendar.DAY_OF_MONTH));
|
||||||
|
// 将字符串拼接
|
||||||
|
format +=dateLength;
|
||||||
|
|
||||||
|
return DateUtils.parseDate(DateUtils.parseDateToStr(format, time));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -271,10 +271,7 @@ public class SysOaOutWarehouseServiceImpl implements ISysOaOutWarehouseService {
|
|||||||
//其中一条
|
//其中一条
|
||||||
sysOaOutWarehouses.forEach(sysOaOutWarehouse -> {
|
sysOaOutWarehouses.forEach(sysOaOutWarehouse -> {
|
||||||
//选出相对应的 库存表中那一条的数据
|
//选出相对应的 库存表中那一条的数据
|
||||||
LambdaQueryWrapper<SysOaWarehouse> lqw2 = Wrappers.lambdaQuery();
|
SysOaWarehouse warehouse = warehouseMapper.selectVoByIdAndXml(sysOaOutWarehouse.getWarehouseId());
|
||||||
lqw2.eq(SysOaWarehouse::getId, sysOaOutWarehouse.getWarehouseId());
|
|
||||||
SysOaWarehouse warehouse = warehouseMapper.selectOne(lqw2);
|
|
||||||
|
|
||||||
// 恢复原本出库的数量
|
// 恢复原本出库的数量
|
||||||
warehouse.setInventory(warehouse.getInventory() + sysOaOutWarehouse.getAmount());
|
warehouse.setInventory(warehouse.getInventory() + sysOaOutWarehouse.getAmount());
|
||||||
warehouseMapper.updateById(warehouse);
|
warehouseMapper.updateById(warehouse);
|
||||||
|
|||||||
@@ -45,5 +45,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
group by soa.project_id
|
group by soa.project_id
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<delete id="delOaAttendanceAll">
|
||||||
|
delete from sys_oa_attendance where
|
||||||
|
attendance_day = #{day}
|
||||||
|
and #{lastDay} > create_time
|
||||||
|
and create_time > #{firstDay}
|
||||||
|
</delete>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -70,3 +70,14 @@ export function delOaAttendance(id) {
|
|||||||
method: 'delete'
|
method: 'delete'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 删除人员考勤
|
||||||
|
export function delOaAttendanceAll(id) {
|
||||||
|
return request({
|
||||||
|
url: '/oa/oaAttendance/all/' + id,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,15 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container" v-loading="loading">
|
<div class="app-container" v-loading="loading">
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="14">
|
<el-col :span="16">
|
||||||
签到表
|
|
||||||
|
<el-header> 签到表</el-header>
|
||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th width="80"></th>
|
<th width="80"></th>
|
||||||
<th v-for="(item,index) in dateLength" :class="selectHead===index+1?'selectBox':''" @click="selectMany(index+1)">
|
<th v-for="(item,index) in dateLength" :class="selectHead===index+1?'selectBox':''"
|
||||||
|
@click="selectMany(index+1)">
|
||||||
{{ index + 1 }}
|
{{ index + 1 }}
|
||||||
</th>
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -15,77 +17,81 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
<tr v-for="(item,index) in userList">
|
<tr v-for="(item,index) in userList">
|
||||||
<td :class="(item.userId===selectUser.userId || selectAll)?'selectBox':''">{{ item.nickName }}</td>
|
<td :class="(item.userId===selectUser.userId || selectAll)?'selectBox':''">{{ item.nickName }}</td>
|
||||||
<td v-for="(item2,index2) in dateLength" @click="selectAttendDay(item,index,index2+1)"
|
<td v-for="(item2,index2) in dateLength" @click="selectAttendDay(item,index,index2+1)"
|
||||||
:style="{backgroundColor:(item.attendances.length>0 && item.attendances.findIndex(i=>i.attendanceDay === index2+1) >-1) ?item.attendances[item.attendances.findIndex(i=>i.attendanceDay === index2+1)].color:(index2+1===selectIndex&&(item.userId===selectUser.userId || selectAll)?'#f3ff52':'')}"></td>
|
:style="{backgroundColor:(item.attendances.length>0 && item.attendances.findIndex(i=>i.attendanceDay === index2+1) >-1) ?item.attendances[item.attendances.findIndex(i=>i.attendanceDay === index2+1)].color:(index2+1===selectIndex&&(item.userId===selectUser.userId || selectAll)?'#f3ff52':'')}"></td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="5">
|
<el-col :span="8">
|
||||||
|
|
||||||
|
<div>
|
||||||
|
|
||||||
<el-card class="box-card">
|
<el-header> 操作栏</el-header>
|
||||||
<div slot="" class="">
|
<el-card class="box-card">
|
||||||
<span><i class="el-icon-s-order"></i> 项目列表</span>
|
<el-button @click="removeAttendance" type="danger" plain>取消操作</el-button>
|
||||||
<!-- <el-button style="float: right; padding: 3px 0" type="text">操作按钮</el-button>-->
|
</el-card>
|
||||||
|
<el-card class="box-card">
|
||||||
|
<div slot="" class="">
|
||||||
|
<span><i class="el-icon-s-order"></i> 项目列表</span>
|
||||||
|
<!-- <el-button style="float: right; padding: 3px 0" type="text">操作按钮</el-button>-->
|
||||||
|
</div>
|
||||||
|
<div v-for="(item,index) in projectList" style="display: flex;justify-content: space-between">
|
||||||
|
<el-button class="text" :style="{backgroundColor:item.color===''?'':item.color}" @click="signIn(item)">
|
||||||
|
{{ item.projectName }}
|
||||||
|
</el-button>
|
||||||
|
<el-color-picker class="color-picker" v-model="item.color" @change="changeItemColor(item)"></el-color-picker>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
<el-card class="box-card">
|
||||||
|
<div slot="" class="">
|
||||||
|
<span><i class="el-icon-timer"></i>工作时长</span>
|
||||||
|
<div style="margin: 20px 0 ">
|
||||||
|
<el-radio-group v-model="timeFlag">
|
||||||
|
<el-radio :label="0">天计</el-radio>
|
||||||
|
<el-radio :label="1">小时计</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</div>
|
||||||
|
<el-select v-if="timeFlag===0" v-model="form.dayLength" placeholder="请选择工作时长">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in dict.type.work_time_length"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
|
||||||
|
<el-select v-if="timeFlag===1" v-model="form.hour" placeholder="请选择工作时长">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in dict.type.work_time_length_hour"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
</div>
|
</div>
|
||||||
<div v-for="(item,index) in projectList" style="display: flex;justify-content: space-between">
|
|
||||||
<el-button class="text" :style="{backgroundColor:item.color===''?'':item.color}" @click="signIn(item)">{{ item.projectName }}
|
|
||||||
</el-button>
|
|
||||||
<el-color-picker class="text" v-model="item.color" @change="changeItemColor(item)"></el-color-picker>
|
|
||||||
</div>
|
|
||||||
</el-card>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="5">
|
|
||||||
|
|
||||||
|
|
||||||
<el-card class="box-card">
|
|
||||||
<div slot="" class="">
|
|
||||||
<span><i class="el-icon-timer"></i>工作时长</span>
|
|
||||||
<div style="margin: 20px 0 ">
|
|
||||||
<el-radio-group v-model="timeFlag">
|
|
||||||
<el-radio :label="0">天计</el-radio>
|
|
||||||
<el-radio :label="1">小时计</el-radio>
|
|
||||||
</el-radio-group>
|
|
||||||
</div>
|
|
||||||
<el-select v-if="timeFlag===0" v-model="form.dayLength" placeholder="请选择工作时长">
|
|
||||||
<el-option
|
|
||||||
v-for="dict in dict.type.work_time_length"
|
|
||||||
:key="dict.value"
|
|
||||||
:label="dict.label"
|
|
||||||
:value="dict.value"
|
|
||||||
></el-option>
|
|
||||||
</el-select>
|
|
||||||
|
|
||||||
<el-select v-if="timeFlag===1" v-model="form.hour" placeholder="请选择工作时长">
|
|
||||||
<el-option
|
|
||||||
v-for="dict in dict.type.work_time_length_hour"
|
|
||||||
:key="dict.value"
|
|
||||||
:label="dict.label"
|
|
||||||
:value="dict.value"
|
|
||||||
></el-option>
|
|
||||||
</el-select>
|
|
||||||
</div>
|
|
||||||
</el-card>
|
|
||||||
|
|
||||||
|
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-row :gutter="20" class="mb8">
|
<el-row :gutter="20" class="mb8">
|
||||||
<el-col :span="2">
|
<el-col :span="2">
|
||||||
|
|
||||||
|
|
||||||
<span class="demonstration">计算月份:</span>
|
<span class="demonstration">计算月份:</span>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<div class="block">
|
<div class="block">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="date"
|
v-model="date"
|
||||||
type="month"
|
type="month"
|
||||||
placeholder="选择日期">
|
placeholder="选择日期">
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
|
|
||||||
@@ -93,7 +99,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-row :gutter="20" >
|
<el-row :gutter="20">
|
||||||
|
|
||||||
<el-table
|
<el-table
|
||||||
:data="userList"
|
:data="userList"
|
||||||
@@ -101,7 +107,7 @@
|
|||||||
style="width: 60%">
|
style="width: 60%">
|
||||||
|
|
||||||
<el-table-column
|
<el-table-column
|
||||||
type="index"
|
type="index"
|
||||||
label="序号"
|
label="序号"
|
||||||
width="180">
|
width="180">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@@ -112,7 +118,7 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template slot-scope="scope" >
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
@@ -120,7 +126,8 @@
|
|||||||
v-if="calcFlag"
|
v-if="calcFlag"
|
||||||
@click="handleCalc(scope.row)"
|
@click="handleCalc(scope.row)"
|
||||||
v-hasPermi="['oa:oaWarehouse:edit']"
|
v-hasPermi="['oa:oaWarehouse:edit']"
|
||||||
>查看考勤结果</el-button>
|
>查看考勤结果
|
||||||
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
@@ -129,7 +136,8 @@
|
|||||||
icon="el-icon-edit"
|
icon="el-icon-edit"
|
||||||
@click="handleCalc(scope.row)"
|
@click="handleCalc(scope.row)"
|
||||||
v-hasPermi="['oa:oaWarehouse:edit']"
|
v-hasPermi="['oa:oaWarehouse:edit']"
|
||||||
>请选择日期计算</el-button>
|
>请选择日期计算
|
||||||
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@@ -140,46 +148,45 @@
|
|||||||
title="计算结果"
|
title="计算结果"
|
||||||
:visible.sync="showCalc"
|
:visible.sync="showCalc"
|
||||||
width="70%"
|
width="70%"
|
||||||
>
|
>
|
||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<h1>员工个人财务与签到报告 - {{calcUser.nickName}}</h1>
|
<h1>员工个人财务与签到报告 - {{ calcUser.nickName }}</h1>
|
||||||
|
|
||||||
<!-- 员工基本信息 -->
|
<!-- 员工基本信息 -->
|
||||||
<div class="employee-info">
|
<div class="employee-info">
|
||||||
<p><strong>员工姓名:</strong> {{calcUser.nickName}}</p>
|
<p><strong>员工姓名:</strong> {{ calcUser.nickName }}</p>
|
||||||
<p><strong>职位:</strong> 员工</p>
|
<p><strong>职位:</strong> 员工</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 月度工作情况表格 -->
|
<!-- 月度工作情况表格 -->
|
||||||
<h2>{{date.getMonth()}} 月度工作签到情况</h2>
|
<h2>{{ date.getMonth() }} 月度工作签到情况</h2>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<el-descriptions class="margin-top" title="报告详情" :column="3" :size="size" border>
|
<el-descriptions class="margin-top" title="报告详情" :column="3" :size="size" border>
|
||||||
<template slot="extra">
|
<template slot="extra">
|
||||||
<div>总工作时长(天):{{calcResultItem.workTimes}}</div>
|
<div>总工作时长(天):{{ calcResultItem.workTimes }}</div>
|
||||||
</template>
|
</template>
|
||||||
<el-descriptions-item>
|
<el-descriptions-item>
|
||||||
<template slot="label">
|
<template slot="label">
|
||||||
<i class="el-icon-user"></i>
|
<i class="el-icon-user"></i>
|
||||||
员工姓名
|
员工姓名
|
||||||
</template>
|
</template>
|
||||||
{{calcUser.nickName}}
|
{{ calcUser.nickName }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item>
|
<el-descriptions-item>
|
||||||
<template slot="label">
|
<template slot="label">
|
||||||
<i class="el-icon-mobile-phone"></i>
|
<i class="el-icon-mobile-phone"></i>
|
||||||
人力成本
|
人力成本
|
||||||
</template>
|
</template>
|
||||||
{{calcUser.laborCost}}
|
{{ calcUser.laborCost }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item>
|
<el-descriptions-item>
|
||||||
<template slot="label">
|
<template slot="label">
|
||||||
|
|
||||||
当月估计(¥)
|
当月估计(¥)
|
||||||
</template>
|
</template>
|
||||||
{{calcUser.laborCost*calcResultItem.workTimes}}
|
{{ calcUser.laborCost * calcResultItem.workTimes }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
</el-descriptions>
|
</el-descriptions>
|
||||||
|
|
||||||
@@ -205,8 +212,6 @@
|
|||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="footer">
|
<div class="footer">
|
||||||
<p>© 2024 财务与签到报告 | 由公司财务部门生成</p>
|
<p>© 2024 财务与签到报告 | 由公司财务部门生成</p>
|
||||||
</div>
|
</div>
|
||||||
@@ -226,12 +231,19 @@
|
|||||||
import {listWorker} from "@/api/system/user";
|
import {listWorker} from "@/api/system/user";
|
||||||
import {listProject, updateProject} from "@/api/oa/project";
|
import {listProject, updateProject} from "@/api/oa/project";
|
||||||
import {listOaAttendance} from "@/api/oa/oaAttendance";
|
import {listOaAttendance} from "@/api/oa/oaAttendance";
|
||||||
import {addBatchOaAttendance, addOaAttendance, getDateLength, workCalc} from "../../../api/oa/oaAttendance";
|
import {
|
||||||
|
addBatchOaAttendance,
|
||||||
|
addOaAttendance,
|
||||||
|
delOaAttendance,
|
||||||
|
getDateLength,
|
||||||
|
workCalc,
|
||||||
|
delOaAttendanceAll
|
||||||
|
} from "../../../api/oa/oaAttendance";
|
||||||
import item from "../../../layout/components/Sidebar/Item.vue";
|
import item from "../../../layout/components/Sidebar/Item.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Project",
|
name: "Project",
|
||||||
dicts: ['work_time_length','work_time_length_hour'],
|
dicts: ['work_time_length', 'work_time_length_hour'],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
// 选择索引
|
// 选择索引
|
||||||
@@ -239,18 +251,18 @@ export default {
|
|||||||
// 用户列表
|
// 用户列表
|
||||||
userList: [],
|
userList: [],
|
||||||
// 计算结果
|
// 计算结果
|
||||||
calcFlag:false,
|
calcFlag: false,
|
||||||
// 项目列表
|
// 项目列表
|
||||||
projectList: [],
|
projectList: [],
|
||||||
loading: true,
|
loading: true,
|
||||||
selectHead: new Date().getDate(),
|
selectHead: new Date().getDate(),
|
||||||
// 当前月的天数
|
// 当前月的天数
|
||||||
dateLength:31,
|
dateLength: 31,
|
||||||
// 计算提交月份
|
// 计算提交月份
|
||||||
date:new Date(),
|
date: new Date(),
|
||||||
// 提交表单
|
// 提交表单
|
||||||
form: {},
|
form: {},
|
||||||
showCalc:false,
|
showCalc: false,
|
||||||
// 查询参数
|
// 查询参数
|
||||||
userQueryParams: {
|
userQueryParams: {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
@@ -260,19 +272,18 @@ export default {
|
|||||||
status: undefined,
|
status: undefined,
|
||||||
deptId: undefined
|
deptId: undefined
|
||||||
},
|
},
|
||||||
calcUser:{
|
calcUser: {},
|
||||||
},
|
queryParams: {
|
||||||
queryParams:{
|
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 50,
|
pageSize: 50,
|
||||||
},
|
},
|
||||||
selectArrayIndex:new Date().getDate(),
|
selectArrayIndex: new Date().getDate(),
|
||||||
timeFlag: 0,
|
timeFlag: 0,
|
||||||
// 项目查询参数
|
// 项目查询参数
|
||||||
projectQueryParams: {
|
projectQueryParams: {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
projectStatus:0,
|
projectStatus: 0,
|
||||||
projectName: undefined,
|
projectName: undefined,
|
||||||
projectNum: undefined,
|
projectNum: undefined,
|
||||||
beginTime: undefined,
|
beginTime: undefined,
|
||||||
@@ -282,11 +293,11 @@ export default {
|
|||||||
// 日期范围
|
// 日期范围
|
||||||
dateRange: [],
|
dateRange: [],
|
||||||
selectAll: true,
|
selectAll: true,
|
||||||
calcResult:[],
|
calcResult: [],
|
||||||
calcResultItem:{},
|
calcResultItem: {},
|
||||||
calcResultUser:{},
|
calcResultUser: {},
|
||||||
calcResultAttendances:[],
|
calcResultAttendances: [],
|
||||||
calcResultProject:{},
|
calcResultProject: {},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
@@ -299,32 +310,46 @@ export default {
|
|||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
|
// 删除签到
|
||||||
|
removeAttendance(){
|
||||||
|
if (!this.selectAll){
|
||||||
|
const attendanceId = this.selectUser.attendances.find(item=>item.attendanceDay===this.selectIndex).id
|
||||||
|
delOaAttendance(attendanceId).then(res=>{
|
||||||
|
this.$modal.msgSuccess("操作成功");
|
||||||
|
this.getList();
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
delOaAttendanceAll(this.selectIndex).then(res=>{
|
||||||
|
this.$modal.msgSuccess("操作成功");
|
||||||
|
this.getList();
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
// 查看计算结果
|
// 查看计算结果
|
||||||
handleCalc(row){
|
handleCalc(row) {
|
||||||
this.showCalc = true;
|
this.showCalc = true;
|
||||||
this.calcUser = row
|
this.calcUser = row
|
||||||
|
this.calcResultItem = this.calcResult.filter(item => item.sysUser.userId === this.calcUser.userId)[0]
|
||||||
this.calcResultItem = this.calcResult.filter(item=>item.sysUser.userId===this.calcUser.userId)[0]
|
|
||||||
this.calcResultAttendances = this.calcResultItem.attendances
|
this.calcResultAttendances = this.calcResultItem.attendances
|
||||||
console.log(this.calcResultItem)
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// 计算
|
// 计算
|
||||||
calcWork(){
|
calcWork() {
|
||||||
|
workCalc(this.date).then(res => {
|
||||||
workCalc(this.date).then(res=>{
|
|
||||||
this.calcResult = res.data;
|
this.calcResult = res.data;
|
||||||
this.calcFlag = true;
|
this.calcFlag = true;
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
getDate(){
|
getDate() {
|
||||||
getDateLength().then(res => {
|
getDateLength().then(res => {
|
||||||
this.dateLength = res.data;
|
this.dateLength = res.data;
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
selectAttendDay(item,index, index2) {
|
selectAttendDay(item, index, index2) {
|
||||||
this.selectIndex = index2;
|
this.selectIndex = index2;
|
||||||
this.selectAll = false;
|
this.selectAll = false;
|
||||||
this.selectUser = item;
|
this.selectUser = item;
|
||||||
@@ -340,7 +365,7 @@ export default {
|
|||||||
/** 查询用户列表 */
|
/** 查询用户列表 */
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
listOaAttendance(this.queryParams).then(res=>{
|
listOaAttendance(this.queryParams).then(res => {
|
||||||
this.userList = res.data;
|
this.userList = res.data;
|
||||||
this.total = res.total;
|
this.total = res.total;
|
||||||
});
|
});
|
||||||
@@ -352,46 +377,46 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
changeItemColor(item) {
|
changeItemColor(item) {
|
||||||
updateProject(item);
|
updateProject(item).then(res=>{
|
||||||
this.getList();
|
this.getList();
|
||||||
|
})
|
||||||
|
|
||||||
},
|
},
|
||||||
signIn(project){
|
signIn(project) {
|
||||||
// 一个签到
|
// 一个签到
|
||||||
if (this.form.dayLength === undefined && this.timeFlag === 0) {
|
if (this.form.dayLength === undefined && this.timeFlag === 0) {
|
||||||
this.$message({ message: '请选择工作时长', type: 'warning' })
|
this.$message({message: '请选择工作时长', type: 'warning'})
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (this.form.hour === undefined && this.timeFlag === 1) {
|
if (this.form.hour === undefined && this.timeFlag === 1) {
|
||||||
this.$message({ message: '请选择工作时长', type: 'warning' })
|
this.$message({message: '请选择工作时长', type: 'warning'})
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let time = this.timeFlag===0?this.form.dayLength:this.form.hour
|
let time = this.timeFlag === 0 ? this.form.dayLength : this.form.hour
|
||||||
|
|
||||||
|
|
||||||
if (!this.selectAll){
|
if (!this.selectAll) {
|
||||||
this.form = {
|
this.form = {
|
||||||
projectId:project.projectId,
|
projectId: project.projectId,
|
||||||
userId:this.selectUser.userId,
|
userId: this.selectUser.userId,
|
||||||
attendanceDay:this.selectIndex,
|
attendanceDay: this.selectIndex,
|
||||||
dayLength: this.timeFlag===0?this.form.dayLength:undefined,
|
dayLength: this.timeFlag === 0 ? this.form.dayLength : undefined,
|
||||||
hour:this.timeFlag===1?this.form.hour:undefined
|
hour: this.timeFlag === 1 ? this.form.hour : undefined
|
||||||
}
|
}
|
||||||
addOaAttendance(this.form).then(res=>{
|
addOaAttendance(this.form).then(res => {
|
||||||
this.selectUser = this.selectArrayIndex>=this.userList.length-1?this.selectUser:this.userList[this.selectArrayIndex+1]
|
this.selectUser = this.selectArrayIndex >= this.userList.length - 1 ? this.selectUser : this.userList[this.selectArrayIndex + 1]
|
||||||
|
|
||||||
this.getList()
|
this.getList()
|
||||||
|
|
||||||
})
|
})
|
||||||
}else{
|
} else {
|
||||||
|
|
||||||
this.form = {
|
this.form = {
|
||||||
projectId:project.projectId,
|
projectId: project.projectId,
|
||||||
attendanceDay:this.selectIndex,
|
attendanceDay: this.selectIndex,
|
||||||
dayLength: this.timeFlag===0?this.form.dayLength:undefined,
|
dayLength: this.timeFlag === 0 ? this.form.dayLength : undefined,
|
||||||
hour:this.timeFlag===1?this.form.hour:undefined
|
hour: this.timeFlag === 1 ? this.form.hour : undefined
|
||||||
}
|
}
|
||||||
// 集体赋予状态
|
// 集体赋予状态
|
||||||
addBatchOaAttendance(this.form).then(res=>{
|
addBatchOaAttendance(this.form).then(res => {
|
||||||
this.getList()
|
this.getList()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -434,7 +459,26 @@ table {
|
|||||||
|
|
||||||
.text {
|
.text {
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
|
width: 70%;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
border-bottom: #cccccc 1px dashed;
|
border-bottom: #cccccc 1px dashed;
|
||||||
margin: 5px 0;
|
margin: 5px 0;
|
||||||
}
|
}
|
||||||
|
.color-picker{
|
||||||
|
font-size: 16px;
|
||||||
|
width: 30%;
|
||||||
|
|
||||||
|
|
||||||
|
border-bottom: #cccccc 1px dashed;
|
||||||
|
margin: 5px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-header, .el-footer {
|
||||||
|
background-color: #f6f6f6;
|
||||||
|
color: #333;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 60px;
|
||||||
|
border-radius: 7px 7px 0 0;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -547,8 +547,7 @@ export default {
|
|||||||
this.loading = true;
|
this.loading = true;
|
||||||
return delOaOutWarehouse(ids);
|
return delOaOutWarehouse(ids);
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
|
this.getList();
|
||||||
this.handleSearch(this.searchItem);
|
|
||||||
this.$modal.msgSuccess("删除成功");
|
this.$modal.msgSuccess("删除成功");
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user