Browse Source

优化

master
陈裕财 4 years ago
parent
commit
29d2fda6a7
  1. 50
      src/views/xm/core/xmGroup/XmGroupSelect.vue
  2. 18
      src/views/xm/core/xmTask/XmTaskEdit.vue
  3. 24
      src/views/xm/core/xmTask/XmTaskMng.vue
  4. 2
      src/views/xm/core/xmTask/XmTaskMngBatch.vue

50
src/views/xm/core/xmGroup/XmGroupSelect.vue

@ -1,17 +1,21 @@
<template> <template>
<section class="border padding-left"> <section class="border padding-left">
<el-row class="padding-top">
<el-col :span="6">
<el-button type="primary" @click="userConfirm" icon="el-icon-finished">确认选择</el-button>
</el-col>
<el-col :span="18" class="hidden-sm-and-down">
<el-tooltip content="黄色表示选中"><span class="addXmGroupFormworkSquare"></span></el-tooltip>
{{this.filters.selProject?"项目:":""}}<el-tag type="primary" @click="selectProjectVisible=true" v-if="this.filters.selProject" closable @close="onProjectClose">{{this.filters.selProject.name}}</el-tag>
<el-tag v-else type="warning" @click="selectProjectVisible=true"> 选择项目</el-tag>
&nbsp;&nbsp;
{{this.filters.xmProduct?"产品:":""}}<el-tag type="primary" @click="selectProductVisible=true" v-if="this.filters.xmProduct&&this.filters.xmProduct.id" closable @close="onProductClose">{{this.filters.xmProduct.productName}}</el-tag>
<el-tag v-else type="warning" @click="selectProductVisible=true">选择产品</el-tag>
</el-col>
<el-row class="padding-top">
<el-popover v-if="(pgClass==='0'||!pgClass) && (!selProject || !selProject.id)"
placement="right"
width="400"
trigger="click">
<xm-project-select :auto-select="true" :xm-product="xmProduct" @row-click="onProjectRowClick" @clear-select="onProjectClose"></xm-project-select>
<el-link type="warning" slot="reference" icon="el-icon-search"><font style="font-size:14px;">{{filters.selProject?filters.selProject.name:'选择项目'}}</font></el-link>
</el-popover>
<el-popover v-if="pgClass==='1' && (!xmProduct || !xmProduct.id)"
placement="right"
width="400"
trigger="click">
<xm-product-select :auto-select="true" :sel-project="selProject" @row-click="onProductRowClick" @clear-select="onProductClose"></xm-product-select>
<el-link type="warning" slot="reference" icon="el-icon-search"><font style="font-size:14px;">{{filters.xmProduct?filters.xmProduct.productName:'选择项目'}}</font></el-link>
</el-popover>
<el-button type="primary" @click="userConfirm" icon="el-icon-finished">确认选择</el-button>
</el-row> </el-row>
<el-row class="padding-top" v-loading="load.list" :style="{overflowX:'auto',height:maxTableHeight+'px'}" ref="table"> <el-row class="padding-top" v-loading="load.list" :style="{overflowX:'auto',height:maxTableHeight+'px'}" ref="table">
<el-row v-for="(item,index) in xmGroupFormworkSels" :key="index"> <el-row v-for="(item,index) in xmGroupFormworkSels" :key="index">
@ -28,12 +32,12 @@
</el-row> </el-row>
<el-drawer title="选中项目团队" :visible.sync="selectProjectVisible" size="80%" append-to-body :close-on-click-modal="false"> <el-drawer title="选中项目团队" :visible.sync="selectProjectVisible" size="80%" append-to-body :close-on-click-modal="false">
<xm-project-list @project-confirm="onPorjectConfirm"></xm-project-list>
<xm-project-list @project-confirm="onProjectRowClick"></xm-project-list>
</el-drawer> </el-drawer>
<el-drawer title="选中产品团队" :visible.sync="selectProductVisible" size="80%" append-to-body :close-on-click-modal="false"> <el-drawer title="选中产品团队" :visible.sync="selectProductVisible" size="80%" append-to-body :close-on-click-modal="false">
<xm-product-select :isSelectProduct="true" @selected="onProductConfirm"></xm-product-select>
<xm-product-select :isSelectProduct="true" @selected="onProductRowClick"></xm-product-select>
</el-drawer> </el-drawer>
</section> </section>
</template> </template>
@ -43,7 +47,7 @@
//import Sticky from '@/components/Sticky' // header //import Sticky from '@/components/Sticky' // header
import { initSimpleDicts } from '@/api/mdp/meta/item';// import { initSimpleDicts } from '@/api/mdp/meta/item';//
import { getGroups } from '@/api/xm/core/xmGroup'; import { getGroups } from '@/api/xm/core/xmGroup';
import XmProjectList from '../xmProject/XmProjectList';
import XmProjectSelect from '../xmProject/XmProjectSelect';
import {mapGetters} from 'vuex' import {mapGetters} from 'vuex'
import XmProductSelect from '../xmProduct/XmProductSelect.vue'; import XmProductSelect from '../xmProduct/XmProductSelect.vue';
@ -55,7 +59,7 @@ import XmProductSelect from '../xmProduct/XmProductSelect.vue';
]) ])
}, },
// //
props: ['visible','selProject','isSelectSingleUser','isSelectMultiUser','xmProduct'],
props: ['visible','selProject','isSelectSingleUser','isSelectMultiUser','xmProduct','pgClass'],
watch: { watch: {
"selGroups": function(selGroups) { "selGroups": function(selGroups) {
if(this.selGroups){ if(this.selGroups){
@ -153,14 +157,14 @@ import XmProductSelect from '../xmProduct/XmProductSelect.vue';
if(this.filters.xmProduct && this.filters.xmProduct.id){ if(this.filters.xmProduct && this.filters.xmProduct.id){
params.productId=this.filters.xmProduct.id params.productId=this.filters.xmProduct.id
} }
if(!params.projectId && !params.productId){
this.$notify({showClose:true,message:'产品团队或者项目团队最少选中一个',type:'error'})
if(this.pgClass==='1' && !params.productId){
this.$notify({showClose:true,message:'请选择产品',type:'error'})
return; return;
} }
if(params.projectId && params.productId){
if((this.pgClass==='0' || !this.pgClass )&& !params.projectId){
params.productId=null params.productId=null
this.$notify({showClose:true,message:'产品团队或者项目团队只能选中一个,两个都选以项目团队为准',type:'warning'})
this.$notify({showClose:true,message:'请选择项目',type:'warning'})
} }
getGroups(params).then(res=>{ getGroups(params).then(res=>{
var tips = res.data.tips; var tips = res.data.tips;
@ -172,7 +176,7 @@ import XmProductSelect from '../xmProduct/XmProductSelect.vue';
}) })
}, },
onPorjectConfirm:function(project){
onProjectRowClick:function(project){
this.filters.selProject=project this.filters.selProject=project
this.filters.xmProduct=null; this.filters.xmProduct=null;
this.selectProjectVisible=false; this.selectProjectVisible=false;
@ -180,7 +184,7 @@ import XmProductSelect from '../xmProduct/XmProductSelect.vue';
}, },
onProductConfirm:function(product){
onProductRowClick:function(product){
this.filters.xmProduct=product this.filters.xmProduct=product
this.filters.selProject=null this.filters.selProject=null
this.selectProductVisible=false; this.selectProductVisible=false;
@ -199,7 +203,7 @@ import XmProductSelect from '../xmProduct/XmProductSelect.vue';
}, //end methods }, //end methods
components: { components: {
XmProjectList,XmProductSelect
XmProjectSelect,XmProductSelect
}, },
mounted() { mounted() {
this.$nextTick(() => { this.$nextTick(() => {

18
src/views/xm/core/xmTask/XmTaskEdit.vue

@ -82,12 +82,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-form-item :label="editForm.ntype=='1'?'计划描述':'任务描述'" prop="description">
<el-input type="textarea" :autosize="{ minRows: 4, maxRows: 10}" v-model="editForm.description" :placeholder="editForm.ntype=='1'?'计划描述':'任务描述'" ></el-input>
</el-form-item>
</el-collapse-item>
<el-collapse-item title="进度预测" name="2">
<el-form-item label="负责人"> <el-form-item label="负责人">
<el-tag v-if="editForm.createUserid" style="margin-left:10px;border-radius:30px;" >{{editForm.createUsername}}</el-tag> <el-tag v-if="editForm.createUserid" style="margin-left:10px;border-radius:30px;" >{{editForm.createUsername}}</el-tag>
<el-button @click="showGroupUserSelect(editForm)" icon="el-icon-setting">设置负责人</el-button> <el-button @click="showGroupUserSelect(editForm)" icon="el-icon-setting">设置负责人</el-button>
@ -96,6 +91,11 @@
<el-tag v-if="editForm.executorUserid" style="margin-left:10px;border-radius:30px;" >{{editForm.executorUsername}}</el-tag> <el-tag v-if="editForm.executorUserid" style="margin-left:10px;border-radius:30px;" >{{editForm.executorUsername}}</el-tag>
<el-button @click="execGroupUserSelectVisible=true" icon="el-icon-setting">设置执行人</el-button> <el-button @click="execGroupUserSelectVisible=true" icon="el-icon-setting">设置执行人</el-button>
</el-form-item> </el-form-item>
<el-form-item :label="editForm.ntype=='1'?'计划描述':'任务描述'" prop="description">
<el-input type="textarea" :autosize="{ minRows: 4, maxRows: 10}" v-model="editForm.description" :placeholder="editForm.ntype=='1'?'计划描述':'任务描述'" ></el-input>
</el-form-item>
</el-collapse-item>
<el-collapse-item title="进度预测" name="2">
<el-form-item label="预计时间"> <el-form-item label="预计时间">
<el-tooltip content="计划类型"> <el-tooltip content="计划类型">
<el-select v-model=" editForm.planType" style="width:20%;"> <el-select v-model=" editForm.planType" style="width:20%;">
@ -201,10 +201,10 @@
<xm-skill-mng :visible="skillVisible" :task-id="editForm.id" @cancel="skillVisible=false" @getSkill="getSkill"></xm-skill-mng> <xm-skill-mng :visible="skillVisible" :task-id="editForm.id" @cancel="skillVisible=false" @getSkill="getSkill"></xm-skill-mng>
</el-drawer> --> </el-drawer> -->
<el-drawer append-to-body title="选择执行人" :visible.sync="execGroupUserSelectVisible" size="60%" :close-on-click-modal="false"> <el-drawer append-to-body title="选择执行人" :visible.sync="execGroupUserSelectVisible" size="60%" :close-on-click-modal="false">
<xm-group-select :visible="execGroupUserSelectVisible" :sel-project="xmProject" :isSelectSingleUser="1" @user-confirm="execGroupUserSelectConfirm"></xm-group-select>
<xm-group-select :pgClass="editForm.ptype" :xm-product="editForm.productId?{id:editForm.productId,productName:''}:null" :visible="execGroupUserSelectVisible" :sel-project="xmProject" :isSelectSingleUser="1" @user-confirm="execGroupUserSelectConfirm"></xm-group-select>
</el-drawer> </el-drawer>
<el-drawer append-to-body title="选择负责人" :visible.sync="groupUserSelectVisible" size="60%" :close-on-click-modal="false"> <el-drawer append-to-body title="选择负责人" :visible.sync="groupUserSelectVisible" size="60%" :close-on-click-modal="false">
<xm-group-select :visible="groupUserSelectVisible" :sel-project="xmProject" :isSelectSingleUser="1" @user-confirm="groupUserSelectConfirm"></xm-group-select>
<xm-group-select :pgClass="editForm.ptype" :xm-product="editForm.productId?{id:editForm.productId,productName:''}:null" :visible="groupUserSelectVisible" :sel-project="xmProject" :isSelectSingleUser="1" @user-confirm="groupUserSelectConfirm"></xm-group-select>
</el-drawer> </el-drawer>
<el-drawer append-to-body title="新增技能" :visible.sync="skillVisible" size="60%" :close-on-click-modal="false"> <el-drawer append-to-body title="新增技能" :visible.sync="skillVisible" size="60%" :close-on-click-modal="false">
<skill-mng :task-skills="taskSkills" :jump="true" @select-confirm="onTaskSkillsSelected"></skill-mng> <skill-mng :task-skills="taskSkills" :jump="true" @select-confirm="onTaskSkillsSelected"></skill-mng>
@ -215,7 +215,7 @@
</el-drawer> </el-drawer>
<el-drawer title="选中任务" :visible.sync="selectTaskVisible" size="80%" append-to-body :close-on-click-modal="false"> <el-drawer title="选中任务" :visible.sync="selectTaskVisible" size="80%" append-to-body :close-on-click-modal="false">
<xm-task-list :sel-project="xmProject" @task-selected="onSelectedTask"></xm-task-list>
<xm-task-list :ptype="editForm.ptype" :xm-product="{id:editForm.productId,productName:''}" :sel-project="xmProject" @task-selected="onSelectedTask"></xm-task-list>
</el-drawer> </el-drawer>
<el-drawer :title="'任务'+editForm.name+'的候选人'" :visible.sync="execUserVisible" fullscreen size="60%" append-to-body :close-on-click-modal="false"> <el-drawer :title="'任务'+editForm.name+'的候选人'" :visible.sync="execUserVisible" fullscreen size="60%" append-to-body :close-on-click-modal="false">

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

@ -920,6 +920,7 @@
:visible="menuGroupUser" :visible="menuGroupUser"
:sel-project="selProject" :sel-project="selProject"
:isSelectSingleUser="1" :isSelectSingleUser="1"
:ptype="ptype"
@user-confirm="seleConfirm" @user-confirm="seleConfirm"
></xm-group-select> ></xm-group-select>
</el-drawer> </el-drawer>
@ -934,6 +935,7 @@
:visible="menuExecutor" :visible="menuExecutor"
:sel-project="selProject" :sel-project="selProject"
:isSelectSingleUser="1" :isSelectSingleUser="1"
:ptype="ptype"
@user-confirm="seleExecutor" @user-confirm="seleExecutor"
></xm-group-select> ></xm-group-select>
</el-drawer> </el-drawer>
@ -961,6 +963,7 @@
:visible="groupUserSelectVisible" :visible="groupUserSelectVisible"
:sel-project="selProject" :sel-project="selProject"
:isSelectSingleUser="1" :isSelectSingleUser="1"
:ptype="ptype"
@user-confirm="groupUserSelectConfirm" @user-confirm="groupUserSelectConfirm"
></xm-group-select> ></xm-group-select>
</el-drawer> </el-drawer>
@ -2423,15 +2426,22 @@ export default {
}, },
showParentTaskList(){ showParentTaskList(){
if(this.filters.selProject && this.filters.selProject.id){
if(this.sels.length==0){
this.$notify({showClose:true,message:"请先选择一个或者多个需要更换上级的计划/任务",type:'warning'})
return;
if(this.sels.length==0){
this.$notify({showClose:true,message:"请先选择一个或者多个需要更换上级的计划/任务",type:'warning'})
return;
}
if(this.ptype==='0'){
if( !this.filters.selProject|| !this.filters.selProject.id){
this.$notify({showClose:true,message:"请先选择项目",type:'warning'})
return;
}
}else if(this.ptype==='1'){
if( !this.filters.product|| !this.filters.product.id){
this.$notify({showClose:true,message:"请先选择产品",type:'warning'})
return;
} }
this.selectParentTaskVisible=true
}else{
this.$notify({showClose:true,message:"请先选择项目",type:'warning'})
} }
this.selectParentTaskVisible=true
}, },
onSelectedParentTask(task){ onSelectedParentTask(task){

2
src/views/xm/core/xmTask/XmTaskMngBatch.vue

@ -225,6 +225,7 @@
:visible="batchExecUserSelectVisible" :visible="batchExecUserSelectVisible"
:sel-project="selProject" :sel-project="selProject"
:isSelectSingleUser="1" :isSelectSingleUser="1"
:ptype="ptype"
@user-confirm="batchExecUserSelectConfirm" @user-confirm="batchExecUserSelectConfirm"
></xm-group-select> ></xm-group-select>
</el-drawer> </el-drawer>
@ -240,6 +241,7 @@
:visible="batchGroupUserSelectVisible" :visible="batchGroupUserSelectVisible"
:sel-project="selProject" :sel-project="selProject"
:isSelectSingleUser="1" :isSelectSingleUser="1"
:ptype="ptype"
@user-confirm="batchCreateUserSelectConfirm" @user-confirm="batchCreateUserSelectConfirm"
></xm-group-select> ></xm-group-select>
</el-drawer> </el-drawer>

Loading…
Cancel
Save