工时统计(工艺)

This commit is contained in:
zhangdingyu
2019-10-29 15:03:21 +08:00
parent 632240d90e
commit e35b2215d3
2 changed files with 341 additions and 104 deletions

View File

@@ -17,9 +17,12 @@
type="date"
placeholder="选择结束日期"/>
<el-button type="success" class="el-icon-search" size="small" style="margin:0px 10px" @click="searchTable();">查询</el-button>
<el-tooltip :open-delay="1000" content="导出人员工时统计表" placement="right">
<el-button type="primary" size="small" icon="el-icon-download" style="margin:0px 10px" @click="exportTable()">导出</el-button>
</el-tooltip>
</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 v-loading="loading" :data="tableData" height="700" size="mini" stripe style="width: 800px" border element-loading-text="拼命加载中">
<el-table-column label="操作者" align="center" width="110px">
<template slot-scope="scope">
{{ scope.row.姓名 }}
@@ -37,98 +40,100 @@
</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.实际加工时间段 }}
{{ scope.row.比例 }}
</template>
</el-table-column>
</el-table>
</el-card>
<div v-show="false">
<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>
</div>
</template>
<script>
@@ -142,14 +147,10 @@ export default {
endTime: '',
loading: false,
tableData: [], // 表格数据
total: null, // 总条数
startTime2: '',
endTime2: '',
loading2: false,
tableData2: [], // 表格数据
total2: null, // 总条数
pageSize: 100000, // 每页显示条数
pageCurrent: 1 // 后台获取页
tableData2: [] // 表格数据
}
},
created() {
@@ -173,10 +174,32 @@ export default {
this.workerName_ckeck = 0
}
searchtable(this.workerName_ckeck, this.workerName, this.timeCheck, this.startTime, this.endTime).then(response => {
response.data.map(v => {
this.$set(v, '比例', v.理论加工时间段 === 0 ? 0 : Math.round(v.实际加工时间段 / v.理论加工时间段 * 100) / 100.00)
})
this.tableData = response.data
this.loading = false
})
},
// 导出
exportTable() {
import('./Export2Excel').then(excel => {
const filterVal1 = ['姓名', '理论加工时间段', '实际加工时间段', '比例']
const data1 = this.tableData.map(v => filterVal1.map(j => v[j]))
const dataGroup = []
dataGroup.push(data1)
const headerGroup = [['操作者', '计划工时', '加工工时', '比例']]
const sheetGroup = ['工时统计表']
excel.export_json_to_excel({
headerGroup: headerGroup,
dataGroup: dataGroup,
sheetGroup: sheetGroup,
filename: '工时统计表',
autoWidth: true,
bookType: 'xlsx'
})
})
},
searchTable2() {
this.loading2 = true
this.tableData2 = []
@@ -199,16 +222,6 @@ export default {
this.tableData2 = response.data
this.loading2 = false
})
},
// 分页
handleSizeChange(val) {
this.pageCurrent = 1
this.pageSize = val
this.searchTable()
},
handleCurrentChange(val) {
this.pageCurrent = val
this.searchTable()
}
}
}