Commit 15f70ac8 authored by 赵啸非's avatar 赵啸非

修改考勤汇总

parent 0edd87c4
......@@ -35,6 +35,7 @@
clearable="true"
@change="item.change"
@clear="item.clear"
:placeholder="item.label ? item.label : '请选择'"
v-if="item.type === 'select'"
>
<el-option
......@@ -110,7 +111,7 @@
v-if="item.type === 'date' && !item.valueFormat"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择日期"
:placeholder="item.label ? item.label : '选择日期'"
>
</el-date-picker>
......@@ -119,7 +120,7 @@
v-if="item.type === 'date' && item.valueFormat"
type="date"
:value-format="item.valueFormat"
placeholder="选择日期"
:placeholder="item.label ? item.label : '选择日期'"
>
</el-date-picker>
......@@ -128,7 +129,7 @@
v-if="item.type === 'month' && !item.valueFormat"
type="month"
value-format="yyyy-MM"
placeholder="选择月份"
:placeholder="item.label ? item.label : '选择月份'"
>
</el-date-picker>
......@@ -137,7 +138,7 @@
v-if="item.type === 'month' && item.valueFormat"
type="month"
:value-format="item.valueFormat"
placeholder="选择月份"
:placeholder="item.label ? item.label : '选择月份'"
>
</el-date-picker>
......@@ -153,7 +154,7 @@
<el-form-item>
<el-button
type="primary" class="addclass"
type="primary"
icon="el-icon-search"
@click="onSubmit"
title="查询"
......@@ -193,17 +194,16 @@ export default {
},
watch: {
$route(route) {
console.log(222)
this.initForm(route.query);
},
},
async created() {
console.log("1111")
this.initForm(this.$route.query);
},
methods: {
remoteMethod(query, searchType) {
if (query == "") {
console.log("查询参数为空!");
return;
}
this.loading = true;
......@@ -254,12 +254,11 @@ export default {
}
});
this.form = Object.assign({}, this.form, newFormData);
// this.form = Object.assign({}, this.form, data);
// console.log("after form",this.form)
this.form = Object.assign({}, this.form, data);
// console.log(this.form,'dddddd')
},
cleanForm() {
this.clean();
this.onSubmit();
},
// 清空表单值
clean() {
......@@ -268,30 +267,55 @@ export default {
if (item.name === "groupList") {
newData[item.name] = [];
} else {
newData[item.name] = item.multiple ? [] : undefined;
newData[item.name] = item.multiple ? [] : "";
}
});
this.form = Object.assign({}, this.form, newData);
this.onSubmit();
},
onSubmit() {
let { path, query } = this.$route;
let data = this.decode(this.form);
console.log("data:",data)
console.log("form",this.form)
//delete this.form["deviceStatusList"]
if (this.form.attendanceDateStart && this.form.attendanceDateEnd) {
let startValue = Date.parse(this.form.attendanceDateStart);
let endValue = Date.parse(this.form.attendanceDateEnd);
if (startValue > endValue) {
this.$message.error("查询-结束的日期需大于开始日期");
this.form.attendanceDateEnd = "";
return false;
}
}
if (this.form.startTime && this.form.endTime) {
let startValue = Date.parse(this.form.startTime);
let endValue = Date.parse(this.form.endTime);
if (startValue > endValue) {
this.$message.error("查询-结束的日期需大于开始日期");
this.form.endTime = "";
return false;
}
}
let params = JSON.parse(JSON.stringify(this.form)); //不更改原始数据
// console.log(this.form,'form参数')
let data = this.decode(params);
// Object.assign({}, query, data)
this.$router.push({
path: path,
query: Object.assign({}, query, data),
query: {
...query,
...data,
},
});
//this.decodetwo(this.form)
},
// 解析url字符串,去除query字段
encode(data, formTemp) {
let newData = {};
Object.keys(Qs.parse(data)).forEach((item) => {
console.log(item);
if (/^query\./.test(item)) {
let val = data[item];
let key = item.replace(/^query\./, "");
this.search.forEach((obj) => {
if (
obj.name === key &&
......@@ -341,34 +365,6 @@ export default {
});
return newData;
},
decodetwo(data) {
let newData = { page: 1 };
Object.keys(data).forEach((item) => {
let val = data[item];
this.search.forEach((obj) => {
if (
obj.name === item &&
obj.fuzzy === true &&
val &&
val.length > 0
) {
//支持模糊查询,收尾增加百分号
val = val.trim();
if (val.charAt(0) == "%") {
val = val.slice(1);
}
if (val.charAt(val.length - 1) == "%") {
val = val + "%";
}
}
});
newData[item] = this.decodeVal(val);
});
return newData;
},
decodeVal(val) {
let valType = type(val);
if (["Number", "Boolean"].indexOf(valType) > -1) {
......@@ -390,7 +386,7 @@ export default {
data() {
return {
form: {
groupList: [],
// groupList: [],
},
remoteOptions: {},
};
......@@ -428,4 +424,3 @@ export default {
}
}
</style>
......@@ -11,7 +11,7 @@ import lombok.Data;
* 请假记录信息实体对象
*
* @author zxfei
* @date 2023-07-18
* @date 2023-07-19
*/
@Data
public class AttendanceLeaveRecordEntity extends AttendanceLeaveRecordVo {
......@@ -20,11 +20,11 @@ public class AttendanceLeaveRecordEntity extends AttendanceLeaveRecordVo {
/**
* 请假人id
*/
@Excel(name = "请假人id")
private Long leavePersonId;
/**
* 请假人
*/
@Excel(name = "请假人")
private String leavePerson;
/**
* 所属部门id
......@@ -37,26 +37,32 @@ public class AttendanceLeaveRecordEntity extends AttendanceLeaveRecordVo {
/**
* 电话号码
*/
@Excel(name = "电话号码")
private String phoneNumber;
/**
* 请假类型(1.事假,2.调休,3.病假,4.年假,5.产假,6.陪产假,7.婚假,8.例假,9.哺乳假,10.丧假,11.回单位,12.因公请假,13.外出勘验,14.值班补班,15.体检,16.隔离,17.因公外出,18.公休,19.育儿假,20.调回单位,21.探亲假)
*/
@Excel(name = "请假类型", readConverterExp = "1=事假,2.调休,3.病假,4.年假,5.产假,6.陪产假,7.婚假,8.例假,9.哺乳假,10.丧假,11.回单位,12.因公请假,13.外出勘验,14.值班补班,15.体检,16.隔离,17.因公外出,18.公休,19.育儿假,20.调回单位,21.探亲假")
private Integer leaveType;
/**
* 开始时间
*/
@Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date startTime;
/**
* 结束时间
*/
@Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date endTime;
/**
* 时长,单位秒
*/
@Excel(name = "时长,单位秒")
private Integer duration;
/**
* 请假事由
*/
@Excel(name = "请假事由")
private String reason;
/**
* 审批负责人Id
......@@ -85,14 +91,17 @@ public class AttendanceLeaveRecordEntity extends AttendanceLeaveRecordVo {
/**
* 审核结果(1.申请通过,2.申请不通过)
*/
@Excel(name = "审核结果", readConverterExp = "1=申请通过,2.申请不通过")
private Integer auditResult;
/**
* 审核说明
*/
@Excel(name = "审核说明")
private String auditDesc;
/**
* 审核时间
*/
@Excel(name = "审核时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date auditTime;
/**
* 处理状态
......@@ -116,7 +125,7 @@ public class AttendanceLeaveRecordEntity extends AttendanceLeaveRecordVo {
public void initAttrValue(){
this.leavePersonId = null;
this.leavePersonId = -1L;
this.leavePerson = "";
......@@ -126,7 +135,7 @@ public class AttendanceLeaveRecordEntity extends AttendanceLeaveRecordVo {
this.phoneNumber = "";
this.leaveType = null;
this.leaveType =null;
this.startTime = null;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment