feat(wms): 添加收货计划导入功能及页面组件

新增ImportGuide组件实现Excel导入功能,包含数据校验和进度展示
添加stockpile成本页面基础结构
调整delivery报表日期范围和显示列
在收货详情页增加导入和导出按钮功能
This commit is contained in:
砂糖
2025-12-01 11:56:31 +08:00
parent 49e5024f89
commit 3cf67df855
5 changed files with 58 additions and 22 deletions

View File

@@ -0,0 +1,5 @@
<template>
<div>
囤积成本页面
</div>
</template>

View File

@@ -50,11 +50,11 @@
v-loading="loading"
>
<el-table-column prop="productName" label="产品名称" min-width="120" fixed="left" />
<el-table-column prop="waybillCount" label="运单数量" min-width="100" align="center">
<!-- <el-table-column prop="waybillCount" label="运单数量" min-width="100" align="center">
<template #default="{ row }">
<span>{{ row.waybillCount || 0 }}</span>
</template>
</el-table-column>
</el-table-column> -->
<el-table-column prop="coilCount" label="卷数" min-width="100" align="center">
<template #default="{ row }">
<span>{{ row.coilCount || 0 }}</span>
@@ -65,11 +65,11 @@
<span>{{ formatWeight(row.totalWeight) }}</span>
</template>
</el-table-column>
<el-table-column prop="dailyWaybillCount" label="日均运单数" min-width="120" align="right">
<!-- <el-table-column prop="dailyWaybillCount" label="日均运单数" min-width="120" align="right">
<template #default="{ row }">
<span>{{ formatDailyValue(row.dailyWaybillCount) }}</span>
</template>
</el-table-column>
</el-table-column> -->
<el-table-column prop="dailyCoilCount" label="日均卷数" min-width="120" align="right">
<template #default="{ row }">
<span>{{ formatDailyValue(row.dailyCoilCount) }}</span>
@@ -112,11 +112,12 @@ export default {
initDateRange() {
const now = new Date()
const firstDay = new Date(now.getFullYear(), now.getMonth(), 1)
const lastDay = new Date(now.getFullYear(), now.getMonth() + 1, 0)
// const lastDay = new Date(now.getFullYear(), now.getMonth() + 1, 0)
const today = new Date()
this.dateRange = [
this.formatDate(firstDay),
this.formatDate(lastDay)
this.formatDate(today)
]
},

View File

@@ -0,0 +1,29 @@
<template>
<!-- 导入向导 -->
<!-- 1. 引导选择excel, 利用xlsx库读取excel文件内容
2. 校验excel格式通过后展示数据
3. 点击确认导入开始调用api逐条导入展示导入进度
4. 导入完成后显示完成 -->
</template>
<script>
import XLSX from 'xlsx';
import { addMaterialCoil } from '@/api/wms/coil'
import { addPendingAction } from '@/api/wms/pendingAction'
export default {
data() {
return {
file: null,
data: [],
}
},
methods: {
async importOneRecord(row) {
// 1. 插入一条dataType为10 的 钢卷数据
// 2. 插入actionStatus为0 的 待处理操作
// 3. 本行数据插入完成,进度+1
}
}
}
</script>

View File

@@ -35,10 +35,10 @@
<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-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
:disabled="!selectedPlan" title="请先选择收货计划">新增</el-button> -->
<el-button type="success" plain icon="el-icon-refresh" size="mini" @click="handleQuery">刷新</el-button>
<!-- <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">导出</el-button> -->
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
:disabled="!selectedPlan" title="导入收货计划">导入</el-button>
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">导出</el-button>
</el-form-item>
</el-form>
@@ -96,6 +96,12 @@
</el-card>
</el-col>
</el-row>
<!-- 先做导入功能通过一个钢卷的excel文件导入 -->
<el-dialog title="导入收货计划" :visible.sync="importDialogVisible" width="50%">
<ImportGuide />
</el-dialog>
</div>
</template>
@@ -103,11 +109,13 @@
import { listDeliveryPlan } from "@/api/wms/deliveryPlan"; // 导入收货计划API
import { listPendingAction } from '@/api/wms/pendingAction';
import MemoInput from "@/components/MemoInput";
import ImportGuide from "@/views/wms/receive/components/ImportGuide.vue";
export default {
name: "DeliveryWaybill",
components: {
MemoInput
MemoInput,
ImportGuide
},
data() {
return {
@@ -172,7 +180,10 @@ export default {
pageSize: 100, // 增大分页大小以确保树形结构显示足够数据
planName: undefined,
planType: 1,
}
},
// 导入弹窗
importDialogVisible: false,
};
},
created() {
@@ -275,17 +286,7 @@ export default {
/** 新增按钮操作 */
handleAdd() {
this.reset();
// 自动填入选中的planId
if (this.selectedPlan) {
this.form.planId = this.selectedPlan.planId;
// 可以根据需要填充其他相关字段
if (this.selectedPlan.planName) {
this.form.waybillName = `收货单_${this.selectedPlan.planName}`;
}
}
this.open = true;
this.title = "添加收货单";
this.importDialogVisible = true;
},
/** 修改按钮操作 */
handleUpdate(row) {