|
|
|
@ -411,7 +411,7 @@ |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import { searchHandlingUnitList, batchChangeAvailabilityControlId, batchChangeExpiryDate } from '@/api/warehouse/changeHUSpecialItem' |
|
|
|
import { searchHandlingUnitList, batchChangeAvailabilityControlId, batchChangeExpiryDate, batchChangeWdr } from '@/api/warehouse/changeHUSpecialItem' |
|
|
|
import { activeList, getDescById } from '@/api/warehouse/availabilityControlId' |
|
|
|
|
|
|
|
export default { |
|
|
|
@ -854,15 +854,63 @@ export default { |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
// 构建提示信息,显示选中的标签数量 - rqrq |
|
|
|
const selectedCount = this.dataListSelections.length |
|
|
|
|
|
|
|
// 按库存关键字去重统计 - rqrq |
|
|
|
const inventoryKeySet = new Set() |
|
|
|
this.dataListSelections.forEach(item => { |
|
|
|
const key = `${item.site}|${item.partNo}|${item.locationId}|${item.batchNo}|${item.wdr}|${item.engChgLevel}` |
|
|
|
inventoryKeySet.add(key) |
|
|
|
}) |
|
|
|
const inventoryCount = inventoryKeySet.size |
|
|
|
|
|
|
|
this.$confirm(`确认将选中的 ${selectedCount} 个标签(${inventoryCount}行库存)的W/D/R修改为 "${this.wdrFormData.toWdr}" 吗?`, '确认修改', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
this.doSaveWdrChange() |
|
|
|
}).catch(() => { |
|
|
|
// 取消操作 |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
// 执行W/D/R修改 - rqrq |
|
|
|
doSaveWdrChange() { |
|
|
|
this.wdrSaveLoading = true |
|
|
|
|
|
|
|
// TODO: 调用后端API保存 - rqrq |
|
|
|
setTimeout(() => { |
|
|
|
const requestData = { |
|
|
|
selectedItems: this.dataListSelections, |
|
|
|
newWdr: this.wdrFormData.toWdr |
|
|
|
} |
|
|
|
|
|
|
|
batchChangeWdr(requestData).then(({ data }) => { |
|
|
|
if (data && data.code == 0) { |
|
|
|
const result = data.row |
|
|
|
if (result.failCount === 0) { |
|
|
|
this.$message.success(`W/D/R修改成功,共处理${result.successCount}个标签`) |
|
|
|
} else { |
|
|
|
// 部分失败,显示详细信息 - rqrq |
|
|
|
this.$alert( |
|
|
|
`成功:${result.successCount}个标签<br/>失败:${result.failCount}个标签<br/><br/>失败标签:${result.failedUnitIds ? result.failedUnitIds.join(', ') : '无'}`, |
|
|
|
'W/D/R修改结果', |
|
|
|
{ |
|
|
|
dangerouslyUseHTMLString: true, |
|
|
|
confirmButtonText: '确定' |
|
|
|
} |
|
|
|
) |
|
|
|
} |
|
|
|
this.closeWdrDialog() |
|
|
|
this.getDataList() |
|
|
|
} else { |
|
|
|
this.$alert(data.msg || 'W/D/R修改失败', '错误') |
|
|
|
} |
|
|
|
}).catch(error => { |
|
|
|
this.$message.error('W/D/R修改失败:' + (error.message || '网络错误')) |
|
|
|
}).finally(() => { |
|
|
|
this.wdrSaveLoading = false |
|
|
|
this.$message.success('W/D/R修改成功') |
|
|
|
this.closeWdrDialog() |
|
|
|
this.getDataList() |
|
|
|
}, 1000) |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
// ==================== Change Expiration Date相关方法 - rqrq ==================== |
|
|
|
|