|
|
@ -1,86 +1,49 @@ |
|
|
<template> |
|
|
<template> |
|
|
<section class="page-container page-full-height padding border"> |
|
|
|
|
|
|
|
|
<section class="page-container padding border"> |
|
|
<el-row> |
|
|
<el-row> |
|
|
<el-input v-model="filters.key" style="width: 20%;" placeholder="模糊查询"></el-input> |
|
|
|
|
|
<el-button type="primary" v-loading="load.list" :disabled="load.list==true" v-on:click="searchXmTaskTemplates">查询</el-button> |
|
|
|
|
|
<el-button v-if="!selProjectTemplate" type="info" @click="showProjectTemplate">选择模板</el-button> |
|
|
|
|
|
|
|
|
|
|
|
<el-button v-if="!isSelect" type="primary" @click="showAdd">+任务</el-button> |
|
|
|
|
|
<el-button v-if="isSelect" type="primary" @click="selectedConfirm">确认选择</el-button> |
|
|
|
|
|
|
|
|
|
|
|
<el-button v-if="!isSelect" type="danger" v-loading="load.del" @click="batchDel" :disabled="this.sels.length===0 || load.del==true">批量删除</el-button> |
|
|
|
|
|
</el-row> |
|
|
|
|
|
<el-row class="page-main page-height-90"> |
|
|
|
|
|
|
|
|
|
|
|
<el-col :span="4" > |
|
|
|
|
|
<xm-project-phase-template-mng :sel-project-template="selProjectTemplate" :simple="true" @row-click="projectPhaseTemplateRowClick" @selected-project-template="onSelectedProjectTemplate" ref="projectPhaseTemplate"></xm-project-phase-template-mng> |
|
|
|
|
|
|
|
|
<el-col :span="filters.projectTemplate&&filters.projectTemplate.id?6:0" > |
|
|
|
|
|
<xm-project-phase-template-mng :sel-project-template="filters.projectTemplate" :simple="true" @row-click="projectPhaseTemplateRowClick" @selected-project-template="onSelectedProjectTemplate" ref="projectPhaseTemplate"></xm-project-phase-template-mng> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="20"> |
|
|
|
|
|
<!--列表 XmTaskTemplate xm_task_template select-confirm--> |
|
|
|
|
|
<el-table :data="xmTaskTemplatesTreeData" row-key="id" :tree-props="{children: 'children', hasChildren: 'hasChildren'}" @sort-change="sortChange" highlight-current-row v-loading="load.list" border @selection-change="selsChange" @row-click="rowClick" style="width: 100%;"> |
|
|
|
|
|
<el-table-column sortable type="selection" width="40"></el-table-column> |
|
|
|
|
|
<el-table-column prop="name" label="任务名称" min-width="80" > |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
{{scope.row.sortLevel}} {{scope.row.name}} |
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column prop="milestone" label="里程碑" min-width="80" > |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
{{scope.row.milestone=='1'?'是':'否'}} |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column prop="budgetCost" label="预算金额" min-width="80" ></el-table-column> |
|
|
|
|
|
<el-table-column prop="budgetWorkload" label="预算工时" min-width="80" ></el-table-column> |
|
|
|
|
|
<el-table-column prop="taskClass" label="结算" min-width="80" > |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
{{scope.row.taskClass=='1'?'是':'否'}} |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column prop="toTaskCenter" label="任务大厅" min-width="80" > |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
{{scope.row.toTaskCenter=='1'?'是':'否'}} |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column prop="taskOut" label="外购" min-width="80" > |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
{{scope.row.taskOut=='1'?'是':'否'}} |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column prop="taskSkillNames" label="技能列表" min-width="80" ></el-table-column> |
|
|
|
|
|
<el-table-column prop="description" label="任务描述" min-width="80" ></el-table-column> |
|
|
|
|
|
<el-table-column label="操作" width="260" fixed="right" v-if="!isSelect" > |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
<el-button @click="showEdit( scope.row,scope.$index)">改</el-button> |
|
|
|
|
|
<el-button @click="showSubAdd( scope.row,scope.$index)">+子任务</el-button> |
|
|
|
|
|
<el-button type="danger" @click="handleDel(scope.row,scope.$index)">删</el-button> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
</el-table> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-col :span="filters.projectTemplate&&filters.projectTemplate.id?18:24"> |
|
|
|
|
|
<el-row> |
|
|
|
|
|
<el-input v-model="filters.key" style="width: 20%;" placeholder="模糊查询"></el-input> |
|
|
|
|
|
<el-button type="primary" v-loading="load.list" :disabled="load.list==true" v-on:click="searchXmTaskTemplates">查询</el-button> |
|
|
|
|
|
<el-button v-if="!selProjectTemplate" @click="showProjectTemplate">选择模板</el-button> |
|
|
|
|
|
<el-button v-if="isSelect" type="primary" @click="selectedConfirm">确认选择</el-button> |
|
|
|
|
|
</el-row> |
|
|
|
|
|
<el-row class="page-main page-height-80"> |
|
|
|
|
|
<!--列表 XmTaskTemplate xm_task_template select-confirm--> |
|
|
|
|
|
<el-table :data="xmTaskTemplatesTreeData" row-key="id" :tree-props="{children: 'children', hasChildren: 'hasChildren'}" @sort-change="sortChange" highlight-current-row v-loading="load.list" border @selection-change="selsChange" @row-click="rowClick" style="width: 100%;"> |
|
|
|
|
|
<el-table-column sortable type="selection" width="40"></el-table-column> |
|
|
|
|
|
<el-table-column prop="name" label="任务名称" min-width="150" > |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
{{scope.row.sortLevel}} {{scope.row.name}} |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column prop="budgetCost" label="预算金额" min-width="80" ></el-table-column> |
|
|
|
|
|
<el-table-column prop="budgetWorkload" label="预算工时" min-width="80" ></el-table-column> |
|
|
|
|
|
<el-table-column prop="taskOut" label="外购" min-width="80" > |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
{{scope.row.taskOut=='1'?'是':'否'}} |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column prop="taskSkillNames" label="技能列表" min-width="80" show-overflow-tooltip></el-table-column> |
|
|
|
|
|
<el-table-column prop="description" label="任务描述" min-width="80" show-overflow-tooltip></el-table-column> |
|
|
|
|
|
</el-table> |
|
|
|
|
|
</el-row> |
|
|
<el-pagination layout="total, sizes, prev, pager, next" @current-change="handleCurrentChange" @size-change="handleSizeChange" :page-sizes="[10,20, 50, 100, 500]" :current-page="pageInfo.pageNum" :page-size="pageInfo.pageSize" :total="pageInfo.total" style="float:right;"></el-pagination> |
|
|
<el-pagination layout="total, sizes, prev, pager, next" @current-change="handleCurrentChange" @size-change="handleSizeChange" :page-sizes="[10,20, 50, 100, 500]" :current-page="pageInfo.pageNum" :page-size="pageInfo.pageSize" :total="pageInfo.total" style="float:right;"></el-pagination> |
|
|
|
|
|
|
|
|
</el-col> |
|
|
</el-col> |
|
|
<!--编辑 XmTaskTemplate xm_task_template界面--> |
|
|
|
|
|
<el-drawer title="编辑任务" :visible.sync="editFormVisible" size="50%" append-to-body :close-on-click-modal="false"> |
|
|
|
|
|
<xm-task-template-edit :xm-task-template="editForm" :visible="editFormVisible" @cancel="editFormVisible=false" @submit="afterEditSubmit"></xm-task-template-edit> |
|
|
|
|
|
</el-drawer> |
|
|
|
|
|
|
|
|
|
|
|
<!--新增 XmTaskTemplate xm_task_template界面--> |
|
|
|
|
|
<el-drawer title="新增任务" :visible.sync="addFormVisible" size="50%" append-to-body :close-on-click-modal="false"> |
|
|
|
|
|
<xm-task-template-add :parent-task-template="parentTaskTemplate" :xm-project-phase-template="projectPhaseTemplate" :xm-task-template="addForm" :visible="addFormVisible" @cancel="addFormVisible=false" @submit="afterAddSubmit"></xm-task-template-add> |
|
|
|
|
|
</el-drawer> |
|
|
|
|
|
</el-row> |
|
|
</el-row> |
|
|
|
|
|
|
|
|
</section> |
|
|
</section> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
import util from '@/common/js/util';//全局公共库 |
|
|
import util from '@/common/js/util';//全局公共库 |
|
|
|
|
|
import treeTool from '@/common/js/treeTool';//全局公共库 |
|
|
//import Sticky from '@/components/Sticky' // 粘性header组件 |
|
|
//import Sticky from '@/components/Sticky' // 粘性header组件 |
|
|
//import { listOption } from '@/api/mdp/meta/itemOption';//下拉框数据查询 |
|
|
//import { listOption } from '@/api/mdp/meta/itemOption';//下拉框数据查询 |
|
|
import { listXmTaskTemplate, delXmTaskTemplate, batchDelXmTaskTemplate } from '@/api/xm/core/xmTaskTemplate'; |
|
|
|
|
|
import XmTaskTemplateAdd from './XmTaskTemplateAdd';//新增界面 |
|
|
|
|
|
import XmTaskTemplateEdit from './XmTaskTemplateEdit';//修改界面 |
|
|
|
|
|
|
|
|
import { listXmTask } from '@/api/xm/core/xmTask'; |
|
|
import xmProjectPhaseTemplateMng from '../xmProjectPhaseTemplate/XmProjectPhaseTemplateMng'; |
|
|
import xmProjectPhaseTemplateMng from '../xmProjectPhaseTemplate/XmProjectPhaseTemplateMng'; |
|
|
|
|
|
|
|
|
import { mapGetters } from 'vuex' |
|
|
import { mapGetters } from 'vuex' |
|
|
@ -92,7 +55,7 @@ |
|
|
]), |
|
|
]), |
|
|
|
|
|
|
|
|
xmTaskTemplatesTreeData() { |
|
|
xmTaskTemplatesTreeData() { |
|
|
return this.translateDataToTree(this.xmTaskTemplates); |
|
|
|
|
|
|
|
|
return treeTool.translateDataToTree(this.xmTaskTemplates,"parentTaskid","id"); |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
watch:{ |
|
|
watch:{ |
|
|
@ -187,8 +150,19 @@ |
|
|
if(this.filters.projectTemplate){ |
|
|
if(this.filters.projectTemplate){ |
|
|
params.projectId=this.filters.projectTemplate.id |
|
|
params.projectId=this.filters.projectTemplate.id |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(!params.projectId){ |
|
|
|
|
|
this.$message({showClose: true, message: "选择一个模板项目", type: 'error' }); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
if(!params.projectPhaseId){ |
|
|
|
|
|
this.$message({showClose: true, message: "请在左边计划列表中选择一个计划", type: 'error' }); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
params.isTpl="1" |
|
|
this.load.list = true; |
|
|
this.load.list = true; |
|
|
listXmTaskTemplate(params).then((res) => { |
|
|
|
|
|
|
|
|
listXmTask(params).then((res) => { |
|
|
var tips=res.data.tips; |
|
|
var tips=res.data.tips; |
|
|
if(tips.isOk){ |
|
|
if(tips.isOk){ |
|
|
this.pageInfo.total = res.data.total; |
|
|
this.pageInfo.total = res.data.total; |
|
|
@ -245,7 +219,7 @@ |
|
|
}).then(() => { |
|
|
}).then(() => { |
|
|
this.load.del=true; |
|
|
this.load.del=true; |
|
|
let params = { id: row.id }; |
|
|
let params = { id: row.id }; |
|
|
delXmTaskTemplate(params).then((res) => { |
|
|
|
|
|
|
|
|
delXmTask(params).then((res) => { |
|
|
this.load.del=false; |
|
|
this.load.del=false; |
|
|
var tips=res.data.tips; |
|
|
var tips=res.data.tips; |
|
|
if(tips.isOk){ |
|
|
if(tips.isOk){ |
|
|
@ -276,50 +250,7 @@ |
|
|
}, |
|
|
}, |
|
|
rowClick: function(row, event, column){ |
|
|
rowClick: function(row, event, column){ |
|
|
this.$emit('row-click',row, event, column);// @row-click="rowClick" |
|
|
this.$emit('row-click',row, event, column);// @row-click="rowClick" |
|
|
}, |
|
|
|
|
|
/**begin 自定义函数请在下面加**/ |
|
|
|
|
|
|
|
|
|
|
|
translateDataToTree(data2) { |
|
|
|
|
|
var data=JSON.parse(JSON.stringify(data2)); |
|
|
|
|
|
let parents = data.filter(value =>{ |
|
|
|
|
|
//如果我的上级为空,则我是最上级 |
|
|
|
|
|
if(value.parentTaskid == 'undefined' || value.parentTaskid == null || value.parentTaskid == ''){ |
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
|
|
|
|
//如果我的上级不在列表中,我作为最上级 |
|
|
|
|
|
}else if(data.some(i=>value.parentTaskid==i.id)){ |
|
|
|
|
|
return false; |
|
|
|
|
|
}else { |
|
|
|
|
|
return true |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
|
let children = data.filter(value =>{ |
|
|
|
|
|
if(data.some(i=>value.parentTaskid==i.id)){ |
|
|
|
|
|
return true; |
|
|
|
|
|
}else{ |
|
|
|
|
|
return false; |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
let translator = (parents, children) => { |
|
|
|
|
|
parents.forEach((parent) => { |
|
|
|
|
|
children.forEach((current, index) => { |
|
|
|
|
|
if (current.parentTaskid === parent.id) { |
|
|
|
|
|
let temp = JSON.parse(JSON.stringify(children)) |
|
|
|
|
|
temp.splice(index, 1) |
|
|
|
|
|
translator([current], temp) |
|
|
|
|
|
typeof parent.children !== 'undefined' ? parent.children.push(current) : parent.children = [current] |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
) |
|
|
|
|
|
} |
|
|
|
|
|
) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
translator(parents, children) |
|
|
|
|
|
|
|
|
|
|
|
return parents |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
}, |
|
|
selectedConfirm(){ |
|
|
selectedConfirm(){ |
|
|
this.$emit("select-confirm",this.sels) |
|
|
this.$emit("select-confirm",this.sels) |
|
|
}, |
|
|
}, |
|
|
@ -338,9 +269,7 @@ |
|
|
/**end 自定义函数请在上面加**/ |
|
|
/**end 自定义函数请在上面加**/ |
|
|
|
|
|
|
|
|
},//end methods |
|
|
},//end methods |
|
|
components: { |
|
|
|
|
|
'xm-task-template-add':XmTaskTemplateAdd, |
|
|
|
|
|
'xm-task-template-edit':XmTaskTemplateEdit, |
|
|
|
|
|
|
|
|
components: { |
|
|
xmProjectPhaseTemplateMng, |
|
|
xmProjectPhaseTemplateMng, |
|
|
//在下面添加其它组件 |
|
|
//在下面添加其它组件 |
|
|
}, |
|
|
}, |
|
|
|