feat(wms): 添加收货计划导入功能及页面组件
新增ImportGuide组件实现Excel导入功能,包含数据校验和进度展示 添加stockpile成本页面基础结构 调整delivery报表日期范围和显示列 在收货详情页增加导入和导出按钮功能
This commit is contained in:
5
klp-ui/src/views/wms/cost/stockpile/index.vue
Normal file
5
klp-ui/src/views/wms/cost/stockpile/index.vue
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
囤积成本页面
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
@@ -50,11 +50,11 @@
|
|||||||
v-loading="loading"
|
v-loading="loading"
|
||||||
>
|
>
|
||||||
<el-table-column prop="productName" label="产品名称" min-width="120" fixed="left" />
|
<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 }">
|
<template #default="{ row }">
|
||||||
<span>{{ row.waybillCount || 0 }}</span>
|
<span>{{ row.waybillCount || 0 }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column> -->
|
||||||
<el-table-column prop="coilCount" label="卷数" min-width="100" align="center">
|
<el-table-column prop="coilCount" label="卷数" min-width="100" align="center">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<span>{{ row.coilCount || 0 }}</span>
|
<span>{{ row.coilCount || 0 }}</span>
|
||||||
@@ -65,11 +65,11 @@
|
|||||||
<span>{{ formatWeight(row.totalWeight) }}</span>
|
<span>{{ formatWeight(row.totalWeight) }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</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 }">
|
<template #default="{ row }">
|
||||||
<span>{{ formatDailyValue(row.dailyWaybillCount) }}</span>
|
<span>{{ formatDailyValue(row.dailyWaybillCount) }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column> -->
|
||||||
<el-table-column prop="dailyCoilCount" label="日均卷数" min-width="120" align="right">
|
<el-table-column prop="dailyCoilCount" label="日均卷数" min-width="120" align="right">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<span>{{ formatDailyValue(row.dailyCoilCount) }}</span>
|
<span>{{ formatDailyValue(row.dailyCoilCount) }}</span>
|
||||||
@@ -112,11 +112,12 @@ export default {
|
|||||||
initDateRange() {
|
initDateRange() {
|
||||||
const now = new Date()
|
const now = new Date()
|
||||||
const firstDay = new Date(now.getFullYear(), now.getMonth(), 1)
|
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.dateRange = [
|
||||||
this.formatDate(firstDay),
|
this.formatDate(firstDay),
|
||||||
this.formatDate(lastDay)
|
this.formatDate(today)
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
29
klp-ui/src/views/wms/receive/components/ImportGuide.vue
Normal file
29
klp-ui/src/views/wms/receive/components/ImportGuide.vue
Normal 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>
|
||||||
@@ -35,10 +35,10 @@
|
|||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
<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 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="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-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
@@ -96,6 +96,12 @@
|
|||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 先做导入功能,通过一个钢卷的excel文件导入 -->
|
||||||
|
<el-dialog title="导入收货计划" :visible.sync="importDialogVisible" width="50%">
|
||||||
|
<ImportGuide />
|
||||||
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -103,11 +109,13 @@
|
|||||||
import { listDeliveryPlan } from "@/api/wms/deliveryPlan"; // 导入收货计划API
|
import { listDeliveryPlan } from "@/api/wms/deliveryPlan"; // 导入收货计划API
|
||||||
import { listPendingAction } from '@/api/wms/pendingAction';
|
import { listPendingAction } from '@/api/wms/pendingAction';
|
||||||
import MemoInput from "@/components/MemoInput";
|
import MemoInput from "@/components/MemoInput";
|
||||||
|
import ImportGuide from "@/views/wms/receive/components/ImportGuide.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "DeliveryWaybill",
|
name: "DeliveryWaybill",
|
||||||
components: {
|
components: {
|
||||||
MemoInput
|
MemoInput,
|
||||||
|
ImportGuide
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -172,7 +180,10 @@ export default {
|
|||||||
pageSize: 100, // 增大分页大小以确保树形结构显示足够数据
|
pageSize: 100, // 增大分页大小以确保树形结构显示足够数据
|
||||||
planName: undefined,
|
planName: undefined,
|
||||||
planType: 1,
|
planType: 1,
|
||||||
}
|
},
|
||||||
|
|
||||||
|
// 导入弹窗
|
||||||
|
importDialogVisible: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@@ -275,17 +286,7 @@ export default {
|
|||||||
|
|
||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
handleAdd() {
|
handleAdd() {
|
||||||
this.reset();
|
this.importDialogVisible = true;
|
||||||
// 自动填入选中的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 = "添加收货单";
|
|
||||||
},
|
},
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
handleUpdate(row) {
|
handleUpdate(row) {
|
||||||
|
|||||||
Reference in New Issue
Block a user