|
|
@ -326,7 +326,7 @@ |
|
|
<script> |
|
|
<script> |
|
|
import { mapGetters } from 'vuex' |
|
|
import { mapGetters } from 'vuex' |
|
|
import { |
|
|
import { |
|
|
getHandlingUnitDetail, |
|
|
|
|
|
|
|
|
scanHandlingUnitLabel, |
|
|
createNewHu, |
|
|
createNewHu, |
|
|
getHuContents, |
|
|
getHuContents, |
|
|
completePacking, |
|
|
completePacking, |
|
|
@ -381,11 +381,20 @@ export default { |
|
|
this.loading = true |
|
|
this.loading = true |
|
|
try { |
|
|
try { |
|
|
// 查询HU是否存在 |
|
|
// 查询HU是否存在 |
|
|
const response = await getHandlingUnitDetail({ |
|
|
|
|
|
|
|
|
// HU装载操作扫码增加立库绑定拦截,普通查看接口不变 - rqrq |
|
|
|
|
|
const response = await scanHandlingUnitLabel({ |
|
|
site: localStorage.getItem('site'), |
|
|
site: localStorage.getItem('site'), |
|
|
unitId: this.parentHuCode.trim() |
|
|
unitId: this.parentHuCode.trim() |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
// 绑定校验失败不是HU不存在,不允许误入创建分支 - rqrq |
|
|
|
|
|
if (!response.data || response.data.code !== 0) { |
|
|
|
|
|
this.parentHuInfo = null |
|
|
|
|
|
this.showCreateHuDialog = false |
|
|
|
|
|
this.$alert((response.data && response.data.msg) || '标签校验失败', '提示') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if (response.data.data) { |
|
|
if (response.data.data) { |
|
|
// HU已存在 |
|
|
// HU已存在 |
|
|
this.parentHuInfo = response.data.data |
|
|
this.parentHuInfo = response.data.data |
|
|
@ -417,11 +426,18 @@ export default { |
|
|
this.loading = true |
|
|
this.loading = true |
|
|
try { |
|
|
try { |
|
|
// 首先检查是否是子HU |
|
|
// 首先检查是否是子HU |
|
|
const huResponse = await getHandlingUnitDetail({ |
|
|
|
|
|
|
|
|
// 新容器装载扫描子HU时复用公共绑定检查,不改物料识别流程 - rqrq |
|
|
|
|
|
const huResponse = await scanHandlingUnitLabel({ |
|
|
site: localStorage.getItem('site'), |
|
|
site: localStorage.getItem('site'), |
|
|
unitId: this.newHuScanCode.trim() |
|
|
unitId: this.newHuScanCode.trim() |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
// 绑定失败立即结束,禁止把被拦截的标签再当作物料条码添加 - rqrq |
|
|
|
|
|
if (!huResponse.data || huResponse.data.code !== 0) { |
|
|
|
|
|
this.$alert((huResponse.data && huResponse.data.msg) || '标签校验失败', '提示') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if (huResponse.data.data) { |
|
|
if (huResponse.data.data) { |
|
|
// 是子HU,添加到子HU列表 |
|
|
// 是子HU,添加到子HU列表 |
|
|
await this.addNewHuChild(huResponse.data.data) |
|
|
await this.addNewHuChild(huResponse.data.data) |
|
|
@ -628,11 +644,18 @@ export default { |
|
|
this.loading = true |
|
|
this.loading = true |
|
|
try { |
|
|
try { |
|
|
// 先检查是否是子HU |
|
|
// 先检查是否是子HU |
|
|
const huResponse = await getHandlingUnitDetail({ |
|
|
|
|
|
|
|
|
// 已有容器装载也在扫码时检查子HU绑定,避免遗漏第二种装载模式 - rqrq |
|
|
|
|
|
const huResponse = await scanHandlingUnitLabel({ |
|
|
site: localStorage.getItem('site'), |
|
|
site: localStorage.getItem('site'), |
|
|
unitId: this.scanCode.trim() |
|
|
unitId: this.scanCode.trim() |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
// 失败不进入物料分支,finally仍负责恢复loading - rqrq |
|
|
|
|
|
if (!huResponse.data || huResponse.data.code !== 0) { |
|
|
|
|
|
this.$alert((huResponse.data && huResponse.data.msg) || '标签校验失败', '提示') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if (huResponse.data.data) { |
|
|
if (huResponse.data.data) { |
|
|
// 是子HU |
|
|
// 是子HU |
|
|
await this.handleChildHuScan(huResponse.data.data) |
|
|
await this.handleChildHuScan(huResponse.data.data) |
|
|
|