|
|
|
|
@ -66,7 +66,7 @@
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
|
|
|
|
<el-table-column v-if="!isProductStockOut" :label="t('ErpStock.Item.inventoryUnit')" min-width="80">
|
|
|
|
|
<el-table-column v-if="!isProductStockOut && !isPurchaseUnitStockOut" :label="t('ErpStock.Item.inventoryUnit')" min-width="80">
|
|
|
|
|
<template #default="{ row }">
|
|
|
|
|
<el-form-item class="mb-0px!">
|
|
|
|
|
<el-input disabled v-model="row.productUnitName" />
|
|
|
|
|
@ -78,10 +78,10 @@
|
|
|
|
|
<el-input :model-value="row.packageQuantity ?? '-'" disabled />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column v-if="isPurchaseUnitStockOut" :label="t('ErpStock.Item.purchaseUnit')" min-width="100">
|
|
|
|
|
<el-table-column v-if="isPurchaseUnitStockOut" label="规格" min-width="150">
|
|
|
|
|
<template #default="{ row }">
|
|
|
|
|
<el-form-item class="mb-0px!">
|
|
|
|
|
<el-input disabled v-model="row.purchaseUnitName" />
|
|
|
|
|
<el-input :model-value="getPurchaseSpecText(row)" disabled />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
@ -92,23 +92,7 @@
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column v-if="isPurchaseUnitStockOut" min-width="120">
|
|
|
|
|
<template #header>
|
|
|
|
|
{{ t('ErpStock.Item.purchaseUnitConvertQuantity') }}
|
|
|
|
|
<el-tooltip effect="dark" placement="top">
|
|
|
|
|
<template #content>
|
|
|
|
|
{{ purchaseUnitConvertTipText }}
|
|
|
|
|
</template>
|
|
|
|
|
<Icon icon="ep:question-filled" class="ml-4px"
|
|
|
|
|
style="vertical-align: middle; color: #909399; cursor: pointer;" />
|
|
|
|
|
</el-tooltip>
|
|
|
|
|
</template>
|
|
|
|
|
<template #default="{ row }">
|
|
|
|
|
<el-form-item class="mb-0px!">
|
|
|
|
|
<el-input disabled v-model="row.purchaseUnitConvertQuantity" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
|
|
|
|
<el-table-column v-if="isSparePartStockOut" :label="t('ErpStock.Item.outboundPurpose')" min-width="140">
|
|
|
|
|
<template #default="{ row, $index }">
|
|
|
|
|
<el-form-item :prop="`${$index}.outUsageType`" :rules="formRules.outUsageType" class="mb-0px!">
|
|
|
|
|
@ -176,9 +160,17 @@
|
|
|
|
|
<template #default="{ row, $index }">
|
|
|
|
|
<el-form-item :prop="`${$index}.inputCount`" :rules="formRules.inputCount" class="mb-0px!">
|
|
|
|
|
<el-input v-if="disabled || isProductStockOut" :model-value="row.pieceCount ?? row.inputCount ?? '-'"
|
|
|
|
|
readonly />
|
|
|
|
|
readonly class="quantity-input !w-100%">
|
|
|
|
|
<template v-if="isPurchaseUnitStockOut" #suffix>
|
|
|
|
|
<span>{{ getInventoryQuantityUnitName(row) }}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-input>
|
|
|
|
|
<el-input-number v-else v-model="row.inputCount" controls-position="right" :min="0" :precision="0"
|
|
|
|
|
class="!w-100%" @blur="handleInputCountBlur(row)" />
|
|
|
|
|
class="quantity-input !w-100%" @blur="handleInputCountBlur(row)">
|
|
|
|
|
<template v-if="isPurchaseUnitStockOut" #suffix>
|
|
|
|
|
<span>{{ getInventoryQuantityUnitName(row) }}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-input-number>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
@ -533,7 +525,20 @@ const codeColumnLabel = computed(() => {
|
|
|
|
|
return t('ErpStock.Item.barcode')
|
|
|
|
|
})
|
|
|
|
|
const outboundPurposeOptions = computed(() => getStrDictOptions(DICT_TYPE.WAREHOUSE_OUTBOUND_PURPOSE))
|
|
|
|
|
const purchaseUnitConvertTipText = computed(() => t('FactoryModeling.ProductInformation.dialogPurchaseUnitConvertTip'))
|
|
|
|
|
const getInventoryQuantityUnitName = (row: any) => row.unitName || row.productUnitName
|
|
|
|
|
const formatSpecQuantity = (value: any) => {
|
|
|
|
|
if (value === undefined || value === null || value === '') return ''
|
|
|
|
|
const numberValue = Number(value)
|
|
|
|
|
if (!Number.isFinite(numberValue)) return String(value)
|
|
|
|
|
return Number.isInteger(numberValue) ? String(numberValue) : String(Number(numberValue.toFixed(6)))
|
|
|
|
|
}
|
|
|
|
|
const getPurchaseSpecText = (row: any) => {
|
|
|
|
|
const purchaseUnitName = row.purchaseUnitName || getInventoryQuantityUnitName(row)
|
|
|
|
|
const inventoryUnitName = getInventoryQuantityUnitName(row)
|
|
|
|
|
if (!purchaseUnitName && !inventoryUnitName && !row.purchaseUnitConvertQuantity) return ''
|
|
|
|
|
return `1${purchaseUnitName || ''}=${formatSpecQuantity(row.purchaseUnitConvertQuantity)}${inventoryUnitName || ''}`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const productDialogVisible = ref(false)
|
|
|
|
|
const productDialogLoading = ref(false)
|
|
|
|
|
const productDialogList = ref<any[]>([])
|
|
|
|
|
@ -1476,4 +1481,10 @@ onMounted(async () => {
|
|
|
|
|
justify-content: flex-end;
|
|
|
|
|
padding: 12px 0 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.quantity-input :deep(.el-input__suffix) {
|
|
|
|
|
min-width: 30px;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
color: var(--el-text-color-secondary);
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
|