This commit is contained in:
liushuai
2020-02-18 08:49:55 +08:00
parent ff571c4e45
commit 97d67c9876
4 changed files with 96 additions and 46 deletions

View File

@@ -51,46 +51,61 @@
{{ scope.row.工序名 }}
</template>
</el-table-column>
<el-table-column label="计划件数" align="center" width="70">
<el-table-column label="计划件数" align="center" width="80">
<template slot-scope="scope">
{{ scope.row.计划数量 }}
</template>
</el-table-column>
<el-table-column label="计划准结(分)" align="center" width="120">
<el-table-column label="计划准结(分)" align="center" width="110">
<template slot-scope="scope">
{{ scope.row.计划准备工时 }}
</template>
</el-table-column>
<el-table-column label="计划定额(分)" align="center" width="120">
<el-table-column label="计划定额(分)" align="center" width="110">
<template slot-scope="scope">
{{ scope.row.单件计划工时 }}
</template>
</el-table-column>
<el-table-column label="计划工时(分)" align="center" prop="计划工时" width="100">
<el-table-column label="计划工时(分)" align="center" prop="计划工时" width="110">
<template slot-scope="scope">
{{ scope.row.计划工时 }}
</template>
</el-table-column>
<el-table-column label="计划加工日期" align="center" width="100">
<el-table-column label="计划加工日期" align="center" width="110">
<template slot-scope="scope">
{{ scope.row.计划加工日期 }}
</template>
</el-table-column>
<el-table-column label="加工件数" align="center" width="70">
<el-table-column label="加工件数" align="center" width="80">
<template slot-scope="scope">
{{ scope.row.加工数量 }}
</template>
</el-table-column>
<el-table-column label="录入准结(分)" align="center" width="120">
<el-table-column label="录入准结(分)" align="center" width="110">
<template slot-scope="scope">
{{ scope.row.加工准备工时 }}
</template>
</el-table-column>
<el-table-column label="加工工时(分)" align="center" prop="加工工时" width="100">
<el-table-column label="加工工时(分)" align="center" prop="加工工时" width="110">
<template slot-scope="scope">
{{ scope.row.加工工时 }}
</template>
</el-table-column>
<el-table-column label="扫码工时(分)" align="center" prop="扫码工时" width="110">
<template slot-scope="scope">
{{ scope.row.扫码工时 }}
</template>
</el-table-column>
<el-table-column label="辅助工时(分)" align="center" prop="辅助工时" width="110">
<template slot-scope="scope">
{{ scope.row.辅助工时 }}
</template>
</el-table-column>
<el-table-column label="工时比值" align="center" width="100">
<template slot-scope="scope">
{{ scope.row.工时比值 }}
</template>
</el-table-column>
<el-table-column label="加工日期" align="center" width="100">
<template slot-scope="scope">
{{ scope.row.加工日期 }}
@@ -162,11 +177,14 @@ export default {
计划数量: response.data[i].批次数量,
计划准备工时: response.data[i].准结定额工时,
单件计划工时: response.data[i].单件定额工时,
计划工时: Number(response.data[i].批次数量) * (Number(response.data[i].单件定额工时) + Number(response.data[i].准结定额工时)),
计划工时: response.data[i].计划工时,
计划加工日期: response.data[i].计划日期.split(' ')[0],
加工数量: response.data[i].完成数量,
加工准备工时: response.data[i].修补准结工时,
加工工时: response.data[i].设备工时,
扫码工时: response.data[i].扫码工时,
辅助工时: response.data[i].辅助工时,
工时比值: Number(response.data[i].计划工时) === 0 ? 0 : Math.round(response.data[i].扫码工时 / Number(response.data[i].计划工时) * 100) / 100.00,
加工日期: response.data[i].操作时间,
图号及规格: response.data[i].零件图号_零件工艺计划,
制品名称: response.data[i].零件名称
@@ -190,8 +208,8 @@ export default {
return
}
import('@/vendor/Export2Excel').then(excel => {
const tHeader = ['跟单号', '工序', '工序名', '计划件数', '计划准结(分)', '计划定额(分)', '计划工时(分)', '计划加工日期', '加工件数', '录入准结(分)', '加工工时(分)', '加工日期', '图号及规格', '制品名称']
const filterVal = ['跟单号', '序号', '工序名', '计划数量', '计划准备工时', '单件计划工时', '计划工时', '计划加工日期', '加工数量', '加工准备工时', '加工工时', '加工日期', '图号及规格', '制品名称']
const tHeader = ['跟单号', '工序', '工序名', '计划件数', '计划准结(分)', '计划定额(分)', '计划工时(分)', '计划加工日期', '加工件数', '录入准结(分)', '加工工时(分)', '扫码工时(分)', '辅助工时(分)', '工时比值', '加工日期', '图号及规格', '制品名称']
const filterVal = ['跟单号', '序号', '工序名', '计划数量', '计划准备工时', '单件计划工时', '计划工时', '计划加工日期', '加工数量', '加工准备工时', '加工工时', '扫码工时', '辅助工时', '工时比值', '加工日期', '图号及规格', '制品名称']
const list = this.tableData
const data = this.formatJson(filterVal, list)
excel.export_json_to_excel({

View File

@@ -1,6 +1,6 @@
<template>
<div class="app-container">
<el-card style="width: 585px;">
<el-card style="width: 685px;">
<el-date-picker
v-model="startTime"
value-format="yyyy-MM-dd"
@@ -16,31 +16,41 @@
style="width: 170px;margin:0px 10px"
type="date"
placeholder="选择结束日期"/>
<el-button type="success" class="el-icon-search" 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-button type="primary" size="small" icon="el-icon-download" @click="exportTable()">导出</el-button>
<el-button type="primary" size="small" plain icon="el-icon-download" @click="exportTable()">导出</el-button>
</el-tooltip>
</el-card>
<el-card style="width: 585px">
<el-table v-loading="loading" :data="tableData" size="mini" stripe style="width: 585px" height="650px" border element-loading-text="拼命加载中">
<el-card style="width: 685px">
<el-table v-loading="loading" :data="tableData" size="mini" stripe style="width: 685px" height="650px" 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">
<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">
{{ scope.row.实际工时 }}
</template>
</el-table-column>
<el-table-column label="比例" align="center">
<el-table-column label="扫码工时(分)" align="center">
<template slot-scope="scope">
{{ scope.row.比例 }}
{{ 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>
@@ -175,7 +185,7 @@ export default {
}
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.$set(v, '工时比值', v.计划工时 === 0 ? 0 : Math.round(v.扫码工时 / v.计划工时 * 100) / 100.00)
})
this.tableData = response.data
this.loading = false
@@ -184,11 +194,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,

View File

@@ -42,22 +42,37 @@
{{ scope.row.工艺名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="录入准结(分)" width="100px">
<el-table-column align="center" label="录入准结(分)" width="110px">
<template slot-scope="scope">
{{ scope.row.修补准结工时 }}
</template>
</el-table-column>
<el-table-column align="center" label="加工工时(分)" width="100px">
<el-table-column align="center" label="加工工时(分)" width="110px">
<template slot-scope="scope">
{{ scope.row.设备工时 }}
</template>
</el-table-column>
<el-table-column align="center" label="合格件数" width="70px">
<el-table-column align="center" label="扫码工时(分)" width="110px">
<template slot-scope="scope">
{{ scope.row.扫码工时 }}
</template>
</el-table-column>
<el-table-column align="center" label="辅助工时(分)" width="110px">
<template slot-scope="scope">
{{ scope.row.辅助工时 }}
</template>
</el-table-column>
<el-table-column align="center" label="工时比值" width="100px">
<template slot-scope="scope">
{{ scope.row.工时比值 }}
</template>
</el-table-column>
<el-table-column align="center" label="合格件数" width="80px">
<template slot-scope="scope">
{{ scope.row.合格数量 }}
</template>
</el-table-column>
<el-table-column align="center" label="废品件数" width="70px">
<el-table-column align="center" label="废品件数" width="80px">
<template slot-scope="scope">
{{ scope.row.不合格数量 }}
</template>
@@ -72,17 +87,17 @@
{{ scope.row.操作时间 }}
</template>
</el-table-column>
<el-table-column align="center" label="计划准结(分)" width="100px">
<el-table-column align="center" label="计划准结(分)" width="110px">
<template slot-scope="scope">
{{ scope.row.准结定额工时 }}
</template>
</el-table-column>
<el-table-column align="center" label="计划定额(分)" width="100px">
<el-table-column align="center" label="计划定额(分)" width="110px">
<template slot-scope="scope">
{{ scope.row.单件定额工时 }}
</template>
</el-table-column>
<el-table-column align="center" label="计划工时(分)" width="100px">
<el-table-column align="center" label="计划工时(分)" width="110px">
<template slot-scope="scope">
{{ scope.row.计划工时 }}
</template>
@@ -138,8 +153,8 @@ export default {
return
}
import('@/vendor/Export2Excel').then(excel => {
const tHeader = ['日期', '姓名', '图号', '跟单号', '工序', '工序名', '录入准结(分)', '实际工时(分)', '合格件数', '废品件数', '备注', '计划准结(分)', '计划定额(分)', '计划工时(分)', '项目名称', '机床图号', '组号', '设计', '材料']
const filterVal = ['操作时间', '姓名', '零件图号_零件工艺计划', '跟单号', '工序顺序', '工艺名称', '修补准结工时', '设备工时', '合格数量', '不合格数量', '备注', '准结定额工时', '单件定额工时', '计划工时', '项目名称', '机床图号', '组号', '设计者', '材料']
const tHeader = ['日期', '姓名', '图号', '跟单号', '工序', '工序名', '录入准结(分)', '实际工时(分)', '扫码工时(分)', '辅助工时(分)', '工时比值', '合格件数', '废品件数', '备注', '计划准结(分)', '计划定额(分)', '计划工时(分)', '项目名称', '机床图号', '组号', '设计', '材料']
const filterVal = ['操作时间', '姓名', '零件图号_零件工艺计划', '跟单号', '工序顺序', '工艺名称', '修补准结工时', '设备工时', '扫码工时', '辅助工时', '工时比值', '合格数量', '不合格数量', '备注', '准结定额工时', '单件定额工时', '计划工时', '项目名称', '机床图号', '组号', '设计者', '材料']
const list = this.tableData
const data = this.formatJson(filterVal, list)
excel.export_json_to_excel({
@@ -155,6 +170,9 @@ export default {
if (this.startTime[0] && this.startTime[1]) {
this.loading = true
searchTable(this.startTime[0], this.startTime[1]).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
})

View File

@@ -164,7 +164,7 @@
<el-button v-if="isShow1" type="success" size="small" icon="el-icon-tickets" style="margin-left: 1px;margin-right: 1px" plain @click="copyAndSave">
复制并保存
</el-button>
<el-button :disabled="disabled" type="success" size="small" icon="el-icon-tickets" plain @click="saveApprove">保存
<el-button :loading="loading" :disabled="disabled" type="success" size="small" icon="el-icon-tickets" plain @click="saveApprove">保存
</el-button>
</el-button-group>
<el-button v-if="!isShow1" type="warning" size="small" icon="el-icon-tickets" @click="saveCompiled">记录修改备注</el-button>
@@ -558,6 +558,7 @@ export default {
dialogMateria2: false,
prepareMateriel: '',
lastFocusText: '',
loading: false,
Result1: '',
Result2: '',
Result3: '',
@@ -1206,6 +1207,7 @@ export default {
this.batchNum = response.data[0].批次数量
this.material = response.data[0].材料流水号
this.materialName = response.data[0].材料
this.Specifications = response.data[0].规格
this.spec = response.data[0].原材料规格
this.工艺是否更改 = response.data[0].工艺是否更改
if (response.data[0].重量 === null) {
@@ -1524,19 +1526,21 @@ export default {
flag++
if (flag === this.tableData.length) {
TableAddLi1(this.partNumValue, this.CraftmenValue).then(() => {
TableAddLi2(this.partNumValue)
this.checked = false
this.partNumValue = ''
this.typeValue = ''
this.Specifications = ''
this.partName = ''
this.batchNum = ''
this.material = ''
this.materialName = ''
this.spec = ''
this.newNum = ''
this.searchPartsByMachineGroup()
this.$message.success('保存成功')
TableAddLi2(this.partNumValue).then(() => {
this.loading = false
this.checked = false
this.partNumValue = ''
this.typeValue = ''
this.Specifications = ''
this.partName = ''
this.batchNum = ''
this.material = ''
this.materialName = ''
this.spec = ''
this.newNum = ''
this.searchPartsByMachineGroup()
this.$message.success('保存成功')
})
})
}
})