添加库存信息查询界面

main
HUOJIN\92525 2025-04-09 14:13:10 +08:00
parent 90d593a388
commit 3d528941af
13 changed files with 347 additions and 62 deletions

View File

@ -0,0 +1,48 @@
/**
* api
*
* @Author:
* @Date: 2024-12-06 17:24:53
* @Copyright
*/
import {postRequest, getRequest} from '/@/lib/axios';
export const inventoryApi = {
/**
* @author
*/
queryPage: (param: object) => {
return postRequest('/inventory/queryPage', param);
},
/**
* @author
*/
add: (param: object) => {
return postRequest('/inventory/add', param);
},
/**
* @author
*/
update: (param: object) => {
return postRequest('/inventory/update', param);
},
/**
* @author
*/
delete: (inventoryId: number) => {
return getRequest('/inventory/delete', {inventoryId});
},
/**
* @author
*/
batchDelete: (idList: number[]) => {
return postRequest('/inventory/batchDelete', idList);
},
};

View File

@ -0,0 +1,11 @@
/**
*
*
* @Author:
* @Date: 2024-12-06 17:24:53
* @Copyright
*/
export default {
};

View File

@ -17,61 +17,61 @@ let businessOAInitTableId = 30000;
let businessERPInitTableId = 40000;
let businessBASEInitTableId = 50000;
let businessWMSInitTableId = 50000;
let businessRECEIVEInitTableId = 60000;
export const TABLE_ID_CONST = {
/**
*
*/
BUSINESS: {
OA: {
NOTICE: businessOAInitTableId + 1, //通知公告
ENTERPRISE: businessOAInitTableId + 2, //企业信息
ENTERPRISE_EMPLOYEE: businessOAInitTableId + 3, //企业员工
ENTERPRISE_BANK: businessOAInitTableId + 4, //企业银行
ENTERPRISE_INVOICE: businessOAInitTableId + 5, //企业发票
},
ERP: {
GOODS: businessERPInitTableId + 1, //商品管理
},
BASE:{
AREA:businessBASEInitTableId+1,//库区
LOCATION:businessBASEInitTableId+2,//库位
ITEM:businessBASEInitTableId+3,//商品
STOCK:businessBASEInitTableId+4,//容器
ADDRESS:businessBASEInitTableId+5,//地址
CUSTOMER:businessBASEInitTableId+6,//客户
},
RECEIVE:{
ASN:businessRECEIVEInitTableId+1,//入库单
ASN_DETAIL:businessRECEIVEInitTableId+2,//入库明细
ASN_TASK:businessRECEIVEInitTableId+3,//入库详情
}
},
/**
*
*/
BUSINESS: {
OA: {
NOTICE: businessOAInitTableId + 1, //通知公告
ENTERPRISE: businessOAInitTableId + 2, //企业信息
ENTERPRISE_EMPLOYEE: businessOAInitTableId + 3, //企业员工
ENTERPRISE_BANK: businessOAInitTableId + 4, //企业银行
ENTERPRISE_INVOICE: businessOAInitTableId + 5, //企业发票
},
ERP: {
GOODS: businessERPInitTableId + 1, //商品管理
},
WMS: {
AREA: businessWMSInitTableId + 1,//库区
LOCATION: businessWMSInitTableId + 2,//库位
ITEM: businessWMSInitTableId + 3,//商品
STOCK: businessWMSInitTableId + 4,//容器
ADDRESS: businessWMSInitTableId + 5,//地址
CUSTOMER: businessWMSInitTableId + 6,//客户
/**
*
*/
SYSTEM: {
EMPLOYEE: systemInitTableId + 1, //员工
MENU: systemInitTableId + 2, //菜单
POSITION:systemInitTableId + 3, //职位
},
/**
*
*/
SUPPORT: {
CONFIG: supportInitTableId + 1, //参数配置
DICT: supportInitTableId + 2, //字典
SERIAL_NUMBER: supportInitTableId + 3, //单号
OPERATE_LOG: supportInitTableId + 4, //请求监控
HEART_BEAT: supportInitTableId + 5, //心跳
LOGIN_LOG: supportInitTableId + 6, //登录日志
RELOAD: supportInitTableId + 7, //reload
HELP_DOC: supportInitTableId + 8, //帮助文档
JOB: supportInitTableId + 9, //Job
JOB_LOG: supportInitTableId + 10, //JobLog
},
ASN: businessWMSInitTableId + 7,//入库单
ASN_DETAIL: businessWMSInitTableId + 8,//入库明细
ASN_TASK: businessWMSInitTableId + 9,//入库详情
INVENTORY: businessWMSInitTableId + 10,//库存
}
},
/**
*
*/
SYSTEM: {
EMPLOYEE: systemInitTableId + 1, //员工
MENU: systemInitTableId + 2, //菜单
POSITION: systemInitTableId + 3, //职位
},
/**
*
*/
SUPPORT: {
CONFIG: supportInitTableId + 1, //参数配置
DICT: supportInitTableId + 2, //字典
SERIAL_NUMBER: supportInitTableId + 3, //单号
OPERATE_LOG: supportInitTableId + 4, //请求监控
HEART_BEAT: supportInitTableId + 5, //心跳
LOGIN_LOG: supportInitTableId + 6, //登录日志
RELOAD: supportInitTableId + 7, //reload
HELP_DOC: supportInitTableId + 8, //帮助文档
JOB: supportInitTableId + 9, //Job
JOB_LOG: supportInitTableId + 10, //JobLog
},
};

