Browse Source

优化导入任务

master
陈裕财 4 years ago
parent
commit
7c65389b92
  1. 103
      src/views/xm/core/xmTask/XmTaskMng.vue

103
src/views/xm/core/xmTask/XmTaskMng.vue

@ -1394,7 +1394,7 @@ export default {
if(tips.isOk){ if(tips.isOk){
var row=this.editForm var row=this.editForm
this.getXmTasks() this.getXmTasks()
treeTool.reloadChildren(this.$refs.table,this.maps,row.parentTaskid,'parentTaskid',this.loadXmTaskLazy)
//treeTool.reloadChildren(this.$refs.table,this.maps,row.parentTaskid,'parentTaskid',this.loadXmTaskLazy)
} }
this.$notify({ this.$notify({
showClose: true, showClose: true,
@ -1460,16 +1460,7 @@ export default {
return true; return true;
},
showSubAdd(row,index,ntype) {
if(!this.checkCanAdd(row)){
return;
}
this.parentTask = row;
this.editForm = row;
this.addForm.ntype=ntype;
this.addFormVisible = true;
},
},
// XmTask xm_task // XmTask xm_task
showAdd: function (ntype) { showAdd: function (ntype) {
if(!this.checkCanAdd()){ if(!this.checkCanAdd()){
@ -1482,19 +1473,19 @@ export default {
this.addFormVisible = false; this.addFormVisible = false;
this.pageInfo.count = true; this.pageInfo.count = true;
this.getXmTasks() this.getXmTasks()
treeTool.reloadChildren(this.$refs.table,this.maps,row.parentTaskid,'parentTaskid',this.loadXmTaskLazy)
//treeTool.reloadChildren(this.$refs.table,this.maps,row.parentTaskid,'parentTaskid',this.loadXmTaskLazy)
}, },
afterEditSubmit() { afterEditSubmit() {
this.editFormVisible = false; this.editFormVisible = false;
var row=this.editForm var row=this.editForm
this.getXmTasks() this.getXmTasks()
treeTool.reloadChildren(this.$refs.table,this.maps,row.parentTaskid,'parentTaskid',this.loadXmTaskLazy)
//treeTool.reloadChildren(this.$refs.table,this.maps,row.parentTaskid,'parentTaskid',this.loadXmTaskLazy)
}, },
afterExecEditSubmit() { afterExecEditSubmit() {
var row=this.editForm var row=this.editForm
this.getXmTasks() this.getXmTasks()
treeTool.reloadChildren(this.$refs.table,this.maps,row.parentTaskid,'parentTaskid',this.loadXmTaskLazy)
//treeTool.reloadChildren(this.$refs.table,this.maps,row.parentTaskid,'parentTaskid',this.loadXmTaskLazy)
}, },
onEditSomeFields(params){ onEditSomeFields(params){
Object.assign(this.editForm,params ) Object.assign(this.editForm,params )
@ -1517,7 +1508,7 @@ export default {
if (tips.isOk) { if (tips.isOk) {
this.pageInfo.count = true; this.pageInfo.count = true;
this.getXmTasks() this.getXmTasks()
treeTool.reloadChildren(this.$refs.table,this.maps,row.parentTaskid,'parentTaskid',this.loadXmTaskLazy)
//treeTool.reloadChildren(this.$refs.table,this.maps,row.parentTaskid,'parentTaskid',this.loadXmTaskLazy)
} }
this.$notify({ this.$notify({
showClose: true, showClose: true,
@ -1605,11 +1596,10 @@ export default {
); );
this.searchXmTasks(); this.searchXmTasks();
}, },
showMenu: function (parentTask) {
if(!this.checkCanAdd(parentTask)){
showMenu: function () {
if(!this.checkCanAdd(this.parentTask)){
return; return;
}
this.parentTask = parentTask;
}
this.menuVisible = true; this.menuVisible = true;
}, },
onSelectedMenus(menus) { onSelectedMenus(menus) {
@ -1650,10 +1640,9 @@ export default {
this.menuStory = false; this.menuStory = false;
}, },
onTaskTemplatesSelected(taskTemplates) { onTaskTemplatesSelected(taskTemplates) {
debugger;
if (taskTemplates == null || taskTemplates.length == 0) { if (taskTemplates == null || taskTemplates.length == 0) {
this.taskTemplateVisible = false; this.taskTemplateVisible = false;
this.parentTask = null;
return; return;
} }
var taskTemplates2 = JSON.parse(JSON.stringify(taskTemplates)); var taskTemplates2 = JSON.parse(JSON.stringify(taskTemplates));
@ -1667,40 +1656,20 @@ export default {
} }
}) })
this.load.add = true; this.load.add = true;
var projectId=null;
var productId=null;
if(this.ptype==='0'){
if(this.parentTask && this.parentTask.id){
projectId=this.parentTask.projectId
}else{
projectId=this.filters.selProject.id
}
var projectId=null;
if(this.parentTask && this.parentTask.id){
projectId=this.parentTask.projectId
}else{ }else{
if(this.parentTask && this.parentTask.id){
productId=this.parentTask.productId
}else{
productId=this.filters.product.id
}
}
taskTemplates2.forEach((i) => {
if(this.ptype==='1'){
i.ptype="1"
i.projectId=null;
i.projectName=null;
if(productId!=i.productId){
i.menuId=null;
i.menuName=null;
}
i.productId=productId
}else if(this.ptype==='0'){
i.ptype="0"
if(i.isTpl=='1'){
i.productId=null;
i.menuId=null;
i.menuName=null;
}
i.projectId=projectId
projectId=this.filters.selProject.id
}
taskTemplates2.forEach((i) => {
i.ptype="0"
if(i.isTpl=='1'){
i.productId=null;
i.menuId=null;
i.menuName=null;
} }
i.projectId=projectId
i.budgetAt = 0; i.budgetAt = 0;
i.budgetWorkload = 80; i.budgetWorkload = 80;
i.level = i.level ? i.level : "3"; i.level = i.level ? i.level : "3";
@ -1728,13 +1697,9 @@ export default {
}); });
var params={ var params={
xmTasks:taskTemplates2, xmTasks:taskTemplates2,
ptype:this.ptype
}
if(this.ptype==='0'){
params.projectId=projectId
}else{
params.productId=productId
}
ptype:"0"
}
params.projectId=projectId
if(this.parentTask && this.parentTask.id){ if(this.parentTask && this.parentTask.id){
params.parentTaskid=this.parentTask.id params.parentTaskid=this.parentTask.id
} }
@ -1743,11 +1708,7 @@ export default {
.then((res) => { .then((res) => {
var tips = res.data.tips; var tips = res.data.tips;
if (tips.isOk) { if (tips.isOk) {
this.getXmTasks();
if(this.parentTask && this.parentTask.id){
treeTool.reloadChildren(this.$refs.table,this.maps,this.parentTask.id,'parentTaskid',this.loadXmTaskLazy)
}
this.getXmTasks();
} }
this.taskTemplateVisible = false; this.taskTemplateVisible = false;
this.$notify({ this.$notify({
@ -1950,14 +1911,10 @@ export default {
this.xmTasks=[] this.xmTasks=[]
this.searchXmTasks(); this.searchXmTasks();
}, },
handleCommand(command) {
if (command.type == "showSubAdd") {
this.showSubAdd(command.data);
} else if (command.type == "showTaskTemplate") {
this.parentTask = command.data;
handleCommand(command) {
if (command.type == "showTaskTemplate") {
this.showTaskTemplate(command.data); this.showTaskTemplate(command.data);
} else if (command.type == "showMenu") {
this.parentTask = command.data;
} else if (command.type == "showMenu") {
this.showMenu(command.data); this.showMenu(command.data);
} else if (command.type == "showDrawer") { } else if (command.type == "showDrawer") {
this.showDrawer(command.data); this.showDrawer(command.data);
@ -1985,7 +1942,7 @@ export default {
var row=this.editForm var row=this.editForm
this.getXmTasks() this.getXmTasks()
treeTool.reloadChildren(this.$refs.table,this.maps,row.parentTaskid,'parentTaskid',this.loadXmTaskLazy)
//treeTool.reloadChildren(this.$refs.table,this.maps,row.parentTaskid,'parentTaskid',this.loadXmTaskLazy)
}, },
toJoin() { toJoin() {
if ( if (

Loading…
Cancel
Save