This commit is contained in:
weipengfei 2024-01-05 19:01:49 +08:00
parent 61a88398a7
commit b2770044e0
6 changed files with 249 additions and 59 deletions

View File

@ -4,6 +4,7 @@
"private": true, "private": true,
"scripts": { "scripts": {
"serve": "vue-cli-service serve", "serve": "vue-cli-service serve",
"dev": "vue-cli-service serve",
"build": "vue-cli-service build", "build": "vue-cli-service build",
"lint": "vue-cli-service lint" "lint": "vue-cli-service lint"
}, },

View File

@ -75,6 +75,10 @@ export function resume(accountCode) {
return $http.post('project/account/resume', {accountCode: accountCode, status: 1}); return $http.post('project/account/resume', {accountCode: accountCode, status: 1});
} }
export function liaisonMan(data) {
return $http.post('project/account/set_liaison_man', data);
}
export function doAccount(data) { export function doAccount(data) {
let url = 'project/account/add'; let url = 'project/account/add';
if (data.code) { if (data.code) {

View File

@ -23,6 +23,48 @@
</div> </div>
<div class="task-basic-attrs-view muted"> <div class="task-basic-attrs-view muted">
<div class="field-list"> <div class="field-list">
<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 description-txt-con 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="component-mount">
<div class="field"> <div class="field">
<div class="field-left"> <div class="field-left">
@ -100,47 +142,6 @@
</div> </div>
</div> </div>
</div> </div>
<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 description-txt-con 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="component-mount">
<div class="field"> <div class="field">
<div class="field-left"> <div class="field-left">
@ -151,7 +152,6 @@
<a-dropdown <a-dropdown
:trigger="['click']" :trigger="['click']"
v-model="visibleTaskMemberMenu" v-model="visibleTaskMemberMenu"
placement="bottomCenter" placement="bottomCenter"
> >
<a-tooltip :mouseEnterDelay="0.5" > <a-tooltip :mouseEnterDelay="0.5" >
@ -173,11 +173,12 @@
<div slot="overlay"> <div slot="overlay">
<task-member-menu <task-member-menu
v-if="visibleTaskMemberMenu" v-if="visibleTaskMemberMenu"
:projectCode="projectCodeCurrent" :projectCode="projectCode"
:taskCode="code" :isCommit="false"
@inviteProjectMember=" @inviteProjectMember="
showInviteMember = true, showInviteMember = true,
visibleTaskMemberMenu = false" visibleTaskMemberMenu = false"
@close="changeRecipient"
></task-member-menu> ></task-member-menu>
</div> </div>
</a-dropdown> </a-dropdown>
@ -187,17 +188,94 @@
<div class="component-mount"> <div class="component-mount">
<div class="field"> <div class="field">
<div class="field-left"> <div class="field-left">
<a-icon type="user"/> <a-icon type="apartment"/>
<span class="field-name">处理部门</span> <span class="field-name">处理部门</span>
</div> </div>
<div class="field-right"> <div class="field-right">
<!-- <a-dropdown <a-dropdown>
<template #overlay>
<a-menu class="field-right-menu" slot="overlay" @click="departmentDropClick">
<a-menu-item :key="item.code" v-for="item in departmentList">
<div class="menu-item-content">
<a-tag>{{item.name}}</a-tag>
<a-icon type="check" class="check muted"
v-show="item.code == department.code"></a-icon>
</div>
</a-menu-item>
</a-menu>
</template>
<div>
<span v-if="department.name">{{ department.name }} / {{ liasionMan.name }}</span>
<span v-else>选择部门</span>
</div>
</a-dropdown>
</div>
</div>
</div>
<div class="component-mount">
<div class="field">
<div class="field-left">
<a-icon type="gateway"/>
<span class="field-name">工作流转</span>
</div>
<div class="field-right field-flex" style="flex-wrap: wrap;">
<div v-for="exc in task.exchangeList" :key="exc.f_key">
<a-dropdown
:trigger="['click']" :trigger="['click']"
v-model="visibleTaskMemberMenu" 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" style="margin-right: 10px;"></a-icon>
</div>
</a-tooltip>
<div slot="overlay">
<task-member-menu
v-if="exc.show"
:projectCode="projectCode"
:isCommit="false"
@inviteProjectMember="
showInviteMember = true,
exc.show = false"
@close="changeExchangeShow"
></task-member-menu>
</div>
</a-dropdown>
</div>
<a-dropdown
:trigger="['click']"
v-model="exchangeMenu"
placement="bottomCenter" placement="bottomCenter"
> >
<a-tooltip :mouseEnterDelay="0.5" >
</a-dropdown> --> <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"
:projectCode="projectCode"
:isCommit="false"
@inviteProjectMember="
showInviteMember = true,
exchangeMenu = false"
@close="changeExchange"
></task-member-menu>
</div>
</a-dropdown>
</div> </div>
</div> </div>
</div> </div>
@ -353,6 +431,8 @@
import {notice} from "@/assets/js/notice"; import {notice} from "@/assets/js/notice";
import {relativelyTaskTime, relativelyTime} from "@/assets/js/dateTime"; import {relativelyTaskTime, relativelyTime} from "@/assets/js/dateTime";
import {checkResponse} from "../../assets/js/utils"; import {checkResponse} from "../../assets/js/utils";
import {list as getDepartment} from "../../api/department";
import {list as getliasonMan} from "../../api/user";
import { import {
_taskWorkTimeList, delTaskWorkTime, _taskWorkTimeList, delTaskWorkTime,
editTaskWorkTime, editTaskWorkTime,
@ -400,7 +480,8 @@
projectCodeCurrent: '', projectCodeCurrent: '',
task: { task: {
pri: 0, pri: 0,
priText: '普通' priText: '普通',
exchangeList: [], //
}, },
taskStatusList: COMMON.TASK_STATUS, taskStatusList: COMMON.TASK_STATUS,
taskLogList: [], taskLogList: [],
@ -414,6 +495,8 @@
/*成员菜单*/ /*成员菜单*/
visibleTaskMemberMenu: false, visibleTaskMemberMenu: false,
/*工作流转*/
exchangeMenu: false,
/*工单标签*/ /*工单标签*/
visibleTaskTagMenu: false, visibleTaskTagMenu: false,
showInviteMember: false, showInviteMember: false,
@ -489,7 +572,11 @@
}, },
// //
showMentions: false, showMentions: false,
mentionsList: [] mentionsList: [],
projectCode: '', //
departmentList: [], //
department: {}, //
liasionMan: {}, //
} }
}, },
computed: { computed: {
@ -559,6 +646,9 @@
created() { created() {
}, },
mounted() { mounted() {
this.getDepartment();
// console.log('router', this.$route);
this.projectCode = this.$route.params.code;
this.$nextTick(()=>{ this.$nextTick(()=>{
this.changeModalHeight(); this.changeModalHeight();
}) })
@ -590,6 +680,61 @@
} }
}, },
methods: { 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){
this.task.executor = e;
this.showInviteMember = false;
this.visibleTaskMemberMenu = false;
},
//
changeExchange(e){
this.task.exchangeList.push({
f_key: new Date().getTime(),
show: false,
...e
})
},
//
changeExchangeShow(e){
let index = this.task.exchangeList.findIndex(item=>item.show==true);
if(index!=-1){
this.task.exchangeList[index].show = false;
let list = JSON.parse(JSON.stringify(this.task.exchangeList));
if(e){
list[index] = {
f_key: new Date().getTime(),
show: false,
...e
};
}else {
list.splice(index, 1)
}
this.$nextTick(()=>{
this.task.exchangeList = list;
})
}
},
detailClose() { detailClose() {
this.$emit('close', this.task); this.$emit('close', this.task);
// this.$router.push(`/project/space/task/${this.task.project_code}`); // this.$router.push(`/project/space/task/${this.task.project_code}`);

View File

@ -954,7 +954,7 @@
</a-spin> </a-spin>
<invite-project-member v-model="showInviteMember" :project-code="projectCodeCurrent" <invite-project-member v-model="showInviteMember" :project-code="projectCodeCurrent"
v-if="showInviteMember"></invite-project-member> v-if="showInviteMember"></invite-project-member>
<a-modal <!-- <a-modal
class="work-time-modal" class="work-time-modal"
v-model="workTimeDo.modalStatus" v-model="workTimeDo.modalStatus"
:title="workTimeDo.modalTitle" :title="workTimeDo.modalTitle"
@ -1037,8 +1037,8 @@
</a-col> </a-col>
</a-row> </a-row>
</a-form> </a-form>
</a-modal> </a-modal> -->
<a-modal <!-- <a-modal
v-model="plainWorkTime.modalStatus" v-model="plainWorkTime.modalStatus"
:title="plainWorkTime.modalTitle" :title="plainWorkTime.modalTitle"
:bodyStyle="{paddingBottom:'1px'}" :bodyStyle="{paddingBottom:'1px'}"
@ -1064,7 +1064,7 @@
</a-input> </a-input>
</a-form-item> </a-form-item>
</a-form> </a-form>
</a-modal> </a-modal> -->
</div> </div>
</template> </template>

View File

@ -18,7 +18,7 @@
<a-avatar icon="user"></a-avatar> <a-avatar icon="user"></a-avatar>
</div> </div>
<div class="ant-list-item-meta-content"> <div class="ant-list-item-meta-content">
<h4 class="ant-list-item-meta-title"><span>待认领</span></h4> <h4 class="ant-list-item-meta-title"><span>未设置</span></h4>
</div> </div>
</div> </div>
<ul class="ant-list-item-action"> <ul class="ant-list-item-action">

View File

@ -154,6 +154,7 @@
}} }}
</router-link> </router-link>
<a-tag class="m-l-sm" v-if="item.is_owner">拥有者</a-tag> <a-tag class="m-l-sm" v-if="item.is_owner">拥有者</a-tag>
<a-tag class="m-l-sm" v-if="item.is_liaison_man">{{item.departments}}联络员</a-tag>
</div> </div>
<div slot="description"> <div slot="description">
<!--<a-tooltip :mouseEnterDelay="0.3" :title="item.create_time">--> <!--<a-tooltip :mouseEnterDelay="0.3" :title="item.create_time">-->
@ -164,6 +165,18 @@
</div> </div>
</a-list-item-meta> </a-list-item-meta>
<template v-if="!item.is_owner"> <template v-if="!item.is_owner">
<a class="muted" slot="actions" v-if="item.is_liaison_man==0"
@click="setLiasionMan(item,0)">
<a-tooltip title="设置为联络员">
<a-icon type="usergroup-add"/>
</a-tooltip>
</a>
<a class="muted" slot="actions" v-else
@click="setLiasionMan(item,1)">
<a-tooltip title="取消联络员">
<a-icon type="usergroup-delete"/>
</a-tooltip>
</a>
<a class="muted" slot="actions" v-if="item.status == 0" <a class="muted" slot="actions" v-if="item.status == 0"
@click="resumeAccount(item,index)"> @click="resumeAccount(item,index)">
<a-tooltip title="启用账号"> <a-tooltip title="启用账号">
@ -198,7 +211,7 @@
import inviteDepartmentMember from '../../components/project/inviteDepartmentMember' import inviteDepartmentMember from '../../components/project/inviteDepartmentMember'
import createDepartment from '../../components/project/createDepartment' import createDepartment from '../../components/project/createDepartment'
import {list} from "../../api/department"; import {list} from "../../api/department";
import {del, forbid, list as getMembers, resume} from "../../api/user"; import {del, forbid, list as getMembers, resume, liaisonMan} from "../../api/user";
import pagination from "../../mixins/pagination"; import pagination from "../../mixins/pagination";
import {checkResponse, getApiUrl, getAuthorization, getUploadUrl} from "../../assets/js/utils"; import {checkResponse, getApiUrl, getAuthorization, getUploadUrl} from "../../assets/js/utils";
import {notice} from "../../assets/js/notice"; import {notice} from "../../assets/js/notice";
@ -431,6 +444,33 @@
} }
}); });
}, },
setLiasionMan(item, type){ //
let app = this;
this.$confirm({
title: `您确定要${type==0?'':'取消'}设置${item.name}${item.departments}的联络员吗?`,
content: ``,
okText: '确认',
okType: 'primary',
cancelText: '再想想',
onOk() {
liaisonMan({
member_code: item.member_code,
type: type==0?1:0
}).then((res) => {
if (!checkResponse(res)) {
return;
}
notice({title: type==0?'设置联络员成功':'取消联络员成功'}, 'notice', 'success');
app.members.forEach((e)=>{
if(e.member_code==item.member_code){
e.is_liaison_man = type==0?1:0;
}
})
});
return Promise.resolve();
}
});
},
resumeAccount(member, index) { resumeAccount(member, index) {
let app = this; let app = this;
this.$confirm({ this.$confirm({