View File

@ -63,7 +63,7 @@
</a-button>
</div>
<div class="smart-table-setting-block">
<TableOperator v-model="columns" :tableId="TABLE_ID_CONST.BUSINESS.BASE.ADDRESS" :refresh="queryData"/>
<TableOperator v-model="columns" :tableId="TABLE_ID_CONST.BUSINESS.WMS.ADDRESS" :refresh="queryData"/>
</div>
</a-row>
<!---------- 表格操作行 end ----------->

View File

@ -55,7 +55,7 @@
</a-button>
</div>
<div class="smart-table-setting-block">
<TableOperator v-model="columns" :tableId="TABLE_ID_CONST.BUSINESS.BASE.AREA" :refresh="queryData"/>
<TableOperator v-model="columns" :tableId="TABLE_ID_CONST.BUSINESS.WMS.AREA" :refresh="queryData"/>
</div>
</a-row>
<!---------- 表格操作行 end ----------->

View File

@ -55,7 +55,7 @@
</a-button>
</div>
<div class="smart-table-setting-block">
<TableOperator v-model="columns" :tableId="TABLE_ID_CONST.BUSINESS.BASE.CUSTOMER" :refresh="queryData"/>
<TableOperator v-model="columns" :tableId="TABLE_ID_CONST.BUSINESS.WMS.CUSTOMER" :refresh="queryData"/>
</div>
</a-row>
<!---------- 表格操作行 end ----------->

View File

@ -68,7 +68,7 @@
</a-button>
</div>
<div class="smart-table-setting-block">
<TableOperator v-model="columns" :tableId="TABLE_ID_CONST.BUSINESS.BASE.ITEM" :refresh="queryData"/>
<TableOperator v-model="columns" :tableId="TABLE_ID_CONST.BUSINESS.WMS.ITEM" :refresh="queryData"/>
</div>
</a-row>
<!---------- 表格操作行 end ----------->

View File

@ -90,7 +90,7 @@
</div>
<div class="smart-table-setting-block">
<TableOperator v-model="columns" :tableId="TABLE_ID_CONST.BUSINESS.BASE.LOCATION" :refresh="queryData"/>
<TableOperator v-model="columns" :tableId="TABLE_ID_CONST.BUSINESS.WMS.LOCATION" :refresh="queryData"/>
</div>
</a-row>
<!---------- 表格操作行 end ----------->

View File

@ -74,7 +74,7 @@
</a-button>
</div>
<div class="smart-table-setting-block">
<TableOperator v-model="columns" :tableId="TABLE_ID_CONST.BUSINESS.BASE.STOCK" :refresh="queryData"/>
<TableOperator v-model="columns" :tableId="TABLE_ID_CONST.BUSINESS.WMS.STOCK" :refresh="queryData"/>
</div>
</a-row>
<!---------- 表格操作行 end ----------->

View File

