Browse Source

优化

master
陈裕财 4 years ago
parent
commit
f4810f91bd
  1. 15
      src/views/xm/core/xmProjectPhase/XmProjectPhaseMng.vue
  2. 4
      src/views/xm/core/xmProjectPhase/XmProjectPhaseSelect.vue
  3. 103
      src/views/xm/core/xmTask/XmTaskMng.vue

15
src/views/xm/core/xmProjectPhase/XmProjectPhaseMng.vue

@ -71,7 +71,7 @@
<span v-show="scope.row.isKeyPath=='1'">
<i class="el-icon-s-help"></i>
</span>
<el-link type="primary" @click="showEdit(scope.row)">{{scope.row.seqNo}} &nbsp;&nbsp;
<el-link :icon="scope.row.ntype=='1'?'el-icon-folder-opened':''" type="primary" @click="showEdit(scope.row)">{{scope.row.seqNo}} &nbsp;&nbsp;
</el-link>
{{scope.row.phaseName}}
<font v-for="item in [calcTaskStateByTime(scope.row.beginDate,scope.row.endDate,scope.row.actRate,scope.phaseStatus)]" :key="item.status"><el-tag :type="item.status">{{item.remark}}</el-tag></font>
@ -129,10 +129,11 @@
<el-popover style="padding-left:10px;"
placement="top-start"
width="250"
v-if="scope.row.ntype=='1'"
trigger="click" >
<el-row>
<el-col :span="24" style="padding-top:5px;">
<el-button @click="showSubAdd( scope.row,scope.$index)" icon="el-icon-plus">子计划</el-button>
<el-button @click="showSubAdd( scope.row,scope.$index)" icon="el-icon-plus">直接创建子计划</el-button>
</el-col>
<el-col :span="24" style="padding-top:5px;">
<el-button @click="showPhaseTemplate(scope.row)" icon="el-icon-upload2">从模板批量导入子计划</el-button>
@ -141,14 +142,12 @@
<el-button @click="showMenu(scope.row)" icon="el-icon-upload2">由需求创建子计划</el-button>
</el-col>
</el-row>
<el-button type="text" slot="reference" icon="el-icon-plus">添加</el-button>
<el-button type="text" slot="reference" icon="el-icon-plus">子计划</el-button>
</el-popover>
<el-button type="text" @click="showMenu(scope.row)" icon="el-icon-edit">编辑</el-button>
<el-button type="text" @click="handleDel(scope.row)" icon="el-icon-delete">删除</el-button>
<span v-show="scope.row.milestone=='1'">
<i class="el-icon-star-on"></i>
</span>
<span>
<el-button type="text" :disabled="scope.row.childrenCnt>0" @click="handleDel(scope.row)" icon="el-icon-delete">删除</el-button>
<span v-if="scope.row.ntype!='1'">
<el-dropdown @command="handleCommand" :hide-on-click="false">
<span class="el-dropdown-link">
<i class="el-icon-more"></i>

4
src/views/xm/core/xmProjectPhase/XmProjectPhaseSelect.vue

@ -4,10 +4,10 @@
<el-table lazy :load="loadXmProjectPhaseLazy" :height="tableHeight" ref="selectPhaseTable" :data="projectPhaseTreeData" :show-summary="false" row-key="id" :tree-props="{children: 'children', hasChildren: 'childrenCnt'}" @sort-change="sortChange" highlight-current-row v-loading="load.list" border @selection-change="selsChange" @row-click="rowClick" style="width: 100%;">
<el-table-column prop="phaseName" label="计划名称" min-width="160" show-overflow-tooltip>
<template slot="header" slot-scope="scope">
<div>计划 <el-tag v-if="editForm.id" closable @close="clearSelectPhase()"> {{editForm.phaseName}}</el-tag></div>
<div>计划 <el-tag type="warning" v-if="editForm.id" closable @close="clearSelectPhase()"> {{editForm.phaseName}}</el-tag></div>
</template>
<template slot-scope="scope">
{{scope.row.seqNo}} &nbsp;&nbsp;<el-tooltip v-if="scope.row.milestone=='1'" content="里程碑"><i class="el-icon-star-on"></i></el-tooltip>{{scope.row.phaseName}}
<i v-if="scope.row.ntype=='1'" class="el-icon-folder-opened"></i>{{scope.row.seqNo}} &nbsp;&nbsp;<el-tooltip v-if="scope.row.milestone=='1'" content="里程碑"><i class="el-icon-star-on"></i></el-tooltip>{{scope.row.phaseName}}
</template>
</el-table-column>
</el-table>

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

