feat(wms): 添加下载收货模板功能并优化代码格式

- 新增下载模板按钮及对应方法
- 调整代码缩进和格式以提高可读性
- 移除多余的空格和注释
This commit is contained in:
砂糖
2025-12-04 10:05:16 +08:00
parent b8066dece5
commit 9e65c07c4d

View File

@@ -34,7 +34,10 @@
<el-button type="success" plain icon="el-icon-refresh" size="mini" @click="handleQuery">刷新</el-button>
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
:disabled="!selectedPlan" title="导入收货计划">导入</el-button>
<el-button type="primary" plain icon="el-icon-upload" size="mini" @click="handlePrint" :disabled="!selectedPlan">打印</el-button>
<el-button type="primary" plain icon="el-icon-download" size="mini" @click="downloadTemplate"
title="下载模板">模板</el-button>
<el-button type="primary" plain icon="el-icon-upload" size="mini" @click="handlePrint"
:disabled="!selectedPlan">打印</el-button>
<!-- <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">导出</el-button> -->
</el-form-item>
</el-form>
@@ -81,7 +84,8 @@
</el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<el-button v-if="scope.row.actionStatus == 0 || scope.row.actionStatus == 1" type="primary" @click="openReceiptModal(scope.row)">签收</el-button>
<el-button v-if="scope.row.actionStatus == 0 || scope.row.actionStatus == 1" type="primary"
@click="openReceiptModal(scope.row)">签收</el-button>
</template>
</el-table-column>
<!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
@@ -99,10 +103,10 @@
</el-card>
</el-col>
</el-row>
<!-- 先做导入功能通过一个钢卷的excel文件导入, 全屏弹窗 -->
<el-dialog v-if="selectedPlan" title="导入收货计划" :visible.sync="importDialogVisible" width="80%" >
<el-dialog v-if="selectedPlan" title="导入收货计划" :visible.sync="importDialogVisible" width="80%">
<ImportGuide :planId="selectedPlan.planId" />
</el-dialog>
@@ -146,11 +150,11 @@ import ImportGuide from "@/views/wms/receive/components/ImportGuide.vue";
import ActualWarehouseSelect from "@/components/KLPService/ActualWarehouseSelect";
import CoilNo from "@/components/KLPService/Renderer/CoilNo.vue";
import Printer from "../components/Printer.vue";
import { getConfigKey } from '@/api/system/config'
export default {
name: "DeliveryWaybill",
components: {
components: {
MemoInput,
ImportGuide,
ActualWarehouseSelect,
@@ -224,7 +228,7 @@ export default {
// 导入弹窗
importDialogVisible: false,
// 确认收货表单参数
// 确认收货表单参数
receiptModalVisible: false,
receiptForm: {
currentCoilNo: null,
@@ -402,7 +406,7 @@ export default {
...this.queryParams
}, `deliveryWaybill_${new Date().getTime()}.xlsx`)
},
// 打开收货弹窗
// 打开收货弹窗
openReceiptModal(row) {
this.loading = true
// 打开确认收货弹窗
@@ -441,6 +445,13 @@ export default {
this.form = {};
this.$refs.form.resetFields();
this.buttonLoading = false;
},
// 下载模板文件
downloadTemplate() {
// 从系统参数中中读取id然后下载
getConfigKey('file.template.receive').then(res => {
this.$download.oss(res.msg);
})
}
}
};