|
|
|
@ -10,9 +10,9 @@
|
|
|
|
<!-- <el-form-item label="批次码" prop="batchCode">
|
|
|
|
<!-- <el-form-item label="批次码" prop="batchCode">
|
|
|
|
<el-input v-model="queryParams.batchCode" placeholder="请输入批次码" clearable @keyup.enter="handleQuery" />
|
|
|
|
<el-input v-model="queryParams.batchCode" placeholder="请输入批次码" clearable @keyup.enter="handleQuery" />
|
|
|
|
</el-form-item> -->
|
|
|
|
</el-form-item> -->
|
|
|
|
<el-form-item label="物料" prop="materialCode">
|
|
|
|
<!-- <el-form-item label="物料" prop="materialCode" clearable>
|
|
|
|
<el-input v-model="queryParams.materialCode" placeholder="请输入物料" clearable @keyup.enter="handleQuery" />
|
|
|
|
<el-input v-model="queryParams.materialCode" placeholder="请输入物料" clearable @keyup.enter="handleQuery" />
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>-->
|
|
|
|
<!-- <el-form-item label="库位编码" prop="locationCode">
|
|
|
|
<!-- <el-form-item label="库位编码" prop="locationCode">
|
|
|
|
<el-input v-model="queryParams.locationCode" placeholder="请输入库位编码" clearable @keyup.enter="handleQuery" />
|
|
|
|
<el-input v-model="queryParams.locationCode" placeholder="请输入库位编码" clearable @keyup.enter="handleQuery" />
|
|
|
|
</el-form-item> -->
|
|
|
|
</el-form-item> -->
|
|
|
|
@ -39,7 +39,7 @@
|
|
|
|
</el-select>
|
|
|
|
</el-select>
|
|
|
|
</el-form-item> -->
|
|
|
|
</el-form-item> -->
|
|
|
|
<el-form-item label="仓库" prop="storeId">
|
|
|
|
<el-form-item label="仓库" prop="storeId">
|
|
|
|
<el-select v-model="form.warehouseId" placeholder="请选择所属仓库">
|
|
|
|
<el-select v-model="queryParams.storeId" placeholder="请选择所属仓库" clearable>
|
|
|
|
<el-option
|
|
|
|
<el-option
|
|
|
|
v-for="item in baseStoreList"
|
|
|
|
v-for="item in baseStoreList"
|
|
|
|
:key="item.warehouseId"
|
|
|
|
:key="item.warehouseId"
|
|
|
|
@ -76,17 +76,25 @@
|
|
|
|
</el-row>
|
|
|
|
</el-row>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<el-table v-loading="loading" :data="inventoryList" @selection-change="handleSelectionChange">
|
|
|
|
<el-table v-loading="loading" :data="inventoryList" @selection-change="handleSelectionChange" :row-class-name="getRowClass">
|
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
|
|
<!-- <el-table-column label="表主键" align="center" prop="inventoryId" v-if="columns[0].visible"/> -->
|
|
|
|
<!-- <el-table-column label="表主键" align="center" prop="inventoryId" v-if="columns[0].visible"/> -->
|
|
|
|
<el-table-column label="批次码" align="center" prop="batchCode" v-if="columns[2].visible"/>
|
|
|
|
<el-table-column label="批次码" align="center" prop="batchCode" v-if="columns[2].visible"/>
|
|
|
|
<!-- <el-table-column label="物料id" align="center" prop="materialId" v-if="columns[3].visible"/> -->
|
|
|
|
<!-- <el-table-column label="物料id" align="center" prop="materialId" v-if="columns[3].visible"/> -->
|
|
|
|
<el-table-column label="库位编码" align="center" prop="locationCode" v-if="columns[4].visible"/>
|
|
|
|
<el-table-column label="库位编码" align="center" prop="locationCode" v-if="columns[4].visible"/>
|
|
|
|
<el-table-column label="物料大类" align="center" prop="materialCategoryName" v-if="columns[5].visible">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
|
|
<el-table-column label="物料" align="center" prop="materialName" v-if="columns[6].visible"/>
|
|
|
|
<el-table-column label="物料" align="center" prop="materialName" v-if="columns[6].visible"/>
|
|
|
|
<el-table-column label="库存数量" align="center" prop="inventoryQty" v-if="columns[6].visible"/>
|
|
|
|
<el-table-column label="库存数量" align="center" prop="inventoryQty" v-if="columns[6].visible">
|
|
|
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
|
|
|
<el-tooltip
|
|
|
|
|
|
|
|
v-if="scope.row.inventoryQty > scope.row.maxStockAmount || scope.row.inventoryQty < scope.row.minStockAmount"
|
|
|
|
|
|
|
|
:content="scope.row.inventoryQty > scope.row.maxStockAmount ? '库存高于上限' : '库存低于下限'"
|
|
|
|
|
|
|
|
placement="top"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<span :class="{ 'text-red-500': true }">{{ scope.row.inventoryQty }}</span>
|
|
|
|
|
|
|
|
</el-tooltip>
|
|
|
|
|
|
|
|
<span v-else>{{ scope.row.inventoryQty }}</span>
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
</el-table-column>
|
|
|
|
<el-table-column label="锁定状态" align="center" prop="lockState" v-if="columns[8].visible">
|
|
|
|
<el-table-column label="锁定状态" align="center" prop="lockState" v-if="columns[8].visible">
|
|
|
|
<template #default="scope">
|
|
|
|
<template #default="scope">
|
|
|
|
<dict-tag :options="lock_state" :value="scope.row.lockState"/>
|
|
|
|
<dict-tag :options="lock_state" :value="scope.row.lockState"/>
|
|
|
|
@ -97,7 +105,7 @@
|
|
|
|
<dict-tag :options="inventory_status" :value="scope.row.inventoryStatus"/>
|
|
|
|
<dict-tag :options="inventory_status" :value="scope.row.inventoryStatus"/>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
</el-table-column>
|
|
|
|
</el-table-column>
|
|
|
|
<el-table-column label="仓库" align="center" prop="warehouseCode" v-if="columns[10].visible"/>
|
|
|
|
<el-table-column label="仓库" align="center" prop="warehouseName" v-if="columns[10].visible"/>
|
|
|
|
<el-table-column label="上限" align="center" prop="maxStockAmount"/>
|
|
|
|
<el-table-column label="上限" align="center" prop="maxStockAmount"/>
|
|
|
|
<el-table-column label="下限" align="center" prop="minStockAmount"/>
|
|
|
|
<el-table-column label="下限" align="center" prop="minStockAmount"/>
|
|
|
|
<!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
|
<!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
|
@ -147,8 +155,8 @@
|
|
|
|
>{{dict.label}}</el-radio>
|
|
|
|
>{{dict.label}}</el-radio>
|
|
|
|
</el-radio-group>
|
|
|
|
</el-radio-group>
|
|
|
|
</el-form-item> -->
|
|
|
|
</el-form-item> -->
|
|
|
|
<el-form-item label="仓库" prop="storeId">
|
|
|
|
<el-form-item label="仓库" prop="storeId" clearable>
|
|
|
|
<el-select v-model="form.warehouseId" placeholder="请选择所属仓库">
|
|
|
|
<el-select v-model="form.storeId" placeholder="请选择所属仓库" >
|
|
|
|
<el-option
|
|
|
|
<el-option
|
|
|
|
v-for="item in baseStoreList"
|
|
|
|
v-for="item in baseStoreList"
|
|
|
|
:key="item.warehouseId"
|
|
|
|
:key="item.warehouseId"
|
|
|
|
@ -218,11 +226,12 @@ const initFormData: InventoryForm = {
|
|
|
|
materialId: undefined,
|
|
|
|
materialId: undefined,
|
|
|
|
locationCode: undefined,
|
|
|
|
locationCode: undefined,
|
|
|
|
materialCategoryId: undefined,
|
|
|
|
materialCategoryId: undefined,
|
|
|
|
materialCategoryName: undefined,//字段映射
|
|
|
|
|
|
|
|
inventoryQty: undefined,
|
|
|
|
inventoryQty: undefined,
|
|
|
|
lockState: undefined,
|
|
|
|
lockState: undefined,
|
|
|
|
inventoryStatus: undefined,
|
|
|
|
inventoryStatus: undefined,
|
|
|
|
storeId: undefined,
|
|
|
|
storeId: undefined,
|
|
|
|
|
|
|
|
warehouseId: undefined,
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const data = reactive<PageData<InventoryForm, InventoryQuery>>({
|
|
|
|
const data = reactive<PageData<InventoryForm, InventoryQuery>>({
|
|
|
|
form: {...initFormData},
|
|
|
|
form: {...initFormData},
|
|
|
|
@ -234,13 +243,12 @@ const data = reactive<PageData<InventoryForm, InventoryQuery>>({
|
|
|
|
materialId: undefined,
|
|
|
|
materialId: undefined,
|
|
|
|
locationCode: undefined,
|
|
|
|
locationCode: undefined,
|
|
|
|
materialCategoryId: undefined,
|
|
|
|
materialCategoryId: undefined,
|
|
|
|
materialCategoryName: undefined,//字段映射
|
|
|
|
|
|
|
|
inventoryQty: undefined,
|
|
|
|
inventoryQty: undefined,
|
|
|
|
lockState: undefined,
|
|
|
|
lockState: undefined,
|
|
|
|
inventoryStatus: undefined,
|
|
|
|
inventoryStatus: undefined,
|
|
|
|
storeId: undefined,
|
|
|
|
storeId: undefined,
|
|
|
|
params: {
|
|
|
|
warehouseId: undefined,
|
|
|
|
}
|
|
|
|
params: {}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
rules: {
|
|
|
|
rules: {
|
|
|
|
inventoryId: [
|
|
|
|
inventoryId: [
|
|
|
|
@ -309,6 +317,7 @@ const handleQuery = () => {
|
|
|
|
|
|
|
|
|
|
|
|
/** 重置按钮操作 */
|
|
|
|
/** 重置按钮操作 */
|
|
|
|
const resetQuery = () => {
|
|
|
|
const resetQuery = () => {
|
|
|
|
|
|
|
|
reset()
|
|
|
|
queryFormRef.value?.resetFields();
|
|
|
|
queryFormRef.value?.resetFields();
|
|
|
|
handleQuery();
|
|
|
|
handleQuery();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -377,6 +386,13 @@ const getMaterialCategorySelect = async () => {
|
|
|
|
mategoryOptions.value = res.data;
|
|
|
|
mategoryOptions.value = res.data;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const getRowClass = (row: any) => {
|
|
|
|
|
|
|
|
if (row.row.inventoryQty > row.row.maxStockAmount || row.row.inventoryQty < row.row.minStockAmount) {
|
|
|
|
|
|
|
|
return 'alarm-row';
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return '';
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
onMounted(() => {
|
|
|
|
getMaterialCategorySelect();
|
|
|
|
getMaterialCategorySelect();
|
|
|
|
@ -384,3 +400,9 @@ onMounted(() => {
|
|
|
|
getList();
|
|
|
|
getList();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
|
|
|
.alarm-row {
|
|
|
|
|
|
|
|
background-color: #ffebee !important;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
</style>
|
|
|
|
|