Browse Source

优化任务上级

master
陈裕财 4 years ago
parent
commit
b8a87a3861
  1. 6
      src/views/xm/core/xmProduct/XmProductForLinkComplex.vue
  2. 7
      src/views/xm/core/xmProject/XmProjectInfo.vue
  3. 11
      src/views/xm/core/xmTask/XmPhase.vue
  4. 410
      src/views/xm/core/xmTask/XmPhaseSelect.vue

6
src/views/xm/core/xmProduct/XmProductForLinkComplex.vue

@ -1,8 +1,8 @@
<template>
<section class="page-container border">
<section>
<el-row>
<el-col :span="24">
<el-tabs type="border-card" :value="showPanel" @tab-click="tabClick">
<el-tabs :value="showPanel" @tab-click="tabClick">
<el-tab-pane disabled>
<div slot="label">
<xm-product-select ref="xmProductSelect" :auto-select="true" :link-project-id="selProject?selProject.id:null" :iterationId="xmIteration?xmIteration.id:null" @row-click="onProductRowClick" @clear="onProductClearSelect"></xm-product-select>
@ -61,7 +61,7 @@
import config from '@/common/config';//
import { initSimpleDicts } from '@/api/mdp/meta/item';//
import XmIterationMng from '../xmIteration/XmIterationMng.vue'
import XmMenuMng from '../xmMenu/XmMenuMng.vue'
import XmMenuMng from '../xmMenu/XmMenuBox.vue'
import XmIterationStateShow from '../xmIterationState/XmIterationStateShow.vue'
import { mapGetters } from 'vuex'
import XmProductMng from './XmProductMng.vue';

7
src/views/xm/core/xmProject/XmProjectInfo.vue

@ -29,6 +29,10 @@
<span slot="title"><i class="el-icon-document"></i>需求</span>
</el-menu-item>
-->
<el-menu-item index="计划">
<span slot="title"><i class="el-icon-odometer"></i>计划</span>
</el-menu-item>
<el-menu-item index="任务">
<span slot="title"><i class="el-icon-s-operation"></i>任务</span>
</el-menu-item>
@ -38,9 +42,6 @@
<el-menu-item index="团队">
<span slot="title"><i class="el-icon-user-solid"></i>团队</span>
</el-menu-item>
<el-menu-item index="计划">
<span slot="title"><i class="el-icon-odometer"></i>计划</span>
</el-menu-item>
<el-submenu index="财务" class="hidden-sm-and-down">
<template slot="title"><i class="el-icon-coin"></i>财务</template>
<el-menu-item index="合同管理">

11
src/views/xm/core/xmTask/XmPhase.vue

