feat(wms/delivery): 改进发货单页面布局和交互
添加可拖拽分割线调整表格和详情区域高度 固定顶部操作栏和表格区域滚动 优化页面整体样式和用户体验
This commit is contained in:
@@ -1,7 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<div v-loading="loading">
|
<div v-loading="loading" style="position: relative; top: 0; background-color: #f5f7fa;">
|
||||||
<div v-if="waybillId">
|
<div v-if="waybillId">
|
||||||
<el-row :gutter="10" class="mb8">
|
<!-- 这一部分始终定在最上方 -->
|
||||||
|
<el-row :gutter="10" class="mb8" style="position: sticky; top: 0; z-index: 10000; padding: 10px; background-color: #fff;">
|
||||||
<el-col :span="2" style="font-weight: 900;">发货单明细</el-col>
|
<el-col :span="2" style="font-weight: 900;">发货单明细</el-col>
|
||||||
<el-col :span="1.5">
|
<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>
|
||||||
|
|||||||
@@ -39,7 +39,8 @@
|
|||||||
</el-descriptions>
|
</el-descriptions>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div style="height: calc(100vh - 184px); overflow-y: scroll; overflow-x: hidden;">
|
<div style="height: calc(100vh - 204px); overflow: hidden; display: flex; flex-direction: column;">
|
||||||
|
<div :style="{ height: topHeight + 'px', overflow: 'auto' }">
|
||||||
<el-table v-loading="loading" border :data="deliveryWaybillList" highlight-current-row
|
<el-table v-loading="loading" border :data="deliveryWaybillList" highlight-current-row
|
||||||
@row-click="handleRowClick">
|
@row-click="handleRowClick">
|
||||||
<el-table-column label="发货单唯一ID" align="center" prop="waybillId" v-if="false" />
|
<el-table-column label="发货单唯一ID" align="center" prop="waybillId" v-if="false" />
|
||||||
@@ -90,13 +91,16 @@
|
|||||||
|
|
||||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
|
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
|
||||||
:limit.sync="queryParams.pageSize" @pagination="getList" />
|
:limit.sync="queryParams.pageSize" @pagination="getList" />
|
||||||
|
</div>
|
||||||
|
|
||||||
<el-divider style="margin: 20px 0;" />
|
<!-- 可拖拽的分割线 -->
|
||||||
|
<div class="resizer" ref="resizer" @mousedown="startResize"></div>
|
||||||
|
|
||||||
|
<div :style="{ flex: 1, overflowY: 'auto', overflowX: 'hidden' }">
|
||||||
<DeliveryWaybillDetail v-if="canEdit" ref="detailTable" :waybillId="waybillId" :coilList="coilList" />
|
<DeliveryWaybillDetail v-if="canEdit" ref="detailTable" :waybillId="waybillId" :coilList="coilList" />
|
||||||
<el-empty v-else description="已发货,不可修改,点击打印查看详情" />
|
<el-empty v-else description="已发货,不可修改,点击打印查看详情" />
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@@ -196,6 +200,8 @@ export default {
|
|||||||
// 发货单表格数据
|
// 发货单表格数据
|
||||||
deliveryWaybillList: [],
|
deliveryWaybillList: [],
|
||||||
waybillId: null,
|
waybillId: null,
|
||||||
|
// 上部分高度
|
||||||
|
topHeight: 300,
|
||||||
// 打印相关数据
|
// 打印相关数据
|
||||||
printDialogVisible: false,
|
printDialogVisible: false,
|
||||||
currentWaybill: {},
|
currentWaybill: {},
|
||||||
@@ -262,6 +268,33 @@ export default {
|
|||||||
this.planListOption = response.rows || [];
|
this.planListOption = response.rows || [];
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
/** 开始拖拽 */
|
||||||
|
startResize(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
// 记录初始位置
|
||||||
|
const container = this.$el.querySelector('.el-card__body');
|
||||||
|
const containerRect = container.getBoundingClientRect();
|
||||||
|
this.startY = e.clientY;
|
||||||
|
this.startTopHeight = this.topHeight;
|
||||||
|
document.addEventListener('mousemove', this.resize);
|
||||||
|
document.addEventListener('mouseup', this.stopResize);
|
||||||
|
},
|
||||||
|
/** 拖拽中 */
|
||||||
|
resize(e) {
|
||||||
|
const container = this.$el.querySelector('.el-card__body');
|
||||||
|
const containerRect = container.getBoundingClientRect();
|
||||||
|
// 基于初始位置计算相对变化
|
||||||
|
const deltaY = e.clientY - this.startY;
|
||||||
|
const newHeight = this.startTopHeight + deltaY;
|
||||||
|
if (newHeight > 100 && newHeight < containerRect.height - 100) {
|
||||||
|
this.topHeight = newHeight;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/** 结束拖拽 */
|
||||||
|
stopResize() {
|
||||||
|
document.removeEventListener('mousemove', this.resize);
|
||||||
|
document.removeEventListener('mouseup', this.stopResize);
|
||||||
|
},
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
// 确保查询参数包含planId
|
// 确保查询参数包含planId
|
||||||
@@ -524,4 +557,42 @@ export default {
|
|||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.resizer {
|
||||||
|
width: 100%;
|
||||||
|
height: 4px;
|
||||||
|
background-color: #818181;
|
||||||
|
cursor: row-resize;
|
||||||
|
position: relative;
|
||||||
|
transition: background-color 0.3s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.resizer:hover {
|
||||||
|
background-color: #409eff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.resizer::before {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
left: 50%;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
width: 40px;
|
||||||
|
height: 2px;
|
||||||
|
background-color: #c0c4cc;
|
||||||
|
border-radius: 1px;
|
||||||
|
transition: background-color 0.3s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.resizer:hover::before {
|
||||||
|
background-color: #409eff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.resizer:active {
|
||||||
|
background-color: #409eff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.resizer:active::before {
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user