|
|
|
|
@ -128,7 +128,8 @@
|
|
|
|
|
<template #default="{ row, $index }">
|
|
|
|
|
<el-form-item :prop="`${$index}.pallets`" :rules="formRules.pallets" class="mb-0px!">
|
|
|
|
|
<el-input v-model="row.palletCode" readonly :clearable="!disabled"
|
|
|
|
|
:placeholder="t('ErpStock.Item.placeholderPalletCode')" @click="openPalletSelectDialog(row)"
|
|
|
|
|
:disabled="isPalletCodeInputDisabled(row)"
|
|
|
|
|
:placeholder="getPalletCodePlaceholder(row)" @click="openPalletSelectDialog(row)"
|
|
|
|
|
@clear="clearPallet(row)" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</template>
|
|
|
|
|
@ -1026,7 +1027,21 @@ const handleOutModeChange = (row: any) => {
|
|
|
|
|
clearPallet(row)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const isPalletCodeInputDisabled = (row: any) => {
|
|
|
|
|
return !props.disabled && !row?.productId
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const getPalletCodePlaceholder = (row: any) => {
|
|
|
|
|
return isPalletCodeInputDisabled(row)
|
|
|
|
|
? t('ErpStock.Item.placeholderProduct')
|
|
|
|
|
: t('ErpStock.Item.placeholderPalletCode')
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const openPalletSelectDialog = async (row: any) => {
|
|
|
|
|
if (isPalletCodeInputDisabled(row)) {
|
|
|
|
|
message.warning(t('ErpStock.Item.placeholderProduct'))
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
currentSelectRow.value = row
|
|
|
|
|
selectedPalletRows.value = getInitialSelectedPalletRows(row)
|
|
|
|
|
await loadRowsWarehouseAreas(selectedPalletRows.value)
|
|
|
|
|
@ -1160,7 +1175,12 @@ const handlePalletPackageCountChange = (value: number | undefined, pallet: any)
|
|
|
|
|
const packageCount = Number(value)
|
|
|
|
|
if (!Number.isFinite(packageCount) || packageCount <= availablePackageCount) return
|
|
|
|
|
pallet.packageCount = availablePackageCount
|
|
|
|
|
message.alertWarning(t('ErpStock.Item.outPackageCountExceededWarning', { count: availablePackageCount }))
|
|
|
|
|
message.alertWarning(
|
|
|
|
|
t('ErpStock.Item.outPackageCountExceededWarning', {
|
|
|
|
|
code: pallet?.code || '-',
|
|
|
|
|
count: availablePackageCount
|
|
|
|
|
})
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const getPalletOutCount = (pallet: any) => {
|
|
|
|
|
|