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