加工工时统计

This commit is contained in:
jiangfuzhuang
2019-06-01 20:04:51 +08:00
parent 1d7a814259
commit 72267ae710
2 changed files with 79 additions and 16 deletions

View File

@@ -13,6 +13,18 @@ export function searchtable(num1, num2, num3, num4, num5, pageCurrent, pageSize)
}
})
}
// 查询人员总工工时
export function searchtable11(num1, num2, num3, num4, num5) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '车间生产管理工艺_工时统计_查询数据2',
param: '操作者_check=' + num1 + '&姓名=' + num2 + '&时间_check=' + num3 + '&开始时间=' + num4 + '&结束时间=' + num5
}
})
}
// 查询人员具体工序
export function searchtable2(num1, num2, num3, num4, pageCurrent, pageSize) {
return request({
@@ -62,6 +74,18 @@ export function searchtable4(num1, num2, pageCurrent, pageSize) {
}
})
}
// 车间生产管理工艺_工时统计_机床查询_查询数据
export function searchtable44(num1, num2) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '车间生产管理工艺_工时统计_机床查询_查询数据',
param: '机床流水号_check=' + num1 + '&机床流水号=' + num2
}
})
}
// 车间生产管理工艺_工时统计_组号查询_查询数据
export function searchtable5(num1, pageCurrent, pageSize) {
return request({

View File

@@ -107,7 +107,7 @@
</el-card>
<el-card>
<span>机床编号:</span>
<el-select v-model="machineNumberValue" filterable placeholder="机床编号" size="small" clearable @change="searchTable4()">
<el-select v-model="machineNumberValue" filterable placeholder="机床编号" size="small" clearable @change="searchTable4();searchTable6()">
<el-option
v-for="item in machineNumber"
:key="item.value"
@@ -117,7 +117,8 @@
<div style="float: right; color: #8492a6; font-size: 13px">{{ item.name }}</div>
</el-option>
</el-select>
<el-button type="primary" size="small" icon="el-icon-download" style="margin-left:10px" @click="exportUninquirySheet2()">导出</el-button>
<el-button type="primary" size="small" icon="el-icon-download" style="margin-left:10px" @click="exportUninquirySheet2()">机床导出</el-button>
<el-button type="primary" size="small" icon="el-icon-download" style="margin-left:10px" @click="exportUninquirySheet3()">组件导出</el-button>
</el-card>
<el-card>
<el-col :span="6">
@@ -187,7 +188,7 @@
</div>
</template>
<script>
import { searchtable, searchtable2, searchtable4, searchtable5, initProject, searchtable55, searchtable22 } from '@/api/ManufacturingCenter/machiningHoursStatistics'
import { searchtable, searchtable2, searchtable4, searchtable5, initProject, searchtable55, searchtable11, searchtable44 } from '@/api/ManufacturingCenter/machiningHoursStatistics'
export default {
data() {
@@ -229,10 +230,10 @@ export default {
},
methods: {
// 导出
exportUninquirySheet2() {
searchtable55(this.machinenumber).then(res1 => {
if (res1.length === 0) {
this.$message.error('请选择人员')
exportUninquirySheet3() {
searchtable55(this.machineNumberValue).then(res1 => {
if (res1.data.length === 0) {
this.$message.error('请选择机床')
return
}
import('./Export2Excel').then(excel => {
@@ -254,24 +255,62 @@ export default {
})
},
// 导出
exportUninquirySheet1() {
searchtable22(this.gongzuozhebianhao, this.timeCheck, this.startTime, this.endTime).then(res1 => {
if (res1.length === 0) {
exportUninquirySheet2() {
if (this.machineNumberValue !== '' && this.machineNumberValue !== null) { this.check1 = 1 } else { this.check1 = 0 }
searchtable44(0, this.machineNumberValue).then(res1 => {
if (res1.data.length === 0) {
this.$message.error('请选择机床')
return
}
import('./Export2Excel').then(excel => {
const filterVal1 = ['零件图号', '零件名称', '工艺名称', '完成数量', '理论加工时间段', '实际加工时间段', '加工完成时间'] // tableData1里的属性名
const filterVal1 = ['机床图号', '理论加工时间段', '实际加工时间段'] // tableData1里的属性名
const data1 = res1.data.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,
dataGroup: dataGroup,
sheetGroup: sheetGroup,
filename: this.personname + '_工时明细表',
filename: '机床工时明细表',
autoWidth: true,
bookType: 'xlsx'
})
})
})
},
// 导出
exportUninquirySheet1() {
if (this.startTime !== '' && this.startTime !== null && this.endTime !== null && this.endTime !== null) {
this.timeCheck = 1
} else {
this.startTime = ''
this.endTime = ''
this.timeCheck = 0
}
if (this.workerName !== '' && this.workerName !== null) {
this.workerName_ckeck = 1
} else {
this.workerName_ckeck = 0
}
searchtable11(this.workerName_ckeck, this.workerName, this.timeCheck, this.startTime, this.endTime).then(res1 => {
if (res1.data.length === 0) {
this.$message.error('请选择人员')
return
}
import('./Export2Excel').then(excel => {
const filterVal1 = ['姓名', '理论加工时间段', '实际加工时间段'] // tableData1里的属性名
const data1 = res1.data.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'
})
@@ -371,8 +410,8 @@ export default {
this.loading4 = true
this.tableData4 = []
this.pageCurrent4 = 1
this.machinenumber = row.机床流水号
searchtable5(this.machinenumber, this.pageCurrent4, this.pageSize4).then(response => {
this.machineNumberValue = parseInt(row.机床流水号)
searchtable5(this.machineNumberValue, this.pageCurrent4, this.pageSize4).then(response => {
if (response.data.total === 0) {
this.loading4 = false
} else {
@@ -386,7 +425,7 @@ export default {
searchTable6(row) {
this.loading4 = true
this.tableData4 = []
searchtable5(this.machinenumber, this.pageCurrent4, this.pageSize4).then(response => {
searchtable5(this.machineNumberValue, this.pageCurrent4, this.pageSize4).then(response => {
if (response.data.total === 0) {
this.loading4 = false
} else {