@ -1013,15 +1013,14 @@ export default {
} else {
var projectPhase = {};
if (
this.editForm &&
this.editForm.id !== null &&
this.editForm.id != null
this.editForm && this.editForm.id
) {
projectPhase.id = this.editForm.projectPhaseId;
projectPhase.phaseName = this.editForm.projectPhaseName;
projectPhase.taskType = this.editForm.taskType;
projectPhase.projectId = this.editForm.projectId;
projectPhase.projectName = this.editForm.projectName;
projectPhase.ntype="0"
return projectPhase;
} else {
return null;
@ -1638,51 +1637,50 @@ export default {
this.editForm = Object.assign({}, row);
console.log("editForm", this.editForm);
},
showTaskTemplate: function () {
if (
!this.roles.some((i) => i.roleid == "projectAdmin") &&
!this.roles.some((i) => i.roleid == "teamAdmin")
) {
this.$message.error("只有项目经理、小组长可以操作");
showTaskTemplate: function (row) {
if(!this.checkCanAdd(row)){
return;
}
if (this.currentProjectPhase == null) {
this.$message({
showClose: true,
message: "请先选择项目计划",
type: "error",
});
return false;
}
this.taskTemplateVisible = true;
},
showSubAdd(row) {
if (
!this.roles.some((i) => i.roleid == "projectAdmin") &&
!this.roles.some((i) => i.roleid == "teamAdmin")
) {
this.$message.error("只有项目经理、小组长可以操作");
checkCanAdd( parentTask){
if(parentTask && parentTask.projectPhaseId){
return true;
}
if(!parentTask||!parentTask.id){
if(this.projectPhase && this.projectPhase.ntype!='1'){
return true;
}
}
if (!this.projectPhase||!this.projectPhase.id) {
this.$message({
showClose: true,
message: "请在左边计划树中选择一个项目计划(不包括计划集)",
type: "error",
});
return false;
}else if(this.projectPhase.ntype=='1'){
this.$message({
showClose: true,
message: "您当前选中的计划【"+this.projectPhase.phaseName+"】是计划集,计划集下不能创建任务,请重新在右边计划树中选择一个计划",
type: "error",
});
return false;
}
},
showSubAdd(row) {
if(!this.checkCanAdd(row)){
return;
}
this.parentTask = row;
this.editForm = row;
this.showAdd();
this.addFormVisible = true;
},
// XmTask xm_task
showAdd: function () {
if (
!this.roles.some((i) => i.roleid == "projectAdmin") &&
!this.roles.some((i) => i.roleid == "teamAdmin")
) {
this.$message.error("只有项目经理、小组长可以操作");
return;
}
if (!this.currentProjectPhase) {
this.$message({
showClose: true,
message: "请先选择项目计划",
type: "error",
});
showAdd: function () {
if(!this.checkCanAdd()){
return;
}
this.addFormVisible = true;
@ -1814,17 +1812,8 @@ export default {
);
this.searchXmTasks();
},
showMenu: function (parentTask) {
if (this.projectPhase == null) {
this.$message.error("请先选中计划");
return;
}
if (
!this.roles.some((i) => i.roleid == "projectAdmin") &&
!this.roles.some((i) => i.roleid == "teamAdmin")
) {
this.$message.error("只有项目经理、小组长可以操作");
showMenu: function (parentTask) {
if(!this.checkCanAdd(parentTask)){
return;
}
this.parentTask = parentTask;
@ -2062,7 +2051,12 @@ export default {
return parents;
},
projectPhaseRowClick: function (projectPhase) {
this.projectPhase = projectPhase;
this.projectPhase = projectPhase;
if(projectPhase.ntype=='1'){
this.pageInfo.total=0;
this.xmTasks=[];
return;
}
this.getXmTasks();
},
clearSelectPhase: function () {
@ -2183,14 +2177,7 @@ export default {
});
}
},
showBatchEdit: function () {
if (
!this.roles.some((i) => i.roleid == "projectAdmin") &&
!this.roles.some((i) => i.roleid == "teamAdmin")
) {
this.$message.error("只有项目经理、小组长可以操作");
return;
}
showBatchEdit: function () {
if (this.projectPhase == null) {
this.$message({
showClose: true,

Loading…
Cancel
Save