feat: 新增物料管理看板功能及多项优化

新增物料管理看板功能,包含统计卡片和图表展示
优化物料选择器组件,支持分页和搜索功能
重构物料详情展示组件,支持动态加载数据
添加多个ECharts图表组件用于数据可视化
完善出入库和采购单相关功能,增加在途数量显示
修复若干界面显示问题和交互逻辑
This commit is contained in:
砂糖
2026-01-31 14:21:49 +08:00
parent 48e75676c5
commit 42f6f83c3a
17 changed files with 1278 additions and 115 deletions

View File

@@ -20,7 +20,11 @@
<el-table-column type="selection" width="55" align="center" />
<!-- <el-table-column label="关联ID 主键" align="center" prop="relationId" v-if="true"/> -->
<!-- <el-table-column label="产品ID 关联t_product.id" align="center" prop="productId" /> -->
<el-table-column label="配料" align="center" prop="materialId" />
<el-table-column label="配料" align="center" prop="materialId">
<template #default="scope">
<raw :data="scope.row" :materialId="scope.row.materialId" />
</template>
</el-table-column>
<el-table-column label="所需数量" align="center" prop="materialNum" />
<!-- <el-table-column label="配料排序 用于前端展示顺序" align="center" prop="sort" /> -->
<el-table-column label="备注" align="center" prop="remark" />
@@ -42,7 +46,7 @@
<el-input v-model="form.productId" placeholder="请输入产品ID 关联t_product.id" />
</el-form-item> -->
<el-form-item label="配料" prop="materialId">
<el-input v-model="form.materialId" placeholder="请输入配料" />
<raw-selector ref="rawSelector" v-model="form.materialId" placeholder="请选择配料" />
</el-form-item>
<el-form-item label="所需数量" prop="materialNum">
<el-input v-model="form.materialNum" placeholder="请输入所需数量" />
@@ -67,7 +71,8 @@
<script setup name="ProductMaterialRelation">
import { listProductMaterialRelation, getProductMaterialRelation, delProductMaterialRelation, addProductMaterialRelation, updateProductMaterialRelation } from "@/api/mat/productMaterialRelation";
import RawSelector from '@/components/RawSelector/index.vue'
import Raw from '@/components/Renderer/Raw.vue'
const { proxy } = getCurrentInstance();
const productMaterialRelationList = ref([]);
@@ -193,7 +198,7 @@ function submitForm() {
buttonLoading.value = true;
if (form.value.relationId != null) {
updateProductMaterialRelation(form.value).then(response => {
proxy.$modal.msgSuccess("修改成功");
proxy.$modal.msgSuccess("修改成功,刷新后生效");
open.value = false;
getList();
}).finally(() => {
@@ -201,7 +206,7 @@ function submitForm() {
});
} else {
addProductMaterialRelation(form.value).then(response => {
proxy.$modal.msgSuccess("新增成功");
proxy.$modal.msgSuccess("新增成功,刷新后生效");
open.value = false;
getList();
}).finally(() => {
@@ -221,7 +226,7 @@ function handleDelete(row) {
}).then(() => {
loading.value = true;
getList();
proxy.$modal.msgSuccess("删除成功");
proxy.$modal.msgSuccess("删除成功,刷新后生效");
}).catch(() => {
}).finally(() => {
loading.value = false;