Files
JY1.0/src/views/ManufacturingCenter/ScheduleCompletionDetails/index.vue
zhangdingyu a25a3fa473 工时查询
2020-01-05 15:31:26 +08:00

202 lines
7.0 KiB
Vue

<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="pageCurrent=1;total = 0;searchTable();">查询</el-button>
</el-card>
<el-row>
<el-col :span="8">
<el-card>
<el-table v-loading="loading" :data="tableData" highlight-current-row size="mini" stripe style="width: 100%;" height="700px" border element-loading-text="拼命加载中" @row-click="searchTable2">
<el-table-column label="操作者" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.姓名 }}
</template>
</el-table-column>
<el-table-column label="计划工时" align="center" width="70px">
<template slot-scope="scope">
{{ scope.row.定额总工时 }}
</template>
</el-table-column>
<el-table-column label="设备工时" align="center" width="70px">
<template slot-scope="scope">
{{ scope.row.设备总工时 }}
</template>
</el-table-column>
<el-table-column label="扫码工时" align="center" width="70px">
<template slot-scope="scope">
{{ scope.row.扫码总工时 }}
</template>
</el-table-column>
<el-table-column label="修补准结工时" align="center" width="100px">
<template slot-scope="scope">
{{ scope.row.修补准结总工时 }}
</template>
</el-table-column>
<el-table-column label="完成数量" align="center" width="70px">
<template slot-scope="scope">
{{ scope.row.总数量 }}
</template>
</el-table-column>
</el-table>
<div>
<el-pagination
v-if="!loading"
:current-page="pageCurrent"
:page-size="pageSize"
:total="total"
layout="total"/>
</div>
</el-card>
</el-col>
<el-col :span="16">
<el-card>
<el-table v-loading="loading2" :data="tableData2" size="mini" stripe highlight-current-row style="width: 100%;" height="700px" border element-loading-text="拼命加载中">
<el-table-column label="零件图号" align="center" width="140px" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.零件图号 }}
</template>
</el-table-column>
<el-table-column label="零件名称" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.零件名称 }}
</template>
</el-table-column>
<el-table-column label="工艺名称" align="center" width="70px" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.工艺名称 }}
</template>
</el-table-column>
<el-table-column label="完成数" align="center" width="60px">
<template slot-scope="scope">
{{ scope.row.完成数量 }}
</template>
</el-table-column>
<el-table-column label="计划工时" align="center" width="70px">
<template slot-scope="scope">
{{ scope.row.工时总额 }}
</template>
</el-table-column>
<el-table-column label="设备工时" align="center" width="70px">
<template slot-scope="scope">
{{ scope.row.设备工时 }}
</template>
</el-table-column>
<el-table-column label="扫码工时" align="center" width="70px">
<template slot-scope="scope">
{{ scope.row.扫码工时 }}
</template>
</el-table-column>
<el-table-column label="修补准结工时" align="center" width="100px">
<template slot-scope="scope">
{{ scope.row.修补准结工时 }}
</template>
</el-table-column>
<el-table-column label="加工时间" align="center" width="135px">
<template slot-scope="scope">
{{ scope.row.操作时间 }}
</template>
</el-table-column>
</el-table>
<div>
<el-pagination
v-if="!loading2"
:current-page="pageCurrent2"
:page-size="pageSize2"
:total="total2"
layout="total"
@size-change="handleSizeChange2"
@current-change="handleCurrentChange2"/>
</div>
</el-card>
</el-col>
</el-row>
</div>
</template>
<script>
import { searchtable, searchtable2 } from '@/api/ManufacturingCenter/ScheduleCompletionDetails'
import { getNowTime, getNowTime1 } from '@/utils/tool'
export default {
data() {
return {
startTime: getNowTime1(), // 开始时间
endTime: getNowTime(), // 结束时间
tableData: [], // 操作者工时统计
loading: '',
tableData2: [], // 工序统计表
loading2: '',
pageCurrent: 1,
pageSize: 10000,
total: 0,
pageCurrent2: 1,
pageSize2: 10000,
total2: 0,
timeCheck: '',
operater: ''
}
},
created() {
this.searchTable()
},
methods: {
// 查询表格数据
searchTable() {
this.loading = true
this.tableData = []
this.tableData2 = []
this.total2 = 0
searchtable(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
searchtable2(row.人员编号, this.startTime, this.endTime, this.pageCurrent2, this.pageSize2).then(response => {
if (response.data.rows.length !== 0) {
this.tableData2 = response.data.rows
}
this.loading2 = false
this.total2 = response.data.total
})
},
handleSizeChange2(val) {
this.pageCurrent2 = 1
this.pageSize2 = val
this.searchTable2()
},
handleCurrentChange2(val) {
this.pageCurrent2 = val
this.searchTable2()
}
}
}
</script>
<style scoped>
</style>