|
|
|
|
@ -93,7 +93,7 @@
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
|
|
|
|
<el-table-column v-if="isSparePartStockOut" :label="t('ErpStock.Item.outboundPurpose')" min-width="140">
|
|
|
|
|
<el-table-column v-if="showOutboundPurposeColumn" :label="t('ErpStock.Item.outboundPurpose')" min-width="140">
|
|
|
|
|
<template #default="{ row, $index }">
|
|
|
|
|
<el-form-item :prop="`${$index}.outUsageType`" :rules="formRules.outUsageType" class="mb-0px!">
|
|
|
|
|
<el-input v-if="disabled" :model-value="getOutboundPurposeLabel(row.outUsageType)" readonly />
|
|
|
|
|
@ -518,13 +518,25 @@ const isProductMaterialStockOut = computed(() => Boolean(activeCategoryType.valu
|
|
|
|
|
const isProductStockOut = computed(() => activeCategoryType.value === 1)
|
|
|
|
|
const isPurchaseUnitStockOut = computed(() => activeCategoryType.value === 2 || activeCategoryType.value === 3)
|
|
|
|
|
const isSparePartStockOut = computed(() => activeCategoryType.value === 3)
|
|
|
|
|
const showOutboundPurposeColumn = computed(() => isProductMaterialStockOut.value)
|
|
|
|
|
const codeColumnLabel = computed(() => {
|
|
|
|
|
if (activeCategoryType.value === 1) return t('ErpStock.Item.productLabel')
|
|
|
|
|
if (activeCategoryType.value === 2) return t('ErpStock.Item.materialLabel')
|
|
|
|
|
if (activeCategoryType.value === 3) return t('ErpStock.Item.sparePartLabel')
|
|
|
|
|
return t('ErpStock.Item.barcode')
|
|
|
|
|
})
|
|
|
|
|
const outboundPurposeOptions = computed(() => getStrDictOptions(DICT_TYPE.WAREHOUSE_OUTBOUND_PURPOSE))
|
|
|
|
|
const allOutboundPurposeOptions = computed(() => getStrDictOptions(DICT_TYPE.WAREHOUSE_OUTBOUND_PURPOSE))
|
|
|
|
|
const outboundPurposeValuesByCategoryType: Record<number, string[]> = {
|
|
|
|
|
1: ['3', '4'],
|
|
|
|
|
2: ['3', '5'],
|
|
|
|
|
3: ['1', '2', '3']
|
|
|
|
|
}
|
|
|
|
|
const outboundPurposeOptions = computed(() => {
|
|
|
|
|
const allowedValues = outboundPurposeValuesByCategoryType[activeCategoryType.value || 0]
|
|
|
|
|
if (!allowedValues) return []
|
|
|
|
|
const allowedValueSet = new Set(allowedValues)
|
|
|
|
|
return allOutboundPurposeOptions.value.filter((dict) => allowedValueSet.has(String(dict.value)))
|
|
|
|
|
})
|
|
|
|
|
const getInventoryQuantityUnitName = (row: any) => row.unitName || row.productUnitName
|
|
|
|
|
const formatSpecQuantity = (value: any) => {
|
|
|
|
|
if (value === undefined || value === null || value === '') return ''
|
|
|
|
|
@ -1215,7 +1227,7 @@ const handleOutboundPurposeChange = (row: any) => {
|
|
|
|
|
|
|
|
|
|
const getOutboundPurposeLabel = (value: any) => {
|
|
|
|
|
const currentValue = String(value ?? '')
|
|
|
|
|
return outboundPurposeOptions.value.find((item) => String(item.value) === currentValue)?.label ?? '-'
|
|
|
|
|
return allOutboundPurposeOptions.value.find((item) => String(item.value) === currentValue)?.label ?? '-'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const getOutModeLabel = (value: any) => {
|
|
|
|
|
|