|
|
@ -338,6 +338,10 @@ export default { |
|
|
this.$message.error('没有可打印的标签信息'); |
|
|
this.$message.error('没有可打印的标签信息'); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
if (!this.labelInfo.site) { |
|
|
|
|
|
this.$message.error('标签缺少工厂编码,无法打印'); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
let printLabelType; |
|
|
let printLabelType; |
|
|
if (this.labelInfo.partNo && this.labelInfo.partNo.startsWith("80")) { |
|
|
if (this.labelInfo.partNo && this.labelInfo.partNo.startsWith("80")) { |
|
|
printLabelType = '库存成品标签'; |
|
|
printLabelType = '库存成品标签'; |
|
|
@ -365,7 +369,8 @@ export default { |
|
|
const printRequest = { |
|
|
const printRequest = { |
|
|
userId: localStorage.getItem('userName'), |
|
|
userId: localStorage.getItem('userName'), |
|
|
username: localStorage.getItem('userName'), |
|
|
username: localStorage.getItem('userName'), |
|
|
site: localStorage.getItem('site'), |
|
|
|
|
|
|
|
|
// 查询已不再按登录工厂过滤,打印必须用当前 HandlingUnit.site,否则会按错工厂取标签数据 |
|
|
|
|
|
site: this.labelInfo.site, |
|
|
unitIds: unitIds, |
|
|
unitIds: unitIds, |
|
|
labelType: printLabelType |
|
|
labelType: printLabelType |
|
|
}; |
|
|
}; |
|
|
@ -428,12 +433,18 @@ export default { |
|
|
this.$message.error('拆分数量必须小于当前数量'); |
|
|
this.$message.error('拆分数量必须小于当前数量'); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (!this.labelInfo.site) { |
|
|
|
|
|
this.$message.error('标签缺少工厂编码,无法拆分'); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
this.splitLoading = true; |
|
|
this.splitLoading = true; |
|
|
|
|
|
|
|
|
try { |
|
|
try { |
|
|
const { data } = await splitLabel({ |
|
|
const { data } = await splitLabel({ |
|
|
site: this.site, |
|
|
|
|
|
|
|
|
// 拆分按 site + unitId 定位原标签,必须用 HandlingUnit.site,不能用登录工厂 |
|
|
|
|
|
site: this.labelInfo.site, |
|
|
unitId: this.labelInfo.unitId, |
|
|
unitId: this.labelInfo.unitId, |
|
|
splitQty: splitQty, |
|
|
splitQty: splitQty, |
|
|
operatorName: localStorage.getItem('userName') |
|
|
operatorName: localStorage.getItem('userName') |
|
|
|