Browse Source

优化任务列表

master
陈裕财 5 years ago
parent
commit
ae10dc53c4
  1. 8
      src/views/xm/core/xmProject/XmProjectInfo.vue
  2. 2
      src/views/xm/core/xmProjectPhase/XmProjectPhaseMng.vue
  3. 701
      src/views/xm/core/xmTask/XmTaskMng.vue
  4. 1412
      src/views/xm/core/xmTask/XmTaskMngBatch.vue

8
src/views/xm/core/xmProject/XmProjectInfo.vue

@ -22,11 +22,19 @@
<el-radio-button label="合同管理"></el-radio-button>
<el-radio-button label="环境清单"></el-radio-button>
</el-radio-group>
<el-popover
placement="top-start"
title="更多操作"
width="400"
trigger="hover"
content="这是一段内容,这是一段内容,这是一段内容,这是一段内容。">
<el-button type="primary" @click="toArchive" round>论坛</el-button>
<el-button type="success" @click="toIm" round>即聊</el-button>
<el-button type="warning" @click="toHelpMe" round>客服</el-button>
<el-button type="primary" @click="handleExport" round v-if="exportArr.includes(infotype)">导出</el-button>
<el-button size="mini" slot="reference" icon="el-icon-more" circle></el-button>
</el-popover>
</div>
<div class="info-detail">
<xm-task-mng v-if="infotype=='任务'" ref="xmTaskMng" :sel-project="selProject" ></xm-task-mng>

2
src/views/xm/core/xmProjectPhase/XmProjectPhaseMng.vue

@ -29,7 +29,7 @@
<el-table ref="selectPhaseTable" v-show="simple==true" :data="projectPhaseTreeData" :show-summary="false" row-key="id" :tree-props="{children: 'children', hasChildren: 'hasChildren'}" @sort-change="sortChange" highlight-current-row v-loading="load.list" border @selection-change="selsChange" @row-click="rowClick" style="width: 100%;">
<el-table-column prop="phaseName" label="阶段名称" min-width="160" >
<template slot="header" slot-scope="scope">
<div>阶段名称 <el-tag sime="mini" v-if="editForm.id" closable @close="clearSelectPhase()">{{editForm.seqNo}}&nbsp;{{editForm.phaseName}}</el-tag></div>
<div>阶段名称 <el-tag size="mini" v-if="editForm.id" closable @close="clearSelectPhase()">{{editForm.seqNo}}&nbsp;{{editForm.phaseName}}</el-tag></div>
</template>
<template slot-scope="scope">
{{scope.row.seqNo}} &nbsp;&nbsp;{{scope.row.phaseName}}

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

@ -1,295 +1,188 @@
<template>
<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}}&nbsp;{{scope.row.name}}</el-link>
</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;">
<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}}&nbsp;{{scope.row.name}}</el-link>
</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>
<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>
</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>
<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>
</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>
</el-row>
<div style="margin-left: 5px;color: #d92b2f !important;color:#bb6f2a;">
{{calcTaskStateByTime(scope.row.startTime,scope.row.endTime)}}
</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-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-dialog
v-if="drawerVisible == true"
width="70%"
@ -443,6 +336,7 @@
import { getTask ,listXmTask,editXmTask,editRate, delXmTask, batchDelXmTask,batchImportTaskFromTemplate,batchSaveBudget } from '@/api/xm/core/xmTask';
import XmTaskAdd from './XmTaskAdd';//
import XmTaskEdit from './XmTaskEdit';//
import XmTaskMngBatch from './XmTaskMngBatch';//
import { mapGetters } from 'vuex';
import headEditor from '../components/headEditor';
import xmExecuserMng from '../xmTaskExecuser/XmTaskExecuserMng';
@ -527,21 +421,18 @@
return len;
},
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);
})
}
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();
}
const tasksTreeData = this.translateDataToTree(xmTasks);
return tasksTreeData;
},
@ -1293,56 +1184,11 @@
}
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){
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(row.startTime && row.endTime){
@ -1563,147 +1409,6 @@
this.filters.selProject=null;
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, -1table
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 sIdmenuId; ePmeuId menuId;
judgePmenuId(dict, sId, ePmeuId) {
@ -1744,6 +1449,12 @@
}
}
},
batchEditBack:function(needReload){
if(needReload==true){
this.searchXmTasks();
}
this.batchEditVisible=false;
}
/**end 自定义函数请在上面加**/
},//end methods
@ -1754,7 +1465,7 @@
xmSkillMng,
skillMng,
xmProjectPhaseMng,
xmTaskTemplateMng, XmProjectList,xmExchangeMng,xmMenuSelect,XmMenuRichDetail,XmGantt
xmTaskTemplateMng, XmProjectList,xmExchangeMng,xmMenuSelect,XmMenuRichDetail,XmGantt,XmTaskMngBatch
//
},
mounted() {
@ -1773,13 +1484,7 @@
,{categoryId:'all',itemCode:'priority'}]).then(res=>{
this.options=res.data.data;
})
});
//
document.body.ondrop = function (event) {
event.preventDefault();
event.stopPropagation();
};
this.rowDrop();
});
}
}

1412
src/views/xm/core/xmTask/XmTaskMngBatch.vue
File diff suppressed because it is too large
View File

Loading…
Cancel
Save