update code
parent
1b4bde84fe
commit
390c0db928
|
@ -2,38 +2,43 @@
|
||||||
<MyDialog v-if="show" v-model="show" width="1600px" height="850px" class="today-attendance-detail">
|
<MyDialog v-if="show" v-model="show" width="1600px" height="850px" class="today-attendance-detail">
|
||||||
<template slot="title">今日出勤</template>
|
<template slot="title">今日出勤</template>
|
||||||
<div class="head-title-tab" style="padding: 10px 0px;">
|
<div class="head-title-tab" style="padding: 10px 0px;">
|
||||||
<div :class="nav == 1 ? 'head-nav active' : 'head-nav'" @click="doNav(101)">总包人员</div>
|
<div :class="nav == 1 ? 'head-nav active' : 'head-nav'" @click="doNav(101)">总包人员</div>
|
||||||
<div :class="nav == 8 ? 'head-nav active' : 'head-nav'" @click="doNav(102)">监理人员</div>
|
<div :class="nav == 8 ? 'head-nav active' : 'head-nav'" @click="doNav(102)">监理人员</div>
|
||||||
<div :class="nav == 2 ? 'head-nav active' : 'head-nav'" @click="doNav(103)">劳务人员</div>
|
<div :class="nav == 2 ? 'head-nav active' : 'head-nav'" @click="doNav(103)">劳务人员</div>
|
||||||
</div>
|
</div>
|
||||||
<el-table v-loading="loading" :data="tableData" class="mytable" height="650" style="width: 100%;background: transparent;" ref="fbsubordinateUnit">
|
<el-table v-loading="loading" :data="tableData" class="mytable" height="650"
|
||||||
|
style="width: 100%;background: transparent;" ref="fbsubordinateUnit">
|
||||||
<el-table-column label="照片" align="center" prop="id">
|
<el-table-column label="照片" align="center" prop="id">
|
||||||
<template slot-scope="{row}">
|
<template slot-scope="{row}">
|
||||||
<el-image v-if="row.scanPhoto||row.recentPhoto||row.workerPhoto" :src="row.scanPhoto||row.recentPhoto||row.workerPhoto" :preview-src-list="[row.recentPhoto||row.scanPhoto||row.workerPhoto]" style="height:60px"/>
|
<el-image v-if="row.scanPhoto || row.recentPhoto || row.workerPhoto"
|
||||||
</template>
|
:src="row.scanPhoto || row.recentPhoto || row.workerPhoto"
|
||||||
</el-table-column>
|
:preview-src-list="[row.recentPhoto || row.scanPhoto || row.workerPhoto]" style="height:60px" />
|
||||||
<el-table-column label="姓名" align="center" prop="workerName" />
|
</template>
|
||||||
<el-table-column label="性别" align="center" prop="attendanceType" >
|
</el-table-column>
|
||||||
<template slot-scope="{row}">{{ row.workerGender==1?'女':'男' }}</template>
|
<el-table-column label="姓名" align="center" prop="workerName" />
|
||||||
</el-table-column>
|
<el-table-column label="性别" align="center" prop="attendanceType">
|
||||||
<el-table-column label="分包商名称" align="center" prop="companyName" />
|
<template slot-scope="{row}">{{ row.workerGender == 1 ? '女' : '男' }}</template>
|
||||||
<el-table-column label="所属班组" align="center" prop="groupName" />
|
</el-table-column>
|
||||||
<el-table-column label="工种" align="center" prop="workTypeName" />
|
<el-table-column label="分包商名称" align="center" prop="companyName" />
|
||||||
<el-table-column label="上午打卡(首次)" align="center" prop="inTime">
|
<el-table-column label="所属班组" align="center" prop="groupName" />
|
||||||
<template slot-scope="{row}">
|
<el-table-column label="工种" align="center" prop="workTypeName" />
|
||||||
<span v-if="row.attendanceTime">{{ row.attendanceTime|formatTime }}</span>
|
<el-table-column label="上午打卡(首次)" align="center" prop="inTime">
|
||||||
<i style="font-size: 20px;color: red;" v-else class="el-icon-close"></i>
|
<template slot-scope="{row}">
|
||||||
</template>
|
<span v-if="row.attendanceTime">{{ row.attendanceTime | formatTime }}</span>
|
||||||
</el-table-column>
|
<i style="font-size: 20px;color: red;" v-else class="el-icon-close"></i>
|
||||||
<el-table-column label="下午打卡(末次)" align="center" prop="outTime" >
|
</template>
|
||||||
<template slot-scope="{row}">
|
</el-table-column>
|
||||||
<span v-if="row.attendanceOutTime">{{ row.attendanceOutTime|formatTime }}</span>
|
<el-table-column label="下午打卡(末次)" align="center" prop="outTime">
|
||||||
<i style="font-size: 20px;color: red;" v-else class="el-icon-close"></i>
|
<template slot-scope="{row}">
|
||||||
</template>
|
<span v-if="row.attendanceOutTime">{{ row.attendanceOutTime | formatTime }}</span>
|
||||||
</el-table-column>
|
<i style="font-size: 20px;color: red;" v-else class="el-icon-close"></i>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<el-pagination layout="total,prev, pager, next" :hide-on-single-page="true" @current-change="handleCurrentChange" :total="total" :page-size="size" :current-page.sync="index" class="bg-pagination"></el-pagination>
|
<el-pagination layout="total,prev, pager, next" :hide-on-single-page="true"
|
||||||
|
@current-change="handleCurrentChange" :total="total" :page-size="size" :current-page.sync="index"
|
||||||
|
class="bg-pagination"></el-pagination>
|
||||||
|
|
||||||
</MyDialog>
|
</MyDialog>
|
||||||
</template>
|
</template>
|
||||||
|
@ -49,15 +54,15 @@ export default {
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading:false,
|
loading: false,
|
||||||
show: false,
|
show: false,
|
||||||
tableData: [],
|
tableData: [],
|
||||||
projectId:0,
|
projectId: 0,
|
||||||
deptId:0,
|
deptId: 0,
|
||||||
size:10,
|
size: 10,
|
||||||
index:1,
|
index: 1,
|
||||||
total:0,
|
total: 0,
|
||||||
nav:101
|
nav: 101
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -66,40 +71,52 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
handleCurrentChange(n){
|
handleCurrentChange(n) {
|
||||||
this.index=n;
|
this.index = n;
|
||||||
this.loadData();
|
this.loadData();
|
||||||
},
|
},
|
||||||
doNav(n){
|
doNav(n) {
|
||||||
this.nav=n;
|
this.nav = n;
|
||||||
this.index=1;
|
this.index = 1;
|
||||||
this.loadData();
|
this.loadData();
|
||||||
},
|
},
|
||||||
showDialog(data) {
|
showDialog(data) {
|
||||||
this.projectId=data?.projectId||0;
|
this.projectId = data?.projectId || 0;
|
||||||
this.deptId=data?.deptId||0;
|
this.deptId = data?.deptId || 0;
|
||||||
this.size=10;
|
this.size = 10;
|
||||||
this.index=1;
|
this.index = 1;
|
||||||
this.loadData();
|
this.loadData();
|
||||||
this.show = true
|
this.show = true
|
||||||
},
|
},
|
||||||
loadData(){
|
loadData() {
|
||||||
let postData={
|
let postData = {
|
||||||
attendanceTime:this.$dt(new Date()).format("YYYY-MM-DD"),
|
attendanceTime: this.$dt(new Date()).format("YYYY-MM-DD"),
|
||||||
projectId:this.projectId,
|
projectId: this.projectId,
|
||||||
pageSize:this.size,
|
pageSize: this.size,
|
||||||
pageNum:this.index,
|
pageNum: this.index,
|
||||||
companyTypeId:this.nav
|
companyTypeId: this.nav
|
||||||
}
|
}
|
||||||
this.tableData=[];
|
this.tableData = [];
|
||||||
this.loading=true;
|
this.loading = true;
|
||||||
this.$api.attendance.listAttendance(postData).then(d=>{
|
this.$api.attendance.listAttendance(postData).then(d => {
|
||||||
this.total=d.total||0;
|
this.total = d.total || 0;
|
||||||
this.tableData=(d.rows||[]).map(it=>{
|
this.tableData = (d.rows || []).map(it => {
|
||||||
it.scanPhoto=it.scanPhoto && it.scanPhoto.indexOf("/profile")==0?"/jhapi"+it.scanPhoto:it.scanPhoto;
|
let dt1 = it.attendanceTime;
|
||||||
|
let dt2 = it.attendanceOutTime;
|
||||||
|
if ((!dt1 || !dt2) || dt1 == dt2) {
|
||||||
|
let dt = dt1 || dt2;
|
||||||
|
if (it.remark == "E") {
|
||||||
|
it.attendanceTime = dt;
|
||||||
|
it.attendanceOutTime = "";
|
||||||
|
} else {
|
||||||
|
it.attendanceTime = "";
|
||||||
|
it.attendanceOutTime = dt;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
it.scanPhoto = it.scanPhoto && it.scanPhoto.indexOf("/profile") == 0 ? "/jhapi" + it.scanPhoto : it.scanPhoto;
|
||||||
return it;
|
return it;
|
||||||
});
|
});
|
||||||
this.loading=false;
|
this.loading = false;
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -107,27 +124,30 @@ export default {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
.mytable{
|
.mytable {
|
||||||
/deep/ th .cell{
|
/deep/ th .cell {
|
||||||
color: aquamarine;
|
color: aquamarine;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.today-attendance-detail{
|
|
||||||
/deep/ .quality-table .el-table .el-table__row{
|
.today-attendance-detail {
|
||||||
|
/deep/ .quality-table .el-table .el-table__row {
|
||||||
background-image: none !important;
|
background-image: none !important;
|
||||||
td{
|
|
||||||
border-bottom:solid 1px rgba(60,170,255,0.3);
|
td {
|
||||||
|
border-bottom: solid 1px rgba(60, 170, 255, 0.3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
.today-attendance-detail{
|
.today-attendance-detail {
|
||||||
.popup-project-introduction-min {
|
.popup-project-introduction-min {
|
||||||
transform: translateY(100px);
|
transform: translateY(100px);
|
||||||
.bg-pagination{
|
|
||||||
margin-top:20px;
|
.bg-pagination {
|
||||||
|
margin-top: 20px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
Loading…
Reference in New Issue