库存管理采购管理页面

This commit is contained in:
zzyuan 2025-05-15 17:26:48 +08:00
parent b5c6a43a58
commit d967a8b610
4 changed files with 590 additions and 0 deletions

View File

@ -0,0 +1,75 @@
import request from '@/utils/request'
// 分页查询 仓库类别-列表
export function getWareHouseCategoryPageApi(data) {
return request({
url: '/smart-canteen/warehouse_category/list',
method: 'get',
headers: {
"merchant-id":"378915229716713472",
},
params:data
})
}
// 仓库类别新增
export function addWareHouseCategoryApi(data) {
return request({
url: '/smart-canteen/warehouse_category/add',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
},
data: data
})
}
// 仓库类别新增
export function editWareHouseCategoryApi(data) {
return request({
url: '/smart-canteen/warehouse_category/edit',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
},
data: data
})
}
// 仓库类别删除
export function delWareHouseCategoryApi(data) {
return request({
url: '/smart-canteen/warehouse_category/del',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
},
data: data
})
}

View File

@ -0,0 +1,235 @@
<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="searchValue">
<el-input v-model="queryParams.searchValue" placeholder="请输入关键字" maxlength="20" clearable style="width: 240px"/>
</el-form-item>
<el-form-item label="所属区域" prop="areaId">
<el-cascader v-model="queryParams.areaId"
:options="treeOptions" :filterable="true" style="width: 240px;" :show-all-levels="false"
:props="{
emitPath: false,// falseid
checkStrictly: false,//
value:'id',label:'label'
}" clearable>
</el-cascader>
</el-form-item>
<el-form-item label="供应商" prop="supplierId">
<el-select v-model="queryParams.supplierId" placeholder="请选择供应商" style="width: 240px;">
<el-option label="供应商1" :value="1"></el-option>
<el-option label="供应商2" :value="2"></el-option>
<el-option label="供应商3" :value="2"></el-option>
</el-select>
</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
size="mini"
@click=""
>录入</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="tableListData" height="800">
<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="materialCode" :show-overflow-tooltip="true" width="120"/>
<el-table-column label="货品名称" align="center" prop="materialName" :show-overflow-tooltip="true" width="120" />
<el-table-column label="货品类别" align="center" prop="categoryName" :show-overflow-tooltip="true" width="120" />
<el-table-column label="计量单位" align="center" prop="" :show-overflow-tooltip="true" width="120" />
<el-table-column label="货品规格" align="center" prop="" :show-overflow-tooltip="true" width="120" />
<el-table-column label="所属区域" align="center" prop="areaName" :show-overflow-tooltip="true" width="120"/>
<el-table-column label="最近一次采购" align="center">
<el-table-column label="价格" align="center" prop="" width="100" :show-overflow-tooltip="true" >
<!-- <template slot-scope="scope">
<span>{{ (scope.row.lastOrderGoodsPrice/100).toFixed(2) }}</span>
</template> -->
</el-table-column>
<el-table-column label="时间" align="center" prop="" width="120" :show-overflow-tooltip="true" />
<el-table-column label="供应商" align="center" prop="" width="100" :show-overflow-tooltip="true" />
</el-table-column>
<el-table-column label="市场价格" align="center">
<el-table-column label="录入/抓取时间" align="center" prop="" width="120" :show-overflow-tooltip="true" />
<el-table-column label="价格" align="center" prop="" width="100" :show-overflow-tooltip="true" >
<!-- <template slot-scope="scope">
<span>{{ (scope.row.lastOrderGoodsPrice/100).toFixed(2) }}</span>
</template> -->
</el-table-column>
<el-table-column label="来源" align="center" prop="" width="100" :show-overflow-tooltip="true" />
</el-table-column>
<el-table-column label="价格浮动比(%)" align="center" prop="" :show-overflow-tooltip="true" width="120"/>
<el-table-column label="首选供应商" align="center" prop="" :show-overflow-tooltip="true" width="120"/>
<el-table-column label="当前最新中标供应商" align="center">
<el-table-column label="供应商名称" align="center" prop="" width="100" :show-overflow-tooltip="true" />
<el-table-column label="中标价(元)" align="center" prop="" width="100" :show-overflow-tooltip="true" >
<!-- <template slot-scope="scope">
<span>{{ (scope.row.lastOrderGoodsPrice/100).toFixed(2) }}</span>
</template> -->
</el-table-column>
</el-table-column>
<el-table-column label="操作" align="center" width="180" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleView(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="评分规则配置" :visible.sync="open" width="800px" append-to-body>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { systemAreaTreeApi } from "@/api/base/stall";
import { systemMaterialTreeApi } from "@/api/dish/material";
export default {
name: "",
dicts: [],
data() {
return {
//
loading: false,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
tableListData: [
{supplierName:'111',areaName:'111'},{supplierName:'222',areaName:'222'},
],
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
supplierName: undefined,
areaId: undefined,
linkman: undefined,
status: undefined,
categoryIdList: []
},
treeTypeOptions:[],//
treeOptions:[],//
//
form: {},
//
rules: {
areaId: [
{ required: true, message: "所属区域不能为空", trigger: "change" }
],
ruleType: [
{ required: true, message: "周期配置不能为空", trigger: "change" }
]
},
};
},
created() {
this.getTypeTreeData();
this.getTreeData();
// this.getList();
},
methods: {
//
getTypeTreeData() {
let param = {
// categoryType:1,
}
systemMaterialTreeApi(param).then((response) => {
this.treeTypeOptions = response.data;
});
},
//
getTreeData() {
systemAreaTreeApi({}).then((response) => {
this.treeOptions = response.data;
});
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 查询列表 */
getList() {
this.loading = true;
let param = {
"pageNum": this.queryParams.pageNum,
"pageSize": this.queryParams.pageSize,
"supplierName": this.queryParams.supplierName,
"categoryIdList": this.queryParams.categoryIdList,
"areaId": this.queryParams.areaId,
"linkman": this.queryParams.linkman,
"status": this.queryParams.status
}
// getPageCanteenApi(param).then(response => {
// this.tableListData = response.rows;
// this.total = Number(response.total);
this.loading = false;
// });
},
//
cancel() {
this.open = false;
},
/** 提交按钮 */
submitForm: function() {
this.$refs["form"].validate(valid => {
if (valid) {
}
});
},
handleView(row){
}
}
};
</script>

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">
<img width="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>