diff --git a/src/views/xm/core/xmProjectGroup/XmProjectGroupSelect.vue b/src/views/xm/core/xmProjectGroup/XmProjectGroupSelect.vue index 6f901a3f..d5f72714 100644 --- a/src/views/xm/core/xmProjectGroup/XmProjectGroupSelect.vue +++ b/src/views/xm/core/xmProjectGroup/XmProjectGroupSelect.vue @@ -60,7 +60,7 @@ }else{ this.xmProjectGroupFormworkSels = []; } - this.applyData(); + // this.applyData(); }, 'visible': function(visible) { if (visible == true) { diff --git a/src/views/xm/core/xmTask/XmTaskMng.vue b/src/views/xm/core/xmTask/XmTaskMng.vue index fea4042c..feac1900 100644 --- a/src/views/xm/core/xmTask/XmTaskMng.vue +++ b/src/views/xm/core/xmTask/XmTaskMng.vue @@ -5,12 +5,12 @@ - - + + 全部状态 未完成 已完成 - 我关注 + 我关注 我排队 我执行 我提交 @@ -18,12 +18,12 @@ 我的验收失败 我的付款中 我的付款成功 - 我放弃的 - - + 我放弃的 + + 全部类型 - {{i.optionName}} - + {{i.optionName}} + 选择标签 {{skill.skillName}} @@ -33,10 +33,10 @@ - + - - + + 从模板快速导入任务 - 由故事快速创建任务 - + 由故事快速创建任务 + @@ -59,21 +59,21 @@ 选择标签 - - + + - - - - + + + + - + > + - {{scope.row.sortLevel}} {{scope.row.name}} - + {{scope.row.sortLevel}} {{scope.row.name}} + - - - + + + 项目 - {{scope.row.projectName}} + {{scope.row.projectName}} + + + + + 故事 - - - {{scope.row.menuName?scope.row.menuName:'去关联故事'}} + {{scope.row.menuName?scope.row.menuName:'去关联故事'}} - + {{parseFloat(scope.row.budgetCost/10000).toFixed(2)}}万,{{scope.row.budgetWorkload}}人时 - - - {{scope.row.createUsername}} - 去设置 + + + 责任人 + + + {{scope.row.createUsername}} + 去设置 - - - {{scope.row.exeUsernames}} - {{scope.row.exeUsernames}} - {{scope.row.exeUsernames}} - 去抢任务 + + + 执行人 + + + {{scope.row.exeUsernames}} + {{scope.row.exeUsernames}} + {{scope.row.exeUsernames}} + 去抢任务 - {{ (scope.row.rate!=null?scope.row.rate:0)+'%'}} + {{ (scope.row.rate!=null?scope.row.rate:0)+'%'}} - + - {{getDateString(scope.row.startTime)}}~{{getDateString(scope.row.endTime)}} + {{getDateString(scope.row.startTime)}}~{{getDateString(scope.row.endTime)}} {{item.desc}} - + @@ -149,20 +158,20 @@ - + {{scope.row.taskSkillNames}} - 去补充 + 去补充 @@ -170,37 +179,37 @@ - + 更多 +子任务 - +从模板批量导入子任务 - +由故事创建子任务 + +从模板批量导入子任务 + +由故事创建子任务 - 明细 - 编辑 - 执行人管理 - 技能管理 + 明细 + 编辑 + 执行人管理 + 技能管理 取关 - 关注 - 讨论 - 日志 - 删除 + 关注 + 讨论 + 日志 + 删除 - + - - + + @@ -221,15 +230,15 @@ - {{editForm.name}} {{taskStateList[parseInt(editForm.taskState)] }} + {{editForm.name}} {{taskStateList[parseInt(editForm.taskState)] }} 去取关 - 去关注 + 去关注 {{formateOption('urgencyLevel',editForm.level)}} - [{{formateOption('taskType',editForm.taskType)}}] + [{{formateOption('taskType',editForm.taskType)}}] {{editForm.projectName}} - - + - {{editForm.createUsername}} 创建于 {{editForm.createTime}} @@ -237,7 +246,7 @@ {{editForm.remarks}} - + 用户故事{{editForm.menuName}} @@ -249,15 +258,15 @@ 完成40% 完成60% 完成80% - 完成99% - 完成100% - + 完成99% + 完成100% + 任务负责人 {{editForm.createUsername}} - 未设置 - 设置负责人 + 未设置 + 设置负责人 任务执行人{{editForm.exeUsernames}} @@ -270,7 +279,7 @@ 任务周期{{getDateString(editForm.startTime)+' ~ '+ getDateString(editForm.endTime)}} 共{{taskTime}}天 - + 子任务{{item.sortLevel}}{{item.name}} @@ -289,7 +298,7 @@ 预算工作量{{editForm.budgetWorkload}} 人时 - + 任务描述{{editForm.description}} @@ -306,8 +315,8 @@ - - + + @@ -332,29 +341,38 @@ - + - + - + - - + + - + + + + + + + + + + - + @@ -363,31 +381,31 @@ import util from '@/common/js/util';//全局公共库 //import Sticky from '@/components/Sticky' // 粘性header组件 import { listOption } from '@/api/mdp/meta/itemOption';//下拉框数据查询 - import { getTask ,listXmTask,editXmTask,editRate, delXmTask, batchDelXmTask,batchImportTaskFromTemplate,batchSaveBudget,setTaskCreateUser} from '@/api/xm/core/xmTask'; + import { getTask ,listXmTask,editXmTask,editRate, delXmTask, batchDelXmTask,batchImportTaskFromTemplate,batchSaveBudget,setTaskCreateUser} from '@/api/xm/core/xmTask'; import XmTaskAdd from './XmTaskAdd';//新增界面 import XmTaskEdit from './XmTaskEdit';//修改界面 import XmTaskMngBatch from './XmTaskMngBatch';//修改界面 - import { mapGetters } from 'vuex'; + import { mapGetters } from 'vuex'; import xmExecuserMng from '../xmTaskExecuser/XmTaskExecuserMng'; import xmSkillMng from '../xmTaskSkill/XmTaskSkillMng'; import skillMng from "@/views/xm/core/skill/skillMng"; import {batchAddSkill } from '@/api/xm/core/xmTaskSkill'; import xmProjectPhaseMng from '../xmProjectPhase/XmProjectPhaseSelect'; - import {sn} from '@/common/js/sequence' - import xmTaskTemplateMng from '../xmTaskTemplate/XmTaskTemplateMng'; - import xmExchangeMng from '../xmExchange/XmExchangeMng'; + import {sn} from '@/common/js/sequence' + import xmTaskTemplateMng from '../xmTaskTemplate/XmTaskTemplateMng'; + import xmExchangeMng from '../xmExchange/XmExchangeMng'; import xmMenuSelect from '../xmMenu/XmMenuSelect'; import { addXmMyFocus , delXmMyFocus } from '@/api/xm/core/xmMyFocus'; - + import XmProjectList from '../xmProject/XmProjectList'; import XmMenuRichDetail from '../xmMenu/XmMenuRichDetail'; - import XmGantt from '../components/xm-gantt'; + import XmGantt from '../components/xm-gantt'; import XmProjectGroupSelect from '../xmProjectGroup/XmProjectGroupSelect.vue'; - export default { + export default { computed: { ...mapGetters([ 'userInfo','roles' @@ -404,7 +422,7 @@ import XmProjectGroupSelect from '../xmProjectGroup/XmProjectGroupSelect.vue'; return currentProject }else{ return null; - } + } } }, currentProjectPhase(){ @@ -421,7 +439,7 @@ import XmProjectGroupSelect from '../xmProjectGroup/XmProjectGroupSelect.vue'; return projectPhase }else{ return null; - } + } } }, curUser() { @@ -461,22 +479,22 @@ import XmProjectGroupSelect from '../xmProjectGroup/XmProjectGroupSelect.vue'; xmTasks.push(c); }) } - - const tasksTreeData = this.translateDataToTree(xmTasks); - + + const tasksTreeData = this.translateDataToTree(xmTasks); + return tasksTreeData; }, - - taskBudgetData(){ + + taskBudgetData(){ var rows=this.xmTasks var surplusPhaseBudgetCostAt = this.getFloatValue(this.projectPhase.phaseBudgetInnerUserAt)+ this.getFloatValue(this.projectPhase.phaseBudgetOutUserAt)+ this.getFloatValue(this.projectPhase.phaseBudgetNouserAt) var surplusPhaseBudgetInnerUserAt=this.getFloatValue(this.projectPhase.phaseBudgetInnerUserAt) var surplusPhaseBudgetOutUserAt=this.getFloatValue(this.projectPhase.phaseBudgetOutUserAt) - var surplusPhaseBudgetNouserAt=this.getFloatValue(this.projectPhase.phaseBudgetNouserAt) + var surplusPhaseBudgetNouserAt=this.getFloatValue(this.projectPhase.phaseBudgetNouserAt) var surplusPhaseBudgetUserAt=this.getFloatValue(this.projectPhase.phaseBudgetInnerUserAt)+this.getFloatValue(this.projectPhase.phaseBudgetOutUserAt) var total={ - surplusPhaseBudgetCostAt: surplusPhaseBudgetCostAt, + surplusPhaseBudgetCostAt: surplusPhaseBudgetCostAt, surplusPhaseBudgetInnerUserAt: surplusPhaseBudgetInnerUserAt, surplusPhaseBudgetOutUserAt: surplusPhaseBudgetOutUserAt, surplusPhaseBudgetNouserAt: surplusPhaseBudgetNouserAt, @@ -488,7 +506,7 @@ import XmProjectGroupSelect from '../xmProjectGroup/XmProjectGroupSelect.vue'; taskBudgetUserAt: 0, - }; + }; //phaseBudgetHours:'',phaseBudgetStaffNu:'',ctime:'',phaseBudgetNouserAt:'',phaseBudgetInnerUserAt:'',phaseBudgetOutUserAt rows.forEach((row2)=>{ var row=row2; @@ -508,27 +526,27 @@ import XmProjectGroupSelect from '../xmProjectGroup/XmProjectGroupSelect.vue'; row.taskBudgetOutUserAt=0 row.taskBudgetInnerUserAt=budgetCost row.taskBudgetNouserAt=0; - } + } total.taskBudgetNouserAt=total.taskBudgetNouserAt+row.taskBudgetNouserAt total.taskBudgetInnerUserAt=total.taskBudgetInnerUserAt+ row.taskBudgetInnerUserAt total.taskBudgetOutUserAt=total.taskBudgetOutUserAt+ row.taskBudgetOutUserAt }) - total.taskBudgetUserAt=total.taskBudgetInnerUserAt+total.taskBudgetOutUserAt - total.surplusPhaseBudgetCostAt=total.surplusPhaseBudgetCostAt-total.taskBudgetNouserAt-total.taskBudgetUserAt + total.taskBudgetUserAt=total.taskBudgetInnerUserAt+total.taskBudgetOutUserAt + total.surplusPhaseBudgetCostAt=total.surplusPhaseBudgetCostAt-total.taskBudgetNouserAt-total.taskBudgetUserAt total.surplusPhaseBudgetInnerUserAt=total.surplusPhaseBudgetInnerUserAt-total.taskBudgetInnerUserAt total.surplusPhaseBudgetOutUserAt=total.surplusPhaseBudgetOutUserAt-total.taskBudgetOutUserAt - total.surplusPhaseBudgetNouserAt=total.surplusPhaseBudgetNouserAt-total.taskBudgetNouserAt + total.surplusPhaseBudgetNouserAt=total.surplusPhaseBudgetNouserAt-total.taskBudgetNouserAt total.surplusPhaseBudgetUserAt=total.surplusPhaseBudgetUserAt-total.taskBudgetUserAt return total; } }, props: ["selProject","isTaskCenter","isMy",'menuId','menuName'], - watch: { - "selProject": function(oval,val) { + watch: { + "selProject": function(oval,val) { this.filters.selProject=this.selProject; this.changeSelKey("all"); - }, + }, 'menuId':function(menuId){ this.getXmTasks() }, @@ -545,6 +563,9 @@ import XmProjectGroupSelect from '../xmProjectGroup/XmProjectGroupSelect.vue'; isMyTask: '0',//0不区分我的,1 时我的任务 selProject:null, skillTags:[], + menus:[], + createUserid:'',//负责人 + executorUserid:''//执行人 }, xmTasks: [],//查询结果 pageInfo:{//分页数据 @@ -563,8 +584,8 @@ import XmProjectGroupSelect from '../xmProjectGroup/XmProjectGroupSelect.vue'; planType:[], priority:[], xmTaskSettleSchemel:[], - },//下拉选择框的所有静态数据 params=[{categoryId:'0001',itemCode:'sex'}] 返回结果 {'sex':[{optionValue:'1',optionName:'男',seqOrder:'1',fp:'',isDefault:'0'},{optionValue:'2',optionName:'女',seqOrder:'2',fp:'',isDefault:'0'}]} - + },//下拉选择框的所有静态数据 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: { @@ -572,19 +593,19 @@ import XmProjectGroupSelect from '../xmProjectGroup/XmProjectGroupSelect.vue'; preTaskid:'',preTaskname:'',startTime:'',endTime:'',milestone:'',description:'',remarks:'',createUserid:'',createUsername:'',createTime:'', rate:'',budgetCost:'',budgetWorkload:'',actCost:'',actWorkload:'',taskState:'',taskType:'',taskClass:'',toTaskCenter:'',actStartTime:'',actEndTime:'', }, - + 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:'',budgetCost:'',budgetWorkload:'',actCost:'',actWorkload:'',taskState:'',taskType:'',taskClass:'',toTaskCenter:'',actStartTime:'',actEndTime:'', - }, + }, /**begin 自定义属性请在下面加 请加备注**/ - taskStateList: ["待领取","已领取执行中","已完工","已结算"], + taskStateList: ["待领取","已领取执行中","已完工","已结算"], selkey: "all", - drawerVisible: false, + drawerVisible: false, progress_show: true, isChild: false, oldrate: "", @@ -608,6 +629,9 @@ import XmProjectGroupSelect from '../xmProjectGroup/XmProjectGroupSelect.vue'; menuDetailVisible:false, pickerOptions: util.pickerOptions(), gstcVisible:false, + menuStory:false,//故事查询 + menuGroupUser:false,//负责人查询 + menuExecutor:false,//执行人查询 groupUserSelectVisible:false,//选择负责人 showSkillSearchVisible:false,//按技能查询 tableHeight:500, @@ -615,7 +639,7 @@ import XmProjectGroupSelect from '../xmProjectGroup/XmProjectGroupSelect.vue'; } },//end data methods: { - + changeSelKey(index){ this.selkey = index; this.getXmTasks(); @@ -624,8 +648,8 @@ import XmProjectGroupSelect from '../xmProjectGroup/XmProjectGroupSelect.vue'; this.filters.taskType = index; this.getXmTasks(); }, - handleSizeChange(pageSize) { - this.pageInfo.pageSize=pageSize; + handleSizeChange(pageSize) { + this.pageInfo.pageSize=pageSize; this.getXmTasks(); }, handleCurrentChange(pageNum) { @@ -651,16 +675,16 @@ import XmProjectGroupSelect from '../xmProjectGroup/XmProjectGroupSelect.vue'; }else{ dir='desc'; } - - this.pageInfo.orderFields=[util.toLine(obj.prop)]; + + this.pageInfo.orderFields=[util.toLine(obj.prop)]; this.pageInfo.orderDirs=[dir]; } - + this.getXmTasks(); }, searchXmTasks(){ - this.pageInfo.count=true; + this.pageInfo.count=true; this.getXmTasks(); }, //获取列表 XmTask xm_task @@ -673,14 +697,14 @@ import XmProjectGroupSelect from '../xmProjectGroup/XmProjectGroupSelect.vue'; }; if(this.pageInfo.orderFields!=null && this.pageInfo.orderFields.length>0){ let orderBys=[]; - for(var i=0;i=0){ params.userid=this.userInfo.userid params.myExecuserStatus=this.selkey.substring("myExecuserStatus".length) - } + } this.load.list = true; if(this.filters.selProject){ params.projectId = this.filters.selProject.id; - } + } params.workexec="true"; if(this.projectPhase){{ params.projectPhaseId=this.projectPhase.id @@ -711,42 +735,53 @@ import XmProjectGroupSelect from '../xmProjectGroup/XmProjectGroupSelect.vue'; if(this.menuId){ params.menuId=this.menuId } + if(this.filters.menus && this.filters.menus.length==1){ + params.menuId=this.filters.menus[0].menuId + }else if(this.filters.menus && this.filters.menus.length>1){ + params.menus=this.filters.menus.map(i=>i.menus) + } if(this.filters.skillTags && this.filters.skillTags.length>0){ params.skillIds=this.filters.skillTags.map(i=>i.skillId) - } + } if(this.filters.key){ params.key='%'+this.filters.key+'%' } + if(this.filters.createUserid){ + params.createUserid=this.filters.createUserid + } + if(this.filters.executorUserid){ + params.executorUserid=this.filters.executorUserid + } getTask(params).then((res) => { var tips=res.data.tips; - if(tips.isOk){ + if(tips.isOk){ this.pageInfo.total = res.data.total; this.pageInfo.count=false; var xmTasks=res.data.data; - this.xmTasks=xmTasks; + 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.$message({ message: tips.msg, type: 'error' }); } this.load.list = false; }).catch( err => this.load.list = false ); }, - calcTaskStateByTime(startTime,endTime,row){ + calcTaskStateByTime(startTime,endTime,row){ var obj={ - type:'', + type:'', desc:'' } if(startTime==null || startTime=="" || endTime==null || endTime ==""){ obj={ - type:'info', + type:'info', desc:"未配置日期" - } + } return obj; } var curDate=new Date(); @@ -755,40 +790,40 @@ import XmProjectGroupSelect from '../xmProjectGroup/XmProjectGroupSelect.vue'; var rate=row.rate; var isOver=row.rate>=100; var days=this.getDaysBetween(curDate, start); - if(days<=0){ + if(days<=0){ obj={ - type:'info', + type:'info', desc:this.toFixed(this.getDaysBetween(start,curDate))+"天后开始" - } + } return obj; - }else if( this.getDaysBetween(curDate, start) > 0 && this.getDaysBetween(curDate, end) <= 0 ){ + }else if( this.getDaysBetween(curDate, start) > 0 && this.getDaysBetween(curDate, end) <= 0 ){ obj={ - type:'primary', + type:'primary', desc:this.toFixed(this.getDaysBetween(end, curDate))+"天后结束" - } + } return obj; - }else if( this.getDaysBetween(curDate, end) > 0 ){ + }else if( this.getDaysBetween(curDate, end) > 0 ){ if(!isOver){ obj={ - type:'danger', + type:'danger', desc:"逾期"+( this.toFixed(this.getDaysBetween(curDate, end)) )+"天" } }else{ obj={ - type:'success', + type:'success', desc:"完工"+( this.toFixed(this.getDaysBetween(curDate, end)) )+"天" - } + } } - + return obj; } }, /** * 计算两个日期之间的天数 * @param dateString1 开始日期 yyyy-MM-dd - * @param dateString2 结束日期 yyyy-MM-dd + * @param dateString2 结束日期 yyyy-MM-dd */ - getDaysBetween(startDate,endDate){ + getDaysBetween(startDate,endDate){ if (startDate==endDate){ return 0; } @@ -800,9 +835,9 @@ import XmProjectGroupSelect from '../xmProjectGroup/XmProjectGroupSelect.vue'; var isCreate=this.userInfo.userid==this.editForm.createUserid var isExec=this.userInfo.userid==this.editForm.executorUserid if( !isCreate && !isExec ){ - this.$message({ message: "你不是该任务的执行人、主负责人,不能更新进度", type: 'error' }); + this.$message({ message: "你不是该任务的执行人、主负责人,不能更新进度", type: 'error' }); return; - } + } if(rate){ this.editForm.rate=rate } @@ -813,7 +848,7 @@ import XmProjectGroupSelect from '../xmProjectGroup/XmProjectGroupSelect.vue'; parentTaskid: this.editForm.parentTaskid, } if(this.editForm.rate==0){ - this.$message({ message: "不允许更新为0", type: 'error' }); + this.$message({ message: "不允许更新为0", type: 'error' }); return; } this.load.edit = true; @@ -835,36 +870,36 @@ import XmProjectGroupSelect from '../xmProjectGroup/XmProjectGroupSelect.vue'; 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("只有项目经理、小组长可以操作"); + this.$message.error("只有项目经理、小组长可以操作"); return; } if(this.currentProjectPhase==null){ - this.$message({ message: "请先选择项目阶段计划", type: 'error' }); + this.$message({ message: "请先选择项目阶段计划", type: 'error' }); return false; } this.taskTemplateVisible=true; }, - showSubAdd(row) { - + showSubAdd(row) { + if( !this.roles.some(i=>i.roleid=='projectAdmin') && !this.roles.some(i=>i.roleid=='teamAdmin')){ - this.$message.error("只有项目经理、小组长可以操作"); + this.$message.error("只有项目经理、小组长可以操作"); return; } - this.parentTask=row; + this.parentTask=row; this.editForm=row; this.showAdd(); }, //显示新增界面 XmTask xm_task showAdd: function () { - + if( !this.roles.some(i=>i.roleid=='projectAdmin') && !this.roles.some(i=>i.roleid=='teamAdmin')){ - this.$message.error("只有项目经理、小组长可以操作"); + this.$message.error("只有项目经理、小组长可以操作"); return; } if(!this.currentProjectPhase){ - this.$message({ message: "请先选择项目阶段计划", type: 'error' }); + this.$message({ message: "请先选择项目阶段计划", type: 'error' }); return; } this.addFormVisible = true; @@ -881,47 +916,47 @@ import XmProjectGroupSelect from '../xmProjectGroup/XmProjectGroupSelect.vue'; //选择行xmTask selsChange: function (sels) { this.sels = sels; - }, + }, //删除xmTask - handleDel: function (row,index) { - + handleDel: function (row,index) { + if( !this.roles.some(i=>i.roleid=='projectAdmin') && !this.roles.some(i=>i.roleid=='teamAdmin')){ - this.$message.error("只有项目经理、小组长可以操作"); + this.$message.error("只有项目经理、小组长可以操作"); return; } this.$confirm('确认删除该记录吗?', '提示', { type: 'warning' - }).then(() => { + }).then(() => { this.load.del=true; let params = Object.assign({},row); delXmTask(params).then((res) => { this.load.del=false; var tips=res.data.tips; - if(tips.isOk){ + if(tips.isOk){ this.pageInfo.count=true; this.getXmTasks(); } - this.$message({ message: tips.msg, type: tips.isOk?'success':'error' }); + this.$message({ message: tips.msg, type: tips.isOk?'success':'error' }); }).catch( err => this.load.del=false ); }); }, //批量删除xmTask batchDel: function () { - + if( !this.roles.some(i=>i.roleid=='projectAdmin') && !this.roles.some(i=>i.roleid=='teamAdmin')){ - this.$message.error("只有项目经理、小组长可以操作"); + this.$message.error("只有项目经理、小组长可以操作"); return; } this.$confirm('确认删除选中记录吗?', '提示', { type: 'warning' - }).then(() => { + }).then(() => { this.load.del=true; batchDelXmTask(this.sels).then((res) => { this.load.del=false; var tips=res.data.tips; - if( tips.isOk ){ + if( tips.isOk ){ this.pageInfo.count=true; - this.getXmTasks(); + this.getXmTasks(); } this.$message({ message: tips.msg, type: tips.isOk?'success':'error'}); }).catch( err => this.load.del=false ); @@ -931,13 +966,13 @@ import XmProjectGroupSelect from '../xmProjectGroup/XmProjectGroupSelect.vue'; this.editForm=row; // this.$emit('row-click',row,);// @row-click="rowClick" }, - + showDrawer: function(row){ this.editForm=row; this.drawerVisible = !this.drawerVisible; // this.$emit('row-click',row,);// @row-click="rowClick" }, - + isEmpty(str) { return str == null || "" == str; }, @@ -947,31 +982,40 @@ import XmProjectGroupSelect from '../xmProjectGroup/XmProjectGroupSelect.vue'; this.execUserVisible = true; }, - showSkill(row){ + showSkill(row){ this.editForm=row; this.skillVisible = true; }, - showSkillSelect(){ - this.showSkillSearchVisible=true; + showSkillSelect(){ + this.showSkillSearchVisible=true; }, + showMenuStory(){ + this.menuStory=true; + }, + showMenuGroupUser(){ + this.menuGroupUser=true + }, + showMenuExecutor(){ + this.menuExecutor=true + }, skillTagClear(skill){ this.filters.skillTags=this.filters.skillTags.filter(i=>i.skillId!=skill.skillId) this.searchXmTasks(); }, showMenu:function(parentTask){ if(this.projectPhase==null){ - this.$message.error("请先选中阶段计划"); + this.$message.error("请先选中阶段计划"); return; } - + if( !this.roles.some(i=>i.roleid=='projectAdmin') && !this.roles.some(i=>i.roleid=='teamAdmin')){ - this.$message.error("只有项目经理、小组长可以操作"); + this.$message.error("只有项目经理、小组长可以操作"); return; } - this.parentTask=parentTask; + this.parentTask=parentTask; this.menuVisible=true; - }, + }, onSelectedMenus(menus){ if(menus==null || menus.length==0){ this.menuVisible=false; @@ -981,15 +1025,23 @@ import XmProjectGroupSelect from '../xmProjectGroup/XmProjectGroupSelect.vue'; menus2.forEach(i=>{ i.id=i.menuId i.parentTaskid=i.pmenuId - i.name=i.menuName + i.name=i.menuName }) this.onTaskTemplatesSelected(menus2); this.menuVisible=false; - + }, + onSelectedStory(menus){//根据故事查询 + if(menus==null || menus.length==0){ + this.menuStory=false; + return; + } + this.filters.menus=menus; + //this.pageInfo.count=true; + this.getXmTasks(); + this.menuStory=false; + }, onTaskTemplatesSelected(taskTemplates) { - - /////////////////// if(taskTemplates==null || taskTemplates.length==0){ this.taskTemplateVisible=false; this.parentTask=null @@ -1008,7 +1060,7 @@ import XmProjectGroupSelect from '../xmProjectGroup/XmProjectGroupSelect.vue'; }else { return true } - + }) if(this.parentTask!=null && this.parentTask!=undefined){ parents.forEach(i=>i.parentTaskid=this.parentTask.id); @@ -1020,15 +1072,15 @@ import XmProjectGroupSelect from '../xmProjectGroup/XmProjectGroupSelect.vue'; return true; }else{ return false; - } - }) + } + }) let translator = (parents, children) => { parents.forEach((parent) => { var newId=sn(); var myChildren=[]; if(children!=null && children.length>0){ myChildren=children.filter(current=>current.parentTaskid===parent.id); - } + } myChildren.forEach((current, index) => { current.parentTaskid=newId; var mySubChildren=children.filter(c=>c.parentTaskid===current.id); @@ -1046,18 +1098,18 @@ import XmProjectGroupSelect from '../xmProjectGroup/XmProjectGroupSelect.vue'; if(this.projectPhase==null){ i.projectPhaseId=this.parentTask.projectPhaseId - i.projectPhaseName=this.parentTask.projectPhaseName + i.projectPhaseName=this.parentTask.projectPhaseName i.sortLevel=i.sortLevel?i.sortLevel:this.parentTask.sortLevel i.taskType=i.taskType?i.taskType:this.parentTask.taskType i.taskClass=i.taskClass?i.taskClass:this.parentTask.taskClass - + }else{ i.projectPhaseId=this.projectPhase.id - i.projectPhaseName=this.projectPhase.phaseName + i.projectPhaseName=this.projectPhase.phaseName i.sortLevel=i.sortLevel?i.sortLevel:this.projectPhase.seqNo i.taskType=i.taskType?i.taskType:this.projectPhase.taskType - } + } i.budgetCost=0 i.budgetWorkload=80; i.level=i.level?i.level:'3' @@ -1071,7 +1123,7 @@ import XmProjectGroupSelect from '../xmProjectGroup/XmProjectGroupSelect.vue'; i.toTaskCenter=i.toTaskCenter?i.toTaskCenter:"1" i.settleSchemel=i.settleSchemel?i.settleSchemel:"quotePrice" i.createUserid=this.userInfo.userid - i.createUsername=this.userInfo.username + i.createUsername=this.userInfo.username const createTime = new Date(); var startTime=new Date(); const endTime=new Date(); @@ -1092,15 +1144,15 @@ import XmProjectGroupSelect from '../xmProjectGroup/XmProjectGroupSelect.vue'; this.$message({ message: tips.msg, type: tips.isOk?'success':'error'}); }).catch(e=>{this.taskTemplateVisible=false;}); }, - onTaskSkillsSearchSelected(skills){ + onTaskSkillsSearchSelected(skills){ this.showSkillSearchVisible=false; this.filters.skillTags=skills; this.searchXmTasks() }, - onTaskSkillsSelected(skills) { + onTaskSkillsSelected(skills) { skills.forEach(i=>{ i.taskId=this.editForm.id - i.taskName=this.editForm.name + i.taskName=this.editForm.name i.taskSkillId=i.skillId i.taskSkillName=i.skillName i.skillRemarks=i.skillRemarks @@ -1112,15 +1164,15 @@ import XmProjectGroupSelect from '../xmProjectGroup/XmProjectGroupSelect.vue'; this.skillVisible = false; this.getXmTasks(); } - this.$message({ message: tips.msg, type: tips.isOk?'success':'error' }); - }).catch( err => this.load.add=false); - + this.$message({ message: tips.msg, type: tips.isOk?'success':'error' }); + }).catch( err => this.load.add=false); + }, handleSelect(key, keyPath) { this.drawerkey = key; }, - translateDataToTree(data2) { + translateDataToTree(data2) { var data=JSON.parse(JSON.stringify(data2)); let parents = data.filter(value =>{ @@ -1139,15 +1191,15 @@ import XmProjectGroupSelect from '../xmProjectGroup/XmProjectGroupSelect.vue'; }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) => { @@ -1192,10 +1244,10 @@ import XmProjectGroupSelect from '../xmProjectGroup/XmProjectGroupSelect.vue'; } }else{ return value - } + } }, - - formatterOption: function(row,column,cellValue, index){ + + formatterOption: function(row,column,cellValue, index){ var columnName=column.property; var key=""; if(columnName=='settleSchemel'){ @@ -1223,7 +1275,7 @@ import XmProjectGroupSelect from '../xmProjectGroup/XmProjectGroupSelect.vue'; }else{ return parseFloat(floatValue).toFixed(0); } - + } }, decrease:function(){ @@ -1232,44 +1284,44 @@ import XmProjectGroupSelect from '../xmProjectGroup/XmProjectGroupSelect.vue'; }else{ this.editForm.rate=parseFloat(this.editForm.rate)-20 } - + }, increase:function(){ if(parseFloat(this.editForm.rate)+20 >100){ this.editForm.rate=100; }else{ this.editForm.rate=parseFloat(this.editForm.rate)+20 - } + } }, - + focusOrUnfocus:function(row){ if(this.selkey=="myFocus"){ delXmMyFocus({projectId:row.projectId,focusType:'task',taskId:row.id,taskName:row.name,userid:this.userInfo.userid,username:this.userInfo.username}).then(res=>{ var tips=res.data.tips; if(tips.isOk){ - this.getXmTasks(); - } - this.$message({ message: tips.msg, type: tips.isOk?'success':'error' }); + this.getXmTasks(); + } + this.$message({ message: tips.msg, type: tips.isOk?'success':'error' }); }) }else{ addXmMyFocus({projectId:row.projectId,projectName:row.projectName,focusType:'task',taskId:row.id,taskName:row.name,userid:this.userInfo.userid,username:this.userInfo.username}).then(res=>{ var tips=res.data.tips; - this.$message({ message: tips.msg, type: tips.isOk?'success':'error' }); + this.$message({ message: tips.msg, type: tips.isOk?'success':'error' }); }) } }, showBatchEdit:function(){ - + if( !this.roles.some(i=>i.roleid=='projectAdmin') && !this.roles.some(i=>i.roleid=='teamAdmin')){ - this.$message.error("只有项目经理、小组长可以操作"); - return; + this.$message.error("只有项目经理、小组长可以操作"); + return; } if(this.projectPhase==null ){ this.$message({ message:"请选择阶段计划再编辑", type: 'error'}); return ; } this.batchEditVisible=true - }, + }, fieldChange:function(row,fieldName, nextReplace){ if(nextReplace) { row.nextReplace = nextReplace; @@ -1277,29 +1329,29 @@ import XmProjectGroupSelect from '../xmProjectGroup/XmProjectGroupSelect.vue'; console.log('fieldChange--row.opType==', row.opType); if(fieldName=='startTime' || fieldName=='endTime'){ if(row.startTime && row.endTime){ - + var start=new Date(row.startTime); var end=new Date(row.endTime); var days=this.getDaysBetween(end,start) if(row.taskOut=='1' && this.projectPhase.phaseBudgetOutUserPrice && !row.budgetWorkload ){ row.budgetWorkload=parseFloat((days*8).toFixed(2)) - row.budgetCost=row.budgetWorkload*this.projectPhase.phaseBudgetOutUserPrice - }else if( row.taskOut!='1' && this.projectPhase.phaseBudgetInnerUserPrice && !row.budgetWorkload){ + row.budgetCost=row.budgetWorkload*this.projectPhase.phaseBudgetOutUserPrice + }else if( row.taskOut!='1' && this.projectPhase.phaseBudgetInnerUserPrice && !row.budgetWorkload){ row.budgetWorkload=parseFloat((days*8).toFixed(2)) - row.budgetCost=row.budgetWorkload*this.projectPhase.phaseBudgetInnerUserPrice + row.budgetCost=row.budgetWorkload*this.projectPhase.phaseBudgetInnerUserPrice } } } if(fieldName=='budgetWorkload' || fieldName=='taskOut'){ if(row.taskOut=='1' && this.projectPhase.phaseBudgetOutUserPrice ){ - row.budgetCost=row.budgetWorkload*this.projectPhase.phaseBudgetOutUserPrice + row.budgetCost=row.budgetWorkload*this.projectPhase.phaseBudgetOutUserPrice }else if( row.taskOut!='1' && this.projectPhase.phaseBudgetInnerUserPrice){ - row.budgetCost=row.budgetWorkload*this.projectPhase.phaseBudgetInnerUserPrice + row.budgetCost=row.budgetWorkload*this.projectPhase.phaseBudgetInnerUserPrice } } if(row.opType){ var index=this.valueChangeRows.findIndex(i=>i.id==row.id); - + if(index>=0){ this.valueChangeRows.splice(index,1); this.valueChangeRows.push(row) @@ -1310,7 +1362,7 @@ import XmProjectGroupSelect from '../xmProjectGroup/XmProjectGroupSelect.vue'; var oneRow=this.valueChangeRows.find(i=>i.id==row.id); if( oneRow ){ - if(oneRow.nextReplace){ + if(oneRow.nextReplace){ var index=this.valueChangeRows.findIndex(i=>i.id==row.id); this.valueChangeRows.splice(index,1); this.valueChangeRows.push(row) @@ -1320,7 +1372,7 @@ import XmProjectGroupSelect from '../xmProjectGroup/XmProjectGroupSelect.vue'; }else{ this.valueChangeRows.push(row) } - } + } }, getRowSum(row){ var budgetCost=this.getFloatValue(row.budgetCost); @@ -1332,11 +1384,11 @@ import XmProjectGroupSelect from '../xmProjectGroup/XmProjectGroupSelect.vue'; row.taskBudgetOutUserAt=0 row.taskBudgetInnerUserAt=budgetCost row.taskBudgetNouserAt=0; - } + } return budgetCost; }, getFloatValue(value,digit){ - + if(isNaN(value)){ return 0; } @@ -1349,11 +1401,10 @@ import XmProjectGroupSelect from '../xmProjectGroup/XmProjectGroupSelect.vue'; this.selectProjectVisible=true; }, onPorjectConfirm:function(project){ - this.filters.selProject=project this.selectProjectVisible=false; this.getXmTasks(); - }, - handleCommand(command) { + }, + handleCommand(command) { if(command.type=='showSubAdd'){ this.showSubAdd(command.data); }else if(command.type=='showTaskTemplate'){ @@ -1378,17 +1429,17 @@ import XmProjectGroupSelect from '../xmProjectGroup/XmProjectGroupSelect.vue'; }, toMenu(task){ this.editForm=task - if(task.menuId){ - this.menuDetailVisible=true + if(task.menuId){ + this.menuDetailVisible=true }else{ this.showEdit(task); } }, handlePopover:function(row,opType){ - + if( !this.roles.some(i=>i.roleid=='projectAdmin') && !this.roles.some(i=>i.roleid=='teamAdmin')){ - this.$message.error("只有项目经理、小组长可以操作"); - return; + this.$message.error("只有项目经理、小组长可以操作"); + return; } if('add'==opType){ var subRow=JSON.parse(JSON.stringify(this.addForm)); @@ -1402,18 +1453,18 @@ import XmProjectGroupSelect from '../xmProjectGroup/XmProjectGroupSelect.vue'; if(this.projectPhase==null){ subRow.projectPhaseId=this.parentTask.projectPhaseId - subRow.projectPhaseName=this.parentTask.projectPhaseName + subRow.projectPhaseName=this.parentTask.projectPhaseName subRow.sortLevel=subRow.sortLevel?subRow.sortLevel:this.parentTask.sortLevel subRow.taskType=subRow.taskType?subRow.taskType:this.parentTask.taskType subRow.taskClass=subRow.taskClass?subRow.taskClass:this.parentTask.taskClass - + }else{ subRow.projectPhaseId=this.projectPhase.id - subRow.projectPhaseName=this.projectPhase.phaseName + subRow.projectPhaseName=this.projectPhase.phaseName subRow.sortLevel=subRow.sortLevel?subRow.sortLevel:this.projectPhase.seqNo subRow.taskType=subRow.taskType?subRow.taskType:this.projectPhase.taskType - } + } subRow.budgetCost=0 subRow.budgetWorkload=80; subRow.level=subRow.level?subRow.level:'3' @@ -1427,7 +1478,7 @@ import XmProjectGroupSelect from '../xmProjectGroup/XmProjectGroupSelect.vue'; subRow.toTaskCenter=subRow.toTaskCenter?subRow.toTaskCenter:"1" subRow.settleSchemel=subRow.settleSchemel?subRow.settleSchemel:"quotePrice" subRow.createUserid=this.userInfo.userid - subRow.createUsername=this.userInfo.username + subRow.createUsername=this.userInfo.username const createTime = new Date(); var startTime=new Date(); const endTime=new Date(); @@ -1452,7 +1503,7 @@ import XmProjectGroupSelect from '../xmProjectGroup/XmProjectGroupSelect.vue'; if(row.children && row.children.length>0){ this.$message.error("请先删除子元素"); return; - }else{ + }else{ var index=this.xmTasks.findIndex(i=>i.id==row.id) var indexValueChanges=this.valueChangeRows.findIndex(i=>i.id==row.id) @@ -1463,22 +1514,22 @@ import XmProjectGroupSelect from '../xmProjectGroup/XmProjectGroupSelect.vue'; this.$message.error("只能删除未保存的行"); return; } - - } else if ('highestPmenuId' === opType) { + + } else if ('highestPmenuId' === opType) { if (row.id) { this.xmTasks.find(d => { - - if (d.id === row.id) { + + if (d.id === row.id) { d.parentTaskid = ''; - this.fieldChange(d,'seqNo'); + this.fieldChange(d,'seqNo'); } }); } - } + } }, - afterExecuserSubmit(){ + afterExecuserSubmit(){ - this.getXmTasks(); + this.getXmTasks(); }, toJoin(){ if(this.editForm.exeUserids && this.editForm.exeUserids.indexOf(this.userInfo.userid)>=0){ @@ -1494,7 +1545,7 @@ import XmProjectGroupSelect from '../xmProjectGroup/XmProjectGroupSelect.vue'; clearProject(){ this.filters.selProject=null; this.getXmTasks() - }, + }, showGroupUserSelect:function(task){ this.editForm=task; this.groupUserSelectVisible=true; @@ -1509,13 +1560,32 @@ import XmProjectGroupSelect from '../xmProjectGroup/XmProjectGroupSelect.vue'; setTaskCreateUser(this.editForm).then(res=>{ var tips = res.data.tips; if(tips.isOk){ - this.$message.success("设置成功"); + this.$message.success("设置成功"); this.groupUserSelectVisible=false; }else{ this.$message.error(tips.msg); } }) }, + //查询时选择责任人 + seleConfirm(groupUser){ + if(groupUser&&groupUser.length!==0){ + this.filters.createUserid=groupUser[0].userid; + }else{ + this.filters.createUserid=''; + } + this.searchXmTasks(); + this.menuGroupUser=false; + }, + seleExecutor(executor){ + if(executor&&executor.length!==0){ + this.filters.executorUserid=executor[0].userid; + }else{ + this.filters.executorUserid=''; + } + this.searchXmTasks(); + this.menuExecutor=false; + }, // 判断前后两个数据是否存在同一回路里面 // dict 为字典;sId拖拽到menuId; ePmeuId 是放置位置的祖先 menuId; judgePmenuId(dict, sId, ePmeuId) { @@ -1552,10 +1622,10 @@ import XmProjectGroupSelect from '../xmProjectGroup/XmProjectGroupSelect.vue'; }) } else { console.log('形成闭合回路--拖拽不更新'); - + } } - }, + }, batchEditBack:function(needReload){ if(needReload==true){ this.searchXmTasks(); @@ -1563,36 +1633,34 @@ import XmProjectGroupSelect from '../xmProjectGroup/XmProjectGroupSelect.vue'; this.batchEditVisible=false; } /**end 自定义函数请在上面加**/ - + },//end methods - components: { + components: { 'xm-task-add':XmTaskAdd, - 'xm-task-edit':XmTaskEdit, + 'xm-task-edit':XmTaskEdit, xmExecuserMng, xmSkillMng, skillMng, xmProjectPhaseMng, xmTaskTemplateMng, XmProjectList,xmExchangeMng,xmMenuSelect,XmMenuRichDetail,XmGantt,XmTaskMngBatch, -XmProjectGroupSelect +XmProjectGroupSelect //在下面添加其它组件 }, mounted() { - if(this.selProject){ this.filters.selProject=this.selProject } this.$nextTick(()=>{ - this.getXmTasks(); - this.tableHeight = window.innerHeight - 250; + this.tableHeight = window.innerHeight - 250; listOption([{categoryId:'all',itemCode:'planType'} ,{categoryId:'all',itemCode:'taskType'} ,{categoryId:'all',itemCode:'urgencyLevel'} ,{categoryId:'all',itemCode:'xmTaskSettleSchemel'} ,{categoryId:'all',itemCode:'priority'}]).then(res=>{ this.options=res.data.data; - }) - }); + }) + }); } } @@ -1655,7 +1723,7 @@ XmProjectGroupSelect .xm-task .progress-disable >>> .el-progress-bar__inner{ background-color: #ccc !important; } - + small{ font-size: 12px; @@ -1704,8 +1772,8 @@ small{ } \ No newline at end of file +