Commit 51037f14 authored by arvin's avatar arvin

update

parent 16bbc99e
......@@ -37,7 +37,6 @@ export default {
.forEach(l => {
if (l.isCritical) {
l.isCritical = false
this.gantt.updateLink(l.id)
this.modifyLink(l, 'MODIFY')
}
})
......@@ -46,7 +45,6 @@ export default {
.forEach(l => {
if (!l.isCritical) {
l.isCritical = true
this.gantt.updateLink(l.id)
this.modifyLink(l, 'MODIFY')
}
})
......
......@@ -8,6 +8,7 @@
import config from './config'
import data from './data'
import CsvExportor from 'csv-exportor'
import moment from 'moment'
export default {
name: 'TfMomWebStep',
mixins: [config, data],
......@@ -259,25 +260,27 @@ export default {
links: []
}
val.forEach((item, index) => {
const link = item.extProcessExecutorRoutes && item.extProcessExecutorRoutes[0]
const links = item.extProcessExecutorRoutes
params.data.push({
index: index + 1,
text: item.serialNumber,
id: item.id,
parenId: link && link.prevNodeId || '',
parenId: '',
start_date: '2007-1-1',
type: 'task',
duration: item.workHour ? Number(item.workHour / 8) : 0
})
if (link) {
params.links.push({
cid: link.id,
tid: link.currNodeId,
source: link.prevNodeId,
target: link.currNodeId,
type: '0',
isCritical: link.isCritical
if (links) {
links.forEach(link => {
params.links.push({
cid: link.id,
tid: link.currNodeId,
source: link.prevNodeId,
target: link.currNodeId,
type: '0',
isCritical: link.isCritical
})
})
}
})
......@@ -325,6 +328,30 @@ export default {
const header = ['节点', '站位号', '工期(天)', '前置']
CsvExportor.downloadCsv(tableData, { header }, '站位路线.csv')
},
calcCosthours(links, tasks) {
links.forEach(link => {
const cosLinks = links.filter(l => Number(l.target) === Number(link.target))
if (cosLinks.length === 1) {
return true
}
const peerTask = cosLinks.map(l => {
const task = tasks.find(t => t.id === Number(l.source))
return {
linkId: l.id,
end_date: task && task.end_date
}
}).sort((a, b) => a.end_date - b.end_date)
const lastDay = moment(peerTask[0].end_date)
peerTask.forEach(l => {
let costHours = lastDay.diff(moment(l.end_date), 'day')
costHours = Number(costHours) * 8
const link = links.find(r => r.id === l.linkId)
if (link) {
link.costHours = costHours
}
})
})
},
save() {
if (this.loading) {
return
......@@ -335,6 +362,7 @@ export default {
links.forEach(l => {
l.isCritical = this.gantt.isCriticalLink(l)
})
this.calcCosthours(links, tasks)
const params = this.ganttData.map(item => {
const routes = item.extProcessExecutorRoutes ? item.extProcessExecutorRoutes.map(r => {
return {
......@@ -343,8 +371,8 @@ export default {
}
}) : []
const task = tasks.find(r => r.id === item.id)
const link = links.find(r => Number(r.target) === item.id)
if (link) {
const _links = links.filter(r => Number(r.target) === item.id)
_links.forEach(link => {
routes.push({
operator: 'ADD',
subTypeName: 'ExtProcessExecutorRoute',
......@@ -352,9 +380,10 @@ export default {
currNodeIdType: 'ExtPosition',
currNodeId: Number(link.target),
prevNodeId: Number(link.source),
costHours: link.costHours,
isCritical: link.isCritical
})
}
})
return {
id: item.id,
......
......@@ -102,8 +102,12 @@ export default {
return (Number(workHour || 0) * 3 * 60) || 0.01
},
addLink(item) {
const link = item.extProcessExecutorRoutes && item.extProcessExecutorRoutes[0]
link && this.params.links.push(this.toLink(link))
const links = item.extProcessExecutorRoutes
if (links) {
links.forEach(link => {
this.params.links.push(this.toLink(link))
})
}
},
toLink(l) {
return {
......
......@@ -93,8 +93,12 @@ export default {
return (Number(workHour || 0) * 3 * 60) || 0.01
},
addLink(item) {
const link = item.extProcessExecutorRoutes && item.extProcessExecutorRoutes[0]
link && this.params.links.push(this.toLink(link))
const links = item.extProcessExecutorRoutes
if (links) {
links.forEach(link => {
this.params.links.push(this.toLink(link))
})
}
},
toLink(l) {
return {
......
......@@ -43,9 +43,8 @@ export default {
.assembly-plan-maintenance-page{
margin: 4px;
margin-top: 0px;
padding: 8px;
height: calc(100% - 20px);
width: calc(100% - 24px);
height: calc(100% - 4px);
width: calc(100% - 8px);
background-color: #fff;
}
</style>
<template>
<div>
search
<div class="assembly-plan-maintenance-search-model">
<div class="search-box box">
<div class="title">
<i class="search-icon" /><span>搜索</span>
</div>
<div class="row">
<label>机型:</label>
<el-select size="mini" />
</div>
<div class="row">
<label>场次:</label>
<el-select size="mini" />
</div>
<div class="row">
<label>状态:</label>
<el-select size="mini" />
</div>
<div class="row">
<el-button size="mini" type="primary">查询</el-button>
</div>
</div>
<div class="sorties-box box">
sorties
</div>
<div class="station-box box">
station
</div>
</div>
</template>
......@@ -24,6 +49,47 @@ export default {
}
</script>
<style lang="scss" scoped>
<style lang="scss">
.assembly-plan-maintenance-search-model{
height: 100%;
padding: 4px;
box-sizing: border-box;
display: flex;
flex-flow: column;
justify-content: space-around;
.search-box{
.title{
margin-left: 10px;
text-align: left;
margin-top: 10px;
}
.search-icon{
display: inline-block;
width: 21px;
height: 21px;
background: url(/icons/r-access.png) no-repeat;
background-size: contain;
vertical-align: middle;
}
label{
margin-right: 6px;
display: inline-block;
}
.el-select{
width: calc(100% - 60px);
}
.row{
line-height: 40px;
height: 40px;
text-align: center;
}
font-size:14px;
}
.box {
margin: 4px;
border: 1px solid #d8d8d8;
border-radius:8px ;
padding: 4px;;
}
}
</style>
......@@ -114,20 +114,19 @@ export default {
'<br><b>问题状态:</b> ' + task.problemStatus
return html
} else {
const row = that.tooltipData[task.tooltipId]
html =
'<b>操作者:</b> ' +
(row && row.creator && row.creator.userName
? row.creator.userName
: '') +
'<br><b>检验员:</b> ' +
(row && row.testor && row.testor.userName
? row.testor.userName
: '') +
'<br><b>实际开始:</b> ' +
(row && row.actualStart ? row.actualStart : '') +
'<br><b>实际完成:</b> ' +
(row && row.actualEnd ? row.actualEnd : '') +
// '<b>操作者:</b> ' +
// (row && row.creator && row.creator.userName
// ? row.creator.userName
// : '') +
// '<br><b>检验员:</b> ' +
// (row && row.testor && row.testor.userName
// ? row.testor.userName
// : '') +
// '<br><b>实际开始:</b> ' +
// (row && row.actualStart ? row.actualStart : '') +
// '<br><b>实际完成:</b> ' +
// (row && row.actualEnd ? row.actualEnd : '') +
'<br><b>站位/装配单元:</b> ' +
task.text +
'<br><b>工期:</b> ' +
......@@ -259,7 +258,7 @@ export default {
'</div>'
)
} else {
const state = that.planStateOptions.find(r => r.value === task.status)
const state = that.stateOptions.find(r => r.value === task.status)
return (
"<div class='ao color " +
task.status +
......@@ -400,9 +399,11 @@ export default {
}
data.forEach(p => {
this.addwrProduction(p, params)
this.addLink(p, params)
if (p.aoPlans) {
p.aoPlans.forEach(t => {
this.addAO(p, t, params)
this.addLink(t, params)
})
}
})
......@@ -462,6 +463,24 @@ export default {
60
}
},
addLink(item, params) {
const links = item.extProcessExecutorRoutes
if (links) {
links.forEach(link => {
params.links.push(this.toLink(link))
})
}
},
toLink(l) {
return {
cid: l.id,
tid: l.currNodeId,
source: l.prevNodeId,
target: l.currNodeId,
type: '0',
isCritical: l.isCritical
}
},
addAO(m, p, params) {
if (p.joExecutePlan && p.joExecutePlan[0]) {
params.data.push(this.toAO(m, p))
......
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