@ -0,0 +1,226 @@
<!--
* 库存信息
*
* @Author: 霍锦
* @Date: 2024-12-06 17:24:53
* @Copyright 友仓
-->
<template>
<!---------- 查询表单form begin ----------->
<a-form class="smart-query-form">
<a-row class="smart-query-form-row">
<a-form-item label="物料" class="smart-query-form-item">
<ItemSelect v-model:value="queryForm.itemId" :disabledFlag="true" @change="changeItemSelect"/>
</a-form-item>
<a-form-item label="库位" class="smart-query-form-item">
<LocationSelect v-model:value="queryForm.locationId" :disabledFlag="true" @change="changeLocationSelect"/>
</a-form-item>
<a-form-item label="容器" class="smart-query-form-item">
<StockSelect v-model:value="queryForm.stockId" :disabled-flag="true" @change="changeStockSelect"/>
</a-form-item>
<a-form-item class="smart-query-form-item">
<a-button type="primary" @click="onSearch" class="smart-margin-left10" v-privilege="'inventory:query'">
<template #icon>
<SearchOutlined/>
</template>
查询
</a-button>
<a-button @click="resetQuery" class="smart-margin-left10" v-privilege="'inventory:query'">
<template #icon>
<ReloadOutlined/>
</template>
重置
</a-button>
</a-form-item>
</a-row>
</a-form>
<!---------- 查询表单form end ----------->
<a-card size="small" :bordered="false" :hoverable="true">
<!---------- 表格操作行 begin ----------->
<a-row class="smart-table-btn-block">
<div class="smart-table-operate-block">
</div>
<div class="smart-table-setting-block">
<TableOperator v-model="columns" :tableId="TABLE_ID_CONST.BUSINESS.WMS.INVENTORY" :refresh="queryData"/>
</div>
</a-row>
<!---------- 表格操作行 end ----------->
<!---------- 表格 begin ----------->
<a-table
size="small"
:dataSource="tableData"
:columns="columns"
rowKey="inventoryId"
bordered
:loading="tableLoading"
:pagination="false"
:row-selection="{ selectedRowKeys: selectedRowKeyList, onChange: onSelectChange }"
>
<template #bodyCell="{ text, record, column }">
<template v-if="column.dataIndex === 'action'">
<div class="smart-table-operate">
</div>
</template>
</template>
</a-table>
<!---------- 表格 end ----------->
<div class="smart-query-table-page">
<a-pagination
showSizeChanger
showQuickJumper
show-less-items
:pageSizeOptions="PAGE_SIZE_OPTIONS"
:defaultPageSize="queryForm.pageSize"
v-model:current="queryForm.pageNum"
v-model:pageSize="queryForm.pageSize"
:total="total"
@change="queryData"
@showSizeChange="queryData"
:show-total="(total:number) => `共${total}条`"
/>
</div>
</a-card>
</template>
<script setup lang="ts">
import {reactive, ref, onMounted} from 'vue';
import {inventoryApi} from '/@/api/business/wms/inventory/inventory-api';
import {PAGE_SIZE_OPTIONS} from '/@/constants/common-const';
import {smartSentry} from '/@/lib/smart-sentry';
import TableOperator from '/@/components/support/table-operator/index.vue';
import {TABLE_ID_CONST} from "/@/constants/support/table-id-const";
import StockSelect from "/@/views/business/wms/base/stock/stock-select.vue";
import ItemSelect from "/@/views/business/wms/base/item/item-select.vue";
import LocationSelect from "/@/views/business/wms/base/location/location-select.vue";
// ---------------------------- ----------------------------
const columns = ref([
{
title: '库存id',
dataIndex: 'inventoryId',
ellipsis: true,
},
{
title: '物料编码',
dataIndex: 'itemCode',
ellipsis: true,
},
{
title: '物料名称',
dataIndex: 'itemName',
ellipsis: true,
},
{
title: '库位',
dataIndex: 'locationCode',
ellipsis: true,
},
{
title: '容器',
dataIndex: 'stockCode',
ellipsis: true,
},
{
title: '数量',
dataIndex: 'quantity',
ellipsis: true,
},
{
title: '占用数',
dataIndex: 'queuedQuantity',
ellipsis: true,
},
{
title: '日期',
dataIndex: 'createTime',
ellipsis: true,
}
]);
// ---------------------------- ----------------------------
const queryFormState = {
itemId: undefined,//
locationId: undefined,//
stockId: undefined,//
pageNum: 1,
pageSize: 10,
};
// form
const queryForm = reactive({...queryFormState});
// loading
const tableLoading = ref(false);
//
const tableData = ref([]);
//
const total = ref(0);
//
function resetQuery() {
let pageSize = queryForm.pageSize;
Object.assign(queryForm, queryFormState);
queryForm.pageSize = pageSize;
queryData();
}
//
function onSearch() {
queryForm.pageNum = 1;
queryData();
}
//
function changeItemSelect(selectValue: any) {
if (selectValue) {
queryForm.itemId = selectValue.itemId;
}
}
//
function changeStockSelect(selectValue: any) {
if (selectValue) {
queryForm.stockId = selectValue.stockId;
}
}
//
function changeLocationSelect(selectValue: any) {
if (selectValue) {
queryForm.locationId = selectValue.locationId;
}
}
//
async function queryData() {
tableLoading.value = true;
try {
let queryResult = await inventoryApi.queryPage(queryForm);
tableData.value = queryResult.data.list;
total.value = queryResult.data.total;
} catch (e) {
smartSentry.captureError(e);
} finally {
tableLoading.value = false;
}
}
//
const selectedRowKeyList = ref([]);
function onSelectChange(selectedRowKeys: any) {
selectedRowKeyList.value = selectedRowKeys;
}
onMounted(queryData);
</script>

View File

@ -49,7 +49,7 @@
</a-button>
</div>
<div class="smart-table-setting-block">
<TableOperator v-model="columns" :tableId="TABLE_ID_CONST.BUSINESS.RECEIVE.ASN" :refresh="queryData"/>
<TableOperator v-model="columns" :tableId="TABLE_ID_CONST.BUSINESS.WMS.ASN" :refresh="queryData"/>
</div>
</a-row>
<!---------- 表格操作行 end ----------->

View File

@ -42,7 +42,7 @@
批量移除
</a-button>
<TableOperator v-model="columns" :tableId="TABLE_ID_CONST.BUSINESS.RECEIVE.ASN_DETAIL" :refresh="queryData"/>
<TableOperator v-model="columns" :tableId="TABLE_ID_CONST.BUSINESS.WMS.ASN_DETAIL" :refresh="queryData"/>
</div>
</div>

View File

@ -27,7 +27,7 @@
批量退货
</a-button>
<TableOperator v-model="columns" :tableId="TABLE_ID_CONST.BUSINESS.RECEIVE.ASN_TASK" :refresh="queryData"/>
<TableOperator v-model="columns" :tableId="TABLE_ID_CONST.BUSINESS.WMS.ASN_TASK" :refresh="queryData"/>
</div>
</div>