|
|
|
@ -10,7 +10,7 @@ |
|
|
|
clearable |
|
|
|
clearable |
|
|
|
filterable |
|
|
|
filterable |
|
|
|
placeholder="请选择" |
|
|
|
placeholder="请选择" |
|
|
|
size="small" |
|
|
|
size="medium" |
|
|
|
value-key="id" |
|
|
|
value-key="id" |
|
|
|
@change="teamChange" |
|
|
|
@change="teamChange" |
|
|
|
> |
|
|
|
> |
|
|
|
@ -30,7 +30,7 @@ |
|
|
|
clearable |
|
|
|
clearable |
|
|
|
filterable |
|
|
|
filterable |
|
|
|
placeholder="请选择" |
|
|
|
placeholder="请选择" |
|
|
|
size="small" |
|
|
|
size="medium" |
|
|
|
value-key="id" |
|
|
|
value-key="id" |
|
|
|
@change="equipChange" |
|
|
|
@change="equipChange" |
|
|
|
> |
|
|
|
> |
|
|
|
@ -50,7 +50,7 @@ |
|
|
|
clearable |
|
|
|
clearable |
|
|
|
filterable |
|
|
|
filterable |
|
|
|
placeholder="请选择" |
|
|
|
placeholder="请选择" |
|
|
|
size="small" |
|
|
|
size="medium" |
|
|
|
@change="processChange" |
|
|
|
@change="processChange" |
|
|
|
value-key="id" |
|
|
|
value-key="id" |
|
|
|
> |
|
|
|
> |
|
|
|
@ -59,7 +59,6 @@ |
|
|
|
:label="item.name" |
|
|
|
:label="item.name" |
|
|
|
:value="item" |
|
|
|
:value="item" |
|
|
|
:key="index" |
|
|
|
:key="index" |
|
|
|
|
|
|
|
|
|
|
|
></el-option> |
|
|
|
></el-option> |
|
|
|
</el-select> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
@ -71,16 +70,16 @@ |
|
|
|
type="date" |
|
|
|
type="date" |
|
|
|
value-format="YYYY-MM-DD" |
|
|
|
value-format="YYYY-MM-DD" |
|
|
|
placeholder="选择日期" |
|
|
|
placeholder="选择日期" |
|
|
|
size="small" |
|
|
|
size="medium" |
|
|
|
></el-date-picker> |
|
|
|
></el-date-picker> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-col :span="4"> |
|
|
|
<div style="float: right"> |
|
|
|
<div style="float: right"> |
|
|
|
<el-button type="primary" icon="el-icon-search" @click="handleSubmit" size="small"> |
|
|
|
<el-button type="primary" icon="el-icon-search" @click="handleSubmit" size="medium"> |
|
|
|
搜索 |
|
|
|
搜索 |
|
|
|
</el-button> |
|
|
|
</el-button> |
|
|
|
<el-button icon="el-icon-delete" @click="handleReset" size="small"> 清空 </el-button> |
|
|
|
<el-button icon="el-icon-delete" @click="handleReset" size="medium"> 清空 </el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-col> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
</el-row> |
|
|
|
@ -91,7 +90,7 @@ |
|
|
|
<div class="gantt-header"> |
|
|
|
<div class="gantt-header"> |
|
|
|
<div class="status-legend"> |
|
|
|
<div class="status-legend"> |
|
|
|
<div class="legend-item"> |
|
|
|
<div class="legend-item"> |
|
|
|
<el-button type="primary" size="small" @click="exportXls">导出</el-button> |
|
|
|
<el-button type="primary" size="medium" @click="exportXls">导出</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="legend-item"> |
|
|
|
<div class="legend-item"> |
|
|
|
<span class="legend-color completed"></span> |
|
|
|
<span class="legend-color completed"></span> |
|
|
|
@ -264,7 +263,19 @@ |
|
|
|
@mouseenter="showTooltip($event, task, order.woCode)" |
|
|
|
@mouseenter="showTooltip($event, task, order.woCode)" |
|
|
|
@mouseleave="hideTooltip()" |
|
|
|
@mouseleave="hideTooltip()" |
|
|
|
> |
|
|
|
> |
|
|
|
<span class="task-label">{{ task.processName }}</span> |
|
|
|
<div class="task-label"> |
|
|
|
|
|
|
|
<span |
|
|
|
|
|
|
|
class="task-label-txt" |
|
|
|
|
|
|
|
:style="{ |
|
|
|
|
|
|
|
top: `${getTastTopOffset( |
|
|
|
|
|
|
|
layerIndex, |
|
|
|
|
|
|
|
getLayeredTasks(order.woCode).length, |
|
|
|
|
|
|
|
order.woCode |
|
|
|
|
|
|
|
)}px`, |
|
|
|
|
|
|
|
}" |
|
|
|
|
|
|
|
>{{ task.processName }}</span |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
@ -358,7 +369,12 @@ |
|
|
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
<script> |
|
|
|
import { getData, selectEquip, selectTeam } from '@/api/productionSchedulingPlan/scheduling'; |
|
|
|
import { getData, selectEquip, selectTeam } from '@/api/productionSchedulingPlan/scheduling'; |
|
|
|
import { getProcessSet, exportBlob,getEquipment,getTeamSet } from '@/api/productionSchedulingPlan/basic'; |
|
|
|
import { |
|
|
|
|
|
|
|
getProcessSet, |
|
|
|
|
|
|
|
exportBlob, |
|
|
|
|
|
|
|
getEquipment, |
|
|
|
|
|
|
|
getTeamSet, |
|
|
|
|
|
|
|
} from '@/api/productionSchedulingPlan/basic'; |
|
|
|
import { downloadXls } from '@/utils/util'; |
|
|
|
import { downloadXls } from '@/utils/util'; |
|
|
|
// import { exportBlob } from '@/api/common'; |
|
|
|
// import { exportBlob } from '@/api/common'; |
|
|
|
export default { |
|
|
|
export default { |
|
|
|
@ -460,14 +476,14 @@ export default { |
|
|
|
}, 600000); // 每分钟更新一次 |
|
|
|
}, 600000); // 每分钟更新一次 |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
processChange(val){ |
|
|
|
processChange(val) { |
|
|
|
this.formLabelAlign.processName = val.name |
|
|
|
this.formLabelAlign.processName = val.name; |
|
|
|
}, |
|
|
|
}, |
|
|
|
equipChange(val){ |
|
|
|
equipChange(val) { |
|
|
|
this.formLabelAlign.equipName = val.deviceName |
|
|
|
this.formLabelAlign.equipName = val.deviceName; |
|
|
|
}, |
|
|
|
}, |
|
|
|
teamChange(val){ |
|
|
|
teamChange(val) { |
|
|
|
this.formLabelAlign.teamName = val.tsName |
|
|
|
this.formLabelAlign.teamName = val.tsName; |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 导出 |
|
|
|
// 导出 |
|
|
|
@ -614,11 +630,11 @@ export default { |
|
|
|
this.formLabelAlign = { |
|
|
|
this.formLabelAlign = { |
|
|
|
startTime: new Date().toISOString().substr(0, 10), |
|
|
|
startTime: new Date().toISOString().substr(0, 10), |
|
|
|
teamName: '', |
|
|
|
teamName: '', |
|
|
|
teamId:'', |
|
|
|
teamId: '', |
|
|
|
equipName: '', |
|
|
|
equipName: '', |
|
|
|
equipId:'', |
|
|
|
equipId: '', |
|
|
|
processName: '', |
|
|
|
processName: '', |
|
|
|
processId:'', |
|
|
|
processId: '', |
|
|
|
woCode: '', |
|
|
|
woCode: '', |
|
|
|
}; |
|
|
|
}; |
|
|
|
this.getData(); |
|
|
|
this.getData(); |
|
|
|
@ -649,13 +665,13 @@ export default { |
|
|
|
return (duration / (24 * 60)) * 100; |
|
|
|
return (duration / (24 * 60)) * 100; |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 样式计算 |
|
|
|
// 任务 样式计算 |
|
|
|
getStatusColor(row) { |
|
|
|
getStatusColor(row) { |
|
|
|
switch (row.planStatus) { |
|
|
|
switch (row.planStatus) { |
|
|
|
case '3': |
|
|
|
|
|
|
|
case '5': |
|
|
|
case '5': |
|
|
|
return '#28a745'; |
|
|
|
return '#28a745'; |
|
|
|
case '2': |
|
|
|
case '2': |
|
|
|
|
|
|
|
case '3': |
|
|
|
return '#007bff'; |
|
|
|
return '#007bff'; |
|
|
|
case '1': |
|
|
|
case '1': |
|
|
|
return '#6c757d'; |
|
|
|
return '#6c757d'; |
|
|
|
@ -667,10 +683,10 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
getStatusTagType(row) { |
|
|
|
getStatusTagType(row) { |
|
|
|
switch (row.planStatus) { |
|
|
|
switch (row.planStatus) { |
|
|
|
case '3': |
|
|
|
|
|
|
|
case '5': |
|
|
|
case '5': |
|
|
|
return 'success'; |
|
|
|
return 'success'; |
|
|
|
case '2': |
|
|
|
case '2': |
|
|
|
|
|
|
|
case '3': |
|
|
|
return 'primary'; |
|
|
|
return 'primary'; |
|
|
|
case '1': |
|
|
|
case '1': |
|
|
|
return 'info'; |
|
|
|
return 'info'; |
|
|
|
@ -722,37 +738,44 @@ export default { |
|
|
|
|
|
|
|
|
|
|
|
// 左侧行高计算 |
|
|
|
// 左侧行高计算 |
|
|
|
getRowHeight(device) { |
|
|
|
getRowHeight(device) { |
|
|
|
const layers = this.getLayeredTasks(device); |
|
|
|
return this.baseRowHeight; |
|
|
|
const layerCount = layers.length; |
|
|
|
|
|
|
|
const height = Math.max(this.baseRowHeight, layerCount * this.baseRowHeight); |
|
|
|
|
|
|
|
this.rowHeights[device] = height; |
|
|
|
|
|
|
|
return height; |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
// 右侧行高计算 |
|
|
|
// 右侧行高计算 |
|
|
|
getRowChartHeight(device) { |
|
|
|
getRowChartHeight(device) { |
|
|
|
const layers = this.getLayeredTasks(device); |
|
|
|
// 固定行高,不随层数变化 |
|
|
|
const layerCount = layers.length; |
|
|
|
return this.baseRowChartHeight; |
|
|
|
const height = Math.max(this.baseRowChartHeight, layerCount * this.baseRowChartHeight); |
|
|
|
|
|
|
|
this.rowHeights[device] = height; |
|
|
|
|
|
|
|
return height; |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
getLayerOffset(layerIndex, totalLayers, device) { |
|
|
|
getLayerOffset(layerIndex, totalLayers, device) { |
|
|
|
const rowHeight = this.getRowChartHeight(device); |
|
|
|
const rowHeight = this.getRowChartHeight(device); |
|
|
|
if (totalLayers <= 1) return 2; |
|
|
|
if (totalLayers <= 1) return 2; |
|
|
|
|
|
|
|
|
|
|
|
const totalSpacing = totalLayers * 4; |
|
|
|
// 计算总间隔和可用高度 |
|
|
|
const availableHeight = rowHeight - totalSpacing; |
|
|
|
const totalSpacing = (totalLayers - 1) * 4; // 层间间隔 |
|
|
|
|
|
|
|
const availableHeight = rowHeight - 40 - totalSpacing; // 减去上下边距 |
|
|
|
const layerHeight = availableHeight / totalLayers; |
|
|
|
const layerHeight = availableHeight / totalLayers; |
|
|
|
return layerIndex * (layerHeight + 18) + 4; |
|
|
|
|
|
|
|
|
|
|
|
// 计算当前层的偏移量 |
|
|
|
|
|
|
|
return 20 + layerIndex * (layerHeight + 4); // 20是顶部边距 |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
getTastTopOffset(layerIndex, totalLayers, device) { |
|
|
|
|
|
|
|
const rowHeight = this.getRowChartHeight(device); |
|
|
|
|
|
|
|
if (totalLayers <= 1) return 8; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 计算总间隔和可用高度 |
|
|
|
|
|
|
|
const totalSpacing = (totalLayers - 1) * 4; // 层间间隔 |
|
|
|
|
|
|
|
const availableHeight = rowHeight - 40 - totalSpacing; // 减去上下边距 |
|
|
|
|
|
|
|
const layerHeight = availableHeight / totalLayers; |
|
|
|
|
|
|
|
// 计算当前层的偏移量 |
|
|
|
|
|
|
|
return 0; // 20是顶部边距 |
|
|
|
}, |
|
|
|
}, |
|
|
|
getLayerTaskHeight(totalLayers, device) { |
|
|
|
getLayerTaskHeight(totalLayers, device) { |
|
|
|
const rowHeight = this.getRowChartHeight(device); |
|
|
|
const rowHeight = this.getRowChartHeight(device); |
|
|
|
if (totalLayers <= 1) { |
|
|
|
if (totalLayers <= 1) { |
|
|
|
return rowHeight - 40; |
|
|
|
return rowHeight - 40; // 减去上下边距 |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
const totalSpacing = totalLayers * 18; |
|
|
|
const totalSpacing = (totalLayers - 1) * 4; |
|
|
|
const availableHeight = rowHeight - 40 - totalSpacing; |
|
|
|
const availableHeight = rowHeight - 30 - totalSpacing; |
|
|
|
return availableHeight / totalLayers; |
|
|
|
return availableHeight / totalLayers; // 平均分配高度 |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
@ -1124,6 +1147,14 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.task-label { |
|
|
|
.task-label { |
|
|
|
|
|
|
|
position: relative; |
|
|
|
|
|
|
|
width: 100%; |
|
|
|
|
|
|
|
height: 100%; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
.task-label-txt { |
|
|
|
|
|
|
|
position: absolute; |
|
|
|
|
|
|
|
/* top: 8px; */ |
|
|
|
|
|
|
|
left: -5px; |
|
|
|
font-size: 10px; |
|
|
|
font-size: 10px; |
|
|
|
color: white; |
|
|
|
color: white; |
|
|
|
white-space: nowrap; |
|
|
|
white-space: nowrap; |
|
|
|
|