Browse Source

Merge pull request '甘特图展示调整' (#121) from liwei into develop

Reviewed-on: http://101.201.121.115:3000/leo/LAPP_GAAS_GFrame_WEBFRONT/pulls/121
Reviewed-by: wangxy <xinyao.wang@le-it.com.cn>
pull/122/head
wangxy 3 years ago
parent
commit
a0ece277e2
1 changed files with 13 additions and 15 deletions
  1. +13
    -15
      src/views/productplan/workbench/schedule.vue

+ 13
- 15
src/views/productplan/workbench/schedule.vue View File

@ -483,8 +483,8 @@
},
}
gantt.config.work_time = true
gantt.config.task_height = 30
gantt.config.row_height = 50
gantt.config.task_height = 60
gantt.config.row_height = 100
gantt.config.scale_height = 60
gantt.config.min_column_width = 40
gantt.config.show_progress = false //
@ -529,7 +529,7 @@
div.addEventListener('mousedown', function () {
div.classList.add('move-task-wrap');
div.innerHTML =
`<div class="move-task">${task.text}&nbsp;/&nbsp;${task.TaskId}&nbsp;/&nbsp;${task.PlanQty}</div>`
`<div class="move-task">${task.text}&nbsp;/&nbsp;${task.TaskId}&nbsp;/&nbsp;${task.PlanQty-task.ActQty3}</div>`
document.onmousemove = function (event) {
// , left
div.style.left = event.clientX + 'px';
@ -545,9 +545,9 @@
const domHelpers = gantt.utils.dom;
const position = domHelpers.getRelativeEventPosition(event, gantt.$task_bg) // div x,y
const scrollLeft = document.getElementsByClassName('gantt_task')[0].scrollLeft
// 50 row_height
// 100 row_height
//
if (position.x >= scrollLeft && position.y > 0 && position.y < 50) {
if (position.x >= scrollLeft && position.y > 0 && position.y < 100) {
// X
const dataTime = gantt.dateFromPos(position.x);
//
@ -583,13 +583,11 @@
}).catch(() => {
_this.fullscreenLoading = false;
})
} else {
//
div.classList.remove('move-task-wrap')
div.innerHTML =
`<div class="work-datails-wrap"><p>名称:${task.text}</p><p>零件号:${task.TaskId}</p><p>零件号:${task.ArtId}</p><p>数量:${task.PlanQty}</p></div>`
`<div class="work-datails-wrap"><p>名称:${task.text}</p><p>零件号:${task.TaskId}</p><p>零件号:${task.ArtId}</p><p>数量:${task.PlanQty-task.ActQty3}</p></div>`
}
});
@ -600,7 +598,7 @@
if (task) {
div.style.background = _this.orderColors[task.Status];
div.innerHTML =
`<div class="work-datails-wrap"><p>名称:${task.text}</p><p>编号:${task.TaskId}</p><p>零件号:${task.ArtId}</p><p>数量:${task.PlanQty}</p></div>`
`<div class="work-datails-wrap"><p>名称:${task.text}</p><p>编号:${task.TaskId}</p><p>零件号:${task.ArtId}</p><p>数量:${task.PlanQty-task.ActQty3}</p></div>`
div.style.display = 'inline-block';
}
return this
@ -625,7 +623,7 @@
console.log(findItem);
if (findItem) {
taskDom.innerHTML =
`<div class="work-datails-wrap"><p class='task-details-title'>名称:${findItem.Wotab['OM_WorkOrder-OrderInfo']}</p><p>零件号:${findItem.ArtId}</p><p>数量:${findItem.PlanQty}</p><p>开始时间:${moment(findItem.SchedStartTime).format('YYYY-MM-DD HH:mm:ss')}</p><p>结束时间:${moment(findItem.SchedEndTime).format('YYYY-MM-DD HH:mm:ss')}</p></div>`
`<div class="work-datails-wrap"><p class='task-details-title'>名称:${findItem.Wotab['OM_WorkOrder-OrderInfo']}</p><p>零件号:${findItem.ArtId}</p><p>数量:${findItem.PlanQty-findItem.ActQty3}</p><p>开始时间:${moment(findItem.SchedStartTime).format('YYYY-MM-DD HH:mm:ss')}</p><p>结束时间:${moment(findItem.SchedEndTime).format('YYYY-MM-DD HH:mm:ss')}</p></div>`
} else {
taskDom.innerHTML = "";
}
@ -687,9 +685,9 @@
// DOM
const position = domHelpers.getRelativeEventPosition(event, gantt.$task_bg)
// , left
// 15 task_height
// 30 task_height
item.style.left = position.x + 'px';
item.style.top = position.y - 15 + 'px';
item.style.top = position.y - 30 + 'px';
}
} else if(e.which === 3){
// setTimeout(()=>{
@ -729,8 +727,8 @@
// const index = Math.floor(pos.y / gantt.config.row_height)
// const resource = gantt.getTaskByIndex(index)
// task.resourceID = resource.id
// 50 row_height
if (position.y <= 50) {
// 100 row_height
if (position.y <= 100) {
//
_this.allData.Operation = "MOVE";
@ -785,7 +783,7 @@
start_date: new Date(e.SchedStartTime),
end_date: new Date(e.SchedEndTime),
duration: 1,
text: `${e.ArtId}&nbsp;/&nbsp;${e.PlanQty}`,
text: `${e.ArtId}&nbsp;/&nbsp;${e.PlanQty-e.ActQty3}`,
sortorder: index,
parent: 0,
open: true,


Loading…
Cancel
Save