Commit 018b021c authored by arvin's avatar arvin

站点路线

parent fbba8819
...@@ -52,7 +52,7 @@ export default { ...@@ -52,7 +52,7 @@ export default {
val.items.push({ fieldName: 'status', operator: 'EQ', value: 'disposed' }) val.items.push({ fieldName: 'status', operator: 'EQ', value: 'disposed' })
val.items.push({ fieldName: 'usableAmount', operator: 'GT', value: 0 }) val.items.push({ fieldName: 'usableAmount', operator: 'GT', value: 0 })
val.items.push({ fieldName: 'disposeDes', operator: 'LIKE', value: '三期' }) val.items.push({ fieldName: 'disposeDes', operator: 'LIKE', value: '三期' })
const extWorkCenterName = this.basicData.extWorkCenteName || (this.basicData.extWorkCeter && this.basicData.extWorkCeter.extname) const extWorkCenterName = this.basicData.extWorkCenteName || (this.basicData.extWorkCenter && this.basicData.extWorkCenter.extname)
if (extWorkCenterName) { if (extWorkCenterName) {
val.items.push({ fieldName: 'workcenter', operator: 'EQ', value: extWorkCenterName }) val.items.push({ fieldName: 'workcenter', operator: 'EQ', value: extWorkCenterName })
} }
......
export default { export default {
data() {
return {
loading: false
}
},
watch: { watch: {
showFlag(val) { showFlag(val) {
if (!val) { if (!val) {
...@@ -33,7 +38,9 @@ export default { ...@@ -33,7 +38,9 @@ export default {
}, },
methods: { methods: {
search() {
} }
}
} }
...@@ -101,7 +101,7 @@ export default { ...@@ -101,7 +101,7 @@ export default {
this.currentId = this.node.id this.currentId = this.node.id
const params = { const params = {
'searchItems': { 'items': [{ 'fieldName': 'aircraftSortiesId', 'operator': 'EQ', 'value': this.node.id }] }, 'searchItems': { 'items': [{ 'fieldName': 'aircraftSortiesId', 'operator': 'EQ', 'value': this.node.id }] },
'sortItem': [{ 'fieldName': 'modifyTime', 'sortOrder': 'asc' }], 'sortItem': [{ 'fieldName': 'serialNumber', 'sortOrder': 'asc' }],
'openProps': [ 'openProps': [
{ {
'name': 'extProcessExecutorRoutes' 'name': 'extProcessExecutorRoutes'
...@@ -185,6 +185,7 @@ export default { ...@@ -185,6 +185,7 @@ export default {
ganttAg.config.scale_height = 70 ganttAg.config.scale_height = 70
ganttAg.config.show_task_cells = true ganttAg.config.show_task_cells = true
ganttAg.config.autofit = false ganttAg.config.autofit = false
ganttAg.config.fit_tasks = false
ganttAg.config.drag_move = false ganttAg.config.drag_move = false
ganttAg.config.details_on_dblclick = false ganttAg.config.details_on_dblclick = false
ganttAg.config.auto_scheduling = true ganttAg.config.auto_scheduling = true
...@@ -290,6 +291,9 @@ export default { ...@@ -290,6 +291,9 @@ export default {
} }
ganttAg.clearAll() ganttAg.clearAll()
ganttAg.parse(data) ganttAg.parse(data)
setTimeout(() => {
ganttAg.autoSchedule()
}, 1000)
} }
}) })
// 在将新链接添加到甘特图之前触发 // 在将新链接添加到甘特图之前触发
...@@ -300,15 +304,7 @@ export default { ...@@ -300,15 +304,7 @@ export default {
return true return true
}) })
ganttAg.attachEvent('onAfterBatchUpdate', function(action) { ganttAg.attachEvent('onAfterBatchUpdate', function(action) {
console.log('onAfterBatchUpdate') ganttAg.autoSchedule()
// your code here
})
ganttAg.attachEvent('onAutoScheduleCircularLink', function(groups) {
console.log(groups, 'onAutoScheduleCircularLink')
// any custom logic here
})
ganttAg.attachEvent('onAfterTaskAutoSchedule', function(task, start, link, predecessor) {
console.log(task, start, link, predecessor, 'onAfterTaskAutoSchedule')
}) })
this.$nextTick(() => { this.$nextTick(() => {
ganttAg.init(this.ganttElId) ganttAg.init(this.ganttElId)
...@@ -343,18 +339,21 @@ export default { ...@@ -343,18 +339,21 @@ export default {
} }
}, },
save() { save() {
if (this.loading) {
return
}
this.loading = true
const tasks = this.gantt.getTableData().data.data const tasks = this.gantt.getTableData().data.data
const links = this.gantt.getTableData().data.links const links = this.gantt.getTableData().data.links
const params = this.ganttData.map(item => { const params = this.ganttData.map(item => {
const routes = item.extProcessExecutorRoutes.map(r => { const routes = item.extProcessExecutorRoutes ? item.extProcessExecutorRoutes.map(r => {
return { return {
id: r.id, id: r.id,
operator: 'REMOVE' operator: 'REMOVE'
} }
}) }) : []
const task = tasks.find(r => r.id === item.id) const task = tasks.find(r => r.id === item.id)
if (item.extProcessExecutorRoutes) { const link = links.find(r => Number(r.target) === item.id)
const link = links.find(r => r.target === item.id)
if (link) { if (link) {
routes.push({ routes.push({
operator: 'ADD', operator: 'ADD',
...@@ -366,7 +365,7 @@ export default { ...@@ -366,7 +365,7 @@ export default {
isCritical: link.isCritical isCritical: link.isCritical
}) })
} }
}
return { return {
id: item.id, id: item.id,
operator: 'MODIFY', operator: 'MODIFY',
...@@ -376,8 +375,9 @@ export default { ...@@ -376,8 +375,9 @@ export default {
} }
}) })
this.$api.recursion('ExtPosition', params, true).then(() => { this.$api.recursion('ExtPosition', params, true).then(() => {
this.$utils.showMessageSuccess('保存成功!')
this.getData() this.getData()
}) }).finally(() => { this.loading = false })
} }
} }
} }
...@@ -389,5 +389,15 @@ export default { ...@@ -389,5 +389,15 @@ export default {
.gatt{ .gatt{
height: 100%; height: 100%;
} }
.gantt_critical_task{
background: #f39c4f;
border: 1px solid #f39c4f;
}
.gantt_task_line{
&.workday_over{
background: #f39c4f;
border: 1px solid #f39c4f;
}
}
} }
</style> </style>
...@@ -116,7 +116,7 @@ export default { ...@@ -116,7 +116,7 @@ export default {
getPosition() { getPosition() {
const params = { const params = {
'searchItems': { 'items': [{ 'fieldName': 'aircraftSortiesId', 'operator': 'EQ', 'value': this.AircraftSortiesId }] }, 'searchItems': { 'items': [{ 'fieldName': 'aircraftSortiesId', 'operator': 'EQ', 'value': this.AircraftSortiesId }] },
'sortItem': [{ 'fieldName': 'modifyTime', 'sortOrder': 'asc' }] 'sortItem': [{ 'fieldName': 'serialNumber', 'sortOrder': 'asc' }]
} }
this.$api.searchApi('ExtPosition', params).then(res => { this.$api.searchApi('ExtPosition', params).then(res => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment