diff --git a/src/common/js/treeTool.js b/src/common/js/treeTool.js index 6d102b97..f71783b0 100644 --- a/src/common/js/treeTool.js +++ b/src/common/js/treeTool.js @@ -1,6 +1,19 @@ - - + export default { + + reloadChildren: function(table,maps, parentId,parentIdName,loadChildren) { + var lazyTreeNodeMap=table.store.states.lazyTreeNodeMap + if (maps.get(parentId)) { + const { tree, treeNode, resolve } = maps.get(parentId) + if (tree) { // 重新执行父节点加载子级操作 + loadChildren(tree, treeNode, resolve) + if (tree[parentIdName]) { // 若存在爷爷结点,则执行爷爷节点加载子级操作,防止最后一个子节点被删除后父节点不显示删除按钮 + const a = maps.get(tree[parentIdName]) + loadChildren(a.tree, a.treeNode, a.resolve) + } + } + } + }, /** * 将类表数据转换为如下树状结构的数据 * { diff --git a/src/views/xm/core/xmProjectPhase/XmProjectPhaseAdd.vue b/src/views/xm/core/xmProjectPhase/XmProjectPhaseAdd.vue index def588a9..7ee63e52 100644 --- a/src/views/xm/core/xmProjectPhase/XmProjectPhaseAdd.vue +++ b/src/views/xm/core/xmProjectPhase/XmProjectPhaseAdd.vue @@ -191,7 +191,7 @@ }, autoParams:function(autoParams){ this.fillphaseBudgetHoursToField() - this.fillphaseBudgetCostAtToField() + this.fillphaseBudgetAtToField() } }, data() { @@ -307,7 +307,7 @@ var tips=res.data.tips; if(tips.isOk){ //this.$refs['addForm'].resetFields(); - this.$emit('submit');// @submit="afteraddSubmit" + this.$emit('submit',res.data.data);// @submit="afteraddSubmit" } this.$message({showClose: true, message: tips.msg, type: tips.isOk?'success':'error' }); }).catch( err => this.load.add=false); @@ -355,7 +355,7 @@ this.addForm.phaseBudgetHours=this.toFixed(this.autoParams.phaseBudgetHours) }, - fillphaseBudgetCostAtToField:function(){ + fillphaseBudgetAtToField:function(){ this.addForm.phaseBudgetNouserAt=this.toFixed(this.autoParams.phaseBudgetNouserAt) this.addForm.phaseBudgetOutUserAt=this.toFixed(this.autoParams.phaseBudgetOutUserAt ) this.addForm.phaseBudgetInnerUserAt=this.toFixed(this.autoParams.phaseBudgetInnerUserAt ) diff --git a/src/views/xm/core/xmProjectPhase/XmProjectPhaseBatch.vue b/src/views/xm/core/xmProjectPhase/XmProjectPhaseBatch.vue index 93babbf7..243248fb 100644 --- a/src/views/xm/core/xmProjectPhase/XmProjectPhaseBatch.vue +++ b/src/views/xm/core/xmProjectPhase/XmProjectPhaseBatch.vue @@ -796,7 +796,7 @@ export default { i.projectId = this.selProject.id; i.projectName = this.selProject.name; i.branchId = this.selProject.branchId; - i.phaseBudgetCostAt = 0; + i.phaseBudgetAt = 0; i.phaseBudgetNouserAt = 0; i.phaseBudgetInnerUserAt = 0; i.phaseBudgetOutUserAt = 0; @@ -979,7 +979,7 @@ export default { let parents = data.filter((value) => { //如果我的上级为空,则我是最上级 var calcData = this.getRowSum(value); - value.phaseBudgetCostAt = calcData.phaseBudgetCostAt; + value.phaseBudgetAt = calcData.phaseBudgetAt; value.actCostAt = calcData.actCostAt; if ( value.parentPhaseId == "undefined" || @@ -1107,7 +1107,7 @@ export default { ) { row.actOutUserAt = 0; } - var phaseBudgetCostAt = + var phaseBudgetAt = parseFloat(row.phaseBudgetNouserAt) + parseFloat(row.phaseBudgetInnerUserAt) + parseFloat(row.phaseBudgetOutUserAt); @@ -1116,7 +1116,7 @@ export default { parseFloat(row.actInnerUserAt) + parseFloat(row.actOutUserAt); - return { phaseBudgetCostAt: phaseBudgetCostAt, actCostAt: actCostAt }; + return { phaseBudgetAt: phaseBudgetAt, actCostAt: actCostAt }; }, fieldChange: function (row, fieldName, nextReplace) { if (nextReplace) { @@ -1684,7 +1684,7 @@ export default { subRow.projectId = this.selProject.id; subRow.projectName = this.selProject.name; subRow.branchId = this.selProject.branchId; - subRow.phaseBudgetCostAt = 0; + subRow.phaseBudgetAt = 0; subRow.phaseBudgetNouserAt = 0; subRow.phaseBudgetInnerUserAt = 0; subRow.phaseBudgetOutUserAt = 0; diff --git a/src/views/xm/core/xmProjectPhase/XmProjectPhaseEdit.vue b/src/views/xm/core/xmProjectPhase/XmProjectPhaseEdit.vue index 058a6fef..52f9484d 100644 --- a/src/views/xm/core/xmProjectPhase/XmProjectPhaseEdit.vue +++ b/src/views/xm/core/xmProjectPhase/XmProjectPhaseEdit.vue @@ -199,7 +199,7 @@ }, autoParams:function(autoParams){ this.fillphaseBudgetHoursToField() - this.fillphaseBudgetCostAtToField() + this.fillphaseBudgetAtToField() } }, data() { @@ -318,7 +318,7 @@ var tips=res.data.tips; if(tips.isOk){ //this.$refs['editForm'].resetFields(); - this.$emit('submit');// @submit="aftereditSubmit" + this.$emit('submit',res.data.data);// @submit="aftereditSubmit" } this.$message({showClose: true, message: tips.msg, type: tips.isOk?'success':'error' }); }).catch( err => this.load.edit=false); @@ -366,7 +366,7 @@ this.editForm.phaseBudgetHours=this.toFixed(this.autoParams.phaseBudgetHours) }, - fillphaseBudgetCostAtToField:function(){ + fillphaseBudgetAtToField:function(){ this.editForm.phaseBudgetNouserAt=this.toFixed(this.autoParams.phaseBudgetNouserAt) this.editForm.phaseBudgetOutUserAt=this.toFixed(this.autoParams.phaseBudgetOutUserAt ) this.editForm.phaseBudgetInnerUserAt=this.toFixed(this.autoParams.phaseBudgetInnerUserAt ) diff --git a/src/views/xm/core/xmProjectPhase/XmProjectPhaseMng.vue b/src/views/xm/core/xmProjectPhase/XmProjectPhaseMng.vue index 1fa399fb..de668f7d 100644 --- a/src/views/xm/core/xmProjectPhase/XmProjectPhaseMng.vue +++ b/src/views/xm/core/xmProjectPhase/XmProjectPhaseMng.vue @@ -107,7 +107,7 @@ - + @@ -206,6 +206,7 @@