Commit 90c52e7c by zhuzhequan

工厂端仓库

parent dc9252f9
......@@ -33,6 +33,7 @@ declare module 'vue' {
ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
ElOption: typeof import('element-plus/es')['ElOption']
ElPagination: typeof import('element-plus/es')['ElPagination']
ElPopover: typeof import('element-plus/es')['ElPopover']
ElRadio: typeof import('element-plus/es')['ElRadio']
ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
ElRow: typeof import('element-plus/es')['ElRow']
......
......@@ -7,8 +7,16 @@ import {
InterskuList,
InterWarehouseList,
ILocation,
InRecordEditForm
InRecordEditForm,
} from '@/types/api/warehouse'
export interface LogListData{
createTime:string
description:string
}
export interface PrintData{
code:string
list:{locationName:string,pickingLocation:string}[]
}
export interface factoryWarehouseInfo {
pageSize: number
currentPage: number
......@@ -35,17 +43,19 @@ export interface WarehouseInventory {
occupyInventoryStart: string;
floorLimit: string;
}
export interface UpdateDefaulted{
id?: number |string;
export interface UpdateDefaulted {
id?: number | string;
defaulted: number;
}
export interface UpdateStatus{
export interface UpdateStatus {
id?: number;
status: number | undefined;
}
export interface warehouseInfo{
id?: number |string;
export interface warehouseInfo {
id?: number | string;
name: string;
code: string;
sort: string;
......@@ -55,26 +65,35 @@ export interface warehouseInfo{
remarks: string
}
export interface positionInfo{
export interface WarehouseWarning {
id: number | string;
locationCode: string;
locationName: string;
}
export interface positionInfo {
id?: number;
warehouseId?: string | number;
warehouseId?: string | number;
locationName: string;
pickingOrder: string;
locationCode: string;
warehouseName?: string ;
warehouseName?: string;
status?: number;
remark: string
}
export interface positionFormInfo{
export interface positionFormInfo {
id?: number;
warehouseId?: number | string;
locationName: string;
pickingOrder: string;
locationCode: string;
warehouseName: string ;
warehouseName: string;
remark: string
status: number
}
interface WarehouseWarningData {
id: number
factoryId: number
......@@ -97,6 +116,7 @@ interface WarehouseWarningData {
createTime: string
updateTime: string
}
export function getFactoryLocation(data: factoryWarehouseInfo) {
return axios.post<never, BasePaginationData<positionInfo>>(
'factoryWarehouseLocation/list_page',
......@@ -112,11 +132,12 @@ export function getFactoryWarehouseInfo(data: factoryWarehouseInfo) {
}
export function getWarehouseInventoryInfo(data: WarehouseInventory) {
return axios.post<never, BasePaginationData<warehouseInfo>>(
return axios.post<never, BasePaginationData<WarehouseWarning>>(
'factoryWarehouseInventory/list_page',
data,
)
}
export function createWarehouseApi(data: warehouseInfo) {
return axios.post<never, BaseRespData<never>>(
'/factoryWarehouseInfo/add',
......@@ -124,16 +145,30 @@ export function createWarehouseApi(data: warehouseInfo) {
)
}
export function createPositionApi(data:positionInfo) {
export function factoryLogWarehouseLog(id: number | string | undefined) {
return axios.get<never, BaseRespData<LogListData[]>>(
'/factoryLogWarehouse/get',
{ params: { id } },
)
}
export function factoryWarehouseInfoPrint(data:PrintData) {
return axios.post<never, BaseRespData<LogListData[]>>(
'/factoryWarehouseInfo/print',
data
)
}
export function createPositionApi(data: positionInfo) {
return axios.post<never, BaseRespData<never>>(
'/factoryWarehouseLocation/add',
data
data,
)
}
export function warehouseInfoGetAll() {
return axios.get<never, BaseRespData<warehouseInfo[]>>(
'/factoryWarehouseInfo/getAll'
'/factoryWarehouseInfo/getAll',
)
}
......@@ -143,6 +178,7 @@ export function createWarehouseInventoryApi(data: WarehouseWarningData) {
data,
)
}
export function updateWarehouseApi(data: positionInfo | UpdateDefaulted) {
return axios.post<never, BaseRespData<never>>(
'/factoryWarehouseInfo/update',
......@@ -150,37 +186,42 @@ export function updateWarehouseApi(data: positionInfo | UpdateDefaulted) {
)
}
export function updatePositionApi(data:positionInfo) {
export function updatePositionApi(data: positionInfo) {
return axios.post<never, BaseRespData<never>>(
'/factoryWarehouseLocation/update',
data
data,
)
}
export function updatePositionStatusApi(data: UpdateStatus) {
return axios.get<never, BaseRespData<never>>(
'/factoryWarehouseLocation/updateStatus',
{ params:data },
{ params: data },
)
}
export function updateWarehouseInventoryApi(data: WarehouseWarningData) {
return axios.post<never, BaseRespData<never>>(
'/factoryWarehouseInventory/update',
data,
)
}
export function deleteWarehouseApi(ids: string) {
return axios.get<never, BaseRespData<never>>('/factoryWarehouseInfo/delete', {
params: { ids },
})
}
export function deleteLocationApi(ids:string) {
export function deleteLocationApi(ids: string) {
return axios.get<never, BaseRespData<never>>(
'/factoryWarehouseLocation/delete',
{
params:{ids}
params: { ids },
},
)
}
export function deleteWarehouseInventory(ids: string) {
return axios.get<never, BaseRespData<never>>(
'/factoryWarehouseInventory/delete',
......@@ -189,6 +230,7 @@ export function deleteWarehouseInventory(ids: string) {
},
)
}
// 入库单
export function warehouseInRecordListPage(
......@@ -205,16 +247,19 @@ export function warehouseInRecordListPage(
},
)
}
export function addInRecordApi(form: InRecordEditForm) {
return axios.post<never, BaseRespData<never>>('factory/warehouseInRecord/add', {
...form,
})
}
export function updateInRecordApi(form: InRecordEditForm) {
return axios.post<never, BaseRespData<never>>('factory/warehouseInRecord/update', {
...form,
})
}
export function getWarehouseInRecordDetail(id: number) {
return axios.get<never, BaseRespData<never>>(
'factory/warehouseInRecord/get',
......@@ -225,6 +270,7 @@ export function getWarehouseInRecordDetail(id: number) {
},
)
}
export function getBySku(warehouseId: number, sku: string | null) {
return axios.get<never, BaseRespData<InterskuList[]>>(
'customProductItem/getBySku',
......@@ -236,6 +282,7 @@ export function getBySku(warehouseId: number, sku: string | null) {
},
)
}
export function getByWareHouseIdAndCode(wareHouseId: number, code: string | null) {
return axios.get<never, BaseRespData<ILocation[]>>(
'factoryWarehouseLocation/getByWareHouseIdAndCode',
......@@ -247,11 +294,13 @@ export function getByWareHouseIdAndCode(wareHouseId: number, code: string | null
},
)
}
export function getWarehouseStatusTree() {
return axios.get<never, BaseRespData<InterWarehouseTree[]>>(
'factory/warehouseInRecord/status_tree',
)
}
export function getWarehouseListApi() {
return axios.get<never, BaseRespData<InterWarehouseList[]>>(
'factoryWarehouseInfo/getAll',
......
......@@ -9,6 +9,10 @@ const props = defineProps({
default: '',
type: String || Number,
},
otherSize: {
default: 20,
type: String || Number,
},
})
const domSize = ref<string>('0')
......@@ -51,6 +55,11 @@ defineExpose({
<slot name="bottom"></slot>
</div>
</pane>
<pane v-if="$slots.other" :size="otherSize">
<div id="other-pane">
<slot name="other"></slot>
</div>
</pane>
</splitpanes>
</template>
......@@ -58,7 +67,9 @@ defineExpose({
#top {
height: fit-content;
}
#other-pane{
height: 100%;
}
#bottom {
height: 100%;
}
......
......@@ -22,14 +22,9 @@ const menu: MenuItem[] = [
label: '库存',
children: [
{
index: '/warehouse/manage',
id: 121,
label: '仓库管理',
},
{
index: '/warehouse/position',
id: 122,
label: '库位管理',
index: '/warehouse/warning',
id: 125,
label: '仓库预警',
},
{
index: '/warehouse/receipt-doc',
......@@ -41,10 +36,16 @@ const menu: MenuItem[] = [
id: 124,
label: '出库单',
},
{
index: '/warehouse/warning',
id: 125,
label: '仓库预警',
index: '/warehouse/manage',
id: 121,
label: '仓库管理',
},
{
index: '/warehouse/position',
id: 122,
label: '库位管理',
},
],
},
......
......@@ -6,7 +6,7 @@ import {
warehouseInfoGetAll,
createPositionApi,
updatePositionApi,
positionInfo, deleteLocationApi, positionFormInfo, updatePositionStatusApi,
positionInfo, deleteLocationApi, positionFormInfo, updatePositionStatusApi, factoryWarehouseInfoPrint,
} from '@/api/warehouse.ts'
import { nextTick, ref } from 'vue'
import SplitDiv from '@/components/splitDiv/splitDiv.vue'
......@@ -95,9 +95,24 @@ const handleConfirm = async () => {
ElMessage.success('操作成功')
await getData()
}
const handleBatchDelete = async (row: positionInfo) => {
if (!row && !selections.value.length) {
async function printLocationTag() {
if(!selections.value.length) {
return ElMessage.warning('请选择数据')
}
const list = selections.value.map((item) => {
return {
locationName:item.locationName,
pickingLocation:item.locationCode,
}
})
const res = await factoryWarehouseInfoPrint({
list,
code:'PT001'
})
console.log(res)
}
const handleBatchDelete = async (row: positionInfo | null) => {
if(!row && !selections.value.length){
return ElMessage.warning('请选择要删除的数据')
}
await ElMessageBox.confirm('确定要删除吗?', '提示', {
......@@ -198,7 +213,8 @@ getWarehouse()
<el-form-item>
<el-button type="primary" @click="getData">查询</el-button>
<el-button type="success" @click="createWarehouse">新增库位</el-button>
<el-button type="danger" @click="handleBatchDelete">删除</el-button>
<el-button type="primary" @click="printLocationTag">打印库位标签</el-button>
<el-button type="danger" @click="handleBatchDelete(null)">删除</el-button>
</el-form-item>
</el-form>
</el-card>
......
......@@ -2,7 +2,12 @@
import {
factoryWarehouseInfo,
warehouseInfo,
deleteWarehouseInventory, warehouseInfoGetAll, getWarehouseInventoryInfo, WarehouseInventory,
warehouseInfoGetAll,
getWarehouseInventoryInfo,
factoryLogWarehouseLog,
LogListData,
factoryWarehouseInfoPrint,
WarehouseWarning,
} from '@/api/warehouse.ts'
import { ref } from 'vue'
import SplitDiv from '@/components/splitDiv/splitDiv.vue'
......@@ -22,13 +27,17 @@ const searchForm = ref({
floorLimit: '',
})
const warehouseList = ref<warehouseInfo[]>([])
const selections = ref<warehouseInfo[]>([])
const leftData = ref<warehouseInfo[]>([])
const logList = ref<LogListData[]>([])
const selections = ref<WarehouseWarning[]>([])
const leftData = ref<WarehouseWarning[]>([])
const pagination = ref<factoryWarehouseInfo>({
pageSize: 50,
currentPage: 1,
total: 0,
})
const clickItem = (row: WarehouseWarning) => {
getDetail(row.id)
}
async function getData() {
const res = await getWarehouseInventoryInfo({
......@@ -37,9 +46,16 @@ async function getData() {
})
leftData.value = res.data.records
pagination.value.total = res.data.total
if (leftData.value.length) {
getDetail(leftData.value[0].id)
}
}
const handleSelectionChange = (data: warehouseInfo[]) => {
const getDetail = async (id: number | string | undefined) => {
const { data } = await factoryLogWarehouseLog(id)
logList.value = data
}
const handleSelectionChange = (data: WarehouseWarning[]) => {
selections.value = data
}
const handleSizeChange = (pageSize: number) => {
......@@ -51,20 +67,6 @@ const handleCurrentChange = (currentPage: number) => {
getData()
}
const handleBatchDelete = async () => {
if (!selections.value.length) {
return ElMessage.warning('请选择要删除的数据')
}
await ElMessageBox.confirm('确定要删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
const str = selections.value.map((el) => el.id).join(',')
await deleteWarehouseInventory(str)
ElMessage.success('删除成功')
await getData()
}
const getWarehouse = async () => {
const { data } = await warehouseInfoGetAll()
warehouseList.value = data
......@@ -77,7 +79,7 @@ getWarehouse()
<split-div>
<template #top>
<el-card>
<el-form inline :model="searchForm">
<el-form class="search-form" inline :model="searchForm">
<el-form-item label="仓库">
<el-select
v-model="searchForm.warehouseId" clearable filterable placeholder="请输入仓库"
......@@ -125,6 +127,7 @@ getWarehouse()
<el-form-item>
<el-button type="primary" @click="getData">查询</el-button>
</el-form-item>
</el-form>
</el-card>
</template>
......@@ -132,21 +135,28 @@ getWarehouse()
<el-card style="height: 100%">
<div class="manage">
<div class="table-flex">
<div class="left-table">
<div class="top-table">
<div class="table-container">
<el-table height="100%" :data="leftData" border @selection-change="handleSelectionChange">
<el-table
highlight-current-row height="100%" :data="leftData" border @current-change="clickItem"
@selection-change="handleSelectionChange">
<el-table-column align="center" fixed type="selection" />
<el-table-column align="center" fixed="left" type="index" label="序号" width="60" />
<el-table-column align="center" prop="warehouseName" label="图片" width="100">
<template #default="scope">
<el-image :preview-teleported="true" style="width: 40px;" :src="scope.row.productItem?.image" :preview-src-list="[scope.row.productItem?.image]"></el-image>
</template>
</el-table-column>
<el-table-column align="center" prop="warehouseName" label="仓库名称" width="180"></el-table-column>
<el-table-column align="center" prop="locationName" label="库位名称" width="160"></el-table-column>
<el-table-column align="center" prop="locationCode" label="库位" width="160"></el-table-column>
<el-table-column align="center" prop="warehouseSku" label="商品SKU" width="180"></el-table-column>
<el-table-column align="center" prop="skuName" label="商品名称" width="250"></el-table-column>
<el-table-column align="center" prop="unit" label="单位" width="100"></el-table-column>
<el-table-column align="center" prop="occupyInventory" label="占用库存" width="120"></el-table-column>
<el-table-column align="center" prop="freezeInventory" label="冻结库存" width="180"></el-table-column>
<el-table-column align="center" prop="inventory" label="实际库存" width="120"></el-table-column>
<el-table-column align="center" prop="upperLimit" label="库存上限" width="120"></el-table-column>
<el-table-column align="center" prop="floorLimit" label="库存下限" width="120"></el-table-column>
<el-table-column align="center" prop="unit" label="单位" width="80"></el-table-column>
<el-table-column align="center" prop="productItem.factoryPrice" label="商品成本价(¥)" width="160"></el-table-column>
<el-table-column align="center" prop="usableInventory" label="可用数量" width="120"></el-table-column>
<el-table-column align="center" prop="inventory" label="库存数量" width="120"></el-table-column>
<el-table-column align="center" prop="occupyInventory" label="占用数量" width="120"></el-table-column>
<el-table-column align="center" prop="freezeInventory" label="冻结数量" width="120"></el-table-column>
<el-table-column align="center" prop="productNumber" label="货号" width="150"></el-table-column>
<el-table-column fixed="right" label="操作" align="center">
<template #default="{row}">
......@@ -171,12 +181,39 @@ getWarehouse()
</div>
</el-card>
</template>
<template #other>
<div class="bottom-table">
<el-tabs>
<el-tab-pane label="库存操作明细">
<ul
style="
display: flex;
flex-direction: column;
color: #333;
font-size: 13px;
height: 100%;
overflow: auto;
white-space: pre;
">
<li v-for="(item, index) in logList" :key="index">
{{ item.createTime + ' ' + item.description }}
</li>
</ul>
</el-tab-pane>
</el-tabs>
</div>
</template>
</split-div>
</template>
<style scoped lang="scss">
::v-deep(.search-form) {
.el-form-item {
margin-bottom: 0;
}
}
.el-card {
::v-deep(.el-card__body) {
height: 100%;
......@@ -197,6 +234,7 @@ getWarehouse()
flex-shrink: 0;
overflow: hidden;
display: flex;
flex-direction: column;
}
.right-table {
......@@ -205,7 +243,7 @@ getWarehouse()
flex-shrink: 0;
}
.left-table {
.top-table {
height: 100%;
display: flex;
width: 100%;
......@@ -224,4 +262,29 @@ getWarehouse()
}
}
}
.bottom-table {
height: 100%;
background: white;
box-sizing: border-box;
padding: 10px;
::v-deep(.el-tabs) {
height: 100%;
display: flex;
flex-direction: column;
.el-tabs__content {
flex: 1;
flex-shrink: 0;
.el-tab-pane {
height: 100%;
ul {
height: 100%;
}
}
}
}
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment