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