feat: 新增收货计划功能并优化入库界面
fix(ui): 修正发货单和收货单界面显示问题 docs: 添加KLPTable组件使用文档 refactor: 重构入库记录显示为表格形式 style: 清理无用代码并统一命名规范
This commit is contained in:
4
klp-ui/src/components/KLPUI/KLPTable/readme.md
Normal file
4
klp-ui/src/components/KLPUI/KLPTable/readme.md
Normal 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' } ]
|
||||||
@@ -8,6 +8,18 @@
|
|||||||
<h3 class="section-title">新增入库</h3>
|
<h3 class="section-title">新增入库</h3>
|
||||||
</div>
|
</div>
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
<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-row>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="入场钢卷号" prop="enterCoilNo">
|
<el-form-item label="入场钢卷号" prop="enterCoilNo">
|
||||||
@@ -33,12 +45,12 @@
|
|||||||
clearable />
|
clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<!-- <el-col :span="12">
|
||||||
<el-form-item label="实际库区" prop="actualWarehouseId">
|
<el-form-item label="实际库区" prop="actualWarehouseId">
|
||||||
<actual-warehouse-select v-model="form.actualWarehouseId" placeholder="请选择实际库区" style="width: 100%;"
|
<actual-warehouse-select v-model="form.actualWarehouseId" placeholder="请选择实际库区" style="width: 100%;"
|
||||||
clearable />
|
clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col> -->
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="班组" prop="team">
|
<el-form-item label="班组" prop="team">
|
||||||
<el-input v-model="form.team" placeholder="请输入班组" />
|
<el-input v-model="form.team" placeholder="请输入班组" />
|
||||||
@@ -121,7 +133,7 @@
|
|||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<div class="section-card">
|
<div class="section-card">
|
||||||
<!-- 入库记录 -->
|
<!-- 入库记录 -->
|
||||||
<div class="section-header">
|
<div class="section-header">
|
||||||
<h3 class="section-title">入库记录</h3>
|
<h3 class="section-title">入库记录</h3>
|
||||||
<el-button size="mini" icon="el-icon-refresh" @click="getList">刷新</el-button>
|
<el-button size="mini" icon="el-icon-refresh" @click="getList">刷新</el-button>
|
||||||
</div>
|
</div>
|
||||||
@@ -134,44 +146,45 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<!-- 待操作卡片列表 -->
|
<!-- 待操作卡片列表 -->
|
||||||
<div class="card-grid-container">
|
<div v-if="pendingActions.length === 0" v-loading="loading" class="empty-state">
|
||||||
<div v-if="pendingActions.length === 0" class="empty-state">
|
<i class="el-icon-document"></i>
|
||||||
<i class="el-icon-document"></i>
|
<p>暂无入库记录</p>
|
||||||
<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>
|
</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>
|
||||||
|
|
||||||
<Pagination v-show="total > 0" :total="total" :page.sync="pagination.currentPage"
|
<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" />
|
:limit.sync="pagination.pageSize" @pagination="getList" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
@@ -186,6 +199,7 @@ import WarehouseSelect from "@/components/KLPService/WarehouseSelect";
|
|||||||
import ProductSelect from "@/components/KLPService/ProductSelect";
|
import ProductSelect from "@/components/KLPService/ProductSelect";
|
||||||
import RawMaterialSelect from "@/components/KLPService/RawMaterialSelect";
|
import RawMaterialSelect from "@/components/KLPService/RawMaterialSelect";
|
||||||
import { Pagination } from 'element-ui';
|
import { Pagination } from 'element-ui';
|
||||||
|
import { listDeliveryPlan } from '@/api/wms/deliveryPlan'
|
||||||
|
|
||||||
// 键值为[400, 500), 不包含在字典中,但后续可以加入的特殊操作,这类操作录入后会立刻完成,例如入库(401)和发货(402)
|
// 键值为[400, 500), 不包含在字典中,但后续可以加入的特殊操作,这类操作录入后会立刻完成,例如入库(401)和发货(402)
|
||||||
|
|
||||||
@@ -211,6 +225,7 @@ export default {
|
|||||||
netWeight: null,
|
netWeight: null,
|
||||||
grossWeight: null,
|
grossWeight: null,
|
||||||
remark: null,
|
remark: null,
|
||||||
|
dataType: 10, // 表示将要入库但是还未入库的钢卷,一般用于钢卷入库的操作去创建一个无法被检索到的钢卷
|
||||||
trimmingRequirement: null,
|
trimmingRequirement: null,
|
||||||
packingStatus: null,
|
packingStatus: null,
|
||||||
packagingRequirement: null,
|
packagingRequirement: null,
|
||||||
@@ -222,12 +237,15 @@ export default {
|
|||||||
},
|
},
|
||||||
// 分页参数
|
// 分页参数
|
||||||
pagination: {
|
pagination: {
|
||||||
currentPage: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
},
|
},
|
||||||
total: 0,
|
total: 0,
|
||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {
|
rules: {
|
||||||
|
planId: [
|
||||||
|
{ required: true, message: "请选择收货计划", trigger: "change" }
|
||||||
|
],
|
||||||
enterCoilNo: [
|
enterCoilNo: [
|
||||||
{ required: true, message: "入场钢卷号不能为空", trigger: "blur" }
|
{ required: true, message: "入场钢卷号不能为空", trigger: "blur" }
|
||||||
],
|
],
|
||||||
@@ -248,6 +266,7 @@ export default {
|
|||||||
{ required: true, message: "毛重不能为空", trigger: "blur" }
|
{ required: true, message: "毛重不能为空", trigger: "blur" }
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
planList: [],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
@@ -276,6 +295,11 @@ export default {
|
|||||||
this.form.itemType = 'raw_material';
|
this.form.itemType = 'raw_material';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
remoteMethod(query) {
|
||||||
|
listDeliveryPlan({ planName: query, pageNum: 1, pageSize: 5, planType: 1 }).then(res => {
|
||||||
|
this.planList = res.rows
|
||||||
|
})
|
||||||
|
},
|
||||||
getList() {
|
getList() {
|
||||||
// 获取入库历史
|
// 获取入库历史
|
||||||
this.loading = true
|
this.loading = true
|
||||||
@@ -292,13 +316,16 @@ export default {
|
|||||||
this.buttonLoading = true;
|
this.buttonLoading = true;
|
||||||
addMaterialCoil(this.form).then(response => {
|
addMaterialCoil(this.form).then(response => {
|
||||||
addPendingAction({
|
addPendingAction({
|
||||||
|
// 计划ID 对应 warehouseId, warehouseId字段并不是仓库ID,而是一个根据操作类型自适应的查询字段
|
||||||
|
warehouseId: this.form.planId,
|
||||||
actionType: 401,
|
actionType: 401,
|
||||||
currentCoilNo: this.form.currentCoilNo,
|
currentCoilNo: this.form.currentCoilNo,
|
||||||
sourceType: 'manual',
|
sourceType: 'manual',
|
||||||
coilId: response.data.coilId,
|
coilId: response.data.coilId,
|
||||||
|
// coilId: 0,
|
||||||
priority: 0,
|
priority: 0,
|
||||||
remark: this.form.remark,
|
remark: this.form.remark,
|
||||||
actionStatus: 2,
|
actionStatus: 0,
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
this.$modal.msgSuccess("入库成功");
|
this.$modal.msgSuccess("入库成功");
|
||||||
this.getList()
|
this.getList()
|
||||||
@@ -306,6 +333,8 @@ export default {
|
|||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
this.buttonLoading = false;
|
this.buttonLoading = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -354,6 +383,7 @@ export default {
|
|||||||
.section-header {
|
.section-header {
|
||||||
border-bottom-color: #409eff;
|
border-bottom-color: #409eff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.section-title {
|
.section-title {
|
||||||
color: #409eff;
|
color: #409eff;
|
||||||
}
|
}
|
||||||
@@ -363,6 +393,7 @@ export default {
|
|||||||
.section-header {
|
.section-header {
|
||||||
border-bottom-color: #67c23a;
|
border-bottom-color: #67c23a;
|
||||||
}
|
}
|
||||||
|
|
||||||
.section-title {
|
.section-title {
|
||||||
color: #67c23a;
|
color: #67c23a;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -175,6 +175,7 @@ export default {
|
|||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
planName: undefined,
|
planName: undefined,
|
||||||
planDate: undefined,
|
planDate: undefined,
|
||||||
|
planType: 0,
|
||||||
},
|
},
|
||||||
// 表单参数
|
// 表单参数
|
||||||
form: {},
|
form: {},
|
||||||
@@ -214,6 +215,7 @@ export default {
|
|||||||
planId: undefined,
|
planId: undefined,
|
||||||
planName: undefined,
|
planName: undefined,
|
||||||
planDate: undefined,
|
planDate: undefined,
|
||||||
|
planType: 0,
|
||||||
remark: undefined,
|
remark: undefined,
|
||||||
delFlag: undefined,
|
delFlag: undefined,
|
||||||
createTime: undefined,
|
createTime: undefined,
|
||||||
@@ -247,6 +249,8 @@ export default {
|
|||||||
this.form.planDate = new Date().toLocaleString().replace('T', ' ').replace().replace(/\//g, '-')
|
this.form.planDate = new Date().toLocaleString().replace('T', ' ').replace().replace(/\//g, '-')
|
||||||
// 发货计划名称格式为年-月-日命名
|
// 发货计划名称格式为年-月-日命名
|
||||||
this.form.planName = new Date().toLocaleDateString().replace(/\//g, '-') + '发货计划'
|
this.form.planName = new Date().toLocaleDateString().replace(/\//g, '-') + '发货计划'
|
||||||
|
// 计划类型为发货计划
|
||||||
|
this.form.planType = 0
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "添加发货计划";
|
this.title = "添加发货计划";
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -82,13 +82,12 @@
|
|||||||
|
|
||||||
<DeliveryWaybillDetail ref="detailTable" :waybillId="waybillId" />
|
<DeliveryWaybillDetail ref="detailTable" :waybillId="waybillId" />
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- 添加或修改发货单主对话框 -->
|
<!-- 添加或修改发货单对话框 -->
|
||||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
<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 ref="form" :model="form" :rules="rules" label-width="80px">
|
||||||
<el-form-item label="发货单名称" prop="waybillName">
|
<el-form-item label="发货单名称" prop="waybillName">
|
||||||
@@ -168,7 +167,7 @@ export default {
|
|||||||
showSearch: true,
|
showSearch: true,
|
||||||
// 总条数
|
// 总条数
|
||||||
total: 0,
|
total: 0,
|
||||||
// 发货单主表格数据
|
// 发货单表格数据
|
||||||
deliveryWaybillList: [],
|
deliveryWaybillList: [],
|
||||||
waybillId: null,
|
waybillId: null,
|
||||||
// 打印相关数据
|
// 打印相关数据
|
||||||
@@ -213,7 +212,8 @@ export default {
|
|||||||
planQueryParams: {
|
planQueryParams: {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 100, // 增大分页大小以确保树形结构显示足够数据
|
pageSize: 100, // 增大分页大小以确保树形结构显示足够数据
|
||||||
planName: undefined
|
planName: undefined,
|
||||||
|
planType: 0,
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -222,7 +222,7 @@ export default {
|
|||||||
this.getPlanList();
|
this.getPlanList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/** 查询发货单主列表 */
|
/** 查询发货单列表 */
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
// 确保查询参数包含planId
|
// 确保查询参数包含planId
|
||||||
@@ -334,7 +334,7 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "添加发货单主";
|
this.title = "添加发货单";
|
||||||
},
|
},
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
handleUpdate(row) {
|
handleUpdate(row) {
|
||||||
@@ -345,7 +345,7 @@ export default {
|
|||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.form = response.data;
|
this.form = response.data;
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "修改发货单主";
|
this.title = "修改发货单";
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
@@ -376,7 +376,7 @@ export default {
|
|||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
const waybillIds = row.waybillId || this.ids;
|
const waybillIds = row.waybillId || this.ids;
|
||||||
this.$modal.confirm('是否确认删除发货单主编号为"' + waybillIds + '"的数据项?').then(() => {
|
this.$modal.confirm('是否确认删除发货单编号为"' + waybillIds + '"的数据项?').then(() => {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
return delDeliveryWaybill(waybillIds);
|
return delDeliveryWaybill(waybillIds);
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
|
|||||||
365
klp-ui/src/views/wms/receive/detail/index.vue
Normal file
365
klp-ui/src/views/wms/receive/detail/index.vue
Normal 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>
|
||||||
@@ -28,6 +28,7 @@ public class WmsCoilPendingActionBo extends BaseEntity {
|
|||||||
/**
|
/**
|
||||||
* 关联的钢卷ID
|
* 关联的钢卷ID
|
||||||
*/
|
*/
|
||||||
|
// 对于入库操作,这个时候还不存在钢卷,因此无法关联钢卷ID,因此先关联为0,如果id为0则跟未关联是相同的
|
||||||
@NotNull(message = "关联的钢卷ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
@NotNull(message = "关联的钢卷ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
private Long coilId;
|
private Long coilId;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user