自制件入库

This commit is contained in:
Vergil
2020-05-15 14:32:25 +08:00
parent ad91c0649d
commit 253675f77d

View File

@@ -204,27 +204,17 @@ export default {
this.listLoading = true this.listLoading = true
searchTable(this.partNumber).then(response => { searchTable(this.partNumber).then(response => {
console.log(response.data) console.log(response.data)
if (response.data.length === 0) { if (response.data[0].结果 === '成功' || response.data[0].结果 === '自动完成入库') {
this.listLoading = false
this.$notify({
title: '警告',
message: '该零件未加工',
type: 'warning'
})
} else {
console.log(response.data, 1233)
for (let i = 0; i < response.data.length; i++) {
if (response.data[i].考核状态 === 7) {
this.listLoading = false this.listLoading = false
this.tableData.push({ this.tableData.push({
plannumber: response.data[i].剩余数量, plannumber: response.data[0].剩余数量,
innumber: response.data[i].入库数量, innumber: response.data[0].入库数量,
capture: '', capture: '',
note: '', note: '',
工艺计划流水号: response.data[i].工艺计划流水号, 工艺计划流水号: response.data[0].工艺计划流水号,
项目名称: response.data[i].项目名称, 项目名称: response.data[0].项目名称,
机床图号: response.data[i].机床图号, 机床图号: response.data[0].机床图号,
零件图号: response.data[i].零件图号 零件图号: response.data[0].零件图号
}) })
const hash = {} // 一个新数组data为你需要去重的数组newData用于接收去重后的数组, curVal.去重条件 const hash = {} // 一个新数组data为你需要去重的数组newData用于接收去重后的数组, curVal.去重条件
this.tableDataNum = this.tableData.reduce((preVal, curVal) => { this.tableDataNum = this.tableData.reduce((preVal, curVal) => {
@@ -240,31 +230,26 @@ export default {
}) })
return preVal return preVal
}, []) }, [])
} else if (response.data[i].考核状态 === 6) { } else if (response.data[0].结果 === '未查到') {
this.$notify({ this.$notify({
title: '警告', title: '警告',
message: 'P' + response.data[i].工艺计划流水号 + '未加工完成', message: '跟单号有误',
type: 'warning' type: 'warning'
}) })
} else if (response.data[i].考核状态 === 8) { } else if (response.data[0].结果 === '未完成') {
this.$notify({ this.$notify({
title: '警告', title: '警告',
message: 'P' + response.data[i].工艺计划流水号 + '已入库', message: '此零件未加工完成',
type: 'warning' type: 'warning'
}) })
} else if (response.data[i].考核状态 === 9) { } else if (response.data[0].结果 === '已入库') {
this.$notify({ this.$notify({
title: '警告', title: '警告',
message: 'P' + response.data[i].工艺计划流水号 + '已出库', message: '此零件已入库',
type: 'warning' type: 'warning'
}) })
} }
}
}
}).then(() => { }).then(() => {
// if (this.finishParts.length > 0) {
// this.dialogFormVisible = true
// }
this.listLoading = false this.listLoading = false
}) })
}, },