diff --git a/src/views/xm/core/xmProduct/XmProductTplMng.vue b/src/views/xm/core/xmProduct/XmProductTplMng.vue index 90f085c7..2a6c47b3 100644 --- a/src/views/xm/core/xmProduct/XmProductTplMng.vue +++ b/src/views/xm/core/xmProduct/XmProductTplMng.vue @@ -66,10 +66,12 @@ - {{scope.row.productName}} + + {{scope.row.productName}} + {{scope.row.productName}} - + 复制 @@ -128,7 +130,7 @@ export default { - props:['selProject','xmIteration','showType'], + props:['selProject','xmIteration','showType','isSelect'], computed: { ...mapGetters([ 'userInfo','roles' diff --git a/src/views/xm/core/xmProject/XmProjectTplMng.vue b/src/views/xm/core/xmProject/XmProjectTplMng.vue index 7ebf48e8..2495fde6 100644 --- a/src/views/xm/core/xmProject/XmProjectTplMng.vue +++ b/src/views/xm/core/xmProject/XmProjectTplMng.vue @@ -22,10 +22,11 @@ - {{scope.row.name}} + {{scope.row.name}} + {{scope.row.name}} - + 复制 删除 @@ -85,20 +86,14 @@ //import { listOption } from '@/api/mdp/meta/itemOption';//下拉框数据查询 import { listXmProject, editStatus, delXmProject, batchDelXmProject,copyTo,createProjectCode} from '@/api/xm/core/xmProject'; import { addXmMyFocus , delXmMyFocus } from '@/api/xm/core/xmMyFocus'; - import XmProjectEdit from './XmProjectEdit';//修改界面 - import { mapGetters } from 'vuex' - import xmProjectInfo from './XmProjectInfo'; + import { mapGetters } from 'vuex' - if(!Vue.component("xm-project-info")){ - - Vue.component('xm-project-info',xmProjectInfo) - Vue.use(xmProjectInfo); - } + export default { - props:['dataScope','showType'], + props:['dataScope','showType','isSelect'], computed: { ...mapGetters([ 'userInfo','roles' @@ -345,10 +340,9 @@ }).catch( err => this.load.del=false ); }); }, - rowClick: function(row, event, column){ - const that = this; - //that.intoInfo(row.id); - // this.$emit('row-click',row, event, column);// @row-click="rowClick" + rowClick: function(row, event, column){ + this.editForm=row + this.$emit('row-click',row, event, column);// @row-click="rowClick" }, onCopyToBtnClick(row){ this.xmProjectCopy.id=row.id; @@ -566,9 +560,7 @@ /**end 自定义函数请在上面加**/ },//end methods - components: { - 'xm-project-edit':XmProjectEdit, - //在下面添加其它组件 + components: { }, mounted() { if(this.$route.params){ diff --git a/src/views/xm/core/xmTask/XmTaskMng.vue b/src/views/xm/core/xmTask/XmTaskMng.vue index 6edfe9b4..58abf642 100644 --- a/src/views/xm/core/xmTask/XmTaskMng.vue +++ b/src/views/xm/core/xmTask/XmTaskMng.vue @@ -1856,21 +1856,23 @@ export default { translator(parents, children); taskTemplates2.forEach((i) => { - i.branchId = this.selProject.branchId; - i.projectId = this.selProject.id; - i.projectName = this.selProject.name; - if (this.projectPhase == null) { - i.phaseId = this.parentTask.phaseId; - 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.phaseId = this.projectPhase.id; - i.projectPhaseName = this.projectPhase.name; - i.sortLevel = i.sortLevel ? i.sortLevel : this.projectPhase.seqNo; - i.taskType = i.taskType ? i.taskType : this.projectPhase.taskType; - } + if(this.ptype==='1'){ + i.branchId=this.xmProduct.branchId; + i.ptype="1" + i.projectId=null; + i.projectName=null; + i.productId=this.xmProduct.id + i.menuId=null; + i.menuName=null; + }else if(this.ptype==='0'){ + i.branchId=this.filters.selProject.branchId; + i.ptype="0" + i.projectId=this.filters.selProject.id; + i.projectName=this.filters.selProject.name; + i.productId=null + i.menuId=null; + i.menuName=null; + } i.budgetCost = 0; i.budgetWorkload = 80; i.level = i.level ? i.level : "3"; diff --git a/src/views/xm/core/xmTaskTemplate/XmTaskTemplateMng.vue b/src/views/xm/core/xmTaskTemplate/XmTaskTemplateMng.vue index 8a90efc3..9bb5cf24 100644 --- a/src/views/xm/core/xmTaskTemplate/XmTaskTemplateMng.vue +++ b/src/views/xm/core/xmTaskTemplate/XmTaskTemplateMng.vue @@ -1,19 +1,28 @@ - - - - - - - + + + + + {{filters.project?filters.project.name:'选择项目模板'}} + + + + + {{filters.product?filters.product.productName:'选择产品模板'}} + 查询 - 选择模板 - 确认选择 + 确认选择 - + @@ -32,9 +41,7 @@ - - - + @@ -43,9 +50,9 @@ import treeTool from '@/common/js/treeTool';//全局公共库 //import Sticky from '@/components/Sticky' // 粘性header组件 //import { listOption } from '@/api/mdp/meta/itemOption';//下拉框数据查询 - import { listXmTask } from '@/api/xm/core/xmTask'; - import xmPhaseTemplateMng from '../xmPhaseTemplate/XmPhaseTemplateMng'; - + import { listXmTask } from '@/api/xm/core/xmTask'; + import XmProductTplMng from '../xmProduct/XmProductTplMng' + import XmProjectTplMng from '../xmProject/XmProjectTplMng' import { mapGetters } from 'vuex' export default { @@ -58,18 +65,15 @@ return treeTool.translateDataToTree(this.xmTaskTemplates,"parentTaskid","id"); }, }, - watch:{ - selProjectTemplate:function(selProjectTemplate){ - this.filters.projectTemplate=this.selProjectTemplate - this.getXmTaskTemplates(); - } + watch:{ }, - props:['selProjectTemplate','isSelect'], + props:['isSelect'], data() { return { filters: { key: '', - projectTemplate:null, + project:null, + product:null, }, xmTaskTemplates: [],//查询结果 pageInfo:{//分页数据 @@ -96,7 +100,6 @@ id:'',name:'',parentTaskid:'',parentTaskname:'',projectId:'',projectName:'',level:'',sortLevel:'',preTaskid:'',preTaskname:'',startTime:'',endTime:'',milestone:'',description:'',remarks:'',createUserid:'',createUsername:'',createTime:'',rate:'',budgetCost:'',budgetWorkload:'',taskState:'',taskType:'',taskClass:'',toTaskCenter:'',phaseId:'',projectPhaseName:'',taskSkillNames:'',taskSkillIds:'',taskOut:'',planType:'',settleSchemel:'',menuId:'',menuName:'' }, parentTaskTemplate:null, - projectPhaseTemplate:null, maxTableHeight:300, /**begin 自定义属性请在下面加 请加备注**/ @@ -144,23 +147,20 @@ orderBys.push(this.pageInfo.orderFields[i]+" "+this.pageInfo.orderDirs[i]) } params.orderBy= orderBys.join(",") + } + if(this.filters.project){ + params.ptype="0" + params.projectId=this.filters.project.id } - if(this.projectPhaseTemplate){ - params.phaseId=this.projectPhaseTemplate.id - } - if(this.filters.projectTemplate){ - params.projectId=this.filters.projectTemplate.id + if(this.filters.product){ + params.ptype="1" + params.productId=this.filters.product.id } - - if(!params.projectId){ - this.$notify({showClose: true, message: "选择一个模板项目", type: 'error' }); + if(!params.productId && !params.projectId){ + this.$notify({showClose: true, message: "选择一个模板", type: 'error' }); return; - } - if(!params.phaseId){ - this.$notify({showClose: true, message: "请在左边计划列表中选择一个计划", type: 'error' }); - return; - } + } params.isTpl="1" this.load.list = true; listXmTask(params).then((res) => { @@ -183,7 +183,7 @@ }, //显示新增界面 XmTaskTemplate xm_task_template showAdd: function () { - if(!this.filters.projectTemplate){ + if(!this.filters.project){ this.$notify.error("请选择模板") return; } @@ -212,71 +212,57 @@ //选择行xmTaskTemplate selsChange: function (sels) { this.sels = sels; - }, - //删除xmTaskTemplate - handleDel: function (row,index) { - this.$confirm('确认删除该记录吗?', '提示', { - type: 'warning' - }).then(() => { - this.load.del=true; - let params = { id: row.id }; - delXmTask(params).then((res) => { - this.load.del=false; - var tips=res.data.tips; - if(tips.isOk){ - this.pageInfo.count=true; - this.getXmTaskTemplates(); - } - this.$notify({showClose: true, message: tips.msg, type: tips.isOk?'success':'error' }); - }).catch( err => this.load.del=false ); - }); - }, - //批量删除xmTaskTemplate - batchDel: function () { - - this.$confirm('确认删除选中记录吗?', '提示', { - type: 'warning' - }).then(() => { - this.load.del=true; - batchDelXmTaskTemplate(this.sels).then((res) => { - this.load.del=false; - var tips=res.data.tips; - if( tips.isOk ){ - this.pageInfo.count=true; - this.getXmTaskTemplates(); - } - this.$notify({showClose: true, message: tips.msg, type: tips.isOk?'success':'error'}); - }).catch( err => this.load.del=false ); - }); - }, + }, rowClick: function(row, event, column){ this.$emit('row-click',row, event, column);// @row-click="rowClick" }, - selectedConfirm(){ + selectConfirm(){ this.$emit("select-confirm",this.sels) + }, + onProjectRowClick:function(project){ + this.filters.project=project + this.filters.product=null; + this.getXmTaskTemplates(); }, - - projectPhaseTemplateRowClick:function(projectPhaseTemplate){ - this.projectPhaseTemplate=projectPhaseTemplate + onProjectClearSelect(){ + this.filters.project=null; + this.getXmTaskTemplates(); + }, + onProductRowClick:function(product){ + this.filters.product=product + this.filters.project=null; this.getXmTaskTemplates(); }, - showProjectTemplate(){ - this.$refs.projectPhaseTemplate.showProjectTemplate(); - }, - onSelectedProjectTemplate:function(projectTemplate){ - this.filters.projectTemplate=projectTemplate + onProductClearSelect(){ + this.filters.product=null; this.getXmTaskTemplates(); - } + }, + loadXmTaskLazy(tree, treeNode, resolve) { + var params={parentTaskid:tree.id} + params.isTop="" + this.load.list = true; + var func=listXmTask + func(params).then(res=>{ + this.load.list = false + var tips = res.data.tips; + if(tips.isOk){ + resolve(res.data.data) + }else{ + resolve([]) + } + }).catch( err => this.load.list = false ); + + }, /**end 自定义函数请在上面加**/ },//end methods components: { - xmPhaseTemplateMng, + XmProjectTplMng,XmProductTplMng, //在下面添加其它组件 }, mounted() { if(this.selProjectTemplate){ - this.filters.projectTemplate=this.selProjectTemplate + this.filters.project=this.selProjectTemplate } this.$nextTick(() => {