工时统计工艺

This commit is contained in:
zhangdingyu
2019-10-29 12:00:09 +08:00
parent 8e0826b50e
commit 907ff3cb93
3 changed files with 244 additions and 1 deletions

View File

@@ -0,0 +1,218 @@
<template>
<div class="app-container">
<el-card>
<el-date-picker
v-model="startTime"
value-format="yyyy-MM-dd"
size="small"
style="width: 170px;margin:0px 10px"
type="date"
placeholder="选择开始日期"/>
<span class="demonstration">~</span>
<el-date-picker
v-model="endTime"
value-format="yyyy-MM-dd"
size="small"
style="width: 170px;margin:0px 10px"
type="date"
placeholder="选择结束日期"/>
<el-button type="success" class="el-icon-search" size="small" style="margin:0px 10px" @click="searchTable();">查询</el-button>
</el-card>
<el-card>
<el-table v-loading="loading" :data="tableData" height="380" size="mini" stripe style="width: 100%;" border element-loading-text="拼命加载中">
<el-table-column label="操作者" align="center" width="110px">
<template slot-scope="scope">
{{ 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.实际加工时间段 }}
</template>
</el-table-column>
<el-table-column label="比例" align="center">
<template slot-scope="scope">
{{ scope.row.理论加工时间段===0 ? 0 : Math.round(scope.row.实际加工时间段 / scope.row.理论加工时间段 * 100) / 100.00 }}
</template>
</el-table-column>
</el-table>
</el-card>
<el-card>
<el-date-picker
v-model="startTime2"
value-format="yyyy-MM-dd"
size="small"
style="width: 170px;margin:0px 10px"
type="date"
placeholder="选择开始日期"/>
<span class="demonstration">~</span>
<el-date-picker
v-model="endTime2"
value-format="yyyy-MM-dd"
size="small"
style="width: 170px;margin:0px 10px"
type="date"
placeholder="选择结束日期"/>
<el-button type="success" class="el-icon-search" size="small" style="margin:0px 10px" @click="searchTable2();">查询</el-button>
</el-card>
<el-card>
<el-table v-loading="loading2" :data="tableData2" height="380" size="mini" stripe style="width: 100%;" border element-loading-text="拼命加载中">
<el-table-column label="姓名" align="center" width="110px">
<template slot-scope="scope">
{{ 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.零件名称 }}
</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.工艺名称 }}
</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.单件定额工时 }}
</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.理论加工时间段 }}
</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.理论加工时间段 }}
</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.实际加工时间段 }}
</template>
</el-table-column>
</el-table>
</el-card>
</div>
</template>
<script>
import { searchtable, searchTable2 } from '@/api/ManufacturingCenter/ManHourStatistics'
export default {
data() {
return {
workerName: '',
startTime: '',
endTime: '',
loading: false,
tableData: [], // 表格数据
total: null, // 总条数
startTime2: '',
endTime2: '',
loading2: false,
tableData2: [], // 表格数据
total2: null, // 总条数
pageSize: 100000, // 每页显示条数
pageCurrent: 1 // 后台获取页
}
},
created() {
this.searchTable()
},
methods: {
// 查询表格数据
searchTable() {
this.loading = true
this.tableData = []
if (this.startTime && this.endTime) {
this.timeCheck = 1
} else {
this.startTime = ''
this.endTime = ''
this.timeCheck = 0
}
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 => {
this.tableData = response.data
this.loading = false
})
},
searchTable2() {
this.loading2 = true
this.tableData2 = []
this.total2 = 0
if (this.startTime && this.endTime) {
this.timeCheck = 1
} else {
this.startTime = ''
this.endTime = ''
this.timeCheck = 0
}
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 => {
console.log(response.data)
this.total2 = response.data.length
this.tableData2 = response.data
this.loading2 = false
})
},
// 分页
handleSizeChange(val) {
this.pageCurrent = 1
this.pageSize = val
this.searchTable()
},
handleCurrentChange(val) {
this.pageCurrent = val
this.searchTable()
}
}
}
</script>
<style scoped>
</style>