加工工时统计

This commit is contained in:
zhangdingyu
2019-03-22 15:49:23 +08:00
parent 822839a57d
commit 3ad5167b71
2 changed files with 200 additions and 6 deletions

View File

@@ -0,0 +1,28 @@
import request from '@/utils/request'
// 查询人员总工工时
export function searchtable(num1, num2, num3, pageCurrent, pageSize) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '车间生产管理工艺_工时统计_查询数据',
param: '时间_check=' + num1 + '&开始时间=' + num2 + '&结束时间=' + num3,
Pagination: pageCurrent + '&' + pageSize
}
})
}
// 查询人员具体工序
export function searchtable2(num1, num2, num3, num4, pageCurrent, pageSize) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '车间生产管理工艺_工时统计按人员查询_查询数据',
param: '工作者编号=' + num1 + '&时间_check=' + num2 + '&开始时间=' + num3 + '&结束时间=' + num4,
Pagination: pageCurrent + '&' + pageSize
}
})
}

View File

@@ -19,26 +19,192 @@
style="width: 160px"
type="date"
placeholder="选择日期"/>
<el-button type="success" class="el-icon-search" size="small" style="margin: 10px 0 0 10px" @click="pageCurrent=1;pageSize=10;total = 0;getTableData();">查询</el-button>
<el-button type="success" class="el-icon-search" size="small" style="margin: 10px 0 0 10px" @click="pageCurrent=1;total = 0;searchTable();">查询</el-button>
</el-row>
</el-card>
<el-card>
<el-col :span="7">
<el-table v-loading="loading" :data="tableData" highlight-current-row height="580" style="width: 100%;" border element-loading-text="拼命加载中" @row-click="searchTable2">
<el-table-column
label=" "
type="index"
align="center"
width="50"/>
<el-table-column label="操作者" align="center" width="150px">
<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>
<div style="margin: 10px">
<el-pagination
v-if="!loading"
:current-page="pageCurrent"
:page-size="pageSize"
:total="total"
layout="total, prev, pager, next"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"/>
</div>
</el-col>
<el-col :span="16" style="margin-left: 30px;">
<el-table v-loading="loading2" :data="tableData2" height="580" style="width: 100%;" border element-loading-text="拼命加载中">
<el-table-column
label=" "
type="index"
align="center"
width="50"/>
<el-table-column label="零件图号" align="center" width="150px">
<template slot-scope="scope">
{{ scope.row.零件图号 }}
</template>
</el-table-column>
<el-table-column label="零件名称" align="center" width="150px">
<template slot-scope="scope">
{{ scope.row.零件名称 }}
</template>
</el-table-column>
<el-table-column label="工艺名称" align="center" width="150px">
<template slot-scope="scope">
{{ scope.row.工艺名称 }}
</template>
</el-table-column>
<el-table-column label="工序工时" align="center" width="150px">
<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>
<div style="margin: 10px">
<el-pagination
v-if="!loading2"
:current-page="pageCurrent2"
:page-size="pageSize2"
:total="total2"
layout="total, prev, pager, next, jumper"
@size-change="handleSizeChange2"
@current-change="handleCurrentChange2"/>
</div>
</el-col>
</el-card>
</div>
</template>
<script>
import {} from '@/api/ManufacturingCenter/machiningHoursStatistics'
import { searchtable, searchtable2 } from '@/api/ManufacturingCenter/machiningHoursStatistics'
export default {
data() {
return {
startTime: '',
endTime: ''
endTime: '',
loading: false,
tableData: [], // 表格数据
total: null, // 总条数
pageSize: 20, // 每页显示条数
pageCurrent: 1, // 后台获取页
gongzuozhebianhao: '',
loading2: false,
tableData2: [], // 表格数据
total2: null, // 总条数
pageSize2: 20, // 每页显示条数
pageCurrent2: 1 // 后台获取页
}
},
created() {},
methods: {}
created() {
this.searchTable()
},
methods: {
// 查询表格数据
searchTable() {
this.loading = true
this.tableData = []
if (this.startTime !== '' && this.startTime !== null && this.endTime !== null && this.endTime !== null) {
this.timeCheck = 1
} else {
this.timeCheck = 0
}
searchtable(this.timeCheck, this.startTime, this.endTime, this.pageCurrent, this.pageSize).then(response => {
if (response.data.total === 0) {
this.loading = false
} else {
this.total = response.data.total
this.tableData = response.data.rows
}
}).then(() => {
this.loading = false
})
},
searchTable2(row) {
this.loading2 = true
this.tableData2 = []
this.pageCurrent2 = 1
this.gongzuozhebianhao = row.工作者编号
searchtable2(row.工作者编号, this.timeCheck, this.startTime, this.endTime, this.pageCurrent2, this.pageSize2).then(response => {
if (response.data.total === 0) {
this.loading2 = false
} else {
for (let i = 0; i < response.data.rows.length; i++) {
response.data.rows[i].完成日期 = response.data.rows[i].完成日期.split(' ')[0]
}
this.total2 = response.data.total
this.tableData2 = response.data.rows
}
}).then(() => {
this.loading2 = false
})
},
searchTable3(row) {
this.loading2 = true
this.tableData2 = []
searchtable2(this.gongzuozhebianhao, this.timeCheck, this.startTime, this.endTime, this.pageCurrent2, this.pageSize2).then(response => {
if (response.data.total === 0) {
this.loading2 = false
} else {
for (let i = 0; i < response.data.rows.length; i++) {
response.data.rows[i].完成日期 = response.data.rows[i].完成日期.split(' ')[0]
}
this.total2 = response.data.total
this.tableData2 = response.data.rows
}
}).then(() => {
this.loading2 = false
})
},
// 分页
handleSizeChange(val) {
this.pageCurrent = 1
this.pageSize = val
this.searchTable()
},
handleCurrentChange(val) {
this.pageCurrent = val
this.searchTable()
},
handleSizeChange2(val) {
this.pageCurrent2 = 1
this.pageSize2 = val
this.searchTable3()
},
handleCurrentChange2(val) {
this.pageCurrent2 = val
this.searchTable3()
}
}
}
</script>
<style scoped>
.el-card{
margin-bottom: 10px;
}
</style>