排产看板问题修改

dev-scheduling
zhangdi 2 months ago
parent e770780d79
commit 49fd6d0a62
  1. 2
      src/api/productionManagement/frontTooling.js
  2. 121
      src/views/productionSchedulingPlan/schedulingDashboard/container.vue

@ -2,7 +2,7 @@ import request from '@/axios';
//列表接口 //列表接口
export const getList = (current, size, params) => { export const getList = (current, size, params) => {
return request({ return request({
url: '/blade-desk//sjWorkOrder/queryByReadStatus', url: '/blade-desk/sjWorkOrder/queryByReadStatus',
method: 'get', method: 'get',
params: { params: {
...params, ...params,

@ -327,6 +327,10 @@
@mouseenter="showTooltip($event, task, order.woCode)" @mouseenter="showTooltip($event, task, order.woCode)"
@mouseleave="hideTooltip()" @mouseleave="hideTooltip()"
> >
<div class="task-icon" v-if="task.remindStatus=='2'||task.remindStatus=='1'">
<el-icon v-if="task.remindStatus == '2'" class="task-icon-red"><WarningFilled /></el-icon>
<el-icon v-else-if="task.remindStatus == '1'" class="task-icon-yellow"><WarningFilled /></el-icon>
</div>
<div <div
class="task-text-wrapper" class="task-text-wrapper"
:class="{ :class="{
@ -345,29 +349,6 @@
> >
{{ task.processName }} {{ task.processName }}
</div> </div>
<!-- <div
class="task-label"
v-if="getWidthPercent(task.planStartTime, task.planEndTime) >= 1.5"
>
<span class="task-label-txt task-label-txt-inside">{{
task.processName
}}</span>
</div>
<div
v-else
class="task-overlay-text"
:style="{
width: `${getWidthPercent(task.planStartTime, task.planEndTime)}%`,
top: `${getNarrowTaskOffsetByLayer(layerIndex)}px`,
left: `${getNarrowTaskOffsetByLayerLeft(
task.processName,
getWidthPercent(task.planStartTime, task.planEndTime),
layerIndex
)}px`,
}"
>
{{ task.processName }}
</div> -->
</div> </div>
</template> </template>
</div> </div>
@ -859,8 +840,6 @@ export default {
// this.formLabelAlign.teamName = this.tsName; // this.formLabelAlign.teamName = this.tsName;
this.updateTime(); this.updateTime();
//
// this.getData();
}, },
// //
getNarrowTaskOffset(orderWoCode, taskIndex, layerIndex) { getNarrowTaskOffset(orderWoCode, taskIndex, layerIndex) {
@ -962,7 +941,14 @@ export default {
// YYYY-MM-DD // YYYY-MM-DD
const format = date => date.toISOString().split('T')[0]; const format = date => date.toISOString().split('T')[0];
this.formLabelAlign.timeRange = [format(startDate), format(endDate)]; this.formLabelAlign.timeRange = [format(startDate), format(endDate)];
const savedLegend = sessionStorage.getItem('legendStatus');
if (savedLegend) {
try {
this.legendStatus = JSON.parse(savedLegend);
} catch (e) {
console.warn('Failed to parse legendStatus from sessionStorage', e);
}
}
// //
if (type === 'reset') { if (type === 'reset') {
this.legendStatus.completed = false; this.legendStatus.completed = false;
@ -977,6 +963,7 @@ export default {
handleLegendChange(type) { handleLegendChange(type) {
// //
this.formLabelAlign.planStatusList = []; this.formLabelAlign.planStatusList = [];
if (this.legendStatus.completed) { if (this.legendStatus.completed) {
this.formLabelAlign.planStatusList.push('5'); this.formLabelAlign.planStatusList.push('5');
} }
@ -986,8 +973,9 @@ export default {
if (this.legendStatus.pending) { if (this.legendStatus.pending) {
this.formLabelAlign.planStatusList.push('1'); this.formLabelAlign.planStatusList.push('1');
} }
if (type == 'reset') {
} // sessionStorage.setItem('formLabelAlign', JSON.stringify(this.formLabelAlign));
sessionStorage.setItem('legendStatus', JSON.stringify(this.legendStatus)); //
this.getData(); this.getData();
}, },
@ -1091,6 +1079,10 @@ export default {
// this.formLabelAlign.planStatusList = []; // this.formLabelAlign.planStatusList = [];
// } // }
let seeData = sessionStorage.getItem('formLabelAlign'); let seeData = sessionStorage.getItem('formLabelAlign');
let seeLegend = sessionStorage.getItem('legendStatus');
if (seeLegend) {
this.legendStatus = JSON.parse(seeLegend);
}
if (seeData) { if (seeData) {
this.formLabelAlign = JSON.parse(seeData); this.formLabelAlign = JSON.parse(seeData);
} }
@ -1302,6 +1294,7 @@ export default {
console.log(this.formLabelAlign, '99999'); console.log(this.formLabelAlign, '99999');
sessionStorage.setItem('formLabelAlign', JSON.stringify(this.formLabelAlign)); sessionStorage.setItem('formLabelAlign', JSON.stringify(this.formLabelAlign));
sessionStorage.setItem('legendStatus', JSON.stringify(this.legendStatus)); //
this.getData(); this.getData();
}, },
@ -1328,6 +1321,7 @@ export default {
// this.updateTime('reset'); // this.updateTime('reset');
sessionStorage.setItem('formLabelAlign', JSON.stringify(this.formLabelAlign)); sessionStorage.setItem('formLabelAlign', JSON.stringify(this.formLabelAlign));
sessionStorage.setItem('legendStatus', JSON.stringify(this.legendStatus)); //
this.getData(); this.getData();
}, },
@ -1344,15 +1338,6 @@ export default {
}, },
// //
getStatusColor(row) { getStatusColor(row) {
if (row.planStatus === '1') {
if (row.remindStatus === '1') {
return '#FFD700'; //
} else if (row.remindStatus === '2') {
return '#dc3545'; //
}
// remindStatus
return '#6c757d';
}
switch (row.planStatus) { switch (row.planStatus) {
case '5': case '5':
return '#007bff'; return '#007bff';
@ -1361,6 +1346,8 @@ export default {
return '#28a745'; return '#28a745';
case '6': case '6':
return '#dc3545'; return '#dc3545';
case '1':
return '#6c757d';
default: default:
return '#ccc'; return '#ccc';
} }
@ -1606,8 +1593,7 @@ export default {
const containerWidth = this.$refs.timelineContainer.scrollWidth; const containerWidth = this.$refs.timelineContainer.scrollWidth;
if (containerWidth <= 0) return false; // if (containerWidth <= 0) return false; //
const taskPixelWidth = (containerWidth * taskWidthPercent) / 100;
const taskPixelWidth = (containerWidth * taskWidthPercent)/100;
const textWidth = this.getTextWidth(text, 10); // const textWidth = this.getTextWidth(text, 10); //
return taskPixelWidth >= textWidth + 4; // 4px padding return taskPixelWidth >= textWidth + 4; // 4px padding
}, },
@ -1624,7 +1610,9 @@ export default {
// //
getTaskTextStyle(task, layerIndex) { getTaskTextStyle(task, layerIndex) {
const canFit = this.canFitText(task.processName, task.planStartTime, task.planEndTime); const canFit = this.canFitText(task.processName, task.planStartTime, task.planEndTime);
const bgColor = this.getStatusColor(task);
//
const isYellow = bgColor === '#FFD700';
if (canFit) { if (canFit) {
// //
return { return {
@ -1632,7 +1620,7 @@ export default {
top: '50%', top: '50%',
left: '50%', left: '50%',
transform: 'translate(-50%, -50%)', transform: 'translate(-50%, -50%)',
color: 'white', color: isYellow ? '#000' : 'white',
fontSize: '10px', fontSize: '10px',
whiteSpace: 'nowrap', whiteSpace: 'nowrap',
textShadow: '0 0 2px rgba(0,0,0,0.5)', textShadow: '0 0 2px rgba(0,0,0,0.5)',
@ -1645,7 +1633,7 @@ export default {
top: isEvenLayer ? '-15px' : 'calc(100% )', top: isEvenLayer ? '-15px' : 'calc(100% )',
left: '50%', left: '50%',
transform: 'translateX(-50%)', transform: 'translateX(-50%)',
color: '#333', color: isYellow ? '#000' : '#333',
fontSize: '10px', fontSize: '10px',
whiteSpace: 'nowrap', whiteSpace: 'nowrap',
padding: '2px 6px', padding: '2px 6px',
@ -1654,6 +1642,14 @@ export default {
}; };
} }
}, },
getTaskIcon(task) {
// planStatus
if (task.remindStatus == '2' || task.remindStatus == '1') {
return 'el-icon-warning';
} else {
return '';
}
},
}, },
}; };
</script> </script>
@ -2014,9 +2010,50 @@ export default {
border: 1px solid rgba(255, 255, 255, 0.3); border: 1px solid rgba(255, 255, 255, 0.3);
min-width: 5px; min-width: 5px;
z-index: 1; z-index: 1;
.task-icon {
position: absolute;
top: -14px;
left: -8px;
width: 16px;
height: 16px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
z-index: 2;
font-size: 12px;
color: #666;
i {
font-weight: bold;
}
}
.task-icon-red {
color: #ff4d4f; /* 红色 - 与 current-time-indicator 一致 */
background-color: white;
}
.task-icon-yellow {
color: #faad14; /* Element UI 警告黄色 */
background-color: white;
}
} }
.task-bar.task-bar-narrow { .task-bar.task-bar-narrow {
overflow: visible; /* 允许覆盖元素超出边界 */ overflow: visible; /* 允许覆盖元素超出边界 */
.task-icon {
top: -14px;
left: 0;
transform: translateX(-50%);
}
.task-icon-red {
color: #ff4d4f; /* 红色 - 与 current-time-indicator 一致 */
background-color: white;
}
.task-icon-yellow {
color: #faad14; /* Element UI 警告黄色 */
background-color: white;
}
} }
.task-bar:hover { .task-bar:hover {

Loading…
Cancel
Save