人员工时统计

This commit is contained in:
Vergil
2020-03-13 11:48:42 +08:00
parent bd4c29a875
commit 75d48dcb87

View File

@@ -2,20 +2,16 @@
<div class="app-container">
<el-card style="width: 720px;">
<el-date-picker
v-model="startTime"
value-format="yyyy-MM-dd"
v-model="dateRange"
size="small"
style="width: 170px;margin:0px 10px"
type="date"
placeholder="选择开始日期"/>
<span class="demonstration">~</span>
<el-date-picker
v-model="endTime"
type="daterange"
align="center"
style="width: 300px"
value-format="yyyy-MM-dd"
size="small"
style="width: 170px;margin:0px 10px"
type="date"
placeholder="选择结束日期"/>
format="yyyy-MM-dd"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"/>
<el-button type="primary" class="el-icon-search" plain size="small" @click="searchTable();">查询</el-button>
<el-tooltip :open-delay="1000" content="导出人员工时统计表" placement="right">
<el-button type="primary" size="small" plain icon="el-icon-download" @click="exportTable()">导出</el-button>
@@ -23,7 +19,7 @@
</el-card>
<el-card style="width: 720px">
<el-table v-loading="loading" :data="tableData" size="mini" stripe height="650px" border element-loading-text="拼命加载中">
<el-table-column label="操作" align="center" width="110px">
<el-table-column label="操作" align="center" width="110px">
<template slot-scope="scope">
{{ scope.row.姓名 }}
</template>
@@ -33,7 +29,7 @@
{{ scope.row.计划工时 }}
</template>
</el-table-column>
<el-table-column label="实际工时(分)" align="center">
<el-table-column label="录入工时(分)" align="center">
<template slot-scope="scope">
{{ scope.row.实际工时 }}
</template>
@@ -43,11 +39,6 @@
{{ scope.row.扫码工时 }}
</template>
</el-table-column>
<el-table-column label="辅助工时(分)" align="center">
<template slot-scope="scope">
{{ scope.row.辅助工时 }}
</template>
</el-table-column>
<el-table-column label="工时比值" align="center">
<template slot-scope="scope">
{{ scope.row.工时比值 }}
@@ -152,6 +143,7 @@ import { searchtable, searchTable2 } from '@/api/ManufacturingCenter/ManHourStat
export default {
data() {
return {
dateRange: '',
workerName: '',
startTime: '',
endTime: '',
@@ -171,19 +163,14 @@ export default {
searchTable() {
this.loading = true
this.tableData = []
if (this.startTime && this.endTime) {
this.timeCheck = 1
} else {
this.startTime = ''
this.endTime = ''
this.timeCheck = 0
}
let check1
this.dateRange ? check1 = 1 : (check1 = 0, this.dateRange = '')
if (this.workerName) {
this.workerName_ckeck = 1
} else {
this.workerName_ckeck = 0
}
searchtable(this.workerName_ckeck, this.workerName, this.timeCheck, this.startTime, this.endTime).then(response => {
searchtable(this.workerName_ckeck, this.workerName, check1, this.dateRange[0], this.dateRange[1]).then(response => {
response.data.map(v => {
this.$set(v, '工时比值', v.计划工时 === 0 ? 0 : Math.round(v.扫码工时 / v.计划工时 * 100) / 100.00)
})
@@ -194,11 +181,11 @@ export default {
// 导出
exportTable() {
import('./Export2Excel').then(excel => {
const filterVal1 = ['姓名', '计划工时', '实际工时', '扫码工时', '辅助工时', '工时比值']
const filterVal1 = ['姓名', '计划工时', '实际工时', '扫码工时', '工时比值']
const data1 = this.tableData.map(v => filterVal1.map(j => v[j]))
const dataGroup = []
dataGroup.push(data1)
const headerGroup = [['操作', '计划工时', '实际工时', '扫码工时', '辅助工时', '工时比值']]
const headerGroup = [['操作', '计划工时', '录入工时', '扫码工时', '工时比值']]
const sheetGroup = ['工时统计表']
excel.export_json_to_excel({
headerGroup: headerGroup,
@@ -214,19 +201,14 @@ export default {
this.loading2 = true
this.tableData2 = []
this.total2 = 0
if (this.startTime && this.endTime) {
this.timeCheck = 1
} else {
this.startTime = ''
this.endTime = ''
this.timeCheck = 0
}
let check1
this.dateRange ? check1 = 1 : (check1 = 0, this.dateRange = '')
if (this.workerName) {
this.workerName_ckeck = 1
} else {
this.workerName_ckeck = 0
}
searchTable2(this.workerName_ckeck, this.workerName, this.timeCheck, this.startTime, this.endTime, this.pageCurrent, this.pageSize).then(response => {
searchTable2(this.workerName_ckeck, this.workerName, check1, this.dateRange[0], this.dateRange[1], this.pageCurrent, this.pageSize).then(response => {
console.log(response.data)
this.total2 = response.data.length
this.tableData2 = response.data