ADD: Warehouse inventory management dashboard

- Add WarehouseItemService.js — API client for all warehouse item endpoints (items CRUD, transactions, stock queries)
- Add WarehouseService.js — API client for warehouse location management
- Add ListWarehouseItems.vue — item catalogue table with inline create/edit dialog and bilingual unit picker
- Add WarehouseItemStockView.vue — per-item stock dashboard showing total + per-warehouse breakdown, IN/OUT transaction dialog with reason presets, inline transaction history with delete
- Add ListWarehouseItemTransactions.vue — full transaction history with filter panel (item, warehouse, type, date range)
- Add ListWarehouses.vue — warehouse location management with create/edit dialogs
- Update AppMenu.vue — add 'مدیریت انبار' menu group with 3 items
- Update router/index.js — register 4 new warehouse management routes
This commit is contained in:
2026-08-11 20:09:31 +03:30
parent 7421896805
commit 703df418ce
8 changed files with 2033 additions and 8 deletions
+51
View File
@@ -0,0 +1,51 @@
import axios from 'axios';
const getAuthHeader = () => {
const bmToken = document.cookie
.split('; ')
.find((row) => row.startsWith('bm-token='))
?.split('=')[1];
return { Authorization: `Bearer ${bmToken}` };
};
export const WarehouseService = {
listWarehouses: async (params = {}) => {
const response = await axios.get('/api/warehouses/admin/get-all', {
params,
withCredentials: true,
headers: getAuthHeader()
});
return response.data.data;
},
createWarehouse: async (data) => {
const response = await axios.post('/api/warehouses/admin/create', data, {
withCredentials: true,
headers: getAuthHeader()
});
return response.data.data;
},
getWarehouse: async (warehouseId) => {
const response = await axios.get(`/api/warehouses/admin/get-one/${warehouseId}`, {
withCredentials: true,
headers: getAuthHeader()
});
return response.data.data;
},
updateWarehouse: async (warehouseId, data) => {
const response = await axios.patch(`/api/warehouses/admin/update/${warehouseId}`, data, {
withCredentials: true,
headers: getAuthHeader()
});
return response.data.data;
},
deleteWarehouse: async (warehouseId) => {
await axios.delete(`/api/warehouses/admin/delete/${warehouseId}`, {
withCredentials: true,
headers: getAuthHeader()
});
}
};