排产看板提交

dev-scheduling
zhangdi 3 days ago
parent 036d40c015
commit ce3ed2fa4c
  1. 86
      src/views/productionSchedulingPlan/schedulingDashboard/index.vue

@ -126,7 +126,7 @@
:style="{ '--checkbox-color': '#6c757d' }" :style="{ '--checkbox-color': '#6c757d' }"
@change="handleLegendChange('pending')" @change="handleLegendChange('pending')"
> >
<span class="legend-text">未开始</span> <span class="legend-text" style="color: #6c757d">未开始</span>
</el-checkbox> </el-checkbox>
</div> </div>
@ -136,7 +136,7 @@
:style="{ '--checkbox-color': '#007bff' }" :style="{ '--checkbox-color': '#007bff' }"
@change="handleLegendChange('processing')" @change="handleLegendChange('processing')"
> >
<span class="legend-text">进行中</span> <span class="legend-text" style="color: #007bff">进行中</span>
</el-checkbox> </el-checkbox>
</div> </div>
<div class="legend-item"> <div class="legend-item">
@ -145,7 +145,7 @@
:style="{ '--checkbox-color': '#28a745' }" :style="{ '--checkbox-color': '#28a745' }"
@change="handleLegendChange('completed')" @change="handleLegendChange('completed')"
> >
<span class="legend-text">已完成</span> <span class="legend-text" style="color: #28a745">已完成</span>
</el-checkbox> </el-checkbox>
</div> </div>
</div> </div>
@ -159,7 +159,7 @@
<div class="info-title-cell info-title-num">序号</div> <div class="info-title-cell info-title-num">序号</div>
<div class="info-title-cell">订单信息</div> <div class="info-title-cell">订单信息</div>
</div> </div>
<div class="info-container"> <div class="info-container" ref="leftScrollContainer">
<div <div
v-for="(order, index) in currentPageOrders" v-for="(order, index) in currentPageOrders"
:key="index" :key="index"
@ -174,12 +174,13 @@
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<div class="info-item-txt info-item-info"> <div class="info-item-txt info-item-info">
<span style="font-weight:600;">{{ order.woCode }}</span>/ <span style="font-weight: 600">{{ order.woCode }}</span
>/
<span>{{ order.partCode }}</span> <span>{{ order.partCode }}</span>
</div> </div>
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24">
<div class="info-item-txt info-item-info"> <div class="info-item-txt info-item-info">
{{ order.batchNo }}<i>&nbsp;/&nbsp;</i>{{ order.makeQty }}<i>&nbsp;/&nbsp;</i {{ order.batchNo }}<i>&nbsp;/&nbsp;</i>{{ order.makeQty }}<i>&nbsp;/&nbsp;</i
>{{ order.productIdent }}<i v-if="order.priorityAps != ''">&nbsp;/&nbsp;</i >{{ order.productIdent }}<i v-if="order.priorityAps != ''">&nbsp;/&nbsp;</i
>{{ order.priorityAps }} >{{ order.priorityAps }}
@ -266,7 +267,7 @@
</div> </div>
<!-- 甘特图内容区域 --> <!-- 甘特图内容区域 -->
<div class="chart-content" :style="{ width: `${timelineWidth}%` }"> <div class="chart-content" ref="timelineContainerTest" :style="{ width: `${timelineWidth}%` }">
<div class="grid-lines"> <div class="grid-lines">
<div <div
v-for="(time, index) in majorTickLabels" v-for="(time, index) in majorTickLabels"
@ -336,14 +337,15 @@
</div> </div>
</div> </div>
<!-- 分页控件 sizes :page-sizes="[10, 20, 50]" ,sizes--> <!-- 分页控件 :page-sizes="[10, 20, 50]" ,sizes-->
<div class="pagination-container"> <div class="pagination-container">
<el-pagination <el-pagination
@size-change="handleSizeChange" @size-change="handleSizeChange"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
:current-page="currentPage" :current-page="currentPage"
:page-size="pageSize" :page-size="pageSize"
layout="total, prev, pager, next, jumper" :page-sizes="[10, 20, 50]"
layout="total,sizes, prev, pager, next, jumper"
:total="totalOrders" :total="totalOrders"
></el-pagination> ></el-pagination>
</div> </div>
@ -388,7 +390,7 @@
<span class="label">计划开始</span> <span class="label">计划开始</span>
<span class="value">{{ tooltipData.planStartTime || '-' }}</span> <span class="value">{{ tooltipData.planStartTime || '-' }}</span>
</li> </li>
<li class="detail-item"> <li class="detail-item">
<span class="label">计划完成</span> <span class="label">计划完成</span>
<span class="value">{{ tooltipData.planEndTime || '-' }}</span> <span class="value">{{ tooltipData.planEndTime || '-' }}</span>
</li> </li>
@ -460,7 +462,7 @@ export default {
// //
currentPage: 1, currentPage: 1,
pageSize: 8, pageSize: 10,
// //
tooltipVisible: false, tooltipVisible: false,
@ -674,6 +676,13 @@ export default {
this.updateTimeAxis(); this.updateTimeAxis();
this.$nextTick(() => { this.$nextTick(() => {
this.calcCurrentTimePosition(); this.calcCurrentTimePosition();
//
if (this.$refs.timelineContainerTest) {
this.$refs.timelineContainerTest.addEventListener('scroll', this.handleRightScrollBound);
}
if (this.$refs.leftScrollContainer) {
this.$refs.leftScrollContainer.addEventListener('scroll', this.handleLeftScrollBound);
}
}); });
// 线 // 线
@ -681,7 +690,39 @@ export default {
// this.calcCurrentTimePosition(); // this.calcCurrentTimePosition();
// }, 60000); // }, 60000);
}, },
created() {
// this
this.handleRightScrollBound = this.handleRightScroll.bind(this);
this.handleLeftScrollBound = this.handleLeftScroll.bind(this);
},
beforeDestroy() {
//
if (this.$refs.timelineContainerTest) {
this.$refs.timelineContainerTest.removeEventListener('scroll', this.handleRightScrollBound);
}
if (this.$refs.leftScrollContainer) {
this.$refs.leftScrollContainer.removeEventListener('scroll', this.handleLeftScrollBound);
}
},
methods: { methods: {
//
handleRightScroll(event) {
if (this.$refs.leftScrollContainer) {
const rightScrollTop = event.target.scrollTop;
console.log('右侧',rightScrollTop)
this.$refs.leftScrollContainer.scrollTop = rightScrollTop;
}
},
//
handleLeftScroll(event) {
if (this.$refs.timelineContainerTest) {
const leftScrollTop = event.target.scrollTop;
this.$refs.timelineContainerTest.scrollTop = leftScrollTop;
console.log('左侧',leftScrollTop,this.$refs.timelineContainerTest.scrollTop)
}
},
updateTime() { updateTime() {
// //
const today = new Date(); const today = new Date();
@ -755,6 +796,7 @@ export default {
// //
scrollToCurrentTime() { scrollToCurrentTime() {
debugger
const container = this.$refs.timelineContainer; const container = this.$refs.timelineContainer;
if (container && this.currentTimePosition >= 0 && this.currentTimePosition <= 100) { if (container && this.currentTimePosition >= 0 && this.currentTimePosition <= 100) {
// //
@ -1100,7 +1142,6 @@ export default {
// //
const percent = (startHour / totalDuration) * 100; const percent = (startHour / totalDuration) * 100;
console.log('percent',percent)
return Math.max(0, Math.min(100, percent)); return Math.max(0, Math.min(100, percent));
}, },
@ -1118,7 +1159,7 @@ export default {
} }
// //
const width = ((duration / totalDuration) * 100); const width = (duration / totalDuration) * 100;
return Math.max(0, Math.min(100, width)); return Math.max(0, Math.min(100, width));
}, },
@ -1258,9 +1299,17 @@ export default {
width: 330px; width: 330px;
background-color: #f8f9fa; background-color: #f8f9fa;
flex-shrink: 0; flex-shrink: 0;
display: flex;
flex-direction: column;
} }
.info-container { .info-container {
flex: 1;
overflow-y: auto; /* 允许垂直滚动 */
overflow-x: hidden; /* 隐藏水平滚动条 */
}
/* 隐藏滚动条的样式(Webkit浏览器) */
.info-container::-webkit-scrollbar {
display: none; /* 隐藏滚动条 */
} }
.info-item-title { .info-item-title {
@ -1283,12 +1332,12 @@ export default {
.info-item-txt i { .info-item-txt i {
font-style: normal; font-style: normal;
} }
.info-item-info{ .info-item-info {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
padding-right: 15px; padding-right: 15px;
} }
.info-title-cell { .info-title-cell {
@ -1310,6 +1359,7 @@ export default {
.info-item { .info-item {
display: flex; display: flex;
height: 100%; height: 100%;
/* padding: 5px; */ /* padding: 5px; */
} }
@ -1328,8 +1378,8 @@ export default {
flex: 1; flex: 1;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
overflow-y: hidden; overflow-y: auto; /* 允许垂直滚动 */
overflow-x: auto; /* 确保支持横向滚动 */ overflow-x: auto; /* 允许水平滚动 */
} }
/* 图表X轴区域样式 */ /* 图表X轴区域样式 */

Loading…
Cancel
Save