Commit a6a88ae4 authored by 赵啸非's avatar 赵啸非

Merge remote-tracking branch 'origin/master'

parents 289847e7 9c2bc047
...@@ -87,7 +87,6 @@ export default { ...@@ -87,7 +87,6 @@ export default {
return; return;
} }
this.tableData.loading = true; this.tableData.loading = true;
console.log(this.query);
this.$post(this.pageInfo.list, this.query, { this.$post(this.pageInfo.list, this.query, {
cancelToken: this.source.token, cancelToken: this.source.token,
}) })
......
<template>
<el-table
size="small"
:data="tableData"
:row-key="handleRowKeyMethod"
:span-method="handleSpanMethod"
:toggleRowSelection="toggleRowSelection"
@selection-change="handleSelectionChange"
@sort-change="handleSortChange"
@row-click="handleRowClick"
@cell-click="handleCellClick"
:row-class-name="tableRowClassName"
:empty-text="emptytxt ? emptytxt : emptyText"
border
style="width: 100%"
>
<template v-for="column in columns">
<el-table-column
v-if="column.show"
:key="column.prop"
:type="column.type"
:index="handleIndexMethod"
:selectable="handleSelectableMethod"
:prop="column.prop"
:label="column.label"
:width="column.width"
:sortable="column.sortable"
:show-overflow-tooltip="column.tooltip"
:align="column.align || 'left'"
:formatter="column.formatter"
:reserve-selection="column.reserveSelection"
:subColumns="column.subColumns"
:fixed="column.fixed"
>
<el-table-column
v-for="sunColumn in column.subColumns"
:key="sunColumn.prop"
:type="sunColumn.type"
:prop="sunColumn.prop"
:label="sunColumn.label"
:width="sunColumn.width"
:sortable="sunColumn.sortable"
:align="sunColumn.align || 'left'"
:formatter="sunColumn.formatter"
/>
</el-table-column>
</template>
</el-table>
</template>
<script>
export default {
props: {
handleRowKeyMethod: {
type: Function,
required: false,
default: (row) => {
return row.id;
},
},
handleSelectableMethod: {
type: Function,
required: false,
default: () => {},
},
handleIndexMethod: {
type: Function,
required: false,
default: () => {},
},
handleSpanMethod: {
type: Function,
required: false,
default: () => {},
},
handleSelectionChange: {
type: Function,
required: false,
default: () => {},
},
handleRowClick: {
type: Function,
required: false,
default: () => {},
},
handleCellClick: {
type: Function,
required: false,
default: () => {},
},
handleSortChange: {
type: Function,
required: false,
default: () => {},
},
tableRowClassName: {
type: Function,
required: false,
default: () => {},
},
loading: {
type: Boolean,
required: false,
default: true,
},
tableData: {
type: Array,
required: false,
default: () => [],
},
columns: {
type: Array,
required: false,
default: () => [],
},
},
computed: {
emptyText() {
return !this.loading && !this.tableData.length ? "暂无数据" : "加载中...";
},
},
mounted() {},
watch: {
tableData(val) {
val.length == 0 || val.length > 0
? (this.emptytxt = "暂无数据")
: (this.emptytxt = "加载中...");
// if (val.length > 0) {
// val.forEach((v) => {
// for (let key in v) {
// v[key] ? "" : (v[key] = "--");
// }
// });
// console.log(val);
// }
},
columns: {
deep: true,
handler(val) {
this.$forceUpdate(this.columns);
},
},
},
methods: {},
data() {
return {
emptytxt: "",
};
},
};
</script>
...@@ -184,6 +184,20 @@ ...@@ -184,6 +184,20 @@
:handleRowClick="config.methods.handleRowClick" :handleRowClick="config.methods.handleRowClick"
:handleCellClick="config.methods.handleCellClick" :handleCellClick="config.methods.handleCellClick"
/> />
<DataTableSelect
v-if="showType == 'tableSelect'"
:tableData="data.data"
:columns="config.columns"
:loading="data.loading"
:tableRowClassName="config.methods.tableRowClassName"
:handleSpanMethod="config.methods.handleSpanMethod"
:handleSortChange="config.methods.handleSortChange"
:handleIndexMethod="config.methods.handleIndexMethod"
:handleSelectableMethod="config.methods.handleSelectableMethod"
:handleSelectionChange="config.methods.handleSelectionChange"
:handleRowClick="config.methods.handleRowClick"
:handleCellClick="config.methods.handleCellClick"
/>
<DataTableFlow <DataTableFlow
v-if="showType == 'tableFlow'" v-if="showType == 'tableFlow'"
...@@ -232,8 +246,9 @@ import Pagination from "@/components/Pagination.vue"; ...@@ -232,8 +246,9 @@ import Pagination from "@/components/Pagination.vue";
import SearchForm from "@/components/SearchForm.vue"; import SearchForm from "@/components/SearchForm.vue";
import Confirm from "@/components/Confirm.vue"; import Confirm from "@/components/Confirm.vue";
import DataTable from "@/components/DataTable.vue"; import DataTable from "@/components/DataTable.vue";
import DataTableSelect from "@/components/DataTableSelect.vue";
import DataTableMobile from "./DataTableMobile.js"; import DataTableMobile from "./DataTableMobile.js";
import DataTableFlow from "./DataTableFlow.vue"; import DataTableFlow from "@/components/DataTableFlow.vue";
import DataTreeTable from "@/components/DataTreeTable.vue"; import DataTreeTable from "@/components/DataTreeTable.vue";
import TabPane from "@/components/tabPane.vue"; import TabPane from "@/components/tabPane.vue";
export default { export default {
...@@ -257,10 +272,10 @@ export default { ...@@ -257,10 +272,10 @@ export default {
DataTableMobile, DataTableMobile,
DataTableFlow, DataTableFlow,
DataTreeTable, DataTreeTable,
DataTableSelect,
TabPane, TabPane,
}, },
mounted() {
},
methods: { methods: {
// 根据url的query参数判断是否展示查询条件 // 根据url的query参数判断是否展示查询条件
isShowSearch(query) { isShowSearch(query) {
......
...@@ -36,7 +36,13 @@ ...@@ -36,7 +36,13 @@
</div> </div>
</div> </div>
</div> --> </div> -->
<LayoutTable :data="tableData" :config="tableConfig" notDel notAdd> <LayoutTable
:data="tableData"
:config="tableConfig"
notDel
notAdd
ref="layoutTable"
>
<el-button <el-button
slot="table-head-left2" slot="table-head-left2"
style="margin-left: 10px" style="margin-left: 10px"
...@@ -69,9 +75,17 @@ ...@@ -69,9 +75,17 @@
style="margin-left: 10px" style="margin-left: 10px"
icon="el-icon-tickets" icon="el-icon-tickets"
size="mini" size="mini"
@click="setdialog" @click="setdialog(2)"
>表格设置</el-button >表格设置</el-button
> >
<el-button
slot="table-head-left2"
style="margin-left: 10px"
icon="el-icon-tickets"
size="mini"
@click="setdialog(1)"
>导出表格设置</el-button
>
</LayoutTable> </LayoutTable>
<drawer-show ref="drawerform" @ok="getData" /> <drawer-show ref="drawerform" @ok="getData" />
<!-- 导出记录查看 --> <!-- 导出记录查看 -->
...@@ -118,7 +132,7 @@ ...@@ -118,7 +132,7 @@
</div> </div>
</div> </div>
</el-drawer> </el-drawer>
<!-- 表格设置 --> <!-- 导出表格设置 -->
<el-dialog :visible.sync="isdialog" title="导出表格设置"> <el-dialog :visible.sync="isdialog" title="导出表格设置">
<div class="tipsword"> <div class="tipsword">
请选择表格展示字段,导出的表格中的内容选中的字段将保持一致。 请选择表格展示字段,导出的表格中的内容选中的字段将保持一致。
...@@ -133,8 +147,27 @@ ...@@ -133,8 +147,27 @@
</el-checkbox> </el-checkbox>
</el-checkbox-group> </el-checkbox-group>
<div class="mt20" style="text-align:right"> <div class="mt20" style="text-align:right">
<el-button @click="handleCancel">取消</el-button> <el-button @click="handleCancel(1)">取消</el-button>
<el-button type="primary" @click="handleSubmit">确定</el-button> <el-button type="primary" @click="handleSubmit(1)">确定</el-button>
</div>
</el-dialog>
<!-- 显示表格设置 -->
<el-dialog :visible.sync="setDialog" title="表格显示设置">
<div class="tipsword">
请选择表格展示字段,表格中的内容与选中的字段将保持一致。
</div>
<el-checkbox-group v-model="checkTableList">
<el-checkbox
v-for="(item, index) in setcolum"
:key="index"
:label="item.prop"
>
{{ item.label }}
</el-checkbox>
</el-checkbox-group>
<div class="mt20" style="text-align:right">
<el-button @click="handleCancel(2)">取消</el-button>
<el-button type="primary" @click="handleSubmit(2)">确定</el-button>
</div> </div>
</el-dialog> </el-dialog>
<!-- 上传 --> <!-- 上传 -->
...@@ -219,14 +252,33 @@ export default { ...@@ -219,14 +252,33 @@ export default {
}, },
methods: { methods: {
// 表格设置弹窗取消操作 // 表格设置弹窗取消操作
handleCancel() { handleCancel(i) {
this.checkList = []; if (i == 1) {
this.isdialog = false; this.checkList = [];
this.isdialog = false;
} else {
this.setDialog = false;
}
}, },
// 表格设置提交操作 // 表格设置提交操作
handleSubmit() { handleSubmit(i) {
this.doExport(); if (i == 1) {
this.isdialog = false; this.doExport();
this.isdialog = false;
} else {
this.config.columns.forEach((v) => {
v.prop && v.prop != "attendanceStaffStatEntities"
? (v.show = false)
: (v.show = true);
this.checkTableList.forEach((val) => {
if (v.prop == val) {
v.show = true;
}
});
});
this.$forceUpdate(this.config.columns);
this.setDialog = false;
}
}, },
// 表格接收数据后 // 表格接收数据后
afterRender(data) { afterRender(data) {
...@@ -249,6 +301,7 @@ export default { ...@@ -249,6 +301,7 @@ export default {
}; };
}); });
this.config.columns = [...this.initalArr, ...addobjArr]; this.config.columns = [...this.initalArr, ...addobjArr];
this.$refs.layoutTable.showType = "tableSelect";
this.$forceUpdate(); this.$forceUpdate();
}, },
// 表格接收数据前 // 表格接收数据前
...@@ -401,12 +454,24 @@ export default { ...@@ -401,12 +454,24 @@ export default {
} }
return false; return false;
}, },
setdialog() { setdialog(i) {
this.isdialog = true; if (i == 1) {
this.setcolum = this.config.columns.filter( this.isdialog = true;
(item) => item.label && item.prop this.setcolum = this.config.columns.filter(
); (item) => item.label && item.prop
console.log(this.setcolum); );
} else {
this.setDialog = true;
this.setcolum = this.config.columns.filter(
(item) => item.label && item.prop
);
this.checkTableList = this.config.columns.map((item) => {
if (item.show) {
return item.prop;
}
});
}
}, },
renderTable(tableData) { renderTable(tableData) {
return ( return (
...@@ -463,33 +528,38 @@ export default { ...@@ -463,33 +528,38 @@ export default {
}, },
/** 子表列元素 */ /** 子表列元素 */
columnSet: [ columnSet: [
{ prop: "shiftsName", label: "班次名称", width: 150 }, { prop: "shiftsName", label: "班次名称", width: 150, show: true },
{ {
prop: "goWorkDate", prop: "goWorkDate",
label: "上班打卡时间", label: "上班打卡时间",
width: 100, width: 100,
formatter: this.formatterDate, formatter: this.formatterDate,
show: true,
}, },
{ {
prop: "goWorkResult", prop: "goWorkResult",
label: "上班打卡结果", label: "上班打卡结果",
width: 100, width: 100,
formatter: this.formatterString, formatter: this.formatterString,
show: true,
}, },
{ {
prop: "offWorkDate", prop: "offWorkDate",
label: "下班打卡时间", label: "下班打卡时间",
width: 100, width: 100,
formatter: this.formatterDate, formatter: this.formatterDate,
show: true,
}, },
{ {
prop: "offWorkResult", prop: "offWorkResult",
label: "下班打卡结果", label: "下班打卡结果",
width: 100, width: 100,
formatter: this.formatterString, formatter: this.formatterString,
show: true,
}, },
], ],
config: { config: {
showType: "tableSelect",
search: [ search: [
{ {
name: "staffName", name: "staffName",
...@@ -548,39 +618,59 @@ export default { ...@@ -548,39 +618,59 @@ export default {
}, },
], ],
columns: [ columns: [
{ type: "selection", width: 60 }, { type: "selection", width: 60, show: true },
{ type: "index", label: "序号", width: 50 }, { type: "index", label: "序号", width: 50, show: true },
{ {
label: "打卡日期", label: "打卡日期",
prop: "attendanceDate", prop: "attendanceDate",
formatter: this.formatterDateOnly, formatter: this.formatterDateOnly,
show: true,
}, },
{ label: "员工姓名", prop: "staffName" }, { label: "员工姓名", prop: "staffName", show: true },
{ label: "员工工号", prop: "workNum" }, { label: "员工工号", prop: "workNum", show: true },
{ {
label: "考勤组", label: "考勤组",
prop: "attendanceGroupName", prop: "attendanceGroupName",
show: true,
},
{ label: "部门", prop: "deptName", show: true },
{ label: "职位", prop: "positionName", show: true },
{
label: "班次",
prop: "classId",
formatter: this.formatter,
show: true,
}, },
{ label: "部门", prop: "deptName" },
{ label: "职位", prop: "positionName" },
{ label: "班次", prop: "classId", formatter: this.formatter },
{ {
label: "签到结果", label: "签到结果",
prop: "signInResult", prop: "signInResult",
formatter: this.formatter, formatter: this.formatter,
show: true,
}, },
{ {
label: "签退结果", label: "签退结果",
prop: "signOutResult", prop: "signOutResult",
formatter: this.formatter, formatter: this.formatter,
show: true,
},
{
label: "打卡结果",
prop: "punchResult",
formatter: this.formatter,
show: true,
},
{
label: "考勤类型",
prop: "attendType",
formatter: this.formatter,
show: true,
}, },
{ label: "打卡结果", prop: "punchResult", formatter: this.formatter },
{ label: "考勤类型", prop: "attendType", formatter: this.formatter },
{ {
label: "考勤打卡记录详细信息", label: "考勤打卡记录详细信息",
width: 120, width: 120,
prop: "subColumns", prop: "subColumns",
show: true,
formatter: (row) => { formatter: (row) => {
let widthsize = this.columnSet.reduce((pre, cur) => { let widthsize = this.columnSet.reduce((pre, cur) => {
return pre + Number(cur.width); return pre + Number(cur.width);
...@@ -611,6 +701,8 @@ export default { ...@@ -611,6 +701,8 @@ export default {
isdialog: false, isdialog: false,
setcolum: [], setcolum: [],
checkList: [], checkList: [],
setDialog: false,
checkTableList: [],
exportList: [], //导出记录 exportList: [], //导出记录
baseUrl: process.env.VUE_APP_API_BASE_URL + "/", baseUrl: process.env.VUE_APP_API_BASE_URL + "/",
initalArr: [], initalArr: [],
......
...@@ -36,7 +36,7 @@ public class AttendanceSummaryTaskImpl implements ITaskExcuteService { ...@@ -36,7 +36,7 @@ public class AttendanceSummaryTaskImpl implements ITaskExcuteService {
Calendar now = Calendar.getInstance(); Calendar now = Calendar.getInstance();
now.setTime(new Date()); now.setTime(new Date());
now.add(Calendar.DAY_OF_MONTH, -1); //默认查前一天数据 now.add(Calendar.DAY_OF_MONTH, -1); //默认查前一天数据
attendanceRecordErrorService.doAutoProcess(now.getTime()); // attendanceRecordErrorService.doAutoProcess(now.getTime());
AttendanceSummaryQuery query = new AttendanceSummaryQuery(); AttendanceSummaryQuery query = new AttendanceSummaryQuery();
query.setSummaryTimeEnd(DateUtils.getStrDate(now.getTime())); query.setSummaryTimeEnd(DateUtils.getStrDate(now.getTime()));
......
...@@ -82,13 +82,13 @@ ...@@ -82,13 +82,13 @@
from from
mortals_xhx_attendance_record_error e mortals_xhx_attendance_record_error e
where where
processStatus = 1 processResult != 4
and processResult != 4
and e.errorDateTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{summaryTime},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s') and e.errorDateTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{summaryTime},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s')
and e.errorDateTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{summaryTime},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s') and e.errorDateTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{summaryTime},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s')
<if test="staffId != null and staffId!=''"> AND e.staffId = #{staffId}</if> <if test="staffId != null and staffId!=''"> AND e.staffId = #{staffId}</if>
group by group by
e.staffId, e.staffId,
e.staffName e.staffName,
DATE_FORMAT(errorDateTime,'%Y-%m-%d')
</select> </select>
</mapper> </mapper>
\ No newline at end of file
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