This commit is contained in:
Vergil
2020-02-14 15:18:43 +08:00
parent e8eeade817
commit 1895977eb2
25 changed files with 1304 additions and 738 deletions

View File

@@ -1,8 +1,7 @@
<template>
<div class="app-container">
<div>
<el-card>
<!--<el-button :disabled="isShow" type="info" size="small" style="margin: 0px 180px;float: right" @click="EditData">补录完成日期</el-button>-->
<el-button :disabled="isDisabled" type="info" size="small" style="margin: 0px 180px;float: right" @click="EditConfirmNum">修改完成数量</el-button>
<el-select v-model="Machine" filterable clearable size="small" style="margin:0px 10px 0px 10px;width: 185px;" placeholder="机床号" @change="getGroup">
<el-option
v-for="item in Machines"
@@ -23,6 +22,8 @@
<el-input v-model="number" placeholder="零件号" clearable size="small" style="width: 170px;margin:0px 10px;"/>
<el-button type="primary" class="el-icon-search" size="small" plain style="margin: 0px 10px;" @click="pageCurrent = 1;pageSize = 100;getTableData()">查询</el-button>
<el-button type="warning" class="el-icon-download" size="small" plain style="margin: 10px 0 0 10px" @click="exportExcel">导出</el-button>
<!--<el-button :disabled="isDisabled" type="info" size="small" style="margin: 10px 10px;float: right" @click="EditConfirmNum">修改完成数量</el-button>-->
<el-button :disabled="isDisabled" type="info" size="small" style="margin: 10px 10px;float: right" @click="EditWorkingHours">修补加工工时</el-button>
</el-card>
<el-row>
<el-col style="width: 37%">
@@ -74,6 +75,7 @@
<el-col style="width: 63%">
<el-card>
<el-table
ref="singleTable"
:data="tableData"
:row-class-name="tableRowClassName"
loading="loading"
@@ -82,11 +84,11 @@
border
height="630"
@row-click="getCurrentRow">
<el-table-column type="index" align="center" label="跟单号" width="140">
<template slot-scope="scope">
<el-radio :label="scope.row.跟单号" v-model="radio"/>
</template>
</el-table-column>
<!--<el-table-column type="index" align="center" label="跟单号" width="140">-->
<!--<template slot-scope="scope">-->
<!--<el-radio :label="scope.row.跟单号" v-model="radio"/>-->
<!--</template>-->
<!--</el-table-column>-->
<el-table-column align="center" label="零件图号" show-overflow-tooltip width="200">
<template slot-scope="scope">
{{ scope.row.零件图号 }}
@@ -231,16 +233,52 @@
<el-button type="primary" @click="submit2('form')" >确定</el-button>
</div>
</el-dialog>
<el-dialog :visible.sync="dialogFormVisible3" title="修补加工工时" center style="min-height: 300px" width="400px">
<el-form ref="form3" :model="form3" :rules="rules2" label-position="left" label-width="90px" class="demo-ruleForm">
<el-row width="200px">
<el-form-item label="操作员" prop="人员" >
<el-select v-model="form3.人员" filterable style="width: 80%" size="small" placeholder="无">
<el-option
v-for="item in person_Form3"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
<el-form-item label="完成数量" prop="完成数量" >
<el-input-number v-model="form3.完成数量" :min="0" :max="批次数量" size="small" style="width: 80%"/>
</el-form-item>
<el-form-item label="修补工时" prop="修补工时" >
<el-input v-model="form3.修补工时" placeholder="修补工时" size="small" style="width: 80%" />
</el-form-item>
<el-form-item label="完成日期" prop="完成时间">
<el-date-picker
v-model="form3.完成时间"
style="width: 80%"
size="small"
type="date"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
placeholder="选择日期"/>
</el-form-item>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible3=false">取消</el-button>
<el-button type="primary" @click="submit3('form3')" >确定</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { getMachines, getGroups, getTable, gettabledata1, getTree, fn, getTable8, submitEdit, getExport, searchWorkTime, submit2 } from '@/api/ManufacturingCenter/ProcessingStatusNew'
import Cookie from 'js-cookie'
import { getMachines, getGroups, getTable, gettabledata1, getTree, fn, getTable8, submitEdit, getExport, searchWorkTime, submit2, submitEdit3, getPerson_Form3 } from '@/api/ManufacturingCenter/ProcessingStatusNew'
export default {
data() {
return {
index: -1,
Machine: '', // 机床号
Machines: [],
Group: '', // 组号
@@ -289,14 +327,117 @@ export default {
数量: ''
},
操作者: [],
max: 0
max: 0,
// new 20200213修补加工工时↓
dialogFormVisible3: false,
person_Form3: [],
form3: {
人员: '',
完成数量: '',
修补工时: '',
完成时间: ''
},
rules2: {
人员: [{ required: true, message: '请选择操作员', trigger: 'change' }],
完成时间: [{ required: true, message: '请选择实际完成时间', trigger: 'change' }],
修补工时: [{ required: true, message: '请输入修补工时', trigger: 'blur' }],
完成数量: [{ required: true, message: '请输入完成数量', trigger: 'blur' }]
},
批次数量: 0
}
},
created() {
this.getMachine()
this.getTable9()
var _this = this
document.onkeydown = function(e) {
if (event.keyCode === 37 || event.keyCode === 38) {
_this.click_Up()
}
if (event.keyCode === 39 || event.keyCode === 40) {
_this.click_Down()
}
}
},
methods: {
click_Up() {
if (this.index === -1) {
console.log(-1)
} else {
this.index = this.index - 1
console.log(this.index)
this.$refs.singleTable.setCurrentRow(this.tableData[this.index])
this.批次数量 = this.tableData[this.index].批次数量
this.getCurrentRow_Click(this.tableData[this.index].工艺计划流水号)
}
},
click_Down() {
if (this.index === -1) {
console.log(-1)
} else {
this.index = this.index + 1
console.log(this.index)
this.$refs.singleTable.setCurrentRow(this.tableData[this.index])
this.批次数量 = this.tableData[this.index].批次数量
this.getCurrentRow_Click(this.tableData[this.index].工艺计划流水号)
}
},
getCurrentRow_Click(row) {
this.isDisabled = true
this.completeTime = ''
this.dateOfProduction = ''
this.processSerialNumber = ''
this.tableData1 = []
gettabledata1(row).then(response => {
if (response.data.length !== 0) {
for (let i = 0; i < response.data.length; i++) {
this.tableData1.push({
工艺名称: response.data[i].工艺名称,
序间质检: response.data[i].质检结果,
排产日期: response.data[i].排产时间 ? response.data[i].排产时间.split(' ')[0] : '',
完成日期: response.data[i].工序完成日期 ? response.data[i].工序完成日期.split(' ')[0] : '',
操作者: response.data[i].操作者,
不合格数量: response.data[i].不合格数量,
质检数量: response.data[i].数量,
工序流水号: response.data[i].工序流水号,
工序状态: response.data[i].工序状态,
完成数量: response.data[i].完成数量
})
}
}
})
},
EditWorkingHours() {
if (this.$refs['form3'] !== undefined) {
this.$refs['form3'].resetFields()
}
this.getPerson_Form3()
this.dialogFormVisible3 = true
},
getPerson_Form3() {
this.person_Form3 = []
getPerson_Form3().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.person_Form3.push({
label: response.data[i].姓名,
value: response.data[i].人员编号
})
}
}).then(() => {
this.form3.人员 = this.person_Form3[0].value
})
},
submit3() {
submitEdit3(this.processSerialNumber, this.form3.人员, this.form3.完成数量, this.form3.修补工时, this.form3.完成时间).then(response => {
if (response.data[0].result === '1') {
this.$message.success('补录成功')
} else {
this.$message.error('补录失败')
}
})
this.dialogFormVisible3 = false
this.getCurrentRow_Click(this.tableData[this.index].工艺计划流水号)
},
EditConfirmNum() {
this.form2.数量 = 0
this.操作者 = []
@@ -345,7 +486,6 @@ export default {
return
}
getExport(this.Machine).then(res => {
console.log(res.data)
import('@/vendor/Export2Excel').then(excel => {
const tHeader = ['机床', '组号', '图号及规格', '制品名称', '计划数', '材料', '当前工序名']
const filterVal = ['机床图号', '组号', '零件图号', '零件名称', '投产数量', '材料', '工艺名称']
@@ -362,50 +502,20 @@ export default {
})
},
getMachine() {
if (Cookie.get('machineValue') !== undefined) {
this.Machine = ''
this.Machines = []
this.Group = ''
this.Groups = []
getMachines().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.Machines.push({
label: response.data[i].机床,
value: response.data[i].机床流水号,
value2: response.data[i].项目名称
})
}
if (Cookie.get('group') !== undefined) {
this.Machine = parseInt(Cookie.get('machineValue'))
this.getGroup()
this.getTableData()
this.Group = parseInt(Cookie.get('group'))
// this.getTableData()
Cookie.remove('machineValue')
Cookie.remove('group')
} else {
// this.getTableData()
Cookie.remove('machineValue')
Cookie.remove('group')
}
})
} else {
this.Machine = ''
this.Machines = []
this.Group = ''
this.Groups = []
getMachines().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.Machines.push({
label: response.data[i].机床图号,
value: response.data[i].机床流水号,
value2: response.data[i].项目名称
})
}
})
this.getTableData()
}
}, // 获取组号
this.Machine = ''
this.Machines = []
this.Group = ''
this.Groups = []
getMachines().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.Machines.push({
label: response.data[i].机床图号,
value: response.data[i].机床流水,
value2: response.data[i].项目名称
})
}
})
},
getGroup() {
this.Group = ''
this.Groups = []
@@ -464,15 +574,16 @@ export default {
},
// 获取工序表
getCurrentRow(row) {
this.批次数量 = row.批次数量
this.index = row.index
this.row2 = row.工艺计划流水号
this.isDisabled = true
this.completeTime = ''
this.dateOfProduction = ''
this.processSerialNumber = ''
this.radio = true
this.tableData1 = []
this.row2 = row.工艺计划流水号
gettabledata1(this.row2).then(response => {
console.log(response.data)
if (response.data.length !== 0) {
for (let i = 0; i < response.data.length; i++) {
this.tableData1.push({