入库扫描
This commit is contained in:
@@ -7,7 +7,7 @@ export function searchTable(partnumber) {
|
|||||||
data: {
|
data: {
|
||||||
type: '1',
|
type: '1',
|
||||||
name: 'MES_机加工MES_库存管理_入库模块_零件基础信息查询_根据零件图号',
|
name: 'MES_机加工MES_库存管理_入库模块_零件基础信息查询_根据零件图号',
|
||||||
param: '工艺计划流水号=' + partnumber + '=string'
|
param: '工艺计划流水号=' + partnumber
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ export default {
|
|||||||
ace: 0,
|
ace: 0,
|
||||||
a: '',
|
a: '',
|
||||||
tableData: [],
|
tableData: [],
|
||||||
partNumber: '',
|
partNumber: [],
|
||||||
listLoading: false,
|
listLoading: false,
|
||||||
craftplannumber: '',
|
craftplannumber: '',
|
||||||
radio2: 3,
|
radio2: 3,
|
||||||
@@ -153,10 +153,12 @@ export default {
|
|||||||
},
|
},
|
||||||
// 根据图号查流水号并查表1
|
// 根据图号查流水号并查表1
|
||||||
getCraftNumber() {
|
getCraftNumber() {
|
||||||
this.partNumber = ''
|
this.partNumber = []
|
||||||
CraftNumber(this.Partpaint).then(response => {
|
CraftNumber(this.Partpaint).then(response => {
|
||||||
if (response.data.length > 0 && response.data[0].工艺计划流水号) {
|
for (let i = 0; i < response.data.length; i++) {
|
||||||
this.partNumber = response.data[0].工艺计划流水号
|
this.partNumber.push(
|
||||||
|
response.data[i].工艺计划流水号
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.getscantable()
|
this.getscantable()
|
||||||
@@ -166,50 +168,96 @@ export default {
|
|||||||
getPaint() {
|
getPaint() {
|
||||||
searchPartNumber(this.partNumber).then(response => {
|
searchPartNumber(this.partNumber).then(response => {
|
||||||
this.Partpaint = response.data[0].零件图号
|
this.Partpaint = response.data[0].零件图号
|
||||||
|
return this.Partpaint
|
||||||
|
}).then(() => {
|
||||||
|
this. getCraftNumber()
|
||||||
})
|
})
|
||||||
this.getscantable()
|
// this.getscantable()
|
||||||
},
|
},
|
||||||
// 根据流水号查询
|
// 根据流水号查询
|
||||||
getscantable() {
|
getscantable() {
|
||||||
if (this.partNumber === '' || this.partNumber === null) {
|
this.tableData = []
|
||||||
this.$message.error('请输入正确零件号')
|
if (this.partNumber.length === 0) {
|
||||||
|
this.$notify({
|
||||||
|
title: '警告',
|
||||||
|
message: '请输入正确的零件图号',
|
||||||
|
type: 'warning'
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
this.listLoading = true
|
this.listLoading = true
|
||||||
searchTable(this.partNumber).then(response => {
|
searchTable(this.partNumber).then(response => {
|
||||||
console.log(response.data)
|
if(response.data.length === 0) {
|
||||||
if (response.data.length === 0) {
|
|
||||||
this.listLoading = false
|
this.listLoading = false
|
||||||
this.$message.warning('该零件未加工完成')
|
this.$notify({
|
||||||
} else if (response.data[0].考核状态 === 8) {
|
title: '警告',
|
||||||
this.listLoading = false
|
message: '该零件未加工完成',
|
||||||
this.$message.warning('该零件已入库')
|
type: 'warning'
|
||||||
} else if (response.data[0].考核状态 === 9) {
|
})
|
||||||
this.listLoading = false
|
}else {
|
||||||
this.$message.warning('该零件已出库')
|
for (let i = 0; i < response.data.length; i++) {
|
||||||
} else if (response.data[0].考核状态 === 7) {
|
if (response.data[i].考核状态 === 8) {
|
||||||
for (let i = 0; i < this.tableData.length; i++) {
|
this.listLoading = false
|
||||||
if (response.data[0].工艺计划流水号 === this.tableData[i].工艺计划流水号) {
|
this.$notify({
|
||||||
this.ace = this.ace + 1
|
title: '警告',
|
||||||
|
message: 'P' + response.data[i].工艺计划流水号 + '已入库',
|
||||||
|
type: 'warning'
|
||||||
|
})
|
||||||
|
} else if (response.data[i].考核状态 === 9) {
|
||||||
|
this.listLoading = false
|
||||||
|
this.$notify({
|
||||||
|
title: '警告',
|
||||||
|
message: 'P' + response.data[i].工艺计划流水号 + '已出库',
|
||||||
|
type: 'warning'
|
||||||
|
})
|
||||||
|
} else if (response.data[i].考核状态 === 7) {
|
||||||
|
this.listLoading = false
|
||||||
|
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].零件图号
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
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('此件已在列表中')
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 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
|
// this.ace = 0
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user