Merge remote-tracking branch 'gitee/0.8.X' into 0.8.X
This commit is contained in:
@@ -135,4 +135,15 @@ export function exportCoil(coilId) {
|
||||
url: '/wms/materialCoil/exportCoil/' + coilId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 根据钢卷ID序列查询钢卷列表
|
||||
export function listCoilByIds(coilIds) {
|
||||
return request({
|
||||
url: '/wms/materialCoil/list',
|
||||
method: 'get',
|
||||
params: {
|
||||
coilIds
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -6,13 +6,11 @@
|
||||
<el-button type="primary" size="small" @click="handleOpen" class="select-button">
|
||||
<i class="el-icon-search"></i>
|
||||
<span v-if="selectedCoil">
|
||||
<span>{{ selectedCoil.currentCoilNo }} </span>
|
||||
|
||||
<span>({{ selectedCoil.itemName }}) </span>
|
||||
|
||||
<span>{{ selectedCoil.currentCoilNo }}</span>
|
||||
<span>({{ selectedCoil.itemName }})</span>
|
||||
<span>[{{ selectedCoil.netWeight }}t]</span>
|
||||
</span>
|
||||
<span v-else>请选择钢卷</span>
|
||||
<span v-else>{{ placeholder }}</span>
|
||||
</el-button>
|
||||
</slot>
|
||||
</div>
|
||||
@@ -38,16 +36,14 @@
|
||||
<!-- 数据表格 -->
|
||||
<el-table v-loading="loading" :data="coilList" @row-click="handleRowClick" highlight-current-row height="400px"
|
||||
style="width: 100%">
|
||||
<el-table-column type="index" width="50" align="center" label="序号" />
|
||||
<el-table-column label="卷号" align="center" prop="currentCoilNo" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="存储位置" align="center" prop="actualWarehouseName" width="120" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="物料" align="center" prop="itemName" width="100" />
|
||||
<el-table-column label="规格" align="center" prop="specification" width="100" />
|
||||
<el-table-column label="材质" align="center" prop="material" width="100" />
|
||||
<el-table-column label="厂家" align="center" prop="manufacturer" width="100" />
|
||||
<el-table-column label="重量(t)" align="center" prop="netWeight" width="100" />
|
||||
<el-table-column label="库区" align="center" prop="warehouseName" width="120" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="操作" align="center" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="small" @click.stop="handleSelect(scope.row)">选择</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!-- 分页 -->
|
||||
@@ -77,6 +73,10 @@ export default {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
placeholder: {
|
||||
type: String,
|
||||
default: '请选择钢卷'
|
||||
},
|
||||
value: {
|
||||
type: [String, Number],
|
||||
default: ''
|
||||
@@ -90,7 +90,7 @@ export default {
|
||||
initialCoil: {
|
||||
type: Object,
|
||||
default: null
|
||||
}
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
@@ -3,22 +3,18 @@
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
|
||||
label-width="68px">
|
||||
label-width="60px">
|
||||
<el-form-item label="方案名称" prop="templateName">
|
||||
<el-input v-model="queryParams.templateName" 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-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table highlight-current-row border @row-click="handleRowClick" v-loading="loading"
|
||||
@@ -213,6 +209,7 @@ export default {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
this.checkItemList = [];
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
@@ -221,6 +218,7 @@ export default {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
this.handleRowClick(this.form);
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
|
||||
@@ -297,7 +297,7 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-dialog title="新增异常" :visible.sync="exceptionDialogVisible" width="400px">
|
||||
<el-dialog title="新增异常" :visible.sync="exceptionDialogVisible" width="600px">
|
||||
<el-form ref="exceptionForm" :model="exceptionForm" label-width="80px">
|
||||
<el-form-item label="位置" prop="position">
|
||||
<el-radio-group v-model="exceptionForm.position">
|
||||
|
||||
64
klp-ui/src/views/wms/delivery/components/coilsTranfer.vue
Normal file
64
klp-ui/src/views/wms/delivery/components/coilsTranfer.vue
Normal file
@@ -0,0 +1,64 @@
|
||||
<template>
|
||||
<div>
|
||||
<!-- 搜索框,可以设置钢卷搜索条件 -->
|
||||
<!-- 上方是未选的钢卷表格,包含选择按钮 -->
|
||||
<!-- 搜索区域 -->
|
||||
<el-row>
|
||||
<el-form :inline="true" :model="queryParams" class="search-form">
|
||||
<el-form-item label="卷号">
|
||||
<el-input v-model="queryParams.currentCoilNo" placeholder="请输入卷号" clearable size="small"
|
||||
@keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="钢种">
|
||||
<el-input v-model="queryParams.grade" placeholder="请输入钢种" clearable size="small"
|
||||
@keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<!-- 分页 -->
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize" @pagination="getList" />
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="small" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="small" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<!-- 数据表格 -->
|
||||
<el-table v-loading="loading" :data="coilList" @row-click="handleRowClick" highlight-current-row height="400px"
|
||||
style="width: 100%">
|
||||
<el-table-column type="index" width="50" align="center" label="序号" />
|
||||
<el-table-column label="卷号" align="center" prop="currentCoilNo" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="物料" align="center" prop="itemName" width="100" />
|
||||
<el-table-column label="重量(t)" align="center" prop="netWeight" width="100" />
|
||||
<el-table-column label="库区" align="center" prop="warehouseName" width="120" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="操作" align="center" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="small" @click.stop="handleSelect(scope.row)">选择</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-table v-loading="loading" :data="coilList" @row-click="handleRowClick" highlight-current-row height="400px"
|
||||
style="width: 100%">
|
||||
<el-table-column type="index" width="50" align="center" label="序号" />
|
||||
<el-table-column label="卷号" align="center" prop="currentCoilNo" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="物料" align="center" prop="itemName" width="100" />
|
||||
<el-table-column label="重量(t)" align="center" prop="netWeight" width="100" />
|
||||
<el-table-column label="库区" align="center" prop="warehouseName" width="120" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="操作" align="center" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="small" @click.stop="handleSelect(scope.row)">选择</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- 下方的已选的钢卷表格,包含删除按钮 -->
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
</script>
|
||||
@@ -2,18 +2,10 @@
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="计划名称" prop="planName">
|
||||
<el-input
|
||||
v-model="queryParams.planName"
|
||||
placeholder="请输入发货计划名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
<el-input v-model="queryParams.planName" placeholder="请输入发货计划名称" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="计划日期" prop="planDate">
|
||||
<el-date-picker clearable
|
||||
v-model="queryParams.planDate"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
<el-date-picker clearable v-model="queryParams.planDate" type="date" value-format="yyyy-MM-dd HH:mm:ss"
|
||||
placeholder="请选择计划日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
@@ -25,96 +17,95 @@
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
>新增</el-button>
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
>修改</el-button>
|
||||
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single"
|
||||
@click="handleUpdate">修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
>删除</el-button>
|
||||
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple"
|
||||
@click="handleDelete">删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
>导出</el-button>
|
||||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20" v-loading="loading">
|
||||
<el-col :span="6" v-for="(row, index) in deliveryPlanList" :key="row.planId">
|
||||
<el-card shadow="hover" class="delivery-plan-card">
|
||||
<div class="card-header">
|
||||
<el-checkbox v-model="row.selected" @change="handleCardSelectionChange(row)"></el-checkbox>
|
||||
<div class="card-title">{{ row.planName }}</div>
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="8">
|
||||
<el-row :gutter="20" v-loading="loading">
|
||||
<el-col :span="12" v-for="(row, index) in deliveryPlanList" :key="row.planId">
|
||||
<el-card shadow="hover" class="delivery-plan-card" @click.native="handleCardClick(row)">
|
||||
<div class="card-header">
|
||||
<el-checkbox v-model="row.selected" @change="handleCardSelectionChange(row)"></el-checkbox>
|
||||
<div class="card-title">{{ row.planName }}</div>
|
||||
</div>
|
||||
<div class="card-content">
|
||||
<div class="content-item">
|
||||
<span>{{ parseTime(row.planDate, '{y}-{m}-{d}') }}</span>
|
||||
<span>
|
||||
<el-tag type="success" v-if="row.auditStatus == 1">已审批</el-tag>
|
||||
<el-tag type="primary" v-else>待审批</el-tag>
|
||||
</span>
|
||||
</div>
|
||||
<div class="content-item">
|
||||
<span>{{ row.createBy }}({{ parseTime(row.updateTime, '{y}-{m}-{d}') }})</span>
|
||||
</div>
|
||||
<div class="content-item">
|
||||
<span class="label">备注:</span>
|
||||
<span>{{ row.remark || '-' }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-actions">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleApprove(row)" v-if="row.auditStatus != 1">审批</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(row)">修改</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(row)">删除</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize" @pagination="getList" />
|
||||
</el-col>
|
||||
|
||||
<!-- 钢卷列表 -->
|
||||
<el-col :span="16" v-loading="rightLoading">
|
||||
<!-- 选中的钢卷表格为空时的提示 -->
|
||||
<div v-if="!currentPlan.planId" class="empty-tip">
|
||||
<el-empty description="请先选择发货计划" />
|
||||
</div>
|
||||
|
||||
<div v-else>
|
||||
<coil-selector ref="coilSelector" placeholder="请选择钢卷添加至计划" @change="handleCoilChange"></coil-selector>
|
||||
<div v-if="selectedCoilList.length > 0 && currentPlan.planId">
|
||||
<el-table :data="selectedCoilList" highlight-current-row height="400px" style="width: 100%">
|
||||
<el-table-column type="index" width="50" align="center" label="序号" />
|
||||
<el-table-column label="卷号" align="center" prop="currentCoilNo" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="存储位置" align="center" prop="actualWarehouseName" width="120"
|
||||
:show-overflow-tooltip="true" />
|
||||
<el-table-column label="物料" align="center" prop="itemName" width="100" />
|
||||
<el-table-column label="规格" align="center" prop="specification" width="100" />
|
||||
<el-table-column label="材质" align="center" prop="material" />
|
||||
<el-table-column label="厂家" align="center" prop="manufacturer" />
|
||||
<el-table-column label="重量(t)" align="center" prop="netWeight" width="100" />
|
||||
<el-table-column label="库区" align="center" prop="warehouseName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="操作" align="center" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="danger" size="small" @click.stop="handleDeleteCoil(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="card-content">
|
||||
<div class="content-item">
|
||||
<span class="label">计划日期:</span>
|
||||
<span>{{ parseTime(row.planDate, '{y}-{m}-{d}') }}</span>
|
||||
</div>
|
||||
<div class="content-item">
|
||||
<span class="label">备注:</span>
|
||||
<span>{{ row.remark || '-' }}</span>
|
||||
</div>
|
||||
<div class="content-item">
|
||||
<span class="label">创建人:</span>
|
||||
<span>{{ row.createBy }}</span>
|
||||
</div>
|
||||
<div class="content-item">
|
||||
<span class="label">更新时间:</span>
|
||||
<span>{{ parseTime(row.updateTime, '{y}-{m}-{d}') }}</span>
|
||||
</div>
|
||||
<div v-else class="empty-tip">
|
||||
<el-empty description="暂无数据" />
|
||||
</div>
|
||||
<div class="card-actions">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(row)"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(row)"
|
||||
>删除</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改发货计划对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
@@ -123,10 +114,7 @@
|
||||
<el-input v-model="form.planName" placeholder="请输入发货计划名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="计划日期" prop="planDate">
|
||||
<el-date-picker clearable
|
||||
v-model="form.planDate"
|
||||
type="datetime"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
<el-date-picker clearable v-model="form.planDate" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
|
||||
placeholder="请选择计划日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
@@ -144,9 +132,14 @@
|
||||
|
||||
<script>
|
||||
import { listDeliveryPlan, getDeliveryPlan, delDeliveryPlan, addDeliveryPlan, updateDeliveryPlan } from "@/api/wms/deliveryPlan";
|
||||
import { listCoilByIds, getMaterialCoil } from "@/api/wms/coil";
|
||||
import coilSelector from "@/components/CoilSelector";
|
||||
|
||||
export default {
|
||||
name: "DeliveryPlan",
|
||||
components: {
|
||||
coilSelector,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 按钮loading
|
||||
@@ -165,6 +158,7 @@ export default {
|
||||
total: 0,
|
||||
// 发货计划表格数据
|
||||
deliveryPlanList: [],
|
||||
rightLoading: false,
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
@@ -183,8 +177,12 @@ export default {
|
||||
planDate: '',
|
||||
},
|
||||
// 表单校验
|
||||
rules: {
|
||||
}
|
||||
rules: {},
|
||||
// 选中的钢卷列表
|
||||
selectedCoilList: [],
|
||||
currentPlan: {},
|
||||
// 防抖定时器
|
||||
debounceTimer: null,
|
||||
};
|
||||
},
|
||||
created() {
|
||||
@@ -212,6 +210,99 @@ export default {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
handleApprove(row) {
|
||||
// 二次确认
|
||||
this.$confirm('确定审批通过该发货计划吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.loading = true;
|
||||
this.buttonLoading = true;
|
||||
const auditTime = this.parseTime(new Date(), '{y}-{m}-{d} {h}:{i}:{s}');
|
||||
updateDeliveryPlan({
|
||||
planId: row.planId,
|
||||
auditStatus: 1,
|
||||
auditBy: this.$store.getters.name,
|
||||
auditTime: auditTime,
|
||||
}).then(res => {
|
||||
this.loading = false;
|
||||
this.buttonLoading = false;
|
||||
this.$message({
|
||||
message: '审批成功',
|
||||
type: 'success'
|
||||
});
|
||||
this.getList();
|
||||
})
|
||||
})
|
||||
},
|
||||
handleCardClick(row) {
|
||||
// 防抖处理,防止频繁点击
|
||||
if (this.debounceTimer) {
|
||||
clearTimeout(this.debounceTimer);
|
||||
}
|
||||
this.debounceTimer = setTimeout(() => {
|
||||
this.currentPlan = row;
|
||||
if (!row.coil) {
|
||||
this.selectedCoilList = [];
|
||||
return;
|
||||
}
|
||||
this.rightLoading = true;
|
||||
listCoilByIds(row.coil).then(response => {
|
||||
this.selectedCoilList = response.rows || [];
|
||||
this.rightLoading = false;
|
||||
});
|
||||
}, 300); // 300ms防抖时间
|
||||
},
|
||||
handleCoilChange(coilId) {
|
||||
const ids = this.selectedCoilList.map(item => item.coilId);
|
||||
if (coilId) {
|
||||
// 检查是否已存在
|
||||
if (!ids.includes(coilId)) {
|
||||
ids.push(coilId);
|
||||
// 从后端查询详细信息
|
||||
this.rightLoading = true;
|
||||
updateDeliveryPlan({
|
||||
planId: this.currentPlan.planId,
|
||||
coil: ids.join(',')
|
||||
}).then(_ => {
|
||||
this.getList();
|
||||
})
|
||||
getMaterialCoil(coilId).then(res => {
|
||||
this.selectedCoilList.push(res.data);
|
||||
this.rightLoading = false;
|
||||
this.$message({
|
||||
message: '添加成功',
|
||||
type: 'success'
|
||||
});
|
||||
})
|
||||
} else {
|
||||
this.$message({
|
||||
message: '钢卷已存在',
|
||||
type: 'warning'
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
// 处理删除选中钢卷
|
||||
handleDeleteCoil(row) {
|
||||
// 从选中的钢卷列表中删除选中的行
|
||||
this.selectedCoilList = this.selectedCoilList.filter(item => item !== row);
|
||||
// 更新发货计划
|
||||
this.rightLoading = true;
|
||||
updateDeliveryPlan({
|
||||
planId: this.currentPlan.planId,
|
||||
coil: this.selectedCoilList.map(item => item.coilId).join(',')
|
||||
}).then(res => {
|
||||
this.rightLoading = false;
|
||||
this.$message({
|
||||
message: '删除成功',
|
||||
type: 'success'
|
||||
});
|
||||
this.getList();
|
||||
})
|
||||
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
@@ -344,8 +435,9 @@ export default {
|
||||
|
||||
.content-item {
|
||||
margin-bottom: 10px;
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.content-item:last-child {
|
||||
@@ -361,7 +453,7 @@ export default {
|
||||
|
||||
.card-actions {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
gap: 10px;
|
||||
justify-content: center;
|
||||
gap: 5px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -211,9 +211,10 @@ export default {
|
||||
selectedPlan: null,
|
||||
planQueryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 100, // 增大分页大小以确保树形结构显示足够数据
|
||||
pageSize: 20, // 增大分页大小以确保树形结构显示足够数据
|
||||
planName: undefined,
|
||||
planType: 0,
|
||||
auditStatus: 1,
|
||||
}
|
||||
};
|
||||
},
|
||||
|
||||
@@ -25,8 +25,12 @@
|
||||
<!-- 图例 -->
|
||||
<div class="legend-container">
|
||||
<div class="legend-item">
|
||||
<div class="legend-color normal"></div>
|
||||
<span class="legend-text">正常未占用</span>
|
||||
<div class="legend-color layer-1"></div>
|
||||
<span class="legend-text">一层</span>
|
||||
</div>
|
||||
<div class="legend-item">
|
||||
<div class="legend-color layer-2"></div>
|
||||
<span class="legend-text">二层</span>
|
||||
</div>
|
||||
<div class="legend-item">
|
||||
<div class="legend-color occupied"></div>
|
||||
@@ -36,29 +40,26 @@
|
||||
|
||||
<!-- 分层库位容器 -->
|
||||
<div class="layers-container">
|
||||
<!-- 遍历每层,渲染 Grid 组件 -->
|
||||
<div v-for="(layerData, layer) in layers" :key="layer" class="layer-section">
|
||||
<WarehouseGrid :layer="layer" :layer-data="layerData" />
|
||||
</div>
|
||||
|
||||
<!-- 无数据提示 -->
|
||||
<div class="empty-tip" v-if="Object.keys(layers).length === 0 && warehouseList.length > 0">
|
||||
暂无解析到有效的库位分层数据
|
||||
</div>
|
||||
<div class="empty-tip" v-if="warehouseList.length === 0">
|
||||
<div class="empty-tip" v-else-if="warehouseList.length === 0">
|
||||
<div class="empty-text">该分类下暂无库位数据</div>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="openInitDialog">初始化库位</el-button>
|
||||
</div>
|
||||
<warehouse-interlaced v-else="warehouseList.length" :layers="layers" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import WarehouseGrid from './WarehouseGrid.vue';
|
||||
import WarehouseInterlaced from './WarehouseInterlaced.vue';
|
||||
|
||||
export default {
|
||||
name: "WarehouseBird",
|
||||
components: { WarehouseGrid },
|
||||
components: { WarehouseGrid, WarehouseInterlaced },
|
||||
props: {
|
||||
// 原始库位列表
|
||||
warehouseList: {
|
||||
@@ -93,7 +94,7 @@ export default {
|
||||
*/
|
||||
parseWarehouseCode(code) {
|
||||
if (!code) return null;
|
||||
const reg = /^([A-Za-z])(\d+[A-Za-z])(\d)(\d{2})-(\d+)$/;
|
||||
const reg = /^([A-Za-z])(\d+[A-Za-z])(\d)-(\d{2})-(\d+)$/;
|
||||
const match = code.match(reg);
|
||||
|
||||
if (!match) {
|
||||
@@ -239,8 +240,16 @@ export default {
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
.layer-1 {
|
||||
background-color: #fff3e0;
|
||||
}
|
||||
|
||||
.layer-2 {
|
||||
background-color: #e8f5e9;
|
||||
}
|
||||
|
||||
.occupied {
|
||||
background-color: #eeff6f;
|
||||
background-color: #111;
|
||||
}
|
||||
|
||||
.legend-text {
|
||||
|
||||
@@ -0,0 +1,372 @@
|
||||
<template>
|
||||
<div class="multi-layer-grid">
|
||||
<!-- 顶部列标尺 -->
|
||||
<div class="col-ruler" :style="{ '--cell-width': `${cellWidth}px` }">
|
||||
<div class="ruler-empty"></div>
|
||||
<div v-for="col in maxColumn" :key="`col-${col}`" class="ruler-item">
|
||||
{{ col }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 左侧行标尺 + 库位网格 -->
|
||||
<div class="row-grid-wrapper">
|
||||
<!-- 左侧行标尺 -->
|
||||
<div class="row-ruler">
|
||||
<div v-for="row in maxRow" :key="`row-${row}`" class="ruler-item">
|
||||
{{ row }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 库位网格容器 -->
|
||||
<div
|
||||
class="grid-container"
|
||||
:style="{
|
||||
'--half-cell-width': `${halfCellWidth}px`,
|
||||
'--cell-width': `${cellWidth}px`,
|
||||
'--column-count': maxColumn * 2,
|
||||
'--row-height': '80px'
|
||||
}"
|
||||
>
|
||||
<!-- 第一层库位(左半列) -->
|
||||
<div
|
||||
v-for="warehouse in layer1Warehouses"
|
||||
:key="`warehouse-1-${warehouse.actualWarehouseId}`"
|
||||
class="warehouse-cell layer-1"
|
||||
:class="{ disabled: warehouse.isEnabled === 0 }"
|
||||
:style="{
|
||||
gridRow: `${warehouse.parsedInfo.row} / ${warehouse.parsedInfo.row + 1}`,
|
||||
gridColumn: `${(warehouse.parsedInfo.column - 1) * 2 + 1} / ${(warehouse.parsedInfo.column - 1) * 2 + 2}`
|
||||
}"
|
||||
@click="handleCellClick(warehouse)"
|
||||
>
|
||||
<div class="cell-name">
|
||||
<div class="cell-line1">{{ warehouse.actualWarehouseName || '-' }}</div>
|
||||
<div class="cell-line2">{{ warehouse.currentCoilNo || '-' }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 第二层库位(右半列 + 下移半格) -->
|
||||
<div
|
||||
v-for="warehouse in layer2Warehouses"
|
||||
:key="`warehouse-2-${warehouse.actualWarehouseId}`"
|
||||
class="warehouse-cell layer-2"
|
||||
:class="{ disabled: warehouse.isEnabled === 0 }"
|
||||
:style="{
|
||||
gridRow: `${warehouse.parsedInfo.row} / ${warehouse.parsedInfo.row + 1}`,
|
||||
gridColumn: `${(warehouse.parsedInfo.column - 1) * 2 + 2} / ${(warehouse.parsedInfo.column - 1) * 2 + 3}`
|
||||
}"
|
||||
@click="handleCellClick(warehouse)"
|
||||
>
|
||||
<div class="cell-name">
|
||||
<div class="cell-line1">{{ warehouse.actualWarehouseName || '-' }}</div>
|
||||
<div class="cell-line2">{{ warehouse.currentCoilNo || '-' }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 库位详情弹窗 -->
|
||||
<el-dialog
|
||||
title="钢卷库位详情"
|
||||
:visible.sync="dialogVisible"
|
||||
width="600px"
|
||||
destroy-on-close
|
||||
append-to-body
|
||||
center
|
||||
>
|
||||
<el-descriptions :column="2" border size="small" v-if="currentWarehouse">
|
||||
<el-descriptions-item label="库位编码">{{ currentWarehouse.actualWarehouseCode }}</el-descriptions-item>
|
||||
<el-descriptions-item label="库位名称">{{ currentWarehouse.actualWarehouseName || '无' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="钢卷编号">{{ currentWarehouse.currentCoilNo || '无' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="所属层级">{{ currentWarehouse.parsedInfo.layer || '未知' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="行号">{{ currentWarehouse.parsedInfo.row || '未知' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="列号">{{ currentWarehouse.parsedInfo.column || '未知' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="启用状态">
|
||||
<el-tag :type="currentWarehouse.isEnabled === 1 ? 'success' : 'danger'">
|
||||
{{ currentWarehouse.isEnabled === 1 ? '启用' : '禁用' }}
|
||||
</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="创建时间" span="2">{{ currentWarehouse.createTime || '无' }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<template slot="footer">
|
||||
<el-button @click="dialogVisible = false">关闭</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "SteelCoilWarehouse",
|
||||
props: {
|
||||
layers: {
|
||||
type: Object,
|
||||
required: true,
|
||||
default: () => ({})
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
currentWarehouse: null,
|
||||
containerWidth: 0,
|
||||
resizeTimer: null
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
layer1Warehouses() {
|
||||
return this.layers['1']?.warehouses || [];
|
||||
},
|
||||
layer2Warehouses() {
|
||||
return this.layers['2']?.warehouses || [];
|
||||
},
|
||||
maxRow() {
|
||||
let max = 0;
|
||||
Object.keys(this.layers).forEach(layer => {
|
||||
max = Math.max(max, this.layers[layer].maxRow);
|
||||
});
|
||||
return max;
|
||||
},
|
||||
maxColumn() {
|
||||
let max = 0;
|
||||
Object.keys(this.layers).forEach(layer => {
|
||||
max = Math.max(max, this.layers[layer].maxColumn);
|
||||
});
|
||||
return max;
|
||||
},
|
||||
cellWidth() {
|
||||
if (!this.containerWidth || this.maxColumn === 0) return 60;
|
||||
const availableWidth = Math.max(0, this.containerWidth - 30);
|
||||
const averageWidth = availableWidth / this.maxColumn;
|
||||
return averageWidth;
|
||||
},
|
||||
halfCellWidth() {
|
||||
return this.cellWidth / 2;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.calcContainerWidth();
|
||||
window.addEventListener('resize', this.handleResize);
|
||||
},
|
||||
beforeUnmount() {
|
||||
window.removeEventListener('resize', this.handleResize);
|
||||
clearTimeout(this.resizeTimer);
|
||||
},
|
||||
methods: {
|
||||
calcContainerWidth() {
|
||||
this.containerWidth = this.$el.parentElement?.clientWidth || this.$el.clientWidth || 0;
|
||||
},
|
||||
handleResize() {
|
||||
clearTimeout(this.resizeTimer);
|
||||
this.resizeTimer = setTimeout(() => {
|
||||
this.calcContainerWidth();
|
||||
}, 100);
|
||||
},
|
||||
handleCellClick(warehouse) {
|
||||
this.currentWarehouse = warehouse;
|
||||
this.dialogVisible = true;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
/* 外层容器:填满父元素 + 隐藏滚动条 */
|
||||
.multi-layer-grid {
|
||||
width: 100% !important;
|
||||
height: 100%;
|
||||
box-sizing: border-box;
|
||||
margin: 0 !important;
|
||||
padding: 0 !important;
|
||||
overflow: hidden !important;
|
||||
}
|
||||
|
||||
/* 列标尺 */
|
||||
.col-ruler {
|
||||
display: flex;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
background: #f5f7fa; /* 更柔和的标尺背景 */
|
||||
border-bottom: 1px solid #e4e7ed;
|
||||
width: 100% !important;
|
||||
box-sizing: border-box;
|
||||
overflow: hidden !important;
|
||||
|
||||
.ruler-empty {
|
||||
width: 30px;
|
||||
text-align: center;
|
||||
font-weight: 600;
|
||||
color: #606266;
|
||||
border-right: 1px solid #e4e7ed;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.ruler-item {
|
||||
width: var(--cell-width);
|
||||
text-align: center;
|
||||
font-weight: 600;
|
||||
color: #606266;
|
||||
border-right: 1px solid #e4e7ed;
|
||||
box-sizing: border-box;
|
||||
flex-shrink: 0;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
|
||||
.row-grid-wrapper {
|
||||
display: flex;
|
||||
width: 100% !important;
|
||||
height: calc(100% - 30px);
|
||||
box-sizing: border-box;
|
||||
overflow: hidden !important;
|
||||
}
|
||||
|
||||
/* 行标尺 */
|
||||
.row-ruler {
|
||||
width: 30px;
|
||||
background: #f5f7fa; /* 更柔和的标尺背景 */
|
||||
border-right: 1px solid #e4e7ed;
|
||||
flex-shrink: 0;
|
||||
overflow: hidden !important;
|
||||
|
||||
.ruler-item {
|
||||
height: 80px;
|
||||
line-height: 80px;
|
||||
text-align: center;
|
||||
font-weight: 600;
|
||||
color: #606266;
|
||||
border-bottom: 1px solid #e4e7ed;
|
||||
box-sizing: border-box;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
|
||||
/* 网格容器 */
|
||||
.grid-container {
|
||||
display: grid;
|
||||
width: 100% !important;
|
||||
grid-template-columns: repeat(var(--column-count), minmax(0, var(--half-cell-width)));
|
||||
grid-auto-rows: var(--row-height);
|
||||
gap: 1px;
|
||||
box-sizing: border-box;
|
||||
margin: 0 !important;
|
||||
padding: 0 !important;
|
||||
overflow: hidden !important;
|
||||
-ms-overflow-style: none;
|
||||
scrollbar-width: none;
|
||||
|
||||
&::-webkit-scrollbar {
|
||||
display: none !important;
|
||||
width: 0 !important;
|
||||
height: 0 !important;
|
||||
}
|
||||
}
|
||||
|
||||
/* 库位单元格基础样式 */
|
||||
.warehouse-cell {
|
||||
height: var(--row-height);
|
||||
border: 1px solid #e4e7ed;
|
||||
border-radius: 4px; /* 圆角更柔和 */
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
overflow: hidden;
|
||||
|
||||
/* 启用状态 - 第一层:柔和暖橙(低饱和度) */
|
||||
&.layer-1:not(.disabled) {
|
||||
background: #fff3e0; /* 柔和浅橙 */
|
||||
color: #e65100; /* 文字用深一点的橙,保证可读性 */
|
||||
}
|
||||
|
||||
/* 启用状态 - 第二层:柔和薄荷绿(低饱和度) */
|
||||
&.layer-2:not(.disabled) {
|
||||
background: #e8f5e9; /* 柔和浅绿 */
|
||||
color: #2e7d32; /* 文字用深一点的绿,保证可读性 */
|
||||
transform: translateY(50%);
|
||||
position: relative;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
/* 禁用状态 - 通用浅灰 */
|
||||
&.disabled {
|
||||
background: #111; /* 浅灰背景 */
|
||||
color: #909399; /* 浅灰文字 */
|
||||
cursor: not-allowed; /* 禁用光标 */
|
||||
opacity: 0.8; /* 降低透明度 */
|
||||
/* 禁用状态取消hover效果 */
|
||||
&:hover {
|
||||
border-color: #e4e7ed;
|
||||
background: #fafafa;
|
||||
z-index: 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* 启用状态hover效果(更柔和) */
|
||||
&:not(.disabled):hover {
|
||||
border-color: #90caf9; /* 柔和的蓝色边框 */
|
||||
background: #f0f8ff; /* 极浅的蓝背景 */
|
||||
z-index: 2;
|
||||
box-shadow: 0 2px 4px rgba(0,0,0,0.05); /* 轻微阴影,提升层次感 */
|
||||
}
|
||||
|
||||
/* 两行文字样式 */
|
||||
.cell-name {
|
||||
width: 100%;
|
||||
height: 90%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
padding: 0 4px;
|
||||
box-sizing: border-box;
|
||||
|
||||
/* 第一行:库位名称 */
|
||||
.cell-line1 {
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
line-height: 1.2;
|
||||
margin-bottom: 4px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* 第二行:currentCoilNo */
|
||||
.cell-line2 {
|
||||
font-size: 13px;
|
||||
line-height: 1.2;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* 禁用状态文字颜色 */
|
||||
.disabled & .cell-line1,
|
||||
.disabled & .cell-line2 {
|
||||
color: #909399 !important;
|
||||
}
|
||||
|
||||
/* 启用状态文字颜色适配 */
|
||||
.layer-1:not(.disabled) & .cell-line1,
|
||||
.layer-1:not(.disabled) & .cell-line2 {
|
||||
color: #e65100;
|
||||
}
|
||||
.layer-2:not(.disabled) & .cell-line1,
|
||||
.layer-2:not(.disabled) & .cell-line2 {
|
||||
color: #2e7d32;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -43,10 +43,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="层数" prop="layerCount">
|
||||
<el-input-number size="mini" v-model="initForm.layerCount" :min="1" :max="99" placeholder="请输入层数(1-99)"
|
||||
style="width: 100%;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="编码前缀" prop="prefix">
|
||||
<el-input v-model="initForm.prefix" disabled placeholder="系统自动生成" />
|
||||
</el-form-item>
|
||||
@@ -189,7 +185,7 @@ export default {
|
||||
|
||||
const prefix = await this.generateWarehousePrefix(this.selectedNode);
|
||||
this.initForm = {
|
||||
rowCount: '', columnCount: '', layerCount: '',
|
||||
rowCount: '', columnCount: '',
|
||||
prefix: prefix,
|
||||
parentId: this.selectedNode.actualWarehouseId
|
||||
};
|
||||
|
||||
@@ -5,9 +5,7 @@ import java.util.List;
|
||||
import java.util.Arrays;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.klp.domain.vo.WmsDeliveryPlanStatisticsVo;
|
||||
import com.klp.domain.vo.WmsDeliveryReportResultVo;
|
||||
import com.klp.domain.vo.WmsDeliveryReportVo;
|
||||
import com.klp.domain.vo.*;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.*;
|
||||
@@ -24,7 +22,6 @@ import com.klp.common.core.validate.AddGroup;
|
||||
import com.klp.common.core.validate.EditGroup;
|
||||
import com.klp.common.enums.BusinessType;
|
||||
import com.klp.common.utils.poi.ExcelUtil;
|
||||
import com.klp.domain.vo.WmsDeliveryPlanVo;
|
||||
import com.klp.domain.bo.WmsDeliveryPlanBo;
|
||||
import com.klp.service.IWmsDeliveryPlanService;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
@@ -129,4 +126,6 @@ public class WmsDeliveryPlanController extends BaseController {
|
||||
WmsDeliveryReportResultVo report = iWmsDeliveryPlanService.getDeliveryReport(startTime, endTime);
|
||||
return R.ok(report);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.klp.controller;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Arrays;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.klp.domain.vo.WmsMaterialCoilExportVo;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -184,5 +185,41 @@ public class WmsMaterialCoilController extends BaseController {
|
||||
List<WmsMaterialCoilVo> distribution = iWmsMaterialCoilService.getDistributionByActualItemType(itemType, itemId);
|
||||
return R.ok(distribution);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询未被任何发货计划引用的钢卷列表
|
||||
* 用于发货计划选择钢卷时,避免选择已经被其他发货计划引用的钢卷
|
||||
*/
|
||||
@GetMapping("/availableForDelivery")
|
||||
public TableDataInfo<WmsMaterialCoilVo> getAvailableCoilsForDelivery(WmsMaterialCoilBo bo, PageQuery pageQuery) {
|
||||
return iWmsMaterialCoilService.queryAvailableForDelivery(bo, pageQuery);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 批量更新钢卷发货状态
|
||||
*
|
||||
* @param coilIds 钢卷ID,多个ID用逗号分隔
|
||||
* @param status 目标状态 (0=在库, 1=在途, 2=已出库)
|
||||
* @return 操作结果
|
||||
*/
|
||||
@Log(title = "钢卷物料表", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/batchUpdateDeliveryStatus")
|
||||
public R<Void> batchUpdateDeliveryStatus(
|
||||
@RequestParam String coilIds,
|
||||
@RequestParam Integer status) {
|
||||
|
||||
// 解析钢卷ID列表
|
||||
List<Long> coilIdList = Arrays.stream(coilIds.split(","))
|
||||
.map(String::trim)
|
||||
.filter(s -> !s.isEmpty())
|
||||
.map(Long::valueOf)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
Boolean result = iWmsMaterialCoilService.batchUpdateDeliveryStatus(coilIdList, status);
|
||||
return result ? R.ok() : R.fail("批量更新失败");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
/**
|
||||
* 发货计划对象 wms_delivery_plan
|
||||
@@ -48,4 +49,16 @@ public class WmsDeliveryPlan extends BaseEntity {
|
||||
@TableLogic
|
||||
private Integer delFlag;
|
||||
|
||||
// 钢卷集合
|
||||
private String coil;
|
||||
|
||||
//-- 1. 新增审核状态字段(核心)
|
||||
private Integer auditStatus;
|
||||
//-- 2. 新增审核人字段
|
||||
private String auditBy;
|
||||
//-- 3. 新增审核时间字段
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date auditTime;
|
||||
|
||||
}
|
||||
|
||||
@@ -13,25 +13,20 @@ import javax.validation.constraints.NotNull;
|
||||
public class WmsActualWarehouseBatchGenerateBo {
|
||||
|
||||
/** 列数 */
|
||||
@NotNull
|
||||
@Min(1)
|
||||
private Integer columnCount;
|
||||
|
||||
/** 行数 */
|
||||
@NotNull
|
||||
@Min(1)
|
||||
private Integer rowCount;
|
||||
|
||||
/** 层数 */
|
||||
@NotNull
|
||||
@Min(1)
|
||||
private Integer layerCount;
|
||||
|
||||
/** 前缀 */
|
||||
@NotBlank
|
||||
private String prefix;
|
||||
|
||||
/** 父节点ID */
|
||||
@NotNull
|
||||
private Long parentId;
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import javax.validation.constraints.*;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
/**
|
||||
* 发货计划业务对象 wms_delivery_plan
|
||||
@@ -43,5 +44,15 @@ public class WmsDeliveryPlanBo extends BaseEntity {
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
// 钢卷集合
|
||||
private String coil;
|
||||
|
||||
//-- 1. 新增审核状态字段(核心)
|
||||
private Integer auditStatus;
|
||||
//-- 2. 新增审核人字段
|
||||
private String auditBy;
|
||||
//-- 3. 新增审核时间字段
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date auditTime;
|
||||
}
|
||||
|
||||
@@ -160,5 +160,10 @@ public class WmsMaterialCoilBo extends BaseEntity {
|
||||
*/
|
||||
private Integer minAbnormalCount;
|
||||
|
||||
/**
|
||||
* 钢卷ID列表(逗号分隔,用于根据ID列表查询钢卷)
|
||||
*/
|
||||
private String coilIds;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.klp.common.annotation.ExcelDictFormat;
|
||||
import com.klp.common.convert.ExcelDictConvert;
|
||||
import com.klp.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
|
||||
/**
|
||||
@@ -71,4 +72,16 @@ public class WmsDeliveryPlanVo extends BaseEntity {
|
||||
*/
|
||||
private String updateByName;
|
||||
|
||||
// 钢卷集合
|
||||
private String coil;
|
||||
|
||||
//-- 1. 新增审核状态字段(核心)
|
||||
private Integer auditStatus;
|
||||
//-- 2. 新增审核人字段
|
||||
private String auditBy;
|
||||
//-- 3. 新增审核时间字段
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date auditTime;
|
||||
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.klp.domain.bo.WmsDeliveryPlanBo;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.klp.domain.vo.WmsDeliveryReportResultVo;
|
||||
import com.klp.domain.vo.WmsMaterialCoilVo;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
|
||||
@@ -99,5 +99,9 @@ public interface IWmsMaterialCoilService {
|
||||
List<com.klp.domain.vo.WmsMaterialCoilExportVo> queryExportList(WmsMaterialCoilBo bo);
|
||||
|
||||
int exportCoil(@NotEmpty(message = "主键不能为空") Long coilId);
|
||||
|
||||
TableDataInfo<WmsMaterialCoilVo> queryAvailableForDelivery(WmsMaterialCoilBo bo, PageQuery pageQuery);
|
||||
|
||||
Boolean batchUpdateDeliveryStatus(List<Long> coilIdList, Integer status);
|
||||
}
|
||||
|
||||
|
||||
@@ -56,20 +56,26 @@ public class WmsActualWarehouseServiceImpl implements IWmsActualWarehouseService
|
||||
Integer layers = bo.getLayerCount();
|
||||
String prefix = bo.getPrefix();
|
||||
Long parentId = bo.getParentId();
|
||||
if (rows == null || cols == null || layers == null || rows < 1 || cols < 1 || layers < 1) {
|
||||
throw new ServiceException("行/列/层必须为正整数");
|
||||
if (layers == null) {
|
||||
layers = 2;
|
||||
}
|
||||
if (rows == null || cols == null || rows < 1 || cols < 1) {
|
||||
throw new ServiceException("行/列必须为正整数");
|
||||
}
|
||||
if (layers < 1) {
|
||||
throw new ServiceException("层必须为正整数");
|
||||
}
|
||||
if (StringUtils.isBlank(prefix)) {
|
||||
throw new ServiceException("前缀不能为空");
|
||||
}
|
||||
|
||||
// 预生成候选编码
|
||||
List<String> codes = new ArrayList<>(rows * cols * layers);
|
||||
for (int c = 1; c <= cols; c++) {
|
||||
for (int r = 1; r <= rows; r++) {
|
||||
String rStr = r < 10 ? ("0" + r) : String.valueOf(r);
|
||||
for (int l = 1; l <= layers; l++) {
|
||||
String code = prefix + c + rStr + '-' + l;
|
||||
for (int l = 1; l <= layers; l++) {
|
||||
int rowsForLayer = (l == 2) ? Math.max(rows - 1, 1) : rows;
|
||||
for (int c = 1; c <= cols; c++) {
|
||||
for (int r = 1; r <= rowsForLayer; r++) {
|
||||
String rStr = r < 10 ? ("0" + r) : String.valueOf(r);
|
||||
String code = prefix + c + '-' + rStr + '-' + l;
|
||||
codes.add(code);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,9 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.klp.common.utils.StringUtils;
|
||||
import com.klp.domain.WmsMaterialCoil;
|
||||
import com.klp.domain.vo.*;
|
||||
import com.klp.mapper.WmsMaterialCoilMapper;
|
||||
import com.klp.system.service.ISysUserService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -34,6 +36,8 @@ public class WmsDeliveryPlanServiceImpl implements IWmsDeliveryPlanService {
|
||||
|
||||
private final ISysUserService userService;
|
||||
|
||||
private final WmsMaterialCoilMapper coilMapper;
|
||||
|
||||
/**
|
||||
* 查询发货计划
|
||||
*/
|
||||
@@ -87,6 +91,7 @@ public class WmsDeliveryPlanServiceImpl implements IWmsDeliveryPlanService {
|
||||
lqw.like(StringUtils.isNotBlank(bo.getPlanName()), WmsDeliveryPlan::getPlanName, bo.getPlanName());
|
||||
lqw.eq(bo.getPlanDate() != null, WmsDeliveryPlan::getPlanDate, bo.getPlanDate());
|
||||
lqw.eq(bo.getPlanType() != null, WmsDeliveryPlan::getPlanType, bo.getPlanType());
|
||||
lqw.eq(bo.getAuditStatus() != null, WmsDeliveryPlan::getAuditStatus, bo.getAuditStatus());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
@@ -163,4 +168,5 @@ public class WmsDeliveryPlanServiceImpl implements IWmsDeliveryPlanService {
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -12,8 +12,10 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.klp.common.helper.LoginHelper;
|
||||
import com.klp.common.utils.StringUtils;
|
||||
import com.klp.common.utils.spring.SpringUtils;
|
||||
import com.klp.domain.WmsDeliveryPlan;
|
||||
import com.klp.domain.bo.*;
|
||||
import com.klp.domain.vo.*;
|
||||
import com.klp.mapper.WmsDeliveryPlanMapper;
|
||||
import com.klp.system.service.ISysUserService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -56,6 +58,7 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
||||
private final IWmsBomItemService bomItemService;
|
||||
private final IWmsProductService productService;
|
||||
private final ISysUserService userService;
|
||||
private final WmsDeliveryPlanMapper deliveryPlanMapper;
|
||||
|
||||
/**
|
||||
* 查询钢卷物料表
|
||||
@@ -347,6 +350,23 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
||||
// 兼容原来的itemId单值查询
|
||||
qw.eq("mc.item_id", bo.getItemId());
|
||||
}
|
||||
// 添加coilIds查询条件,支持逗号分隔的多个coilId查询
|
||||
if (StringUtils.isNotBlank(bo.getCoilIds())) {
|
||||
String[] coilIdArray = bo.getCoilIds().split(",");
|
||||
List<Long> coilIdList = new ArrayList<>();
|
||||
for (String coilIdStr : coilIdArray) {
|
||||
if (StringUtils.isNotBlank(coilIdStr)) {
|
||||
try {
|
||||
coilIdList.add(Long.parseLong(coilIdStr.trim()));
|
||||
} catch (NumberFormatException e) {
|
||||
// 忽略无效的ID格式
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!coilIdList.isEmpty()) {
|
||||
qw.in("mc.coil_id", coilIdList);
|
||||
}
|
||||
}
|
||||
//逻辑删除
|
||||
qw.eq("mc.del_flag", 0);
|
||||
//把team字段作为筛选条件
|
||||
@@ -1752,4 +1772,114 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
||||
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询可用于发货计划的钢卷(未被任何发货计划引用的钢卷)
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 钢卷分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<WmsMaterialCoilVo> queryAvailableForDelivery(WmsMaterialCoilBo bo, PageQuery pageQuery) {
|
||||
// 构建查询条件
|
||||
LambdaQueryWrapper<WmsMaterialCoil> lqw = buildAvailableCoilQueryWrapper(bo);
|
||||
Page<WmsMaterialCoilVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建可用于发货计划的钢卷查询条件
|
||||
* 排除已被任何发货计划引用的钢卷
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 查询构造器
|
||||
*/
|
||||
private LambdaQueryWrapper<WmsMaterialCoil> buildAvailableCoilQueryWrapper(WmsMaterialCoilBo bo) {
|
||||
LambdaQueryWrapper<WmsMaterialCoil> lqw = Wrappers.lambdaQuery();
|
||||
|
||||
// 基础查询条件
|
||||
lqw.eq(WmsMaterialCoil::getDelFlag, 0); // 未删除
|
||||
lqw.eq(WmsMaterialCoil::getStatus, 0); // 在库状态
|
||||
lqw.eq(WmsMaterialCoil::getDataType, 1); // 当前数据
|
||||
|
||||
// 应用传入的查询条件
|
||||
if (StringUtils.isNotBlank(bo.getEnterCoilNo())) {
|
||||
lqw.like(WmsMaterialCoil::getEnterCoilNo, bo.getEnterCoilNo());
|
||||
}
|
||||
if (StringUtils.isNotBlank(bo.getCurrentCoilNo())) {
|
||||
lqw.like(WmsMaterialCoil::getCurrentCoilNo, bo.getCurrentCoilNo());
|
||||
}
|
||||
if (StringUtils.isNotBlank(bo.getSupplierCoilNo())) {
|
||||
lqw.like(WmsMaterialCoil::getSupplierCoilNo, bo.getSupplierCoilNo());
|
||||
}
|
||||
if (bo.getWarehouseId() != null) {
|
||||
lqw.eq(WmsMaterialCoil::getWarehouseId, bo.getWarehouseId());
|
||||
}
|
||||
if (bo.getItemId() != null) {
|
||||
lqw.eq(WmsMaterialCoil::getItemId, bo.getItemId());
|
||||
}
|
||||
if (StringUtils.isNotBlank(bo.getItemType())) {
|
||||
lqw.eq(WmsMaterialCoil::getItemType, bo.getItemType());
|
||||
}
|
||||
|
||||
// 排除已被发货计划引用的钢卷
|
||||
LambdaQueryWrapper<WmsDeliveryPlan> planQuery =Wrappers.lambdaQuery();
|
||||
planQuery.eq(WmsDeliveryPlan::getDelFlag, 0) // 过滤已删除的计划
|
||||
.isNotNull(WmsDeliveryPlan::getCoil) // 只查有钢卷ID的计划
|
||||
.ne(WmsDeliveryPlan::getCoil, ""); // 排除空字符串
|
||||
List<WmsDeliveryPlan> plans = deliveryPlanMapper.selectList(planQuery);
|
||||
if (!plans.isEmpty()) {
|
||||
Set<Long> usedCoilIds = new HashSet<>();
|
||||
for (WmsDeliveryPlan plan : plans) {
|
||||
if (StringUtils.isNotBlank(plan.getCoil())) {
|
||||
String[] coilIds = plan.getCoil().split(",");
|
||||
for (String coilIdStr : coilIds) {
|
||||
try {
|
||||
usedCoilIds.add(Long.parseLong(coilIdStr.trim()));
|
||||
} catch (NumberFormatException ignored) {
|
||||
// 忽略无效的ID
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!usedCoilIds.isEmpty()) {
|
||||
lqw.notIn(WmsMaterialCoil::getCoilId, usedCoilIds);
|
||||
}
|
||||
}
|
||||
|
||||
return lqw;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 批量更新钢卷发货状态
|
||||
*
|
||||
* @param coilIds 钢卷ID列表
|
||||
* @param status 目标状态 (0=在库, 1=在途, 2=已出库)
|
||||
* @return 是否更新成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean batchUpdateDeliveryStatus(List<Long> coilIds, Integer status) {
|
||||
if (coilIds == null || coilIds.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (status == null || status < 0 || status > 2) {
|
||||
throw new RuntimeException("无效的状态值,状态必须在0-2之间");
|
||||
}
|
||||
|
||||
// 构造更新条件
|
||||
LambdaUpdateWrapper<WmsMaterialCoil> updateWrapper = Wrappers.lambdaUpdate();
|
||||
updateWrapper.in(WmsMaterialCoil::getCoilId, coilIds);
|
||||
updateWrapper.set(WmsMaterialCoil::getStatus, status);
|
||||
|
||||
// 如果是设置为已出库状态,同时更新出库时间
|
||||
if (status == 1) {
|
||||
updateWrapper.set(WmsMaterialCoil::getExportTime, new Date());
|
||||
}
|
||||
|
||||
return baseMapper.update(null, updateWrapper) > 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,10 @@
|
||||
<result property="planName" column="plan_name"/>
|
||||
<result property="planDate" column="plan_date"/>
|
||||
<result property="planType" column="plan_type"/>
|
||||
<result property="coil" column="coil"/>
|
||||
<result property="auditStatus" column="audit_status"/>
|
||||
<result property="auditBy" column="audit_by"/>
|
||||
<result property="auditTime" column="audit_time"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
|
||||
Reference in New Issue
Block a user