新增时间组件
清楚所有页面的console.log输出
This commit is contained in:
parent
9aa780b617
commit
73377aabc5
@ -52,4 +52,12 @@ export function listAttendanceByParams(query) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 查询考勤记录详细
|
||||||
|
export function getAttendanceDetail(id) {
|
||||||
|
return request({
|
||||||
|
url: '/attendance/attendance/detail/list/' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
15
src/plugins/DateUtils.js
Normal file
15
src/plugins/DateUtils.js
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
export default{
|
||||||
|
getCurrentMonthStartDates(currentDate) {
|
||||||
|
const firstDay = new Date(currentDate);
|
||||||
|
firstDay.setDate(1);
|
||||||
|
// 格式化日期为YYYY-MM-DD格式
|
||||||
|
return firstDay.toISOString().slice(0, 10);
|
||||||
|
},
|
||||||
|
|
||||||
|
getCurrentMonthEndDates(currentDate) {
|
||||||
|
const lastDay = new Date(currentDate);
|
||||||
|
lastDay.setMonth(lastDay.getMonth() + 1, 0); // 设置日期为下个月的第一天的前一天,即当前月的最后一天
|
||||||
|
// 格式化日期为YYYY-MM-DD格式
|
||||||
|
return lastDay.toISOString().slice(0, 10);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -14,7 +14,8 @@
|
|||||||
start-placeholder="开始日期"
|
start-placeholder="开始日期"
|
||||||
end-placeholder="结束日期"
|
end-placeholder="结束日期"
|
||||||
value-format="yyyy-MM-dd"
|
value-format="yyyy-MM-dd"
|
||||||
clearable>
|
:clearable="false"
|
||||||
|
>
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="上班状态:" prop="workSum">
|
<el-form-item label="上班状态:" prop="workSum">
|
||||||
@ -88,6 +89,12 @@
|
|||||||
@click="handleUpdate(scope.row)"
|
@click="handleUpdate(scope.row)"
|
||||||
v-hasPermi="['attendance:attendance:edit']"
|
v-hasPermi="['attendance:attendance:edit']"
|
||||||
>修改</el-button>
|
>修改</el-button>
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-view"
|
||||||
|
@click="viewInfo(scope.row)"
|
||||||
|
>打卡详情</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@ -177,14 +184,35 @@
|
|||||||
<el-button @click="openDate = false">取 消</el-button>
|
<el-button @click="openDate = false">取 消</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
<el-drawer
|
||||||
|
:title="info.title"
|
||||||
|
:visible.sync="info.infoOpen"
|
||||||
|
direction="rtl">
|
||||||
|
<div class="block">
|
||||||
|
<el-timeline >
|
||||||
|
<el-timeline-item
|
||||||
|
v-for="(activity, index) in info.activities"
|
||||||
|
:key="index"
|
||||||
|
:icon="activity.icon"
|
||||||
|
:type="activity.type"
|
||||||
|
:color="activity.color"
|
||||||
|
:size="activity.size"
|
||||||
|
:timestamp="activity.timestamp">
|
||||||
|
{{activity.content}}
|
||||||
|
</el-timeline-item>
|
||||||
|
</el-timeline>
|
||||||
|
</div>
|
||||||
|
</el-drawer>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listAttendance, getAttendance, updateAttendance,updateBatchAttendance } from "@/api/attendance/attendance";
|
import { listAttendance, getAttendance, updateAttendance,updateBatchAttendance, getAttendanceDetail } from "@/api/attendance/attendance";
|
||||||
import { buttonOptionList } from "@/api/equipment/button";
|
import { buttonOptionList } from "@/api/equipment/button";
|
||||||
import { getToken } from '@/utils/auth'
|
import { getToken } from '@/utils/auth'
|
||||||
import { parseTime } from '../../../utils/ruoyi'
|
import { parseTime } from '../../../utils/ruoyi'
|
||||||
|
import DateUtils from "../../../plugins/DateUtils";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Attendance",
|
name: "Attendance",
|
||||||
@ -205,6 +233,7 @@ export default {
|
|||||||
// 弹出层标题
|
// 弹出层标题
|
||||||
title: "",
|
title: "",
|
||||||
// 是否显示弹出层
|
// 是否显示弹出层
|
||||||
|
findDate: false,
|
||||||
open: false,
|
open: false,
|
||||||
openDate: false,
|
openDate: false,
|
||||||
// 查询参数
|
// 查询参数
|
||||||
@ -224,6 +253,32 @@ export default {
|
|||||||
timeRange: [],
|
timeRange: [],
|
||||||
// 表单参数
|
// 表单参数
|
||||||
form: {},
|
form: {},
|
||||||
|
|
||||||
|
info:{
|
||||||
|
infoOpen: false,
|
||||||
|
title: "",
|
||||||
|
activities: [{
|
||||||
|
content: '支持使用图标',
|
||||||
|
timestamp: '2018-04-12 20:46',
|
||||||
|
size: 'large',
|
||||||
|
type: 'primary',
|
||||||
|
icon: 'el-icon-caret-top'
|
||||||
|
}, {
|
||||||
|
content: '支持自定义颜色',
|
||||||
|
timestamp: '2018-04-03 20:46',
|
||||||
|
color: '#0bbd87'
|
||||||
|
}, {
|
||||||
|
content: '支持自定义尺寸',
|
||||||
|
timestamp: '2018-04-03 20:46',
|
||||||
|
size: 'large',
|
||||||
|
type:'danger',
|
||||||
|
icon: 'el-icon-caret-bottom'
|
||||||
|
}, {
|
||||||
|
content: '默认样式的节点',
|
||||||
|
timestamp: '2018-04-03 20:46'
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
|
||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {
|
rules: {
|
||||||
rules: [
|
rules: [
|
||||||
@ -252,17 +307,27 @@ export default {
|
|||||||
this.queryParams.startTime = '';
|
this.queryParams.startTime = '';
|
||||||
this.queryParams.endTime ='';
|
this.queryParams.endTime ='';
|
||||||
}
|
}
|
||||||
|
this.findDate = true;
|
||||||
|
},
|
||||||
|
findDate(val){
|
||||||
|
if(val){
|
||||||
|
this.getList();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
var param = this.$route.query
|
var param = this.$route.query
|
||||||
this.queryParams.staffId = param.staffId;
|
this.queryParams.staffId = param.staffId;
|
||||||
this.getList();
|
this.buildTimeRange();
|
||||||
this.getRuleList();
|
this.getRuleList();
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
buildTimeRange(){
|
||||||
/**获取补贴 */
|
const date = new Date();
|
||||||
|
this.timeRange = [DateUtils.getCurrentMonthStartDates(date),DateUtils.getCurrentMonthEndDates(date)];
|
||||||
|
},
|
||||||
|
/**获取规则 */
|
||||||
getRuleList(){
|
getRuleList(){
|
||||||
buttonOptionList({rules:"上班"}).then(response => {
|
buttonOptionList({rules:"上班"}).then(response => {
|
||||||
this.ruleList = response.data;
|
this.ruleList = response.data;
|
||||||
@ -297,7 +362,6 @@ export default {
|
|||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
listAttendance(this.queryParams).then(response => {
|
listAttendance(this.queryParams).then(response => {
|
||||||
console.log(response.rows)
|
|
||||||
this.attendanceList = response.rows;
|
this.attendanceList = response.rows;
|
||||||
this.total = response.total;
|
this.total = response.total;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
@ -331,6 +395,15 @@ export default {
|
|||||||
resetQuery() {
|
resetQuery() {
|
||||||
this.resetForm("queryForm");
|
this.resetForm("queryForm");
|
||||||
this.handleQuery();
|
this.handleQuery();
|
||||||
|
},
|
||||||
|
viewInfo(row){
|
||||||
|
this.info.title=row.name+" ["+row.attendanceDate+"] 打卡记录";
|
||||||
|
getAttendanceDetail(row.id).then(response => {
|
||||||
|
this.info.activities = response.data;
|
||||||
|
this.info.infoOpen=true;
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
handleUpdate(row) {
|
handleUpdate(row) {
|
||||||
|
|||||||
@ -424,7 +424,6 @@ export default {
|
|||||||
this.getList();
|
this.getList();
|
||||||
this.getDeptList();
|
this.getDeptList();
|
||||||
var parms = this.$route.query
|
var parms = this.$route.query
|
||||||
console.log(1)
|
|
||||||
if(parms){
|
if(parms){
|
||||||
this.queryParams.month = parms.month
|
this.queryParams.month = parms.month
|
||||||
}
|
}
|
||||||
@ -566,7 +565,6 @@ export default {
|
|||||||
},
|
},
|
||||||
submitFormExport(){
|
submitFormExport(){
|
||||||
let param = this.form;
|
let param = this.form;
|
||||||
console.log(1)
|
|
||||||
if(this.queryParams.month == '' || this.queryParams.month == null){
|
if(this.queryParams.month == '' || this.queryParams.month == null){
|
||||||
this.$message({
|
this.$message({
|
||||||
message: '请选择月份',
|
message: '请选择月份',
|
||||||
|
|||||||
@ -111,7 +111,6 @@ export default {
|
|||||||
this.loading = true;
|
this.loading = true;
|
||||||
getPage(year).then(response => {
|
getPage(year).then(response => {
|
||||||
this.holiday = response.data;
|
this.holiday = response.data;
|
||||||
console.log(this.holiday);
|
|
||||||
|
|
||||||
this.beforYear = this.holiday.year-1;
|
this.beforYear = this.holiday.year-1;
|
||||||
this.afterYear = this.holiday.year+1;
|
this.afterYear = this.holiday.year+1;
|
||||||
|
|||||||
@ -522,7 +522,6 @@ export default {
|
|||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
listInterviewer(this.queryParams).then(response => {
|
listInterviewer(this.queryParams).then(response => {
|
||||||
console.log("===================="+this.interviewerList);
|
|
||||||
this.interviewerList = response.rows;
|
this.interviewerList = response.rows;
|
||||||
this.total = response.total;
|
this.total = response.total;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
|
|||||||
@ -321,13 +321,11 @@ export default {
|
|||||||
},
|
},
|
||||||
//更改请假类型
|
//更改请假类型
|
||||||
changeHolidayType(){
|
changeHolidayType(){
|
||||||
console.log("changeHolidayType")
|
|
||||||
this.detail.autoCalculation=this.detail.autoTypeList.includes(this.detail.form.type);
|
this.detail.autoCalculation=this.detail.autoTypeList.includes(this.detail.form.type);
|
||||||
this.blurLeaveStartTime();
|
this.blurLeaveStartTime();
|
||||||
},
|
},
|
||||||
//更改请假开始时间
|
//更改请假开始时间
|
||||||
blurLeaveStartTime(){
|
blurLeaveStartTime(){
|
||||||
console.log("blurLeaveStartTime")
|
|
||||||
//如果需要计算
|
//如果需要计算
|
||||||
if(this.detail.autoCalculation){
|
if(this.detail.autoCalculation){
|
||||||
//存在开始时间
|
//存在开始时间
|
||||||
@ -338,7 +336,6 @@ export default {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}else if(this.detail.form.id == undefined){
|
}else if(this.detail.form.id == undefined){
|
||||||
console.log("走了")
|
|
||||||
this.blurLeaveEndTime();
|
this.blurLeaveEndTime();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@ -133,7 +133,6 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
getSpecialTime(){
|
getSpecialTime(){
|
||||||
getSpecialOverTime().then(response => {
|
getSpecialOverTime().then(response => {
|
||||||
console.log(response)
|
|
||||||
this.overTime = response;
|
this.overTime = response;
|
||||||
})
|
})
|
||||||
}, /** 查询员工信息 */
|
}, /** 查询员工信息 */
|
||||||
|
|||||||
@ -300,7 +300,6 @@ export default {
|
|||||||
this.form = response.data;
|
this.form = response.data;
|
||||||
// 确保isOverTime是数字类型
|
// 确保isOverTime是数字类型
|
||||||
this.form.isOverTime = Number(this.form.isOverTime);
|
this.form.isOverTime = Number(this.form.isOverTime);
|
||||||
console.log('修改表单数据:', this.form);
|
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "修改部门";
|
this.title = "修改部门";
|
||||||
listDeptExcludeChild(row.deptId).then(response => {
|
listDeptExcludeChild(row.deptId).then(response => {
|
||||||
|
|||||||
@ -224,7 +224,6 @@ export default {
|
|||||||
created() {
|
created() {
|
||||||
var param = this.$route.query
|
var param = this.$route.query
|
||||||
this.queryParams.staffId = param.staffId;
|
this.queryParams.staffId = param.staffId;
|
||||||
console.log(param.staffId)
|
|
||||||
this.getList();
|
this.getList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user