|
|
|
|
@ -18,7 +18,14 @@ v-model="row.warehouseId" clearable filterable
|
|
|
|
|
<el-table-column v-if="isProductMaterialStockOut" :label="t('ErpStock.Item.area')" min-width="140">
|
|
|
|
|
<template #default="{ row, $index }">
|
|
|
|
|
<el-form-item :prop="`${$index}.areaId`" :rules="formRules.areaId" class="mb-0px!">
|
|
|
|
|
<el-select v-model="row.areaId" clearable filterable :placeholder="t('ErpStock.Item.placeholderArea')" :disabled="!row.warehouseId">
|
|
|
|
|
<el-select
|
|
|
|
|
v-model="row.areaId"
|
|
|
|
|
clearable
|
|
|
|
|
filterable
|
|
|
|
|
:placeholder="t('ErpStock.Item.placeholderArea')"
|
|
|
|
|
:disabled="!row.warehouseId"
|
|
|
|
|
@change="setStockCount(row)"
|
|
|
|
|
>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in getAreaOptions(row.warehouseId)" :key="item.id" :label="getAreaLabel(item)"
|
|
|
|
|
:value="item.id" />
|
|
|
|
|
@ -585,7 +592,7 @@ const setStockCount = async (row) => {
|
|
|
|
|
if (!row.productId || !row.warehouseId) {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
const stock = await StockApi.getStock2(row.productId, row.warehouseId)
|
|
|
|
|
const stock = await StockApi.getStock2(row.productId, row.warehouseId, row.areaId)
|
|
|
|
|
row.stockCount = stock ? stock.count : 0
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|