@ -396,10 +396,10 @@
<xm-group-dialog ref="xmGroupDialog" :isSelectSingleUser="true" :sel-project="filters.selProject" :xm-product="filters.xmProduct" @user-confirm="selectCreateUserConfirm">
</xm-group-dialog>
<el-drawer title="选中上级" :visible.sync="selectParentTaskVisible" size="60%" append-to-body :close-on-click-modal="false">
<xm-task-list check-scope="plan" queryScope="plan" :sel-project="filters.selProject" @task-selected="onSelectedParentTask"></xm-task-list>
</el-drawer>
<el-dialog title="选择新的上级计划" append-to-body :visible.sync="selectParentTaskVisible" width="60%" top="20px">
<xm-phase-select :sel-project="filters.selProject" @select="onSelectedParentTask"></xm-phase-select>
</el-dialog>
</section>
</template>
@ -438,6 +438,8 @@ import XmProductSelect from "@/views/xm/core/components/XmProductSelect";
import XmGantt from "../components/xm-gantt";
import XmGroupSelect from "../xmGroup/XmGroupSelect.vue";
import XmPhaseSelect from "./XmPhaseSelect.vue";
import XmTableConfig from '@/views/xm/core/components/XmTableConfig';//
import XmGroupDialog from '@/views/xm/core/xmGroup/XmGroupDialog';//
@ -2004,6 +2006,7 @@ export default {
TagDialog,
XmGroupDialog,
XmTableConfig,
XmPhaseSelect,
//
},
mounted() {

410
src/views/xm/core/xmTask/XmPhaseSelect.vue

@ -0,0 +1,410 @@
<template>
<section class="padding-right">
<el-row>
<el-col
:span="24"
class="padding-left"
>
<el-row>
<xm-project-select style="display:inline;" v-if="!selProject||!selProject.id" :auto-select="isTaskCenter?false:true" :link-iteration-id="xmIteration?xmIteration.id:null" :link-product-id="xmProduct?xmProduct.id:null" @row-click="onProjectRowClick" @clear="onProjectClear" ></xm-project-select>
</el-row>
<el-row class="padding-top">
<el-table class="task-table"
:data="tasksTreeData"
@sort-change="sortChange"
v-loading="load.list"
@row-click="rowClick"
@selection-change="selsChange"
highlight-current-row
current-row-key="id"
stripe
fit
border
tooltip-effect="light"
:height="tableHeight"
:tree-props="{ children: 'children' }"
row-key="id"
ref="table"
:row-style="{height:'60px'}"
>
<el-table-column
label="全选"
type="selection"
width="50"
fixed="left"
>
</el-table-column>
<el-table-column
sortable
prop="name"
class-name="title"
fixed="left"
label="计划名称"
min-width="300" show-overflow-tooltip
>
<template slot-scope="scope">
<div class="icon" :style="{backgroundColor: scope.row.ntype==='1'?'#E6A23C':'#409EFF'}">
<i :class="scope.row.ntype==='1'?'el-icon-odometer':'el-icon-s-operation'" ></i>
</div>
<span>
{{ scope.row.sortLevel }}&nbsp; {{ scope.row.name }}
</span>
</template>
</el-table-column>
<el-table-column
label="状态"
type="taskState"
width="100"
>
<template slot-scope="scope">
<div>
<el-tag v-for="(item,index) in formatDictsWithClass(dicts,'taskState',scope.row.taskState)" :key="index" :type="item.className">{{item.name}}</el-tag>
</div>
</template>
</el-table-column>
<el-table-column
label="操作"
width="100"
>
<template slot-scope="scope">
<div>
<el-button @click="$emit('select', scope.row,scope.$index)" title="选择" type="primary">选择 </el-button>
</div>
</template>
</el-table-column>
</el-table>
<el-pagination
ref="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; margin-top: 10px;"
></el-pagination>
</el-row>
</el-col>
</el-row>
</section>
</template>
<script>
import Vue from "vue";
import util from "@/common/js/util"; //
import treeTool from "@/common/js/treeTool"; //
//import Sticky from '@/components/Sticky' // header
import { initSimpleDicts } from '@/api/mdp/meta/item'; //
import {
getTask,
listXmTask,
calcProgress,
calcProjectProgress,
} from "@/api/xm/core/xmTask";
import { mapGetters } from "vuex";
import { sn } from "@/common/js/sequence";
import XmProjectSelect from "@/views/xm/core/components/XmProjectSelect";
import XmGroupDialog from '@/views/xm/core/xmGroup/XmGroupDialog';//
export default {
computed: {
...mapGetters(["userInfo", "roles"]),
tasksTreeData() {
let xmTasks = JSON.parse(JSON.stringify(this.xmTasks || []));
const tasksTreeData = treeTool.translateDataToTree(xmTasks,"parentTaskid","id");
return tasksTreeData;
},
},
props: [
"selProject", "xmProduct","xmIteration"
],
watch: {
selProject: function (oval, val) {
this.filters.selProject = this.selProject;
this.changeSelKey("all");
},
xmProduct: function () {
this.filters.product = this.xmProduct;
this.getXmTasks();
},
xmIteration: function () {
this.getXmTasks();
},
},
data() {
return {
filters: {
key: "",
isMyTask: "0", //01
selProject: null,
skillTags: [],
taskOut: "", //10//
menus: [],
createUser: null, //
executor: null, //
taskType: "",
tags: [],
taskState:'',//
lvls:['1','2'],
},
xmTasks: [], //
pageInfo: {
//
total: 0, //0>0
pageSize: this.queryScope==='plan' || this.queryScope==='planTask'?50:20, //
count: false, //
pageNum: 1, //1
orderFields: ["sort_level"], // ['sex','student_id']
orderDirs: ["asc"], // asc,desc ['asc','desc']
},
load: { list: false, edit: false, del: false, add: false,calcProgress:false, }, //...
sels: [], //
dicts: {
priority: [],
taskType: [],
planType: [],
priority: [],
xmTaskSettleSchemel: [],
taskState:[],
xm_plan_lvl:[],
}, // params=[{categoryId:'0001',itemCode:'sex'}] {'sex':[{optionValue:'1',optionName:'',seqOrder:'1',fp:'',isDefault:'0'},{optionValue:'2',optionName:'',seqOrder:'2',fp:'',isDefault:'0'}]}
addFormVisible: false, //xmTask
//xmTask
addForm: {
id: "",
name: "",
parentTaskid: "",
parentTaskname: "",
projectId: "",
projectName: "",
level: "",
sortLevel: "",
executorUserid: "",
executorUsername: "",
preTaskid: "",
preTaskname: "",
startTime: "",
endTime: "",
milestone: "",
description: "",
remarks: "",
createUserid: "",
createUsername: "",
createTime: "",
rate: "",
budgetAt: "",
budgetWorkload: "",
actAt: "",
actWorkload: "",
taskState: "",
taskType: "",
taskClass: "",
toTaskCenter: "",
actStartTime: "",
actEndTime: "",
uniInnerPrice:80,uniOutPrice:100,
},
editFormVisible: false, //
//xmTask
editForm: {
id: "",
name: "",
parentTaskid: "",
parentTaskname: "",
projectId: "",
projectName: "",
level: "",
sortLevel: "",
executorUserid: "",
executorUsername: "",
preTaskid: "",
preTaskname: "",
startTime: "",
endTime: "",
milestone: "",
description: "",
remarks: "",
createUserid: "",
createUsername: "",
createTime: "",
rate: "",
budgetAt: "",
budgetWorkload: "",
actAt: "",
actWorkload: "",
taskState: "",
taskType: "",
taskClass: "",
toTaskCenter: "",
actStartTime: "",
actEndTime: "",
uniInnerPrice:80,uniOutPrice:100,
},
tableHeight: 300,
};
}, //end data
methods: {
...util,
handleSizeChange(pageSize) {
this.pageInfo.pageSize = pageSize;
this.getXmTasks();
},
handleCurrentChange(pageNum) {
this.pageInfo.pageNum = pageNum;
this.getXmTasks();
},
// obj.order=ascending/descending, asc/desc ; obj.prop=,
sortChange(obj) {
if (obj.order == null) {
this.pageInfo.orderFields = ["create_time"];
this.pageInfo.orderDirs = ["desc"];
} else {
var dir = "asc";
if (obj.order == "ascending") {
dir = "asc";
} else {
dir = "desc";
}
this.pageInfo.orderFields = [util.toLine(obj.prop)];
this.pageInfo.orderDirs = [dir];
}
this.getXmTasks();
},
searchXmTasks() {
this.pageInfo.count = true;
this.getXmTasks();
},
// XmTask xm_task
getXmTasks() {
let params = {
pageSize: this.pageInfo.pageSize,
pageNum: this.pageInfo.pageNum,
total: this.pageInfo.total,
count: this.pageInfo.count,
};
if (
this.pageInfo.orderFields != null &&
this.pageInfo.orderFields.length > 0
) {
let orderBys = [];
for (var i = 0; i < this.pageInfo.orderFields.length; i++) {
orderBys.push(
this.pageInfo.orderFields[i] + " " + this.pageInfo.orderDirs[i]
);
}
params.orderBy = orderBys.join(",");
}
params=this.getParams(params)
getTask(params)
.then((res) => {
var tips = res.data.tips;
if (tips.isOk) {
this.pageInfo.total = res.data.total;
this.pageInfo.count = false;
var xmTasks = res.data.data;
this.xmTasks = xmTasks;
if (this.editForm != null) {
var index = this.xmTasks.findIndex(
(i) => i.id == this.editForm.id
);
if (index >= 0) {
this.editForm = this.xmTasks[index];
}
}
} else {
this.$notify({
showClose: true,
message: tips.msg,
type: "error",
});
}
this.load.list = false;
})
.catch((err) => (this.load.list = false));
},
//xmTask
selsChange: function (sels) {
this.sels = sels;
},
rowClick: function (row) {
this.editForm = row;
this.editFormBak=Object.assign({},row)
this.$emit('row-click',row,);// @row-click="rowClick"
},
onProjectRowClick: function (project) {
this.filters.selProject = project;
this.$emit("project-row-click",project)
this.searchXmTasks();
},
onProjectClear(){
this.filters.selProject=null;
this.xmTasks=[]
this.searchXmTasks();
},
getParams(params) {
if(this.filters.taskState){
params.taskState=this.filters.taskState
}
if (this.filters.selProject) {
params.projectId = this.filters.selProject.id;
}
if (this.filters.key) {
params.key = "%" + this.filters.key + "%";
}
params.ntype='1'
return params;
},
initData(){
if (this.selProject) {
this.filters.selProject = this.selProject;
}
if (this.xmProduct) {
this.filters.product = this.xmProduct;
}
},
}, //end methods
components: {
XmProjectSelect,
XmGroupDialog,
//
},
mounted() {
this.initData();
this.$nextTick(() => {
if(this.isTaskCenter ||(this.selProject && this.selProject.id)){
this.getXmTasks();
}
this.tableHeight = this.source == 'GZT' ? this.tableHeight : util.calcTableMaxHeight(this.$refs.table.$el);
initSimpleDicts( "all", ["planType","taskType","priority","xmTaskSettleSchemel","priority","taskState",'xm_plan_lvl' ]).then((res) => {
Object.assign(this.dicts,res.data.data)
});
});
},
};
</script>
<style scoped>
</style>
Loading…
Cancel
Save