库存仓库管理

This commit is contained in:
zzyuan 2025-06-30 14:22:19 +08:00
parent 91305bfd88
commit 6077b41438
2 changed files with 715 additions and 0 deletions

View File

@ -0,0 +1,435 @@
<template>
<div class="app-container">
<div class="depotleft">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="90px">
<el-form-item label="" prop="areaId">
<el-cascader v-model="queryParams.areaId" placeholder="所属区域"
:options="treeAreaOptions" :filterable="true" style="width: 100%;" :show-all-levels="false"
:props="{
emitPath: false,// falseid
checkStrictly: false,//
value:'id',label:'label'
}" clearable @change="handleAreaChange">
</el-cascader>
</el-form-item>
<el-form-item label="">
<el-input v-model="queryParams.categoryName" placeholder="请输入仓库类别" maxlength="20" clearable style="width: 140px;float: left;"/>
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAddAll"
>新增</el-button>
</el-col>
</el-form-item>
<div class="master-depot-main">
<div class="master-depot-item"
v-for="child in allDepots"
>
<p >{{child.name}}</p>
<div class="button-wrap">
<el-button style="padding: 5px 5px;"
type="primary"
plain
icon="el-icon-edit"
size="mini"
@click="handleAddAll"
></el-button>
<el-button style="padding: 5px 5px;"
type="primary"
plain
icon="el-icon-delete"
size="mini"
@click="handleAddAll"
></el-button>
</div>
</div>
</div>
</el-form>
</div>
<div class="depotright">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="90px">
<el-form-item label="所属区域" prop="areaId">
<el-cascader v-model="queryParams.areaId"
:options="treeAreaOptions" :filterable="true" style="width: 100%;" :show-all-levels="false"
:props="{
emitPath: false,// falseid
checkStrictly: false,//
value:'id',label:'label'
}" clearable @change="handleAreaChange">
</el-cascader>
</el-form-item>
<el-form-item label="仓库类别">
<el-input v-model="queryParams.categoryName" placeholder="请输入仓库类别" maxlength="20" clearable style="width: 220px"/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
>新增</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="tableListData" height="800" ref="multipleTable">
<el-table-column label="序号" align="center" width="80" type="index" fixed="left">
<template slot-scope="scope">
<span>{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}</span>
</template>
</el-table-column>
<el-table-column label="仓库类别名称" align="center" prop="categoryName" :show-overflow-tooltip="true" >
</el-table-column>
<el-table-column label="所属区域" align="center" prop="areaName" :show-overflow-tooltip="true" >
</el-table-column>
<!-- <el-table-column label="创建人" align="center" prop="createBy" :show-overflow-tooltip="true" >
</el-table-column> -->
<el-table-column label="创建时间" align="center" prop="createTime" :show-overflow-tooltip="true" >
</el-table-column>
<el-table-column label="操作" align="center" width="200" class-name="small-padding fixed-width" fixed="right">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 对话框 -->
<el-dialog :title="title" :visible.sync="open" width="680px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row>
<el-col :span="24">
<el-form-item label="所属区域" prop="areaId">
<el-cascader v-model="form.areaId"
:options="treeAreaOptions" :filterable="true" style="width: 100%;" :show-all-levels="false"
:props="{
emitPath: false,// falseid
checkStrictly: false,//
value:'id',label:'label'
}" clearable>
</el-cascader>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="仓库类别名称" prop="categoryName">
<el-input v-model="form.categoryName" placeholder="请输入仓库类别名称" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<el-dialog :title="titleAll" :visible.sync="openAll" width="680px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row>
<el-col :span="24">
<el-form-item label="所属区域" prop="areaId">
<el-cascader v-model="form.areaId"
:options="treeAreaOptions" :filterable="true" style="width: 100%;" :show-all-levels="false"
:props="{
emitPath: false,// falseid
checkStrictly: false,//
value:'id',label:'label'
}" clearable>
</el-cascader>
</el-form-item>
</el-col>
</el-row>
<div>
<div>
<table>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</table>
</div>
</div>
<el-row>
<el-col :span="24">
<el-form-item label="仓库类别名称" prop="categoryName">
<el-input v-model="form.categoryName" placeholder="请输入仓库类别名称" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<el-dialog :visible.sync="dialogVisible">
<img width="100%" :src="dialogImageUrl" alt="">
</el-dialog>
</div>
</div>
</template>
<script>
import { systemAreaTreeApi } from "@/api/base/stall";
import { getWareHouseCategoryPageApi,addWareHouseCategoryApi,editWareHouseCategoryApi,delWareHouseCategoryApi } from "@/api/stockManage/index";
export default {
name: "",
dicts: [],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
tableListData: [],
title:"",
//
open: false,
titleAll:"",
//
openAll: false,
allDepots:[{"id":"111","name":"总仓库一"},{"id":"222","name":"总仓库二"},{"id":"333","name":"总仓库三"}],
chronicOptions:[],
treeAreaOptions:[],
//
queryParams: {
pageNum: 1,
pageSize: 10,
categoryName: null,
areaId: null,
},
form: {
areaId:null,
categoryName:null,
},//
rules: {
areaId: [
{ required: true, message: "所属区域不能为空", trigger: "blur" }
],
categoryName: [
{ required: true, message: "仓库类别名称不能为空", trigger: "blur" }
]
}
};
},
created() {
this.getList()
this.getAreaTreeData();
},
methods: {
//
getAreaTreeData() {
systemAreaTreeApi({}).then((response) => {
this.treeAreaOptions = response.data;
});
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams = {
pageNum: 1,
pageSize: 10,
areaId:null,
categoryName: null
}
this.resetForm("queryForm");
this.handleQuery();
},
/** 查询列表 */
getList() {
this.loading = true;
let param = {
...this.queryParams
}
getWareHouseCategoryPageApi(param).then(response => {
this.tableListData = response.rows;
this.total = Number(response.total);
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
areaId:null,
categoryName:null,
};
this.resetForm("form");
},
resetAll() {
this.form = {
areaIdAll:null,
categoryNameAll:null,
};
this.resetForm("form");
},
handleAddAll() {
this.resetAll();
this.openAll = true;
this.titleAll = "新增总仓";
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "新增";
},
handleUpdate(row) {
this.form = Object.assign({}, row);
this.open = true;
this.title = "修改";
},
/** 提交按钮 */
submitForm: function() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.categoryId != undefined) {
editWareHouseCategoryApi(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addWareHouseCategoryApi(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
handleDelete(row) {
this.$modal.confirm('是否确认删除数据项?').then(function() {
return delWareHouseCategoryApi({categoryId:row.categoryId});
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功!");
}).catch(() => {});
}
}
};
</script>
<style lang="scss" scoped>
.app-container {
height: calc(100vh - 84px);
padding: 20px;
-webkit-box-sizing: border-box;
box-sizing: border-box;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-ms-flex-direction: column;
flex-direction: row;
overflow-x: auto;
}
.depotleft{
float: left;
width: 16%;
}
.depotright{
float: left;
width: 82%;
}
.master-depot-main {
padding: 15px 0;
height: calc(100% - 100px);
overflow-y: auto;
}
.master-depot-main .master-depot-item {
padding: 0 5px 0 15px;
cursor: pointer;
line-height: 40px;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-webkit-box-pack: justify;
-ms-flex-pack: justify;
justify-content: space-between;
border-bottom: 1px solid #f5f7fa;
}
.remind-question{
width: 100%;
height: 50px;
font-size: 22px;
display: flex;
align-items: center;
justify-content: center;
}
.remind-title{
width: 100%;
height: 40px;
font-size: 16px;
font-weight: bold;
color: #000;
display: flex;
align-items: center;
justify-content: center;
}
//css
::v-deep.disabled {
.el-upload--picture-card {
display: none;
}
}
</style>

View File

@ -0,0 +1,280 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="90px">
<el-form-item label="所属区域" prop="areaId">
<el-cascader v-model="queryParams.areaId"
:options="treeAreaOptions" :filterable="true" style="width: 100%;" :show-all-levels="false"
:props="{
emitPath: false,// falseid
checkStrictly: false,//
value:'id',label:'label'
}" clearable @change="handleAreaChange">
</el-cascader>
</el-form-item>
<el-form-item label="仓库类别">
<el-input v-model="queryParams.categoryName" placeholder="请输入仓库类别" maxlength="20" clearable style="width: 220px"/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
>新增</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="tableListData" height="800" ref="multipleTable">
<el-table-column label="序号" align="center" width="80" type="index" fixed="left">
<template slot-scope="scope">
<span>{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}</span>
</template>
</el-table-column>
<el-table-column label="仓库类别名称" align="center" prop="categoryName" :show-overflow-tooltip="true" >
</el-table-column>
<el-table-column label="所属区域" align="center" prop="areaName" :show-overflow-tooltip="true" >
</el-table-column>
<!-- <el-table-column label="创建人" align="center" prop="createBy" :show-overflow-tooltip="true" >
</el-table-column> -->
<el-table-column label="创建时间" align="center" prop="createTime" :show-overflow-tooltip="true" >
</el-table-column>
<el-table-column label="操作" align="center" width="200" class-name="small-padding fixed-width" fixed="right">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 对话框 -->
<el-dialog :title="title" :visible.sync="open" width="680px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row>
<el-col :span="24">
<el-form-item label="所属区域" prop="areaId">
<el-cascader v-model="form.areaId"
:options="treeAreaOptions" :filterable="true" style="width: 100%;" :show-all-levels="false"
:props="{
emitPath: false,// falseid
checkStrictly: false,//
value:'id',label:'label'
}" clearable>
</el-cascader>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="仓库类别名称" prop="categoryName">
<el-input v-model="form.categoryName" placeholder="请输入仓库类别名称" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<el-dialog :visible.sync="dialogVisible" width="700px">
<img style="width: 100%;height: 100%;" :src="dialogImageUrl" alt="">
</el-dialog>
</div>
</template>
<script>
import { systemAreaTreeApi } from "@/api/base/stall";
import { getWareHouseCategoryPageApi,addWareHouseCategoryApi,editWareHouseCategoryApi,delWareHouseCategoryApi } from "@/api/stockManage/index";
export default {
name: "",
dicts: [],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
tableListData: [],
title:"",
//
open: false,
chronicOptions:[],
treeAreaOptions:[],
//
queryParams: {
pageNum: 1,
pageSize: 10,
categoryName: null,
areaId: null,
},
form: {
areaId:null,
categoryName:null,
},//
rules: {
areaId: [
{ required: true, message: "所属区域不能为空", trigger: "blur" }
],
categoryName: [
{ required: true, message: "仓库类别名称不能为空", trigger: "blur" }
]
}
};
},
created() {
this.getList()
this.getAreaTreeData();
},
methods: {
//
getAreaTreeData() {
systemAreaTreeApi({}).then((response) => {
this.treeAreaOptions = response.data;
});
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams = {
pageNum: 1,
pageSize: 10,
areaId:null,
categoryName: null
}
this.resetForm("queryForm");
this.handleQuery();
},
/** 查询列表 */
getList() {
this.loading = true;
let param = {
...this.queryParams
}
getWareHouseCategoryPageApi(param).then(response => {
this.tableListData = response.rows;
this.total = Number(response.total);
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
areaId:null,
categoryName:null,
};
this.resetForm("form");
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "新增";
},
handleUpdate(row) {
this.form = Object.assign({}, row);
this.open = true;
this.title = "修改";
},
/** 提交按钮 */
submitForm: function() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.categoryId != undefined) {
editWareHouseCategoryApi(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addWareHouseCategoryApi(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
handleDelete(row) {
this.$modal.confirm('是否确认删除数据项?').then(function() {
return delWareHouseCategoryApi({categoryId:row.categoryId});
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
}
}
};
</script>
<style lang="scss" scoped>
.remind-question{
width: 100%;
height: 50px;
font-size: 22px;
display: flex;
align-items: center;
justify-content: center;
}
.remind-title{
width: 100%;
height: 40px;
font-size: 16px;
font-weight: bold;
color: #000;
display: flex;
align-items: center;
justify-content: center;
}
//css
::v-deep.disabled {
.el-upload--picture-card {
display: none;
}
}
</style>