feat: 更新采购计划和出入库管理功能

添加清除所有草稿功能
扩展采购计划和出入库接口类型定义
新增出入库统计和产品列表接口
重写计划详情页面数据展示逻辑
改进数据分析组件支持动态数据
优化库存管理页面查询和展示逻辑
完善详情信息组件展示和文件预览功能
This commit is contained in:
re-JZzzz
2025-09-28 20:04:30 +08:00
parent 11f9433ba7
commit 321c3fce49
12 changed files with 856 additions and 674 deletions

View File

@ -9,15 +9,15 @@
<ArrowLeft />
</el-icon>
</span>
<h2>Q2风电轴承采购计划</h2>
<h2>{{ Info.jihuaName }}</h2>
</div>
</el-card>
</el-col>
</el-row>
<el-row gutter="10">
<el-row :gutter="10">
<el-col :span="18">
<el-card>
<detailInfo />
<detailInfo :detail-info="Info" />
</el-card>
</el-col>
<el-col :span="6" style="flex-grow: 1;">
@ -46,12 +46,66 @@
cursor: pointer;
}
</style>
<script setup>
<script setup lang="ts">
import detailInfo from './components/detailInfo.vue';
import DetailsProcess from './components/DetailsProcess.vue';
import { ref, onMounted, getCurrentInstance, toRefs, watch } from 'vue';
import { useRoute } from 'vue-router';
import type { ComponentInternalInstance } from 'vue';
const route = useRoute();
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
import { caigouPlanDetail } from '@/api/wuziguanli/caigouPlan';
import { CaigouPlanVO, CaigouPlanQuery, CaigouPlanForm } from '@/api/wuziguanli/caigouPlan/types';
// 存储计划详情数据
const Info = ref<CaigouPlanVO>({} as CaigouPlanVO);
// 存储计划编号
const id = ref('');
// 获取详细信息
const getDetailInfo = async () => {
const res = await caigouPlanDetail(id.value);
if (res.code === 200) {
Info.value = res.data;
console.log(Info.value);
}
}
onMounted(() => {
// 接收路由参数
id.value = route.query.id as string || '';
console.log('组件挂载时路由参数id:', id.value);
// 确保id不为空时才调用接口
if (id.value) {
getDetailInfo();
} else {
proxy.$modal.msgError('未获取到详细信息')
setTimeout(() => {
router.back();
}, 800);
}
});
// 监听路由参数变化
watch(
() => route.query.id,
(newId) => {
id.value = newId as string || '';
if (id.value) {
getDetailInfo();
}
},
{ immediate: true }
);
const router = useRouter();
const handleBack = () => {
router.back();
}
</script>