This commit is contained in:
parent
b2770044e0
commit
32e9f798da
|
@ -148,36 +148,35 @@
|
|||
<a-icon type="user"/>
|
||||
<span class="field-name">抄送人</span>
|
||||
</div>
|
||||
<div class="field-right">
|
||||
<div class="field-right field-flex">
|
||||
<div v-for="(co, index) in task.copied_list" :key="co.code" @click="spliceCopied(index)" class="field-flex" style="flex-wrap: wrap;">
|
||||
<a-avatar :src="co.avatar" icon="user" size="small"/>
|
||||
<a class="muted name">{{co.name}}</a>
|
||||
</div>
|
||||
<a-dropdown
|
||||
:trigger="['click']"
|
||||
v-model="visibleTaskMemberMenu"
|
||||
v-model="visibleTaskCopied"
|
||||
placement="bottomCenter"
|
||||
>
|
||||
<a-tooltip :mouseEnterDelay="0.5" >
|
||||
<template slot="title">
|
||||
<span>点击设置抄送人</span>
|
||||
</template>
|
||||
<div class="field-flex">
|
||||
<template v-if="task.executor">
|
||||
<a-avatar :src="task.executor.avatar" icon="user"
|
||||
size="small"/>
|
||||
<a class="muted name">{{task.executor.name}}</a>
|
||||
</template>
|
||||
<template v-if="!task.executor">
|
||||
<div class="field-flex" >
|
||||
<template>
|
||||
<a-avatar icon="user" size="small"/>
|
||||
<a class="muted name">未设置</a>
|
||||
<a class="muted name">添加抄送人</a>
|
||||
</template>
|
||||
</div>
|
||||
</a-tooltip>
|
||||
<div slot="overlay">
|
||||
<task-member-menu
|
||||
v-if="visibleTaskMemberMenu"
|
||||
v-if="visibleTaskCopied"
|
||||
:projectCode="projectCode"
|
||||
:isCommit="false"
|
||||
@inviteProjectMember="
|
||||
showInviteMember = true,
|
||||
visibleTaskMemberMenu = false"
|
||||
visibleTaskCopied = false"
|
||||
@close="changeRecipient"
|
||||
></task-member-menu>
|
||||
</div>
|
||||
|
@ -260,7 +259,7 @@
|
|||
<div class="field-flex" style="flex-wrap: wrap;">
|
||||
<template>
|
||||
<a-avatar icon="user" size="small"/>
|
||||
<a class="muted name">未设置</a>
|
||||
<a class="muted name">添加人员</a>
|
||||
</template>
|
||||
</div>
|
||||
</a-tooltip>
|
||||
|
@ -482,6 +481,7 @@
|
|||
pri: 0,
|
||||
priText: '普通',
|
||||
exchangeList: [], //流转
|
||||
copied_list: [], //抄送人
|
||||
},
|
||||
taskStatusList: COMMON.TASK_STATUS,
|
||||
taskLogList: [],
|
||||
|
@ -494,7 +494,7 @@
|
|||
visibleTaskMenu: false,
|
||||
|
||||
/*成员菜单*/
|
||||
visibleTaskMemberMenu: false,
|
||||
visibleTaskCopied: false,
|
||||
/*工作流转*/
|
||||
exchangeMenu: false,
|
||||
/*工单标签*/
|
||||
|
@ -703,9 +703,15 @@
|
|||
},
|
||||
// 选择抄送人
|
||||
changeRecipient(e){
|
||||
this.task.executor = e;
|
||||
let obj = this.task.copied_list.find(item=>item.code==e.code);
|
||||
if(!obj) this.task.copied_list.push(e);
|
||||
else notice({title:'已经设置过, 请更换其他人员'}, 'error', 3000)
|
||||
this.showInviteMember = false;
|
||||
this.visibleTaskMemberMenu = false;
|
||||
// this.visibleTaskCopied = false;
|
||||
},
|
||||
// 取消选择抄送人
|
||||
spliceCopied(index){
|
||||
this.task.copied_list.splice(index, 1);
|
||||
},
|
||||
// 选择流转人员
|
||||
changeExchange(e){
|
||||
|
@ -735,13 +741,44 @@
|
|||
})
|
||||
}
|
||||
},
|
||||
// 创建任务
|
||||
addTask(){
|
||||
this.createTask();
|
||||
return console.log(this.task);
|
||||
},
|
||||
// 创建任务
|
||||
createTask(){
|
||||
let task = JSON.parse(JSON.stringify(this.task));
|
||||
task.exchangeList = task.exchangeList.map(item=>{
|
||||
return item.code;
|
||||
})
|
||||
task.exchangeList = task.exchangeList.join(',');
|
||||
task.copied_list = task.copied_list.map(item=>{
|
||||
return item.code;
|
||||
})
|
||||
task.copied_list = task.copied_list.join(',');
|
||||
task.assign_to = "";
|
||||
// task.executor = task.executor.code;
|
||||
task.stage_code = this.$route.query.stage_code;
|
||||
task.project_code = this.$route.params.code;
|
||||
task.end_time = new Date(task.end_time).getTime();
|
||||
createTask(task).then(res=>{
|
||||
console.log(res);
|
||||
this.$emit('close', this.task);
|
||||
this.$router.push(`/project/space/task/${this.$route.params.code}?re=1&from=${this.$route.query.from}`);
|
||||
// this.$router.push(`/project/space/task/${this.$route.params.code}`);
|
||||
}).catch(err=>{
|
||||
notice({title: '创建失败'}, 'error', 5000);
|
||||
})
|
||||
},
|
||||
detailClose() {
|
||||
this.$emit('close', this.task);
|
||||
this.$router.push(`/project/space/task/${this.$route.params.code}?re=1&from=${this.$route.query.from}`);
|
||||
// this.$router.push(`/project/space/task/${this.task.project_code}`);
|
||||
},
|
||||
clearMemberMenu() {
|
||||
this.visibleTaskTagMenu = false;
|
||||
this.visibleTaskMemberMenu = false;
|
||||
this.visibleTaskCopied = false;
|
||||
this.showChildTask = false;
|
||||
},
|
||||
getTask() {
|
||||
|
@ -1013,10 +1050,6 @@
|
|||
}
|
||||
return false;
|
||||
},
|
||||
// 创建任务
|
||||
addTask(){
|
||||
console.log(this.task);
|
||||
},
|
||||
changeModalHeight() {
|
||||
const defaultWidth = this.width;
|
||||
let width = $(window).width() - 100;
|
||||
|
|
|
@ -119,6 +119,136 @@
|
|||
</div>
|
||||
<div class="task-basic-attrs-view muted">
|
||||
<div class="field-list" :class="{'disabled': task.deleted}">
|
||||
<div class="component-mount pink-bg">
|
||||
<div class="field">
|
||||
<div class="field-left">
|
||||
<a-icon type="file-text"/>
|
||||
<span class="field-name">工作内容</span>
|
||||
</div>
|
||||
<div class="field-right width-block">
|
||||
<div class="task-description" :class="{'disabled': task.deleted}"
|
||||
v-show="!showTaskDescriptionEdit"
|
||||
@click="showTaskDesc">
|
||||
<div class="description-txt img-preview-content" v-show="task.description"
|
||||
v-html="task.description"></div>
|
||||
<span v-show="!task.description">添加工作内容</span>
|
||||
</div>
|
||||
<div class="m-t-sm" v-if="hasMoreDesc">
|
||||
<a v-show="!showMoreDesc"
|
||||
@click="checkShowMoreDesc(true)">显示更多</a>
|
||||
<a v-show="showMoreDesc"
|
||||
@click="checkShowMoreDesc(false)">收起工作内容</a>
|
||||
</div>
|
||||
<div v-show="showTaskDescriptionEdit">
|
||||
<editor ref="vueWangeditor"
|
||||
id="editor"
|
||||
:uploadImgServer="editorConfig.uploadImgServer"
|
||||
:uploadImgHeaders="editorConfig.uploadImgHeaders"
|
||||
:menus="editorConfig.menus"
|
||||
></editor>
|
||||
<div class="action-btn pull-right">
|
||||
<a type="text" class="cancel-text muted"
|
||||
@click="showTaskDescriptionEdit = false,initContent(false)">
|
||||
取消
|
||||
</a>
|
||||
<a-button type="primary" htmlType='submit'
|
||||
class="middle-btn"
|
||||
@click="doContent">保存
|
||||
</a-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="component-mount">
|
||||
<div class="field">
|
||||
<div class="field-left">
|
||||
<a-icon type="calendar"/>
|
||||
<span class="field-name">完成期限</span>
|
||||
</div>
|
||||
<div class="field-right field-date">
|
||||
<template v-if="task.openBeginTime">
|
||||
<a-dropdown :trigger="['click']" v-model="showBeginTime"
|
||||
:disabled="!!task.deleted">
|
||||
<a-tooltip :mouseEnterDelay="0.5" v-if="!task.deleted">
|
||||
<template slot="title">
|
||||
<span>点击设置开始完成期限</span>
|
||||
</template>
|
||||
<div class="field-flex">
|
||||
<a class="muted name" style="margin: 0">
|
||||
<template v-if="!task.setBeginTime">设置开始完成期限
|
||||
</template>
|
||||
<template v-else>{{task.begin_time_format}}
|
||||
</template>
|
||||
</a>
|
||||
</div>
|
||||
</a-tooltip>
|
||||
<div class="field-flex" v-else>
|
||||
<a class="muted name" style="margin: 0">
|
||||
<template v-if="!task.setBeginTime">设置开始完成期限</template>
|
||||
<template v-else>{{task.begin_time_format}}</template>
|
||||
</a>
|
||||
</div>
|
||||
<div slot="overlay">
|
||||
<a-date-picker
|
||||
v-model="task.begin_time"
|
||||
size="small"
|
||||
format="MM月DD日 HH:mm"
|
||||
showTime
|
||||
allowClear
|
||||
:showToday="false"
|
||||
:open="showBeginTime"
|
||||
@ok="doBeginTime(true)"
|
||||
>
|
||||
<template slot="renderExtraFooter">
|
||||
<a style="position: absolute;" size="small"
|
||||
@click="doBeginTime(false)">清除</a>
|
||||
</template>
|
||||
</a-date-picker>
|
||||
</div>
|
||||
</a-dropdown>
|
||||
<span class="m-l-sm m-r-sm">-</span>
|
||||
</template>
|
||||
<a-dropdown :trigger="['click']" v-model="showEndTime"
|
||||
:disabled="!!task.deleted">
|
||||
<a-tooltip :mouseEnterDelay="0.5" v-if="!task.deleted">
|
||||
<template slot="title">
|
||||
<span>点击设置截止完成期限</span>
|
||||
</template>
|
||||
<div class="field-flex">
|
||||
<a class="muted name" style="margin: 0">
|
||||
<template v-if="!task.setEndTime">设置截止完成期限</template>
|
||||
<template v-else>{{task.end_time_format}}</template>
|
||||
</a>
|
||||
</div>
|
||||
</a-tooltip>
|
||||
<div class="field-flex" v-else>
|
||||
<a class="muted name" style="margin: 0">
|
||||
<template v-if="!task.setEndTime">设置截止完成期限</template>
|
||||
<template v-else>{{task.end_time_format}}</template>
|
||||
</a>
|
||||
</div>
|
||||
<div slot="overlay">
|
||||
<a-date-picker
|
||||
v-model="task.end_time"
|
||||
size="small"
|
||||
format="MM月DD日 HH:mm"
|
||||
showTime
|
||||
allowClear
|
||||
:showToday="false"
|
||||
:open="showEndTime"
|
||||
@ok="doEndTime(true)"
|
||||
>
|
||||
<template slot="renderExtraFooter">
|
||||
<a style="position: absolute;" size="small"
|
||||
@click="doEndTime(false)">清除</a>
|
||||
</template>
|
||||
</a-date-picker>
|
||||
</div>
|
||||
</a-dropdown>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="component-mount">
|
||||
<div class="field">
|
||||
<div class="field-left">
|
||||
|
@ -244,130 +374,114 @@
|
|||
<div class="component-mount">
|
||||
<div class="field">
|
||||
<div class="field-left">
|
||||
<a-icon type="calendar"/>
|
||||
<span class="field-name">时间</span>
|
||||
<a-icon type="user"/>
|
||||
<span class="field-name">抄送人</span>
|
||||
</div>
|
||||
<div class="field-right field-date">
|
||||
<template v-if="task.openBeginTime">
|
||||
<a-dropdown :trigger="['click']" v-model="showBeginTime"
|
||||
:disabled="!!task.deleted">
|
||||
<a-tooltip :mouseEnterDelay="0.5" v-if="!task.deleted">
|
||||
<template slot="title">
|
||||
<span>点击设置开始时间</span>
|
||||
</template>
|
||||
<div class="field-flex">
|
||||
<a class="muted name" style="margin: 0">
|
||||
<template v-if="!task.setBeginTime">设置开始时间
|
||||
</template>
|
||||
<template v-else>{{task.begin_time_format}}
|
||||
</template>
|
||||
</a>
|
||||
</div>
|
||||
</a-tooltip>
|
||||
<div class="field-flex" v-else>
|
||||
<a class="muted name" style="margin: 0">
|
||||
<template v-if="!task.setBeginTime">设置开始时间</template>
|
||||
<template v-else>{{task.begin_time_format}}</template>
|
||||
</a>
|
||||
</div>
|
||||
<div slot="overlay">
|
||||
<a-date-picker
|
||||
v-model="task.begin_time"
|
||||
size="small"
|
||||
format="MM月DD日 HH:mm"
|
||||
showTime
|
||||
allowClear
|
||||
:showToday="false"
|
||||
:open="showBeginTime"
|
||||
@ok="doBeginTime(true)"
|
||||
>
|
||||
<template slot="renderExtraFooter">
|
||||
<a style="position: absolute;" size="small"
|
||||
@click="doBeginTime(false)">清除</a>
|
||||
</template>
|
||||
</a-date-picker>
|
||||
</div>
|
||||
</a-dropdown>
|
||||
<span class="m-l-sm m-r-sm">-</span>
|
||||
</template>
|
||||
<a-dropdown :trigger="['click']" v-model="showEndTime"
|
||||
:disabled="!!task.deleted">
|
||||
<a-tooltip :mouseEnterDelay="0.5" v-if="!task.deleted">
|
||||
<div class="field-right field-flex" style="flex-wrap: wrap;pointer-events: none;">
|
||||
<div v-for="co in task.copied_info" :key="co.code" @click="spliceCopied(index)">
|
||||
<a-avatar :src="co.avatar" icon="user" size="small"/>
|
||||
<a class="muted name">{{co.name}}</a>
|
||||
</div>
|
||||
<a-dropdown
|
||||
v-if="false"
|
||||
:trigger="['click']"
|
||||
v-model="visibleTaskCopied"
|
||||
placement="bottomCenter"
|
||||
>
|
||||
<a-tooltip :mouseEnterDelay="0.5" >
|
||||
<template slot="title">
|
||||
<span>点击设置截止时间</span>
|
||||
<span>点击设置抄送人</span>
|
||||
</template>
|
||||
<div class="field-flex">
|
||||
<a class="muted name" style="margin: 0">
|
||||
<template v-if="!task.setEndTime">设置截止时间</template>
|
||||
<template v-else>{{task.end_time_format}}</template>
|
||||
</a>
|
||||
<div class="field-flex" >
|
||||
<template>
|
||||
<a-avatar icon="user" size="small"/>
|
||||
<a class="muted name">添加抄送人</a>
|
||||
</template>
|
||||
</div>
|
||||
</a-tooltip>
|
||||
<div class="field-flex" v-else>
|
||||
<a class="muted name" style="margin: 0">
|
||||
<template v-if="!task.setEndTime">设置截止时间</template>
|
||||
<template v-else>{{task.end_time_format}}</template>
|
||||
</a>
|
||||
</div>
|
||||
<div slot="overlay">
|
||||
<a-date-picker
|
||||
v-model="task.end_time"
|
||||
size="small"
|
||||
format="MM月DD日 HH:mm"
|
||||
showTime
|
||||
allowClear
|
||||
:showToday="false"
|
||||
:open="showEndTime"
|
||||
@ok="doEndTime(true)"
|
||||
>
|
||||
<template slot="renderExtraFooter">
|
||||
<a style="position: absolute;" size="small"
|
||||
@click="doEndTime(false)">清除</a>
|
||||
</template>
|
||||
</a-date-picker>
|
||||
<task-member-menu
|
||||
v-if="visibleTaskCopied"
|
||||
:taskCode="code"
|
||||
:projectCode="projectCodeCurrent"
|
||||
:isCommit="false"
|
||||
@inviteProjectMember="
|
||||
showInviteMember = true,
|
||||
visibleTaskCopied = false"
|
||||
@close="changeRecipient"
|
||||
></task-member-menu>
|
||||
</div>
|
||||
</a-dropdown>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="component-mount pink-bg">
|
||||
<div class="component-mount">
|
||||
<div class="field">
|
||||
<div class="field-left">
|
||||
<a-icon type="file-text"/>
|
||||
<span class="field-name">备注</span>
|
||||
<a-icon type="gateway"/>
|
||||
<span class="field-name">工作流转</span>
|
||||
</div>
|
||||
<div class="field-right width-block">
|
||||
<div class="task-description" :class="{'disabled': task.deleted}"
|
||||
v-show="!showTaskDescriptionEdit"
|
||||
@click="showTaskDesc">
|
||||
<div class="description-txt img-preview-content" v-show="task.description"
|
||||
v-html="task.description"></div>
|
||||
<span v-show="!task.description">添加备注</span>
|
||||
<div class="field-right field-flex" style="flex-wrap: wrap;">
|
||||
<div v-for="(exc, index) in task.exchange_info" :key="exc.code" style="pointer-events: none;">
|
||||
<a-dropdown
|
||||
:trigger="['click']"
|
||||
v-model="exc.show"
|
||||
placement="bottomCenter"
|
||||
>
|
||||
<a-tooltip :mouseEnterDelay="0.5" >
|
||||
<template slot="title">
|
||||
<span>更换人员</span>
|
||||
</template>
|
||||
<div class="field-flex" style="flex-wrap: wrap;align-items: center;">
|
||||
<a-avatar :src="exc.avatar" icon="user" size="small"/>
|
||||
<a class="muted name">{{exc.name}}</a>
|
||||
<a-icon type="double-right" v-if="index!=task.exchange_info.length-1" style="margin-right: 10px;"></a-icon>
|
||||
</div>
|
||||
</a-tooltip>
|
||||
<div slot="overlay">
|
||||
<task-member-menu
|
||||
v-if="exc.show"
|
||||
:taskCode="code"
|
||||
:projectCode="projectCodeCurrent"
|
||||
:isCommit="false"
|
||||
@inviteProjectMember="
|
||||
showInviteMember = true,
|
||||
exc.show = false"
|
||||
@close="changeExchangeShow"
|
||||
></task-member-menu>
|
||||
</div>
|
||||
</a-dropdown>
|
||||
</div>
|
||||
<div class="m-t-sm" v-if="hasMoreDesc">
|
||||
<a v-show="!showMoreDesc"
|
||||
@click="checkShowMoreDesc(true)">显示更多</a>
|
||||
<a v-show="showMoreDesc"
|
||||
@click="checkShowMoreDesc(false)">收起备注</a>
|
||||
</div>
|
||||
<div v-show="showTaskDescriptionEdit">
|
||||
<editor ref="vueWangeditor"
|
||||
id="editor"
|
||||
:uploadImgServer="editorConfig.uploadImgServer"
|
||||
:uploadImgHeaders="editorConfig.uploadImgHeaders"
|
||||
:menus="editorConfig.menus"
|
||||
></editor>
|
||||
<div class="action-btn pull-right">
|
||||
<a type="text" class="cancel-text muted"
|
||||
@click="showTaskDescriptionEdit = false,initContent(false)">
|
||||
取消
|
||||
</a>
|
||||
<a-button type="primary" htmlType='submit'
|
||||
class="middle-btn"
|
||||
@click="doContent">保存
|
||||
</a-button>
|
||||
<a-dropdown
|
||||
v-if="false"
|
||||
:trigger="['click']"
|
||||
v-model="exchangeMenu"
|
||||
placement="bottomCenter"
|
||||
>
|
||||
<a-tooltip :mouseEnterDelay="0.5" >
|
||||
<template slot="title">
|
||||
<span>添加工作流转人员</span>
|
||||
</template>
|
||||
<div class="field-flex" style="flex-wrap: wrap;">
|
||||
<template>
|
||||
<a-avatar icon="user" size="small"/>
|
||||
<a class="muted name">添加人员</a>
|
||||
</template>
|
||||
</div>
|
||||
</a-tooltip>
|
||||
<div slot="overlay">
|
||||
<task-member-menu
|
||||
v-if="exchangeMenu"
|
||||
:taskCode="code"
|
||||
:projectCode="projectCodeCurrent"
|
||||
:isCommit="false"
|
||||
@inviteProjectMember="
|
||||
showInviteMember = true,
|
||||
exchangeMenu = false"
|
||||
@close="changeExchange"
|
||||
></task-member-menu>
|
||||
</div>
|
||||
</div>
|
||||
</a-dropdown>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -410,330 +524,6 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="component-mount task-tag">
|
||||
<div class="field">
|
||||
<div class="field-left">
|
||||
<a-icon type="tag"/>
|
||||
<span class="field-name">标签</span>
|
||||
</div>
|
||||
<div class="field-right">
|
||||
<div class="inline-block">
|
||||
<a-tag :color="tag.tag.color" v-for="(tag,index) in task.tags"
|
||||
:key="index">
|
||||
{{tag.tag.name}}
|
||||
<a-icon type="close" @click="removeTag(tag.tag,index)"/>
|
||||
</a-tag>
|
||||
</div>
|
||||
<a-dropdown
|
||||
:trigger="['click']"
|
||||
v-model="visibleTaskTagMenu"
|
||||
:disabled="!!task.deleted"
|
||||
placement="bottomCenter"
|
||||
>
|
||||
<a-tooltip :mouseEnterDelay="0.5" v-if="!task.deleted">
|
||||
<template slot="title">
|
||||
<span>添加标签</span>
|
||||
</template>
|
||||
<div class="inline-block">
|
||||
<a-icon class="member-item invite" type="plus-circle"
|
||||
theme="twoTone"/>
|
||||
</div>
|
||||
</a-tooltip>
|
||||
<div class="inline-block">
|
||||
<a-icon class="member-item invite" type="plus-circle"
|
||||
theme="twoTone"/>
|
||||
</div>
|
||||
<div slot="overlay">
|
||||
<task-tag-menu
|
||||
v-if="visibleTaskTagMenu"
|
||||
:projectCode="projectCodeCurrent"
|
||||
:taskCode="code"
|
||||
@change="taskTagChange"
|
||||
@update="taskTagUpdate"
|
||||
@delete="taskTagDelete"
|
||||
></task-tag-menu>
|
||||
</div>
|
||||
</a-dropdown>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="component-mount">
|
||||
<div class="field">
|
||||
<div class="field-left">
|
||||
<a-icon type="bars"/>
|
||||
<span class="field-name">子任务 <span v-show="childTaskList.length"> · {{childTaskDoneNum}}/{{childTaskList.length}}</span></span>
|
||||
</div>
|
||||
<div class="field-right width-block">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="component-mount">
|
||||
<div class="field">
|
||||
<div class="block-field width-block">
|
||||
<div class="task-child">
|
||||
<div class="task-list" v-show="childTaskList.length">
|
||||
<div v-for="done in [0,1]" :key="done">
|
||||
<div
|
||||
v-for="(childTask, index) in childTaskList"
|
||||
:key="childTask.code">
|
||||
<div class="list-item task"
|
||||
v-if="childTask.done == done"
|
||||
>
|
||||
<a-tooltip placement="top">
|
||||
<template slot="title">
|
||||
<span v-if="childTask.parentDone"
|
||||
style="font-size: 12px;">父任务已完成,无法重做子任务</span>
|
||||
<span v-else-if="childTask.hasUnDone"
|
||||
style="font-size: 12px;">子任务尚未全部完成,无法完成父任务</span>
|
||||
</template>
|
||||
<div class="check-box-wrapper task-item"
|
||||
@click.stop="()=>{if(task.deleted || childTask.parentDone || childTask.hasUnDone) return false;taskDone(childTask.code,!childTask.done,index,'child')}">
|
||||
<a-icon class="check-box"
|
||||
:class="{'disabled': task.deleted || childTask.parentDone || childTask.hasUnDone}"
|
||||
:type="childTask.done ? 'check-square' : 'border'"
|
||||
:style="{fontSize:'16px'}"/>
|
||||
</div>
|
||||
<!--<a class="task-item check-box"
|
||||
:class="{'disabled': task.deleted || childTask.parentDone || childTask.hasUnDone}"
|
||||
@click="()=>{if(task.deleted || childTask.parentDone || childTask.hasUnDone) return false;taskDone(childTask.code,!childTask.done,index,'child')}">
|
||||
<a-icon type="check"
|
||||
v-show="childTask.done"/>
|
||||
</a>-->
|
||||
</a-tooltip>
|
||||
<a-dropdown :trigger="['click']"
|
||||
v-model="childTask.visibleChildTaskMemberMenu"
|
||||
:disabled="!!task.deleted"
|
||||
placement="bottomCenter"
|
||||
|
||||
>
|
||||
<a-tooltip :mouseEnterDelay="0.5">
|
||||
<template slot="title">
|
||||
<span v-if="childTask.executor">{{childTask.executor.name}}</span>
|
||||
<span v-else>待认领</span>
|
||||
</template>
|
||||
<a-avatar
|
||||
v-if="childTask.executor"
|
||||
class="task-item"
|
||||
:class="{'disabled': task.deleted}"
|
||||
|
||||
size="small"
|
||||
icon="user"
|
||||
:src="childTask.executor.avatar"
|
||||
></a-avatar>
|
||||
<a-avatar
|
||||
v-else
|
||||
class="task-item"
|
||||
:class="{'disabled': task.deleted}"
|
||||
|
||||
size="small"
|
||||
icon="user"
|
||||
></a-avatar>
|
||||
</a-tooltip>
|
||||
<div slot="overlay">
|
||||
<task-member-menu
|
||||
v-if="childTask.visibleChildTaskMemberMenu"
|
||||
:projectCode="projectCodeCurrent"
|
||||
:taskCode="childTask.code"
|
||||
:isCommit="true"
|
||||
@close="childTask.visibleChildTaskMemberMenu = false;getChildTasks();"
|
||||
@inviteProjectMember="
|
||||
showInviteMember = true,
|
||||
childTask.visibleChildTaskMemberMenu = false"
|
||||
></task-member-menu>
|
||||
</div>
|
||||
</a-dropdown>
|
||||
<!-- <a-tooltip :mouseEnterDelay="0.5">
|
||||
<template slot="title">
|
||||
<span v-if="childTask.executor">{{childTask.executor.name}}</span>
|
||||
<span v-else>待认领</span>
|
||||
</template>
|
||||
<a-avatar
|
||||
v-if="childTask.executor"
|
||||
class="task-item"
|
||||
:class="{'disabled': task.deleted}"
|
||||
|
||||
size="small"
|
||||
icon="user"
|
||||
:src="childTask.executor.avatar"
|
||||
></a-avatar>
|
||||
<a-avatar
|
||||
v-else
|
||||
class="task-item"
|
||||
:class="{'disabled': task.deleted}"
|
||||
|
||||
size="small"
|
||||
icon="user"
|
||||
></a-avatar>
|
||||
</a-tooltip>-->
|
||||
<div class="task-item task-title"
|
||||
@click.stop="init(childTask.code)">
|
||||
<div class="title-text"
|
||||
:class="{'done': childTask.done}"
|
||||
>
|
||||
{{childTask.name}}
|
||||
</div>
|
||||
</div>
|
||||
<a class="muted" @click.stop="init(childTask.code)">
|
||||
<a-icon class="task-item" type="right"/>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="task-list" v-show="showChildTask">
|
||||
<div class="add-task">
|
||||
<div class="list-item task">
|
||||
<span class="task-item check-box"></span>
|
||||
|
||||
<a-dropdown :trigger="['click']"
|
||||
v-model="visibleChildTaskMemberMenu"
|
||||
:disabled="!!task.deleted"
|
||||
placement="bottomCenter"
|
||||
|
||||
>
|
||||
<a-tooltip :mouseEnterDelay="0.5">
|
||||
<template slot="title">
|
||||
<span v-if="childExecutor">{{childExecutor.name}}</span>
|
||||
<span v-else>待认领</span>
|
||||
</template>
|
||||
<div class="field-flex">
|
||||
<template v-if="childExecutor">
|
||||
<a-avatar class="task-item"
|
||||
:src="childExecutor.avatar"
|
||||
icon="user"
|
||||
size="small"/>
|
||||
</template>
|
||||
<template v-if="!childExecutor">
|
||||
<a-avatar class="task-item"
|
||||
|
||||
icon="user"
|
||||
size="small"/>
|
||||
</template>
|
||||
</div>
|
||||
</a-tooltip>
|
||||
<div slot="overlay">
|
||||
<task-member-menu
|
||||
v-if="visibleChildTaskMemberMenu"
|
||||
:projectCode="projectCodeCurrent"
|
||||
:taskCode="childExecutor ? code : ''"
|
||||
:isCommit="false"
|
||||
@close="updateChildExecutor"
|
||||
@inviteProjectMember="
|
||||
showInviteChildTaskMember = true,
|
||||
visibleChildTaskMemberMenu = false"
|
||||
></task-member-menu>
|
||||
</div>
|
||||
</a-dropdown>
|
||||
<div class="task-item task-input">
|
||||
<a-input v-model="childTaskName"
|
||||
@pressEnter="createTask"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="action-btn text-right">
|
||||
<a type="text" class="cancel-text muted"
|
||||
@click="showChildTask = false">取消</a>
|
||||
<a-button type="primary" htmlType='submit'
|
||||
class="middle-btn"
|
||||
@click="createTask">保存
|
||||
</a-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<a-tooltip placement="top">
|
||||
<template slot="title">
|
||||
<span v-if="task.done" style="font-size: 12px;">父任务已完成,无法添加新的子任务</span>
|
||||
</template>
|
||||
<a class="add-handler"
|
||||
:class="{'disabled': task.done}"
|
||||
v-show="!showChildTask"
|
||||
@click="()=>{if (task.deleted || task.done) return false; showChildTask = true}">
|
||||
<a-icon type="plus" style="margin-right: 6px;"/>
|
||||
添加子任务
|
||||
</a>
|
||||
</a-tooltip>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="component-mount">
|
||||
<div class="field">
|
||||
<div class="field-left" style="width: 100%">
|
||||
<a-icon type="clock-circle"/>
|
||||
<span class="field-name">工时
|
||||
<span v-if="workTimeList.length"> · 实际工时 {{workTimeTotal}} 小时,工时记录 {{workTimeList.length}} 条,预估工时 {{task.work_time}} 小时 <a
|
||||
class="muted m-l-sm" @click="doPlainWorkTime">
|
||||
<a-icon class="task-item" type="edit"/>
|
||||
</a>
|
||||
</span>
|
||||
<span v-else>
|
||||
<span v-if="task.work_time"> · 预估工时 {{task.work_time}} 小时</span>
|
||||
<a-tooltip>
|
||||
<template slot="title">
|
||||
<span>设置预估工时</span>
|
||||
</template>
|
||||
<a class="muted m-l-sm" @click="doPlainWorkTime">
|
||||
<a-icon class="task-item" type="edit"/>
|
||||
</a>
|
||||
</a-tooltip>
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="component-mount">
|
||||
<div class="field">
|
||||
<div class="block-field width-block">
|
||||
<div class="task-child">
|
||||
<div class="task-list" v-show="workTimeList.length">
|
||||
<div
|
||||
v-for="(workTime, index) in workTimeList"
|
||||
:key="workTime.code">
|
||||
<div class="list-item task m-l-xs">
|
||||
<div class="task-item task-title hover-none">
|
||||
<div class="title-text"
|
||||
>
|
||||
<a-tooltip :mouseEnterDelay="0.5">
|
||||
<template slot="title">
|
||||
<span v-if="workTime.member">{{workTime.member.name}}</span>
|
||||
<span v-else>待认领</span>
|
||||
</template>
|
||||
<a-avatar
|
||||
class="task-item"
|
||||
size="small"
|
||||
icon="user"
|
||||
:src="workTime.member.avatar"
|
||||
></a-avatar>
|
||||
</a-tooltip>
|
||||
{{workTime.member.name}}
|
||||
{{moment(workTime.begin_time).format('MM月DD日 HH:mm')}}开始 工时为
|
||||
{{workTime.num}} 小时
|
||||
<div class="muted"
|
||||
v-show="workTime.content"
|
||||
style="padding-left: 40px;margin-top: 6px;">
|
||||
{{workTime.content}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<a class="muted" @click="doWorkTime(workTime)">
|
||||
<a-icon class="task-item" type="edit"/>
|
||||
</a>
|
||||
<a class="muted"
|
||||
@click="deleteWorkTime(workTime, index)">
|
||||
<a-icon class="task-item" type="delete"/>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<a-tooltip placement="top">
|
||||
<a class="add-handler" @click="doWorkTime(false)">
|
||||
<a-icon type="plus" style="margin-right: 6px;"/>
|
||||
添加工时
|
||||
</a>
|
||||
</a-tooltip>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="component-mount">
|
||||
<div class="field">
|
||||
<div class="field-left">
|
||||
|
@ -989,7 +779,7 @@
|
|||
<a-row :gutter="24">
|
||||
<a-col :span="12">
|
||||
<a-form-item
|
||||
label="开始时间"
|
||||
label="开始完成期限"
|
||||
>
|
||||
<a-date-picker
|
||||
showTime
|
||||
|
@ -1006,7 +796,7 @@
|
|||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item
|
||||
label="消耗时间"
|
||||
label="消耗完成期限"
|
||||
>
|
||||
<a-input
|
||||
type="text"
|
||||
|
@ -1014,7 +804,7 @@
|
|||
addonAfter="小时"
|
||||
v-decorator="[
|
||||
'num',
|
||||
{rules: [{ required: true, message: '请输入消耗时间' }], validateTrigger: 'change'}
|
||||
{rules: [{ required: true, message: '请输入消耗完成期限' }], validateTrigger: 'change'}
|
||||
]"
|
||||
>
|
||||
</a-input>
|
||||
|
@ -1148,6 +938,8 @@
|
|||
|
||||
/*成员菜单*/
|
||||
visibleTaskMemberMenu: false,
|
||||
/*抄送人菜单*/
|
||||
visibleTaskCopied: false,
|
||||
/*任务标签*/
|
||||
visibleTaskTagMenu: false,
|
||||
visibleProjectMemberMenu: false,
|
||||
|
@ -1161,7 +953,7 @@
|
|||
showBeginTime: false,
|
||||
showEndTime: false,
|
||||
|
||||
/*备注*/
|
||||
/*工作内容*/
|
||||
showTaskDescriptionEdit: false,
|
||||
showMoreDesc: false,
|
||||
hasMoreDesc: false,
|
||||
|
@ -1332,6 +1124,67 @@
|
|||
}
|
||||
},
|
||||
methods: {
|
||||
// 获取部门
|
||||
getDepartment(){
|
||||
getDepartment().then((res)=>{
|
||||
this.departmentList = res.data.list;
|
||||
})
|
||||
},
|
||||
// 选择部门
|
||||
departmentDropClick(e){
|
||||
let obj = this.departmentList.find(item=>item.code == e.key);
|
||||
this.department = obj;
|
||||
getliasonMan({
|
||||
searchType: 4,
|
||||
type: 1,
|
||||
departmentCode: obj.code
|
||||
}).then(res=>{
|
||||
if(res.data.list[0]) this.liasionMan = res.data.list[0];
|
||||
else notice({
|
||||
title: '该部门没有联络员',
|
||||
}, 'notice', 'error', 5)
|
||||
})
|
||||
},
|
||||
// 选择抄送人
|
||||
changeRecipient(e){
|
||||
let obj = this.task.copied_info.find(item=>item.code==e.code);
|
||||
if(!obj) this.task.copied_info.push(e);
|
||||
else notice({title:'已经设置过, 请更换其他人员'}, 'error', 3000)
|
||||
this.showInviteMember = false;
|
||||
// this.visibleTaskCopied = false;
|
||||
},
|
||||
// 取消选择抄送人
|
||||
spliceCopied(index){
|
||||
this.task.copied_info.splice(index, 1);
|
||||
},
|
||||
// 选择流转人员
|
||||
changeExchange(e){
|
||||
this.task.exchange_info.push({
|
||||
f_key: new Date().getTime(),
|
||||
show: false,
|
||||
...e
|
||||
})
|
||||
},
|
||||
// 替换流转人员
|
||||
changeExchangeShow(e){
|
||||
let index = this.task.exchange_info.findIndex(item=>item.show==true);
|
||||
if(index!=-1){
|
||||
this.task.exchange_info[index].show = false;
|
||||
let list = JSON.parse(JSON.stringify(this.task.exchange_info));
|
||||
if(e){
|
||||
list[index] = {
|
||||
f_key: new Date().getTime(),
|
||||
show: false,
|
||||
...e
|
||||
};
|
||||
}else {
|
||||
list.splice(index, 1)
|
||||
}
|
||||
this.$nextTick(()=>{
|
||||
this.task.exchange_info = list;
|
||||
})
|
||||
}
|
||||
},
|
||||
init(code = null, loading = true) {
|
||||
if (code) {
|
||||
this.code = code;//子任务
|
||||
|
|
|
@ -322,7 +322,7 @@
|
|||
</div>
|
||||
<!--添加任务按钮-->
|
||||
<div class="task-creator-handler-wrap" @click.stop="showTaskCard(index)"
|
||||
v-if="!stage.showTaskCard">
|
||||
v-if="!stage.showTaskCard&&false">
|
||||
<a class="task-creator-handler link-add-handler">
|
||||
<a-icon type="plus-circle" style="padding-right: 6px;"></a-icon>
|
||||
添加任务
|
||||
|
@ -769,6 +769,12 @@
|
|||
});
|
||||
}
|
||||
}
|
||||
if(to.query.re==1){
|
||||
let stage = this.taskStages[+to.query.from];
|
||||
getTasks({stageCode: stage.code}).then((res) => {
|
||||
console.log('----', res);
|
||||
});
|
||||
}
|
||||
},
|
||||
socketAction(val) {
|
||||
if (val.action === 'organization:task') {
|
||||
|
@ -1002,11 +1008,11 @@
|
|||
},
|
||||
// 添加任务
|
||||
addTask(stageCode, stageIndex){
|
||||
console.log('-----',stageCode);
|
||||
// console.log('-----',stageCode);
|
||||
this.task.stage_code = stageCode;
|
||||
this.task.project_code = this.code;
|
||||
this.task.assign_to = this.defaultExecutor.code;
|
||||
this.$router.push(`${this.$route.path}/add/${this.code}?from=${stageIndex}`);
|
||||
this.$router.push(`${this.$route.path}/add/${this.code}?from=${stageIndex}&stage_code=${stageCode}`);
|
||||
},
|
||||
//准备添加任务
|
||||
createTask(stageCode, stageIndex) {
|
||||
|
|
Loading…
Reference in New Issue