基本件出库
This commit is contained in:
@@ -9,7 +9,7 @@
|
|||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<el-card>
|
<el-card>
|
||||||
<el-table v-loading="listLoading" :data="tableData" border size="mini" style="width: 100%" height="650px">
|
<el-table v-loading="listLoading" :data="tableDataNum" border size="mini" style="width: 100%" height="650px">
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="序号"
|
label="序号"
|
||||||
align="center"
|
align="center"
|
||||||
@@ -32,12 +32,12 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="计划数量" align="center" min-width="100">
|
<el-table-column label="计划数量" align="center" min-width="100">
|
||||||
<template slot-scope="scope" align="center">
|
<template slot-scope="scope" align="center">
|
||||||
{{ tableData[scope.$index].plannumber }}
|
{{ tableDataNum[scope.$index].plannumber }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="入库数量" align="center" min-width="100">
|
<el-table-column label="入库数量" align="center" min-width="100">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-input v-model="tableData[scope.$index].innumber" clearable size="mini"/>
|
<el-input v-model="tableDataNum[scope.$index].innumber" clearable size="mini"/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="仓库" align="center" min-width="100">
|
<el-table-column label="仓库" align="center" min-width="100">
|
||||||
@@ -101,7 +101,8 @@ export default {
|
|||||||
inventoryNumber: '',
|
inventoryNumber: '',
|
||||||
locateName: [], // 货位名称下拉框
|
locateName: [], // 货位名称下拉框
|
||||||
locateNumber: '',
|
locateNumber: '',
|
||||||
Partpaint: ''
|
Partpaint: '',
|
||||||
|
tableDataNum: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -118,6 +119,7 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
// 移除
|
// 移除
|
||||||
handleDelete(index, row) {
|
handleDelete(index, row) {
|
||||||
|
this.tableDataNum.splice(index, 1)
|
||||||
this.tableData.splice(index, 1)
|
this.tableData.splice(index, 1)
|
||||||
},
|
},
|
||||||
// 获取人员编号
|
// 获取人员编号
|
||||||
@@ -176,7 +178,7 @@ export default {
|
|||||||
},
|
},
|
||||||
// 根据流水号查询
|
// 根据流水号查询
|
||||||
getscantable() {
|
getscantable() {
|
||||||
this.tableData = []
|
// this.tableData = []
|
||||||
if (this.partNumber.length === 0) {
|
if (this.partNumber.length === 0) {
|
||||||
this.$notify({
|
this.$notify({
|
||||||
title: '警告',
|
title: '警告',
|
||||||
@@ -212,52 +214,34 @@ export default {
|
|||||||
} else if (response.data[i].考核状态 === 7) {
|
} else if (response.data[i].考核状态 === 7) {
|
||||||
this.listLoading = false
|
this.listLoading = false
|
||||||
this.tableData.push({
|
this.tableData.push({
|
||||||
plannumber: response.data[0].剩余数量,
|
plannumber: response.data[i].剩余数量,
|
||||||
innumber: response.data[0].入库数量,
|
innumber: response.data[i].入库数量,
|
||||||
capture: '',
|
capture: '',
|
||||||
note: '',
|
note: '',
|
||||||
工艺计划流水号: response.data[0].工艺计划流水号,
|
工艺计划流水号: response.data[i].工艺计划流水号,
|
||||||
项目名称: response.data[0].项目名称,
|
项目名称: response.data[i].项目名称,
|
||||||
机床图号: response.data[0].机床图号,
|
机床图号: response.data[i].机床图号,
|
||||||
零件图号: response.data[0].零件图号
|
零件图号: response.data[i].零件图号
|
||||||
})
|
})
|
||||||
|
let hash = {}; // 一个新数组,data为你需要去重的数组,newData用于接收去重后的数组, curVal.去重条件
|
||||||
|
this.tableDataNum = this.tableData.reduce((preVal, curVal) => {
|
||||||
|
hash[curVal.工艺计划流水号] ? '' : hash[curVal.工艺计划流水号] = true && preVal.push({
|
||||||
|
工艺计划流水号: curVal.工艺计划流水号,
|
||||||
|
项目名称: curVal.项目名称,
|
||||||
|
机床图号: curVal.机床图号,
|
||||||
|
零件图号: curVal.零件图号,
|
||||||
|
plannumber: curVal.plannumber,
|
||||||
|
innumber: curVal.innumber,
|
||||||
|
capture: '',
|
||||||
|
note: ''
|
||||||
|
});
|
||||||
|
return preVal
|
||||||
|
}, [])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (response.data.length === 0) {
|
|
||||||
// this.listLoading = false
|
|
||||||
// this.$message.warning('该零件未加工完成')
|
|
||||||
// } else if (response.data[0].考核状态 === 8) {
|
|
||||||
// this.listLoading = false
|
|
||||||
// this.$message.warning('该零件已入库')
|
|
||||||
// } else if (response.data[0].考核状态 === 9) {
|
|
||||||
// this.listLoading = false
|
|
||||||
// this.$message.warning('该零件已出库')
|
|
||||||
// } else if (response.data[0].考核状态 === 7) {
|
|
||||||
// for (let i = 0; i < this.tableData.length; i++) {
|
|
||||||
// if (response.data[0].工艺计划流水号 === this.tableData[i].工艺计划流水号) {
|
|
||||||
// this.ace = this.ace + 1
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// if (this.ace === 0) {
|
|
||||||
// this.tableData.push({
|
|
||||||
// plannumber: response.data[0].剩余数量,
|
|
||||||
// innumber: response.data[0].入库数量,
|
|
||||||
// capture: '',
|
|
||||||
// note: '',
|
|
||||||
// 工艺计划流水号: response.data[0].工艺计划流水号,
|
|
||||||
// 项目名称: response.data[0].项目名称,
|
|
||||||
// 机床图号: response.data[0].机床图号,
|
|
||||||
// 零件图号: response.data[0].零件图号
|
|
||||||
// })
|
|
||||||
// } else {
|
|
||||||
// this.$message.error('此件已在列表中')
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.listLoading = false
|
this.listLoading = false
|
||||||
// this.ace = 0
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -271,14 +255,14 @@ export default {
|
|||||||
if (this.locateNumber === '') {
|
if (this.locateNumber === '') {
|
||||||
this.$message.error('请选择货位')
|
this.$message.error('请选择货位')
|
||||||
} else {
|
} else {
|
||||||
for (let i = 0; i < this.tableData.length; i++) {
|
for (let i = 0; i < this.tableDataNum.length; i++) {
|
||||||
if (Number(this.tableData[i].innumber) === 0) {
|
if (Number(this.tableDataNum[i].innumber) === 0) {
|
||||||
this.$message.error('请输入正确数量')
|
this.$message.error('请输入正确数量')
|
||||||
} else {
|
} else {
|
||||||
if (this.tableData[i].innumber > this.tableData[i].plannumber) {
|
if (this.tableDataNum[i].innumber > this.tableDataNum[i].plannumber) {
|
||||||
this.tableData[i].innumber = this.tableData[i].plannumber
|
this.tableDataNum[i].innumber = this.tableDataNum[i].plannumber
|
||||||
}
|
}
|
||||||
insertOne(this.tableData[i].工艺计划流水号, this.tableData[i].innumber, this.PeopleNumber, this.tableData[i].capture, this.inventoryNumber, this.locateNumber, this.tableData[i].note).then(response => {
|
insertOne(this.tableDataNum[i].工艺计划流水号, this.tableDataNum[i].innumber, this.PeopleNumber, this.tableDataNum[i].capture, this.inventoryNumber, this.locateNumber, this.tableDataNum[i].note).then(response => {
|
||||||
if (response.data[0].result === '1') {
|
if (response.data[0].result === '1') {
|
||||||
this.$message({
|
this.$message({
|
||||||
type: 'success',
|
type: 'success',
|
||||||
@@ -305,6 +289,7 @@ export default {
|
|||||||
// 清空
|
// 清空
|
||||||
Empty() {
|
Empty() {
|
||||||
this.tableData = []
|
this.tableData = []
|
||||||
|
this.tableDataNum = []
|
||||||
this.Partpaint = ''
|
this.Partpaint = ''
|
||||||
},
|
},
|
||||||
// 仓库查询
|
// 仓库查询
|
||||||
|
|||||||
Reference in New Issue
Block a user