feat: 新增收货计划功能并优化入库界面

fix(ui): 修正发货单和收货单界面显示问题

docs: 添加KLPTable组件使用文档

refactor: 重构入库记录显示为表格形式

style: 清理无用代码并统一命名规范
This commit is contained in:
砂糖
2025-11-29 17:24:46 +08:00
parent 1c10423429
commit 6c37c934bc
6 changed files with 497 additions and 92 deletions

View File

@@ -0,0 +1,4 @@
## 组件用法
1. 将原有的el-table标签改为KLPTable标签该组件已经全局注册可以直接使用无需带入。
2. 要展示浮层需要在表格组件上设置props,将floatLayer设置为true这时表格中有哪些列浮层就会展示哪些信息。
3. 如果需要单独设置浮层展示的信息例如展示表格中不存在但数据中存在的列需要在标签上增加一个props配置设置floatLayerConfig.columns为要展示的列示例[ { label: 'xxx', props: 'xxx.xxx' // 支持展示多层的数据 }, { label: '标签', props: 'xxx' } ]

View File

@@ -8,6 +8,18 @@
<h3 class="section-title">新增入库</h3>
</div>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-row>
<el-col :span="24">
<el-form-item label="收货计划" prop="planId">
<el-select style="width: 100%;" v-model="form.planId" placeholder="请输入计划名称搜索收货计划" filterable remote
:remote-method="remoteMethod">
<el-option v-for="item in planList" :key="item.planId" :label="item.planName"
:value="item.planId" />
</el-select>
</el-form-item>
<!-- 查找并选择选择收货计划, 使用远程搜索 -->
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="入场钢卷号" prop="enterCoilNo">
@@ -33,12 +45,12 @@
clearable />
</el-form-item>
</el-col>
<el-col :span="12">
<!-- <el-col :span="12">
<el-form-item label="实际库区" prop="actualWarehouseId">
<actual-warehouse-select v-model="form.actualWarehouseId" placeholder="请选择实际库区" style="width: 100%;"
clearable />
</el-form-item>
</el-col>
</el-col> -->
<el-col :span="12">
<el-form-item label="班组" prop="team">
<el-input v-model="form.team" placeholder="请输入班组" />
@@ -121,7 +133,7 @@
<el-col :span="12">
<div class="section-card">
<!-- 入库记录 -->
<div class="section-header">
<div class="section-header">
<h3 class="section-title">入库记录</h3>
<el-button size="mini" icon="el-icon-refresh" @click="getList">刷新</el-button>
</div>
@@ -133,45 +145,46 @@
<el-button type="primary" @click="getList">查询</el-button>
</el-form-item>
</el-form>
<!-- 待操作卡片列表 -->
<div class="card-grid-container">
<div v-if="pendingActions.length === 0" class="empty-state">
<i class="el-icon-document"></i>
<p>暂无入库记录</p>
</div>
<div
v-for="(item, index) in pendingActions"
:key="item.actionId || index"
class="action-card"
:class="{
'urgent-card': item.priority === 2,
'important-card': item.priority === 1
}"
>
<div class="card-header">
<el-tag type="info" size="small" class="coil-no-tag">{{ item.currentCoilNo }}</el-tag>
</div>
<div class="card-body">
<div class="info-list">
<div class="info-item">
<span class="info-label">创建人</span>
<span class="info-value">{{ item.createBy || '—' }}</span>
</div>
<div class="info-item">
<span class="info-label">创建时间</span>
<span class="info-value">{{ parseTime(item.createTime, '{m}-{d} {h}:{i}') || '—' }}</span>
</div>
</div>
</div>
</div>
</div>
<Pagination v-show="total > 0" :total="total" :page.sync="pagination.currentPage"
<!-- 待操作卡片列表 -->
<div v-if="pendingActions.length === 0" v-loading="loading" class="empty-state">
<i class="el-icon-document"></i>
<p>暂无入库记录</p>
</div>
<el-table v-else v-loading="loading" border :data="pendingActions" highlight-current-row>
<el-table-column label="钢卷号" align="center" prop="currentCoilNo" :show-overflow-tooltip="true">
<template slot-scope="scope">
<el-tag type="info" size="small">{{ scope.row.currentCoilNo }}</el-tag>
</template>
</el-table-column>
<el-table-column label="优先级" align="center" prop="priority" width="90">
<template slot-scope="scope">
<el-tag v-if="scope.row.priority === 0" type="info" size="mini">普通</el-tag>
<el-tag v-else-if="scope.row.priority === 1" type="warning" size="mini">重要</el-tag>
<el-tag v-else-if="scope.row.priority === 2" type="danger" size="mini">紧急</el-tag>
</template>
</el-table-column>
<el-table-column label="新增时间" align="center" prop="createTime" width="155" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}') }}</span>
</template>
</el-table-column>
<el-table-column label="创建人" align="center" prop="createBy" width="100" />
<el-table-column label="操作状态" align="center" prop="actionStatus" width="120">
<template slot-scope="scope">
<el-tag v-if="scope.row.actionStatus === 2" type="success">已收货</el-tag>
<el-tag v-else type="primary">未收货</el-tag>
</template>
</el-table-column>
</el-table>
<Pagination v-show="total > 0" :total="total" :page.sync="pagination.pageNum"
:limit.sync="pagination.pageSize" @pagination="getList" />
</div>
</div>
</el-col>
</el-row>
</div>
@@ -186,6 +199,7 @@ import WarehouseSelect from "@/components/KLPService/WarehouseSelect";
import ProductSelect from "@/components/KLPService/ProductSelect";
import RawMaterialSelect from "@/components/KLPService/RawMaterialSelect";
import { Pagination } from 'element-ui';
import { listDeliveryPlan } from '@/api/wms/deliveryPlan'
// 键值为[400, 500), 不包含在字典中但后续可以加入的特殊操作这类操作录入后会立刻完成例如入库401和发货402
@@ -211,6 +225,7 @@ export default {
netWeight: null,
grossWeight: null,
remark: null,
dataType: 10, // 表示将要入库但是还未入库的钢卷,一般用于钢卷入库的操作去创建一个无法被检索到的钢卷
trimmingRequirement: null,
packingStatus: null,
packagingRequirement: null,
@@ -222,12 +237,15 @@ export default {
},
// 分页参数
pagination: {
currentPage: 1,
pageNum: 1,
pageSize: 10,
},
total: 0,
// 表单校验
rules: {
planId: [
{ required: true, message: "请选择收货计划", trigger: "change" }
],
enterCoilNo: [
{ required: true, message: "入场钢卷号不能为空", trigger: "blur" }
],
@@ -248,6 +266,7 @@ export default {
{ required: true, message: "毛重不能为空", trigger: "blur" }
],
},
planList: [],
}
},
mounted() {
@@ -276,6 +295,11 @@ export default {
this.form.itemType = 'raw_material';
}
},
remoteMethod(query) {
listDeliveryPlan({ planName: query, pageNum: 1, pageSize: 5, planType: 1 }).then(res => {
this.planList = res.rows
})
},
getList() {
// 获取入库历史
this.loading = true
@@ -292,13 +316,16 @@ export default {
this.buttonLoading = true;
addMaterialCoil(this.form).then(response => {
addPendingAction({
// 计划ID 对应 warehouseId warehouseId字段并不是仓库ID而是一个根据操作类型自适应的查询字段
warehouseId: this.form.planId,
actionType: 401,
currentCoilNo: this.form.currentCoilNo,
sourceType: 'manual',
coilId: response.data.coilId,
// coilId: 0,
priority: 0,
remark: this.form.remark,
actionStatus: 2,
actionStatus: 0,
}).then(res => {
this.$modal.msgSuccess("入库成功");
this.getList()
@@ -306,6 +333,8 @@ export default {
}).finally(() => {
this.buttonLoading = false;
});
}
});
},
@@ -354,6 +383,7 @@ export default {
.section-header {
border-bottom-color: #409eff;
}
.section-title {
color: #409eff;
}
@@ -363,6 +393,7 @@ export default {
.section-header {
border-bottom-color: #67c23a;
}
.section-title {
color: #67c23a;
}
@@ -384,25 +415,25 @@ export default {
max-height: calc(100vh - 320px);
overflow-y: auto;
padding-right: 4px;
&::-webkit-scrollbar {
width: 6px;
}
&::-webkit-scrollbar-track {
background: #f1f1f1;
border-radius: 3px;
}
&::-webkit-scrollbar-thumb {
background: #c1c1c1;
border-radius: 3px;
&:hover {
background: #a8a8a8;
}
}
@media (min-width: 1600px) {
grid-template-columns: repeat(4, 1fr);
}
@@ -413,14 +444,14 @@ export default {
text-align: center;
padding: 60px 20px;
color: #909399;
i {
font-size: 48px;
margin-bottom: 16px;
display: block;
color: #c0c4cc;
}
p {
margin: 0;
font-size: 14px;
@@ -436,51 +467,51 @@ export default {
flex-direction: column;
transition: all 0.3s ease;
height: 100%;
&:hover {
border-color: #409eff;
box-shadow: 0 2px 6px rgba(64, 158, 255, 0.12);
}
.card-header {
padding: 6px 8px;
border-bottom: 1px solid #e4e7ed;
background-color: #fafafa;
.header-left {
display: flex;
align-items: center;
gap: 6px;
}
.coil-no-tag {
font-weight: 600;
font-size: 11px;
padding: 2px 6px;
}
.material-type {
font-size: 11px;
color: #606266;
font-weight: 500;
}
.param-icon {
font-size: 13px;
color: #909399;
cursor: pointer;
transition: color 0.3s;
&:hover {
color: #409eff;
}
}
}
.card-body {
padding: 8px;
flex: 1;
.info-list {
.info-item {
display: flex;
@@ -488,11 +519,11 @@ export default {
margin-bottom: 4px;
font-size: 11px;
line-height: 1.4;
&:last-child {
margin-bottom: 0;
}
.info-label {
color: #909399;
white-space: nowrap;
@@ -500,7 +531,7 @@ export default {
min-width: 40px;
font-size: 11px;
}
.info-value {
color: #303133;
flex: 1;
@@ -512,14 +543,14 @@ export default {
}
}
}
.card-footer {
padding: 6px 8px;
border-top: 1px solid #e4e7ed;
background-color: #fafafa;
display: flex;
justify-content: center;
.action-btn {
width: 100%;
padding: 5px 10px;
@@ -537,32 +568,32 @@ export default {
flex-direction: column;
transition: all 0.3s ease;
height: 100%;
&:hover {
border-color: #67c23a;
box-shadow: 0 2px 8px rgba(103, 194, 58, 0.15);
}
&.urgent-card {
border-left: 4px solid #f56c6c;
background-color: #fef0f0;
&:hover {
border-color: #f56c6c;
box-shadow: 0 2px 8px rgba(245, 108, 108, 0.2);
}
}
&.important-card {
border-left: 4px solid #e6a23c;
background-color: #fdf6ec;
&:hover {
border-color: #e6a23c;
box-shadow: 0 2px 8px rgba(230, 162, 60, 0.2);
}
}
.card-header {
padding: 10px 12px;
border-bottom: 1px solid #e4e7ed;
@@ -570,41 +601,41 @@ export default {
display: flex;
justify-content: space-between;
align-items: center;
.coil-no-tag {
font-weight: 600;
font-size: 12px;
}
.status-tags {
display: flex;
gap: 4px;
flex-wrap: wrap;
}
}
.card-body {
padding: 12px;
flex: 1;
.info-list {
.info-item {
display: flex;
align-items: center;
margin-bottom: 8px;
font-size: 12px;
&:last-child {
margin-bottom: 0;
}
.info-label {
color: #909399;
white-space: nowrap;
margin-right: 6px;
min-width: 50px;
}
.info-value {
color: #303133;
flex: 1;
@@ -612,14 +643,14 @@ export default {
text-overflow: ellipsis;
white-space: nowrap;
}
.action-type-tag {
font-size: 11px;
}
}
}
}
.card-footer {
padding: 10px 12px;
border-top: 1px solid #e4e7ed;
@@ -627,7 +658,7 @@ export default {
display: flex;
justify-content: center;
gap: 6px;
.action-btn {
flex: 1;
font-size: 12px;
@@ -656,7 +687,7 @@ export default {
padding-bottom: 8px;
border-bottom: 1px solid #e4e7ed;
}
.params-list {
.param-item {
.param-row {
@@ -664,17 +695,17 @@ export default {
margin-bottom: 6px;
font-size: 12px;
line-height: 1.5;
&:last-child {
margin-bottom: 0;
}
.param-label {
color: #909399;
min-width: 70px;
margin-right: 8px;
}
.param-value {
color: #303133;
flex: 1;
@@ -682,7 +713,7 @@ export default {
}
}
}
.param-divider {
height: 1px;
background-color: #e4e7ed;

View File

@@ -175,6 +175,7 @@ export default {
pageSize: 10,
planName: undefined,
planDate: undefined,
planType: 0,
},
// 表单参数
form: {},
@@ -214,6 +215,7 @@ export default {
planId: undefined,
planName: undefined,
planDate: undefined,
planType: 0,
remark: undefined,
delFlag: undefined,
createTime: undefined,
@@ -247,6 +249,8 @@ export default {
this.form.planDate = new Date().toLocaleString().replace('T', ' ').replace().replace(/\//g, '-')
// 发货计划名称格式为年-月-日命名
this.form.planName = new Date().toLocaleDateString().replace(/\//g, '-') + '发货计划'
// 计划类型为发货计划
this.form.planType = 0
this.open = true;
this.title = "添加发货计划";
},

View File

@@ -82,13 +82,12 @@
<DeliveryWaybillDetail ref="detailTable" :waybillId="waybillId" />
</el-card>
</el-col>
</el-row>
<!-- 添加或修改发货单对话框 -->
<!-- 添加或修改发货单对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="发货单名称" prop="waybillName">
@@ -168,7 +167,7 @@ export default {
showSearch: true,
// 总条数
total: 0,
// 发货单表格数据
// 发货单表格数据
deliveryWaybillList: [],
waybillId: null,
// 打印相关数据
@@ -213,7 +212,8 @@ export default {
planQueryParams: {
pageNum: 1,
pageSize: 100, // 增大分页大小以确保树形结构显示足够数据
planName: undefined
planName: undefined,
planType: 0,
}
};
},
@@ -222,7 +222,7 @@ export default {
this.getPlanList();
},
methods: {
/** 查询发货单列表 */
/** 查询发货单列表 */
getList() {
this.loading = true;
// 确保查询参数包含planId
@@ -334,7 +334,7 @@ export default {
}
}
this.open = true;
this.title = "添加发货单";
this.title = "添加发货单";
},
/** 修改按钮操作 */
handleUpdate(row) {
@@ -345,7 +345,7 @@ export default {
this.loading = false;
this.form = response.data;
this.open = true;
this.title = "修改发货单";
this.title = "修改发货单";
});
},
/** 提交按钮 */
@@ -376,7 +376,7 @@ export default {
/** 删除按钮操作 */
handleDelete(row) {
const waybillIds = row.waybillId || this.ids;
this.$modal.confirm('是否确认删除发货单编号为"' + waybillIds + '"的数据项?').then(() => {
this.$modal.confirm('是否确认删除发货单编号为"' + waybillIds + '"的数据项?').then(() => {
this.loading = true;
return delDeliveryWaybill(waybillIds);
}).then(() => {

View File

@@ -0,0 +1,365 @@
<template>
<div class="app-container">
<el-row :gutter="10">
<el-col :span="4">
<el-card>
<el-input v-model="planQueryParams.planName" placeholder="计划名称" clearable @change="handlePlanQuery"
style="width: 100%;" />
<el-tree v-loading="planLoading" :data="planTreeData" :props="planTreeProps" @node-click="handlePlanSelect"
default-expand-all style="margin-top: 10px; height: 550px; overflow: auto;">
<template slot-scope="{ node, data }">
<span class="plan-node">
<span class="plan-name">{{ data.planName }}</span>
</span>
</template>
</el-tree>
<pagination v-show="planTotal > 0" :total="planTotal" :page.sync="planQueryParams.pageNum"
:limit.sync="planQueryParams.pageSize" @pagination="getPlanList" style="margin-top: 10px;"
layout="total, prev, jumper, next" />
</el-card>
</el-col>
<el-col :span="20">
<el-card>
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
label-width="68px">
<el-form-item label="收货单名称" prop="waybillName">
<el-input v-model="queryParams.waybillName" placeholder="请输入收货单名称" clearable
@keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="收货单位" prop="consigneeUnit">
<el-input v-model="queryParams.consigneeUnit" placeholder="请输入收货单位" clearable
@keyup.enter.native="handleQuery" />
</el-form-item>
<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-form-item>
</el-form>
<el-table v-loading="loading" border :data="deliveryWaybillList" highlight-current-row>
<el-table-column label="钢卷号" align="center" prop="currentCoilNo" :show-overflow-tooltip="true">
<template slot-scope="scope">
<el-tag type="info" size="small">{{ scope.row.currentCoilNo }}</el-tag>
</template>
</el-table-column>
<el-table-column label="优先级" align="center" prop="priority">
<template slot-scope="scope">
<el-tag v-if="scope.row.priority === 0" type="info" size="mini">普通</el-tag>
<el-tag v-else-if="scope.row.priority === 1" type="warning" size="mini">重要</el-tag>
<el-tag v-else-if="scope.row.priority === 2" type="danger" size="mini">紧急</el-tag>
</template>
</el-table-column>
<el-table-column label="来源" align="center" prop="sourceType">
<template slot-scope="scope">
<el-tag v-if="scope.row.sourceType === 'scan'" type="success" size="mini">
<i class="el-icon-mobile"></i> 扫码
</el-tag>
<el-tag v-else type="info" size="mini">
<i class="el-icon-edit-outline"></i> 手动
</el-tag>
</template>
</el-table-column>
<el-table-column label="新增时间" align="center" prop="createTime" width="155" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}') }}</span>
</template>
</el-table-column>
<el-table-column label="创建人" align="center" prop="createBy" width="100" />
<el-table-column label="操作状态" align="center" prop="actionStatus" width="120">
<template slot-scope="scope">
<el-tag v-if="scope.row.actionStatus === 2" type="success">已收货</el-tag>
<el-tag v-else type="primary">未收货</el-tag>
</template>
</el-table-column>
<!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit"
@click.stop="handleUpdate(scope.row)">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete"
@click.stop="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column> -->
</el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize" @pagination="getList" />
</el-card>
</el-col>
</el-row>
</div>
</template>
<script>
import { listDeliveryPlan } from "@/api/wms/deliveryPlan"; // 导入收货计划API
import { listPendingAction } from '@/api/wms/pendingAction';
import MemoInput from "@/components/MemoInput";
export default {
name: "DeliveryWaybill",
components: {
MemoInput
},
data() {
return {
// 按钮loading
buttonLoading: false,
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 收货单表格数据
deliveryWaybillList: [],
waybillId: null,
// 打印相关数据
printDialogVisible: false,
currentWaybill: {},
currentWaybillDetails: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
waybillNo: undefined,
waybillName: undefined,
licensePlate: undefined,
consigneeUnit: undefined,
senderUnit: undefined,
deliveryTime: undefined,
weighbridge: undefined,
salesPerson: undefined,
principal: undefined,
principalPhone: undefined,
status: undefined,
planId: undefined
},
// 表单参数
form: {},
// 表单校验
rules: {},
// 收货计划相关数据
planList: [],
planTreeData: [],
planTreeProps: {
label: 'planName',
children: 'children'
},
planTotal: 0,
planLoading: false,
selectedPlan: null,
planQueryParams: {
pageNum: 1,
pageSize: 100, // 增大分页大小以确保树形结构显示足够数据
planName: undefined,
planType: 1,
}
};
},
created() {
this.getList();
this.getPlanList();
},
methods: {
/** 查询收货单列表 */
getList() {
this.loading = true;
// 确保查询参数包含planId
const params = {
...this.queryParams,
actionType: 401, // 401表示钢卷入库
// 如果选中了计划将计划作为查询条件虽然字段名交warehouseId但实际存储的是计划Id
warehouseId: this.selectedPlan ? this.selectedPlan.planId : undefined
};
listPendingAction(params).then(response => {
this.deliveryWaybillList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
waybillId: undefined,
waybillNo: new Date().getTime(),
waybillName: undefined,
planId: undefined,
licensePlate: undefined,
consigneeUnit: undefined,
senderUnit: '科伦普',
deliveryTime: undefined,
weighbridge: undefined,
salesPerson: undefined,
principal: undefined,
principalPhone: undefined,
status: undefined,
remark: undefined,
delFlag: undefined,
createTime: undefined,
createBy: undefined,
updateTime: undefined,
updateBy: undefined
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
// 重置查询时保留planId
if (this.selectedPlan) {
this.queryParams.planId = this.selectedPlan.planId;
}
this.handleQuery();
},
// 获取收货计划列表
getPlanList() {
this.planLoading = true;
listDeliveryPlan(this.planQueryParams).then(response => {
this.planList = response.rows;
this.planTotal = response.total;
// 转换为树形数据格式
this.planTreeData = response.rows;
this.planLoading = false;
});
},
// 收货计划搜索
handlePlanQuery() {
this.planQueryParams.pageNum = 1;
this.getPlanList();
},
// 收货计划重置
resetPlanQuery() {
this.planQueryParams.planName = undefined;
this.handlePlanQuery();
},
handlePlanSelect(row) {
this.selectedPlan = row;
// 更新查询参数根据选中的planId筛选收货单
this.queryParams.planId = row.planId;
this.waybillId = null;
this.getList();
},
handleRowClick(row) {
this.waybillId = row.waybillId;
},
/** 新增按钮操作 */
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 = "添加收货单";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.loading = true;
this.reset();
const waybillId = row.waybillId || this.ids
getDeliveryWaybill(waybillId).then(response => {
this.loading = false;
this.form = response.data;
this.open = true;
this.title = "修改收货单";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
this.buttonLoading = true;
if (this.form.waybillId != null) {
updateDeliveryWaybill(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
}).finally(() => {
this.buttonLoading = false;
});
} else {
addDeliveryWaybill(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
}).finally(() => {
this.buttonLoading = false;
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const waybillIds = row.waybillId || this.ids;
this.$modal.confirm('是否确认删除收货单编号为"' + waybillIds + '"的数据项?').then(() => {
this.loading = true;
return delDeliveryWaybill(waybillIds);
}).then(() => {
this.loading = false;
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {
}).finally(() => {
this.loading = false;
});
},
/** 导出按钮操作 */
handleExport() {
this.download('wms/deliveryWaybill/export', {
...this.queryParams
}, `deliveryWaybill_${new Date().getTime()}.xlsx`)
},
}
};
</script>
<style scoped>
.plan-container {
padding: 10px;
height: 100%;
border-right: 1px solid #ebeef5;
}
.plan-container h3 {
margin: 0 0 10px 0;
padding: 0;
font-size: 16px;
font-weight: 500;
}
</style>

View File

@@ -28,6 +28,7 @@ public class WmsCoilPendingActionBo extends BaseEntity {
/**
* 关联的钢卷ID
*/
// 对于入库操作这个时候还不存在钢卷因此无法关联钢卷ID因此先关联为0如果id为0则跟未关联是相同的
@NotNull(message = "关联的钢卷ID不能为空", groups = { AddGroup.class, EditGroup.class })
private Long coilId;