|
|
|
|
@ -80,16 +80,6 @@
|
|
|
|
|
<el-input :model-value="row.packagingSchemeName || '-'" readonly />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column v-if="isProductStockIn" :label="t('ErpStock.PackagingScheme.palletPackageQuantity')" min-width="120">
|
|
|
|
|
<template #default="{ row }">
|
|
|
|
|
<el-input :model-value="row.palletPackageQuantity ?? '-'" readonly />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column v-if="isProductStockIn" :label="t('ErpStock.Item.packageItemCount')" min-width="120">
|
|
|
|
|
<template #default="{ row }">
|
|
|
|
|
<el-input :model-value="row.packageQuantity ?? '-'" readonly />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column v-if="isProductStockIn" :label="t('ErpStock.Item.palletCode')" min-width="180">
|
|
|
|
|
<template #default="{ row, $index }">
|
|
|
|
|
<el-form-item :prop="`${$index}.pallets`" :rules="formRules.pallets" class="mb-0px!">
|
|
|
|
|
@ -104,17 +94,10 @@
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column v-if="isPurchaseUnitStockIn" :label="t('ErpStock.Item.inventoryUnit')" min-width="80">
|
|
|
|
|
<template #default="{ row }">
|
|
|
|
|
<el-form-item class="mb-0px!">
|
|
|
|
|
<el-input readonly v-model="row.productUnitName" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column v-if="isPurchaseUnitStockIn" :label="t('ErpStock.Item.purchaseUnit')" min-width="100">
|
|
|
|
|
<el-table-column v-if="isPurchaseUnitStockIn" label="规格" min-width="150">
|
|
|
|
|
<template #default="{ row }">
|
|
|
|
|
<el-form-item class="mb-0px!">
|
|
|
|
|
<el-input readonly v-model="row.purchaseUnitName" />
|
|
|
|
|
<el-input :model-value="getPurchaseSpecText(row)" disabled />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
@ -132,23 +115,6 @@
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column v-if="isPurchaseUnitStockIn" 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 readonly v-model="row.purchaseUnitConvertQuantity" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column v-if="isPurchaseUnitStockIn" :label="t('ErpStock.Item.inCount')" prop="packageCount" min-width="160">
|
|
|
|
|
<template #default="{ row, $index }">
|
|
|
|
|
<el-form-item :prop="`${$index}.packageCount`" :rules="formRules.packageCount" class="mb-0px!">
|
|
|
|
|
@ -176,7 +142,7 @@
|
|
|
|
|
controls-position="right"
|
|
|
|
|
:min="0.001"
|
|
|
|
|
:precision="3"
|
|
|
|
|
readonly
|
|
|
|
|
disabled
|
|
|
|
|
class="quantity-input !w-100%"
|
|
|
|
|
>
|
|
|
|
|
<template #suffix>
|
|
|
|
|
@ -275,11 +241,17 @@
|
|
|
|
|
</Dialog>
|
|
|
|
|
|
|
|
|
|
<Dialog :title="t('FactoryModeling.ProductInformation.dialogSupplierTitle')" v-model="supplierDialogVisible" width="900px">
|
|
|
|
|
<el-form ref="supplierSearchFormRef" :model="supplierQueryParams" :inline="true" class="-mb-15px">
|
|
|
|
|
<el-form
|
|
|
|
|
ref="supplierSearchFormRef"
|
|
|
|
|
:model="supplierQueryParams"
|
|
|
|
|
:inline="true"
|
|
|
|
|
class="supplier-dialog-search-form -mb-15px"
|
|
|
|
|
>
|
|
|
|
|
<el-form-item :label="t('ErpPurchase.Supplier.name')" prop="name">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="supplierQueryParams.name"
|
|
|
|
|
clearable
|
|
|
|
|
class="supplier-dialog-search-form__input"
|
|
|
|
|
:placeholder="t('ErpPurchase.Supplier.placeholderName')"
|
|
|
|
|
@keyup.enter="handleSupplierDialogQuery"
|
|
|
|
|
/>
|
|
|
|
|
@ -288,15 +260,24 @@
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="supplierQueryParams.mobile"
|
|
|
|
|
clearable
|
|
|
|
|
class="supplier-dialog-search-form__input"
|
|
|
|
|
:placeholder="t('ErpPurchase.Supplier.placeholderMobile')"
|
|
|
|
|
@keyup.enter="handleSupplierDialogQuery"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item>
|
|
|
|
|
<el-form-item class="supplier-dialog-search-actions">
|
|
|
|
|
<el-button type="primary" @click="handleSupplierDialogQuery">
|
|
|
|
|
<Icon icon="ep:search" class="mr-5px" /> {{ t('common.query') }}
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button @click="resetSupplierDialogQuery">{{ t('common.reset') }}</el-button>
|
|
|
|
|
<el-button
|
|
|
|
|
type="primary"
|
|
|
|
|
plain
|
|
|
|
|
@click="openSupplierCreateForm"
|
|
|
|
|
v-hasPermi="['erp:supplier:create']"
|
|
|
|
|
>
|
|
|
|
|
<Icon icon="ep:plus" class="mr-5px" /> {{ t('action.create') }}
|
|
|
|
|
</el-button>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
<el-table
|
|
|
|
|
@ -402,16 +383,6 @@
|
|
|
|
|
{{ getDefaultTaskProductScheme(row)?.packagingSchemeName || '-' }}
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column :label="t('ErpStock.PackagingScheme.palletPackageQuantity')" min-width="120">
|
|
|
|
|
<template #default="{ row }">
|
|
|
|
|
{{ getDefaultTaskProductScheme(row)?.palletPackageQuantity ?? '-' }}
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column :label="t('ErpStock.Item.packageItemCount')" min-width="120">
|
|
|
|
|
<template #default="{ row }">
|
|
|
|
|
{{ getDefaultTaskProductScheme(row)?.packageQuantity ?? '-' }}
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
</div>
|
|
|
|
|
<template #footer>
|
|
|
|
|
@ -578,6 +549,7 @@
|
|
|
|
|
</Dialog>
|
|
|
|
|
|
|
|
|
|
<PalletForm ref="palletFormRef" @success="handlePalletCreateSuccess" />
|
|
|
|
|
<SupplierForm ref="supplierFormRef" @success="handleSupplierCreateSuccess" />
|
|
|
|
|
</template>
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
import { Icon } from '@/components/Icon'
|
|
|
|
|
@ -589,6 +561,7 @@ import { TaskApi, TaskVO } from '@/api/mes/task'
|
|
|
|
|
import { PalletApi, PalletVO } from '@/api/erp/stock/pallet'
|
|
|
|
|
import { SupplierApi } from '@/api/erp/purchase/supplier'
|
|
|
|
|
import PalletForm from '../../pallet/PalletForm.vue'
|
|
|
|
|
import SupplierForm from '../../../purchase/supplier/SupplierForm.vue'
|
|
|
|
|
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
|
|
|
|
import { dateFormatter2 } from '@/utils/formatTime'
|
|
|
|
|
import { erpPriceMultiply } from '@/utils'
|
|
|
|
|
@ -624,7 +597,6 @@ const activeCategoryType = computed(() => stockInCategoryTypeMap[props.inType ||
|
|
|
|
|
const isProductMaterialStockIn = computed(() => Boolean(activeCategoryType.value))
|
|
|
|
|
const isProductStockIn = computed(() => activeCategoryType.value === 1)
|
|
|
|
|
const isPurchaseUnitStockIn = computed(() => activeCategoryType.value === 2 || activeCategoryType.value === 3)
|
|
|
|
|
const purchaseUnitConvertTipText = computed(() => t('FactoryModeling.ProductInformation.dialogPurchaseUnitConvertTip'))
|
|
|
|
|
const selectorColumnLabel = computed(() => {
|
|
|
|
|
const rows = formData.value || []
|
|
|
|
|
return rows.length > 0 && rows.every((row) => isRowRelatedTask(row))
|
|
|
|
|
@ -633,6 +605,18 @@ const selectorColumnLabel = computed(() => {
|
|
|
|
|
})
|
|
|
|
|
const getPurchaseQuantityUnitName = (row: any) => row.purchaseUnitName
|
|
|
|
|
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[]>([])
|
|
|
|
|
@ -651,6 +635,7 @@ const supplierDialogLoading = ref(false)
|
|
|
|
|
const supplierDialogList = ref<any[]>([])
|
|
|
|
|
const supplierDialogTotal = ref(0)
|
|
|
|
|
const supplierSearchFormRef = ref()
|
|
|
|
|
const supplierFormRef = ref()
|
|
|
|
|
const selectedSupplierId = ref<number>()
|
|
|
|
|
const supplierQueryParams = reactive({
|
|
|
|
|
pageNo: 1,
|
|
|
|
|
@ -1069,6 +1054,15 @@ const resetSupplierDialogQuery = () => {
|
|
|
|
|
handleSupplierDialogQuery()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const openSupplierCreateForm = () => {
|
|
|
|
|
supplierFormRef.value?.open('create')
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const handleSupplierCreateSuccess = async () => {
|
|
|
|
|
supplierQueryParams.pageNo = 1
|
|
|
|
|
await getSupplierDialogList()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const handleSupplierDialogRowClick = (row: any) => {
|
|
|
|
|
selectedSupplierId.value = row.id
|
|
|
|
|
}
|
|
|
|
|
@ -1573,6 +1567,27 @@ onMounted(async () => {
|
|
|
|
|
padding: 12px 0 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.supplier-dialog-search-form {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-wrap: nowrap;
|
|
|
|
|
align-items: flex-start;
|
|
|
|
|
overflow-x: auto;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.supplier-dialog-search-form :deep(.el-form-item) {
|
|
|
|
|
flex: 0 0 auto;
|
|
|
|
|
margin-right: 12px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.supplier-dialog-search-form__input {
|
|
|
|
|
width: 190px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.supplier-dialog-search-actions :deep(.el-form-item__content) {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-wrap: nowrap;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.quantity-input :deep(.el-input__suffix) {
|
|
|
|
|
min-width: 30px;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
|