style:仓储模块单位调整

main
黄伟杰 3 weeks ago
parent 9c9e9b4a86
commit c0c701b79f

@ -328,11 +328,7 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="t('ErpStock.Check.materialSubCategory')" prop="subCategoryName" min-width="120" /> <el-table-column :label="t('ErpStock.Check.materialSubCategory')" prop="subCategoryName" min-width="120" />
<el-table-column :label="t('ErpStock.Item.unit')" prop="purchaseUnitName" align="center" min-width="80"> <el-table-column :label="t('ErpStock.Item.unit')" prop="unitName" align="center" min-width="80" />
<template #default="{ row }">
{{ row.purchaseUnitName || row.unitName || '-' }}
</template>
</el-table-column>
<el-table-column :label="t('ErpStock.Check.standard')" prop="standard" min-width="120" show-overflow-tooltip /> <el-table-column :label="t('ErpStock.Check.standard')" prop="standard" min-width="120" show-overflow-tooltip />
</el-table> </el-table>
<div class="stock-check-dialog-pagination"> <div class="stock-check-dialog-pagination">

@ -368,7 +368,7 @@ const getSourceTypeLabel = (value: number | string | undefined) => {
} }
const getUnitName = (row: StockCheckRecordVO) => { const getUnitName = (row: StockCheckRecordVO) => {
return row.purchaseUnitName || row.unitName || row.productUnitName || '' return row.productUnitName || ''
} }
const formatNumber = (value: number | string | undefined) => { const formatNumber = (value: number | string | undefined) => {

@ -149,18 +149,40 @@
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column v-if="isPurchaseUnitStockIn" :label="inPackageCountLabel" prop="packageCount" min-width="140"> <el-table-column v-if="isPurchaseUnitStockIn" :label="t('ErpStock.Item.inCount')" prop="packageCount" min-width="160">
<template #default="{ row, $index }"> <template #default="{ row, $index }">
<el-form-item :prop="`${$index}.packageCount`" :rules="formRules.packageCount" class="mb-0px!"> <el-form-item :prop="`${$index}.packageCount`" :rules="formRules.packageCount" class="mb-0px!">
<el-input v-if="disabled" :model-value="row.packageCount ?? '-'" readonly /> <el-input-number
<el-input-number v-else v-model="row.packageCount" controls-position="right" :min="0.001" :precision="3" class="!w-100%" /> v-model="row.packageCount"
controls-position="right"
:min="0.001"
:precision="3"
:readonly="disabled"
class="quantity-input !w-100%"
>
<template #suffix>
<span>{{ getPurchaseQuantityUnitName(row) }}</span>
</template>
</el-input-number>
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column v-if="!isProductStockIn" :label="isPurchaseUnitStockIn ? inItemCountLabel : t('ErpStock.Item.count')" prop="count" min-width="140"> <el-table-column v-if="!isProductStockIn" :label="isPurchaseUnitStockIn ? t('ErpStock.Item.inCount') : t('ErpStock.Item.count')" prop="count" min-width="160">
<template #default="{ row, $index }"> <template #default="{ row, $index }">
<el-form-item :prop="`${$index}.count`" :rules="formRules.count" class="mb-0px!"> <el-form-item :prop="`${$index}.count`" :rules="formRules.count" class="mb-0px!">
<el-input v-if="disabled || isPurchaseUnitStockIn" :model-value="row.count ?? '-'" readonly /> <el-input
v-if="isPurchaseUnitStockIn"
:model-value="row.count"
controls-position="right"
:min="0.001"
:precision="3"
readonly
class="quantity-input !w-100%"
>
<template #suffix>
<span>{{ getInventoryQuantityUnitName(row) }}</span>
</template>
</el-input>
<el-input-number v-else v-model="row.count" controls-position="right" :min="0.001" :precision="3" class="!w-100%" /> <el-input-number v-else v-model="row.count" controls-position="right" :min="0.001" :precision="3" class="!w-100%" />
</el-form-item> </el-form-item>
</template> </template>
@ -609,17 +631,8 @@ const selectorColumnLabel = computed(() => {
? `${t('ErpStock.Item.taskOrder')}/${t('ErpStock.Item.selectProduct')}` ? `${t('ErpStock.Item.taskOrder')}/${t('ErpStock.Item.selectProduct')}`
: t('ErpStock.Item.selectProduct') : t('ErpStock.Item.selectProduct')
}) })
const getFirstUnitName = (keys: string[]) => { const getPurchaseQuantityUnitName = (row: any) => row.purchaseUnitName
const row = (formData.value || []).find((item) => keys.some((key) => item?.[key])) const getInventoryQuantityUnitName = (row: any) => row.unitName || row.productUnitName
const key = keys.find((itemKey) => row?.[itemKey])
return key ? row?.[key] : undefined
}
const formatInboundQuantityLabel = (unitName?: string) => {
const base = t('ErpStock.Item.inCount')
return unitName ? `${base}${unitName}` : base
}
const inPackageCountLabel = computed(() => formatInboundQuantityLabel(getFirstUnitName(['productUnitName', 'unitName'])))
const inItemCountLabel = computed(() => formatInboundQuantityLabel(getFirstUnitName(['purchaseUnitName'])))
const productDialogVisible = ref(false) const productDialogVisible = ref(false)
const productDialogLoading = ref(false) const productDialogLoading = ref(false)
const productDialogList = ref<any[]>([]) const productDialogList = ref<any[]>([])
@ -793,6 +806,7 @@ const handleAdd = () => {
productId: undefined, productId: undefined,
productName: undefined, productName: undefined,
productUnitName: undefined, // productUnitName: undefined, //
unitName: undefined,
productBarCode: undefined, // productBarCode: undefined, //
productPrice: undefined, productPrice: undefined,
purchaseUnitId: undefined, purchaseUnitId: undefined,
@ -889,6 +903,7 @@ const onChangeProduct = (productId, row) => {
const fillRowByProduct = (row: any, product: any) => { const fillRowByProduct = (row: any, product: any) => {
row.productUnitName = product.unitName row.productUnitName = product.unitName
row.unitName = product.unitName
row.productBarCode = product.barCode row.productBarCode = product.barCode
row.productCode = product.barCode row.productCode = product.barCode
row.productPrice = product.minPrice row.productPrice = product.minPrice
@ -939,6 +954,7 @@ const getDefaultSupplier = (product: any) => {
const clearProduct = (row: any) => { const clearProduct = (row: any) => {
row.productUnitName = undefined row.productUnitName = undefined
row.unitName = undefined
row.productBarCode = undefined row.productBarCode = undefined
row.productCode = undefined row.productCode = undefined
row.productPrice = undefined row.productPrice = undefined
@ -1489,6 +1505,7 @@ const fillProductNames = (rows: any[]) => {
row.productCode = row.productCode || product.barCode row.productCode = row.productCode || product.barCode
row.productName = row.productName || product.name row.productName = row.productName || product.name
row.productUnitName = row.productUnitName || product.unitName row.productUnitName = row.productUnitName || product.unitName
row.unitName = row.unitName || product.unitName
row.productPrice = row.productPrice ?? product.minPrice row.productPrice = row.productPrice ?? product.minPrice
row.purchaseUnitId = row.purchaseUnitId ?? (product as any).purchaseUnitId row.purchaseUnitId = row.purchaseUnitId ?? (product as any).purchaseUnitId
row.purchaseUnitName = row.purchaseUnitName ?? (product as any).purchaseUnitName row.purchaseUnitName = row.purchaseUnitName ?? (product as any).purchaseUnitName
@ -1556,6 +1573,12 @@ onMounted(async () => {
padding: 12px 0 0; padding: 12px 0 0;
} }
.quantity-input :deep(.el-input__suffix) {
min-width: 30px;
justify-content: center;
color: var(--el-text-color-secondary);
}
.task-product-select { .task-product-select {
display: grid; display: grid;
gap: 6px; gap: 6px;

@ -287,7 +287,7 @@ const categoryTypeLabel = computed(() => {
const productColumnLabel = computed(() => categoryTypeLabel.value) const productColumnLabel = computed(() => categoryTypeLabel.value)
const productPlaceholder = computed(() => `请选择${productColumnLabel.value}`) const productPlaceholder = computed(() => `请选择${productColumnLabel.value}`)
const productSelectTitle = computed(() => `选择${productColumnLabel.value}`) const productSelectTitle = computed(() => `选择${productColumnLabel.value}`)
const getRowUnitName = (row) => row.purchaseUnitName || row.unitName || row.productUnitName || '-' const getRowUnitName = (row) => row.unitName || '-'
watch( watch(
() => props.items, () => props.items,

@ -1,33 +1,28 @@
<template> <template>
<div class="stock-overview"> <div class="stock-overview">
<ContentWrap> <ContentWrap>
<el-form <el-form ref="queryFormRef" :inline="true" :model="queryParams" class="-mb-15px stock-overview__query"
ref="queryFormRef" :inline="true" :model="queryParams" class="-mb-15px stock-overview__query"
label-width="auto"> label-width="auto">
<el-form-item :label="t('ErpStock.Overview.materialCategory')" prop="categoryType"> <el-form-item :label="t('ErpStock.Overview.materialCategory')" prop="categoryType">
<el-select <el-select v-model="queryParams.categoryType" clearable :placeholder="t('common.selectText')"
v-model="queryParams.categoryType" clearable :placeholder="t('common.selectText')"
class="!w-220px"> class="!w-220px">
<el-option v-for="item in categoryTypeOptions" :key="item.value" :label="item.label" :value="item.value" /> <el-option v-for="item in categoryTypeOptions" :key="item.value" :label="item.label" :value="item.value" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="t('ErpStock.Stock.warehouse')" prop="warehouseId"> <el-form-item :label="t('ErpStock.Stock.warehouse')" prop="warehouseId">
<el-select <el-select v-model="queryParams.warehouseId" clearable filterable
v-model="queryParams.warehouseId" clearable filterable
:placeholder="t('ErpStock.Stock.placeholderWarehouse')" class="!w-220px"> :placeholder="t('ErpStock.Stock.placeholderWarehouse')" class="!w-220px">
<el-option v-for="item in warehouseList" :key="item.id" :label="item.name" :value="item.id" /> <el-option v-for="item in warehouseList" :key="item.id" :label="item.name" :value="item.id" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="t('ErpStock.Overview.location')" prop="areaId"> <el-form-item :label="t('ErpStock.Overview.location')" prop="areaId">
<el-select <el-select v-model="queryParams.areaId" clearable filterable :placeholder="t('common.selectText')"
v-model="queryParams.areaId" clearable filterable :placeholder="t('common.selectText')"
class="!w-220px"> class="!w-220px">
<el-option v-for="item in areaOptions" :key="item.id" :label="item.areaName" :value="item.id" /> <el-option v-for="item in areaOptions" :key="item.id" :label="item.areaName" :value="item.id" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="t('ErpStock.Overview.dateRange')" prop="dateRange"> <el-form-item :label="t('ErpStock.Overview.dateRange')" prop="dateRange">
<el-date-picker <el-date-picker v-model="queryParams.dateRange" value-format="YYYY-MM-DD HH:mm:ss" type="daterange"
v-model="queryParams.dateRange" value-format="YYYY-MM-DD HH:mm:ss" type="daterange"
:start-placeholder="t('ErpStock.Record.placeholderCreateTimeStart')" :start-placeholder="t('ErpStock.Record.placeholderCreateTimeStart')"
:end-placeholder="t('ErpStock.Record.placeholderCreateTimeEnd')" :end-placeholder="t('ErpStock.Record.placeholderCreateTimeEnd')"
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]" class="!w-280px" /> :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]" class="!w-280px" />
@ -44,8 +39,7 @@ v-model="queryParams.dateRange" value-format="YYYY-MM-DD HH:mm:ss" type="dateran
</ContentWrap> </ContentWrap>
<div class="stock-overview__cards"> <div class="stock-overview__cards">
<ContentWrap <ContentWrap v-for="item in summaryCards" :key="item.title" class="stock-overview__card-wrap"
v-for="item in summaryCards" :key="item.title" class="stock-overview__card-wrap"
:body-style="{ padding: '22px 24px' }"> :body-style="{ padding: '22px 24px' }">
<div class="stock-overview__card"> <div class="stock-overview__card">
<div class="stock-overview__card-main"> <div class="stock-overview__card-main">
@ -64,15 +58,10 @@ v-for="item in summaryCards" :key="item.title" class="stock-overview__card-wrap"
<ContentWrap :title="t('ErpStock.Overview.stockDetail')" class="stock-overview__stock"> <ContentWrap :title="t('ErpStock.Overview.stockDetail')" class="stock-overview__stock">
<el-tabs v-model="activeName" @tab-click="handleTabClick"> <el-tabs v-model="activeName" @tab-click="handleTabClick">
<el-tab-pane label="全部" name="" /> <el-tab-pane label="全部" name="" />
<el-tab-pane <el-tab-pane v-for="item in categoryTypeOptions" :key="item.value" :label="item.label"
v-for="item in categoryTypeOptions" :name="String(item.value)" />
:key="item.value"
:label="item.label"
:name="String(item.value)"
/>
</el-tabs> </el-tabs>
<el-table <el-table v-loading="stockLoading" :data="stockList" :stripe="true" :show-overflow-tooltip="true" row-key="id"
v-loading="stockLoading" :data="stockList" :stripe="true" :show-overflow-tooltip="true" row-key="id"
height="520"> height="520">
<el-table-column :label="t('ErpStock.Stock.code')" align="center" sortable prop="barCode" min-width="160" /> <el-table-column :label="t('ErpStock.Stock.code')" align="center" sortable prop="barCode" min-width="160" />
<el-table-column :label="t('ErpStock.Stock.name')" align="center" sortable prop="name" min-width="180"> <el-table-column :label="t('ErpStock.Stock.name')" align="center" sortable prop="name" min-width="180">
@ -80,21 +69,17 @@ v-loading="stockLoading" :data="stockList" :stripe="true" :show-overflow-tooltip
{{ row.name || row.productName || '-' }} {{ row.name || row.productName || '-' }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="t('ErpStock.Stock.subCategory')" align="center" prop="categoryName" min-width="120" sortable /> <el-table-column :label="t('ErpStock.Stock.subCategory')" align="center" prop="categoryName" min-width="120"
<el-table-column :label="t('ErpStock.Stock.packagingRule')" align="center" prop="packagingRule" min-width="180" /> sortable />
<el-table-column :label="t('ErpStock.Stock.warehouse')" align="center" prop="warehouseName" min-width="140" sortable /> <el-table-column :label="t('ErpStock.Stock.packagingRule')" align="center" prop="packagingRule"
min-width="180" />
<el-table-column :label="t('ErpStock.Stock.warehouse')" align="center" prop="warehouseName" min-width="140"
sortable />
<el-table-column :label="t('ErpStock.Stock.stockDisplay')" align="center" prop="stockDisplay" min-width="220"> <el-table-column :label="t('ErpStock.Stock.stockDisplay')" align="center" prop="stockDisplay" min-width="220">
<template #default="{ row }"> <template #default="{ row }">
<span <span v-if="formatStockDisplay(row.stockDisplay).length" class="stock-display"
v-if="formatStockDisplay(row.stockDisplay).length" :style="getStockDisplayStyle(row.categoryType)">
class="stock-display" <span v-for="item in formatStockDisplay(row.stockDisplay)" :key="item" class="stock-display__item">
:style="getStockDisplayStyle(row.categoryType)"
>
<span
v-for="item in formatStockDisplay(row.stockDisplay)"
:key="item"
class="stock-display__item"
>
{{ item }} {{ item }}
</span> </span>
</span> </span>
@ -103,28 +88,23 @@ v-loading="stockLoading" :data="stockList" :stripe="true" :show-overflow-tooltip
</el-table-column> </el-table-column>
<el-table-column :label="t('ErpStock.Stock.areaStockDisplay')" align="center" min-width="260"> <el-table-column :label="t('ErpStock.Stock.areaStockDisplay')" align="center" min-width="260">
<template #default="{ row }"> <template #default="{ row }">
<div <div v-if="getAreaStockDisplayList(row.areaStocks).length" class="area-stock-list"
v-if="getAreaStockDisplayList(row.areaStocks).length" :style="getStockDisplayStyle(row.categoryType)">
class="area-stock-list" <div v-for="item in getAreaStockDisplayList(row.areaStocks)" :key="item" class="area-stock-list__item">
:style="getStockDisplayStyle(row.categoryType)"
>
<div
v-for="item in getAreaStockDisplayList(row.areaStocks)"
:key="item"
class="area-stock-list__item"
>
{{ item }} {{ item }}
</div> </div>
</div> </div>
<span v-else>-</span> <span v-else>-</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="t('ErpStock.Stock.totalPackageCount')" align="center" sortable prop="totalPackageCount" min-width="120"> <el-table-column :label="t('ErpStock.Stock.totalPackageCount')" align="center" sortable
prop="totalPackageCount" min-width="120">
<template #default="{ row }"> <template #default="{ row }">
{{ formatStockCount(row.totalPackageCount) }} {{ formatStockCount(row.totalPackageCount) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="t('ErpStock.Stock.totalBaseCount')" align="center" sortable prop="totalBaseCount" min-width="120"> <el-table-column :label="t('ErpStock.Stock.totalBaseCount')" align="center" sortable prop="totalBaseCount"
min-width="120">
<template #default="{ row }"> <template #default="{ row }">
{{ formatStockCount(row.totalBaseCount) }} {{ formatStockCount(row.totalBaseCount) }}
</template> </template>
@ -141,13 +121,11 @@ v-loading="stockLoading" :data="stockList" :stripe="true" :show-overflow-tooltip
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<Pagination <Pagination :total="stockTotal" v-model:page="stockQuery.pageNo" v-model:limit="stockQuery.pageSize"
:total="stockTotal" v-model:page="stockQuery.pageNo" v-model:limit="stockQuery.pageSize"
@pagination="getStockList" /> @pagination="getStockList" />
</ContentWrap> </ContentWrap>
<ContentWrap <ContentWrap :title="t('ErpStock.Overview.recentRecord')" class="stock-overview__record"
:title="t('ErpStock.Overview.recentRecord')" class="stock-overview__record"
:body-style="{ padding: '10px 14px 16px' }"> :body-style="{ padding: '10px 14px 16px' }">
<template #header> <template #header>
<el-button link type="primary" class="stock-overview__more" @click="goRecordPage"> <el-button link type="primary" class="stock-overview__more" @click="goRecordPage">
@ -156,8 +134,7 @@ v-loading="stockLoading" :data="stockList" :stripe="true" :show-overflow-tooltip
</el-button> </el-button>
</template> </template>
<template #default> <template #default>
<el-table <el-table v-loading="recordLoading" :data="recordList" :stripe="true" :show-overflow-tooltip="true"
v-loading="recordLoading" :data="recordList" :stripe="true" :show-overflow-tooltip="true"
row-key="id" height="562"> row-key="id" height="562">
<el-table-column :label="t('ErpStock.Overview.time')" align="center" min-width="160"> <el-table-column :label="t('ErpStock.Overview.time')" align="center" min-width="160">
<template #default="{ row }"> <template #default="{ row }">
@ -187,8 +164,7 @@ v-loading="recordLoading" :data="recordList" :stripe="true" :show-overflow-toolt
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column :label="t('ErpStock.Record.creatorName')" align="center" prop="creatorName"
:label="t('ErpStock.Record.creatorName')" align="center" prop="creatorName"
min-width="90" /> min-width="90" />
</el-table> </el-table>
</template> </template>

@ -62,12 +62,8 @@
<ContentWrap> <ContentWrap>
<el-tabs v-model="activeName" @tab-click="handleTabClick"> <el-tabs v-model="activeName" @tab-click="handleTabClick">
<el-tab-pane label="全部" name="" /> <el-tab-pane label="全部" name="" />
<el-tab-pane <el-tab-pane v-for="item in categoryTypeOptions" :key="item.value" :label="item.label"
v-for="item in categoryTypeOptions" :name="String(item.value)" />
:key="item.value"
:label="item.label"
:name="String(item.value)"
/>
</el-tabs> </el-tabs>
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true" row-key="id" <el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true" row-key="id"
@selection-change="handleSelectionChange"> @selection-change="handleSelectionChange">
@ -188,7 +184,7 @@ const formatNumber = (value: number | string | undefined) => {
const formatCountWithUnit = (row: StockRecordVO, withDirectionSign = false) => { const formatCountWithUnit = (row: StockRecordVO, withDirectionSign = false) => {
const value = withDirectionSign ? row.count : row.totalCount const value = withDirectionSign ? row.count : row.totalCount
const unitName = row.purchaseUnitName || row.unitName const unitName = row.unitName
const unit = unitName ? ` ${unitName}` : '' const unit = unitName ? ` ${unitName}` : ''
if (value === undefined || value === null) return `-${unit}` if (value === undefined || value === null) return `-${unit}`
if (!withDirectionSign) return `${formatNumber(value)}${unit}` if (!withDirectionSign) return `${formatNumber(value)}${unit}`

Loading…
Cancel
Save