|
@@ -17,6 +17,19 @@
|
|
|
@sort-change="handleSortChange"
|
|
@sort-change="handleSortChange"
|
|
|
@pagination-change="handlePaginationChange"
|
|
@pagination-change="handlePaginationChange"
|
|
|
>
|
|
>
|
|
|
|
|
+ <template slot="time">
|
|
|
|
|
+ <el-date-picker
|
|
|
|
|
+ v-model="daterRange"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ type="daterange"
|
|
|
|
|
+ :picker-options="pickerOptions"
|
|
|
|
|
+ range-separator="至"
|
|
|
|
|
+ start-placeholder="开始日期"
|
|
|
|
|
+ end-placeholder="结束日期"
|
|
|
|
|
+ align="right"
|
|
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
|
|
+ />
|
|
|
|
|
+ </template>
|
|
|
<!-- 自定义多级表头 -->
|
|
<!-- 自定义多级表头 -->
|
|
|
<template #prepend-column>
|
|
<template #prepend-column>
|
|
|
<el-table-column key="userName" prop="userName" label="姓名" width="80">
|
|
<el-table-column key="userName" prop="userName" label="姓名" width="80">
|
|
@@ -107,6 +120,15 @@ export default {
|
|
|
limit: 15
|
|
limit: 15
|
|
|
},
|
|
},
|
|
|
sorts: {},
|
|
sorts: {},
|
|
|
|
|
+ daterRange: [],
|
|
|
|
|
+ pickerOptions: {
|
|
|
|
|
+ disabledDate (time) {
|
|
|
|
|
+ const today = new Date()
|
|
|
|
|
+ today.setHours(0, 0, 0, 0)
|
|
|
|
|
+ // 禁用今天及未来的日期
|
|
|
|
|
+ return time.getTime() >= today.getTime()
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
listConfig: {
|
|
listConfig: {
|
|
|
toolbars: [
|
|
toolbars: [
|
|
|
{ key: 'search', icon: 'ibps-icon-search', label: '查询', type: 'primary' },
|
|
{ key: 'search', icon: 'ibps-icon-search', label: '查询', type: 'primary' },
|
|
@@ -116,7 +138,7 @@ export default {
|
|
|
labelWidth: 80,
|
|
labelWidth: 80,
|
|
|
forms: [
|
|
forms: [
|
|
|
{ prop: 'Q^kao_qin_zhuang_ta^SL', label: '考勤状态', fieldType: 'select', options: [{ value: '正常', label: '正常' }, { value: '异常', label: '异常' }] },
|
|
{ prop: 'Q^kao_qin_zhuang_ta^SL', label: '考勤状态', fieldType: 'select', options: [{ value: '正常', label: '正常' }, { value: '异常', label: '异常' }] },
|
|
|
- { prop: ['Q^ri_qi_^DL', 'Q^ri_qi_^DG'], label: '日期范围', fieldType: 'daterange' },
|
|
|
|
|
|
|
+ { prop: '', label: '日期范围', fieldType: 'slot', slotName: 'time' },
|
|
|
{ prop: 'Q^ban_ci_ming_^SL', label: '班次名称' },
|
|
{ prop: 'Q^ban_ci_ming_^SL', label: '班次名称' },
|
|
|
{ prop: 'Q^ban_ci_bie_ming_^SL', label: '班次别名' },
|
|
{ prop: 'Q^ban_ci_bie_ming_^SL', label: '班次别名' },
|
|
|
{ prop: 'Q^pai_ban_ming_chen^SL', label: '排班名称' }
|
|
{ prop: 'Q^pai_ban_ming_chen^SL', label: '排班名称' }
|
|
@@ -144,7 +166,7 @@ export default {
|
|
|
item.userName = this.getUserLabel(item.yong_hu_id_)
|
|
item.userName = this.getUserLabel(item.yong_hu_id_)
|
|
|
item.deptName = this.getDeptLabel(item.bu_men_)
|
|
item.deptName = this.getDeptLabel(item.bu_men_)
|
|
|
})
|
|
})
|
|
|
- this.pagination.totalCount = this.listData[0].total_count
|
|
|
|
|
|
|
+ this.pagination.totalCount = this.listData[0]?.total_count || 0
|
|
|
}).finally(() => {
|
|
}).finally(() => {
|
|
|
this.loading = false
|
|
this.loading = false
|
|
|
})
|
|
})
|
|
@@ -164,19 +186,21 @@ export default {
|
|
|
const { first, second } = this.$store.getters.level || {}
|
|
const { first, second } = this.$store.getters.level || {}
|
|
|
const searchParam = this.$refs['crud'] ? this.$refs['crud'].getSearcFormData() : {}
|
|
const searchParam = this.$refs['crud'] ? this.$refs['crud'].getSearcFormData() : {}
|
|
|
searchParam['Q^di_dian_^S'] = second || first
|
|
searchParam['Q^di_dian_^S'] = second || first
|
|
|
|
|
+ searchParam['Q^ri_qi_^DGT'] = this.$common.getDateNow()
|
|
|
// 筛选当前用户数据
|
|
// 筛选当前用户数据
|
|
|
searchParam['Q^yong_hu_id_^S'] = this.$store.getters.userId
|
|
searchParam['Q^yong_hu_id_^S'] = this.$store.getters.userId
|
|
|
return ActionUtils.formatParams(searchParam, this.pagination, this.sorts)
|
|
return ActionUtils.formatParams(searchParam, this.pagination, this.sorts)
|
|
|
},
|
|
},
|
|
|
getSearchSql () {
|
|
getSearchSql () {
|
|
|
const { first, second } = this.$store.getters.level || {}
|
|
const { first, second } = this.$store.getters.level || {}
|
|
|
- let sql = `select t.*, (select COUNT(*) FROM t_attendance_detail WHERE di_dian_ = '${second || first}' AND yong_hu_id_ = '${this.$store.getters.userId}' ) AS total_count FROM t_attendance_detail t `
|
|
|
|
|
|
|
+ let sql = `select t.*, (select COUNT(*) FROM t_attendance_detail WHERE di_dian_ = '${second || first}' AND yong_hu_id_ = '${this.$store.getters.userId}' and ri_qi_ < '${this.$common.getDateNow()}' ) AS total_count FROM t_attendance_detail t `
|
|
|
const params = this.getSearchFormData()
|
|
const params = this.getSearchFormData()
|
|
|
// 定义操作符映射
|
|
// 定义操作符映射
|
|
|
const operatorMap = {
|
|
const operatorMap = {
|
|
|
'S': '=',
|
|
'S': '=',
|
|
|
'SL': 'LIKE',
|
|
'SL': 'LIKE',
|
|
|
'DG': '<=',
|
|
'DG': '<=',
|
|
|
|
|
+ 'DGT': '<',
|
|
|
'DL': '>='
|
|
'DL': '>='
|
|
|
}
|
|
}
|
|
|
// 如果有查询条件,构建 WHERE 子句
|
|
// 如果有查询条件,构建 WHERE 子句
|
|
@@ -200,9 +224,10 @@ export default {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
-
|
|
|
|
|
|
|
+ debugger
|
|
|
if (conditions.length > 0) {
|
|
if (conditions.length > 0) {
|
|
|
- sql += ' WHERE ' + conditions.join(' AND ')
|
|
|
|
|
|
|
+ const wherestr = ' WHERE ' + conditions.join(' AND ')
|
|
|
|
|
+ sql = `select t.*, (select COUNT(*) FROM t_attendance_detail ${wherestr} ) AS total_count FROM t_attendance_detail t ${wherestr} `
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
// 添加分页
|
|
// 添加分页
|