Fix: 塔吊增加考勤记录
This commit is contained in:
parent
34fd6c01bd
commit
79256e3fd7
@ -72,6 +72,7 @@ export default {
|
|||||||
alarmData: '报警数据',
|
alarmData: '报警数据',
|
||||||
dutyCycleData: '工作循环数据',
|
dutyCycleData: '工作循环数据',
|
||||||
violationData: '违章数据',
|
violationData: '违章数据',
|
||||||
|
workerAttendanceData: '考勤数据',
|
||||||
|
|
||||||
allTowerCranes: '全部塔吊(位置配置)',
|
allTowerCranes: '全部塔吊(位置配置)',
|
||||||
newTowerCrane: '新增塔吊',
|
newTowerCrane: '新增塔吊',
|
||||||
@ -439,4 +440,12 @@ export default {
|
|||||||
violationInfo6: '风速违章',
|
violationInfo6: '风速违章',
|
||||||
violationInfo7: '添加时间',
|
violationInfo7: '添加时间',
|
||||||
violationInfo8: '违章时间',
|
violationInfo8: '违章时间',
|
||||||
|
|
||||||
|
//考勤记录列表
|
||||||
|
driverName: '驾驶员名称',
|
||||||
|
idCardNo: '驾驶员身份证号码',
|
||||||
|
recgRercentage: '匹配百分比',
|
||||||
|
recognitionType: '识别类型',
|
||||||
|
systemTime: '考勤时间',
|
||||||
|
towerName: '塔吊名称',
|
||||||
}
|
}
|
||||||
@ -112,6 +112,8 @@ export const selectTowerWorkCycleCountApi = data => post('xmgl/towerWorkCycle/se
|
|||||||
export const selectTowerWorkCycleApi = data => post('xmgl/towerWorkCycle/list', data,'aa');
|
export const selectTowerWorkCycleApi = data => post('xmgl/towerWorkCycle/list', data,'aa');
|
||||||
// 分页列表查询塔机违章数据表信息
|
// 分页列表查询塔机违章数据表信息
|
||||||
export const selectTowerViolationApi = data => post('xmgl/towerViolation/list', data);
|
export const selectTowerViolationApi = data => post('xmgl/towerViolation/list', data);
|
||||||
|
// 分页列表查询塔机考勤记录表信息
|
||||||
|
export const selectTowerWorkerAttendanceApi = data => get('xmgl/towerWorkerAttendance/page', data);
|
||||||
|
|
||||||
//螺母
|
//螺母
|
||||||
export const selectTowerNutByNutHostIdApi = data => post('xmgl/towerNut/selectTowerNutByNutHostId', data);
|
export const selectTowerNutByNutHostIdApi = data => post('xmgl/towerNut/selectTowerNutByNutHostId', data);
|
||||||
|
|||||||
@ -21,6 +21,9 @@
|
|||||||
<div class="menu-item" :class="{'active-menu': activeNav == 5}" @click="checkNav(5)">
|
<div class="menu-item" :class="{'active-menu': activeNav == 5}" @click="checkNav(5)">
|
||||||
钢丝绳监测记录
|
钢丝绳监测记录
|
||||||
</div>
|
</div>
|
||||||
|
<div class="menu-item" :class="{'active-menu': activeNav == 6}" @click="checkNav(6)">
|
||||||
|
考勤记录数据
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="right">
|
<div class="right">
|
||||||
@ -35,6 +38,7 @@
|
|||||||
import liveDataTable from './liveDataTable.vue'
|
import liveDataTable from './liveDataTable.vue'
|
||||||
import violationData from './violationData.vue'
|
import violationData from './violationData.vue'
|
||||||
import wireRopeMonitoring from './wireRopeMonitoring.vue'
|
import wireRopeMonitoring from './wireRopeMonitoring.vue'
|
||||||
|
import workerAttendanceData from './workerAttendanceData.vue'
|
||||||
export default {
|
export default {
|
||||||
name: "reportForm",
|
name: "reportForm",
|
||||||
props:['sn'],
|
props:['sn'],
|
||||||
@ -50,7 +54,8 @@
|
|||||||
alarmsTable,//报警数据
|
alarmsTable,//报警数据
|
||||||
liveDataTable,//实时数据
|
liveDataTable,//实时数据
|
||||||
violationData,//违章数据
|
violationData,//违章数据
|
||||||
wireRopeMonitoring//钢丝绳监测数据
|
wireRopeMonitoring,//钢丝绳监测数据
|
||||||
|
workerAttendanceData//考勤记录数据
|
||||||
},
|
},
|
||||||
created(){
|
created(){
|
||||||
this.projectSn = this.sn ? this.sn:this.$store.state.projectSn;
|
this.projectSn = this.sn ? this.sn:this.$store.state.projectSn;
|
||||||
@ -71,6 +76,9 @@
|
|||||||
else if(val == 5){
|
else if(val == 5){
|
||||||
this.componentName = wireRopeMonitoring
|
this.componentName = wireRopeMonitoring
|
||||||
}
|
}
|
||||||
|
else if(val == 6){
|
||||||
|
this.componentName = workerAttendanceData
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
325
src/views/projectFront/towerCrane/workerAttendanceData.vue
Normal file
325
src/views/projectFront/towerCrane/workerAttendanceData.vue
Normal file
@ -0,0 +1,325 @@
|
|||||||
|
<template>
|
||||||
|
<div class="content">
|
||||||
|
<div class="search-box">
|
||||||
|
<div class="search-item">
|
||||||
|
<!-- 设备名称 -->
|
||||||
|
<span>{{ $t('message.towerCrane.equipmentName') }}:</span>
|
||||||
|
<el-select
|
||||||
|
style="margin-right: 20px"
|
||||||
|
v-model="devSn"
|
||||||
|
clearable
|
||||||
|
size="medium"
|
||||||
|
:placeholder="$t('message.towerCrane.pleaseSelect')"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in devList"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.devName"
|
||||||
|
:value="item.devSn"
|
||||||
|
>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
<el-date-picker
|
||||||
|
class="serarch_picker"
|
||||||
|
size="medium"
|
||||||
|
v-model="valueTime"
|
||||||
|
value-format="yyyy-MM-dd HH:mm:ss"
|
||||||
|
type="datetimerange"
|
||||||
|
range-separator="-"
|
||||||
|
:start-placeholder="$t('message.towerCrane.startDate')"
|
||||||
|
:end-placeholder="$t('message.towerCrane.endDate')"
|
||||||
|
>
|
||||||
|
</el-date-picker>
|
||||||
|
</div>
|
||||||
|
<!-- 查询 -->
|
||||||
|
<el-button size="medium" @click="quertData">{{
|
||||||
|
$t('message.towerCrane.query')
|
||||||
|
}}</el-button>
|
||||||
|
<!-- 刷新 -->
|
||||||
|
<el-button size="medium" @click="refresh">{{
|
||||||
|
$t('message.towerCrane.refresh')
|
||||||
|
}}</el-button>
|
||||||
|
<!-- 导出 -->
|
||||||
|
<el-button size="medium" @click="exportExcel">{{
|
||||||
|
$t('message.towerCrane.export')
|
||||||
|
}}</el-button>
|
||||||
|
</div>
|
||||||
|
<div class="table-box">
|
||||||
|
<el-table
|
||||||
|
:data="tableData"
|
||||||
|
class="tables"
|
||||||
|
height="560"
|
||||||
|
style="width: 100%"
|
||||||
|
>
|
||||||
|
<!-- 考勤数据 -->
|
||||||
|
<el-table-column :label="$t('message.towerCrane.workerAttendanceData')">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<!-- <template> -->
|
||||||
|
<div class="table-list f-2">
|
||||||
|
<div class="table-item">
|
||||||
|
<!-- 塔吊名称 -->
|
||||||
|
{{ $t('message.towerCrane.towerName') }}:
|
||||||
|
{{ scope.row.towerName }}
|
||||||
|
</div>
|
||||||
|
<div class="table-item">
|
||||||
|
<!-- 驾驶员名称 -->
|
||||||
|
{{ $t('message.towerCrane.driverName') }}:
|
||||||
|
{{ scope.row.driverName }}
|
||||||
|
</div>
|
||||||
|
<div class="table-item">
|
||||||
|
<!-- 驾驶员身份证号码 -->
|
||||||
|
{{ $t('message.towerCrane.idCardNo') }}:
|
||||||
|
{{ scope.row.idCardNo }}
|
||||||
|
</div>
|
||||||
|
<div class="table-item">
|
||||||
|
<!-- 匹配百分比 -->
|
||||||
|
{{ $t('message.towerCrane.recgRercentage') }}:
|
||||||
|
{{ scope.row.recgRercentage }}
|
||||||
|
</div>
|
||||||
|
<div class="table-item">
|
||||||
|
<!-- 识别类型 -->
|
||||||
|
{{ $t('message.towerCrane.recognitionType') }}:
|
||||||
|
{{ scope.row.recognitionType }}
|
||||||
|
</div>
|
||||||
|
<div class="table-item">
|
||||||
|
<!-- 考勤时间 -->
|
||||||
|
{{ $t('message.towerCrane.systemTime') }}:
|
||||||
|
{{ scope.row.systemTime }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<el-pagination
|
||||||
|
class="pagerBox"
|
||||||
|
@size-change="handleSizeChange"
|
||||||
|
@current-change="handleCurrentChange"
|
||||||
|
:current-page="pageNo"
|
||||||
|
:page-sizes="$store.state.PAGESIZRS"
|
||||||
|
:page-size="pageSize"
|
||||||
|
layout="total, sizes, prev, pager, next"
|
||||||
|
:total="Number(total)"
|
||||||
|
background
|
||||||
|
></el-pagination>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {
|
||||||
|
getTowerListApi,
|
||||||
|
selectTowerWorkerAttendanceApi,
|
||||||
|
exporExcelTowerWorkCycleApi
|
||||||
|
} from '@/assets/js/api/towerCrane'
|
||||||
|
export default {
|
||||||
|
props: ['sn'],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
devSn: '',
|
||||||
|
projectSn: '',
|
||||||
|
devList: [],
|
||||||
|
tableData: [],
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
total: 0,
|
||||||
|
valueTime: ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.projectSn = this.sn ? this.sn : this.$store.state.projectSn
|
||||||
|
this.queryDev()
|
||||||
|
this.selectNowDate()
|
||||||
|
this.queryTowerAttendance()
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
transformTimestamp() {
|
||||||
|
return function (timestamp) {
|
||||||
|
if (timestamp) {
|
||||||
|
let a = new Date(timestamp).getTime()
|
||||||
|
const date = new Date(a)
|
||||||
|
const Y = date.getFullYear() + '-'
|
||||||
|
const M =
|
||||||
|
(date.getMonth() + 1 < 10
|
||||||
|
? '0' + (date.getMonth() + 1)
|
||||||
|
: date.getMonth() + 1) + '-'
|
||||||
|
const D =
|
||||||
|
(date.getDate() < 10 ? '0' + date.getDate() : date.getDate()) + ' '
|
||||||
|
const h =
|
||||||
|
(date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) +
|
||||||
|
':'
|
||||||
|
const m =
|
||||||
|
(date.getMinutes() < 10
|
||||||
|
? '0' + date.getMinutes()
|
||||||
|
: date.getMinutes()) + ':'
|
||||||
|
const s = date.getSeconds() // 秒
|
||||||
|
const dateString = Y + M + D + h + m + s
|
||||||
|
return dateString
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
transformTimestamp2() {
|
||||||
|
return function (timestamp) {
|
||||||
|
if (timestamp) {
|
||||||
|
let a = new Date(timestamp).getTime()
|
||||||
|
const date = new Date(a)
|
||||||
|
const Y = date.getFullYear() + '-'
|
||||||
|
const M =
|
||||||
|
(date.getMonth() + 1 < 10
|
||||||
|
? '0' + (date.getMonth() + 1)
|
||||||
|
: date.getMonth() + 1) + '-'
|
||||||
|
const D = date.getDate() < 10 ? '0' + date.getDate() : date.getDate()
|
||||||
|
const h =
|
||||||
|
(date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) +
|
||||||
|
':'
|
||||||
|
const m =
|
||||||
|
(date.getMinutes() < 10
|
||||||
|
? '0' + date.getMinutes()
|
||||||
|
: date.getMinutes()) + ':'
|
||||||
|
const s = date.getSeconds() // 秒
|
||||||
|
const dateString = Y + M + D
|
||||||
|
return dateString
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 获取当前时间 返回YYYY-MM-DD HH:mm:ss
|
||||||
|
selectNowDate() {
|
||||||
|
var date = new Date(),
|
||||||
|
year = date.getFullYear(),
|
||||||
|
month = date.getMonth() + 1,
|
||||||
|
day = date.getDate(),
|
||||||
|
hours = date.getHours(), //获取当前小时数(0-23)
|
||||||
|
minutes = date.getMinutes(), //获取当前分钟数(0-59)
|
||||||
|
seconds = date.getSeconds()
|
||||||
|
month >= 1 && month <= 9 ? (month = '0' + month) : ''
|
||||||
|
day >= 0 && day <= 9 ? (day = '0' + day) : ''
|
||||||
|
hours >= 0 && hours <= 9 ? (hours = '0' + hours) : ''
|
||||||
|
minutes >= 0 && minutes <= 9 ? (minutes = '0' + minutes) : ''
|
||||||
|
seconds >= 0 && seconds <= 9 ? (seconds = '0' + seconds) : ''
|
||||||
|
// var timer = year + '-' + month + '-' + day + ' ' + hours + ':' + minutes+ ':' + seconds;
|
||||||
|
let timer = year + '-' + month + '-' + day + ' ' + '00:00:00';
|
||||||
|
// var timer = year + '-' + month + '-' + day
|
||||||
|
let timerOut = year + '-' + month + '-' + day + ' ' + '23:59:59'
|
||||||
|
this.valueTime = [timer, timerOut]
|
||||||
|
console.log(timer)
|
||||||
|
// return timer;
|
||||||
|
},
|
||||||
|
queryDev() {
|
||||||
|
getTowerListApi({ projectSn: this.projectSn }).then((res) => {
|
||||||
|
// console.log(res)
|
||||||
|
if (res.code == 200 && res.result) {
|
||||||
|
this.devList = res.result
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
quertData() {
|
||||||
|
this.pageNo = 1
|
||||||
|
this.pageSize = 10
|
||||||
|
console.log(this.devSn)
|
||||||
|
this.queryTowerAttendance()
|
||||||
|
},
|
||||||
|
refresh() {
|
||||||
|
this.pageNo = 1
|
||||||
|
this.pageSize = 10
|
||||||
|
this.total = 0
|
||||||
|
this.devSn = ''
|
||||||
|
this.valueTime = ''
|
||||||
|
this.queryTowerAttendance()
|
||||||
|
},
|
||||||
|
queryTowerAttendance() {
|
||||||
|
const loading = this.$loading({
|
||||||
|
lock: true,
|
||||||
|
text: 'Loading',
|
||||||
|
spinner: 'el-icon-loading',
|
||||||
|
background: 'rgba(0, 0, 0, 0.7)'
|
||||||
|
})
|
||||||
|
let data = {
|
||||||
|
devSn: this.devSn,
|
||||||
|
pageNo: this.pageNo,
|
||||||
|
pageSize: this.pageSize,
|
||||||
|
projectSn: this.projectSn,
|
||||||
|
systemTime_begin: this.valueTime ? this.valueTime[0] : '',
|
||||||
|
systemTime_end: this.valueTime ? this.valueTime[1] : ''
|
||||||
|
}
|
||||||
|
console.log(data)
|
||||||
|
selectTowerWorkerAttendanceApi(data).then((res) => {
|
||||||
|
console.log(res)
|
||||||
|
if (res.code == 200 && res.result) {
|
||||||
|
this.tableData = res.result.records
|
||||||
|
console.log(this.tableData)
|
||||||
|
this.total = res.result.total
|
||||||
|
loading.close()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleSizeChange(value) {
|
||||||
|
this.pageSize = value
|
||||||
|
this.queryTowerAttendance()
|
||||||
|
},
|
||||||
|
handleCurrentChange(value) {
|
||||||
|
this.pageNo = value
|
||||||
|
this.queryTowerAttendance()
|
||||||
|
},
|
||||||
|
exportExcel() {
|
||||||
|
if (this.valueTime) {
|
||||||
|
window.location.href =
|
||||||
|
this.$http.defaults.baseURL +
|
||||||
|
'xmgl/download/exporExcelTowerWorkCycle?projectSn=' +
|
||||||
|
this.projectSn +
|
||||||
|
'&devSn=' +
|
||||||
|
this.devSn
|
||||||
|
? this.devSn
|
||||||
|
: '' +
|
||||||
|
'&startTime=' +
|
||||||
|
this.valueTime[0] +
|
||||||
|
'&endTime=' +
|
||||||
|
this.valueTime[1]
|
||||||
|
} else {
|
||||||
|
window.location.href =
|
||||||
|
this.$http.defaults.baseURL +
|
||||||
|
'xmgl/download/exporExcelTowerWorkCycle?projectSn=' +
|
||||||
|
this.projectSn +
|
||||||
|
'&devSn=' +
|
||||||
|
this.devSn
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped>
|
||||||
|
.content {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
height: 100%;
|
||||||
|
.search-box {
|
||||||
|
background: #fff;
|
||||||
|
padding: 25px;
|
||||||
|
margin-bottom: 14px;
|
||||||
|
.search-item {
|
||||||
|
display: inline-block;
|
||||||
|
margin-right: 26px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.table-box {
|
||||||
|
flex: 1;
|
||||||
|
background: #fff;
|
||||||
|
/deep/.el-table {
|
||||||
|
td {
|
||||||
|
vertical-align: top;
|
||||||
|
}
|
||||||
|
.cell {
|
||||||
|
padding-left: 44px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.f-2 {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
.table-item {
|
||||||
|
width: 50%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
Loading…
x
Reference in New Issue
Block a user