新增时间组件

清楚所有页面的console.log输出
This commit is contained in:
andy 2025-07-26 14:27:33 +08:00
parent 9aa780b617
commit 73377aabc5
10 changed files with 102 additions and 16 deletions

View File

@ -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
View 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);
}
}

View File

@ -14,7 +14,8 @@
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="yyyy-MM-dd"
clearable>
:clearable="false"
>
</el-date-picker>
</el-form-item>
<el-form-item label="上班状态:" prop="workSum">
@ -88,6 +89,12 @@
@click="handleUpdate(scope.row)"
v-hasPermi="['attendance:attendance:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-view"
@click="viewInfo(scope.row)"
>打卡详情</el-button>
</template>
</el-table-column>
</el-table>
@ -177,14 +184,35 @@
<el-button @click="openDate = false"> </el-button>
</div>
</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>
</template>
<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 { getToken } from '@/utils/auth'
import { parseTime } from '../../../utils/ruoyi'
import DateUtils from "../../../plugins/DateUtils";
export default {
name: "Attendance",
@ -205,6 +233,7 @@ export default {
//
title: "",
//
findDate: false,
open: false,
openDate: false,
//
@ -224,6 +253,32 @@ export default {
timeRange: [],
//
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: [
@ -252,17 +307,27 @@ export default {
this.queryParams.startTime = '';
this.queryParams.endTime ='';
}
this.findDate = true;
},
findDate(val){
if(val){
this.getList();
}
}
},
created() {
var param = this.$route.query
this.queryParams.staffId = param.staffId;
this.getList();
this.buildTimeRange();
this.getRuleList();
},
methods: {
/**获取补贴 */
buildTimeRange(){
const date = new Date();
this.timeRange = [DateUtils.getCurrentMonthStartDates(date),DateUtils.getCurrentMonthEndDates(date)];
},
/**获取规则 */
getRuleList(){
buttonOptionList({rules:"上班"}).then(response => {
this.ruleList = response.data;
@ -297,7 +362,6 @@ export default {
getList() {
this.loading = true;
listAttendance(this.queryParams).then(response => {
console.log(response.rows)
this.attendanceList = response.rows;
this.total = response.total;
this.loading = false;
@ -331,6 +395,15 @@ export default {
resetQuery() {
this.resetForm("queryForm");
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) {

View File

@ -424,7 +424,6 @@ export default {
this.getList();
this.getDeptList();
var parms = this.$route.query
console.log(1)
if(parms){
this.queryParams.month = parms.month
}
@ -566,7 +565,6 @@ export default {
},
submitFormExport(){
let param = this.form;
console.log(1)
if(this.queryParams.month == '' || this.queryParams.month == null){
this.$message({
message: '请选择月份',

View File

@ -111,7 +111,6 @@ export default {
this.loading = true;
getPage(year).then(response => {
this.holiday = response.data;
console.log(this.holiday);
this.beforYear = this.holiday.year-1;
this.afterYear = this.holiday.year+1;

View File

@ -522,7 +522,6 @@ export default {
getList() {
this.loading = true;
listInterviewer(this.queryParams).then(response => {
console.log("===================="+this.interviewerList);
this.interviewerList = response.rows;
this.total = response.total;
this.loading = false;

View File

@ -321,13 +321,11 @@ export default {
},
//
changeHolidayType(){
console.log("changeHolidayType")
this.detail.autoCalculation=this.detail.autoTypeList.includes(this.detail.form.type);
this.blurLeaveStartTime();
},
//
blurLeaveStartTime(){
console.log("blurLeaveStartTime")
//
if(this.detail.autoCalculation){
//
@ -338,7 +336,6 @@ export default {
});
}
}else if(this.detail.form.id == undefined){
console.log("走了")
this.blurLeaveEndTime();
}
},

View File

@ -133,7 +133,6 @@ export default {
methods: {
getSpecialTime(){
getSpecialOverTime().then(response => {
console.log(response)
this.overTime = response;
})
}, /** 查询员工信息 */

View File

@ -300,7 +300,6 @@ export default {
this.form = response.data;
// isOverTime
this.form.isOverTime = Number(this.form.isOverTime);
console.log('修改表单数据:', this.form);
this.open = true;
this.title = "修改部门";
listDeptExcludeChild(row.deptId).then(response => {

View File

@ -224,7 +224,6 @@ export default {
created() {
var param = this.$route.query
this.queryParams.staffId = param.staffId;
console.log(param.staffId)
this.getList();
},
methods: {