|
|
@ -1,295 +1,188 @@ |
|
|
<template> |
|
|
<template> |
|
|
<section> |
|
|
<section> |
|
|
<el-row class="xm-task"> |
|
|
|
|
|
<el-menu active-text-color="#00abfc" :default-active="selkey" @select="changeSelKey" class="el-menu-demo" mode="horizontal"> |
|
|
|
|
|
<el-menu-item class="showall" index="all">全部</el-menu-item> |
|
|
|
|
|
<el-menu-item v-if="batchEditVisible==false" index="work">未完成</el-menu-item> |
|
|
|
|
|
<el-menu-item v-if="batchEditVisible==false" index="finish">已完成</el-menu-item> |
|
|
|
|
|
<el-menu-item v-if="batchEditVisible==false" index="myFocus">我关注</el-menu-item> |
|
|
|
|
|
<el-menu-item v-if="batchEditVisible==false" index="myExecuserStatus0">我排队</el-menu-item> |
|
|
|
|
|
<el-menu-item v-if="batchEditVisible==false" index="myExecuserStatus1">我执行</el-menu-item> |
|
|
|
|
|
<el-menu-item v-if="batchEditVisible==false" index="myExecuserStatus2">我提交</el-menu-item> |
|
|
|
|
|
<el-menu-item v-if="batchEditVisible==false" index="myExecuserStatus3">我的验收成功</el-menu-item> |
|
|
|
|
|
<el-menu-item v-if="batchEditVisible==false" index="myExecuserStatus4">我的验收失败</el-menu-item> |
|
|
|
|
|
<el-menu-item v-if="batchEditVisible==false" index="myExecuserStatus5">我的付款中</el-menu-item> |
|
|
|
|
|
<el-menu-item v-if="batchEditVisible==false" index="myExecuserStatus6">我的付款成功</el-menu-item> |
|
|
|
|
|
<el-menu-item v-if="batchEditVisible==false" index="myExecuserStatus7">我放弃的</el-menu-item> |
|
|
|
|
|
|
|
|
|
|
|
<div v-if="batchEditVisible!=true" style="line-height:50px;float:right;margin-right:10px;"> |
|
|
|
|
|
<el-button type="primary" v-if=" projectPhase!=null " @click="showBatchEdit" v-loading="load.edit">批量修改</el-button> |
|
|
|
|
|
<el-button v-if=" isTaskCenter!='1' && isMy!='1'" @click="showTaskTemplate" type="success">导入任务</el-button> |
|
|
|
|
|
<el-button v-if=" isTaskCenter!='1' && isMy!='1'" @click="showMenu" type="success">由故事创建任务</el-button> |
|
|
|
|
|
<el-button v-if=" isTaskCenter!='1' && isMy!='1'" @click="showAdd" type="primary" round>新建任务</el-button> |
|
|
|
|
|
</div> |
|
|
|
|
|
</el-menu> |
|
|
|
|
|
<el-row> |
|
|
|
|
|
</el-row> |
|
|
|
|
|
<el-menu v-if="batchEditVisible!=true" active-text-color="#00abfc" :default-active="filters.taskType" @select="changeTaskType" class="el-menu-demo" mode="horizontal"> |
|
|
|
|
|
<el-menu-item index="all">全部任务类型</el-menu-item> |
|
|
|
|
|
<el-menu-item v-for="(i,index) in options.taskType" :index="i.optionValue" :key="index">{{i.optionName}}</el-menu-item> |
|
|
|
|
|
<div style="line-height:50px;float:right;margin-right:10px;"> |
|
|
|
|
|
<el-checkbox v-model="gstcVisible" >甘特图</el-checkbox> |
|
|
|
|
|
<el-tag v-if=" !selProject && filters.selProject" :closable="!selProject" @click="showProjectList" @close="clearProject">项目:{{this.filters.selProject.name}}</el-tag> |
|
|
|
|
|
<el-tag v-if=" !selProject && !filters.selProject" @click="showProjectList" type="plian">未选项目,点我</el-tag> |
|
|
|
|
|
|
|
|
|
|
|
<el-input v-if="batchEditVisible==false" style="width:200px;" v-model="searchTask" placeholder="任务名称"></el-input> |
|
|
|
|
|
|
|
|
|
|
|
<el-button @click="searchXmTasks" type="primary">查询</el-button> |
|
|
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
</el-menu> |
|
|
|
|
|
<!-- @selection-change="selsChange" --> |
|
|
|
|
|
<el-menu v-if="batchEditVisible==true" active-text-color="#00abfc" :default-active="filters.taskType" @select="changeTaskType" class="el-menu-demo" mode="horizontal"> |
|
|
|
|
|
<el-menu-item index="all">全部任务类型</el-menu-item> |
|
|
|
|
|
<div style="line-height:50px;float:right;margin-right:10px;"> |
|
|
|
|
|
<el-button type="danger" @click="batchDel" v-loading="load.edit">批量删除</el-button> |
|
|
|
|
|
<el-button type="warning" @click="saveBatchEdit" v-loading="load.edit">批量保存</el-button> |
|
|
|
|
|
<el-button type="success" @click="handlePopover(null,'add')" >+任务</el-button> |
|
|
|
|
|
<el-button type="primary" @click="noBatchEdit" v-loading="load.edit">返回</el-button> |
|
|
|
|
|
</div> |
|
|
|
|
|
</el-menu> |
|
|
|
|
|
<el-row v-if="batchEditVisible==true"> |
|
|
|
|
|
<span style="margin-left:10px;font-size:14px;">阶段总预算:</span><el-tag type='success'> {{((projectPhase.phaseBudgetNouserAt+projectPhase.phaseBudgetInnerUserAt+projectPhase.phaseBudgetOutUserAt)/10000).toFixed(2)}}万,剩{{(taskBudgetData.surplusPhaseBudgetCostAt/10000).toFixed(2)}}万</el-tag> |
|
|
|
|
|
<span style="margin-left:10px;font-size:14px;">非人力总预算:</span><el-tag :type="taskBudgetData.surplusPhaseBudgetNouserAt>0?'warning':'danger'">{{(projectPhase.phaseBudgetNouserAt/10000).toFixed(2)}}万,剩{{(taskBudgetData.surplusPhaseBudgetNouserAt/10000).toFixed(2)}}万</el-tag> |
|
|
|
|
|
<span style="margin-left:10px;font-size:14px;">内部人力总预算:</span><el-tag :type="taskBudgetData.surplusPhaseBudgetInnerUserAt>0?'warning':'danger'">{{(projectPhase.phaseBudgetInnerUserAt/10000).toFixed(2)}}万,剩{{(taskBudgetData.surplusPhaseBudgetInnerUserAt/10000).toFixed(2)}}万</el-tag> |
|
|
|
|
|
<span style="margin-left:10px;font-size:14px;">外购人力总预算:</span><el-tag :type="taskBudgetData.surplusPhaseBudgetOutUserAt>0?'warning':'danger'">{{(projectPhase.phaseBudgetOutUserAt/10000).toFixed(2)}}万,剩{{(taskBudgetData.surplusPhaseBudgetOutUserAt/10000).toFixed(2)}}万</el-tag> |
|
|
|
|
|
</el-row> |
|
|
|
|
|
<el-row v-show="batchEditVisible==false"> |
|
|
|
|
|
<el-col :span="4"> |
|
|
|
|
|
<xm-project-phase-mng v-if="isTaskCenter!='1' && currentProject " :sel-project="currentProject" :simple="true" @row-click="projectPhaseRowClick" @clear-select="clearSelectPhase"></xm-project-phase-mng> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
<el-col :span="isTaskCenter=='1' ?24:20"> |
|
|
|
|
|
<el-table v-if="!gstcVisible" |
|
|
|
|
|
show-summary |
|
|
|
|
|
:data="tasksTreeData" |
|
|
|
|
|
@sort-change="sortChange" |
|
|
|
|
|
v-loading="load.list" |
|
|
|
|
|
@row-click="rowClick" |
|
|
|
|
|
@selection-change="selsChange" |
|
|
|
|
|
highlight-current-row |
|
|
|
|
|
stripe |
|
|
|
|
|
fit |
|
|
|
|
|
default-expand-all |
|
|
|
|
|
:tree-props="{children: 'children', hasChildren: 'hasChildren'}" |
|
|
|
|
|
row-key="id" |
|
|
|
|
|
> |
|
|
|
|
|
<el-table-column sortable prop="name" label="任务名称(点击详情)" min-width="240"> |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
<el-link @click.stop="showDrawer(scope.row)" type="primary">{{scope.row.sortLevel}} {{scope.row.name}}</el-link> |
|
|
|
|
|
|
|
|
<el-row v-show="batchEditVisible==false" > |
|
|
|
|
|
<el-col :span="4" class="app-container"> |
|
|
|
|
|
<xm-project-phase-mng v-if="isTaskCenter!='1' && currentProject " :sel-project="currentProject" :simple="true" @row-click="projectPhaseRowClick" @clear-select="clearSelectPhase"></xm-project-phase-mng> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
<el-col :span="20" class="app-container"> |
|
|
|
|
|
<el-row> |
|
|
|
|
|
<el-menu active-text-color="#00abfc" :default-active="selkey" @select="changeSelKey" class="el-menu-demo" mode="horizontal"> |
|
|
|
|
|
<el-menu-item class="showall" index="all">全部状态</el-menu-item> |
|
|
|
|
|
<el-menu-item index="work">未完成</el-menu-item> |
|
|
|
|
|
<el-menu-item index="finish">已完成</el-menu-item> |
|
|
|
|
|
<el-menu-item index="myFocus">我关注</el-menu-item> |
|
|
|
|
|
<el-menu-item index="myExecuserStatus0">我排队</el-menu-item> |
|
|
|
|
|
<el-menu-item index="myExecuserStatus1">我执行</el-menu-item> |
|
|
|
|
|
<el-menu-item index="myExecuserStatus2">我提交</el-menu-item> |
|
|
|
|
|
<el-menu-item index="myExecuserStatus3">我的验收成功</el-menu-item> |
|
|
|
|
|
<el-menu-item index="myExecuserStatus4">我的验收失败</el-menu-item> |
|
|
|
|
|
<el-menu-item index="myExecuserStatus5">我的付款中</el-menu-item> |
|
|
|
|
|
<el-menu-item index="myExecuserStatus6">我的付款成功</el-menu-item> |
|
|
|
|
|
<el-menu-item index="myExecuserStatus7">我放弃的</el-menu-item> |
|
|
|
|
|
</el-menu> |
|
|
|
|
|
</el-row> |
|
|
|
|
|
<el-row> |
|
|
|
|
|
<el-menu active-text-color="#00abfc" :default-active="filters.taskType" @select="changeTaskType" class="el-menu-demo" mode="horizontal"> |
|
|
|
|
|
<el-menu-item index="all">全部类型</el-menu-item> |
|
|
|
|
|
<el-menu-item v-for="(i,index) in options.taskType" :index="i.optionValue" :key="index">{{i.optionName}}</el-menu-item> |
|
|
|
|
|
<div style="line-height:50px;float:right;margin-right:10px;"> |
|
|
|
|
|
<el-checkbox v-model="gstcVisible" >甘特图</el-checkbox> |
|
|
|
|
|
<el-tag v-if=" !selProject && filters.selProject" :closable="!selProject" @click="showProjectList" @close="clearProject">项目:{{this.filters.selProject.name}}</el-tag> |
|
|
|
|
|
<el-tag v-if=" !selProject && !filters.selProject" @click="showProjectList" type="plian">未选项目,点我</el-tag> |
|
|
|
|
|
|
|
|
|
|
|
<el-input style="width:200px;" v-model="searchTask" placeholder="任务名称"></el-input> |
|
|
|
|
|
|
|
|
|
|
|
<el-button @click="searchXmTasks" type="primary">查询</el-button> |
|
|
|
|
|
<el-button v-if=" isTaskCenter!='1' && isMy!='1'" @click="showAdd" type="primary" round>新建任务</el-button> |
|
|
|
|
|
<el-popover |
|
|
|
|
|
placement="top-start" |
|
|
|
|
|
title="" |
|
|
|
|
|
width="200" |
|
|
|
|
|
trigger="hover" > |
|
|
|
|
|
<el-row> |
|
|
|
|
|
<el-col :span="24" style="padding-top:5px;"> |
|
|
|
|
|
<el-button type="primary" v-if=" isTaskCenter!='1' && isMy!='1'" @click="showBatchEdit" v-loading="load.edit">批量修改任务</el-button> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
<el-col :span="24" style="padding-top:5px;"> |
|
|
|
|
|
<el-button v-if=" isTaskCenter!='1' && isMy!='1'" @click="showTaskTemplate" type="success">从模板快速导入任务</el-button> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
<el-col :span="24" style="padding-top:5px;"> |
|
|
|
|
|
<el-button v-if=" isTaskCenter!='1' && isMy!='1'" @click="showMenu" type="success">由故事快速创建任务</el-button> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
</el-row> |
|
|
|
|
|
<el-button slot="reference" icon="el-icon-more" circle></el-button> |
|
|
|
|
|
</el-popover> |
|
|
|
|
|
</div> |
|
|
|
|
|
</el-menu> |
|
|
|
|
|
</el-row> |
|
|
|
|
|
<el-row> |
|
|
|
|
|
<el-table v-if="!gstcVisible" |
|
|
|
|
|
show-summary |
|
|
|
|
|
:data="tasksTreeData" |
|
|
|
|
|
@sort-change="sortChange" |
|
|
|
|
|
v-loading="load.list" |
|
|
|
|
|
@row-click="rowClick" |
|
|
|
|
|
@selection-change="selsChange" |
|
|
|
|
|
highlight-current-row |
|
|
|
|
|
stripe |
|
|
|
|
|
fit |
|
|
|
|
|
border |
|
|
|
|
|
default-expand-all |
|
|
|
|
|
:tree-props="{children: 'children', hasChildren: 'hasChildren'}" |
|
|
|
|
|
row-key="id" |
|
|
|
|
|
> |
|
|
|
|
|
<el-table-column sortable prop="name" label="任务名称(点击详情)" min-width="240"> |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
<el-link @click.stop="showDrawer(scope.row)" type="primary">{{scope.row.sortLevel}} {{scope.row.name}}</el-link> |
|
|
|
|
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column v-if="!filters.selProject" prop="projectName" label="项目" min-width="120"> |
|
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column v-if="!filters.selProject" prop="projectName" label="项目" min-width="120"> |
|
|
|
|
|
|
|
|
|
|
|
<template slot="header" slot-scope="scope"> |
|
|
|
|
|
项目<el-button @click="showProjectList" icon="el-icon-search" circle size="mini"></el-button> |
|
|
|
|
|
</template> |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
<el-link @click.stop="toMenu(scope.row)">{{scope.row.projectName}}</el-link> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column sortable prop="menuId" label="故事" min-width="120"> |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
<el-link @click.stop="toMenu(scope.row)">{{scope.row.menuName?scope.row.menuName:'去关联故事'}}</el-link> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column sortable label="预算" prop="budgetCost" width="120" > |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
<el-tag type= 'info' >{{parseFloat(scope.row.budgetCost/10000).toFixed(2)}}万,{{scope.row.budgetWorkload}}人时</el-tag> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column sortable label="执行人" prop="exeUserids" min-width="120" show-overflow-tooltip> |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
<el-link v-if="scope.row.exeUsernames!=null && scope.row.exeUsernames !='' " @click.stop="showExecusers(scope.row)">{{scope.row.exeUsernames}}</el-link> |
|
|
|
|
|
<el-link type="warning" v-if="scope.row.exeUsernames==null || scope.row.exeUsernames ==''" @click.stop="showExecusers(scope.row)" >去抢任务</el-link> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column sortable prop="rate" label="进度" width="100"> |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
<div> |
|
|
|
|
|
<el-tag style="border-radius:30px;"> {{ (scope.row.rate!=null?scope.row.rate:0)+'%'}} </el-tag> |
|
|
|
|
|
</div> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column sortable prop="startTime" label="任务起止时间" width="300"> |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
|
|
|
|
|
|
<div style="display:flex;align-items:center;"> |
|
|
|
|
|
|
|
|
<template slot="header" slot-scope="scope"> |
|
|
|
|
|
项目<el-button @click="showProjectList" icon="el-icon-search" circle size="mini"></el-button> |
|
|
|
|
|
</template> |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
<el-link @click.stop="toMenu(scope.row)">{{scope.row.projectName}}</el-link> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column sortable prop="menuId" label="故事" min-width="120"> |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
<el-link @click.stop="toMenu(scope.row)">{{scope.row.menuName?scope.row.menuName:'去关联故事'}}</el-link> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column sortable label="预算" prop="budgetCost" width="120" > |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
<el-tag type= 'info' >{{parseFloat(scope.row.budgetCost/10000).toFixed(2)}}万,{{scope.row.budgetWorkload}}人时</el-tag> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column sortable label="执行人" prop="exeUserids" min-width="120" show-overflow-tooltip> |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
<el-link v-if="scope.row.exeUsernames!=null && scope.row.exeUsernames !='' " @click.stop="showExecusers(scope.row)">{{scope.row.exeUsernames}}</el-link> |
|
|
|
|
|
<el-link type="warning" v-if="scope.row.exeUsernames==null || scope.row.exeUsernames ==''" @click.stop="showExecusers(scope.row)" >去抢任务</el-link> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column sortable prop="rate" label="进度" width="100"> |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
<div> |
|
|
<div> |
|
|
<div>{{getDateString(scope.row.startTime)}}~{{getDateString(scope.row.endTime)}}</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div style="margin-left: 5px;color: #d92b2f !important;color:#bb6f2a;"> |
|
|
|
|
|
{{calcTaskStateByTime(scope.row.startTime,scope.row.endTime)}} |
|
|
|
|
|
|
|
|
<el-tag style="border-radius:30px;"> {{ (scope.row.rate!=null?scope.row.rate:0)+'%'}} </el-tag> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<!-- |
|
|
|
|
|
<el-table-column label="外购" prop="taskOut" width="80"> |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
<el-checkbox :disabled="true" v-model="scope.row.taskOut" :false-label="0" :true-label="1" ></el-checkbox> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column label="结算方案" prop="settleSchemel" width="120" :formatter="formatterOption"> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
--> |
|
|
|
|
|
<el-table-column label="任务技能需求" prop="taskSkillNames" min-width="120" show-overflow-tooltip > |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
<el-link v-if="scope.row.taskSkillNames!=null && scope.row.taskSkillNames !='' " @click.stop="showSkill(scope.row)">{{scope.row.taskSkillNames}}</el-link> |
|
|
|
|
|
<el-link v-else @click.stop="showSkill(scope.row)" type="success" >去补充</el-link> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<!-- |
|
|
|
|
|
<el-table-column prop="description" label="任务描述" min-width="160" > |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
--> |
|
|
|
|
|
<el-table-column v-if=" isTaskCenter!='1'" header-align="center" fixed="right" label="操作" width="100"> |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
<!-- |
|
|
|
|
|
<el-button-group> |
|
|
|
|
|
<el-button @click.stop="showSubAdd(scope.row)" type="primary">+子任务</el-button> |
|
|
|
|
|
<el-button @click.stop="showEdit(scope.row,scope.$index)" type="primary">编辑</el-button> |
|
|
|
|
|
<el-button v-if="isEmpty(scope.row.children) " type="primary" @click.stop="handleDel(scope.row,scope.$index)">删除</el-button> |
|
|
|
|
|
</el-button-group> |
|
|
|
|
|
--> |
|
|
|
|
|
<el-dropdown @command="handleCommand"> |
|
|
|
|
|
<span class="el-dropdown-link"> |
|
|
|
|
|
更多<i class="el-icon-setting"></i> |
|
|
|
|
|
</span> |
|
|
|
|
|
<el-dropdown-menu slot="dropdown"> |
|
|
|
|
|
<el-dropdown-item :command="{type:'showSubAdd',data:scope.row}">+子任务</el-dropdown-item> |
|
|
|
|
|
<el-dropdown-item :command="{type:'showTaskTemplate',data:scope.row}">+从模板批量导入子任务</el-dropdown-item> |
|
|
|
|
|
<el-dropdown-item :command="{type:'showMenu',data:scope.row}">+由故事创建子任务</el-dropdown-item> |
|
|
|
|
|
|
|
|
|
|
|
<el-dropdown-item :command="{type:'showDrawer',data:scope.row}">明细</el-dropdown-item> |
|
|
|
|
|
<el-dropdown-item :command="{type:'showEdit',data:scope.row}">编辑</el-dropdown-item> |
|
|
|
|
|
<el-dropdown-item :command="{type:'showExecusers',data:scope.row}" >执行人管理</el-dropdown-item> |
|
|
|
|
|
<el-dropdown-item :command="{type:'showSkill',data:scope.row}">技能管理</el-dropdown-item> |
|
|
|
|
|
<el-dropdown-item v-if=" isTaskCenter=='1' && selkey=='myFocus'" :command="{type:'focusOrUnfocus',data:scope.row}">取关</el-dropdown-item> |
|
|
|
|
|
<el-dropdown-item v-if=" isTaskCenter=='1' && selkey!='myFocus'" :command="{type:'focusOrUnfocus',data:scope.row}">关注</el-dropdown-item> |
|
|
|
|
|
<el-dropdown-item :command="{type:'showDrawer',data:scope.row}">讨论</el-dropdown-item> |
|
|
|
|
|
<el-dropdown-item :command="{type:'showDrawer',data:scope.row}">日志</el-dropdown-item> |
|
|
|
|
|
<el-dropdown-item :command="{type:'handleDel',data:scope.row}" >删除</el-dropdown-item> |
|
|
|
|
|
</el-dropdown-menu> |
|
|
|
|
|
</el-dropdown> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
</el-table> |
|
|
|
|
|
<el-pagination v-if="!gstcVisible" 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;"></el-pagination> |
|
|
|
|
|
<xm-gantt v-if="gstcVisible" :tree-data="tasksTreeData" :project-phase="{startTime: currentProjectPhase.beginDate, endTime: currentProjectPhase.endDate}" :useRealTime="true"></xm-gantt> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
</el-row> |
|
|
|
|
|
<el-row v-show="batchEditVisible==true"> |
|
|
|
|
|
<el-col :span="24"> |
|
|
|
|
|
<!-- show-summary --> |
|
|
|
|
|
<el-table |
|
|
|
|
|
show-summary |
|
|
|
|
|
class="drag-table2" |
|
|
|
|
|
:data="tasksTreeData" |
|
|
|
|
|
@sort-change="sortChange" |
|
|
|
|
|
v-loading="load.list" |
|
|
|
|
|
@row-click="rowClick" |
|
|
|
|
|
@selection-change="selsChange" |
|
|
|
|
|
highlight-current-row |
|
|
|
|
|
stripe |
|
|
|
|
|
fit |
|
|
|
|
|
default-expand-all |
|
|
|
|
|
:tree-props="{children: 'children', hasChildren: 'hasChildren'}" |
|
|
|
|
|
row-key="id" |
|
|
|
|
|
> |
|
|
|
|
|
<el-table-column sortable type="selection" width="45"></el-table-column> |
|
|
|
|
|
<el-table-column sortable prop="sortLevel" label="序号" width="150"> |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
<div style="display:flex;width:100%;"> |
|
|
|
|
|
<el-popover |
|
|
|
|
|
placement="top" |
|
|
|
|
|
width="400" |
|
|
|
|
|
trigger="click"> |
|
|
|
|
|
<div style="text-align: center; margin: 0"> |
|
|
|
|
|
<div :ref="'task_'+scope.$index" :data-task-id="scope.row.id"></div> |
|
|
|
|
|
<el-button type="primary" size="mini" @click="handlePopover(scope.row,'highestPmenuId')">成为顶级节点</el-button> |
|
|
|
|
|
<el-button type="danger" size="mini" @click="handlePopover(scope.row,'delete')">删除当前行</el-button> |
|
|
|
|
|
<el-button type="success" size="mini" @click="handlePopover(scope.row,'addSub')">增加子行</el-button> |
|
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column sortable prop="startTime" label="任务起止时间" width="300"> |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
|
|
|
|
|
|
<div style="display:flex;align-items:center;"> |
|
|
|
|
|
<div> |
|
|
|
|
|
<div>{{getDateString(scope.row.startTime)}}~{{getDateString(scope.row.endTime)}}</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div style="margin-left: 5px;color: #d92b2f !important;color:#bb6f2a;"> |
|
|
|
|
|
{{calcTaskStateByTime(scope.row.startTime,scope.row.endTime)}} |
|
|
</div> |
|
|
</div> |
|
|
<el-button slot="reference" :type="scope.row.opType?'success':'plain'" size="mini" icon="el-icon-edit" circle></el-button> |
|
|
|
|
|
</el-popover> |
|
|
|
|
|
<el-input style="width:100%;" v-model="scope.row.sortLevel" @change="fieldChange(scope.row,'sortLevel')"></el-input> |
|
|
|
|
|
</div> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<!-- <el-table-column sortable width="40" type="selection"></el-table-column> --> |
|
|
|
|
|
<el-table-column prop="name" label="任务名称" min-width="150"> |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
<el-input v-model="scope.row.name" @change="fieldChange(scope.row,'name')"></el-input> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column prop="startTime" label="任务起止时间" width="160"> |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
<div> |
|
|
|
|
|
<el-date-picker style="width:100%;" |
|
|
|
|
|
v-model="scope.row.startTime" |
|
|
|
|
|
align="right" |
|
|
|
|
|
type="date" |
|
|
|
|
|
value-format="yyyy-MM-dd HH:mm:ss" |
|
|
|
|
|
format="yyyy-MM-dd" |
|
|
|
|
|
placeholder="选择日期" |
|
|
|
|
|
:picker-options="pickerOptions" @change="fieldChange(scope.row,'startTime')"> |
|
|
|
|
|
</el-date-picker> |
|
|
|
|
|
<el-date-picker style="width:100%;" |
|
|
|
|
|
v-model="scope.row.endTime" |
|
|
|
|
|
align="right" |
|
|
|
|
|
type="date" |
|
|
|
|
|
value-format="yyyy-MM-dd HH:mm:ss" |
|
|
|
|
|
format="yyyy-MM-dd" |
|
|
|
|
|
placeholder="选择日期" |
|
|
|
|
|
:picker-options="pickerOptions" @change="fieldChange(scope.row,'endTime')"> |
|
|
|
|
|
</el-date-picker> |
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column label="预计工作量" prop="budgetWorkload" width="140" > |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
<el-input v-model="scope.row.budgetWorkload" type="number" ::precision="2" @change="fieldChange(scope.row,'budgetWorkload')"></el-input> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column label="预算金额.元" prop="budgetCost" width="140" > |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
<el-input v-model="scope.row.budgetCost" type="number" ::precision="2" @change="fieldChange(scope.row,'budgetCost')"></el-input> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column prop="rate" label="进度" width="100"> |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
<el-input type="number" :precision="0" v-model="scope.row.rate" min="0" max="100" @change="fieldChange(scope.row,'rate')"></el-input> |
|
|
|
|
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column label="外购" prop="taskOut" width="80"> |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
<el-checkbox v-model="scope.row.taskOut" false-label="0" true-label="1" @change="fieldChange(scope.row,'taskOut')"></el-checkbox> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column label="结算方案" prop="settleSchemel" width="160"> |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
<el-select v-model=" scope.row.settleSchemel" @change="fieldChange(scope.row,'settleSchemel')"> |
|
|
|
|
|
<el-option v-for="i in options.xmTaskSettleSchemel" :label="i.optionName" :key="i.optionValue" :value="i.optionValue"></el-option> |
|
|
|
|
|
</el-select> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column prop="description" label="任务描述" min-width="150"> |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
<el-input type="textarea" v-model="scope.row.description" @change="fieldChange(scope.row,'description')"></el-input> |
|
|
|
|
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
</el-table> |
|
|
|
|
|
<el-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;"></el-pagination> |
|
|
|
|
|
|
|
|
|
|
|
</el-col> |
|
|
|
|
|
</el-row> |
|
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<!-- |
|
|
|
|
|
<el-table-column label="外购" prop="taskOut" width="80"> |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
<el-checkbox :disabled="true" v-model="scope.row.taskOut" :false-label="0" :true-label="1" ></el-checkbox> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column label="结算方案" prop="settleSchemel" width="120" :formatter="formatterOption"> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
--> |
|
|
|
|
|
<el-table-column label="任务技能需求" prop="taskSkillNames" min-width="120" show-overflow-tooltip > |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
<el-link v-if="scope.row.taskSkillNames!=null && scope.row.taskSkillNames !='' " @click.stop="showSkill(scope.row)">{{scope.row.taskSkillNames}}</el-link> |
|
|
|
|
|
<el-link v-else @click.stop="showSkill(scope.row)" type="success" >去补充</el-link> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<!-- |
|
|
|
|
|
<el-table-column prop="description" label="任务描述" min-width="160" > |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
--> |
|
|
|
|
|
<el-table-column v-if=" isTaskCenter!='1'" header-align="center" fixed="right" label="操作" width="100"> |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
<!-- |
|
|
|
|
|
<el-button-group> |
|
|
|
|
|
<el-button @click.stop="showSubAdd(scope.row)" type="primary">+子任务</el-button> |
|
|
|
|
|
<el-button @click.stop="showEdit(scope.row,scope.$index)" type="primary">编辑</el-button> |
|
|
|
|
|
<el-button v-if="isEmpty(scope.row.children) " type="primary" @click.stop="handleDel(scope.row,scope.$index)">删除</el-button> |
|
|
|
|
|
</el-button-group> |
|
|
|
|
|
--> |
|
|
|
|
|
<el-dropdown @command="handleCommand"> |
|
|
|
|
|
<span class="el-dropdown-link"> |
|
|
|
|
|
更多<i class="el-icon-setting"></i> |
|
|
|
|
|
</span> |
|
|
|
|
|
<el-dropdown-menu slot="dropdown"> |
|
|
|
|
|
<el-dropdown-item :command="{type:'showSubAdd',data:scope.row}">+子任务</el-dropdown-item> |
|
|
|
|
|
<el-dropdown-item :command="{type:'showTaskTemplate',data:scope.row}">+从模板批量导入子任务</el-dropdown-item> |
|
|
|
|
|
<el-dropdown-item :command="{type:'showMenu',data:scope.row}">+由故事创建子任务</el-dropdown-item> |
|
|
|
|
|
|
|
|
|
|
|
<el-dropdown-item :command="{type:'showDrawer',data:scope.row}">明细</el-dropdown-item> |
|
|
|
|
|
<el-dropdown-item :command="{type:'showEdit',data:scope.row}">编辑</el-dropdown-item> |
|
|
|
|
|
<el-dropdown-item :command="{type:'showExecusers',data:scope.row}" >执行人管理</el-dropdown-item> |
|
|
|
|
|
<el-dropdown-item :command="{type:'showSkill',data:scope.row}">技能管理</el-dropdown-item> |
|
|
|
|
|
<el-dropdown-item v-if=" isTaskCenter=='1' && selkey=='myFocus'" :command="{type:'focusOrUnfocus',data:scope.row}">取关</el-dropdown-item> |
|
|
|
|
|
<el-dropdown-item v-if=" isTaskCenter=='1' && selkey!='myFocus'" :command="{type:'focusOrUnfocus',data:scope.row}">关注</el-dropdown-item> |
|
|
|
|
|
<el-dropdown-item :command="{type:'showDrawer',data:scope.row}">讨论</el-dropdown-item> |
|
|
|
|
|
<el-dropdown-item :command="{type:'showDrawer',data:scope.row}">日志</el-dropdown-item> |
|
|
|
|
|
<el-dropdown-item :command="{type:'handleDel',data:scope.row}" >删除</el-dropdown-item> |
|
|
|
|
|
</el-dropdown-menu> |
|
|
|
|
|
</el-dropdown> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
</el-table> |
|
|
|
|
|
<el-pagination v-if="!gstcVisible" 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;"></el-pagination> |
|
|
|
|
|
<xm-gantt v-if="gstcVisible" :tree-data="tasksTreeData" :project-phase="{startTime: currentProjectPhase.beginDate, endTime: currentProjectPhase.endDate}" :useRealTime="true"></xm-gantt> |
|
|
|
|
|
|
|
|
|
|
|
</el-row> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
</el-row> |
|
|
|
|
|
<el-row v-show="batchEditVisible" > |
|
|
|
|
|
<xm-task-mng-batch :sel-project="selProject" :sel-project-phase="currentProjectPhase" :visible="batchEditVisible" @back="batchEditBack"></xm-task-mng-batch> |
|
|
</el-row> |
|
|
</el-row> |
|
|
|
|
|
|
|
|
<el-dialog |
|
|
<el-dialog |
|
|
v-if="drawerVisible == true" |
|
|
v-if="drawerVisible == true" |
|
|
width="70%" |
|
|
width="70%" |
|
|
@ -443,6 +336,7 @@ |
|
|
import { getTask ,listXmTask,editXmTask,editRate, delXmTask, batchDelXmTask,batchImportTaskFromTemplate,batchSaveBudget } from '@/api/xm/core/xmTask'; |
|
|
import { getTask ,listXmTask,editXmTask,editRate, delXmTask, batchDelXmTask,batchImportTaskFromTemplate,batchSaveBudget } from '@/api/xm/core/xmTask'; |
|
|
import XmTaskAdd from './XmTaskAdd';//新增界面 |
|
|
import XmTaskAdd from './XmTaskAdd';//新增界面 |
|
|
import XmTaskEdit from './XmTaskEdit';//修改界面 |
|
|
import XmTaskEdit from './XmTaskEdit';//修改界面 |
|
|
|
|
|
import XmTaskMngBatch from './XmTaskMngBatch';//修改界面 |
|
|
import { mapGetters } from 'vuex'; |
|
|
import { mapGetters } from 'vuex'; |
|
|
import headEditor from '../components/headEditor'; |
|
|
import headEditor from '../components/headEditor'; |
|
|
import xmExecuserMng from '../xmTaskExecuser/XmTaskExecuserMng'; |
|
|
import xmExecuserMng from '../xmTaskExecuser/XmTaskExecuserMng'; |
|
|
@ -461,7 +355,7 @@ |
|
|
|
|
|
|
|
|
import XmMenuRichDetail from '../xmMenu/XmMenuRichDetail'; |
|
|
import XmMenuRichDetail from '../xmMenu/XmMenuRichDetail'; |
|
|
|
|
|
|
|
|
import XmGantt from '../components/xm-gantt'; |
|
|
|
|
|
|
|
|
import XmGantt from '../components/xm-gantt'; |
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
|
computed: { |
|
|
computed: { |
|
|
@ -527,21 +421,18 @@ |
|
|
return len; |
|
|
return len; |
|
|
}, |
|
|
}, |
|
|
tasksTreeData() { |
|
|
tasksTreeData() { |
|
|
let xmTasks = JSON.parse(JSON.stringify(this.xmTasks || [])); |
|
|
|
|
|
if (this.valueChangeRows && this.valueChangeRows.length) { |
|
|
|
|
|
this.valueChangeRows.forEach(c => { |
|
|
|
|
|
var index = xmTasks.findIndex(i=>i.id==c.id); |
|
|
|
|
|
const oldRow = JSON.parse(JSON.stringify(xmTasks[index])); |
|
|
|
|
|
xmTasks.splice(index,1); |
|
|
|
|
|
c.parentTaskid = oldRow.parentTaskid; |
|
|
|
|
|
xmTasks.push(c); |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const tasksTreeData = this.translateDataToTree(xmTasks); |
|
|
|
|
|
if (this.batchEditVisible) { |
|
|
|
|
|
this.rowDrop(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
let xmTasks = JSON.parse(JSON.stringify(this.xmTasks || [])); |
|
|
|
|
|
if (this.valueChangeRows && this.valueChangeRows.length) { |
|
|
|
|
|
this.valueChangeRows.forEach(c => { |
|
|
|
|
|
var index = xmTasks.findIndex(i=>i.id==c.id); |
|
|
|
|
|
const oldRow = JSON.parse(JSON.stringify(xmTasks[index])); |
|
|
|
|
|
xmTasks.splice(index,1); |
|
|
|
|
|
c.parentTaskid = oldRow.parentTaskid; |
|
|
|
|
|
xmTasks.push(c); |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const tasksTreeData = this.translateDataToTree(xmTasks); |
|
|
|
|
|
|
|
|
return tasksTreeData; |
|
|
return tasksTreeData; |
|
|
}, |
|
|
}, |
|
|
@ -1292,57 +1183,12 @@ |
|
|
return ; |
|
|
return ; |
|
|
} |
|
|
} |
|
|
this.batchEditVisible=true |
|
|
this.batchEditVisible=true |
|
|
}, |
|
|
|
|
|
saveBatchEdit:function(){ |
|
|
|
|
|
if( !this.roles.some(i=>i.roleid=='projectAdmin') && !this.roles.some(i=>i.roleid=='teamAdmin')){ |
|
|
|
|
|
this.$message.error("只有项目经理、小组长可以操作"); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
console.log(JSON.stringify(this.taskBudgetData)) |
|
|
|
|
|
if(this.valueChangeRows.length==0){ |
|
|
|
|
|
this.$message({ message:"没有改变任何数据,无需保存", type: 'success'}); |
|
|
|
|
|
return; |
|
|
|
|
|
}else { |
|
|
|
|
|
if(this.taskBudgetData.surplusPhaseBudgetInnerUserAt<0){ |
|
|
|
|
|
this.$message({ message:"内部人力预算不足,请调整", type: 'error'}); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
if(this.taskBudgetData.surplusPhaseBudgetOutUserAt<0){ |
|
|
|
|
|
this.$message({ message:"外购人力预算不足,请调整", type: 'error'}); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
if(this.taskBudgetData.surplusPhaseBudgetNouserAt<0){ |
|
|
|
|
|
this.$message({ message:"非人力预算不足请调整",type: 'error'}); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.load.edit=true; |
|
|
|
|
|
batchSaveBudget(this.valueChangeRows).then(res=>{ |
|
|
|
|
|
this.load.edit=false; |
|
|
|
|
|
var tips =res.data.tips; |
|
|
|
|
|
if(tips.isOk){ |
|
|
|
|
|
this.valueChangeRows=[] |
|
|
|
|
|
this.getXmTasks(); |
|
|
|
|
|
} |
|
|
|
|
|
this.$message({ message: tips.msg, type: tips.isOk?'success':'error'}); |
|
|
|
|
|
|
|
|
|
|
|
}).catch(e=>this.load.edit=false); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
noBatchEdit(){ |
|
|
|
|
|
this.batchEditVisible=false; |
|
|
|
|
|
if(this.valueChangeRows.length>0){ |
|
|
|
|
|
this.valueChangeRows=[]; |
|
|
|
|
|
this.getXmTasks() |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
}, |
|
|
fieldChange:function(row,fieldName, nextReplace){ |
|
|
fieldChange:function(row,fieldName, nextReplace){ |
|
|
if(nextReplace) { |
|
|
|
|
|
row.nextReplace = nextReplace; |
|
|
|
|
|
} |
|
|
|
|
|
console.log('fieldChange--row.opType==', row.opType); |
|
|
|
|
|
|
|
|
if(nextReplace) { |
|
|
|
|
|
row.nextReplace = nextReplace; |
|
|
|
|
|
} |
|
|
|
|
|
console.log('fieldChange--row.opType==', row.opType); |
|
|
if(fieldName=='startTime' || fieldName=='endTime'){ |
|
|
if(fieldName=='startTime' || fieldName=='endTime'){ |
|
|
if(row.startTime && row.endTime){ |
|
|
if(row.startTime && row.endTime){ |
|
|
|
|
|
|
|
|
@ -1562,148 +1408,7 @@ |
|
|
clearProject(){ |
|
|
clearProject(){ |
|
|
this.filters.selProject=null; |
|
|
this.filters.selProject=null; |
|
|
this.getXmTasks() |
|
|
this.getXmTasks() |
|
|
}, |
|
|
|
|
|
// 行拖拽 |
|
|
|
|
|
rowDrop() { |
|
|
|
|
|
console.log('rowDrop==='); |
|
|
|
|
|
|
|
|
|
|
|
const _this = this |
|
|
|
|
|
// 被拖动的元素的索引 |
|
|
|
|
|
let dragged = null; |
|
|
|
|
|
// 被拖动的元素的索引 |
|
|
|
|
|
let draggedIndex = -1; |
|
|
|
|
|
|
|
|
|
|
|
// 目标元素 |
|
|
|
|
|
let target = document.querySelector('.drag-table2 .el-table__body-wrapper .el-table__body tbody'); |
|
|
|
|
|
console.log('rowDrop--target==', target); |
|
|
|
|
|
|
|
|
|
|
|
let rows = 0;//行数 |
|
|
|
|
|
setTimeout(function () { |
|
|
|
|
|
rows = target.childElementCount |
|
|
|
|
|
console.log('rowDrop--rows==', rows); |
|
|
|
|
|
|
|
|
|
|
|
for (let i = 0; i < target.childElementCount; i++) { |
|
|
|
|
|
const child = target.children[i] |
|
|
|
|
|
child.draggable = true |
|
|
|
|
|
// child.style.cursor = 'copy' |
|
|
|
|
|
child.ondragstart = function(e){ |
|
|
|
|
|
console.log('开始--ondragstart--e==', e); |
|
|
|
|
|
|
|
|
|
|
|
dragged = e.path[0] |
|
|
|
|
|
draggedIndex = e.path[0].rowIndex |
|
|
|
|
|
console.log('child'+i+'开始拖拽'+draggedIndex); |
|
|
|
|
|
_this.cellMouseIndex = -1 |
|
|
|
|
|
dragged.style.cursor = 'grabbing' |
|
|
|
|
|
} |
|
|
|
|
|
child.ondragend = function(){ |
|
|
|
|
|
console.log('child'+i+'拖拽结束'); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
},0) |
|
|
|
|
|
|
|
|
|
|
|
// 被拖动的元素正在那个容器里 |
|
|
|
|
|
let dragIndex = -1 |
|
|
|
|
|
|
|
|
|
|
|
target.ondragenter = function(e){ |
|
|
|
|
|
clearTimeout(loop) |
|
|
|
|
|
|
|
|
|
|
|
// 由于被拖动的元素 经过tbody中的每一元素都会触发该事件, 但是我们只需要它正在那一行上就行了 |
|
|
|
|
|
if(e.path[0].nodeName === 'TD'){ |
|
|
|
|
|
// throughRow 表示被拖动的元素正在哪一行上 |
|
|
|
|
|
const throughRow = e.path.find(path => { |
|
|
|
|
|
if(path.className.split(' ').includes('el-table__row')){ |
|
|
|
|
|
return path |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
if(dragIndex !== throughRow.rowIndex){ |
|
|
|
|
|
if(dragIndex > -1){ |
|
|
|
|
|
// 清除上次进入的容器的状态 |
|
|
|
|
|
const last = target.children[dragIndex]; |
|
|
|
|
|
clearClass(last) |
|
|
|
|
|
} |
|
|
|
|
|
// console.log('拖动进入目标元素'+selectRow.rowIndex); |
|
|
|
|
|
// 不是自己或未文件夹时才改变状态 |
|
|
|
|
|
if(draggedIndex !== throughRow.rowIndex ){ |
|
|
|
|
|
// 改变本次进入的容器的状态 |
|
|
|
|
|
dragged.style.cursor = 'copy' |
|
|
|
|
|
throughRow.style.height = 60+'px' |
|
|
|
|
|
throughRow.style.backgroundColor = '#e9fdcf' |
|
|
|
|
|
} |
|
|
|
|
|
dragIndex = throughRow.rowIndex |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
leaveIndex = -1 |
|
|
|
|
|
} |
|
|
|
|
|
target.ondragover = function(e){ |
|
|
|
|
|
// console.log('目标元素中拖拽...'); |
|
|
|
|
|
e.preventDefault(); |
|
|
|
|
|
leaveIndex = -1 |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
let loop = null |
|
|
|
|
|
let leaveIndex = -1 // 是否拖出了整个table, -1表示还在table内 |
|
|
|
|
|
|
|
|
|
|
|
target.ondragleave = function(e){ |
|
|
|
|
|
console.log('ondragleave--e==', e); |
|
|
|
|
|
|
|
|
|
|
|
clearTimeout(loop) |
|
|
|
|
|
|
|
|
|
|
|
if(e.path[0].nodeName){ |
|
|
|
|
|
const throughRow = e.path.find(path => { |
|
|
|
|
|
if(path.className.split(' ').includes('el-table__row')){ |
|
|
|
|
|
return path; |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
if(throughRow && dragIndex !== throughRow.rowIndex){ |
|
|
|
|
|
// console.log('拖动离开目标元素'+selectRow.rowIndex); |
|
|
|
|
|
// selectRow.style.height = 'unset' |
|
|
|
|
|
// selectRow.style.backgroundColor = '#fff' |
|
|
|
|
|
// dragIndex = selectRow.rowIndex |
|
|
|
|
|
} |
|
|
|
|
|
if(throughRow.rowIndex === 0 || throughRow.rowIndex === rows-1){ |
|
|
|
|
|
// 离开第一行或最后一行 |
|
|
|
|
|
leaveIndex = throughRow.rowIndex |
|
|
|
|
|
loop = setTimeout(function () { |
|
|
|
|
|
if(leaveIndex > -1){ |
|
|
|
|
|
console.log("离开了",leaveIndex) |
|
|
|
|
|
const leave = target.children[leaveIndex]; |
|
|
|
|
|
clearClass(leave) |
|
|
|
|
|
dragIndex = -1 |
|
|
|
|
|
} |
|
|
|
|
|
},100) |
|
|
|
|
|
}`` |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
target.ondrop = function(){ |
|
|
|
|
|
console.log('ondrop--放下了'+draggedIndex); |
|
|
|
|
|
// 清除上次进入的容器的状态 |
|
|
|
|
|
const last = target.children[dragIndex]; |
|
|
|
|
|
clearClass(last) |
|
|
|
|
|
dragged.style.cursor = 'default' |
|
|
|
|
|
|
|
|
|
|
|
console.log('ondrop--draggedIndex==', draggedIndex); |
|
|
|
|
|
console.log('ondrop--dragIndex==', dragIndex); |
|
|
|
|
|
|
|
|
|
|
|
const startId = _this.$refs['task_'+draggedIndex].dataset.taskId; |
|
|
|
|
|
const endId = _this.$refs['task_'+dragIndex].dataset.taskId; |
|
|
|
|
|
|
|
|
|
|
|
if (startId !== endId) { |
|
|
|
|
|
_this.changePmenuId(startId, endId) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
let clearClass = function (node) { |
|
|
|
|
|
if(node){ |
|
|
|
|
|
node.style.height = 'unset' |
|
|
|
|
|
node.style.backgroundColor = '#fff' |
|
|
|
|
|
} |
|
|
|
|
|
dragged.style.cursor = 'grabbing' |
|
|
|
|
|
} |
|
|
|
|
|
// if(last && form.menuId !== to.menuId && to.isFolder){ |
|
|
|
|
|
// // 移动文件/文件夹 |
|
|
|
|
|
// _this.copyOrMoveApi('move', form.menuId, to.menuId) |
|
|
|
|
|
// } |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
}, |
|
|
// 判断前后两个数据是否存在同一回路里面 |
|
|
// 判断前后两个数据是否存在同一回路里面 |
|
|
// dict 为字典;sId拖拽到menuId; ePmeuId 是放置位置的祖先 menuId; |
|
|
// dict 为字典;sId拖拽到menuId; ePmeuId 是放置位置的祖先 menuId; |
|
|
judgePmenuId(dict, sId, ePmeuId) { |
|
|
judgePmenuId(dict, sId, ePmeuId) { |
|
|
@ -1744,6 +1449,12 @@ |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
batchEditBack:function(needReload){ |
|
|
|
|
|
if(needReload==true){ |
|
|
|
|
|
this.searchXmTasks(); |
|
|
|
|
|
} |
|
|
|
|
|
this.batchEditVisible=false; |
|
|
|
|
|
} |
|
|
/**end 自定义函数请在上面加**/ |
|
|
/**end 自定义函数请在上面加**/ |
|
|
|
|
|
|
|
|
},//end methods |
|
|
},//end methods |
|
|
@ -1754,7 +1465,7 @@ |
|
|
xmSkillMng, |
|
|
xmSkillMng, |
|
|
skillMng, |
|
|
skillMng, |
|
|
xmProjectPhaseMng, |
|
|
xmProjectPhaseMng, |
|
|
xmTaskTemplateMng, XmProjectList,xmExchangeMng,xmMenuSelect,XmMenuRichDetail,XmGantt |
|
|
|
|
|
|
|
|
xmTaskTemplateMng, XmProjectList,xmExchangeMng,xmMenuSelect,XmMenuRichDetail,XmGantt,XmTaskMngBatch |
|
|
//在下面添加其它组件 |
|
|
//在下面添加其它组件 |
|
|
}, |
|
|
}, |
|
|
mounted() { |
|
|
mounted() { |
|
|
@ -1773,13 +1484,7 @@ |
|
|
,{categoryId:'all',itemCode:'priority'}]).then(res=>{ |
|
|
,{categoryId:'all',itemCode:'priority'}]).then(res=>{ |
|
|
this.options=res.data.data; |
|
|
this.options=res.data.data; |
|
|
}) |
|
|
}) |
|
|
}); |
|
|
|
|
|
// 阻止默认行为 |
|
|
|
|
|
document.body.ondrop = function (event) { |
|
|
|
|
|
event.preventDefault(); |
|
|
|
|
|
event.stopPropagation(); |
|
|
|
|
|
}; |
|
|
|
|
|
this.rowDrop(); |
|
|
|
|
|
|
|
|
}); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|